# Wednesday, 04 February 2009

Though external javascript and css files can be cached by a browser the initial download can still be quite large. For example the minified jQuery library compared with the uncompressed one, or even the visual studio documented one is considerable. A while ago, for my current project, I also faced the problem of lots of script files in the project either created by the team or provided by a design company. This however hurt performance so I took some time to dig into the matter and try out several compression tools. The best one I found so far is YUICompressor from Yahoo!. It’s written in java but that shouldn’t stop you from giving it a try. The nice thing about it is that one can provide arguments to the command line tool to get a different outcome like for example the switch --nomunge which tells the tool to only minify the javascript and not to obfuscate local symbols. According to Wikipedia obfuscation means:

Obfuscation is the concealment of meaning in communication, making communication confusing, intentionally ambiguous, and more difficult to interpret.

It also has a side effect benefit that mostly the file even becomes a little bit smaller.

Because as a .NET developer I mainly work with Visual Studio and I like to stay in that environment instead of going to a command prompt, typing in the commands to run the tool. Luckily Visual Studio provides the needed mechanism to automate this process without leaving the IDE itself.

In the menu select Tools > External Tools…
There you can add a new entry like in the image by clicking the Add button.


I added the YUICompression entry. The command is the executable file, in this case java.exe which is needed to run the jar file. The arguments section is the most interesting one though as this provides us the way to tweak the arguments of the command line tool. Also note that I put the compression tool in my c:\ root directly.

The whole line reads as:

-jar C:\yuicompressor-2.4.2.jar $(ItemPath) -o $(ItemDir)$(ItemFileName).min$(ItemExt) –v

For the CSS file compression I added another entry but with this in the Arguments section:

-jar C:\yuicompressor-2.4.2.jar $(ItemPath) -o $(ItemPath) –v

The reason for this is because I like the javascript, when minified, get the filename that indicates that it was minified so I add the .min in between. The added benefit for this is that you can still keep the original .js file for changes, and then minify it again of course. I don’t do this for the css files as they don’t get obfuscated and it’s easy to reformat the document again with the default keyboard combination ctrl + k, ctrl + d (Menu > Edit > Advanced > Format document).

Now that we’ve got this into place it’s quite easy. In the Solution explorer you just select a .js or .css file and from the menu Tools > YUICompression you can let the tool do its magic.

Grz, Kris.

Wednesday, 04 February 2009 23:19:01 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, 27 January 2009

Just read the news on Scott Guthrie's blog that ASP.NET MVC RC got released today. That’s good news as this means that the final version will probably ship soon as well. Being a fan of jQuery since a couple of months, and already using it in production code, it’s great to see that it MVC ships with this great javascript library as well. Today still with version 1.2.6 but the 1.0 final release of MVC will have 1.3.1 included which is way more performing when you take a look at the graphs.

Grz, Kris.

Tuesday, 27 January 2009 23:45:44 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Friday, 23 January 2009

Today I got to hear that my grandfather passed away. He almost made it to the age of 92, a very respectable age, especially if you know that he still drove with his car up until he became 90. He has always been interested in technology and I really enjoyed our talks during the years I had the pleasure to know him. During the last months of his life my family and myself tried to spend as much time as possible with him, helping him out, trying to cheer him up during tough periods. I’s always painful to have to let go of someone you liked a lot and had a place in your personal education to become a decent person.

Grz, Kris.

Friday, 23 January 2009 04:19:00 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [2]  | 
# Thursday, 30 October 2008

Cool! In the past Microsoft already released similar posters but this time you can also Deepzoom to view it. Looks great.

Grz, Kris.

Thursday, 30 October 2008 14:40:00 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [1]  | 
# Tuesday, 28 October 2008

I just noticed that on the site of jQuery there’s now also a download available for having a much better intellisense experience. It’s actually a big js file with xml comment that Visual Studio can interpret but it can be used to power up the development experience. Also when you do reference this only do so while developing and don’t put this into production since it’s waaaay bigger than the minified version (or the packed one). So make sure that you set that into production instead.

Update: I just found out about these extra handy tips for adding the documented jQuery file to your pages.

Grz, Kris.

Tuesday, 28 October 2008 08:29:43 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Monday, 27 October 2008

At the PDC a new logo for .NET was introduced:


