Saturday, January 24, 2009

All I could think of for the first two minutes was...CSS! :)
Bookmark and Share Saturday, January 24, 2009 8:45:24 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [4]  
 Thursday, January 22, 2009

There are few reasons to have your code log extensive error/debug messages. One of them is to help with debugging issues on a remote (or worse, production) environment. Here are some tips to help you get the most out of this kind of logging:

Log Actual Values

With a well placed log message you will be able to easily pinpoint the line of code where the problem occurred. Now you're left staring at that line of code and trying to guess what caused the error. This will be so much easier if you include in the log message the actual run-time values that your code worked with. This includes stuff like the parameters to the method, fields of the class, session values etc.

Log at Component Boundaries

A component can be a different .net assembly, code that resides in a different logical layer of your application, a third-party library or a piece of code you communicate with using anything than just a method call (like HTTP or WCF). Wherever there's communication between two components, there are bound to be "wiring bugs". Because most components are well thought-out and tested on a standalone basis, it is very useful to know what data was exchanged to help with debugging the issue. Always log all parameter values, both on the client (caller) side and the server (called) side.

Log at Organization/Responsibility Boundaries

This is a slight variation on the previous suggestion. Whenever a call is made to a piece of code owned by another person or group, you should log all parameter values. When you walk across the hall to ask the owner of that code about the bug you're trying to fix, the first thing they'll ask you is what are the exact values you're sending in.

Bookmark and Share Thursday, January 22, 2009 10:58:45 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [0]  
 Saturday, December 20, 2008

The good: Leonardo DiCaprio is "star power" defined. Holding the movie up in the air all by himself. Even though, a hint of one-sidedness is noticeable (Danny Archer from "Blood Diamond", Billy Costigan from "The Departed" and Roger Ferris from "Body of Lies" are all the same guy, really).

The bad: Alon Abutbul is the ultimate in Israeli terrorist-portraying technology.

Comic relief: Simon McBurney as the one-man-show homosexual secret black-ops branch of the CIA run out of the woods (the C-I-Gay).

The girl: Golshifteh Farahani as the mysteriously-beautiful-Persian is not mysteriously beautiful at all (but Persian nonetheless).

Believability: CIA agents shooting people on the streets of Amman are as low-key as a teenager playing GTA on crack.

Bottom line: Good flick. Well written, played and directed.

Bookmark and Share Saturday, December 20, 2008 7:54:20 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [1]  
 Friday, November 21, 2008

The FIFA ranking system is used to determine the seeding of national teams for various international competitions. It is considered absolutely broken by every football fan. For example, the Israeli national team is currently ranked 15th(1) in the world, while Sweden, for example, is only 29th. Enough said.

