<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3703531</id><updated>2012-01-28T07:03:34.468+01:00</updated><category term='C#'/><category term='Unit testing'/><category term='android'/><category term='Open source'/><category term='WindowsMobile'/><category term='python'/><category term='mylyn'/><category term='mocking'/><category term='TFS'/><category term='Eclipse'/><category term='Localisation'/><category term='debian'/><category term='ci'/><category term='Hudson'/><category term='WTF'/><category term='VS2005'/><category term='MSBuild'/><category term='Java'/><category term='.NET'/><title type='text'>Redsolo's blog site</title><subtitle type='html'>Generic blog gripes and raves, mostly about java, C# and software development.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3703531.post-3847427653474165838</id><published>2009-11-23T21:35:00.004+01:00</published><updated>2009-11-23T22:37:52.865+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WindowsMobile'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Reply to an "Android vs Windows Mobile" post</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;div&gt;This is a response for the &lt;a href="http://jkontherun.com/2009/11/23/windows-mobile-vs-android-winmo-is-better-than-you-think"&gt;"Windows Mobile vs. Android: WinMo Is Better Than You Think"&lt;/a&gt; blog post. That blog post might at first look unbiased but it isn't; the author must have skimmed the android #101 class and missed vital parts.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Multi-tasking - Big advantage: Windows Mobile&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;"Anyone who has run an Android phone for more than a few minutes should fire up a task manager and have a look. You’ll likely see 20 or more tasks running in the background, not unlike WinMo."&lt;/i&gt; &lt;/div&gt;&lt;div&gt;Yes, you will see the applications which consists of services and Activities (ie a Form, Dialog or Window), but the big difference is that those activities are NOT running at the same time as your main activity (the one that is on the front). If you want multitasking, then look at the running services. On WinMo they background applications are still RUNNING, they are consuming both memory and CPU, that is one big difference between Android and WinMo.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;"WinMo automatically changes memory allocation based on the needs of each app, and if the system memory starts to get stretched thin, the OS shuts down background tasks automatically."&lt;/i&gt;&lt;/div&gt;&lt;div&gt;How is the priotization done? For Android it is a clear priority path, first all activities that are not showing is killed, then it starts killing of services and lastly the activity in the front. On WinMo, it is not soo clear. How will WinMo distinguish an application for checking emails from the Chess application you stopped playing 2 days ago? &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The post also forgets to mention that the android framework will bring your activities back into memory after they have been swapped out. That way the user will not notice that an application (or actually activity has been swapped out because of the lack of memory. Does WinMo do anything even close to bring an application back up? No! Android has framework support for making it seamless.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;About memory, the Windows Mobile 6.5 (and all older versions) has an application memory limit of 32MB. Shared DLLs will eat up that memory if they have been loaded in a bad way. Please read http://msdn.microsoft.com/en-us/library/ms836325.aspx for more info on how one application can reduce the available memory for another application. It is amazing that an OS in 2009 can have this limitation.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Multitasking on android is a more modern approach than WinMo has (or PocketPC as nothing has really changed). It helps the developer of creating a never ceasing, seamless user experience. I have NEVER had the phone freeze so it has to be rebooted because of a faulty application. That happens on WinMo now and then. Why is it even possible for an application to nuke an OS?  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Yes, Android has a big problem with the SD card issue, but comparing that to multitasking is like comparing apples and bees.   &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Available apps - Advantage: Windows Mobile&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;"Not a lot of apps are in there yet, which is not surprising given how new the store is to the market. " &lt;/i&gt;&lt;/div&gt;&lt;div&gt;iPhone had 3,000 applications after the first month. How many does marketplace have today? 400, 500? It is time for MS to put their money where their mouth is. When iPhone started saying that they have so and so many apps in their appstore, MS boasted that there were over 20,000 apps available for WinMo. But where are they? Why don't the developers deliver the applications to the best place to sell and advertise an application? You also forget to mention that the marketplace has a 10mb limit, what does that do to real games?  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;"Opera Mobile 10 is as good as any mobile browser out there on any platform, and it is free for Windows phone users. It is so exceptional that HTC has been using it as the default browser on its WinMo phones for years, and with good reason. It demonstrates the quality and quantity of apps available for the WinMo platform"&lt;/i&gt;&lt;/div&gt;&lt;div&gt;Android has opera as well, AND a web browser based on the webkit engine (google it, if you dont know it). Opera is a great software, but it does not equal that all other apps for WinMo is great. Im not saying that Android applications are of a higher quality as there are a few ones that will crash and burn but thankfully they dont bring the OS down with them.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;User interface - Advantage: Windows Mobile &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;"Spb Mobile Shell has been out for years, and the latest version is for WinMo what Sense is for Android. The difference is that Mobile Shell is user obtainable, where HTC Sense must be installed on a phone as purchased."&lt;/i&gt;&lt;/div&gt;&lt;div&gt;I guess you have missed the other Home replacements? There are several ones that allows the user to custom design their front ends, search in the android market for "Home" and you shall find.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;"Android phones with the stock interface are pretty plain Jane, as is the WinMo interface."&lt;/i&gt;&lt;/div&gt;&lt;div&gt;It is not possible to say, with a straight face, that vanilla WinMo is as good as vanilla android if you have used the two of them next to each other. None of them of course looks as good as the iPhone.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;"The end result is that a WinMo phone running Sense is as good as an Android phone running it."&lt;/i&gt;&lt;/div&gt;&lt;div&gt;Yes, Touchflo and Sense are great front ends and really responsive, but as soon as you get one or two steps away from it, you see the ugliness of the old WinMo UI. HTC has done a lot to hold WinMo under its arms, as they have been working mainly on the front end that is the only thing the user sees when looking for a new phone. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then if someone could explain to me why the HTC Sense is more responsive than the WinMo 6.5 start menu when they are run on the same hardware? I have tried the HD2, and when you scroll up and down in the WinMo start menu it will do some strange jumps, which you cant see when using HTC Sense. Also, there is another problem here with a nice front end over the WinMo UI. The user will use fingers gestures to go back and forth from views to other views (which all modern phones should do),but as soon as you go into the WinMo UI you have to bring out the stylus to check a checkbox or something. Unfortunately the next WinMo 6.5.3 will not fix this, as just increasing the size of every control isnt the solution.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Computer desktop integration: Advantage: Tie&lt;/b&gt;&lt;/div&gt;&lt;div&gt;This section nails it, it all depends on if you are using exchange or gmail. I am a gmail user and Im quite happy, and I know HTC Hero users that use exchange and are happy with it. Of course using gmail on WinMo is now a viable option thanks to the Google exchange synchronization.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Last &lt;/b&gt;&lt;/div&gt;&lt;div&gt;I am a software developer that mostly work with the WinMo platform, and it doesnt go a week without me implementing work arounds for some undocumented change in an API. Especially today as the software is targeting Pocket PC 2003 to Windows Mobile 6.5.3. Add Smartphone to the mix and it is even more fun.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For a nice read on the HD2, check this out &lt;a href="http://www.sanneblad.com/2009/11/22/htc-hd2-worst-windows-mobile-device-yet/"&gt;this review&lt;/a&gt;.&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-3847427653474165838?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/3847427653474165838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=3847427653474165838' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/3847427653474165838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/3847427653474165838'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2009/11/this-is-response-for-windows-mobile-vs.html' title='Reply to an &quot;Android vs Windows Mobile&quot; post'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-725918288606403840</id><published>2008-11-24T13:25:00.009+01:00</published><updated>2008-11-25T10:10:47.486+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WTF'/><category scheme='http://www.blogger.com/atom/ns#' term='WindowsMobile'/><title type='text'>Sending WM_WININICHANGE message on device with HTC TouchFlo 3D will crash the device</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Today I finally solved a very strange bug in a Windows Mobile project Im currently working on. The bug would only show up on HTC devices, and not our HTC devices we had at our location. After the application was installed and the user started it, the whole device would freeze and reboot itself after a minute or so.&lt;br /&gt;&lt;br /&gt;After some digging around, rebuilding, re-installing for way too many times; we found out that if the HTC TouchFlo 3D today plugin was enabled the device would crash. With that knowledge I was able to pin point the location of the failure which was that the installation DLL sends a &lt;/span&gt;&lt;span style="font-weight:bold;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;WM_WININICHANGE &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;message to refresh the PocketPc Today plugins.&lt;br /&gt;&lt;br /&gt;As many &lt;/span&gt;&lt;a href="http://www.pocketpcdn.com/articles/changetodaytheme.html"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;sites&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; and &lt;/span&gt;&lt;a href="http://forum.xda-developers.com/archive/index.php/t-398285.html"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;forum posts&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; states, this is the only way to refresh the Today plugins.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;::SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Of course, this is not documented anywhere within MS documentation; and the &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms725499(VS.85).aspx"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;documentation&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; that exists states that the &lt;/span&gt;&lt;span style="font-weight:bold;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;wParam &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;isnt used at all &lt;/span&gt;&lt;span style="font-style:italic;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;(which in fact it is)&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;.&lt;br /&gt;&lt;br /&gt;It seems that the HTC TouchFlo 3D isnt capable of handling the &lt;/span&gt;&lt;span style="font-weight:bold;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;WM_WININICHANGE &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;properly, and even just opening the calendar application after that sending that message will crash the device. So if your WindowsMobile application sends that message, I would advise you to look into this. Using the replacement message &lt;/span&gt;&lt;span style="font-weight:bold;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;WM_SETTINGCHANGE&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; does not change anything, the device will still crash.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;One solution is to check if the HTC TouchFlo Today plugin is enabled, which can easily be retrived through the regkey &lt;/span&gt;&lt;span style="font-style:italic;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;"HKLM\Software\Microsoft\Today\Items\TouchFLO 3D\Enabled"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;. If it is enabled, then do not send the &lt;span style="font-weight:bold;"&gt;WM_WININICHANGE&lt;/span&gt; message.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-725918288606403840?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/725918288606403840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=725918288606403840' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/725918288606403840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/725918288606403840'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2008/11/sending-wmwininichange-message-on.html' title='Sending WM_WININICHANGE message on device with HTC TouchFlo 3D will crash the device'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-4451854057294450152</id><published>2008-11-04T21:01:00.009+01:00</published><updated>2008-11-04T22:03:26.597+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='debian'/><title type='text'>Trying out SimplifyMedia on Debian</title><content type='html'>I just noticed &lt;a href="http://www.simplifymedia.com/"&gt;SimplifyMedia&lt;/a&gt;, and wanted to start sharing music from my home media server. The server is running Debian etch (4.0), and there is no debian repository for it (not surprinsgly as it is not open source). Here's a short description on how I got it to work on my Debian machine.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Startup&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Download the package from &lt;a href="http://www.simplifymedia.com/download.html"&gt;SimplifyMedia Downloads&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Unpack the contents to a folder&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;tar zxfv simplifymedia.tar.gz&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Install all necessary debian packages to get the SimplifyMedia server running&lt;br /&gt;&lt;tt&gt;aptitude install libavahi-client3 libavahi-common3 libavahi-compat-libdnssd1 libavahi-core5 libc6 libdaemon0 libdbus-1-3 libfreetype6 libgcc1 libidn11 libpng12-0 libssl0.9.8 libstdc++6 libx11-6 libxau6 libxdmcp6 libxext6 zlib1g&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;First you need to register for an account, start the SimplifyMedia GUI and enter all needed details. After registering close the GUI.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;simplifymedia/SimplifyMedia&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start the simplifymedia server using the newly created credentials&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;simplifyserver/simplifyserver.sh -n USER -l HomeTest -p PASSWD -s /home/media/Music/&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Now the server will start scanning your folders, and soon publish the location.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/SRC1aOaiIQI/AAAAAAAAAHY/9N0oWA8jMaQ/s1600-h/SimplifyMedia-1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 228px; height: 282px;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/SRC1aOaiIQI/AAAAAAAAAHY/9N0oWA8jMaQ/s400/SimplifyMedia-1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5264907426546721026" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt; Gotchas/Problems&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;I'm using the Winamp plugin on my Windows XP laptop, and many of the files does not played when selected. This is a major issue, but I'm hoping it will be fixed soon.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The server did not find all my mp3's, it's currently missing 15% of my files.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Even though I'm almost sitting next to the server (using Wlan) the playback stutters sometimes.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There is no daemon support, so I need to fix something.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The password is shown in clear text when doing a &lt;tt&gt;ps aux&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Impression&lt;/b&gt;&lt;br /&gt;I was more impressed when reading about it than now after I've used it. The problems that it can not find all files, not able to play all files on a client; are a little too much for me to accept. But hopefully it will improve and become something great!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-4451854057294450152?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/4451854057294450152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=4451854057294450152' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/4451854057294450152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/4451854057294450152'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2008/11/trying-out-simplifymedia-on-debian.html' title='Trying out SimplifyMedia on Debian'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_jQ762RWJZOo/SRC1aOaiIQI/AAAAAAAAAHY/9N0oWA8jMaQ/s72-c/SimplifyMedia-1.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-3204198020450021211</id><published>2008-07-15T10:17:00.001+02:00</published><updated>2008-07-15T23:36:55.874+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ci'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Hudson'/><category scheme='http://www.blogger.com/atom/ns#' term='TFS'/><title type='text'>Hudson now supports Team Foundation Server</title><content type='html'>&lt;span style="font-family:arial;"&gt;Today I released a plugin that adds support for Microsoft's source control manager &lt;a href="http://msdn.microsoft.com/en-us/library/aa730884%28VS.80%29.aspx"&gt;Team Foundation Server&lt;/a&gt; to &lt;a href="http://hudson.dev.java.net/"&gt;Hudson&lt;/a&gt; (a continuous integration server). The plugin makes it possible to retrieve files and poll the server to detect changes on a project. If Hudson detects a change, a new build can be started automatically. Hudson will also &lt;/span&gt;&lt;span style="font-family:arial;"&gt;display the changes that occurred in each build.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_jQ762RWJZOo/SHvNwT4YebI/AAAAAAAAAFI/CANsjAfx7OU/s1600-h/tfs-changes.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_jQ762RWJZOo/SHvNwT4YebI/AAAAAAAAAFI/CANsjAfx7OU/s400/tfs-changes.png" alt="" id="BLOGGER_PHOTO_ID_5222994422720395698" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Configuring the plugin is easy as it is only requires the server URL and the path to the project. Hudson will take care of the rest, such as creating a workspace and work folder to store the files in. &lt;/span&gt;  &lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_jQ762RWJZOo/SHvKxw_RGfI/AAAAAAAAAFA/f9i-atO6JYI/s1600-h/tfs-configuration.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_jQ762RWJZOo/SHvKxw_RGfI/AAAAAAAAAFA/f9i-atO6JYI/s400/tfs-configuration.png" alt="" id="BLOGGER_PHOTO_ID_5222991149178886642" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;The plugin supports both the command line client in the &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.microsoft.com/downloads/details.aspx?familyid=0ED12659-3D41-4420-BBB0-A46E51BFCA86&amp;amp;displaylang=en"&gt;Team Explorer package&lt;/a&gt;&lt;span style="font-family:arial;"&gt; from Microsoft and the &lt;/span&gt;&lt;a style="font-family: arial;" href="http://teamprise.com/products/clc/"&gt;command line client from Teamprise&lt;/a&gt;&lt;span style="font-family:arial;"&gt;. An upcoming version of the plugin will add support for the &lt;/span&gt;&lt;a style="font-family: arial;" href="http://code.google.com/p/opentf/"&gt;opentf command line client&lt;/a&gt;&lt;span style="font-family:arial;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;So if you wanted to give Hudson a whirl but couldn't use it because you were using TFS, now is the chance to try it out! &lt;/span&gt;&lt;span style="font-family:arial;"&gt;For more information about this plugin, &lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/Team+Foundation+Server+Plugin"&gt;check out the wiki&lt;/a&gt;. &lt;/span&gt;&lt;span style="font-family:arial;"&gt;There are also several other .NET plugins for &lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/MSBuild+Plugin"&gt;MSBuild&lt;/a&gt;, &lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/NAnt+Plugin"&gt;NAnt&lt;/a&gt;, &lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/NUnit+Plugin"&gt;NUnit&lt;/a&gt;, &lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/Violations+Plugin"&gt;FxCop, StyleCop&lt;/a&gt; and &lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/Warnings+Plugin"&gt;compile warnings&lt;/a&gt;. I'm currently working on a plugin that integrates &lt;a href="http://codeplex.com/"&gt;CodePlex&lt;/a&gt; into Hudson.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Update:&lt;/span&gt; The plugin can be downloaded &lt;a href="https://hudson.dev.java.net/servlets/ProjectDocumentList?folderID=9590&amp;amp;expandFolder=9590&amp;amp;folderID=2761"&gt;here&lt;/a&gt;, or through the &lt;a href="http://weblogs.java.net/blog/johnsmart/archive/2008/06/new_features_in_1.html"&gt;update manager&lt;/a&gt; in Hudson.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-3204198020450021211?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/3204198020450021211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=3204198020450021211' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/3204198020450021211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/3204198020450021211'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2008/07/hudson-now-supports-team-foundation.html' title='Hudson now supports Team Foundation Server'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_jQ762RWJZOo/SHvNwT4YebI/AAAAAAAAAFI/CANsjAfx7OU/s72-c/tfs-changes.png' height='72' width='72'/><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-2655463871881730490</id><published>2008-05-28T08:15:00.005+02:00</published><updated>2008-09-19T08:52:32.928+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ci'/><category scheme='http://www.blogger.com/atom/ns#' term='Hudson'/><category scheme='http://www.blogger.com/atom/ns#' term='MSBuild'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Hudson adds support for StyleCop</title><content type='html'>&lt;span style="font-family:arial;"&gt;Last week &lt;a href="http://blogs.msdn.com/sourceanalysis/"&gt;Microsoft&lt;/a&gt; released &lt;a href="http://code.msdn.microsoft.com/sourceanalysis"&gt;StyleCop&lt;/a&gt; (aka Microsoft Source Analysis for C#), a tool that analyzes C# code and enforces a certain code style (similar to &lt;a href="http://checkstyle.sourceforge.net/"&gt;Checkstyle&lt;/a&gt;). The tool will go through all C# source files and mark the code style violations. Now &lt;a href="http://hudson.dev.java.net/"&gt;Hudson&lt;/a&gt; &lt;i&gt;(a Continuous Integration server)&lt;/i&gt; together with the &lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/Violations+Plugin"&gt;Violations plugin&lt;/a&gt; has added support for parsing the StyleCop XML report and display the results for every build.&lt;br /&gt;&lt;br /&gt;The Violations plugin displays a trend graph over builds so it is real easy to see that your project is progressing in the right direction (decreasing the number of violations). &lt;i&gt;As you can see the plugin also supports FxCop reports.&lt;/i&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_jQ762RWJZOo/SDyFjfuX2cI/AAAAAAAAAEI/QIRwc1az0P0/s1600-h/stylecop-trend.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_jQ762RWJZOo/SDyFjfuX2cI/AAAAAAAAAEI/QIRwc1az0P0/s400/stylecop-trend.png" alt="" id="BLOGGER_PHOTO_ID_5205182114191366594" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Each build will display a listing of the files that are violating the code style, and it is also possible to see the number of fixed (or introduced) violations for every build.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jQ762RWJZOo/SDyHTPuX2fI/AAAAAAAAAEg/fAgYZK5hhNw/s1600-h/stylecop-file-listing.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_jQ762RWJZOo/SDyHTPuX2fI/AAAAAAAAAEg/fAgYZK5hhNw/s400/stylecop-file-listing.png" alt="" id="BLOGGER_PHOTO_ID_5205184034041747954" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Clicking on a file will display excerpts from the C# code showing the violations.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/SDyFj_uX2dI/AAAAAAAAAEQ/w0O79lcv80w/s1600-h/stylecop-file.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/SDyFj_uX2dI/AAAAAAAAAEQ/w0O79lcv80w/s400/stylecop-file.png" alt="" id="BLOGGER_PHOTO_ID_5205182122781301202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Setup&lt;/b&gt;&lt;br /&gt;Follow the &lt;a href="http://blogs.msdn.com/sourceanalysis/pages/source-analysis-msbuild-integration.aspx"&gt;guideline here&lt;/a&gt; after &lt;a href="http://code.msdn.microsoft.com/sourceanalysis/Release/ProjectReleases.aspx?ReleaseId=1047"&gt;downloading&lt;/a&gt; StyleCop. Add the &lt;tt&gt;&amp;lt;Import Project="$(ProgramFiles)\MSBuild\Microsoft\SourceAnalysis\v4.2\Microsoft.SourceAnalysis.targets" /&amp;gt;&lt;/tt&gt; to every csproj file that you are building within Hudson. When the VS project is built, StyleCop will store a file named &lt;tt&gt;StyleCopViolations.xml&lt;/tt&gt; &lt;i&gt;[Update, if you are using StyleCop 4.2 enter &lt;tt&gt;SourceAnalysisViolations.xml&lt;/tt&gt; &lt;/i&gt; in the project folder. &lt;i&gt;As of now, there is no way to store it elsewhere.&lt;/i&gt; The XML file contains all violations that were found in the Visual Studio project.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Hudson Configuration&lt;/b&gt;&lt;br /&gt;To configure the violations plugin, enable the "Report violations" check box. If there are several VS projects in the build, you should use &lt;tt&gt;**/*/SourceAnalysisViolations.xml&lt;/tt&gt; as it will find XML files in all sub folders.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/SDzv9_uX2gI/AAAAAAAAAEo/xCxHxdDMGeU/s1600-h/stylecop-config.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/SDzv9_uX2gI/AAAAAAAAAEo/xCxHxdDMGeU/s400/stylecop-config.png" alt="" id="BLOGGER_PHOTO_ID_5205299117690444290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After configuration, start a new build to analyze and display the StyleCop results in Hudson. &lt;i&gt;To see a trend graph you need at least two successful builds.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Tips&lt;br /&gt;&lt;/b&gt;&lt;ul&gt;&lt;li&gt;Do not enable all rules, choose those that are valid for your organization and make sense for you.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Do not activate too many rules at first, as it probably will generate too many violations. Too many violations may be ignored by your co-workers, as it seems to be too much work to fix them all. When the most critical code style violations has been fixed, increase the number of rules.&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-2655463871881730490?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/2655463871881730490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=2655463871881730490' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/2655463871881730490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/2655463871881730490'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2008/05/hudson-adds-support-for-stylecop.html' title='Hudson adds support for StyleCop'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_jQ762RWJZOo/SDyFjfuX2cI/AAAAAAAAAEI/QIRwc1az0P0/s72-c/stylecop-trend.png' height='72' width='72'/><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-1669216985772717524</id><published>2008-05-21T10:07:00.010+02:00</published><updated>2008-05-21T10:24:06.543+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Advance to the next Eclipse level by using the MouseFeed plugin</title><content type='html'>&lt;span style="font-family:arial;"&gt;&lt;a href="http://www.mousefeed.com/"&gt;MouseFeed&lt;/a&gt; is the best eclipse plugin that I have tested/used in a while. The plugin will make you learn the eclipse keyboard shortcuts and thus be quicker when using Eclipse. If you are using the mouse or the menu bar to select an action, and there is a shortcut for the action, the shortcut will be displayed in a big message box.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/SDPaFtGdUTI/AAAAAAAAAEA/F6P_pBrfRo4/s1600-h/mousefeed-rename.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/SDPaFtGdUTI/AAAAAAAAAEA/F6P_pBrfRo4/s400/mousefeed-rename.png" alt="" id="BLOGGER_PHOTO_ID_5202741786083938610" border="0" /&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;The message box is not too big, but enough annoying so in order to never see it you are forced to learn the shortcuts. So you learn even if you don't want to!&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-1669216985772717524?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/1669216985772717524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=1669216985772717524' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1669216985772717524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1669216985772717524'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2008/05/advance-to-next-eclipse-level-by-using.html' title='Advance to the next Eclipse level by using the MouseFeed plugin'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_jQ762RWJZOo/SDPaFtGdUTI/AAAAAAAAAEA/F6P_pBrfRo4/s72-c/mousefeed-rename.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-1750346431433544151</id><published>2008-05-14T08:02:00.000+02:00</published><updated>2008-05-21T10:25:44.181+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ci'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Hudson'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Guide to building .NET projects using Hudson</title><content type='html'>In this guide I'm going to show how to set up a C# project on the Continuous integration server &lt;a href="http://hudson.dev.java.net/"&gt;Hudson&lt;/a&gt;. I've been using Hudson on .NET projects since september and it works really well. I'm going to use &lt;a href="http://www.team-mediaportal.com/"&gt;Media Portal&lt;/a&gt; as the example project.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_jQ762RWJZOo/SCrZOdGdUKI/AAAAAAAAAC4/Bw1kwRp3mjc/s1600-h/cs-main.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_jQ762RWJZOo/SCrZOdGdUKI/AAAAAAAAAC4/Bw1kwRp3mjc/s400/cs-main.png" alt="" id="BLOGGER_PHOTO_ID_5200207562105770146" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The below goals will be solved in this guide:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Get the source code from the Subversion repository&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Link change logs to the repository browser using ViewVC&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Build the project using MBuild&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Run the tests using NUnit and display the results together with a trend graph&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Publish artifacts from the build (nightly builds)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Run FxCop on an assembly and display warnings (linked with source code) and a trend graph &lt;/li&gt;&lt;br /&gt;&lt;li&gt;Search the source code for TODO, FIXME comments and display the open tasks with links to the source code&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Initial downloads&lt;/span&gt;&lt;br /&gt;The following files are needed besides Java (at least 1.5). Get the latest version of all files and notice that the Hudson file has the extension .war and plugins .hpi. &lt;i&gt;This guide assumes that MSBuild, NUnit and FxCop are already installed and working.&lt;/i&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Hudson server application (&lt;a href="https://hudson.dev.java.net/servlets/ProjectDocumentList?folderID=2761"&gt;download)&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;MSBuild plugin (&lt;a href="https://hudson.dev.java.net/servlets/ProjectDocumentList?folderID=7951&amp;amp;expandFolder=7951&amp;amp;folderID=2761"&gt;download&lt;/a&gt;)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;NUnit plugin (&lt;a href="https://hudson.dev.java.net/servlets/ProjectDocumentList?folderID=7965&amp;amp;expandFolder=7965&amp;amp;folderID=7951"&gt;download&lt;/a&gt;)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Violations plugin (FxCop support among other such as Simian, CPD, PMD and PyLint) (&lt;a href="https://hudson.dev.java.net/servlets/ProjectDocumentList?folderID=7879&amp;amp;expandFolder=7879&amp;amp;folderID=7965"&gt;download&lt;/a&gt;)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Open Tasks plugin (&lt;a href="https://hudson.dev.java.net/servlets/ProjectDocumentList?folderID=7892&amp;amp;expandFolder=7892&amp;amp;folderID=7879"&gt;download&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Installation steps&lt;/span&gt;&lt;br /&gt;I'm going to install Hudson into c:\Program Files\Hudson.&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Copy the hudson.war file to &lt;span style="font-style: italic;"&gt;c:\Program Files\Hudson&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start Hudson through &lt;span style="font-style: italic;"&gt;"java -DHUDSON_HOME=data -jar hudson.war"&lt;/span&gt;. Verify that you can access Hudson through &lt;a href="http://localhost:8080/"&gt;http://localhost:8080&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Copy the plugins to &lt;span style="font-style: italic;"&gt;c:\Program Files\Hudson\data\plugins&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Stop Hudson by pressing &lt;span style="font-style: italic;"&gt;Ctrl+C&lt;/span&gt; in the command prompt where you started Hudson.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start Hudson again and you should be set to go.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Hudson system configuration&lt;/span&gt;&lt;br /&gt;Follow the following steps to configure the tools that Hudson will use in building MediaPortal.&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Go to the System configuration at &lt;a href="http://localhost:8080/configure"&gt;http://localhost:8080/configure&lt;/a&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;MSBuild Builder - Set the path to the MSBuild tool to &lt;span style="font-style: italic;"&gt;C:\Windows\Microsoft.NET\Framework\v2.0.50727\msbuild.exe&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrZoNGdULI/AAAAAAAAADA/fmtrxjYquCc/s1600-h/cs-msbuild.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrZoNGdULI/AAAAAAAAADA/fmtrxjYquCc/s400/cs-msbuild.png" alt="" id="BLOGGER_PHOTO_ID_5200208004487401650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;MediaPortal job configuration&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Click the "New job" link at the home page.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Enter the name &lt;span style="font-style: italic;"&gt;"MediaPortal"&lt;/span&gt;, check the &lt;span style="font-style: italic;"&gt;"Build a free-style software project"&lt;/span&gt; and press OK.&lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jQ762RWJZOo/SCraWNGdUMI/AAAAAAAAADI/2pVyGmXcpn0/s1600-h/cs-create.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_jQ762RWJZOo/SCraWNGdUMI/AAAAAAAAADI/2pVyGmXcpn0/s400/cs-create.png" alt="" id="BLOGGER_PHOTO_ID_5200208794761384130" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Source code management&lt;/span&gt;&lt;br /&gt;MediaPortal uses a Subversion SCM. Hudson supports CVS and SVN out of the box, but there are many &lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/Plugins#Plugins-Sourcecodemanagement"&gt;plugins for other SCMs&lt;/a&gt;. After checking out the files from the repository Hudson will show the new change sets since the previous build in the Build page. A detailed view of change sets can be seen in the Changes page as the name of the developer, files that were changed and the comment for the change. Each change set is linked to the &lt;a href="http://mediaportal.svn.sourceforge.net/viewvc/mediaportal/"&gt;MediaPortal subversion repository browser&lt;/a&gt;, so it is easy to browse the actual file that changed.&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Press the Subversion radio button to configure the SCM.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Repository URL=&lt;span style="font-style: italic;"&gt;https://mediaportal.svn.sourceforge.net/svnroot/mediaportal/trunk/mediaportal&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Local module directory=&lt;span style="font-style: italic;"&gt;.&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Press the Advanced button&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Repository Browser=&lt;span style="font-style: italic;"&gt;ViewSVN&lt;/span&gt;, URL=&lt;span style="font-style: italic;"&gt;http://mediaportal.svn.sourceforge.net/viewvc/mediaportal/&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrahNGdUNI/AAAAAAAAADQ/qWhOrkU8PnY/s1600-h/cs-config-scm.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrahNGdUNI/AAAAAAAAADQ/qWhOrkU8PnY/s400/cs-config-scm.png" alt="" id="BLOGGER_PHOTO_ID_5200208983739945170" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;To test the configuration, press Save and then Build. The source code will be downloaded from the repository and put into the Workspace. If there were any changes in the SCM repository they can be viewed in the Changes page.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrS19GdT-I/AAAAAAAAABY/CD1eQQrupEk/s1600-h/cs-changelog.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrS19GdT-I/AAAAAAAAABY/CD1eQQrupEk/s400/cs-changelog.png" alt="" id="BLOGGER_PHOTO_ID_5200200544129208290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;When the build is completed verify that it has checked out the code by going to the Workspace page. Using the Workspace page you can browse and view the files that has been checked out and it doesn't matter if the files are on the master or on a distributed slave!&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrTeNGdT_I/AAAAAAAAABg/zyZvPds_6cA/s1600-h/cs-workspace.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrTeNGdT_I/AAAAAAAAABg/zyZvPds_6cA/s400/cs-workspace.png" alt="" id="BLOGGER_PHOTO_ID_5200201235618942962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Building the project&lt;/span&gt;&lt;br /&gt;Im going to build a Release version of MediaPortal using MSBuild and the mediaportal.sln solution file. Hudson also supports NAnt and many other &lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/Plugins#Plugins-Buildtools"&gt;build tools through plugins&lt;/a&gt;.&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Click the &lt;span style="font-style: italic;"&gt;"Add build step"&lt;/span&gt; and select &lt;span style="font-style: italic;"&gt;"Build a Visual Studio project or solution using MSBuild."&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;MsBuild Build File=&lt;span style="font-style: italic;"&gt;mediaportal.sln&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Command Line Arguments=&lt;span style="font-style: italic;"&gt;/p:Configuration=Release&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_jQ762RWJZOo/SCra4dGdUOI/AAAAAAAAADY/1qj4Myx4Deo/s1600-h/cs-build.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_jQ762RWJZOo/SCra4dGdUOI/AAAAAAAAADY/1qj4Myx4Deo/s400/cs-build.png" alt="" id="BLOGGER_PHOTO_ID_5200209383171903714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;To test the configuration, press Save and then Build. Now the source code should be updated if there any changes and then built using MSBuild. While the build is running you can check the Console log that is updated as the build continues.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrVlNGdUDI/AAAAAAAAACA/-ahdQEjsrhE/s1600-h/CS-console.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrVlNGdUDI/AAAAAAAAACA/-ahdQEjsrhE/s400/CS-console.png" alt="" id="BLOGGER_PHOTO_ID_5200203554901282866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Running unit tests and showing the result&lt;/span&gt;&lt;br /&gt;Hudson can read NUnit XML reports and display the results of them for each build. If a test fails, then it will be displayed in the Status page. Hudson will also show how many builds ago a test failed (it's age); that way it is simple to see if a test failed in the current build. If a build has at least one failing unit tests then the build will become Unstable (yellow); otherwise it is marked as Successful (blue). After two builds you will get a trend graph showing the test results over time. To run the NUnit tests, I'm running &lt;span style="font-style: italic;"&gt;nunit-console&lt;/span&gt; from Hudson after the MSBuild has compiled all files.&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Click the &lt;span style="font-style: italic;"&gt;"Add build step"&lt;/span&gt; and select &lt;span style="font-style: italic;"&gt;"Execute Windows batch command"&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Command=&lt;pre&gt;"c:\program files\nunit\bin\nunit-console.exe" MediaPortal.Tests\bin\RELEASE\MediaPortal.Tests.dll /xml=nunit-result.xml /config=test.config&lt;br /&gt;exit 0&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Check the &lt;span style="font-style: italic;"&gt;"Publish NUnit test result report"&lt;/span&gt; and enter &lt;span style="font-style: italic;"&gt;"nunit-result.xml"&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrbTNGdUPI/AAAAAAAAADg/B88FAsMceVc/s1600-h/cs-nunit.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrbTNGdUPI/AAAAAAAAADg/B88FAsMceVc/s400/cs-nunit.png" alt="" id="BLOGGER_PHOTO_ID_5200209842733404402" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Start a new build, now the unit tests will be run and their results are collected at the end of the build. When the build is completed, you can see how many tests there were, and how many failed, in the build in the Status page.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_jQ762RWJZOo/SCrUedGdUAI/AAAAAAAAABo/S1yeTl10tKo/s1600-h/cs-test.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_jQ762RWJZOo/SCrUedGdUAI/AAAAAAAAABo/S1yeTl10tKo/s400/cs-test.png" alt="" id="BLOGGER_PHOTO_ID_5200202339425538050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;More information on namespace detail can be shown in the Test result page.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrUl9GdUBI/AAAAAAAAABw/jUiWFd3os00/s1600-h/cs-test-detail.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrUl9GdUBI/AAAAAAAAABw/jUiWFd3os00/s400/cs-test-detail.png" alt="" id="BLOGGER_PHOTO_ID_5200202468274556946" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The test results are then displayed as a trend report. &lt;i&gt;(This trend graph is copied from my python project, as it shows a variation over time)&lt;/i&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_jQ762RWJZOo/SCrYYdGdUJI/AAAAAAAAACw/AZp_i8cOIRk/s1600-h/cs-test-trend.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_jQ762RWJZOo/SCrYYdGdUJI/AAAAAAAAACw/AZp_i8cOIRk/s400/cs-test-trend.png" alt="" id="BLOGGER_PHOTO_ID_5200206634392834194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Archiving build artifacts&lt;/span&gt;&lt;br /&gt;It is good to archive the outputs (artifacts) from the build, so they can be retrieved later. This way it is possible to get a version of MediaPortal that was built a week ago, and compare the functionality to one built today. Hudson can be configured to store any number of files for each build, it can also be configured so only the latest successful build's artifacts are stored. &lt;i&gt;As I'm not really sure what the output from MediaPortal is, I'm going to show how to archive the files for the MPInstaller.&lt;/i&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Click the &lt;span style="font-style: italic;"&gt;"Archive the artifacts"&lt;/span&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Files to archive = &lt;span style="font-style: italic;"&gt;MPInstaller\bin\Release\*&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_jQ762RWJZOo/SCrbptGdUQI/AAAAAAAAADo/Q9ML4p4Beak/s1600-h/cs-archiving.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_jQ762RWJZOo/SCrbptGdUQI/AAAAAAAAADo/Q9ML4p4Beak/s400/cs-archiving.png" alt="" id="BLOGGER_PHOTO_ID_5200210229280461058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In the next build, Hudson will store all files in the MPInstaller release folder so it can be retrieved later even if there are newer builds available.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_jQ762RWJZOo/SCrVJdGdUCI/AAAAAAAAAB4/lFJIlQDu6vw/s1600-h/cs-artifacts.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_jQ762RWJZOo/SCrVJdGdUCI/AAAAAAAAAB4/lFJIlQDu6vw/s400/cs-artifacts.png" alt="" id="BLOGGER_PHOTO_ID_5200203078159912994" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Analyzing code with FxCop&lt;/span&gt;&lt;br /&gt;Hudson can collect output from several quality metric tools and show them for each build. Similar to the unit tests, they will be displayed in a trend graph. For .NET projects, it is good to use FxCop. FxCop analyzes managed code assemblies and can be very good to use but it may also generate too many warnings at start, in this example I will only use the security rules and analyze the &lt;span style="font-style: italic;"&gt;Core.dll&lt;/span&gt; assembly.&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Click the &lt;span style="font-style: italic;"&gt;"Add build step"&lt;/span&gt; and select &lt;span style="font-style: italic;"&gt;"Execute Windows batch command"&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Command = &lt;pre&gt;&lt;br /&gt;"c:\Program Files\Microsoft FxCop 1.35\fxcopcmd.exe" /file:Core\bin\Release\Core.dll  /rule:SecurityRules.dll /out:fxcop-result.xml&lt;br /&gt;exit 0&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Check the "Violations" check box, and set &lt;span style="font-style: italic;"&gt;fxcop=fxcop-result.xml&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrcd9GdUSI/AAAAAAAAAD4/8Dm1lFo_Xs0/s1600-h/cs-violation-config.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrcd9GdUSI/AAAAAAAAAD4/8Dm1lFo_Xs0/s400/cs-violation-config.png" alt="" id="BLOGGER_PHOTO_ID_5200211126928625954" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Next build will take considerate longer time, as FxCop goes through the assembly and analyzes it to find potential problems. When the build finishes, you will see a nice summary on how many violations there are in the current build.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_jQ762RWJZOo/SCrX0tGdUII/AAAAAAAAACo/su2sh2-8iJo/s1600-h/cs-fxcop.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_jQ762RWJZOo/SCrX0tGdUII/AAAAAAAAACo/su2sh2-8iJo/s400/cs-fxcop.png" alt="" id="BLOGGER_PHOTO_ID_5200206020212510850" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Finding source code comments&lt;/span&gt;&lt;br /&gt;A nice plugin is the Tasks plugin as it will go through the sources, and find specific comments that should be watched. In this example I'm going to search for TODO or FIXME comments,&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Click the &lt;span style="font-style: italic;"&gt;"Scan workspace for open tasks"&lt;/span&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Files to scan = &lt;span style="font-style: italic;"&gt;**/*.cs&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;High priority=&lt;span style="font-style: italic;"&gt;FIXME&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Normal priority=&lt;span style="font-style: italic;"&gt;TODO&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrcH9GdURI/AAAAAAAAADw/yQdfShvKH2E/s1600-h/cs-tasks-config.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrcH9GdURI/AAAAAAAAADw/yQdfShvKH2E/s400/cs-tasks-config.png" alt="" id="BLOGGER_PHOTO_ID_5200210748971503890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;If the plugin finds any comments in the source they will be displayed in the build page.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrWZNGdUEI/AAAAAAAAACI/tS2UMcxUfvw/s1600-h/cs-tasks.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_jQ762RWJZOo/SCrWZNGdUEI/AAAAAAAAACI/tS2UMcxUfvw/s400/cs-tasks.png" alt="" id="BLOGGER_PHOTO_ID_5200204448254480450" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;There will also be a trend graph so it is possible to monitor that the tasks are decreasing over time. Together with the summary on what comments were found, the full source code can be viewed.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrWw9GdUFI/AAAAAAAAACQ/FkIA4B4jHKk/s1600-h/cs-tasks-detail.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrWw9GdUFI/AAAAAAAAACQ/FkIA4B4jHKk/s400/cs-tasks-detail.png" alt="" id="BLOGGER_PHOTO_ID_5200204856276373586" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrXd9GdUHI/AAAAAAAAACg/49AGWL5yGBE/s1600-h/cs-tasks-source.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/SCrXd9GdUHI/AAAAAAAAACg/49AGWL5yGBE/s400/cs-tasks-source.png" alt="" id="BLOGGER_PHOTO_ID_5200205629370486898" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Summary&lt;/span&gt;&lt;br /&gt;I hope this was a useful guide to start building .NET projects with Hudson, one of the many CI servers. As shown above it does not take much configuration to start building a project using Hudson. The best way to start using continuous integration is to start building the project. Then focus on running unit tests and other quality metrics so you can monitor the quality progress on your project.&lt;br /&gt;&lt;br /&gt;Currently there are some plugins in the pipeline that could be interesting for .NET developers:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A SCM implementation for Microsofts Team System&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Support for CodePlex issues and Wiki words in change set comment. And a very simple configuration to check out code from a CodePlex project&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Support for displaying coverage stats using NCover and MS own coverage tool&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-1750346431433544151?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/1750346431433544151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=1750346431433544151' title='79 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1750346431433544151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1750346431433544151'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2008/04/guide-to-building-net-projects-using.html' title='Guide to building .NET projects using Hudson'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_jQ762RWJZOo/SCrZOdGdUKI/AAAAAAAAAC4/Bw1kwRp3mjc/s72-c/cs-main.png' height='72' width='72'/><thr:total>79</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-2666752537000586894</id><published>2008-04-08T10:32:00.009+02:00</published><updated>2008-04-09T14:42:30.952+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ci'/><category scheme='http://www.blogger.com/atom/ns#' term='Hudson'/><title type='text'>Start playing the Continuous Integration game for real</title><content type='html'>I read &lt;a href="http://clintshank.javadevelopersjournal.com/ci_build_game.htm"&gt;"The Continuous Integration Build Game"&lt;/a&gt; 6 months ago, just when I had found &lt;a href="http://hudson.dev.java.net"&gt;Hudson&lt;/a&gt;. The idea behind the game seemed so simple and at that time we had problems with people comitting code that broke the build and failed the (very few) unit tests. I thought that the game could help out, as people like competitions and they would try to "win" the game. To win the game the developers have to commit code that is compiling and add unit tests.&lt;br /&gt;&lt;br /&gt;The rules of the game are:&lt;br /&gt;* -10 for breaking a build&lt;br /&gt;* +1 for doing a build with no failures&lt;br /&gt;* -1 for each new test failures&lt;br /&gt;* +1 for each new test that passes&lt;br /&gt;&lt;br /&gt;&lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/The+Continuous+Integration+Game+plugin"&gt;The plugin&lt;/a&gt; is more a proof of concept than a real full fledged plugin that will suit everyone. Thus the points for each rule are hard coded and can not be changed in this release. So if you are finding this plugin useful let me know.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_jQ762RWJZOo/R_vaCrT0h5I/AAAAAAAAAAQ/DP6LfGgxqjA/s1600-h/summary.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_jQ762RWJZOo/R_vaCrT0h5I/AAAAAAAAAAQ/DP6LfGgxqjA/s320/summary.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5186979135367710610" /&gt;&lt;/a&gt;For each build you will get a summary stating how many points the build was worth, and if you want you can see what rules that were involved.&lt;br /&gt;&lt;br /&gt;The plugin installs a leader board on the front page, which shows who are on top.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jQ762RWJZOo/R_vqe7T0h8I/AAAAAAAAAAo/3udIqDQFMZo/s1600-h/leaderboard.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_jQ762RWJZOo/R_vqe7T0h8I/AAAAAAAAAAo/3udIqDQFMZo/s400/leaderboard.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5186997212885059522" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-2666752537000586894?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/2666752537000586894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=2666752537000586894' title='37 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/2666752537000586894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/2666752537000586894'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2008/04/start-playing-continuous-integration.html' title='Start playing the Continuous Integration game for real'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_jQ762RWJZOo/R_vaCrT0h5I/AAAAAAAAAAQ/DP6LfGgxqjA/s72-c/summary.png' height='72' width='72'/><thr:total>37</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-1288247538438677179</id><published>2008-04-07T21:55:00.005+02:00</published><updated>2008-04-07T22:19:28.712+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='mylyn'/><title type='text'>Use Mylyn and you will be happy in two months</title><content type='html'>I must say that I really like &lt;a href="http://www.eclipse.org/mylyn/"&gt;Mylyn&lt;/a&gt;. Besides all the &lt;a href="http://www.ibm.com/developerworks/java/library/j-mylyn1/?ca=dgr-eclipse-1"&gt;issue tracker integration&lt;/a&gt;, the &lt;a href="http://www.ibm.com/developerworks/java/library/j-mylyn2/?ca=dgr-eclipse-1"&gt;task context features&lt;/a&gt; are great. Today I got a &lt;span style="font-style:italic;"&gt;"ahh, this is to good to be true"&lt;/span&gt; moment.&lt;br /&gt;&lt;br /&gt;I was working on my clear case plugin for &lt;a href="http://hudson.dev.java.net"&gt;Hudson&lt;/a&gt;, and was going to fix a feature request I entered two months ago. So I activated the task, and suddenly two files was opened in the editor. The caret was moved to the method that was going to be involved in fixing the feature. Apparently Eclipse has improved recently and it knew how to fix the feature before I knew. &lt;br /&gt;&lt;br /&gt;Then it dawned on me that I had started looking into fixing the feature two months ago, and thats why the task context already contained the two files. I just picked up where I left two months ago, and could continue working on the feature request within minutes. That is great functionality that doesn't intrude on the user, it just works! &lt;br /&gt;&lt;br /&gt;So if you are using Eclipse and haven't tested mylyn, start using it today and you will be happy in two months! (and the time in between!)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-1288247538438677179?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/1288247538438677179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=1288247538438677179' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1288247538438677179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1288247538438677179'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2008/04/use-mylyn-and-you-will-be-happy-in-two.html' title='Use Mylyn and you will be happy in two months'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-3151004121064578575</id><published>2007-11-24T13:21:00.001+01:00</published><updated>2007-12-03T22:10:04.978+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unit testing'/><category scheme='http://www.blogger.com/atom/ns#' term='mocking'/><title type='text'>RFC: A mock too far?</title><content type='html'>&lt;span style="font-family:arial;"&gt;I love using mocks as it makes it possible to write unit tests for small parts of a bigger system without depending on it. Using mocks is very simple, just create a mock of an interface &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;(or class, schhhh) &lt;/span&gt;&lt;span style="font-family:arial;"&gt;, set up the expectations on it, and then execute the test. When using mocks it is easy to get 100% coverage without relying on others. But I have come to the conclusion that this can be taken too far, way too far.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I have tests that do more setting up the mock expectations than actually testing the code. This makes the tests much harder to read, and I'm having problems going back to 6 months old code and understand what a test actually tests. And in my eyes this is a big problem because unit test code should be as simple as possible.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;So what I'm interested in is how should I do mock testing, without drowning in mocking expectations. Does anyone have any ideas on how to do it? Have I gone a mock too far?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;As a simple example I will show my &lt;/span&gt;&lt;a style="font-family: arial;" href="http://fisheye5.cenqua.com/browse/hudson/hudson/plugins/clearcase/src/test/java/hudson/plugins/clearcase/ClearCaseSCMTest.java?r=MAIN"&gt;unit tests&lt;/a&gt;&lt;span style="font-family:arial;"&gt; of my &lt;/span&gt;&lt;a style="font-family: arial;" href="http://hudson.gotdns.com/wiki/display/HUDSON/ClearCase+Plugin"&gt;Clear case&lt;/a&gt;&lt;span style="font-family:arial;"&gt; implementation for the &lt;/span&gt;&lt;a style="font-family: arial;" href="http://hudson.dev.java.net/"&gt;Hudson CI&lt;/a&gt;&lt;span style="font-family:arial;"&gt; server. &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;(But my production code looks very similar unfortunately)&lt;/span&gt;&lt;span style="font-family:arial;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I've selected to mock out the clear tool command execution in the test, ie I dont want to issue real commands using the clear case command line tool (and I don't have a Clear case server or client at home). In the below example I want to verify that when the plugin polls the CC server for changes, then it should issue a &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;"lshistory"&lt;/span&gt;&lt;span style="font-family:arial;"&gt; method call. But to get it to the point where I can run the tests I have to mock out the Hudson dependencies, ie get the latest build, check the time stamp of it, mock a list of changes that the "&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;lshistory"&lt;/span&gt;&lt;span style="font-family:arial;"&gt; should return.&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;@Test&lt;br /&gt;public void testPollChanges() throws Exception {&lt;br /&gt;  final ArrayList&lt;object[]&gt; list = new ArrayList&lt;object[]&gt;();&lt;br /&gt;  list.add(new String[] { "A" });&lt;br /&gt;  final Calendar mockedCalendar = Calendar.getInstance();&lt;br /&gt;  mockedCalendar.setTimeInMillis(400000);&lt;br /&gt;&lt;br /&gt;  context.checking(new Expectations() {&lt;br /&gt;  {&lt;br /&gt;    one(clearTool).lshistory(with(any(ClearToolLauncher.class)),&lt;br /&gt;      with(equal(mockedCalendar.getTime())),&lt;br /&gt;      with(equal("viewname")), with(equal("branch")));&lt;br /&gt;    will(returnValue(list));&lt;br /&gt;    one(clearTool).setVobPaths(with(equal("vob")));&lt;br /&gt;  }&lt;br /&gt;  });&lt;br /&gt;  classContext.checking(new Expectations() {&lt;br /&gt;  {&lt;br /&gt;    one(build).getTimestamp();&lt;br /&gt;    will(returnValue(mockedCalendar));&lt;br /&gt;    one(project).getLastBuild();&lt;br /&gt;    will(returnValue(build));&lt;br /&gt;  }&lt;br /&gt;  });&lt;br /&gt;&lt;br /&gt;  ClearCaseSCM scm = new ClearCaseSCM(clearTool, "branch",&lt;br /&gt;    "configspec", "viewname", true, "vob", false, "");&lt;br /&gt;  boolean hasChanges = scm.pollChanges(project, launcher,&lt;br /&gt;    workspace, taskListener);&lt;br /&gt;  assertTrue("The first time should always return true", hasChanges);&lt;br /&gt;&lt;br /&gt;  classContext.assertIsSatisfied();&lt;br /&gt;  context.assertIsSatisfied();&lt;br /&gt;}&lt;br /&gt;&lt;/object[]&gt;&lt;/object[]&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-family: arial;"&gt;As you can see the mock expectations take up at least two thirds of the test. Of course I can refactor the tests by adding helper methods that will set up the expections, but many times the expectations are similar but not equal.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-3151004121064578575?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/3151004121064578575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=3151004121064578575' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/3151004121064578575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/3151004121064578575'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2007/11/rfc-mock-too-far.html' title='RFC: A mock too far?'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-9156666369756695973</id><published>2007-11-20T20:50:00.002+01:00</published><updated>2008-09-17T14:51:37.415+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ci'/><category scheme='http://www.blogger.com/atom/ns#' term='Hudson'/><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Hudson embraces Python</title><content type='html'>&lt;span style=";font-family:arial;font-size:100%;"  &gt;A few months ago I started using &lt;a href="http://hudson.dev.java.net/"&gt;Hudson&lt;/a&gt; for my &lt;a href="http://xbmc.ramfelt.se/wiki/TvScreenShots"&gt;XBMC TV.com scripts&lt;/a&gt; that are written in Python. The Hudson continuous integration server will retrieve the latest sources from subversion, package the sources into a zip file, run a few unit tests, analyze the source using pylint and then display the outcome in a easy navigated web-ui. You can see the result at &lt;a href="http://hudson.ramfelt.se/"&gt;http://hudson.ramfelt.se&lt;/a&gt; where the latest build is always accessible.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Python unit tests&lt;/span&gt;&lt;br /&gt;Hudson supports JUnit report files, but unfortunately the py-unit framework does not support outputting the unit test results to an XML file. But thanks to &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a style="font-family: arial;" href="http://www.rittau.org/python/"&gt;Sebastian Rittau&lt;/a&gt;&lt;span style="font-family:arial;"&gt;, there is a unit test runner that will write the result into an XML file that can be parsed as a JUnit file. Using the &lt;a href="http://xbmc.ramfelt.se/browser/TV.com/trunk/src/python-test/xmlrunner.py"&gt;xmlrunner.py&lt;/a&gt; when running my tests I can produce XML files that can be read by Hudson. So now for every commit or forced build the tests are executed and shown in a nice graph.&lt;/span&gt;&lt;br /&gt;&lt;a href="http://ramfelt.se/blog/redsolo/0711/test-result.PNG"&gt;&lt;img style="font-family: arial;" WIDTH=350 src="http://ramfelt.se/blog/redsolo/0711/test-result.PNG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The &lt;/span&gt;&lt;a style="font-family: arial;" href="http://xbmc.ramfelt.se/browser/TV.com/trunk/src/python-test/alltestsuite.py"&gt;python code&lt;/a&gt;&lt;span style="font-family:arial;"&gt; looks like this:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:100%;"  &gt;&lt;span style="font-size:85%;"&gt;suite = unittest.TestSuite([&lt;br /&gt;   unittest.TestLoader().loadTestsFromTestCase(ShowTestCase),&lt;br /&gt;          unittest.TestLoader().loadTestsFromTestCase(VideoTestCase),&lt;br /&gt;])&lt;br /&gt;if __name__ == '__main__':&lt;br /&gt;   runner = xmlrunner.XmlTestRunner(sys.stdout)&lt;br /&gt;   runner.run(suite)&lt;/span&gt;&lt;br /&gt;&lt;target name="report-pyunit-xml"&gt;&lt;target name="report-pyunit-xml" depends="report-prepare,test-prepare"&gt;&lt;exec dir="${build.test}" executable="${python.binary}" output="${report.pyunit.xml}" error="${report.pyunit.xml}.error"&gt;&lt;exec dir="${build.test}" executable="${python.binary}" output="${report.pyunit.xml}"&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;In Hudson you must enable JUnit report files by checking the &lt;/span&gt;&lt;/exec&gt;&lt;/exec&gt;&lt;/target&gt;&lt;/target&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="font-style: italic;"&gt;"Publish JUnit test result report"&lt;/span&gt; and enter the path to the XML reports.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;img style="font-family: arial;" src="http://ramfelt.se/blog/redsolo/0711/hudson-junit.PNG" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:100%;"  &gt;Python code analysis&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Hudson supports the common Java analyzers such as PMD, FindBugs, CPD, checkstyle, etc. It didn't have any support for pylint, but thanks to a &lt;/span&gt;&lt;a style="font-family: arial;" href="http://hudson.gotdns.com/wiki/display/HUDSON/Violations+Plugin"&gt;great plugin&lt;/a&gt;&lt;span style="font-family:arial;"&gt; it was very easy to &lt;/span&gt;&lt;a style="font-family: arial;" href="http://fisheye5.cenqua.com/browse/hudson/hudson/plugins/violations/src/main/java/hudson/plugins/violations/types/pylint/PyLintParser.java?r=MAIN"&gt;write a parser&lt;/a&gt; for pylint reports. Using this plugin, Hudson can now analyze my python files and show a nice &lt;a style="font-family: arial;" href="http://akira:8070/job/XBMC%20TV/violations/"&gt;trend graph &lt;/a&gt;&lt;span style="font-family:arial;"&gt;on how many issues there are and for long. It will also produce a &lt;/span&gt;&lt;a style="font-family: arial;" href="http://akira:8070/job/XBMC%20TV/violations/file/tv.py/"&gt;report for each file&lt;/a&gt; with code snippets to show where the issue is.&lt;br /&gt;&lt;a href="http://ramfelt.se/blog/redsolo/0711/pylint-snippet.PNG"&gt;&lt;img style="font-family: arial;" WIDTH=350 src="http://ramfelt.se/blog/redsolo/0711/pylint-snippet.PNG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-family: arial;" href="http://xbmc.ramfelt.se/browser/TV.com/trunk/build.xml#L205"&gt;Ant target&lt;/a&gt;&lt;span style="font-family:arial;"&gt; to create the pylint file (important that the pylint output is parseable)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="font-size:85%;"&gt;&amp;lt;target name="report-pylint" depends="report-prepare"&amp;gt;&lt;br /&gt; &amp;lt;exec dir="${src.python}" executable="${pylint.binary}" output="${report.pylint}"&amp;gt;&lt;br /&gt;      &amp;lt;env key="PYTHONPATH" path="${build.bin}:${build.bin}/lib/"/&amp;gt;&lt;br /&gt;      &amp;lt;arg line="-f parseable -i y TVcom.py tvguicontroller.py tvweb.py tv.py settingsmanager.py --output-format=parseable --ignore-comments=y --min-similarity-lines=4 --disable-msg=R0903 --disable-msg=C0301"/&amp;gt;&lt;br /&gt;   &amp;lt;/exec&amp;gt;&lt;br /&gt; &amp;lt;/target&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Configuring the Violation plugin in Hudson looks like this:&lt;br /&gt;&lt;a href="http://ramfelt.se/blog/redsolo/0711/pylint-config.PNG"&gt;&lt;img style="font-family: arial;" WIDTH=350 src="http://ramfelt.se/blog/redsolo/0711/pylint-config.PNG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Verification tests&lt;br /&gt;&lt;/span&gt;I've also set up Hudson to run the verification tests when ever a build has been completed for the main XBMC TV Script job. This verification job will crawl through the www.tv.com web using the crawling sources to verify that there is no crashes because www.tv.com have changed the html format. This job takes a long time, up too 3-5 hours, and the result will be displayed in a nice trend graph as other unit tests. At the same time I can continue develop the next version and even build a new version while Hudson is running the verification job.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I must say that Hudson is a great CI tool, which works with Java, Python and C#. My favorite languages.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-9156666369756695973?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/9156666369756695973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=9156666369756695973' title='176 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/9156666369756695973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/9156666369756695973'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2007/11/hudson-embraces-python.html' title='Hudson embraces Python'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>176</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-253961776997836115</id><published>2007-07-20T22:39:00.001+02:00</published><updated>2008-09-17T14:51:37.415+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ci'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Hudson'/><title type='text'>Continuous integration made easy</title><content type='html'>&lt;span style="font-family: arial;"&gt;Yesterday I found a great continuous integration server. Its called &lt;/span&gt;&lt;a style="font-family: arial;" href="http://hudson.gotdns.com/"&gt;Hudson&lt;/a&gt;&lt;span style="font-family: arial;"&gt; and is written in Java and can do loads of stuff with no complex setup. Right out of the box it supports Ant, Maven, Cvs, and Subversion. In 10 minutes I was up and running periodical builds of my XBMC python scripts from my Trac/Subversion &lt;/span&gt;&lt;a style="font-family: arial;" href="http://xbmc.ramfelt.se/"&gt;site&lt;/a&gt;&lt;span style="font-family: arial;"&gt;.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;At my previous job at large american hand held manufacturer, they had a really nice build system  that was integrated with sharepoint. With it, they could schedule builds through a web page on their separate products. I was pretty amazed by it and it seemed so complex. But now I have a tool that can do the same thing for free.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;Hudson has some nice features:&lt;/span&gt;&lt;br /&gt; &lt;ul style="font-family: arial;"&gt;&lt;li&gt;Builds trends - How often does the build break? Does the build time increase for every build?&lt;/li&gt;&lt;li&gt;Periodical builds Or when someone commits&lt;/li&gt;&lt;li&gt;&lt;a href="https://hudson.dev.java.net/screenshots/5.png"&gt;Test trends&lt;/a&gt; - Is the number of failed test increasing or decreasing over time? Does the test cover more and more code? (Clover plugin)&lt;br /&gt;  &lt;/li&gt;&lt;li&gt;Emails when a build fails - An email can be sent out when someone checks in code that breaks. Apparently it can even email those responsible for breaking the build (that I havent tested yet)&lt;/li&gt;&lt;li&gt;&lt;a href="http://hudson.gotdns.com/wiki/download/thumbnails/753667/1.png"&gt;Multiple jobs&lt;/a&gt; that can be shared one or several machines.&lt;/li&gt;&lt;li&gt;Shell access, you can run any batch file or shell script from the builds; so it is very easy to integrate into your current build situation&lt;/li&gt;&lt;li&gt;&lt;a href="http://hudson.gotdns.com/wiki/display/HUDSON/Plugins"&gt;Plugins &lt;/a&gt;- To integrate with Trac and other bug reports; Jabber and IRC support, etc.&lt;br /&gt;  &lt;/li&gt;&lt;/ul&gt; &lt;span style="font-family: arial;"&gt;So far I have used it for a Java, a Python and a .NET project; and all that just in one day!&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;Take a test drive of it (&lt;/span&gt;&lt;a style="font-family: arial;" href="https://hudson.dev.java.net/hudson.jnlp"&gt;check out the webstart&lt;/a&gt;&lt;span style="font-family: arial;"&gt;) and you will be pleasantry surprised.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-253961776997836115?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/253961776997836115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=253961776997836115' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/253961776997836115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/253961776997836115'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2007/07/continuous-integration-made-easy.html' title='Continuous integration made easy'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-3140445247554035178</id><published>2007-01-19T22:33:00.000+01:00</published><updated>2007-01-19T22:49:01.558+01:00</updated><title type='text'>Continued inconsistencies in .NET</title><content type='html'>&lt;span style="font-family: arial;"&gt;Everyone complains that Java has their inconsistencies and then points in .NET direction and says that it is so much greater, and less inconsistencies. Somehow I can understand that java has a few of those as it has evolved since the middle of the 90's to what we have today. But I can not understand how .NET can have those as it has only evolved in the last few years.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;But today, I found one inconsistency that I thought was very strange. This is a very minor inconsistency, but as the two events has been developed at the same time it makes it much worse. These two events must been under development at the same time and it has probably been developed by the same team or perhaps the same people &lt;span style="font-style: italic;"&gt;(imaging the horror)&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;On the Form class there are two events, to notify listeners that a Form/Window has received focus/lost focus. There are two events which can be subscribed upon:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-family: arial;" href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.form.activated%28VS.80%29.aspx"&gt;Form.Activated&lt;/a&gt;&lt;br /&gt;&lt;a style="font-family: arial;" href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.form.deactivate%28VS.80%29.aspx"&gt;Form.Deactivate&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Notice the difference, one is past tense and the other one isn't. C'mon these two events must have been developed at the same time, but somehow they screwed up anyhow. The more I look at the Windows.Forms API, the lesser I think of it. There are so many bad decisions in it, so many rushed things. But of course it is only a small API on top of the windows API, and they can only do so much with it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Strange, that Sun managed to a dynamic, layout managed GUI like Swing with the same APIs. It makes you think on who hired the right guys....&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-3140445247554035178?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/3140445247554035178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=3140445247554035178' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/3140445247554035178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/3140445247554035178'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2007/01/continued-inconsistencies-in-net.html' title='Continued inconsistencies in .NET'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-1981938186068341213</id><published>2006-12-21T13:46:00.000+01:00</published><updated>2006-12-21T14:17:59.354+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>I need a better "Go to definition" in VS2005 (similar to Eclipse)</title><content type='html'>&lt;span style="font-family: arial;"&gt;I wish MS could implement a little smarter/better &lt;span style="font-style: italic; font-family: arial;"&gt;"Go to definition" &lt;/span&gt;&lt;span style="font-family: arial;"&gt;feature. Today it almost works as it should. The &lt;/span&gt;&lt;span style="font-style: italic; font-family: arial;"&gt;"Go to definition"&lt;/span&gt; feature is used to go to the row where something is defined (a method, a variable, etc). Which is very handy if you are maintaining a project without any code documentation at all. But unfortunately the function will be confused if there are two methods that are named the same, but have different arguments.  (&lt;/span&gt;&lt;a style="font-family: arial;" href="http://en.wikipedia.org/wiki/Method_overloading"&gt;It is called method overloading&lt;/a&gt;&lt;span style="font-family: arial;"&gt;) &lt;/span&gt;&lt;span style="font-family: arial;"&gt;&lt;span style="font-family: arial;"&gt;Visual Studio 2005 is an &lt;span style="font-style: italic;"&gt;"ok"&lt;/span&gt; IDE, but it is no way near Eclipse. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;With VS2005, it will instead of moving the cursor to the method, it will move focus to a &lt;span style="font-style: italic;"&gt;"Find symbol results"&lt;/span&gt; view where it displays those methods that have the same name. VS2005 could very easily look into the code and find out the type of method arguments and move focus to the method I wanted to see. But apparently it can not distinguish between an int and an ArrayList.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Try the below code in Eclipse and VS2005, and try to go the correct method that is used in "anotherMethod". (In Eclipse use "&lt;span style="font-style: italic;"&gt;Open declaration"&lt;/span&gt;). Eclipse will move you directly to the correct method (&lt;span style="font-style: italic;"&gt;method(int,ArrayList)&lt;/span&gt;), while VS2005 will just show a simple search result.&lt;/span&gt;&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;public void method(int i, int j)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void method(int i, ArrayList list)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void otherMethod()&lt;br /&gt;{&lt;br /&gt;    int i = 2;&lt;br /&gt;    int j = 2;&lt;br /&gt;    method(i, j);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void anotherMethod()&lt;br /&gt;{&lt;br /&gt;    int i = 2;&lt;br /&gt;    ArrayList list = new ArrayList();&lt;br /&gt;    method(i, list);&lt;br /&gt;}&lt;/blockquote&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: arial;"&gt;&lt;span style="font-weight: bold;"&gt;To me it feels like Eclipse is developed by developers for developers&lt;/span&gt;. VS2005 is developed by someone for developers. If they had used the IDE on a daily basis they would understand that the current &lt;span style="font-style: italic;"&gt;"Go to definition"&lt;/span&gt; is not properly implemented. They should be able to do a better implementation than this semi solution.&lt;br /&gt;Another good example of that VS2005 is not developed by developers, is the lack of unit testing understanding in VS2005, &lt;/span&gt;&lt;a style="font-family: arial;" href="http://redsolo.blogspot.com/2006/11/frustration-grows-when-unit-testing.html"&gt;which I already blogged about&lt;/a&gt;&lt;span style="font-family: arial;"&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-1981938186068341213?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/1981938186068341213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=1981938186068341213' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1981938186068341213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1981938186068341213'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/12/i-need-better-go-to-definition-in.html' title='I need a better &quot;Go to definition&quot; in VS2005 (similar to Eclipse)'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-1728531289174973412</id><published>2006-12-21T11:00:00.000+01:00</published><updated>2006-12-21T13:37:40.969+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>OO Parenting by MS</title><content type='html'>&lt;span style="font-family:arial;"&gt;I really love object orientation (&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;OO&lt;/span&gt;), because it is so easy to build software using it; and it is so easy to totally screw up using it. Today I was surprised when I was trying to find out some information about the Select method in System.Windows.Forms.Control. The &lt;/span&gt;&lt;a style="font-family: arial;" href="http://msdn2.microsoft.com/en-us/library/7wt11hea.aspx"&gt;documentation for the Select method&lt;/a&gt;&lt;span style="font-family:arial;"&gt; states what the method does and &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;doe&lt;span style="font-family: arial;"&gt;sn't&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: arial;"&gt; do, but it also informs what inheriting classes that does not support it. Of course, every parent class should know everything about the inheriting classes; and have documentation on everything&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Excerpt from the documentation:&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;&lt;/span&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;The Windows Forms controls in the following list are not selectable. Controls derived from controls in the list will also not be selectable.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    * Label&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    * Panel&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    * &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;GroupBox&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    * &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;PictureBox&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    * &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;ProgressBar&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    * Splitter&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:courier new;" &gt;    * &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;LinkLabel&lt;/span&gt; (when there is no link present in the control)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;C'mon&lt;/span&gt;, why put the Select method in the Control class if they know that many inheriting classes will not implement it at all. This solution/idea reeks of bad design! If a Control does not support a certain functionality, then that class should not have a method pretending to support the functionality.&lt;/span&gt;&lt;span style="font-family:arial;"&gt; But this is not &lt;a href="http://redsolo.blogspot.com/2006/08/changing-text-on-splitcontainer-what.html"&gt;the first time I found a similar problem&lt;/a&gt; with the &lt;span style="font-style: italic;"&gt;"design"&lt;/span&gt; of Windows Forms, so I will stop whining here....&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-1728531289174973412?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/1728531289174973412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=1728531289174973412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1728531289174973412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1728531289174973412'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/12/parents-is-responneed-to-know-what.html' title='OO Parenting by MS'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-1325402405010007806</id><published>2006-11-30T10:55:00.000+01:00</published><updated>2006-11-30T15:43:32.039+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Unit testing'/><title type='text'>Frustration grows when unit testing with VS2005</title><content type='html'>&lt;span style="font-family:arial;"&gt;I've always liked unit testing as it makes my job as a software developer much easier. But the unit testing features of &lt;span style="font-style: italic;"&gt;Visual Studio 2005&lt;/span&gt; makes me very frustrated and tired of writing unit tests.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;There are two big key issues when using unit testing in &lt;span style="font-weight: bold;"&gt;VS2005&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;&lt;ul style="font-family: arial;"&gt;&lt;li&gt;When I have executed a test and it fails; it will show up in a list with a red icon. When I double click on the failing row/test it will show a report stating what went wrong. &lt;span style="font-style: italic;"&gt;Tell me something I don't know, and move the focus to the failed assertion.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;When I have fixed a bug in the project under test, I would like to re-run the test. In the &lt;span style="font-style: italic;"&gt;"Test results"&lt;/span&gt; window I can choose&lt;span style="font-style: italic;"&gt; "Rerun original test"&lt;/span&gt;. When I click on it, it will re-run the test with the old code; and the test will fail again even if I fixed the bug. &lt;span style="font-style: italic;"&gt;What happened, didn't I fix the code??&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;What the h**l is &lt;span style="font-style: italic;"&gt;"Assert.Fail failed."&lt;/span&gt;?&lt;/li&gt;&lt;/ul&gt;&lt;div  style="text-align: center;font-family:arial;"&gt;&lt;span style="font-size:130%;"&gt;Visual Studio 2005:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div  style="text-align: center;font-family:arial;"&gt;&lt;a href="http://ramfelt.se/blog/redsolo/0611/unit_testing_failures_vs.PNG"&gt;&lt;img src="http://ramfelt.se/blog/redsolo/0611/unit_testing_failures_vs_thumb.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div face="arial" style="text-align: center;"&gt;&lt;span style="font-size:130%;"&gt;Eclipse:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center; font-family: arial;"&gt;&lt;a href="http://ramfelt.se/blog/redsolo/0611/unit_testing_failures_eclipse.PNG"&gt;&lt;img src="http://ramfelt.se/blog/redsolo/0611/unit_testing_failures_eclipse_thumb.PNG" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:130%;"  &gt;&lt;br /&gt;Issue 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Since the test report window has already displayed that the test fail, I'm not interested in a report stating that the test failed, I know already that the test failed and (hopefully) the reason for it. What I am interested in is which assertion failed and where it is.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;In VS2005 I have to do the following to get to the assertion:&lt;/span&gt;&lt;br /&gt;&lt;ol style="font-family: arial;"&gt;&lt;li&gt;Double click the failure in the "Test results" window.&lt;/li&gt;&lt;li&gt;Find the row number by reading the text in the stack trace section. Add row number to memory.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Open the unit testing code file.&lt;/li&gt;&lt;li&gt;Go to the row found in step 2&lt;/li&gt;&lt;li&gt;Fix the assertion&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-family:arial;"&gt;In Eclipse it is so much easier:&lt;/span&gt;&lt;br /&gt;&lt;ol style="font-family: arial;"&gt;&lt;li&gt;Click on the failure in the "Junit" window.&lt;/li&gt;&lt;li&gt;Double click on the "AssertionFailed" in the "Failure trace"&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Fix the assertion&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-family:arial;"&gt;C'mon; 4 steps and many user interactions involving remembering trivial values to show the failed assertion. It is really frustrating to do it whenever something fails. If something is frustrating and takes time, the developer will stop doing it; thus stop unit testing the software. There is no context menu item to go to the failed assertion, only to go to the begining of the test method. With test cases that can be long, it is not so easy to find the failed assertion.&lt;/span&gt;&lt;span style="font-family:arial;"&gt; Below is the test report that is shown when the user double clicks on the failure. &lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: center; font-family: arial;"&gt;&lt;a href="http://ramfelt.se/blog/redsolo/0611/unit_testing_failures_2.PNG"&gt;&lt;img src="http://ramfelt.se/blog/redsolo/0611/unit_testing_failures_2_thumb.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span&gt;Issue 2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;I have one project that contains the production code, and one test project next to it as I don't want to mix production code with test code. I've created a test project, added a reference to the production project, and verified that the test project depended on the main project. The test project can access the production classes, so far everything is fine.&lt;br /&gt;&lt;br /&gt;But the problem comes when one of the tests fails because of a bug in a production class. When I update the code in the production project, and want to debug the last failed test I click on the &lt;span style="font-style: italic;"&gt;"Debug original test"&lt;/span&gt;. Sure the debugger starts, but the problem is that VS2005 forgot to build the whole solution including the production project. Instead of rebuilding the production project it will only rerun the test. &lt;span style="font-weight: bold;"&gt;The test will of course fail again, and I will be sitting there wondering if my fix didn't do anything. &lt;/span&gt;This has happen to many times, and I've wasted numerous minutes before realising that I must manually build the solution.&lt;br /&gt;&lt;br /&gt;Perhaps I'm not using the features correctly, and MS has another view on old test results. Maybe test results should be saved every time a test is run. But for me test results has a very limited lifetime, as soon as I've fixed an error; I don't care about the results prior to the fix.&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;This does not happen in Eclipse, the minute that I've updated the code I can re-run the test by clicking on &lt;span style="font-style: italic;"&gt;"Re-run Last Test - Failures first"&lt;/span&gt;. No rebuild needed, no time spent wondering why a fix doesn't work.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;Issue 3&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:85%;"  &gt;&lt;span style="font-style: italic;"&gt;(Minor)&lt;/span&gt; &lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;I just saw this when writing this blog. How can an &lt;span style="font-style: italic;"&gt;Assert.Fail()&lt;/span&gt; fail? The failure text states that the Assert.Fail() itself failed, to me that is not correct. The test failed itself, and should perhaps say &lt;span style="font-style: italic;"&gt;"Failed due to an Assert.Fail() call". &lt;/span&gt;Unfortunately Eclipse is not much better as it states &lt;span style="font-style: italic;"&gt;"AssertionFailedError"&lt;/span&gt; for a &lt;span style="font-style: italic;"&gt;fail()&lt;/span&gt; call, but still that is better than VS2005.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Opinion&lt;/span&gt;&lt;br /&gt;The VS2005 unit testing features are not user friendly, they don't help the user as good as they could. Sometimes a tool with a bad feature implementation is worse than a tool without the feature. Perhaps MS can improve the usability in VS2005, and make it easier for us developer that wants to utilise unit testing. It seems that the above design misstakes must be developed by people who doesn't practice unit testing.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-1325402405010007806?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/1325402405010007806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=1325402405010007806' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1325402405010007806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1325402405010007806'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/11/frustration-grows-when-unit-testing.html' title='Frustration grows when unit testing with VS2005'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-1005778150813710359</id><published>2006-11-23T15:53:00.000+01:00</published><updated>2006-11-23T16:42:00.101+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WTF'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>Why no Equals() and GetHashCode()  in System.Collection?</title><content type='html'>&lt;span style="font-family:arial;"&gt;Today I had another brain freeze when I was trying to understand why two array lists would generate two different hash codes even if they contained the same data. But when I started my investigation in &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;MSDN&lt;/span&gt;, I see that the &lt;span style="font-style: italic;"&gt;&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;ArrayList&lt;/span&gt; &lt;/span&gt;does not override the &lt;span style="font-style: italic;"&gt;&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;GetHashCode&lt;/span&gt;()&lt;/span&gt; nor the&lt;span style="font-style: italic;"&gt; Equals()&lt;/span&gt; method. &lt;span style="font-style: italic;"&gt;&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Ehhhhh&lt;/span&gt;?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;So my question is how can I check if two lists are equal? NO, I &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;don't&lt;/span&gt; want to go through all items. This should be handled by the framework classes and I &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_5"&gt;don't&lt;/span&gt; want to do any unnecessary implementation.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;If I look in &lt;span style="font-weight: bold;"&gt;Java, &lt;/span&gt;the &lt;span style="font-style: italic;"&gt;&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;ArrayList&lt;/span&gt; &lt;/span&gt;implements &lt;span style="font-style: italic;"&gt;equals(), &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;hashCode&lt;/span&gt;()&lt;/span&gt; as all good objects should. They have also a good &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_8"&gt;explanation&lt;/span&gt; on how it is done &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html#hashCode%28%29"&gt;here&lt;/a&gt;. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;If I look through the other classes in &lt;span style="font-style: italic;"&gt;System.Collection&lt;/span&gt; I see that no implements &lt;span style="font-style: italic;"&gt;&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;GetHashCode&lt;/span&gt;()&lt;/span&gt; or &lt;span style="font-style: italic;"&gt;Equals()&lt;/span&gt;. If none of them do, then it must be a design choice. But what design choice would that be? If anyone have any &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_10"&gt;explanation&lt;/span&gt;, please make a comment to this blog. I really want to know.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;There is an interface in&lt;span style="font-style: italic;"&gt; System.Collections.Generic&lt;/span&gt; that is named&lt;span style="font-style: italic;"&gt; &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;IEqualityComparer&lt;/span&gt;&lt;/span&gt;, which has two methods, &lt;span style="font-style: italic;"&gt;Equals()&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;GetHashCode&lt;/span&gt;()&lt;/span&gt;. Why make an interface when every class implements those methods? And why doesn't the default list/collection classes implement this interface?&lt;br /&gt;&lt;br /&gt;I did a little test application to test this out, because I can not believe it. &lt;a href="http://pastebin.com/831400"&gt;Full listing here.&lt;/a&gt;&lt;br /&gt;Pseudo code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;string a = "A";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            string b = "B";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;ArrayList&lt;/span&gt; list1 = new &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;ArrayList&lt;/span&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            list1.Add(a);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            list1.Add(b);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;ArrayList&lt;/span&gt; list2 = new &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;ArrayList&lt;/span&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            list2.Add(a);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            list2.Add(b);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            Console.&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;WriteLine&lt;/span&gt;("list1.equals(list2) ? " + (list1.Equals(list2)));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            Console.&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;WriteLine&lt;/span&gt;("list1.equals(list1.clone) ? " + (list1.Equals(list1.Clone())));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            Console.&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;WriteLine&lt;/span&gt;("list1.hash == list2.hash ? " + (list1.&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;GetHashCode&lt;/span&gt;() == list2.&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;GetHashCode&lt;/span&gt;()));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;This program would show:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;list1.Equals(list2) ? False&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;list1.Equals(list1.Clone()) ? False&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;list1.hash == list2.hash ? False&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;If I create two array lists that contains the same items, the &lt;span style="font-style: italic;"&gt;Equals()&lt;/span&gt; method will return &lt;span style="font-weight: bold;"&gt;FALSE&lt;/span&gt;. If I clone an array list and checks if they are equal the &lt;span style="font-style: italic;"&gt;Equals()&lt;/span&gt; method returns &lt;span style="font-weight: bold;"&gt;FALSE&lt;/span&gt;. How can a CLONE not be an exact copy of the object, or how can two exact copies not be equal to each other?&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The best part is that &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;Hashtable&lt;/span&gt; &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_28"&gt;doesn't&lt;/span&gt; implement &lt;span style="font-style: italic;"&gt;&lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;GetHashCode&lt;/span&gt;()&lt;/span&gt; either. And that class require all other objects to implement that method in order to be used, but they refuse to do it themselves. &lt;span style="font-weight: bold; font-style: italic;"&gt;"Do what I tell you, not what I do."&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Is it because they know people will not implement those &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_25"&gt;methods&lt;/span&gt; since developers are lazy? But why have they put them into the Object class if they can't be trusted? Or was it a copy-paste &lt;span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_26"&gt;mistake&lt;/span&gt; from Java? &lt;/span&gt;&lt;span style="font-family:arial;"&gt;To me this is so wrong.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-1005778150813710359?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/1005778150813710359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=1005778150813710359' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1005778150813710359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1005778150813710359'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/11/why-no-equals-and-gethashcode-in.html' title='Why no Equals() and GetHashCode()  in System.Collection?'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-7473994818117749439</id><published>2006-11-20T15:48:00.000+01:00</published><updated>2006-11-20T16:42:18.968+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Localisation'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Localisation with VS2005 will slow you down</title><content type='html'>&lt;span style="font-family:arial;"&gt;In my previous &lt;a href="http://redsolo.blogspot.com/2006/11/localisation-gone-wrong-in-c.html"&gt;blog about a localisation that went sour&lt;/a&gt;, I mentioned that the time for building a localised application takes longer and longer for every language that is added. I have now quantified my feeling and found out that adding a language adds 15-20 seconds for each language. Now that doesn't sound that bad right? &lt;span style="font-weight: bold;"&gt;Wrong&lt;/span&gt;, If you develop an application that takes one minute to build and adding languages almost triples that time, then it becomes tedious very quickly.&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;This is what I found out&lt;span style="font-style: italic;"&gt; (&lt;/span&gt;&lt;a style="font-style: italic;" href="http://ramfelt.se/blog/redsolo/0611/Table.PNG"&gt;table &lt;/a&gt;&lt;span style="font-style: italic;"&gt;and &lt;/span&gt;&lt;a style="font-style: italic;" href="http://ramfelt.se/blog/redsolo/0611/Graph.PNG"&gt;graph&lt;/a&gt;&lt;span style="font-style: italic;"&gt;)&lt;/span&gt;:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;Default language took 69 seconds to build&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;With two languages it took 85 seconds to build (16 extra seconds)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;With four languages it took 118 seconds to build (49 extra seconds)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;With six languages it took 144 seconds to build (75 extra seconds)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;If a normal developer compiles 10 times an hour to test something, he/she will waste 12 minutes, just sitting to wait for VS2005 to build. I meanthat is an outrageous extra time, and I wonder if we can send a invoice to Microsoft for those hours that we just wait for the build complete?&lt;/span&gt; &lt;span style="font-family:arial;"&gt;And I guess we have to make the work day longer as we get much less done.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;For this project, the solution was to remove all language resource files from the project file. This means that the only language that is supported in mid-development is "default" and nothing else. &lt;span style="font-style: italic;"&gt;So fixing those too narrow labels for localised texts has to wait for another day.&lt;/span&gt;  The tool do add/remove all those languages to/from the project file is developed in house and can not be shared unfortunately. The tool is very simple to create, but in my view unnecessary.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Here we have a grave problem with the localisation in Visual Studio 2005. If it is done as MS wants, the build time to a project can (and probably will) go up for every language added. What is the outcome of that? Either the developer will stop adding localisations, constrain the development by only showing the default or sit and do nothing while the project builds.&lt;/span&gt;&lt;span style="font-family:arial;"&gt;  This is not a good solution. I would rather have a one-file seperate from the GUI, which reads on the fly when the application is started. That way the language files does not affect the build at all, and it will be a minor load time added for the user which probably will not be noticed.&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Measurement notes:&lt;/span&gt;&lt;/span&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;This is an observation of an application that has been under development for 3-4 years.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;They have tried to follow MS design guidelines.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;Clear case is used with dynamic views, which could have an impact on the result as it needs to access 200 new files for every added language.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;The application is not divided up into more than 2 GUI projects. Perhaps adding more sub projects could make the build quicker?&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;I used a C# application to measure the time it took to execute a bat file containing&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;"devenv app.sln /build debug"&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:arial;"&gt;I measured each language addition at least 4 times&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-7473994818117749439?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/7473994818117749439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=7473994818117749439' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/7473994818117749439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/7473994818117749439'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/11/localisation-with-vs2005-will-slow-you.html' title='Localisation with VS2005 will slow you down'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-4258330958070284865</id><published>2006-11-13T14:26:00.000+01:00</published><updated>2006-11-13T23:30:00.403+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Localisation'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Localisation gone bad in C#</title><content type='html'>&lt;span style="font-family:arial;"&gt;I'm doing maintenance on a huge C# application that was developed for a swedish customer. A while ago it was decided that the application should be sold outside Sweden, and therefore it had to be localised in english, romanian, chinese, etc. The application consists of roughly 200 controls/panels and forms. It was a huge task to translate everything, and from what I now can see MS Visual Studio 2005 did not help very much (as I'm maintaining it right now).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Apparently one new thing in VS, is that you can localise each and every control/form in the designer. That is nice when you have a few forms and controls that do not use the same words all the time. The developer creates a form, changes the language property and inserts all the translated texts. It is very easy to change a word in swedish to english, and it is all GUI based. But what happens if you have 200 controls/forms that share many texts? I have not figured out how to do that in VS2005 and GUI elements. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Developers are lazy (and they should be), so they will use the easiest way out. In this case it meant that nobody cared that the same words were used in many forms. Sometimes, people missed a label here and there. And for me maintaining it, it isn't nice.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I demand these things out of a localisation framework&lt;/span&gt;&lt;br /&gt;&lt;ul  style="font-family:arial;"&gt;&lt;li&gt;One file for each language. &lt;span style="font-style: italic;"&gt;- VS2005 brings you one file for each language and GUI control. In the project it means 1,000 new XML files to handle. That is not good.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;One method call to get the texts for a language. &lt;span style="font-style: italic;"&gt;- &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Yes, .NET helps partly with this (I will blog another rant about this later)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Ability to change locale during runtime. &lt;span style="font-style: italic;"&gt;- Yes, it is possible in .NET.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;I need the following tools:&lt;/span&gt;&lt;br /&gt;&lt;ul  style="font-family:arial;"&gt;&lt;li&gt;Tool to find duplicates so they can be erased, and defined in one place. (Think OO but with languages) - &lt;span style="font-style: italic;"&gt;VS2005 does not help you at all.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Tool to spell check localisation files. Apparently there is no such tool out there. - &lt;span style="font-style: italic;"&gt;I have not seen anything in VS2005.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Tool to show missing translations for a language. &lt;span style="font-style: italic;"&gt;- Nope, the company had to build their own software to extract missing translations and merging. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;So what I got was to "translate" around 200 "missing" translation in an XML file, out of them there were 50 "OK", 5 "Cancel", 10 "Index", 15 "Close", etc. I can sure tell you that it could have been very tedious, but I built a very simple tool that would go through the file, so I didn't have to bother with copying/pasting. But once again, I have to develop tools to do stuff that the IDE should have helped me with. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;Side note:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;They discovered a side effect of adding new languages to the project files, for every new language you had to add 200 files, this made the project bigger and bigger. Now it takes eons to compile, and one of the core developers came up with the idea to remove all localisation files from the project files. When that was done, the time to compile was drastically cut which was good. Unfortunately we we're in integration testing and could not test any of the localisation bug fixes (&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;D'oh&lt;/span&gt;&lt;span style="font-family:arial;"&gt;).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;So what did they end up with when using Visual Studio and .NET?&lt;/span&gt;&lt;br /&gt;&lt;ul style="font-family: arial;"&gt;&lt;li&gt;Duplicated texts all over the resource files.&lt;/li&gt;&lt;li&gt;200 new files for each language&lt;/li&gt;&lt;li&gt;Compilation time sky rocketed &lt;span style="font-weight: bold; font-style: italic;"&gt;(I will bring stats for this later this week)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Developed their own tools to handle the resource files (RESX) which require maintenance, etc.&lt;/li&gt;&lt;li&gt;Forms that were not properly translated, which wasn't found out until the system test phase (or even later).&lt;/li&gt;&lt;li&gt;And lets not forget the need to update the size of every button/label to cater for romanian texts. That is also tedious and really unnecessary work.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-style: italic;"&gt;What is the proper way to do localisation in .NET and Visual Studio? What did they do wrong? What is the easier way out?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-4258330958070284865?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/4258330958070284865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=4258330958070284865' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/4258330958070284865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/4258330958070284865'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/11/localisation-gone-wrong-in-c.html' title='Localisation gone bad in C#'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-1353500528793159749</id><published>2006-11-06T17:18:00.000+01:00</published><updated>2006-11-07T14:05:38.048+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>TabControl, ListView and checking list items</title><content type='html'>&lt;span style=";font-family:arial;font-size:100%;"  &gt;Today I found an odd feature with the &lt;span style="font-style: italic;"&gt;ListView &lt;/span&gt;GUI control. The list view must be the king of Windows controls. I mean, what can't it do? It can display lists in 5 different ways, which is increasing as Windows evolves. It can even display a list with check boxes for each item, very similar to the &lt;span style="font-style: italic;"&gt;CheckedListBox&lt;/span&gt;. But the &lt;span style="font-style: italic;"&gt;ListView &lt;/span&gt;behaves very differently when it comes to checking and unchecking list items if it is placed in a &lt;span style="font-style: italic;"&gt;TabControl&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The event &lt;span style="font-style: italic;"&gt;ItemCheck &lt;/span&gt;should be called when the user or code checks an item in the list. But the oddity I found was that the &lt;span style="font-style: italic;"&gt;ItemCheck &lt;/span&gt;event method would &lt;span style="font-weight: bold;"&gt;NOT&lt;/span&gt; be called when code/user checks a list item, but the event is first called when the user clicked on the tab that contained the control.&lt;br /&gt;&lt;br /&gt;This is what I did &lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:85%;"  &gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family:arial;"&gt;Full source code available at &lt;a href="http://pastebin.com/818663"&gt;pastebin.com&lt;/a&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;:&lt;br /&gt;&lt;/span&gt; &lt;ul  style="font-family:arial;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Created a &lt;span style="font-style: italic;"&gt;Form &lt;/span&gt;with a &lt;span style="font-style: italic;"&gt;ListBox, TabControl &lt;/span&gt;and a &lt;span style="font-style: italic;"&gt;ListView&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;The &lt;span style="font-style: italic;"&gt;TabControl &lt;/span&gt;contains 3 tab pages, the initial tab with a button, the second tab with a second &lt;span style="font-style: italic;"&gt;ListView &lt;/span&gt;and the third tab page contained a &lt;span style="font-style: italic;"&gt;CheckedListBox.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Added event listeners for all three lists that would add text into the &lt;span style="font-style: italic;"&gt;ListBox &lt;/span&gt;to show what happens and when.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;When pressing the button, it will check the first item in all lists (the two &lt;span style="font-style: italic;"&gt;ListViews &lt;/span&gt;and the &lt;span style="font-style: italic;"&gt;CheckedListBox).&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;span style=";font-family:arial;font-size:100%;"  &gt;This is what I found:&lt;/span&gt;&lt;a style="font-family: arial;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/747/452/1600/btnClick.png"&gt;&lt;/a&gt; &lt;ul  style="font-family:arial;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;When the button was clicked, it would call the &lt;span style="font-style: italic;"&gt;ItemCheck &lt;/span&gt;method on the&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;span style="font-style: italic;"&gt;CheckedListBox &lt;/span&gt;and the ListView outside the tab control. It would &lt;span style="font-weight: bold;"&gt;NOT&lt;/span&gt; call the &lt;span style="font-style: italic;"&gt;ItemChe&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-style: italic;"&gt;ck &lt;/span&gt;method on the &lt;span style="font-style: italic;"&gt;ListView &lt;/span&gt;inside tab page 2.&lt;/span&gt; &lt;a href="http://ramfelt.se/blog/redsolo/btnClick.png"&gt;(Form screen shot)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;When I clicked on tab page 2, then it would call the &lt;span style="font-style: italic;"&gt;ItemCheck &lt;/span&gt;method on the &lt;span style="font-style: italic;"&gt;ListView &lt;/span&gt;inside that tab page. &lt;/span&gt;&lt;a href="http://ramfelt.se/blog/redsolo/tabClick.PNG"&gt;(Form screen shot).&lt;/a&gt; Somehow the &lt;span style="font-style: italic;"&gt;ListView &lt;/span&gt;remembered that I wanted some of the items checked.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;Now we have two differently behaviours depending if a &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;ListView &lt;/span&gt;&lt;span style="font-size:100%;"&gt;is inside a tab control or not.&lt;/span&gt;&lt;br /&gt;&lt;ol  style="font-family:arial;"&gt;&lt;li&gt;If a &lt;span style="font-style: italic;"&gt;ListView &lt;/span&gt;is outside a tab control it will call the &lt;span style="font-style: italic;"&gt;ItemCheck &lt;/span&gt;method when the property is changed. But if the &lt;span style="font-style: italic;"&gt;ListView &lt;/span&gt;is inside a tab control (that isn't visible) it will not call the &lt;span style="font-style: italic;"&gt;ItemCheck &lt;/span&gt;method when the property is changed.&lt;a href="http://ramfelt.se/blog/redsolo/btnClick.png"&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;A &lt;span style="font-style: italic;"&gt;CheckedListBox &lt;/span&gt;inside a tab control (not visible) will call the &lt;span style="font-style: italic;"&gt;ItemCheck &lt;/span&gt;method when the property is changed; and the &lt;span style="font-style: italic;"&gt;ListView &lt;/span&gt;will not call the &lt;span style="font-style: italic;"&gt;ItemCheck &lt;/span&gt;method. &lt;a href="http://ramfelt.se/blog/redsolo/tabClick.PNG"&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt; &lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Workaround:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;In our case I solved it by setting a boolean to false in the &lt;span style="font-style: italic;"&gt;TabControl_SelectedIndexChanged&lt;/span&gt;() event, and then setting it to true in the &lt;span style="font-style: italic;"&gt;TabControl_Selected&lt;/span&gt;() event. This way I can check from the boolean if the &lt;span style="font-style: italic;"&gt;ItemCheck&lt;/span&gt;() comes from the user or is cached by the &lt;span style="font-style: italic;"&gt;ListView&lt;/span&gt;. If the boolean is &lt;span style="font-weight: bold;"&gt;true, &lt;/span&gt;then I know the user checked a list item.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="font-style: italic;font-family:arial;" &gt;C'mon, which is the correct behaviour?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-style: italic;"&gt;Why is there a need for a different behaviour?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Why do I have to bother?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="font-family:arial;"&gt;Perhaps I didn't know that it is common GUI-OO design to have one implementation if a control is in a &lt;span style="font-style: italic;"&gt;TabControl &lt;/span&gt;and one if it isn't.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-1353500528793159749?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/1353500528793159749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=1353500528793159749' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1353500528793159749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/1353500528793159749'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/11/tabcontrol-listview-and-checking-list.html' title='TabControl, ListView and checking list items'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-116172500225494742</id><published>2006-10-24T22:57:00.000+02:00</published><updated>2006-11-06T11:09:29.626+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>C# Trolls vs. Java Trolls. (wikipedia wars)</title><content type='html'>&lt;span style="font-family:arial;"&gt;A month ago when I added the different release names for &lt;a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29"&gt;Java&lt;/a&gt; in wikipedia, I saw that there were quite a few troll edits in the page. &lt;span style="font-style: italic;"&gt;(Troll edit = people adding/changing wikipedia pages for no good reason)&lt;/span&gt; Then I went over to the &lt;a href="http://en.wikipedia.org/wiki/Csharp"&gt;C#&lt;/a&gt; page in wikipedia, and just looked over the history &lt;/span&gt;&lt;span style="font-family:arial;"&gt;very quickly &lt;/span&gt;&lt;span style="font-family:arial;"&gt;and it seemed that there were less troll edits on that page. That got me thinking of the &lt;span style="font-weight: bold;"&gt;"war"&lt;/span&gt; between Java and C#; a war that developers loves to fight &lt;span style="font-style: italic;"&gt;"What programming language is the best?" &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;Uncanny similar to the youth discussion on whos dad could kick the other dad butt.&lt;br /&gt;&lt;br /&gt;Anyhow, this evening I had 30 mins to spare, so I did a very unscientific investigation to see which faction that had entered the most troll comments into the other factions wikipedia page. So I went through all the latest 200 changes for each page. &lt;span style="font-style: italic;font-size:85%;" &gt;Thanks for Firefox excellent tab support, I could do it quite quickly with Ctrl+Tab and Ctrl+W&lt;/span&gt;. What I found was this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The &lt;a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29"&gt;Java&lt;/a&gt; wikipedia page had been troll edited 12 times. Some examples of the changes:&lt;/span&gt;&lt;br /&gt;&lt;ul  style="font-family:arial;"&gt;&lt;li&gt;&lt;span style="font-style: italic;" class="diffchange"&gt;"Java Database &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Connectivity" &lt;/span&gt;was changed into &lt;span style="font-style: italic;"&gt;"&lt;/span&gt;&lt;span style="font-style: italic;" class="diffchange"&gt;help me groe &lt;/span&gt;&lt;span style="font-style: italic;"&gt;Connectivity"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;"&lt;/span&gt;&lt;span class="diffchange"&gt;&lt;span style="font-style: italic;"&gt;IAN Hitchcox is a BIG qeer"&lt;/span&gt; - Whatever that means...&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="diffchange"&gt;Changing the name of James Gosling into &lt;span style="font-style: italic;"&gt;"Giant Lava"&lt;/span&gt; or &lt;span style="font-style: italic;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;" class="diffchange"&gt;Michael Adolf Gow"&lt;/span&gt;&lt;span class="diffchange"&gt;... Giant Java would be more appropiate, but that Adolf guy is unknown to me.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="diffchange"&gt;&lt;span style="font-style: italic;"&gt;"The entire java language centers around a single concept, IF Loops.&lt;/span&gt;" - Hmm, I think I have used a switch statement once in java.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;   &lt;span style="font-style: italic;"&gt; "Influenced by = ....&lt;/span&gt;&lt;span class="diffchange"&gt;&lt;span style="font-style: italic;"&gt;C sharp C#"&lt;/span&gt; - &lt;/span&gt;Well, that is not really true is it?&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;"Mr. Youngpradit - A acclamed computer science teacher teaching Java to high school students he also heads the extreme sports club and botball"&lt;/span&gt; - A computer science teacher that do extreme sports, that is a little far fetched.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Some made an incorrect note that Java's performance is really bad&lt;br /&gt;&lt;/li&gt;&lt;li&gt;And someone replaced all content on the page with &lt;span style="font-style: italic;"&gt;"&lt;/span&gt;&lt;span style="font-style: italic;" class="diffchange"&gt;XXXXXXXXXXXXXXX&lt;/span&gt;&lt;span style="font-style: italic;"&gt;"&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;The &lt;a href="http://en.wikipedia.org/wiki/Csharp"&gt;C#&lt;/a&gt; wikipedia page has been troll edited 4 times. Some examples:&lt;/span&gt;&lt;br /&gt;&lt;ul  style="font-family:arial;"&gt;&lt;li&gt;   &lt;span style="font-style: italic;"&gt;"A good example of this is the "Chad Rocks" program."&lt;/span&gt; - Seems like that Chad managed to write a good program with C#&lt;/li&gt;&lt;li&gt;Self advertising as '&lt;span style="font-style: italic;"&gt;'&lt;/span&gt;&lt;span style="font-style: italic;" class="diffchange"&gt;This article is being presented by Rakesh.S&lt;/span&gt;&lt;span style="font-style: italic;"&gt;, &lt;/span&gt;&lt;span style="font-style: italic;" class="diffchange"&gt;Bangalore&lt;/span&gt;&lt;span style="font-style: italic;"&gt;''&lt;/span&gt;, with email adress and all. Thanks, I probably won't contact this troll.&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;"C# is intended to be a '''simple, modern, general-purpose''', object-oriented programming language &lt;/span&gt;&lt;span style="font-style: italic;" class="diffchange"&gt;that does not work&lt;/span&gt;&lt;span style="font-style: italic;"&gt;."&lt;/span&gt; - I don't think that was copied from the MS requirement spec?&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;"&lt;/span&gt;&lt;span class="diffchange"&gt;&lt;span style="font-style: italic;"&gt;The language is very facist and Fleury can't program it for shit!"&lt;/span&gt; - Apparently someone was tired of both Fleury and C#.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;So what does this mean? I have no clue, but it seems that the C# Trolls won this round as they did manage to get in twice the number of troll edits into the Java page.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-family:arial;"&gt;Java Trolls - C# Trolls&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;0 - 1 &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;Yes, I was bored and no Im not serious, but the investigation was...&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-116172500225494742?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/116172500225494742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=116172500225494742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/116172500225494742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/116172500225494742'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/10/c-trolls-vs-java-trolls-wikipedia-wars.html' title='C# Trolls vs. Java Trolls. (wikipedia wars)'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-116136338093638963</id><published>2006-10-20T18:08:00.000+02:00</published><updated>2006-11-06T11:09:29.559+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Open source'/><title type='text'>Open source is not your enemy</title><content type='html'>&lt;span style="font-family:arial;"&gt;The last weeks, I've seen an emerge of Open Source (OS) critical blogs. Those blogs most of the times talk how OS either provides &lt;/span&gt;&lt;a style="font-family: arial;" href="http://blog.paytonbyrd.com/?p=42"&gt;no business opportunity&lt;/a&gt;&lt;span style="font-family:arial;"&gt;, low quality products, steals our jobs, &lt;/span&gt;&lt;a style="font-family: arial;" href="http://weblogs.asp.net/jezell/archive/2006/10/05/Open-Source_3A00_-It-Costs-Too-Much.aspx"&gt;are expensive&lt;/a&gt;&lt;span style="font-family:arial;"&gt;, &lt;/span&gt;&lt;a style="font-family: arial;" href="http://blogs.technet.com/bethpattonmsblog/archive/2006/09/13/455943.aspx"&gt;is for communists only&lt;/a&gt; or &lt;a href="http://eclipse-ecosystem.blogspot.com/2006/10/three-things-ive-learned-working-in.html#c116129512416433636"&gt;the participators are thiefs&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I don't get it. Why is open source so terrifying? Why is it so hard to understand that some people wants to collaborate on mutual project? Isn't it more fun to do stuff together than doing them yourself?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Communism?&lt;/span&gt;&lt;br /&gt;Most OS projects are developed together with other people, every one has a say. To me that sounds a lot more like Democracy, and definetly not communism. Has nothing changes since the McCarthy era?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Expensive?&lt;/span&gt;&lt;br /&gt;Sure, OSS don't have a support hot line which you can call, and it takes time to get used to ask your peers for help through mailing lists, or finding the information youself. But then, companies that charge for their commercial product can have bad support as well. How does it feel when you paid for it and don't get any help at all?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Stealing because they are incompetent?&lt;/span&gt;&lt;br /&gt;Well, that was one of the stupidiest comments I've read in a while. Is it a problem if someone else is using your code? Is it a problem that you are no longer the only expert of your code? There is a huge amount of projects that produce tools that I can't imagine how to code. If someone is an expert on something else, why not utilise them; instead of doing it yourself? OSS is the opposite of the "Not invented here" idea.&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight: bold;"&gt;No business opportunities?&lt;/span&gt;&lt;br /&gt;I'm sorry, but isn't MySQL, RedHat, JBoss successful companies? Don't they make money?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Steals our jobs?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt; Open Source Software (OSS) is not going to make all developers unemployed. You need to see it from the other side, OSS helps us produce better quality products. We no longer need to implement a LinkedList, a String class or a web server every time a new project is started. Building on top of OSS will get us to the goal quickier. Then if I make an adjustment to an OSS, I give something back to the community. I'm tired of re-inventing the wheel every day. But sure, if I'm a crappy developer, then I should be worried.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-116136338093638963?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/116136338093638963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=116136338093638963' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/116136338093638963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/116136338093638963'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/10/open-source-is-not-your-enemy.html' title='Open source is not your enemy'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-116064877622961494</id><published>2006-10-12T10:13:00.000+02:00</published><updated>2006-11-06T11:09:29.491+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>.NET lacks action; can't keep up with Swing</title><content type='html'>&lt;span style="font-family:arial;"&gt;Microsoft has really not understood the concept behind the GUI design pattern Model View Control (&lt;a href="http://en.wikipedia.org/wiki/Model-view-controller"&gt;MVC&lt;/a&gt;). As I understand .NET can not connect GUI controls to functionality (logic) objects &lt;span style="font-style: italic;"&gt;(that would be linking View to Control)&lt;/span&gt;. I've asked this question on common .NET sites, usenet groups and it seems that they missed out on this part totally. To me, it shows that the .NET Forms project was really rushed and misses major parts that Swing has had for 8 years.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;What I am talking about, is that Java Swing has &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/Action.html"&gt;Action &lt;/a&gt;classes that can be linked to GUI controls, which means that the GUI control uses the Action object when it has been activated (clicked for &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JButton.html#JButton%28javax.swing.Action%29"&gt;buttons&lt;/a&gt;, &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JMenuItem.html#JMenuItem%28javax.swing.Action%29"&gt;menu items&lt;/a&gt;, &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JComboBox.html#setAction%28javax.swing.Action%29"&gt;combo boxes&lt;/a&gt;, lists and even tree controls) . This Action class contains only the logic (Control) and nothing else; when activated from a GUI control it will perform it's functionality. The drawback with this approach that every major action needs their own class, which generate many more classes. But the benefit is that you can have several buttons/menu items, that uses ONE class to do a certain functionality. &lt;span style="font-style: italic;"&gt;It helps during maintenance, where I am right now.&lt;/span&gt; This is nice, when a certain Action is disabled &lt;span style="font-style: italic;"&gt;(for instance Save is disabled when the user doesn't have an active document)&lt;/span&gt;; because it will notify ALL controls that is connected to the Action object. So the developer does not have to care which dialogs/forms/menu that are visible and must be disabled, etc. It is just one simple &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/Action.html#setEnabled%28boolean%29"&gt;method call&lt;/a&gt;&lt;/span&gt;, and that is the beauty of it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Another nice thing with it, is that the Action class contains most of the important properties for a control:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* A &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/Action.html#NAME"&gt;name&lt;/a&gt; (for buttons) &lt;span style="font-style: italic;"&gt;(can be localised)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* A &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/Action.html#SHORT_DESCRIPTION"&gt;short description&lt;/a&gt; (read tool tip) &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;(can be localised)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* A &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/Action.html#ACCELERATOR_KEY"&gt;key accelerator&lt;/a&gt;, for short cut keys&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;* An &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/Action.html#SMALL_ICON"&gt;icon&lt;/a&gt; (next to the text in buttons and menu items)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;* An &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/Action.html#MNEMONIC_KEY"&gt;mnemonic key&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;So when I need to create a button and menu item, all I do is:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;anAction = new FileSaveAction();&lt;br /&gt;JButton button = new JButton(anAction);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;mainFramePanel.add(button);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;JMenuItem menu = new JMenuItem(anAction);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:courier new;"&gt;mainFrame.getJMenuBar().getMenu(0).add(anAction);&lt;br /&gt;anAction.setEnabled(false);&lt;br /&gt;//.. user opens a new document&lt;br /&gt;anAction.setEnabled(true);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The above code will create a button in the main frame panel, and a menu item. They will have the same text, the same icon, the same tool tip AND both are disabled at the same time. When the user opens a new document it is just one method call to enable both controls. Magic, isn't it? Or is it just properly designed?&lt;br /&gt;&lt;br /&gt;At my current project, which is a huge .NET project, they have many menu items and buttons that each of them needs to be enabled/disabled when some functionality is disabled. That generates alot of excess code that isn't needed and is &lt;span style="font-weight: bold;"&gt;hell&lt;/span&gt; to maintain. Since the application is localised in 5 different languages, the developer needs to code enable/disable functionality for least 2 GUI controls. And this means that each control needs 5 different localisations which needs to be set. Talk about unnecessary and unwanted work.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-116064877622961494?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/116064877622961494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=116064877622961494' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/116064877622961494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/116064877622961494'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/10/net-lacks-action-cant-keep-up-with.html' title='.NET lacks action; can&apos;t keep up with Swing'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-116029066327795865</id><published>2006-10-08T08:37:00.000+02:00</published><updated>2006-11-06T11:09:29.416+01:00</updated><title type='text'>MVP Paul Yao can't code (or is .NET too hard?)</title><content type='html'>&lt;span style="font-family:arial;"&gt;For more than a year ago, I visited the head quarter of my previous company's in Everett, Washington, USA to meet up with some colleagues and our new boss. One evening there was a WE.DIG (User group for MS, .NET) meeting and me and my friend wanted to participate. So we signed up on a website for that meeting, went to it and enjoyed the free pizza.&lt;/span&gt; This user group is run by Mr Paul Yao, a well known MS book writer and MVP.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Apparently the sign up included adding us to the mailing list from hell. For more than a year, I've tried to unsubscribe from the newsletter for WE-DIG. As I live in Sweden, I'm no longer interested in events in Seattle. So every month when I get a newsletter, I click on the &lt;span style="font-style: italic;"&gt;"Unsubscribe"&lt;/span&gt; link; get a nice &lt;span style="font-style: italic;"&gt;"You were unsubscribed from the list"&lt;/span&gt;, and every next month I get a new newsletter. This grows old on me quite quickly. I've multipled times unsubscribed from it, emailed Paul Yao and the board for WE-DIG to be removed from the list. But no such luck.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;So my conclusion to this is, either Paul Yao is an evil person that never implemented an unsubscibe functionality; or he can not code diddly squat. I mean how hard is it to implement a mailing list functionality, there must be tons of reference implementations out there? Or is it just to hard to implement a mailing list in .NET?&lt;/span&gt; Is it .NET that throws an unhandled exception when someone tries to unsubscribe?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;For you how don't know who Paul Yao is, he has been writing books about MS tech for more than 20 years, so he should know what he is doing. &lt;span style="font-style: italic;"&gt;Or perhaps he doesnt..... And this is my last attempt to be removed from the mailing list.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-116029066327795865?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/116029066327795865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=116029066327795865' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/116029066327795865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/116029066327795865'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/10/mvp-paul-yao-cant-code-or-is-net-too.html' title='MVP Paul Yao can&apos;t code (or is .NET too hard?)'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-116005976266660250</id><published>2006-10-05T16:34:00.000+02:00</published><updated>2006-11-06T11:09:29.352+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Localisation'/><title type='text'>Spell checking localisation files??</title><content type='html'>&lt;span style="font-family: arial;"&gt;Is there any tool that spell checks localisation files? In a current .NET project, which is translated to 4 different languages, there are too many spelling errors that should have been caught before release. &lt;span style="font-style: italic;"&gt;(Some of them are really obvious)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;So I wonder if there exists such a tool for .NET or Java? If so, does it support Ant/Nant? &lt;span style="font-style: italic;font-size:85%;" &gt;(Preferably open-source or free)&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-116005976266660250?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/116005976266660250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=116005976266660250' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/116005976266660250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/116005976266660250'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/10/spell-checking-localisation-files.html' title='Spell checking localisation files??'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-115935320009172679</id><published>2006-09-27T12:32:00.000+02:00</published><updated>2006-11-06T11:09:29.291+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>Garbage collection DO exists in C#</title><content type='html'>&lt;span style="font-family: arial;"&gt;The .NET Framework is a very advanced framework as it has two different types of garbage collection. Like Java it is able to remove objects that is not in use anymore without being told and do it automatically. But .NET also has another GC that Java doesn't have. It is not the normal GC that you would assume, but it is highly integrated into the WinForms framework.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;This new garbage collection is a property named Tag in the Control class. This is a place where you can put any garbage into that you could use later. The Controll class will store it for you forever, which is nice when you want to have garbage lying around. So with this enhanced garbage collection, you can store all your garbage and it looks like it is good OO.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;The idea behind the Tag property is to store objects for combo box and list items, which is later used when a list item is selected and the object "representing" is needed. It seems that MS has come up with their own solution to the well known Model-View-Control pattern for GUI development. What they came up with is that every GUI control needs to have a model/data, and therefore it is wise to add such functionality to the Control class. The problem is that changing the model (Tag property) does not have any effect at all, the list or combo boxes doesn't change when the Tag property is updated. It is just a place to store objects; it isn't really MVC, is it?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;The thing with Java, which tries to enforce the MVC (or at least MV) it is that the GUI devloper has to seperate the model from the view (and control). With .NETs approach you most of the time end up with a Form that has several Control objects and data in one class. I thought OO was to go away from the One-File(-To-Rule-Them-All) idea and seperate code. Now that MS still lets the developers use the Tag property, they are not helping us to seperate logic from representation. And it sucks, because we developers are lazy. We really need someone standing behind our back so we code "correctly".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Once again, I'm sitting wishing that my current project was developed in Java and not in .NET 2.0, because I do not want to work store everything in one class. &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-115935320009172679?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/115935320009172679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=115935320009172679' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115935320009172679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115935320009172679'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/09/garbage-collection-do-exists-in-c.html' title='Garbage collection DO exists in C#'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-115869781229318012</id><published>2006-09-19T22:10:00.000+02:00</published><updated>2006-11-06T11:09:29.229+01:00</updated><title type='text'>OO is for suckers</title><content type='html'>&lt;span style="font-family: arial;"&gt;Im trying to read up on .NET Forms and how they work with .NET 2.0. Im reading a quite good book &lt;span style="font-style: italic;"&gt;"Programming Microsoft Windows Forms"&lt;/span&gt; by Charles Petzhold. It's a Microsoft Press book. This evening I read something that I though was quite strange. The below quote is from page 167, when the author talks about creating controls in DLLs.&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style="font-family: arial;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;"We haven't been worrying much about making classes public. It's really only an issue when you're putting classes in a DLL."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, making classes public, private, protected, package (or whaterver its named in C#) is only good when packaging everything in a DLL. I thought it was good OO to make certain classes private, public, etc. Perhaps I was wrong to put classes in different namespaces/packages so classes cant access every other class in a project. But the good thing is that I've been enlighted, and only bother with OO when packaging everything in a DLL.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:78%;" &gt;BTW, I know Im nitpicking, but I thought it was fun :)&lt;/span&gt;&lt;br /&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-115869781229318012?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/115869781229318012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=115869781229318012' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115869781229318012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115869781229318012'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/09/oo-is-for-suckers.html' title='OO is for suckers'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-115815676798149473</id><published>2006-09-13T16:04:00.000+02:00</published><updated>2006-11-06T11:09:29.167+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>One more nail in the coffin for Unchecked exceptions</title><content type='html'>&lt;span style="font-family:arial;"&gt;At my current job, Im fixing bugs in a huge C# system. This system has moved from .NET 1.1 to .NET 2.0, and it was not painless but the move was considered successful. &lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic;"&gt;(except that resource handling has changed totally, which messes up everything, but that will be another blog)&lt;/span&gt;&lt;/span&gt; Today, Im seeing a problem with one of the components that is missbehaving when it fails to send an SMS.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The whole component (which is a stand alone service) crashes because of some unknown exception. After Ive started to investigating the problem I discover that the exception is an &lt;span style="font-family:courier new;"&gt;AbandonedMutexException&lt;/span&gt;. Since Im quite new with .NET/C#, I have no clue what this means. MSDN informs me that it means &lt;span style="font-style: italic; font-weight: bold;"&gt;"In previous versions, the WaitOne method returns true when a mutex is abandoned. An abandoned mutex indicates a serious coding error. The exception contains information useful for debugging."&lt;/span&gt;. The exception is new for .NET 2.0 and is there to "help" developer.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;So, now we have a service/component that works fine in the old .NET 1.1 but can potentially crash in the new environement. Even if there is a &lt;span style="font-weight: bold;"&gt;"serious" &lt;/span&gt;coding error in the product, it has worked as it should for at least 2 years. But now MS wants to &lt;span style="font-style: italic;"&gt;"help"&lt;/span&gt; their developers to write better code, but the problem is that they did not tell the developers that something happened. This would not happen if C# had checked exceptions, because this would have been caught when compiling with .NET 2.0. Now it was caught by &lt;span style="font-style: italic;"&gt;"misstake"&lt;/span&gt; and could have been shipped if I didn't do something wrong to provoke the error. Sure MS will help the people who is developing new software, but they just made it harder to maintain software. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I havent still made up my mind about Checked vs Unchecked exceptions. But I believe that if C# had Checked exception this problem would have been caught when moving to .NET 2.0 and not 6 months later. It was impossible to test every part of this huge system when the move was made and therefore it passed. It has come to my understanding that coding with Unchecked exceptions means catching unnamed exceptions here and there. In one component I saw 120 catch statements, 12 was for named exceptions and the rest was just &lt;span style="font-family:courier new;"&gt;"catch(Exception&lt;/span&gt;)". That is not handling an exception, that is hiding an exception from reaching the user or crashing the application. For me catching unnamed exceptions all over the place is bad code.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Aftermath&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family:arial;"&gt;Sure, I found the problem. It was not a big one, and is definetly not a &lt;span style="font-weight: bold;"&gt;"serious"&lt;/span&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;code error that could have horrendous effects. Yes, it was a coding problem. The problem is that it could have reached the customer, and in my eyes MS played a major part in provoking the error that could have reached the customer. Bad PR for the company, no PR change for MS. &lt;span style="font-style: italic;"&gt;tsk, tsk, tsk.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-115815676798149473?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/115815676798149473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=115815676798149473' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115815676798149473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115815676798149473'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/09/one-more-nail-in-coffin-for-unchecked.html' title='One more nail in the coffin for Unchecked exceptions'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-115755285989068559</id><published>2006-09-06T16:21:00.000+02:00</published><updated>2006-11-06T11:09:29.098+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>Label is not JLabel, or Why wont .NET make my job easier?</title><content type='html'>&lt;span style="font-family:arial;"&gt;Once again, I'm struggling with C# .NET 2.0, and finding out that .NET isn't really doing my job easier. My job as a software developer should not involve re-inventing the wheel every time I develop software. MS has always being good on creating tools that are simple to use and build simple things. But every once in a while I see cracks in the facade, sure it is simple to use but it is so much harder to do something advanced.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;By &lt;span style="font-weight: bold;"&gt;"advanced"&lt;/span&gt; I mean in this particular case that I want to have a control that displays an icon and a text next to each other. A simple label that has a text AND an image. In Java, it is quite simple; create a JLabel and set horizontal position with setHorizontalTextPosition(). This has existed forever in the Swing framework, and Sun thought of it from the begining. Simple and &lt;span style="font-weight: bold;"&gt;"advanced"&lt;/span&gt;.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;In .NET it is not quite so simple; my first try was to use a Label for the text and image. The class has both a Text and Image property, so I thought I could set the text and image and it was done.. But unfortunately the control does not have a property to set a alignment relation between the image and the text. So if I set the image and text, the image will be placed behind the text and it is not very pretty. If I set the alignment of the icon and text to Left and Right, the control will still have the image behind the text but now the text looks like crap as it is right aligned. So the result is, I can either set the text OR the image; but not both. &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;C'MON this isn't really advanced, is it?&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Last week I had the same problem with a button, but &lt;span style="font-style: italic;"&gt;(credit to MS)&lt;/span&gt; they actually have implemented a TextImageRelation property that fixes this &lt;span style="font-style: italic;"&gt;"problem"&lt;/span&gt;. The interesting part is that it was introduced in .NET 2.0, so I wonder how people managed to create a button that has text AND an image before &lt;span style="font-weight: bold;"&gt;December 2005&lt;/span&gt;. And the other question is why didn't they think it through and thougt of other .NET Controls that could have this problem and fixed those as well?&lt;/span&gt; &lt;span style="font-family:arial;"&gt;I got the answer for you, &lt;span style="font-weight: bold;"&gt;"Because they don't think"&lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;What is the real solution to this problem? Adding a new Label with an Icon, develop my own control?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-115755285989068559?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/115755285989068559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=115755285989068559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115755285989068559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115755285989068559'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/09/label-is-not-jlabel-or-why-wont-net.html' title='Label is not JLabel, or Why wont .NET make my job easier?'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-115705651272260469</id><published>2006-08-31T21:57:00.000+02:00</published><updated>2006-11-06T11:09:29.038+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><title type='text'>Changing Text on SplitContainer, what an interesting idea....</title><content type='html'>&lt;span style="font-family:arial;"&gt;Today I rummaged through thousands lines of C# GUI code to find out why some things happen and some things didnt. Suddenly I see (through content assist) that one of the project specific controls has a &lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;TextChanged &lt;/span&gt;&lt;span style="font-family:arial;"&gt;event. This control has nothing to do with text so it directly grabbed my attention.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Then I find out that it really isnt the specific control that implements the event, it is a control further up in the hiearchy. I keep going up the inheritance tree, to find that &lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;System.Windows.Forms.Control&lt;/span&gt;&lt;span style="font-family:arial;"&gt; has a property named &lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;Text &lt;/span&gt;&lt;span style="font-family:arial;"&gt;(and a bunch of events for text manipulations). That is odd I think, why would a base Control class have a text property when the deriving classes are not necessary text orientated controls.&lt;/span&gt;&lt;br /&gt;&lt;ul  style="font-family:arial;"&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;What happens if I change the Text property on a PictureBox? Would it show the text on top of the picture?&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;What happens if I do it on a SplitContainer?&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Or on a NumericUpDown control?&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:arial;"&gt;This is one of the problems with the .NET framework. It carries to much bagage from C++ and VB into the C# (and .NET) world. The old MFC libraries probably had a SetText() method, so therefore it must exist one in .NET. I wonder why they would have such functionality, and the only idea I can come up with is: It is simple if all text specific properties are named the same, and thus every control should have one. &lt;span style="font-style: italic;"&gt;"If we keep it in Control, then we dont have to write code for text handling in every control"&lt;/span&gt;.  But what about all those controls that dont have a text in them? They must override this property and do nothing, so now we have code that hides other code just to remove a functionality. &lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;This does not make sense to me.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The MSDN will of course answer the question if the Text property actually works or not. On those controls that do not support them, it will say &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;"This property supports the .NET Framework infrastructure and is not intended to be used directly from your code."&lt;/span&gt;&lt;span style="font-family:arial;"&gt;. Sheeesh, that makes we want to think twice before using the Text property on a Label or Button. Perhaps the Text property is not intended to be used directly in my code on a button? The best explaination is (of course all these overriden properties have different wording) &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;"The Text has no affect on the appearance of the NumericUpDown control; therefore, it is hidden in the designer and from IntelliSense."&lt;/span&gt;&lt;span style="font-family:arial;"&gt;.. I would like to see that code in the IntelliSense.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;doPopupMenu(Control)&lt;br /&gt;if (control is SplitContainer) || (control is NumbericUpDown)&lt;br /&gt;{&lt;br /&gt; menu.removeTextProperty()&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Or is there any valid reason that every Control has a Text property?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-115705651272260469?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/115705651272260469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=115705651272260469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115705651272260469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115705651272260469'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/08/changing-text-on-splitcontainer-what.html' title='Changing Text on SplitContainer, what an interesting idea....'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-115650629865929680</id><published>2006-08-25T13:25:00.000+02:00</published><updated>2006-11-06T11:09:28.975+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Open source'/><title type='text'>Nant is definetly not Ant (build MSBuild is)</title><content type='html'>As a newly born .NET/C# developer, I have trouble finding those must-have-tools. At my current job, they are running VS2005 in a huge system with over 70 seperate components/solution files with each having around 2000-10000 LOC. This gives me a huge headache as it takes forever to build, and everything is built with batch files. (so 90-ish)&lt;br /&gt;&lt;br /&gt;But as a java developer, I have come to love Ant. There is a .NET version of it called NANT that I downloaded and was going to test and hopefully replace the batch files. 10 mins after downloading I stumble into the first problem. NANT does not support (as of 25 aug 2006) Visual Studio 2005. NANT can not handle the new solution files as they have change completly (not surprisingly). Apparently it is quite a job to add VS2005 support, so it seems that it is not going to happen. So NANT is definetly not ant, as it will probably cease to be used.&lt;br /&gt;&lt;br /&gt;The new king of building MS code is MSBuild, which seems to be a total rip-off from Ant.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-115650629865929680?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/115650629865929680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=115650629865929680' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115650629865929680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115650629865929680'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/08/nant-is-definetly-not-ant-build.html' title='Nant is definetly not Ant (build MSBuild is)'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-115575889470312368</id><published>2006-08-16T21:55:00.000+02:00</published><updated>2006-11-06T11:09:28.912+01:00</updated><title type='text'>Its 2006 and MS has still learned nothing about installations!?</title><content type='html'>Due to a contractor job, I need to get some Visual C#/.NET/MSSQL experience. So I was going to install Visual C# Express (or as it is called Visual Studio 8, or other). I got the 3 mb installation file and started the installation (I hoped). The installation program did what they always do, Greetings&amp;Saluations, Accept eula, Install MSDN and MSSQL?. Sure I could go for those as well. The program told me that I needed 1.7++ GBs of hard drive for this installation. Fine, I have plenty of space on my D-drive (data&amp;Programs), which I told the program.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;But wait a minute! That isnt how Ms wants it!&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If I choose to install everything onto the d-drive, it would install 60 MBs on the D-drive and a whooping 1.7 GBs on the C-drive. But I thought I told VS to install on the d-drive and not onto the c-drive. Of course, I understand that VS requires some files to be installed on the c-drive. But 1.7 GBs, that is ridiculos.&lt;br /&gt;&lt;br /&gt;Ok, regroup. Lets just choose the VSC# package, and I still want to install on the d-drive. Now it still wants to install 60 MBs on the d-drive and &lt;span style="font-style:italic;"&gt;only&lt;/span&gt; 314 MBs on the c-drive.&lt;br /&gt;&lt;br /&gt;When I left the MS development environment for six years ago, they still had this idea that I as a user shouldnt be allowed to make decisions like this. Still, they order me around and forces me to install everything on the c-drive. (The c-drive is already packed as every other program/driver wants to install onto the c-drive). I guess I can solve this the MS-user way, do a re-install every two years.&lt;br /&gt;&lt;br /&gt;At least with Java, I'm old enough to choose where to put things.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-115575889470312368?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/115575889470312368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=115575889470312368' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115575889470312368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/115575889470312368'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2006/08/its-2006-and-ms-has-still-learned.html' title='Its 2006 and MS has still learned nothing about installations!?'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-112742374440041723</id><published>2005-09-22T22:47:00.000+02:00</published><updated>2006-11-06T11:09:28.844+01:00</updated><title type='text'>Streamlining the debian/linux boot</title><content type='html'>As my ever continuing project is to build a media box running debian and Freevo. As of now, it can play movies, music and show images. The only big step left is to minimize the boot time for linux. For a media box that only purpose is to show movies, it must start very quickly. I need to get the boot time down to at most 30 seconds. Now it takes approx 90 seconds to boot from the grub menu. That is way to long time, so I need a few tools to get it even shorter.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;I found a nice &lt;span style="font-weight:bold;"&gt;&lt;a href="http://www.bootchart.org/"&gt;application&lt;/a&gt;&lt;/span&gt; that can show me the boot flow as a chart. This debian package can be installed from the unstable package set.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The first time I use it, I could see that it took 80 seconds to boot, and that it was the 'udev' module that took some of its time. &lt;span style="font-weight:bold;"&gt;&lt;a href="http://hem.bredband.net/b291533/bootcharts/runlevel-1-sysinit.gif"&gt;As can be seen here&lt;/a&gt;&lt;/span&gt;. Nice graph, but what do I do with it?&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Continuing searching I found another init module for linux, that promised a very faster boot time. Its called &lt;span style="font-weight:bold;"&gt;&lt;a href="http://initng.thinktux.net/index.php/Main_Page"&gt;initng&lt;/a&gt;&lt;/span&gt;. Installing the package from the experiment package set, and running bootchart with it; seemed to give a much better boot time. &lt;span style="font-weight:bold;"&gt;&lt;a href="http://hem.bredband.net/b291533/bootcharts/runlevel-1-initng.png"&gt;As can be seen here.&lt;/a&gt;&lt;/span&gt; According to bootchart it would only take 14 seconds, if it only was true. USing a stoptimer, the boot takes 67 seconds. Where did those extra seconds come from? I have no clue.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-112742374440041723?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/112742374440041723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=112742374440041723' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/112742374440041723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/112742374440041723'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2005/09/streamlining-debianlinux-boot.html' title='Streamlining the debian/linux boot'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-110794515317344193</id><published>2005-02-09T11:09:00.000+01:00</published><updated>2006-11-06T11:09:28.719+01:00</updated><title type='text'>Using MFC and threads, dazzled and amazed!?</title><content type='html'>As always Im amazed on how much worse it is by developing applications in MFC than using Swing. MFC has a complete different view of how a dialog and threads should cooperate. In short words, MFC wont let any threads to change any control in a dialog. WTF? If you have a task that takes hours, and you want to have a GUI that displays the progress of it; what do you do? The thread is not allowed to use any of the GUI controls at all, and if you do, then suddenly the whole application will lock up because you try to change a control. In Swing you dont have this problem, because you have true VMC modelling.&lt;p&gt;&lt;br /&gt;So what do you do when you want to update a GUI from a thread. There are two ways in MFC: you can either change the GUI control youself, but this will result in deadlocks 100% guarantee; you can either change the value (string/dword) behind the control and then call the UpdateData() method. But something that they forgot to say is that you cant call UpdateData() from a thread outside the GUI loop, doing that will result in deadlock 100% guarantee. MS only response is "threads are not allowed to touch GUI, you must send a message to the dialog that you want to update". Fair enough, but MS has failed to give such a functionality and if I want to update a tabbed dialog with data from the thread, there is no way but to implement a WM_USER message listener for every dialog that you want to update from the thread. Sheeeesh, I dont want to put more stuff into each one of the dialogs, for just make it "thread-safe" for the MFC GUI.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;My solution to this problem is jsut to create a base CDialog class that will handle this problem, and is safe to update all values in a dialog. It took med 5 minutes to create it and test it. Whoah, that was easy, but that main point is &lt;span style="font-weight:bold;"&gt;IF IT WAS SO EASY, WHY HASNT MS DONE THIS IN THE FIRST PLACE?&lt;/span&gt; Why do I have to live with crap design eons after the MFC was "designed", why can't they extend the dialog class with such functionality so you dont have to sit and wonder why the application has locked. &lt;span style="font-style:italic;"&gt;"Is it me or MFC?"&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Im still amazed that MFC is still not thread safe, it was earlier one of the most commonly used application tools/API for creating applications. How could it survive for such a long time??&lt;br /&gt;&lt;p&gt;&lt;br /&gt;My solution, is as easy as pie. Here it is:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#include &lt;afxwin.h&gt;&lt;br&gt;&lt;br /&gt;#include &lt;afxmt.h&gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;class CRefreshDialog : public CDialog  &lt;br&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;public:&lt;br&gt;&lt;br /&gt;	CRefreshDialog(UINT nIDTemplate,CWnd* pParentWnd = NULL );&lt;br&gt;&lt;br /&gt;	virtual ~CRefreshDialog();&lt;br&gt;&lt;br /&gt;	virtual BOOL OnWndMsg( UINT message,WPARAM wParam, LPARAM lParam, LRESULT* pResult );&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;	void	RefreshDialog();&lt;br&gt;&lt;br /&gt;private:&lt;br&gt;&lt;br /&gt;	CCriticalSection	refreshMutex;&lt;br&gt;&lt;br /&gt;};&lt;br&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#define WM_REFRESH WM_USER + 0x9283&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;CRefreshDialog::CRefreshDialog(UINT nIDTemplate, CWnd* pParentWnd ) : CDialog(nIDTemplate, pParentWnd)&lt;br&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;CRefreshDialog::~CRefreshDialog()&lt;br&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;BOOL CRefreshDialog::OnWndMsg( UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult )&lt;br&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;	BOOL wasHandled = FALSE;&lt;br&gt;&lt;br /&gt;	if (message == WM_REFRESH)&lt;br&gt;&lt;br /&gt;	{&lt;br&gt;&lt;br /&gt;		UpdateData(FALSE);&lt;br&gt;&lt;br /&gt;	} else&lt;br&gt;&lt;br /&gt;	{&lt;br&gt;&lt;br /&gt;		wasHandled = CDialog::OnWndMsg(message, wParam, lParam, pResult);&lt;br&gt;&lt;br /&gt;	}&lt;br&gt;&lt;br /&gt;	return wasHandled;&lt;br&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;void CRefreshDialog::RefreshDialog()&lt;br&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;	CSingleLock lock(&amp;refreshMutex);&lt;br&gt;&lt;br /&gt;	lock.Lock();&lt;br&gt;&lt;br /&gt;	::PostMessage(m_hWnd, WM_REFRESH, 0, 0);&lt;br&gt;&lt;br /&gt;	lock.Unlock();&lt;br&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-110794515317344193?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/110794515317344193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=110794515317344193' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/110794515317344193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/110794515317344193'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2005/02/using-mfc-and-threads-dazzled-and.html' title='Using MFC and threads, dazzled and amazed!?'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-110021394791355118</id><published>2004-11-11T23:47:00.000+01:00</published><updated>2006-11-06T11:09:28.648+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java Desktop Search tool</title><content type='html'>I find that the Google Desktop Search tool, is an extremly usefull tool. But one that has many disadvantages, it is very MS orientated. It can only read emails from MS apps, can only read web history from IE, it can only read Word document (by default). As many people goes about and try to figure on how to add the FireFox web history into GDS, perhaps there is another way.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Since Ive used &lt;a href="http://jakarta.apache.org/lucene/"&gt;Lucene&lt;/a&gt; before and find this an extremly good search tool/API for java, which is very lean and quick; I came up with an idea, Why not make this in Java? This would be a blast for all Linux users as well, since there is no GDS for linux (right?). Of course it will probably be hard to pair up with the searching techniques done by Google, since they've done this for years. But I still think there is an opportunity here for an open-source project that can work in all platforms.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;By making it in java, it would be very simpel to add other searches, such as:&lt;br /&gt;&lt;ul&gt;   &lt;li&gt;MP3 files ID3 tags&lt;/li&gt;   &lt;li&gt;Thunderbirds emails&lt;/li&gt;   &lt;li&gt;Columba emails (Java based email program)&lt;/li&gt;   &lt;li&gt;Open office documents&lt;/li&gt;   &lt;li&gt;Miranda chat logs&lt;/li&gt;   &lt;li&gt;ICQ chat logs, etc...&lt;/li&gt; &lt;/ul&gt; For presentating the stuff, the &lt;a href="http://jakarta.apache.org/velocity"&gt;Velocity&lt;/a&gt; engine could be used for seperating the logic and presentation. Velocity is a very nice tool for simpel web based applications.&lt;br /&gt;&lt;br /&gt;But I wonder if there are already any very light weight web servers that can be used for this?&lt;br /&gt;&lt;p&gt;&lt;br /&gt;One problem is that google is going to fill this void, &lt;span style="font-weight: bold;"&gt;so its either now or never&lt;/span&gt;!&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-110021394791355118?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/110021394791355118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=110021394791355118' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/110021394791355118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/110021394791355118'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2004/11/java-desktop-search-tool.html' title='Java Desktop Search tool'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-109482481196576374</id><published>2004-09-10T15:13:00.000+02:00</published><updated>2006-11-06T11:09:28.578+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Localisation'/><title type='text'>Localization problems</title><content type='html'>Localizing software is a very tedious effort, and most times its up to the translators language knowledge on how good the result will be. Most applications shares also a bunch of menu entries that must be the same in all localized applications. (&lt;em&gt;You can't replace a "Save" button with a button named "Store"). &lt;/em&gt;There are other definitions that you can find several synonyms for but where only one is applicable.&lt;br /&gt;&lt;br /&gt;How do you know that one word is more appriopiate than another one? This must happen to every open-source project that is undergoing localizations. How much time isnt spent on getting the right words for some actions or menu entries?&lt;br /&gt;&lt;br /&gt;Im looking for a common source for localizing softwares, a place where you can get the simplest menu entries translated just by looking at some documents. This common place could be a community with a forum for placing questions, language defintions, basic help on getting a localization working. Each language would have their own section of it, this would of course help open-source projects to become accepted quicker among ordinary users. There must be loads of info/data already available in different linux builds, (debian comes to mind) why cant we put this knowledge where it is easier to get?&lt;br /&gt;&lt;br /&gt;Is there such a place, Ive done some googling but havent found any. Perhaps SF or any other open-source site would be suitable for this... (Or am I just dreaming?)&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-109482481196576374?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/109482481196576374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=109482481196576374' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/109482481196576374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/109482481196576374'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2004/09/localization-problems.html' title='Localization problems'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-108125874620501068</id><published>2004-04-20T11:15:00.000+02:00</published><updated>2006-11-06T11:09:28.516+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Workarounds for Swings DnD problems!</title><content type='html'>&lt;p&gt;&lt;br /&gt;After digging around, googling and receiving tons of help; I've built two workarounds for some of the problems with Swings Drag and Drop (DnD) problems. The first problem with the DnD is the lack of the ability to dynamically create files dynamically when exporting files from a Java program. The second problem with the DnD is that you have to redo already implemented data handling.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;I've already described the two problems in these blogs: &lt;a href="http://redsolo.blogspot.com/2004_03_01_redsolo_archive.html#108004595020752861"&gt;Extending the..&lt;/a&gt; and &lt;a href="http://redsolo.blogspot.com/2004_03_01_redsolo_archive.html#107995948076142310"&gt;Shortcoming of..&lt;/a&gt;. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;These problems comes from design decisions in Swing, and cannot be fixed without tampering with the APIs of the DnD in Swing. Actually the first problem is the one that will have the largest impact on the handling of DnD to the native system. The second can be changed within the current API.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The problem was that all files that are to be DnD from a Java application to the native system, must exist before the action. And there are several areas where this isn't possible. Example the Columba email client, it was not wanted to extract attachments from an email until the user has selected so. FTP applications could just have one file list for the remote server, and then the user could DnD files from the file list to the desktop to start a transfer.&lt;br /&gt;&lt;br&gt;&lt;br /&gt;My solution was to create the files during the DnD action, before the actual drop of the file has been initiated. Therefore I came up with the class &lt;a href="http://cvs.sourceforge.net/viewcvs.py/columba/frapuccino/src/java/org/frappucino/swing/DynamicFileTransferHandler.java?view=markup"&gt;DynamicFileTransferHandler&lt;/a&gt;. This class could be used for any JComponent that wants to export files from Java dynamically. All it needs is a File factory that creates the files during the DnD process. The files can either be created at the start of the DnD or at the very end of it. &lt;i&gt;Well not really the very end, it is actually when the DnD moves over a native application, that is the last known place for the DnD of files.&lt;/i&gt;. Check out the webstart demo of the frappucino package. Unfortunately this feature will not be a part of the Swing's DND API for a very long time, and I doubt that it will even go into the SDK 1.6 release. Please note that this solution is good enough but Sun should get their act together and make better support for this type of DnD. I solved the problem for the email application, but for FTP applications this is still unsolvable.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div id="links"&gt;&lt;strong&gt;Links&lt;/strong&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://columba.sourceforge.net/webstart/frappucino.jnlp"&gt;&lt;strong&gt;Frappucino demo&lt;/strong&gt; &lt;em&gt;jnlp&lt;/em&gt;&lt;/a&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://www.javadesktop.org/forums/thread.jspa?threadID=1883&amp;tstart=0"&gt;Discussion at Javadesktop&lt;/a&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://columba.sourceforge.net/subprojects_frappucino.php"&gt;Frappucino - &lt;em&gt;not yet released&lt;/em&gt;&lt;/a&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://columba.sourceforge.net/"&gt;Columba email client&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The second problem was that often the developer only wants to add one DnD data flavor to a JComponent. This was not possible with the current API. Some of the methods in the API has protected access, and the DnD API "cheated" by being in the same package. I've now developed a solution that enables a JComponent to have multiple TransferHandlers for importing data. Now you can easily add DnD support of files into a Textarea, and not lose the default DnD implementation. &lt;strong&gt;&lt;em&gt;I wonder why nobody has done anything about this problem, because it makes it even more tedious to add DnD import for Swing components.&lt;/em&gt;&lt;/strong&gt; Anyhow my solution is to have a set of transfer handlers that uses the Chain of responsibility design pattern. The class &lt;a href="http://cvs.sourceforge.net/viewcvs.py/columba/frapuccino/src/java/org/frappucino/swing/MultipleTransferHandler.java?view=markup"&gt;MultipleTransferHandler&lt;/a&gt; can have one or more transfer handlers, and will go through the set until it can find one handler that accepts a certain data flavor. Due to the fact that the export methods for TransferHandler are protected and it is impossible to call those without extending the handler or being in the same package, I had to use the reflection API to access those two methods. Due to this "cheat" there are some security issues when using this class, but as long as it is used in one trusted application, this wont be any problem. Now the class will work with one or more transfer handler for importing data flavor, and it still can export flavors from ONE of the transfer handler. Restricting it to one export transfer handler, solved the problem when you have several handlers that export the same data flavor. &lt;em&gt;This may change in the future.&lt;/em&gt;. With this bug, I have little faith in that they are going to fix this. The bug/feature request has been around for over one year, with no real answers. Check out the Frappucino demo, it has a demo for this component as well.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;BTW, thanks for all the replies from the Java desktop forum and bug lists, I hope that I can help somebody with these Swing objects.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-108125874620501068?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/108125874620501068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=108125874620501068' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/108125874620501068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/108125874620501068'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2004/04/workarounds-for-swings-dnd-problems.html' title='Workarounds for Swings DnD problems!'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-108004595020752861</id><published>2004-03-26T18:15:00.000+01:00</published><updated>2006-11-06T11:09:28.456+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Extending the DnD in Swing = reinventing the wheel</title><content type='html'>&lt;p&gt;&lt;br /&gt;The Swing's DnD functionality looks very extendable at a first glance, but as more as I dig deeper into this part of the SDK I understand that it is not 100% true. Adding new DnD functionality to a component, forces the developer to reinvent the wheel every time. Why do the developer have to redo already implemented functionality to extend a components DnD actions?&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Many of the JComponents in the swing package supports drag and drop actions. Those components already have a nice feature rich implementation that handles the dragging and dropping of objects to/from the component. The problem arises when the developer wants to add a new flavor to the components DnD functionality, ie extend so the component can import new types of objects. Each JComponent can only have one TransferHandler, and this is the one used during a DnD action.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Once again I'm in the middle of adding DnD to the email client &lt;em&gt;(see my previous blog)&lt;/em&gt;. This time I would like to add drag and drop of files into a new email, ie. add them as attachments. Other native email clients lets the user drag files onto the text area and the attachment bar. When the user drops the files in either of the target components, they are added to the emails attachment list. Now this was no problem adding the DnD of files to a attachment component but when I wanted to add this feature to the editor panes DnD support, I stumbled upon this problem. The editor pane already has a TransferHandler that supports strings/texts/Unicode data flavors. I would only like to add the fileList data flavor so it would also accept files.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The problem starts with that the TransferHandlers that are used by the JEditorPane components is package private, and therefore I cant extend them to get the functionality I want. I don't want to re-implement all those features in my own version, since that would be a waste of time and bloat the code. Then I thought of using the chain of responsibility design pattern to merge the two transfer handlers into one. Ie use one as the primary transfer handler, and then if the primary doesn't support a certain flavor it will try the other handler(s) if they can import a certain flavor. This to me looked like a fine idea, and I developed a nice class to work as one TransferHandler, but actually handling several. Everything went fine until the user tries to drag and drop from a component that has this object. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;During that drag and drop action, it wants to create a transferable object through the protected method createTransferable(). BUT the method is called by at &lt;em&gt;javax.swing.TransferHandler$DragHandler.dragGestureRecognized(TransferHandler.java:710)&lt;/em&gt; method, (outside the TransferHandler class) and it uses the fact that they are in the same package, ie they can break the protected access modifier. Now I have no clue on how to create the real transferable object, since in my implementation (see below) tries to do this on the primary transfer handler, but its createTransferable() method is protected and therefore I cant reach it, I'm not in the same package so I can "cheat" as the DragHandler does. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div id="links"&gt;&lt;strong&gt;Links&lt;/strong&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://cvs.sourceforge.net/viewcvs.py/columba/frapuccino/src/java/org/frappucino/swing/MultipleTransferHandler.java"&gt;&lt;strong&gt;MultipleTransferHandler.java&lt;/strong&gt; @ &lt;em&gt;CVS&lt;/em&gt;&lt;/a&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://developer.java.sun.com/developer/bugParade/bugs/4830695.html"&gt;Bug report at Sun&lt;/a&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://columba.sourceforge.net/subprojects_frappucino.php"&gt;Frappucino - &lt;em&gt;not yet released&lt;/em&gt;&lt;/a&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="http://columba.sourceforge.net/"&gt;Columba email client&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Once again, there is a problem in the design of the Swings DnD, but at least for this problem I have a workaround. I get around the problem by calling the needed protected methods using the reflection API, and making them public. But this to me is not the correct way of doing it, I should be able to call those methods in TransferHandler without relying on using reflection. There is already a feature request at Suns bug report system, and all I can do is hope that they change it in coming releases, but for now I at least got a solution. If you would like to use it, it is part of the Frappucino module in the Columba project. Frappucino is a collection of widgets that eases the development of Swing UIs. Check the link section for the class.&lt;/p&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-108004595020752861?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/108004595020752861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=108004595020752861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/108004595020752861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/108004595020752861'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2004/03/extending-dnd-in-swing-reinventing.html' title='Extending the DnD in Swing = reinventing the wheel'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3703531.post-107995948076142310</id><published>2004-03-22T16:02:00.000+01:00</published><updated>2006-11-06T11:09:28.393+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Shortcomings of Sun's DnD model!?</title><content type='html'>&lt;p&gt;&lt;br /&gt;I've tried to implement a drag and drop action of attachments in an email client, and found that the Sun's implementation of DnD makes it impossible to mimic native applications drag and drop actions. The DnD framework does not support creating files lazily. This is a shortcoming that makes it very hard to create feature-rich java clients that can compete with native clients. This is not only true for email clients, its for most clients that work with large files over the network, ex. webbrowsers, FTPs, and others. &lt;br /&gt;&lt;strong&gt;The problem comes from the fact that the files must exists locally before the DnD of files can begin.&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;Note that this is about DnD a file outside the java application!&lt;/em&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;In the email client the attachments lies within the email(s), and needs to be extracted before they can be copied to the correct location. For performance reasons I dont want to extract all attachments to the disk when the user opens an email with attachments. Neither do I want to extract the attachment during the user's DnD operation. I would like to make the copy/extraction when the DnD has been completed. This is also true for FTP clients as well, for instance if the UI displays the files on the remote server and the user wants to download it to the desktop, preferably he/she should drag the file from the file list to the dekstop. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;The only way of copying (or moving) a File through DnD is to create a Transferable object that supports the DataFlavor.javaFileListFlavor. This transferable should return a List of files that are to be copied/moved to the target location. When the DnD action is completed the actual copying/moving of the file is handled deep down within the Suns own code, and I havent found the place to see how its done. But the problem is that the Files must exists locally before the DnD starts, ie before the getTransferData() or the exportDone() methods are called. This I cannot do, since I dont want to extract the attachment until the DnD is complete. (performance issues) &lt;strong&gt;There is no way of finding out the target file from the current DnD action.&lt;/strong&gt;, ie it is impossible to make the copying yourself.&lt;hr&gt;&lt;br /&gt;My first idea was to create an empty dummy file on the disk, and use this as the source File to be dragged around. Then when the DnD is completed, I would extract the attachment from the email and make the copy manually. Doing it this way, Im sure that &lt;ul compact=true&gt;&lt;li&gt;theres no unecessary extraction, &lt;li&gt;the DnD action is not hindered by sharing CPU with the extraction of the file itself&lt;li&gt;the user doesnt have to wait until he has choosen where to put the file&lt;li&gt;the extraction is done according to the API for the email client.&lt;/ul&gt;&lt;br /&gt;There are four methods that need to be overloaded in order to get a &lt;a href="http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/TransferHandler.html"&gt;TransferHandler&lt;/a&gt; to work:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; getSourceAction() - return which actions the transfer handler supports, ie copy/move&lt;li&gt; createTransferable() - returns a Transferable object that is sent around to the other components that supports DnD actions.&lt;li&gt; canImport() - if the current component can import a certain type of data flavors&lt;li&gt; exportDone() - is called when the DnD action is finished, remove those objects that has been moved&lt;/ul&gt;&lt;br /&gt;The &lt;a href="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/datatransfer/Transferable.html"&gt;Transferable&lt;/a&gt; interface has these methods.&lt;ul&gt;&lt;li&gt; getTransferDataFlavors() - return which data flavors that this supports, in my case the javaFileListFlavor flavor&lt;li&gt; isDataFlavorSupported() - return if the transferable understands one type of data flavor&lt;li&gt; getTransferData() - return the actual data that is to be DnD'ed, in my case the list of Files&lt;/ul&gt;&lt;br /&gt;Ive found out that the actual Copying of the files is done before the exportDone() method and after the getTransferData(), which is not suprising since the actual copying is done by the DnD framework. But the exportDone() method has no way of telling what the target was, and therefore makes it impossible to make the copy yourself, or start the download to the location.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;p&gt;So, as far as I can see, there is no solution or workaround for this problem, and that it will be virtually impossible to create applications that can compete with native programs. If someone haves a solution or workaround for this problem, it would be greatly appreciated to get that.&lt;br /&gt;&lt;br /&gt;But for now, I think the default implementation of Sun's DnD of Files is nice, but it lacks this important feature that hinders the usability. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;SUN bug report - &lt;a href="http://developer.java.sun.com/developer/bugParade/bugs/4808793.html"&gt;http://developer.java.sun.com/developer/bugParade/bugs/4808793.html&lt;/a&gt; - Bug # 4808793&lt;a href="http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/TransferHandler.html"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3703531-107995948076142310?l=redsolo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://redsolo.blogspot.com/feeds/107995948076142310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3703531&amp;postID=107995948076142310' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/107995948076142310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3703531/posts/default/107995948076142310'/><link rel='alternate' type='text/html' href='http://redsolo.blogspot.com/2004/03/shortcomings-of-suns-dnd-model.html' title='Shortcomings of Sun&apos;s DnD model!?'/><author><name>redsolo</name><uri>http://www.blogger.com/profile/16392618477260411222</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