It looks like a helix shape to me and that reminds me of that other helix shape: DNA. When one says DNA, and who has been around for a while, probably immediately thinks about Microsoft DNA, Windows Distributed interNet Applications Architecture.

Actually the helix is also flipped over an angle of 90° and that reminds me of another story: Flipping the funnel. It’s an eBook by Seth Godin. During my college years I liked my course of marketing a lot. Actually when I remember reading this particular book and how the new logo looks… well it kind of mixed you know. The DNA helixes also got flipped like the funnel into a megaphone. It reflects it perfectly as Microsoft tends to spread .NET where it can: on the server, on the desktop, in the browser, …

Grz, Kris.

Monday, 27 October 2008 21:49:00 (GMT Standard Time, UTC+00:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, 24 September 2008
Just noticed that I just wrote my 10.000th post on the ASP.NET forums. Cool! Well I hope many people enjoyed my replies and possible answers during those years.

Grz,  Kris.
ASP.NET | Forums | MVP
Wednesday, 24 September 2008 12:43:22 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 
# Friday, 05 September 2008

Oh man, I just found out about this sad news. The following news statement is taken from the site of U2U, the company that he cofounded:

It is with deepest regret that we have to announce the death of Patrick Tisseghem, co-founder of U2U. Patrick suddenly passed away on Wednesday 3 September 2008 around 18 hours in Gothenburg Sweden due to a heart failure. Our sympathy and thoughts go out to his wife Linda, their daughters Anahi and Laura, and to his family. We are all deeply saddened by this tragic loss. We remember him as caring father as well as a driven and warm hearted colleague and friend. We miss you Patrick.

I followed one of his courses about Sharepoint several years ago and especially requested for a course given by him because I knew he was a world known expert on that particular topic. After that we met occasionally and moslty saw each other thanks to Microsoft related conventions or like a couple of months ago when we had a meet and greet with Tim Sneath.

I'm the guy on the left, then Peter and then Patrick himself. This is truly very, very sad news for his family as well for the community.

Grz, Kris.

Friday, 05 September 2008 13:02:13 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [1]  | 
# Thursday, 04 September 2008

Last week I had to help someone out on the ASP.NET that was asking the question that he couldn't find the 2.0 bits anymore of the ASP.NET AJAX Control Toolkit. Indeed, when you navigate to the Releases tab of the project on Codeplex you'll only see this list:

Source Code AjaxControlToolkit-Framework3.5SP1.zip
source code, 3033K, uploaded Aug 21 - 24104 downloads
Application AjaxControlToolkit-Framework3.5SP1-NoSource.zip
application, 1716K, uploaded Aug 21 - 8256 downloads
Application AjaxControlToolkit-Framework3.5SP1-DllOnly.zip
application, 512K, uploaded Aug 22 - 5704 downloads
Application AjaxControlToolkit-ScriptFilesOnly.zip
application, 238K, uploaded Aug 22 - 2555 downloads
Phew, no more 2.0 bits. It seems that Microsoft decided to cut on keeping things rolling since SP1 of .NET 3.5 came out.
Luckily for the person I helped out you can still reach to the 2.0 bits by navigating to this url (the release of February 29th 2008).
Grz, Kris.
Thursday, 04 September 2008 13:51:08 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, 02 September 2008
During my studies of becoming an engineer I found marketing one of my most interesting side courses. During the last years I tried to follow blogs like the one of Seth Godin and was greatly amused by the Apple commercials.

Well today I found out about a great way that Google made up to show Chrome, their new browser, to the masses in the form of a comic book. I think it's just great marketing. I haven't tried out the Chrome browser myself yet but I'm looking forward to it. Not just because of the marketing behind it (I like to read comic books myself a lot so that also added to the appeal) but also from the point of view of a webdeveloper. Especially the javascript V8 engine looks very interesting with all kinds of AJAX web applications nowadays and if it's really as fast as they claim I'm highly interested.

Exciting times ahead with the newest release of Firefox (3) and the upcoming IE8. Since I also like to use a Mac I also use Safari nowadays. Aaah, I see a new browser war coming already like in the good old days between Netscape and Internet Explorer.

Grz, Kris.

Tuesday, 02 September 2008 22:16:07 (GMT Daylight Time, UTC+01:00)  #    Disclaimer  |  Comments [2]  |