I decided to look into the method used by FIFA to determine the rankings, in order to understand why the system is so obviously broken and whether it can be fixed. To save you reading the detailed explanation in the Wikipedia article above, the method, in broad terms, goes like this:
1. For each game played by a given team, award the team a point amount using the formula:
Amount = [result points] X [match status] X [opposition strength] X [regional strength].
We'll look into the specifics soon.
2. Take then average of all the Amount values for all the games played by the team in the last year. This average is the score used to determine the rankings.
(In fact, the last four years are taken into account, but this isn't important to our discussion)

"Regional strength" doesn't have much effect relatively to the other factors, so lets ignore it.
"Result points" is 3 points for victory, 2 for victory in penalty shootout, 1 for draw or loss by penalty shootout and 0 for defeat.

So, where's the problem? The problem is the "match status" and "opposition strength" factors.

Opposition Strength

Here's how the opposition strength factor is calculated:
(200 - [opposition team ranking position]) / 100
(If the result is less than 0.5 - the value 0.5 is used)
The logic is this - there are about 200 teams in the ranking, so, when playing the best team, you'll get a strong bonus (200-1)/100=2. The bonus will be less and less significant the lower the opposing team is ranked, and starting at number 101, you'll actually be punished. For example for playing the 120th team the factor will be (200-120)/100=0.8.

The problem is that this formula ignores a simple but important truth: the best teams are much much stronger than all the rest. There are about 20 national sides that are consistently reaching the knockout stages of important international competitions and providing the star players to all the top clubs.
However, with FIFA's method, you will get a very high factor (of 1.6) for beating, for example, a team like Lithuania or Northern Ireland, ranked 41th and 42th respectively. These two teams aren't much better than South Africa (80th) or Austria (92th).
A quick fix that comes to mind is to take the square of the formula. This will "spread out" the factor a bit. You will get a factor of ( (200-10)/100 ) ^ 2 = 3.61 for playing the 10th ranked team, but only ( (200-50)/100 ^ 2 ) = 2.25 for playing the 50th ranked team.

Match Status

Match status is supposed to express the truth that a match that is played in an important competition like the World Cup is contested much more heavily than just a friendly game.
The way FIFA expresses this in the calculation is to assign a value of 1 to a friendly, 2.5 to a qualification match, 3 for a regional cup (like the Euro) and 4 to the World Cup. This value is used as a factor in the multiplication used to calculate the score for a specific match played by a team.
Lets assume that beating world champions Italy is worth 500 points. Then beating Italy in a Euro qualification match would be worth 1250 points and beating them in a friendly 500 points. So far so good.
But remember that to calculate the rating FIFA takes the average of the points assigned to the team in the last 12 months. So, for example, if a team plays 3 matches, beating Italy once in a Euro qualification match and twice in a friendly, this team's rating for the year will be:
(1250 + 500 + 500) / 3 = 750
However, if the same team beats Italy in two more friendlies in that year, the rating will go down to:
(1250 + 500 + 500 + 500 + 500) / 5 = 650
Effectively, the ranking system punishes you for victories in friendly games.

The correct way would be not using the match status in the points calculation for a single match but rather using it to calculate a weighted average. This way, in the previous example, the rating will not be hurt by beating one of the best teams in the world in a friendly:
(500 * 2.5 + 500 * 1 + 500 * 1 + 500 * 1 + 500 * 1) / (2.5 + 1 + 1 + 1 + 1) = 500
But also, an important match will have more influence on the overall rating. For example if a team plays 3 matches, with scores of 500, 700 and 700, when the latter two are friendlies and the former is a qualification match, the rating will be:
(500 * 2.5 + 700 * 1 + 700 * 1) / (2.5 + 1 + 1) = 588
Closer to the result in the important game than to the unimportant ones, as desired.

Unfortunately, I am sure the nice people at FIFA are wisely spending their attention on expensive women and liquor, instead of on silly math.

Bookmark and Share Saturday, November 22, 2008 12:55:06 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [3]  



Infectious, the car-art start up company, now has also laptop art which is insanely cool. I just wish it didn't cost 50 bucks to ship to Israel :(

Bookmark and Share Friday, November 21, 2008 10:48:51 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [2]  



The new Guns N' Roses album, "Chinese Democracy", which was in work for 15 years, is finally up on MySpace.

Yeeeeees!!!

Bookmark and Share Friday, November 21, 2008 10:38:54 PM (Jerusalem Standard Time, UTC+02:00)  #    Comments [0]  
 Tuesday, November 18, 2008



Made with toondoo

Bookmark and Share Wednesday, November 19, 2008 12:26:56 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [2]  
 Sunday, November 16, 2008

Yes, forgot to mention, I can now be seen pimping my writing to Israel's leading online restaurants site, rest.co.il.
(Hebrew only)
Some examples are here and here.

Bookmark and Share Sunday, November 16, 2008 7:57:44 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [0]  
 Friday, November 14, 2008

Bookmark and Share Friday, November 14, 2008 9:15:54 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [4]  
 Wednesday, October 29, 2008

Being a long-time and proud member of the "Russian Jews United" group on Facebook, I have found the following message waiting in my inbox today:


Single? Need a fresh start?

Try:
http://www.rajeusa.com/rajemate/survey.php

Nice service for nice people.

Gary Linkov


Well, Gary, I don't believe we've met, but that's really...nice. Thank you.

"I am single! I do need a fresh start!", I thought.
Nice people?? That is me!!

With thoughts of beautiful Jewish girls with rich daddies, I immediately clicked on the link and landed on the "RAJE" homepage:



Wow! That's a lot of details just to start. Okay:
RAJE: Last name?
Bitz: Bitz.
R: First name?
B: Pasha.
R: Hebrew Name if any?
B: Hmm, Hebrew name? Mmm, Pasha? No, mm, ahem, I don't know! Please let me date Jewish chicks!!
R: Ethnicity (Ashkenazi / Sephardic / Bucharian / Gorsky)?
B: Woah, that's specific! You're really not for mixing them up, are you? And Bucharian is like a whole category in itself? Do they pray westwards? And what is "Gorsky"? I searched Delver, which is the limit of my knowledge, and didn't find anything. Do you mean to ask whether I'm the dead Soviet spy? Well, I am not!
R: Would like to date only (Doesn't matter / Ashkenazi / Sephardic / Bucharian / Gorsky)?
B: Look, I don't really want to restrict myself. As long as the father is really loaded, I mean. Well, what the hell, I like trying out new stuff. Gorsky!
R: Are you a Cohen?
B: No. Are you a Cohen?
R: Practicing Judaism (High holidays only / Some Shabbats / Kashrus / Other)?
B: Practicing? I don't need to practice baby, I'm already GOOD. But I like the way you American Jews make everything sound cool. Kashrus. Doesn't sound like "can't eat anything" at all!
By the way, RAGE, how come you don't ask me if I'm a boy or a girl? Do you sort of assume I am a horny male? Nice.
R: Would you relocate?
B: Hell yeah!
R: Do you want to move to Israel?
B: Move to Israel?? What? I am marrying you for the Green Card baby! No Israel. I want the dollars!
R: Hair covering after marriage?
B: What? Hair covering? Where? That's a little personal, don't you think?
R: Kipa?
B: Nope.
R: Tzitzit?
B: No. Wait! I have a kipa somewhere! I use it about once a year or so. Though it's usually kind of sad and involves someone dying.
R: Jewish education?
B: Oh yeah! Betzefer Mitzpe!!!
R: Describe in words, your family's religious background if any?
B: In words? Okay. My father is Jewish. My mother is Jewish. Their parents are Jewish too. They say they had to get really good grades in school because back in the USSR they would only let a few Jews into University. I don't remember anything particular about religion. But seriously - your father will LOVE me. I am sure. I'll pretend I like McCain!!!
R: Personality traits:
(Insecure/Nervious) B: Aren't we all? Jewish, remember?
(Argumentative) B: Hmm, not really.
(Intellectual) B: Hell yes, I am a regular Karl-fucking-Marx!
(Low maintenance) B: I see where you're going. Lets say 100K a year from your father will do. I don't need much.
R: Reference (non-family)?
B: Oooh, you're taking this seriously. It's like I am applying for a job. Okay, okay. My army commander, good?

Bookmark and Share Thursday, October 30, 2008 4:57:25 AM (Jerusalem Standard Time, UTC+02:00)  #    Comments [2]