Destination IUnknown http://www.hadianto.net/destination/ Mostly on .NET, Java, Blogosphere, software development and other techie stuff by Victor Hadianto en 2008-02-21T09:47:55+10:00 Moving http://www.hadianto.net/destination/archives/2008/02/moving.html Yes ... this blog has been discontinued. The new version is located here: http://www.hadianto.net/destinationv2

]]>
vhadiant 2008-02-21T09:47:55+10:00
vhshost.exe Mystery http://www.hadianto.net/destination/archives/2008/01/vhshostexe_myst.html Have you been wondering what the vshost.exe file is for? You'll notice this when you start working with Visual Studio 2005. Basically this is the file that is used by VS 2005 to optimise the debugging performance and should not be deployed in production environment.

dtemp has a good outline here:

http://blogs.msdn.com/dtemp/archive/2004/08/17/215764.aspx

]]>
.NET vhadiant 2008-01-22T21:22:12+10:00
Essential SQL Server Date Function http://www.hadianto.net/destination/archives/2007/08/essential_sql_s.html This is really useful:

Essential SQL Server Date, Time and DateTime Functions

I've always find out strange to work with date and time in SQL Server, it just feel so ... unnatural. The aforementioned link list the important date & time function in SQL Sever. Goodness :)

]]>
Coding vhadiant 2007-08-02T20:57:49+10:00
The "Wow" Ended Yesterday http://www.hadianto.net/destination/archives/2007/05/the_wow_ended_y.html That's it, after putting up with Vista just over a month I've reformatted my laptop back to Windows XP. Vista may look pretty, and don't get me wrong, my beefed-up DELL XPS M1710 (2gb RAM, Intel Core 2 Duo T 7400) has enough juice to run Vista ... for home user that is.

Unfortunately, I'm not a typical home computer or business laptop user. I'm a developer and use my laptop for home development etc. Running Vista is putting extra strain that I don't need. I've put up with it for a while before deciding it ain't worth it. On top of that I have a few more grief with Vista:

- It's too damn chatty. Dialog boxes keep popping out asking me to do something. It's annoying. There's gotta be a way to turn this off.

- Windows Media Player (WMP) stutters near the end of the song. Something that I can't figure out how to fix yet, at the last few seconds of a song, WMP seems to have problem playing back and it introduces a couple of second of "WMP remix".

- WMP takes aaaages to move from one track to another if you force it to move.

- Heavy disk access. Vista seems to keep reading/writing the disk all the time. I've turned off indexing and disk IO is still noticeably (much) higher than XP.

- No nVidia driver for Vista just yet. nVidia hasn't released the GeForce Go 7800/7900 driver for Vista.

- It tries too hard (to be smart that is). There should be a "I know what I'm doing" option that will automatically set everything to "Advanced" mode. For example, not allowing you to do "select all" in read-only and protected folders is probably a life safer for some, but totally annoying for me.

Is it all doom for Vista then? I don't think so. For a start it's very good looking bordering MAC OS X' sexiness. Compare Vista to XP side-by-side you'll notice the big jump in UI.

Also most of my grief above can be attributed to my type of user (developer). A typical home user who use the computer for simple internet/email, games, simple Word & Excel will probably benefit for Vista's new features and the rather harsh safety options. I for one will wait until I absolutely have to upgrade to Vista.

]]>
Tech vhadiant 2007-05-16T20:10:29+10:00
Fixing AVG after Vista upgrade http://www.hadianto.net/destination/archives/2007/04/fixing_avg_afte.html After the upgrade of my Dell's XPS M1710 to Windows Vista, AVG stopped working. It keeps complaining that my key is not valid, which is strange since it's a free product.

Initially I thought this was a simple problem, simply uninstall then re-install. Well I was wrong, it turned out to be quite serious and common problems. Despite following suggestions from AVG forums which other people seemed to be quite successful, I can't uninstall AVG. Downloading a new executable, run as Admin, uninstall doesn't work. Installing it over the existing install also doesn't work too well.

Simply put, I should have uninstalled AVG before upgrading to Vista. Anyway I thought I was screwed and need to reinstall Vista from scratch, kinda a drastic method. I'd rather not.

