ailon's DevBlog: Development related stuff in my life

?? operator in C#

11/14/2007 11:24:00 AM

As embarrassing as it sounds I somehow missed the "new" ?? operator and Nullable types (int?, etc.) in C# 2.0. It helps preserve my self-esteem a little that ScottGu thought that this was new in C# 3.0 too. :)

Tags: ,

Good News for Flash Developers & Co.

11/9/2007 10:54:20 AM

Back in April 2006, we made a change to how Internet Explorer handled embedded controls used on some webpages. Some sites required users to “click to activate” before they could interact with the control. Microsoft has now licensed the technologies from Eolas, removing  the “click to activate” requirement in Internet Explorer. Because of this, we're removing the “click to activate” behavior from Internet Explorer!
IEBlog: IE Automatic Component Activation (Changes to IE ActiveX Update)

Tags: ,

File Encoding in Visual Studio

11/5/2007 3:43:02 PM

It appears that there's no way to set default file encoding for new files created in Visual Studio 2005 through "Options" and it will save your files in UTF only if it encounters characters it can't save in your systems default non-unicode locale.

What does it mean? It means that if you develop a simple web site in a language of your system (Lithuanian in my case) and you hardcode some local text in your .aspx it will save in non-unicode encoding (Windows-1257 in my case) and when you move it to the server (or other computer) with other default non-unicode encoding all your localized text will be ruined.

What can be done about it? It looks like we have 3 options:

  1. manually save or re-save your files using "Save with Encoding";
  2. change your system language to "English" in control panel (this is kind of wrong);
  3. re-save Visual Studio templates (in Common 7\IDE\ItemTemplates) in UTF-8 with signature

Only the last option somewhat solves the problem but you'll have to go through all of the templates you ever plan to use and hope that this doesn't break anything.

Hopefully this issue will be addressed in VS2008. I had no time to play with the betas yet, so I have no idea if there are any changes in this area. Can anybody confirm this?

Tags: , , ,


11/1/2007 7:02:41 PM

Today I was playing with Gmail's IMAP implementation and Outlook 2007/Pocket Outlook. As a result (not counting a couple of known issues that will hopefully be fixed soon) I can read email in native clients on my work PC/laptop, PDA/Phone and use Web UI elsewhere (like wife's PC, daughter's PC, mistress's Mac ;). And all my read/unread/deleted mail will be in sync without additional efforts on my side (fingers crossed).

My next thought was: I want the same for my RSS! I used RSS Bandit back in the day when online RSS readers sucked. But synchronizing read/unread items between work and home PCs was pain in the ass and I didn't even read my feeds on my phone back then. So I moved to Bloglines, then to Google Reader, now back to Bloglines (beta). But it would be super cool if I could use desktop RSS reader when on my own PC and web-based reader when elsewhere and this wouldn't require jumping over my head to keep all the feeds and read/unread items in sync.

