Google Sync - Now With Push

Illustration

Google Sync had support for synchronizing both contacts and calendar events over ActiveSync for quite a while now. Finally support is extended to e-mail account.

Instead of IMAP account that gets “pulled” for updates every X minutes, real “push” e-mail is supported. This both speeds up process of getting actual e-mails and decreases cost since TCP/IP traffic is almost non-existent when there is no new e-mail waiting.

Whole thing integrates perfectly into Windows Mobile as direct replacement for Exchange Server and only thing still missing is support for tasks. I am sure that this is coming sometime in the future.

French Toast - My Way

Illustration

One of comfort foods of my childhood was simple stale bread dipped in eggs. Nearest description of it would be french toast. However, while french toast is mostly on sweet side of equation, I will give you salty variant here.

Since almost always I make this from old bread, all calculations are based on amounts needed for one half of loaf. Be aware that this measurements are only approximate since I usually do it in free-style.

First ingredient would be egg. You will need four of them. After I use fork to break eggs and make rough mix I add some water to mix. Six table spoons should be enough. Water just makes eggs less dense so we can add some flour to make it denser (two topped table spoons are good measure). I find this very necessary since without flour bread will soak too much oil. Do not forget to add some salt here.

Heat up the pan and put one centimeter of oil inside. I put knob on mark 3 (out of 6). I would call this a low-temperature setting.

Slice bread in one centimeter slices and dip it inside of egg mixture. Keep it in for ten seconds, pull it out, and then dip other side. Ten seconds is just approximate guess since it highly depends on mixture density and type and age of bread.

After dipping, throw it in pan. Keep in pan until bottom is bright yellow-brown and then flip it to other side. When both sides are done, just put it on some paper to soak excess oil. My cooking time is usually in range of two minutes per side.

After few minutes on paper, it is ready to be served. More often than not, I make this late in night and eat it only in morning since it tastes good cold also.

Modifications

I like to add bell pepper (red works best for me) to mix. Just slice it in small-small pieces before putting it in egg mixture. Quarter of paprika is more than enough. If this is not intended for kids or weaklings, you may add chilli pepper also. One should be enough per batch.

Most common modification to this is dipping bread in milk before putting it to egg mixture. While this will make it softer and it will make step of adding water and flour unnecessary, it will also make it taste different. I prefer to skip this.

Null-coalescing Operator

In my code there is lot of checks like this:

...
if (text == null) {
    text = "Some default value";
}

With C# this line can be written as:

...
text = text ?? "Some default value";

This will definitely make code shorter and while I use strings here, it is not limited to them. Any object will do.

Most of time I find this syntax less readable than first example. Part is probably because I am not used to it and part is definitely because of those question marks (??). Somehow they make me uneasy.

However, it is great help in your database layer when you need to get some value out of nullable type:

int count = dbCount ?? 0;

Once you need to set ten fields to defaults if their value is null, you learn to appreciate it.

Password Hint

Illustration

During installation of Windows 7 there is one point where you get asked for password. Thing that did surprise me is the fact that it requires password hint to be filled. While I do see use and benefit of it, especially for accounts that are used only occasionally, I cannot understand why that hint was made required parameter.

Even worse, if you chose not to have password and add it only later, password hint is not mandatory any more. Seems like a little inconsistency to me.

Shutdown Event Tracker

I have dual-boot installation of Windows Server 2008 R2 in order to play with Hyper-V. I run it only occasionally and thus I am quite annoyed with shutdown event tracker. While I can understand benefits in normal scenarios, it is quite unnecessary for test installations.

Problem here is that there is no obvious check-box that would disable it. However, Group policy comes to rescue.

Open Start menu and select Run (or hit ) and type gpedit.msc. Press OK and that should open Local group policy.

Go to “Computer Configuration” > “Administrative Templates” > “System” and on right side you should see “Display Shutdown Event Tracker”. It’s common state is “Not configured”. That configuration will cause server OS (Windows Server 2008 R2) to display it while client OS (Windows 7) will not.

Setting this value to “Disabled” removes this annoyance.