Well the solution turned out to be quite simple. Suddenly I realised what if I supplied AVG with a new and valid license? So if you double click AVG's installation, just before the install starts it'll show you the license (generated I presume) for you. So copy that license into a notepad. Reboot Vista, AVG will complain about the license thingy. Paste the license that you took down earlier and voila, it's all good.

]]>
Tech vhadiant 2007-04-12T19:55:11+10:00
Battling VSTO's SerializationException: Type is not resolved for ... http://www.hadianto.net/destination/archives/2007/02/battling_vstos.html I've just won half a day battle with VSTO's SerializationException. The actual error turned out to be a red-herring, that was what giving me such a grief (not to mention that this is my first day of cutting down my daily coffee intake)

This is the background of the problem as I posted in MSDN forum earlier today:


I'm currently at loss with this current problem. This is the scenario: I have several c# libraries (all strongly named) in my solution. This solution processes data and serialised the result into a MS SQL Server database.

From my VSTO project (using VB.NET) I tried to access the database and deserialise the result back into my object. Everything works until the moment of deserialisation where I get the SerializationException: Type is not resolved for member ...

I have a test project that accesses the database and deserialise my object and it is working perfectly fine, so I'm certain that the serialisation/deserialisation code is working, but just not within VSTO framework.

Now this error is suspiciously related to way VSTO is run by Excel. I spent ages trying to figure out what went wrong since all the assemblies are available and loaded properly. I even tried strong naming all the assemblies.

I almost gave up before fortunately helped arrived from this thread. Basically it gave me the idea of hooking to AppDomain's AssemblyResolve event to find out if there is a problem. Yes there was, but in a completely different assembly than the one that was in the exception message!

Apparently this is a common problem when .NET is hosted by an external application. Often the virtual machine has difficulties loading assemblies. For example your project requires assembly A and A requires assembly B, normally you only need to add reference to A and the virtual machine will be able to load assembly B automatically, but not with VSTO. The solution is to strong reference (add the reference from Visual Studio's add reference dialog box) the assemblies, and voila, everything works ... half a day later.

]]>
.NET vhadiant 2007-02-05T20:53:52+10:00
Using command line to install Windows Service http://www.hadianto.net/destination/archives/2006/11/using_command_l.html This usefull command is not the most intuitive command. The sc command allows you to install/delete Windows Services. I have used this nifty command quite often in the past project to remove erroneous Windows Service. Microsoft has a good KB article.

Things to watch out is the escaping of the binPath. If there are spaces in your binPath you must escape it using the " character which must be escaped again using the \ character.

For example:

c:\sc create MyService binPath= "\"c:\program files\my service\service.exe\""

]]>
Tech vhadiant 2006-11-07T20:57:43+10:00
BackgroundWorker class http://www.hadianto.net/destination/archives/2006/10/backgroundworke.html This .NET 2.0 new class is one of the most usefull class in .NET 2.0 threading class library. This simplifies creating a new background thread from your WinForm application. Here you can safely update the GUI control without marshalling and it also provide you with built in cancellation method.

A good article about this class is available here. Don't I wish that this class is available in .NET 1.x, this would have saved me heaps of ground work in GUI projects.

]]>
.NET vhadiant 2006-10-12T18:12:35+10:00
New photo gallery http://www.hadianto.net/destination/archives/2006/10/new_photo_galle.html Phew after four months on the road, I finally have a bit of time to do some website maintenance. First thing first is to migrate all my photos into the new Coppermine based gallery. I installed Coppermine just before I left for my trip, it is pretty powerful and customisable engine.

So migrated the photos, added the Creative Commons copyright and that's pretty much it. I still need to tweak bits and pieces of it, but I'm quite pleased that it's been working really well. This is my third attempt at online photo album heh, hopefully this Coppermine will stay for a while.

]]>
Tech vhadiant 2006-10-02T17:44:17+10:00
On a holiday http://www.hadianto.net/destination/archives/2006/06/on_a_holiday.html I'm currently travelling for the next few months. If you want to follow my adventure go to my Someone Misspelt Pigeon blog.

]]>
vhadiant 2006-06-12T12:12:10+10:00
Google Maps does Sydney http://www.hadianto.net/destination/archives/2006/05/google_maps_doe.html Woohoo, Google Maps now includes Sydney and NSW in general. It's very impressive! However I still couldn't get Google Maps to locate my address. I tried several different permutations and still nothing. I tried big landmarks such as 366 George St in the city and still no luck. Maybe they haven't implement the mapping engine 100%, but it's already looking very impressive. All the roads are there, even the backroads.

