Crazy Feed

MSDN subscribers have two choices when it comes to getting new software. Either you will visit MSDN site every few days to see what is new or you will subscribe to their feed. Logic would dictate that MSDN feed should be preferred way of doing this - every time something new arrives you get notification in your RSS reader.

Because of some idiotic programming MSDN feed is worse than useless. For example today I had total of 370 of new items in my feed. Those are probably quite a same items that were available yesterday when I had around 200 items. Or day before that when another 200 ended up in my reader. Who knows, maybe there was some new software inside. I haven’t got a clue since I was too lazy to read everything.

I am not sure why this happens - I am too lazy to investigate thoroughly. And no, it is not a RSS reader’s fault since no other feed exhibits such behavior. My guess would be that missing GUID and pubDate that keeps on changing are one to blame. Without unique GUID for each item it is very difficult for any program to say what remains same and what is really different.

It would be easy for Microsoft to fix RSS feed but they haven’t in last three years so I am not holding my breath. After all, they never said that developer’s satisfaction is their priority.

P.S. As I wrote this, I noticed another 300+ waiting…

Azure Java

Another presentation is done. Materials can be accessed here. Do notice that PowerPoint slides are in Croatian. Fortunately, Java code is in English. :)

P.S. You will need your own Azure account to run HelloBlob project.

P.P.S. Applications are available here and here. Unfortunately, I only have few days on account left so don’t expect it being there forever.

Not the Funniest Joke I've Ever Told (To a Three-year-old)

Illustration

This is last time I retell joke that Raymond Chen recommends. He wrote that most funniest joke to tell to three/four year old is:

There were two kittens walking down the street, and one of them fell on its butt!

Maybe something got lost in translation (since I did use Croatian to tell this joke). Maybe I am just not that good at telling jokes. Maybe I have children that are too much into bad cop / good cop style of questioning. All I know is that it took me a while to escape:

  • Why kitten fell?
  • Where was their mommy?
  • What did it brake?
  • Were they crying?

And list goes on and on. There was no laughter but there were questions. And since I brought subject up I had to answer them all. Those with kids know how long this “Why?” game can last…

You might be good with all Windows peculiarities Mr. Raymond but this is last time I take joke advice from you. :)

Not Your Normal Random

Illustration

When I test with random data I usually tend to use normal distribution. This particular time I didn’t want that. I wanted to simulate sensor readings and that means that I cannot have values going around all willy-nilly. I wanted sensors to read their default value most of time with occasional trips to edge areas. This is code I ended up with:

private static double GetAbnormalRandom() {
    double rnd = Rnd.NextDouble();
    double xh = 0.5 - rnd;
    double xs = xh * xh * 2;
    double x = 0.5 + Math.Sign(xh) * xs;
    if (x < 1) { return x; } else { return 0.5; }
}

2) This is just standard random number. Minimum value is 0 and maximum is LOWER than 1 (it can also be written as [0,1)).

3) I than moved this number to minimum of -0.5 and maximum lower than 0.5 ([-0.5,0.5)).

4) In order to maximize our mean value, I decided upon square function. It gives us number ranging from 0 to less than 0.5 (0.52 gives 0.25 and multiplication by 2 moves this back to 0.5).

5) Everything could stop here sine I have my distribution already available in step 4. However, I wanted to get everything back into [0,1) range. It is just matter of adding 0.5 to whatever number we got in step 4. Sign operation is here to ensure that half of numbers go to less than 0.5 and half of them go above.

6) Of course all this math is causing rounding to our floating point numbers. In rare occasions that can cause our step 4 to generate positive range number that is equal to 0.5. It is very rare (approximately 1 in 1000000) and we can just add it in middle.

And this is it. Function will most probably return values around 0.5 with sharp drop in probability for values further toward edge (see graph).

For full code alongside some statistics you can download source code.