How to auto zoom and auto center Google Maps
This post discusses how to auto center and auto zoom a Google Map to display all of the markers optimally.
In order to get accomplish this, you have to calculate the center point and zoom level manually via code. Fortunately this is pretty easy to do, you just need to calculate the minimum and maximum latitude/longitude of all of your markers and then get the center point of the resulting area (which will be a rectangle). (more…)
Bookmark on del.icio.usCool new C# 3.0 syntactic sugar
I was recently reading a post on MSDN blogs by Abhinaba Basu about a new feature in C# 3.0 and Visual Studio 2008 (Orcas)—Automatic Properties.
Coming from a Visual Basic background, I never really understood why C# forces you to do some things the hard way, even when it knows by itself what you meant to do, and it could have done it for you in the first place. (more…)
Bookmark on del.icio.usDitch POP3 and start using IMAP
I was recently introduced to IMAP by a friend. I was aware of IMAP for a very long time, but I never got around to actually using it. We turned to IMAP because had to answer support emails for a website collaboratively without using a ticket system.
Overview of IMAP
Although IMAP was supposed to be the natural successor of POP3, most email servers these days still use POP3. Regular internet users are not very familiar with IMAP, because, as with every new technology, there is a slight learning curve to it. (more…)
Bookmark on del.icio.usOwner-drawing a Windows.Forms TextBox
This article describes how SharpSpell is able to modify existing TextBox controls to display wavy red underlines below misspelled words.
Here’s an image to demonstrate what I mean:

(This image is borrowed from SharpSpell, but you get the point) (more…)
BlogRush and how to get targeted visitors for your blog
You may have noticed the new From the Blogosphere widget on the sidebar, here’s what this is all about.
What is BlogRush?
BlogRush is a new service by John Reese (an Internet marketing guru—I hate the term guru this will be my first and last time using it) which is kind of like a MLM scheme for traffic building.
When I first heard “MLM” I was kind of suspicious too, and I’m pretty sure most of you are as well, but here’s the thing with BlogRush: (more…)
Bookmark on del.icio.usVacation in Crete
Sorry for not posting anything this last week, me and my coworkers and friends at Tachyon Labs have been on vacation in Crete, Greece.
Accomodation
We stayed at the Santa Marina hotel in Ammoudara. The conditions were pretty good and the staff was wonderful. There were two fellow Romanians working at the hotel for the summer, and we also met lots of other Romanian people working at shops, pubs and clubs in Iraklion and Hersonissos.
Hersonissos is where it’s at if you’re young and want to have fun, it’s basically the youth town of Crete and the night life hot spot. Ammoudara is a bit quieter and relaxing, catering better for a family vacation.
Trip to Hersonissos
Two days into the vacation we rented a car so we could go to Hersonissos (yes, we’re not nerds, we’re all still pretty young and we like to have fun), and this was pretty interesting. I was the one to drive, and a friend was guiding me using a map that we got from our hotel reception. (more…)
Bookmark on del.icio.usCalling a Windows Service from ASP.NET via Remoting & IpcChannel
I recently had to design a Windows Service that connects to several game servers via UDP, gathers stats, and then updates a MSSQL database.
These stats were then made available in real-time on a web-site written in C# and ASP.NET.
Before Remoting
For the first version of the application, the web-site and Windows Service were completely independent. The web-site would just query the database and determine, or make a best guess about what was going on inside the Windows Service at that exact time. This worked pretty good, and although the database is now about 1GB in size and growing fast, I optimized it good enough for this to work in real-time without a hitch.
There was some caching going on, thanks to the OutputCache directive in ASP.NET, but surprisingly enough there were no performance issues.
After Remoting
All right, so because I needed to display some extra information about ‘online’ users, that the Windows Service knew about, but the database didn’t, I decided to have a look at .NET Remoting. This was my first time working with it.
These were the issues I experienced (as a Remoting newbie) when rewriting the Windows Service to be accessible via .NET Remoting: (more…)
Bookmark on del.icio.usGoogle Web Toolkit and ASP.NET?
Now that Google’s Web Toolkit is out of beta, I’m looking at ways of integrating it somehow with C# and ASP.NET.
First of all, if you don’t know what Google Web Toolkit is, here’s a quickie: it is a framework for creating Web 2.0 AJAX Web Applications using the Java language, preferably inside an Integrated Development Environment (IDE) such as Eclipse. You then compile this from Java to HTML/JavaScript using the provided tools, and you have a desktop application-like web-page without knowing anything about the W3C DOM, HTML or JavaScript.
What does this have to do with C#?
Well, don’t get me wrong, the ASP.NET AJAX Toolkit is amazing, but being able to visually design a page and use JavaScript behaviors and AJAX from inside an IDE is a step forward.
It seems that Nikhil Kothari from Microsoft is working on a C# to JavaScript compiler, called Script#, as a side project of his. Unfortunately, Script# is not currently supported by Microsoft, and they are really losing ground on the AJAX field because of this. They should promote this to a corporate project, I would love having that same power that GWT has, but directly in the Visual Studio IDE. (more…)
Bookmark on del.icio.usGreen Marinee Wide WordPress Theme
While looking around trying to find a theme for this blog I came across the great Green Marinee Theme theme by Ian Main .
The theme has one flaw:
While I’m pretty sure that back in 2005 screen resolutions such as 800×600 were still common, in today’s world the theme is just too narrow for a big screen display, and too much space is lost.
This is especially a problem with a blog such as mine because I frequently use code samples, and lines can get pretty long.
My update:
So, I decided to keep the theme, but I modified it to make it exactly 200 pixels wider. I also added a Latest Posts display to the right navigation bar to improve the overall usability, and more importantly: Widget Support (more…)
Bookmark on del.icio.usGenerating a transparent GIF image using C#
Problem:
There is apparently no easy way to generate a transparent GIF image using the .NET framework. Microsoft provided a method in the Bitmap class called MakeTransparent() but it doesn’t work for GIFs, it only seems to work for PNGs.
To create a transparent GIF you need to recreate the color table of the image using Imaging APIs, as detailed in this KB article . Unfortunately, this can be pretty slow for an ASP.NET Web application, and it has a lot of overhead, so I needed an alternative. (more…)
Bookmark on del.icio.us