This is already looking so much better than crappy Whereis mapping engine. When Google add the direction engine I can't see any reason why I would want to use Whereis.

Update: Wrong info, Google actually puts Australia on the map not just NSW.

]]>
Internet vhadiant 2006-05-19T18:36:07+10:00
Comment spam bonanza http://www.hadianto.net/destination/archives/2006/05/comment_spam_bo.html It seems that MovableType's basic comment spam defense is working. All spams are neatly tucked in the "Junk Comment" tab while two spams escaped the junk comment rating.

I need to put more anti-spam plug-ins to buff up the defense. Unfortunately I couldn't get the CAPTCHA plug-in to work. With this current anti-spam measure those spam still made it to the system, I'd like it to not enter the system at all if I can help it.

]]>
MovableType vhadiant 2006-05-04T19:58:40+10:00
Upgrading MovableType (for real this time) http://www.hadianto.net/destination/archives/2006/05/upgrading_movab_1.html Not happy with my previous upgrade attempt since it pretty much destroys all the existing files I tried another MovableType 3.2 upgrade attempt. This time it's much more successful.

You can pretty much disregard the instruction on MovableType website for "upgrading" MovableType installation. This is what you need to do:

1) Backup everything, including your MovableType's database. I'm using BerkeleyDB so it's very easy for me.
2) Extract MovableType's tar.gz file into a new directory
3) Fix your mt-config.cgi. For me there are only two (yes two) settings that I need to fix. The path for my new MT 3.2 install and the location of the datasource. Point the datasource to the old MT 3.1x BerkeleyDB
4) On your web browser go to your new MovableType 3.2 directory's mt.cgi. That will automatically sets the upgrade process and voila you're done.

This way my templates, old generated files are still the same. One thing that I still couldn't figure out is that I can't see all the comments on the comments list. They are there if I go to the individual entries but a lot are missing from the main comments page. I hope this is not a sign of a corruption again.

]]>
MovableType vhadiant 2006-05-03T21:42:30+10:00
"Upgrading" MovableType http://www.hadianto.net/destination/archives/2006/05/upgrading_movab.html Fed up with the lack of anti-spam plug-in for MovableType 3.1x I've decided to once again tried to upgrade to MovableType 3.2.

Once again I was thwarted by the cryptic Perl error messages. This time though I had my resolve to use MovableType 3.2. I found out that installing it fresh seems to work, so rather than doing an "upgrade" I exported the content of my old blogs and imported back to the new installation.

It seems to work good enough, but it does have a few drawbacks:

1) Archives by default are stored in the root blog directory. I didn't realise this because before all my archives are neatly stored under the "archives" directory.

2) MT 3.2 seems to generate different filename than the MT 3.1x for items with longer name.This is the new filename while this is the old one. I suspect a few my internal links will be broken if I don't leave the old files.

But apart from those two issues, arguably quite bad if a blog is popular but mine is not, everything seems to be working quite well.

Next step is to customise the styles, at the moment both blog have the standard styles that come with the default install. It actually looks better than my old one :)

]]>
MovableType vhadiant 2006-05-02T22:52:41+10:00
MCSD .NET Done and Dusted http://www.hadianto.net/destination/archives/2006/04/mcsd_net_done_a.html After one long year, five exams later I've finally completed the MCSD .NET certification by passing the last exam: 70-300 Analyzing Requirements and Defining Microsoft .NET Solution Architectures.

I remember buying the first book April last year and have been studying whenever I have the time. It hasn't been an easy process, the most difficult task is to actually find the time to study. Not to mention the amount of material to cover. When I first started studying I thought I can finish the entire set in 5 months, at 1 exam per month rate. Reality doesn't seem to agree. I've been told that the 'normal' time to finish MSCD .NET range between 10 - 18 months. I know a few people who didn't end up finishing it, you do need a lot of determination and encouragement to study.

]]>
Certification vhadiant 2006-04-23T09:00:50+10:00