Creating such a protocol (let's call it IFAP) is not a very difficult task. The difficult part is making it de-facto standard so that both online and offline readers support it and writing/hosting IFAP servers. And this is a task that only someone like Google or Microsoft can pull. Or probably some very ambitious and aggressive startup. Not me, unfortunately.

So, if you have balls of steel (or just happen to work for Google) and you like the idea, please, oh please, implement it. You can count me in as your alpha-tester.

Tags: , , ,

TortoiseSVN installation

10/23/2007 9:52:44 AM

For quite some time TortoiseSVN was shouting that I have to upgrade my installation cause I used a version which apparently had a security hole. After refusing to comply for some time I finally gave up. I've downloaded and installed version TortoiseSVN 1.4.5, Build 10425 which to my surprise, among other apps, required that I "exit" Windows Explorer!

I've killed all the "reasonable" applications it required but refused to do the same with Explorer and hit "Ignore". After the reboot TortoiseSVN couldn't launch stating (or was it Windows?) that "The application has failed to start because its side-by-side configuration is incorrect."

I needed to work with SVN badly, so I ran tortoise's installer again and ordered it to repair my installation. No surprise it asked again that I kill Windows Explorer. This time I complied (no matter how crazy this might seem) and it went "smoothly". I wonder when my whole system is going to crash...

I wonder if this is Vista-only issue or everyone has to kill Windows Explorer to install TortoiseSVN? Sounds completely nuts to me.

Tags: , , ,


10/13/2007 4:44:12 PM

I've just discovered the existence of SET NULL option for ON DELETE/ON UPDATE clauses in Oracle. Yes, I'm stupid. No idea in which version this first appeared but there's still no way to set this through GUI in Enterprise Manager Console (as far as I know). However you can set this through code or via GUI in Oracle SQL Developer.

This could be very handy when you have some columns referencing other tables but the data in this columns is of not critical importance. For instance you may have user id of the person who last edited some article stored in the table but if you delete the user (and you are sure about this) you don't want that value preventing your operation. Earlier I just didn't create foreign key on such fields, resulting in ghost values. Now I can just add ON DELETE SET NULL to foreign key declaration and the problem is solved.

Btw, this is also available in MS SQL Server 2005 (not in 2000) along with SET DEFAULT. I can hardly think what is the possible use for SET DEFAULT. Hard-coding the value for referenced field!? Doesn't sound very useful to me. But who am I? If it's there then probably someone needs it.

Tags: , , ,

You Snooze, You Loose

10/13/2007 7:28:00 AM

It looks like someone has released almost exact "clone" of what was supposed to be my first Windows Mobile application. I'll have to come up with some other idea for practicing WM development.


Windows Vista SideShow + Windows Mobile 6 = No Love

10/12/2007 10:42:04 AM

Sometimes I kind of don't understand Microsoft. Windows Vista was released like a year ago and Windows Mobile 6 was released this year and still there's no support for SideShow in WM6. And what is the first device that comes to mind as Vista PC companion device? If asked this question in the middle of the night I would immediately answer - PocketPC.

I would really like to have WMP "Now playing" information and controls on my HTC Touch docked next to my main monitor. And you can probably think of more useful applications.

Do divisions at Microsoft actually talk to each other?

kick it on

Tags: , , ,


10/8/2007 8:10:08 PM

consolas I'm very slow on customizing my environment. I can do things the hard way for months before I force myself to make a small tweak that makes life much easier. No wonder I used Visual Studio (and PSPad for that matter) with default "Courier New" font and didn't even know that Vista comes with a special monospace, ClearType fine-tuned font family called Consolas. You can download it for XP, too.

Hopefully this will make the long development hours ahead a little bit easier on my eyes.

You can find samples and download links for other popular "developer fonts" through this article.

Tags: , , ,

If It Ain't Broke, Don't Fix It

10/8/2007 11:01:54 AM

The telling is as true as ever. Update to Windows Mobile Device Center was hanging for some time in optional Windows Vista Updates on my computer and I finally decided to install it this weekend. Installation went smoothly but this morning I found out that my HTC Touch couldn't connect to computer or vice versa. And there was an error in Application Event Log saying: "Windows Mobile-based USB device is plugged in but is unable to make a network connection to the desktop."

I tried many things including rebooting both phone and computer, dropping the partnership, plugging device to a different port, enabling and disabling firewalls, etc. Finally I decided that it was about time to google. After several unhelpful links I found this thread in Microsoft's forums and this post in particular saying:

Settings - Connections - Usb to PC - uncheck the "Enable advanced network functionality".  Disconnect device and connect back up.  Recognized it immediately

I didn't even have to unplug the device. It was recognized immediately and everything (as far as I noticed) started working. No idea, though, what functionality I lost disabling that "advanced network functionality". Go figure...

Tags: , , ,

Copyright © 2003 - 2018 Alan Mendelevich
Powered by BlogEngine.NET