tag:blogger.com,1999:blog-81379882214121966922009-07-05T23:29:48.007+03:00Mostly unoriginalwherein I document some of my thoughts and observations on software, development and life in generalRytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.comBlogger80125tag:blogger.com,1999:blog-8137988221412196692.post-68266990550488013072009-07-05T23:29:00.001+03:002009-07-05T23:29:48.104+03:00London calling<p>So my vacation has just begun. I've only got three weeks this year, because I switched jobs about a quarter of a year into the period that determines the yearly vacation time. I didn’t negotiate more paid vacation time when I took this new job, either. My mistake, but there you go.</p> <p>We’re kicking my vacation off with a trip to London tomorrow. We’ll be there for a week. Our current plans include some of the mandatory sights, but mostly I just want to wander around a bit, sit in cafés, browse books at book stores and get to know the local culture a bit.</p> <p>In the meantime, three of our friends are touring the Europe together on the <a href="http://www.interrail.net/">InterRail</a>. With any luck, they’ll manage a detour to London for a day or two so we can hit the town together, and see what sort of mayhem we can come up with. :)</p> <p>In other news, I’m futzing a bit with Windows Live Photo Gallery – I think it really needs a publishing plug-in that creates a zip archive from the selected images. This will most likely end up being Yet Another Project I Won’t Finish, but still, it’s enough to keep me interested. </p> <p>Another developer-y thing I’ve been looking at is the XNA framework. It’s really fun, even if all I’ve managed so far is to draw a couple of lines here and there. I’m considering starting a small game project with a friend of mine.</p> <p>This about wraps it up for today. Rytmis out.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-6826699055048801307?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-32207578650548361662009-06-25T23:13:00.001+03:002009-06-25T23:13:59.661+03:00Friday, here we come<p>Last night we went to see Faith No More at the Kaisaniemi park, home of the <a title="Tuska Open Air Metal Festival" href="http://www.tuska-festival.fi">Tuska Festival</a> (which begins tomorrow, by the by), and even though I’ve never been a big fan, the gig was <em>pure awesome</em>. The sheer intensity of Patton’s act is amazing, his vocal range is beyond belief, and the style with which the band performed made it one hell of a night.</p> <p>While going through the photos (a few of which I cropped up a bit and uploaded to a <a title="rytmis@Flickr: Faith No More @ Kaisaniemi 24.6.2009" href="http://www.flickr.com/photos/33308892@N02/sets/72157620556566658/">Flickr set</a>) I remembered how much I suck as a photographer. By and large that’s because I practice rarely if ever, and I don’t really know the camera I’m shooting with. :P</p> <p>So Tuska tomorrow, and while I’m not attending the festival, I am planning on a little get-together on the lawn outside. The weather so far has been incredible and we’ve got friends from all over coming to join us. Should be fun!</p> <p><a title="Mike Patton" href="http://www.flickr.com/photos/33308892@N02/3660900698/"><img border="0" alt="Mike Patton" src="http://static.flickr.com/3368/3660900698_c03b24ed49.jpg" /></a></p> <p><em>“I see beer… lots and lots of beer in the near future!”</em></p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-3220757865054836166?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-71218583308158786352009-05-21T00:48:00.001+03:002009-06-19T13:54:57.911+03:00My wrongness quota is filling up<p>Today <a title="StackOverflow: Visual Studio loses track of pending changes after unshelve" href="http://stackoverflow.com/questions/886395/visual-studio-loses-track-of-pending-changes-after-unshelve">I blamed TFS for a problem I was having</a>, when it was me all along who was looking in the wrong place. Granted, VS could have been a liiiiittle bit more informative, but still, had I opened the correct branch to begin with, the problem wouldn’t have been there.</p> <p>In the same vein, I noticed that <a title="Previous entry: Windows RC 7 and Visual Studio 2008" href="http://blog.rytmis.net/2009/05/windows-7-rc-and-visual-studio-2008.html">my issue</a> about getting the “upgrade to IE” error on IE 8 was actually because the page in Firefox is a result of a redirect – and guess what happens when you copy the redirected URL and paste it into another browser? You guessed it! You get the redirected page instead of the original one. Duh.</p> <p>Edit: Boy, reading this a month later, I realized I had mixed up the link titles and the link texts. Even took me a while to figure out what I was trying to say there. :P Well, that’s fixed now.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-7121858330815878635?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-46963172196538288792009-05-16T13:27:00.001+03:002009-05-16T13:27:40.859+03:00Windows 7 RC and Visual Studio 2008<p>So I thought I’d install VS 2008 to dabble around with <abbr title="Windows Presentation Foundation">WPF</abbr> a bit. After the installer was finished, I was confronted with this:</p> <p><a href="http://lh3.ggpht.com/_Mp0Wg4oMQjM/Sg6VCpByVJI/AAAAAAAAACw/Slj2qJ2Vfzk/s1600-h/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Visual Studio 2008 installer, showing an error on every component" border="0" alt="Visual Studio 2008 installer, showing an error on every component" src="http://lh4.ggpht.com/_Mp0Wg4oMQjM/Sg6VDNQNFVI/AAAAAAAAAC0/HWGXQDl1BB8/image_thumb1.png?imgmax=800" width="770" height="591" /></a></p> <p>OK, so I reboot my machine, and as soon as I log in, this pops up:</p> <p><a href="http://lh4.ggpht.com/_Mp0Wg4oMQjM/Sg6VD6ru3oI/AAAAAAAAAC4/gFFT_t52K60/s1600-h/image%5B4%5D.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Visual Studio 2008 setup screen with &quot;Check for Service Releases&quot; link active" border="0" alt="Visual Studio 2008 setup screen with &quot;Check for Service Releases&quot; link active" src="http://lh3.ggpht.com/_Mp0Wg4oMQjM/Sg6VEdbP4xI/AAAAAAAAAC8/jXG8Z3UCaj8/image_thumb%5B1%5D.png?imgmax=800" width="512" height="416" /></a> </p> <p>After having seen the error, I think “service releases, let’s see,” and click on the link. Firefox opens up with this:</p> <p><a href="http://lh4.ggpht.com/_Mp0Wg4oMQjM/Sg6VE2GG_0I/AAAAAAAAADA/0cSHAD5RfjY/s1600-h/image%5B9%5D.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Firefox showing a Windows Update message asking to visit the site using the latest IE" border="0" alt="Firefox showing a Windows Update message asking to visit the site using the latest IE" src="http://lh6.ggpht.com/_Mp0Wg4oMQjM/Sg6VFcpuFjI/AAAAAAAAADE/yK_tNDMFsb0/image_thumb%5B7%5D.png?imgmax=800" width="789" height="315" /></a> </p> <p>OK, fair enough, let’s take the URL and fire up IE:</p> <p><a href="http://lh5.ggpht.com/_Mp0Wg4oMQjM/Sg6VGfEVFsI/AAAAAAAAADI/KNP6DFzFfNY/s1600-h/image%5B13%5D.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="The latest IE showing a Windows Update message asking to visit the site using the latest IE" border="0" alt="The latest IE showing a Windows Update message asking to visit the site using the latest IE" src="http://lh4.ggpht.com/_Mp0Wg4oMQjM/Sg6VHGcpfmI/AAAAAAAAADM/VSobuHgi2vE/image_thumb%5B9%5D.png?imgmax=800" width="585" height="520" /></a> </p> <p>OK, now you’re just fucking with me. Seriously.</p> <p>The kicker? Looks like VS has no problems working, despite the apparent failure of every single installed component. :-)</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-4696317219653828879?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-33993504559355082542009-04-28T23:19:00.001+03:002009-04-28T23:19:40.552+03:00Mathemagics<p>I’ve been listening to and transcribing the <a title="Transcript of StackOverflow podcast 31" href="https://stackoverflow.fogbugz.com/default.asp?W26423">StackOverflow Podcast 31</a> in the last couple of days, and something Jeff Atwood said struck a nerve:</p> <blockquote> <p><b>Spolsky:</b> Maybe you just don't like the kind of math they teach in American high schools. I mean, maybe you would like discrete math or set theory or that kind of stuff. The stuff that's like really interesting math.</p> <p><b>Atwood:</b> I think historically the problem has been that I just didn't really have -- couldn't really grok it at some fundamental level, like I could do it, like you could just show me a problem and I could solve that problem. But I couldn't really extrapolate that to anywhere interesting. At all.</p> </blockquote> <p>I can relate to Jeff here. That used to be, and to a very large extent, still is, my problem with math. While I can mechanically apply a solution I’ve learned, actually extracting the underlying principle and being able to identify analogous problems doesn’t come nearly as easily. </p> <p>Fortunately, university math tends to be taught differently than high school math, and there is a heavy emphasis on being able to prove things and understand why things work, not just learn and apply them. That, and hindsight from the way I botched my high school studies should ensure that I learn at least a thing or two this time. </p> <p>Listening to that bit in the podcast made me wish I had more time to devote to studying in general, and math specifically. Too bad I’m busy with my Data Structures course (final exam tomorrow) and work. Still, I’m keeping an eye out for math textbooks that seem interesting enough to grab my attention even outside the lecture halls.</p> <p>Speaking of Data Structures, I have this funny feeling that I’ve both let myself down in terms of what I got from the course, and simultaneously learned more than I thought I had. Simply being familiar with some simple tree and graph traversal algorithms has given me the kind of insight into programming problems I didn’t used to have. It’s great, being able to recognize a concrete problem as an instance of something more abstract I’ve seen before, because it opens up a wide variety of known solutions to the problem. :)</p> <p>Here’s hoping tomorrow’s exam won’t be a complete disaster. \o/</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-3399350455935508254?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-16825090660714437332009-04-07T23:29:00.001+03:002009-04-07T23:29:01.960+03:00Exercise, debugging and books aplenty.<p>Phew, finally managed to complete <a title="One Hundred Pushups: Week 2" href="http://hundredpushups.com/week2.html">Week 2, Day 1</a> of the One Hundred Pushups program, even if it was just barely. This is the third time I’m repeating the Week 2 exercises. I decided I’d keep repeating until I can complete each day with at least the minimum number of pushups in the last set. So far I’ve been living up to the decision, too.</p> <p>--</p> <p>Today at work brought to mind a meta-quote from Code Complete:</p> <blockquote> <p><i>“If you haven't spent at least a month working on the same program—working 16 hours a day, dreaming about it during the remaining 8 hours of restless sleep, working several nights straight through truing to eliminate that &quot;one last bug&quot; from the program—then you haven't really written a complicated computer program. And you may not have the sense that there is something exhilarating about programming. “</i></p> <p><i>—Edward Yourdon </i></p> </blockquote> <blockquote> <p><i>This lusty tribute to programming machismo is pure B.S. and an almost certain recipe for failure. Those all-night programming stints make you feel like the greatest programmer in the world, but then you have to spend several weeks correcting the defects you installed during your blaze of glory. By all means, get excited about programming. But excitement is no substitute for competency. Remember which is more important. </i></p> </blockquote> <p>Props to Jeff Atwood for <a title="Coding Horror: Because I love the smell of compilation in the morning" href="http://www.codinghorror.com/blog/archives/000143.html">typing this quote out</a> so I didn’t have to. </p> <p>Both the original quote and McConnell’s commentary sprang to mind as I drank cup after cup of coffee (and my mug is <a title="The Daily WTF: Announcement: Get the Mug" href="http://thedailywtf.com/articles/announcement-get-the-mug.aspx">not lacking in volume</a>), tried to debug JITted .NET code by watching the local variables and call stack (because that was the only thing I could understand – you see, I’m not a Real Programmer), and finally, almost by a stroke of luck managing to figure out the cause of the mystery bug. </p> <p>I had forgotten how strange that combination of excitement and frustration can be. I almost shouted out loud as laid out a solution in my head and went off to explain it to my team members. </p> <p>--</p> <p>Finally managed to get a copy of <a title="Amazon.co.uk (unaffiliated): The C Programming Language (2nd Edition)" href="http://www.amazon.co.uk/C-Programming-Language-2nd/dp/0131103628/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1239135307&amp;sr=8-1">K&amp;R C</a>, too. I read about half of it in one sittng, pleased with how the book is written and wondering why I ever bothered with a huge monster like <a title="Amazon.co.uk (unaffiliated): C Primer Plus" href="http://www.amazon.co.uk/C-Primer-Plus-Stephen-Prata/dp/0672326965/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1239135386&amp;sr=1-1">C Primer Plus</a>, which drones on and on about basic programming constructs, and is a bitch to carry around. I also got <a title="Amazon.co.uk (unaffiliated): The One-page Project Manager" href="http://www.amazon.co.uk/One-page-Project-Manager-Communicate-Manage/dp/0470052376/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1239135489&amp;sr=1-1">The One-page Project Manager</a> – communicating the status of a project is something I’m interested in, specifically ways to visualize actual progress. A quick glance at the contents of the book suggests this is not the kind of progress or communication I meant. More on that later.</p> <p>--</p> <p>That’s all for today. :)</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-1682509066071443733?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-40154227973786617472009-03-09T20:15:00.001+02:002009-03-09T20:15:50.452+02:00A week of Windows 7<p>I’ve been playing with Windows 7 Beta for just under a week now. Initially I thought I’d install it in a virtual machine, but I never seemed to have enough space on my laptop. I also had an issue with my Vista install – a lockup that forced me to do a hard reset also broke a file or two that were integral to the functioning of Windows Update. Imagine my surprise when I figured I hadn’t had any updates in over a month. I tried various voodoo-esque methods to fix things, but as each of them failed to provide results, I began to consider using a beta version more and more. </p> <p>The installer seemed nice for starters, almost on par with modern Linux installers. ;-) However, one thing that caused hours of frustration was that since I had PowerShell installed, the upgrade refused to run. And Vista refused to show me any way to uninstall PowerShell. After some searching I found a registry setting which fooled the installer to thinking I didn’t have PS, and things began to work.</p> <p>Well, by “work” I mean the installer agreed to run. It took hours to “gather” my files (why it needed to know that, I have no idea – every file I care about is in the exact same spot it was in before the upgrade). In the morning I peeked at the progress. It told me “21%” and “Windows needs to reboot”, but gave me no way to agree to the reboot. A forced restart later, the installer booted up, only to fail at resuming. I figured this was due to the forced restart, booted back into Vista (luckily the installer left Vista untouched at that point) and fired the installer again. This time at 21% I got a reboot prompt, after which things have gone smoothly.</p> <p>I had to futz with the settings a little to make sleep-on-lid-close work again, which was a bit annoying, but the bigger problem is WMP 12, which downright refuses to work after I wake the laptop up by opening the lid. The application launches, but then it presents me with this:</p> <p><a href="http://lh5.ggpht.com/_Mp0Wg4oMQjM/SbVcz0QY9wI/AAAAAAAAACo/K3dI_f87sqY/s1600-h/wmpfreeze%5B2%5D.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Windows Media Player 12 frozen right after launch" border="0" alt="Windows Media Player 12 frozen right after launch" src="http://lh6.ggpht.com/_Mp0Wg4oMQjM/SbVc0iX-m7I/AAAAAAAAACs/gCZKahmxXkU/wmpfreeze_thumb.png?imgmax=800" width="244" height="195" /></a> </p> <p>and a busy cursor. And there it remains. In fact, it refuses to die by any conventional means: the close button doesn’t work, the close command in the Jump List menu doesn’t work, taskkill doesn’t have any effect, and neither does ending the process via Task Manager. The only thing that does work is restarting the computer. At least once I’ve had even that fail to kill the WMP process, so the shutdown process shut down, and the OS kept on running. A hard reset and a disk check later, things work fine again – until the next time I close the lid. </p> <p>I <a title="Microsoft TechNet Forums - Windows 7 Media - Media Player won&#39;t work after laptop wakes up" href="http://social.technet.microsoft.com/Forums/en/w7itpromedia/thread/bed8ae6b-f7a1-43d0-a0f9-6a69f3e29f62">posted a summary</a> about the problem on the <a title="Microsoft TechNet Forums - Windows 7 Beta" href="http://social.technet.microsoft.com/Forums/en/category/w7itpro/">Windows 7 Beta TechNet forum</a>. Here’s hoping someone has a solution. :)</p> <p>Overall, I like Windows 7. It does a good job at bringing the Windows GUI closer to modern standards. The window manager has even learned a couple of useful tricks. I can’t wait for the day when alternate Window Managers for Windows begin to appear. </p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-4015422797378661747?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-14232333400794555722009-03-07T23:43:00.001+02:002009-03-07T23:46:33.103+02:00Unleash that dragon<p>So I’m in the clutches of the lurgy here, and trying to keep my brain active. I’ve received a miscellaneous bunch of books in the mail in the last few days, one of them being Microsoft Expression Blend Unleashed. I’ve read the first two chapters, and skimmed the next two. </p> <p>First, a quote:</p> <blockquote> <p>“If you have used Microsoft Vista, you will have noticed how Microsoft appears to have finally gotten an outstanding balance with their product with respect to familiarity, visual appearance and general feel.”</p> </blockquote> <p>OK, so we’re starting off with a Vista ad. Great. This bit, on page 10, was the moment when I began to question my judgment in choosing this book over the others on the market. No, wait, that happened on page 4:</p> <blockquote> <p>“Next Generation Hardware Is Coming!</p> <p>Already hardware changes are being made to accommodate Vista-specific features like Windows Sideshow. </p> <p>[…] </p> <p>However, it appears that the implementation has been slow to gather momentum in this particular case.”</p> </blockquote> <p>… yeah.</p> <p>The same chapter expresses similar feelings towards other Microsoft technologies, such as Silverlight. Fine, I get it, Silverlight is cool. However, I bought a book to learn how to work with the tools, not to be blasted with marketing garbage.</p> <p>Chapter 2 really makes clear that this book is not intended for a programmer. Topics that are obvious or at least easy for a developer are discussed in a tone that, to me, feels condescending. Around page 48 things get more interesting – first demo app. At this point, the author’s conversational tone is beginning to feel forced. However, the next few pages do cover bits of the Blend tooling that are interesting to me. On the downside, that coverage is accompanied by a step-by-step tutorial <em>no less than 44 steps long</em>. Perhaps this could have been broken down to a number of sub-tasks, so that the steps could be kept simple, and grouped logically?</p> <p>Chapter 3 meticulously goes through all the panels of the Blend UI. Maybe it’s just me, but again a little breathing room would have been nice.</p> <p>I have few comments about the XAML basics bits in Chapter 4. It’s a very short chapter.</p> <p>I’m really hoping the rest of the book offers something more compelling for me. More posts when I read further. </p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-1423233340079455572?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-9207629809366200532009-03-03T20:41:00.001+02:002009-03-03T20:41:12.272+02:00Lazy bum…<p>No pictures, or posts for that matter. I’m coming down with something, possibly a flu, possibly worse – I already have a sore throat, and my bronchi seems to be clogging up. </p> <p>Brief updates: I’ve started my new gig with a day of general briefing about the customs of the customer, and another day of training specific to the customer’s platform. Movements are definitely constrained, code-wise, but the platform seems impressive.</p> <p>I’m also re-doing <a href="http://hundredpushups.com/week1.html">week one of One Hundred Push-ups</a>, now with considerably less muscle ache on the in-between days. Now, if I could only get my eating habits in check… :) </p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-920762980936620053?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-81189983890900776812009-02-24T18:39:00.001+02:002009-02-24T18:39:50.908+02:00Ow ow ow<p>I’m back to trying the one hundred pushups exercise program – they even have a spiffy new logger now – and yesterday was week 1, day 1. I feel like someone beat me up with a baseball bat. It’s going to feel worse tomorrow, and tomorrow’s week 1, day 2. Ow. Ow ow ow.</p> <p>I’ve got the prosthesis now, trying to get used to it. It looks great, but feels weird. More on that, possibly with pics, later when I feel less lazy.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-8118998389090077681?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com1tag:blogger.com,1999:blog-8137988221412196692.post-30251292225209480582009-02-12T21:57:00.001+02:002009-02-13T20:12:15.329+02:00Nope, this is not the way to impress me<p>[<strong>Update</strong>: I was contacted by SlickEdit support. They provided the patch for me, updated the forum post to contain the correct support address and were generally very friendly. Lesson learned: wait a day or two before posting ,-) I’m leaving this post up anyway, since it’s an accurate description of the events and my impressions yesterday.]</p> <p>Today I was working on some Flex code, popped over to <a title="StackOverflow" href="http://stackoverflow.com/">StackOverflow</a> and saw an ad for <a href="http://www.slickedit.com/">SlickEdit</a>. Curious, I cliked the ad to refresh my memory about the product, and I noticed they boast Vim-like input. That makes me instantly want to like an editor. Even better, they offer a plugin for Eclipse, SlickEdit Core. I’ve been less than pleased with <a href="http://www.viplugin.com/viplugin/">ViPlugin</a>, my current Eclipse-Vim provider, because it doesn’t want to play ball with Flex too well, and it has an irritating bug where a blank line at the end of a document causes the cursor to always revert to the top of the file, no matter what I do. (Note to self: the plugin has been updated.)</p> <p>Anxious to try how SlickEdit works, I installed the plugin. It bugged me about getting a trial license key, which went relatively smoothly. The editor itself seemed fast, the Vim-emulation felt comfortable, but opening a MXML file still popped up the Flex editor, and I couldn’t figure out a way to change that. Instead of working through all the options, I searched Google for an answer, and found a forum posting saying they have a patch that improves Flex integration, and provides breakpoints and suchlike to the SlickEdit editor. Considering the debugger is a feature I end up needing (more often than I’d like), I was suddenly very interested. The posting said to email their support for the patch. So I did, and this is what I got:</p> <blockquote> <p>We were unable to match your email with the subject “Flex Builder support for SlickEdit Core?” to an open case in our support system. If you were replying to an existing case, please include the case number (in the format of CAS-#####-####) in your subject line. <br />If you wish to open a new case please submit your request using the in-product mechanism:</p> <ul> <li>From within SlickEdit® 2008 via Help &gt; Contact Product Support </li> <li>For SlickEdit® Core for Eclipse™ you can do this via Help &gt; SlickEdit Support Web Site and click on the &quot;Open a Support Case&quot; link </li> <li>For SlickEdit® Tools for Microsoft® Visual Studio® you can do this via SlickEdit &gt; Contact Product Support </li> </ul> <p>Alternatively, if your product is not running you can submit your request on the SlickEdit Website at <a href="http://www.slickedit.com/supportcase/">http://www.slickedit.com/supportcase/</a> <br />Thank you,</p> <p>SlickEdit Product Support</p> </blockquote> <p>The tone is polite, but what the… can’t you guys accept <em>regular email</em> without making me jump through hoops? I was evaluating the product for <em>work</em>, and while at home I can spend time doing stuff like blogging about things that bug me, at work I really should be <em>working</em>. So if you make it hard for me to evaluate your product for my day-to-day needs, odds are <em>I’m not going to</em>.</p> <p>Now, you could make a fair case by noting that I usually buy single licenses, rarely buy anything that exceeds 200€ in price and so on and so forth. But I really wanted to like the product, and I had already decided that $99 really wasn’t a bad price at all.</p> <p>You could also say, well, this patch is for existing customers only. Fine, if that’s the case, then you’re not the company I want to do business with. If I can’t make your product work for me, that’s pretty much the end of the story right there.</p> <p>I tend to advertise products I do like with considerable vigor – I’ve managed to sell a bunch of ReSharper licenses on JetBrains’s behalf. Too bad the <a href="http://www.jetbrains.net/confluence/display/JBSDR/JetBrains+Seeder+Program;jsessionid=0998CE0660CE542A61A3759E5BAF26AD">JetBrains Seeder program</a> was established after I had done so…</p> <p>… anyway. Here’s the deal: I’m always looking for good tools at prices I can easily afford to pay myself. When I find them, I want a web site that displays the features in an easily navigable way, a payment processor that is secure and easy, a license system that either doesn’t exist at all or will provide the license for me straight after the payment has been verified, and a company that actually wants to do business with me. Take one or more of those away, and your product needs to be seriously amazing and/or mandatory for something I’m doing before I cough up the dough.</p> <p>In the meantime, I’m still in the market for a good Vi/Vim plugin for Eclipse, preferably one that plays nice with existing editors.</p> <p>[edit]</p> <p>It occurs to me that SlickEdit support is probably in another time zone (duh), so perhaps I’ll be getting a reply during the night. If that’s the case, I’ll happily re-evaluate the situation. Even so, the email response I got gave me the feeling that I had done something wrong, and that they wouldn’t contact me unless I re-submitted my request through another means.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-3025129222520948058?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-22921879210438331512009-02-10T19:50:00.001+02:002009-02-10T19:50:51.508+02:00Changing the version of an assembly reference on the fly<p>Today I wrote a small wrapper for the <a title="Quartz.NET - Enterprise Job Scheduler for .NET Platform" href="http://quartznet.sourceforge.net/">Quartz.NET</a> scheduler library to integrate it into a project I’m working on. The project has been using MySQL Connector/.NET version 5.1 for its database needs for a while now, and I was intent on storing the Quartz scheduler jobs in the same database, using the same library. </p> <p>Quartz comes with a pre-configured set of ADO.NET providers. It allows you to set the connection string, user name and whatnot, but what it doesn’t allow you to do is override the class names it uses to instantiate the ADO.NET provider classes. That’s a bit strange, since near as I can tell, it contains a mechanism that could allow that. </p> <p>That, in itself, wouldn’t be a problem. But we were using MySql.Data.dll version 5.1.3.0 and the embedded property file in Quartz.dll specified version 5.1.6.0.</p> <p>API-wise I suspected that nothing remarkable had changed, and that we’d be able to use 5.1.3.0 – in fact, my colleague had successfully recompiled Quartz from source to use that version, and everything had worked. But I really didn’t want to include the Quartz sources in our build, we have more than enough projects already.</p> <p>I had a recollection that there is a mechanism that allows to change the assembly on the fly, but I couldn’t recall what it is. So I began to type my question at <a title="StackOverflow" href="http://stackoverflow.com">StackOverflow</a>, and lo and behold, one of the suggested already-asked questions had a comment that mentioned <a title="MSDN: Assembly Binding Redirection" href="http://msdn.microsoft.com/en-us/library/2fc472t2(vs.71).aspx">Assembly Binding Redirection</a>. That rang a bell, I followed the link, and no more than two minutes later I had managed to force Quartz to use the version of MySql.Data I wanted it to use. It’s this simple:</p> <blockquote> <pre>&lt;configuration&gt; &lt;runtime&gt; &lt;assemblyBinding xmlns=&quot;urn:schemas-microsoft-com:asm.v1&quot;&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity name=&quot;myAssembly&quot; publicKeyToken=&quot;32ab4ba45e0a69a1&quot; culture=&quot;neutral&quot; /&gt; &lt;bindingRedirect oldVersion=&quot;1.0.0.0&quot; newVersion=&quot;2.0.0.0&quot;/&gt; &lt;codeBase version=&quot;2.0.0.0&quot; href=&quot;http://www.litwareinc.com/myAssembly.dll&quot;/&gt; &lt;/dependentAssembly&gt; &lt;/assemblyBinding&gt; &lt;/runtime&gt; &lt;/configuration&gt;</pre> </blockquote> <p>I suppose I should qualify this post with a “be sure you know what you’re doing if you use this.” You need to be sure that the substituted assembly obeys the contract of the original, otherwise you will likely break things. </p> <p>This is a powerful mechanism to have, and since I had forgotten it once already, I thought I’d document it here to make sure it doesn’t happen again. .-)</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-2292187921043833151?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-76639832891288664322009-02-09T23:10:00.001+02:002009-02-09T23:10:35.325+02:00C# using statement, redux<p>Last week, I wrote about the <a title="Previous entry: Things I didn’t know (or remember) about the C# using statement" href="http://blog.rytmis.net/2009/02/things-i-didnt-know-or-remember-about-c.html">things I had not known about the C# using statement</a>:</p> <blockquote> <p>Multiple objects can be used in with a <b>using</b> statement, but they must be declared inside the <b>using</b> statement, like this:</p> </blockquote> <blockquote> <pre>using (Font font3 = new Font(&quot;Arial&quot;, 10.0f), font4 = new Font(&quot;Arial&quot;, 10.0f)) { // Use font3 and font4. }</pre> </blockquote> <blockquote> <p>I’m beginning to wonder where it was I learned the using statement from, given that I really didn’t know this is supported. Granted, I learned my C# basics when the language was version 1.0, and while the older reference does have an example of this usage, it’s not as clear as the current version. Still, lacking this knowledge meant that I’ve (ab)used braceless blocks to achieve the same effect:</p> </blockquote> <blockquote> <pre>using (Font font3 = new Font(&quot;Arial&quot;, 10.0f)) using (Font font4 = new Font(&quot;Arial&quot;, 10.0f)) { // Use font3 and font4. }</pre> </blockquote> <p>I wasn’t actually as far off as I thought – what the documentation doesn’t clearly spell out is that the syntax for the variable declaration inside the using statement must match a normal variable declaration. And there’s no way to do this:</p> <blockquote> <pre>string foo = “bar”, int baz = 42;</pre> </blockquote> <p>Because C# only allows you to initialize variables of one type in one declaration, and the same limitation applies to the using statement. The compiler knows this, the documentation wasn’t so clear about it. I’ve rarely declared two variables of the same type like in my example – instead, it’s been more like this:</p> <blockquote> <pre>using (DbConnection connection = OpenConnection()) using (IDataReader reader = connection.ExecuteReader(“…”)) { // ... }</pre> </blockquote> <p>in which case the neater syntax doesn’t actually work at all. So I’m still stuck with my syntax abuse, unless I want to nest blocks. And this sort of seems to communicate my intent: I’m trying to say, the usages of these two things are linked in scope. Were I to do something to the connection before running the statement, I’d of course indent them differently.</p> <p>I’m still waiting for a better idea.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-7663983289128866432?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-434327256052784252009-02-09T22:55:00.001+02:002009-02-09T22:55:26.449+02:00Holy crap, Delphi is alive and kicking<p>Holy crap, it looks like CodeGear is actively doing Good Things to keep Delphi alive! Apparently, <a title="hans-eric.com: Welcome Back Delphi" href="http://www.hans-eric.com/2009/02/09/welcome-back-delphi/">Delphi 2009 supports anonymous functions</a>:</p> <blockquote> <p>Not only that, the language (Object Pascal) has finally woken from its stagnated state and is getting increasingly modern. It now implements, for instance, closures (anonymous methods) which is quite rare for a non garbage collected language.</p> </blockquote> <p>Now, while the first paragraph should convey my excitement about the development, that alone isn’t quite enough to bring Delphi back to the front lines. I’ve used several versions of Delphi (5, 6, 7, 8 and 2006), and since version 6, seen quite a few problems with the tools and libraries. First of all, Delphi 7 deprecated a number of components without providing a migration path – only to introduce the very same components in source code, the <em>demos </em>folder of all places. </p> <p>Delphi 8 was half-baked. The IDE was buggy, the forced migration to .NET was a bad idea, and the company quickly reversed their direction with Delphi 2005. A bug we discovered for Delphi 8 still existed two major versions later in the 2006 edition. When I finally figured out the steps to trigger it and reported it to Quality Central, I got no response. Eventually, the bug was closed with the response: “feature has been removed.” </p> <p>Oh, and one of the crowning moments: I phoned Borland’s Finland offices to ask a licensing question, only to be told that they don’t handle those issues. At all. </p> <p>After a history like this, CodeGear needs to pull some serious stunts to regain credibility. Evolving the language is not a bad start. </p> <p>Reading up more on CodeGear’s latest, Delphi for .NET seems to be resurrected as <a title="CodeGear: Delphi Prism" href="http://www.codegear.com/products/delphi/prism">Delphi Prism</a>, powered by a compiler from another vendor, <a title="RemObjects software" href="http://www.remobjects.com/">RemObjects software</a>. What I find notable is that the RemObjects Oxygene compiler has boasted support for Mono since I first saw it. In fact, cross-platform applications running on OS X and Linux, courtesy of Mono are a feature highlight.</p> <p>Now, if CodeGear can manage to nurture the community of Delphi developers in a way that matches the .NET and Java communities, things could be looking up.</p> <p>Welcome back, Delphi!</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-43432725605278425?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-82830079947771706542009-02-04T19:26:00.001+02:002009-02-04T19:31:07.557+02:00Things I didn’t know (or remember) about the C# using statement<h4>Declaring disposables outside the using statement</h4><p>The first thing that surprised me was that you don’t have to declare the IDisposable in the using statement. Maybe because something like this:</p><pre>public class Foo : IDisposable { Bar bar = new Bar(); public void Dispose() { using(bar) { bar.DoSomething(); } } }</pre><p>doesn’t quite feel natural to me. However, MSDN does mention that this usage is possible, so I shouldn’t be surprised. I came across this one when trying to avoid writing a <tt>try/finally</tt> pair to dispose of a member variable inside a Dispose method.</p><h4>Multiple IDisposables in a single using statement</h4><p>While browsing the <a title="MSDN: using statement (C#)" href="http://msdn.microsoft.com/en-us/library/yh598w02(VS.80).aspx">documentation for the using statement</a>, I came across this gem:</p><blockquote> <p>Multiple objects can be used in with a <b>using</b> statement, but they must be declared inside the <b>using</b> statement, like this:</p> <pre>using (Font font3 = new Font(&quot;Arial&quot;, 10.0f), font4 = new Font(&quot;Arial&quot;, 10.0f)) { // Use font3 and font4. }</pre></blockquote><p>I’m beginning to wonder where it was I learned the using statement from, given that I really didn’t know this is supported. Granted, I learned my C# basics when the language was version 1.0, and while the older reference does have an example of this usage, it’s not as clear as the current version. Still, lacking this knowledge meant that I’ve (ab)used braceless blocks to achieve the same effect:</p><pre>using (Font font3 = new Font(&quot;Arial&quot;, 10.0f)) using (Font font4 = new Font(&quot;Arial&quot;, 10.0f)) { // Use font3 and font4. }</pre><p>which not only is questionable in terms of syntax abuse, but also more verbose than the better way.</p><h4>Variables declared inside a using statement are read-only</h4><p>This one is courtesy of ReSharper’s background compilation. I was cleaning up code that opened a database connection twice by moving the opening statement to the outer scope and converting a <tt>try/finally</tt> pair to a using statement, when I got this message (I’m futzing with File.Open here purely for illustrative purposes):</p><p><a href="http://lh3.ggpht.com/_Mp0Wg4oMQjM/SYnP2vwDT9I/AAAAAAAAACI/uCf0t1V0980/s1600-h/resharper_using_readonly%5B3%5D.png"><img title="ReSharper showing an error when trying to assign to to a variable declared inside a using statement" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="106" alt="ReSharper showing an error when trying to assign to to a variable declared inside a using statement" src="http://lh5.ggpht.com/_Mp0Wg4oMQjM/SYnP3Hvz1iI/AAAAAAAAACM/P9VuHkn3JVc/resharper_using_readonly_thumb%5B1%5D.png?imgmax=800" width="404" border="0" /></a></p><p>This makes a lot of sense, but is still somewhat surprising, given that <a title="StackOverflow: Why does C# disallow readonly local variables?" href="http://stackoverflow.com/questions/443687/why-does-c-disallow-readonly-local-variables">C# does not have a way to declare read-only local variables</a>. Another thing that seems a bit inconsistent to me is that when the declaration is outside the using statement, the compiler doesn’t mind if you assign to it:</p><p><a href="http://lh5.ggpht.com/_Mp0Wg4oMQjM/SYnP3ejeyqI/AAAAAAAAACQ/17Qf2wvrNZo/s1600-h/resharper_using_previously_declared_disposable%5B3%5D.png"><img title="When the declaration is moved outside the using statement, reassigning is possible again" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="116" alt="When the declaration is moved outside the using statement, reassigning is possible again" src="http://lh3.ggpht.com/_Mp0Wg4oMQjM/SYnP3vsbgZI/AAAAAAAAACU/6bbIDJPAk8A/resharper_using_previously_declared_disposable_thumb%5B1%5D.png?imgmax=800" width="387" border="0" /></a> </p><p>which doesn’t make so much sense to me. I’m sure there’s a reason, but when I read that, I’m thinking whatever is assigned to foo before the using statement will be disposed of. I’m fairly sure that isn’t the case when reassigning is allowed.</p><h4>So if I didn’t know this about the using statement, how well do I know C#?</h4><p>I thought I knew the C# language pretty well, since it has been my primary tool at work for quite some time now. Turns out I was really, really wrong. I think I’m going to get a C# 3.0 language reference book just to go through the different aspects of the language and see if there are other places where I’ve missed something obvious.</p><p>The bigger question is, how can I ever hope to master even this one language, if details like this have eluded me for over four years, especially since C# is evolving rapidly.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-8283007994777170654?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-19756336354812905352009-02-03T22:22:00.001+02:002009-02-03T22:22:03.675+02:00I’m being just a tiny bit evil<p>… which is to say, I added the Google Analytics tracker to this blog. Not so much to know how many readers I have as to know if I have any. I’m fairly sure it won’t show up in the RSS feed, so it very possibly might not tell me anything. Feel free to block it if it bugs you. .-)</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-1975633635481290535?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-5912467394066328462009-02-03T20:47:00.001+02:002009-02-03T20:47:26.805+02:00Back in business<p>Back to work since yesterday, and hoo boy, it’s good to be alive. It didn’t take long for the hair pulling and swearing to begin, but in a good way. I enjoy the challenge of trying to clean up a messy code base – what I don’t enjoy are the days when progress is scarce.</p> <p>Popped by the Uni for some Data Structures exercises and to catch a glimpse of my co-students. I felt like staying in, just because I really like the blend of people who appreciate quirky humor, geekiness, caffeine and code.</p> <p>Today’s challenge was (and tomorrow’s still is…) creating a scheduled task that accesses some features that were – I hesitate to say “designed” – never thought to be useful outside a scenario where we know of a single logged user. It’s not feasible to try to extend the session concept to include a “working as the system here” type of session, due to a large number of potential, unexpected consequences. Hence the sane response seems to be to try and carefully write out the bits that always expect a session to be had. </p> <p>Normal sleeping patterns are creeping in, after two nights of short, restless sleep and two consecutive mornings of still getting up between 6:15 and 6:45. Good thing I know this works, otherwise I might not have the willpower. I had almost three weeks to sleep as much as I wanted. That’s something I could get used to.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-591246739406632846?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-91165719253348860442009-01-31T22:29:00.001+02:002009-01-31T22:29:51.890+02:00Don’t try this at home, we’re professionals<p>So I just received the feedback for my last exercises for the Data Structures course. Three mistakes total: I transformed an O(n) algorithm to an O(n<sup>2</sup>) one (although I spotted that one myself – after I had already submitted my answers, d’oh!) and my lazy-delete linked list was doubly borked: two successive deleted items confused my Purge routine altogether, and the search would stop on a deleted item.</p> <p>Ouch.</p> <p>OK, so I admit, I didn’t really pay attention to the search thing at all, and I'm taking some credit for figuring the O(n<sup>2</sup>) thing out myself, but damn, not checking for two successive deleted items in the key part of the algorithm I was actually working on. Sloppy!</p> <p>Fortunately, at work I tend to interleave writing tests with implementing my algorithms, but I have to admit that I’m not sure if I would have thought to check for this case when doing TDD, either.</p> <p>Sobering thoughts. One should never ever fall to the trap of thinking that a problem is so trivial it doesn’t merit a thorough checking. Because <a title="Jon Skeet: Coding Blog: Programming is hard" href="http://msmvps.com/blogs/jon_skeet/archive/2009/01/29/programming-is-hard.aspx">programming is hard</a>:</p> <ul> <li>If your code deals with arbitrary human text, it's probably broken. (Have you taken the <a href="http://www.moserware.com/2008/02/does-your-code-pass-turkey-test.html">Turkey test</a> recently?) </li> <li>If your code deals with floating point numbers, it's probably broken. </li> <li>If your code deals with concurrency (whether that means database transactions, threading, whatever), it's probably broken. </li> <li>If your code deals with dates, times and time zones, it's probably broken. (Time zones in particular are hideous.) </li> <li>If your code has a user interface with anything other than a fixed size and a fixed set of labels (no i18n), it's probably broken. </li> </ul> <p>Let me add one to the list: if your code implements an algorithm you that you can’t verify for correctness at a glance, it’s probably broken. Especially if I wrote it.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-9116571925334886044?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-70361455223765857412009-01-31T16:56:00.001+02:002009-01-31T16:56:12.403+02:00ASP.NET MVC updated<p>Just a quick note: the RC release of ASP.NET MVC introduced some regressions that are fixed in a refresh release (the file name is the same, but the signature date is Jan 29th instead of 23rd or 24th).</p> <p>More info at <a title="You&#39;ve been HAACKED: ASP.NET MVC RC Refresh" href="http://haacked.com/archive/2009/01/30/aspnetmvc-refresh.aspx">You've been HAACKED</a>.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-7036145522376585741?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-49040448623514288332009-01-30T22:05:00.001+02:002009-01-30T22:05:56.373+02:00Friday miscellany<p>Synchronicity strikes again. A couple of days after I write about <a title="Earlier entry: Time for improvement" href="http://blog.rytmis.net/2009/01/time-for-improvement.html">what I think is the responsible way to refactor</a>, <a title="Raganwald" href="http://weblog.raganwald.com/">Raganwald</a>’s del.icio.us link feed coughs up a post titled “<a title="Eric Ries: Refactoring yourself out of business" href="http://startuplessonslearned.blogspot.com/2009/01/refactoring-yourself-out-of-business.html">Refactoring yourself out of business</a>” from a blog by a chap named Eric Ries. Choice quotes:</p> <blockquote> <p>They asked for my advice, and we went through a number of recommendations […] I thought we were having a successful conversation. Towards the end, I asked when they'd be able to make these changes, so that we could meet again and have data to look at together. I was told they weren't sure, because <strong>all of their engineers</strong> were currently busy refactoring. You see, the <strong>code is a giant mess, has bugs, isn't expandable, and is generally hard to modify without introducing collateral damage</strong>. In other words, it is dreaded legacy code. The engineering team […] is taking several weeks to bring it up to modern standards, including unit tests, getting started with continuous integration, and a new MVC architecture. Doesn't that sound good?</p> </blockquote> <blockquote> <p>I asked, &quot;how much money does the company have left?&quot; And it was this answer that really floored me. They only have enough money to last another three months.</p> </blockquote> <blockquote> <p>I have no doubt that the changes the team is currently working on are good, technically sound, and will deliver the benefits they've claimed. Still, <strong>I think it is a very bad idea to take a large chunk of time (weeks or months) to focus exclusively on refactoring</strong>. The fact that this time is probably a third of the remaining life of the company (these projects inevitably slip) only makes this case more exaggerated.</p> </blockquote> <blockquote> <p>[…]</p> <p>We're always going to have to live with legacy code. And yet it's always dangerous to engage in large refactoring projects. In my experience, the way to resolve this tension is to follow these Rules for Refactoring: </p> <ul> <li>Insist on incremental improvements. </li> <li>Only pay for benefits to customers.</li> <li>Only make durable changes (under test coverage). </li> <li>Share what you learn. </li> </ul> </blockquote> <p>I can’t help but notice the bulleted list looks a lot like what I was suggesting. .-)</p> <p>Now, I’ve butchered the quote from Eric’s entry (sorry!) to save some space, so if my previous rant resonated with you, <a title="Eric Ries: Refactoring yourself out of business" href="http://startuplessonslearned.blogspot.com/2009/01/refactoring-yourself-out-of-business.html">go read the original text</a> – it’s far more comprehensive, and well-written. </p> <p>Next up, TechCrunch has a story on <a title="TechCrunch: Why Google employees quit" href="http://www.techcrunch.com/2009/01/18/why-google-employees-quit/">why googlers quit</a>. All is not well in the land of milk and honey. My, one might even conclude that it’s silly to expect a single employer to be the be-all, end-all workplace for every top notch techie. Really I’m just enjoying some schadenfreude, given that I suck too much to ever pass the Google hiring bar. ,-)</p> <p>Back on the topic of refactoring, I’ve had an analogy in mind for a while now, between programming and cooking. Obviously, the cooking itself is the programming, but if you’ve prepared anything remotely interesting, you know the dirty dishes, cartons, plastic wrappings and ingredients you no longer need quickly accumulate into a big mess that makes the actual cooking hard. Kind of like legacy code. So continuously cleaning up after yourself is kind of like continuously refactoring while you add features. </p> <p>I’m not saying that analogy really helps me when I’m programming – I already have a certain mindset for it. However, what I don’t like is cleaning up, and thinking about chores as tiny little refactorings in my home helps a bit. </p> <p>How geeky is that? .-)</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-4904044862351428833?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com2tag:blogger.com,1999:blog-8137988221412196692.post-78834426299435823592009-01-29T13:15:00.001+02:002009-01-29T13:15:16.946+02:00PuTTY, Vista and the annoying security warning<p>I’ve been living for months now with the annoying security warning generated when you open an executable you just downloaded, such as PuTTY.exe. From time to time I’d try to uncheck the “Always ask” checkbox only to have it return on the next run, and periodically I’d search for the anwer.</p> <p>Turns out there are two ways of getting rid of the warning. First is to use the installer version of PuTTY. But I had done that already. And true enough, it didn’t used to happen until I downloaded <a title="PuTTYtray" href="http://www.xs4all.nl/~whaa/putty/">PuTTYtray</a>, which didn’t come in the installer.</p> <p>The only way to fix things is to <a title="Robert Woodward&#39;s Website: Always ask really does mean always ask!" href="https://www.robertwoodward.com/index.php/5.html">open the file properties window while it’s in the original download location and unblock the executable</a>. How very annoying.</p> <p>Fortunately, all my browsers store the downloaded files in the same, default location, which is C:\Users\myusername\Downloads. So I moved the file there, and ta-da, the unblock button appeared in the properties window.</p> <p>&#160;</p> <p>This is one of those times I really have to say a feature of Vista sucks, big-time. I mean, security-wise it’s a good thing that verifications like this are done, but UI-wise it’s insane to hide the option if the file is moved and <em>not tell about it in any way, shape or form</em>.</p> <p>Obviously the information about the original location of the file is stored somewhere, otherwise the button couldn’t have appeared when I moved it there. Hence the UI should at the very least tell me what is wrong, and where I need to move the file to fix things. Something like this, perhaps:</p> <p><a href="http://lh6.ggpht.com/_Mp0Wg4oMQjM/SYGPwjAaNmI/AAAAAAAAACA/uITEldmuHbE/s1600-h/unblock%5B8%5D.png"><img title="UI concept: the file properties dialog with information about the problem" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="159" alt="UI concept: the file properties dialog with information about the problem" src="http://lh3.ggpht.com/_Mp0Wg4oMQjM/SYGPxAAlJxI/AAAAAAAAACE/JliIRG8-FZ8/unblock_thumb%5B9%5D.png?imgmax=800" width="380" border="0" /></a> </p> <p>The wording and placement of the message could and should be improved, but the key things are: <em>something is not right</em> – there is something about this file you need to know. This is <em>why it’s happening</em> – you shouldn’t have to guess at what’s wrong. And most importantly, <em>this is what you can do about it.</em> Armed with that information, I can make the informed decision on what, if anything, I should do about it.</p> <p>I’m sure <a title="The Old New Thing" href="http://blogs.msdn.com/oldnewthing/">Raymond Chen</a> can give me a dozen reasons why this is technically impossible, or a bad idea security-wise. Still, if the UI is going to refuse to obey me, it should let me know why and let me know how I can fix it. This is making my computer so secure I can’t use it properly either.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-7883442629943582359?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-90134291094443377222009-01-28T10:55:00.001+02:002009-01-28T10:55:31.328+02:00Software that doesn’t pull its weight<p>A moment ago, I decided I’d play around with ASP.NET MVC for a while, mostly just to try out the <a title="Spark view engine" href="http://dev.dejardin.org/">Spark view engine</a> and see if it actually is as elegant as it looks. I fired up Visual Studio, and then remembered that I should probably install the new <a title="ScottGu&#39;s Blog: ASP.NET MVC 1.0 Release Candidate Now Available" href="http://weblogs.asp.net/scottgu/archive/2009/01/27/asp-net-mvc-1-0-release-candidate-now-available.aspx">Release Candidate of ASP.NET MVC</a> too.</p> <p>I downloaded the installer, ran it, and got this:</p> <p><a href="http://lh4.ggpht.com/_Mp0Wg4oMQjM/SYAddPr7T5I/AAAAAAAAABw/6kywCfLfHQY/s1600-h/aargh%5B3%5D.png"><img title="An older version has already been installed. I could remove it for you, but instead I&#39;ll just throw an error in your face!" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="247" alt="An older version has already been installed. I could remove it for you, but instead I&#39;ll just throw an error in your face!" src="http://lh4.ggpht.com/_Mp0Wg4oMQjM/SYAddpXtVkI/AAAAAAAAAB0/DzcNfdRHCpk/aargh_thumb%5B1%5D.png?imgmax=800" width="380" border="0" /></a> </p> <p>First of all, having an earlier version installed is an error? Are you saying I shouldn’t have tried the beta?</p> <p>Second, just what exactly is preventing you from offering a button that says something to the effect of “replace with this version”, runs the uninstaller quietly and then installs? Why bother making a big deal out of this?</p> <p>Third, if that’s too much work, could you at least <em>please</em> offer me a quick way to access the uninstaller? Instead, now I have to open up Explorer, groan in exasperation, dig up control panel, go to Add/Remove Programs and remove it myself, then close the error and re-run the installer.</p> <p>And the feature isn’t even called Add/Remove Programs in the Vista default control panel view:</p> <p><a href="http://lh6.ggpht.com/_Mp0Wg4oMQjM/SYAdeV6oOeI/AAAAAAAAAB4/9uD7UYZVD9s/s1600-h/uninstall%5B3%5D.png"><img title="It says &quot;Uninstall a program&quot;, not Add/Remove Programs" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="501" alt="It says &quot;Uninstall a program&quot;, not Add/Remove Programs" src="http://lh6.ggpht.com/_Mp0Wg4oMQjM/SYAdfHFZVYI/AAAAAAAAAB8/RBqRzHA_2NM/uninstall_thumb%5B1%5D.png?imgmax=800" width="501" border="0" /></a> </p> <p>Of course, since this product is targeted at developers, the people encountering this error will probably have the good sense to locate “Uninstall a program”. But if this is a general installer feature, which I think it is, I can imagine a less computer literate user might not dare to disobey the message like that.</p> <p>I’m sure it’s easier to fail and let the user deal with it. But damn it bugs me. I haven’t even begun to evaluate the actual product, and already it has given me a bad impression. Good thing I’m still inclined to like the framework itself.</p> <p>&#160;</p> <p>Now that I think about the error a bit more, I’m pretty sure I’ve actually done the same deed – packaged an IE extension in an installer that would throw precisely the same error if it was already installed, which meant upgrading required an uninstall. Damn! Now I’m angry at <em>myself</em> too.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-9013429109444337722?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-33111903481712266552009-01-27T20:44:00.001+02:002009-01-31T16:52:15.530+02:00Time for improvement<p>Today I had a long discussion – more of a one-sided rant, really – where I tried to convince two other programmers that quality stems from the programmer, and almost every programmer has it in their power to change things for the better.</p> <p>Suppose you are given the task, of say, implementing a Frobnitzer for the next minor version of Blooperator. You open your editor and dive in to gain understanding on how to best implement the feature. Then you get that sinking feeling. The existing code was intended for a Flubbergleep instead. It was written by someone who left the company ages ago. It’s poorly documented. Worst of all, it looks like a mess. You sigh, and wish for the 307th time that the customer would agree to The Big Refactoring. </p> <p>But nobody ever pays for refactoring only. And why should they?</p> <p>Clean code is a nice thing to have, but from the customer’s standpoint, that’s not what provides the value. The customer just wants their Frobnitzer. While the existing code is ugly, with lots of tight coupling, obscure variable names and near-indecipherable methods, it works as expected. </p> <p>You are a programmer. Your job is to solve problems for the business, even if they don’t acknowledge them. </p> <p>Poor quality code is a problem. So solve it.</p> <p>It doesn’t really <em>require</em> The Big Refactoring, even though it would be the easy way to do it. When you work out what that complex algorithm with lots of one-letter variable names is actually doing, <em>clarify the variable names</em>. When you’re forced to change a method that consists of 200 lines of <a title="Coding Horror: Flattening Arrow Code" href="http://www.codinghorror.com/blog/archives/000486.html">arrowhead code</a>, <em>flatten it</em>. If you can extract a method to clarify the meaning of the code, <em>do it</em>. There are <a title="ReSharper" href="http://www.jetbrains.com/resharper/">automated tools</a> that can do it and verify that they don’t make any semantic changes to your code. Use them -- make any and every simplifying or clarifying change you judge <u>safe enough</u> to do while still shipping on schedule.</p> <p>If you can, write tests for it. So you’ve got a 100k<abbr title="Lines Of Code">LOC</abbr> project with zero tests, and seeing the first one throw a red bar is a bit disheartening. Grit your teeth, make it pass, then go for another one. In a week you’ll have a couple of dozen. In a month or so, you’ll probably surpass a hundred. And the next maintainer will thank you.</abbr></p> <p>Most likely that maintainer will be you.</p> <p>If it feels like you can’t write tests for it, <a title="(unaffiliated) Amazon.co.uk: Working Effectively with Legacy Code" href="http://www.amazon.co.uk/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/">I’ve got a book you need to read</a>. Get used to the idea of working with legacy code. You’ll be doing that most of the time anyway.</p> <p>Complaining endlessly about how you’re never explicitly given the time and resources to get things right is a cop-out. Making things better bit by bit is rarely easy, rarely rewarding and almost never appreciated by the customer. But it’s the right thing to do.</p> <p>So quit complaining, and go do your job.</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-3311190348171226655?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com0tag:blogger.com,1999:blog-8137988221412196692.post-66170551366166346462009-01-26T20:42:00.001+02:002009-01-26T20:42:59.443+02:00Beating procrastination<p>I’m a terrible procrastinator. I put off all sorts of things all the time, because I’m tired, I don’t feel like it or I just don’t have the time. However, I seem to always have enough time and energy for the things I <em>do</em> like, so I’ve come to suspect that maybe I’m trying to fool myself.</p> <p>Procrastination is a weird thing. You delay the bigger reward of having accomplished your task in favor of the small-to-the-point-of-nonexistent reward of… not doing it. It wouldn’t make any sense at all, if we weren’t hard-wired to prefer the immediate reward over the long-term reward.</p> <p>It’s also something that accumulates quickly. You should make dinner but you can’t because first you’d have to wash the dishes which would require you to empty the cupboard where the dry dishes from the last round are, and so on, and so forth. It applies to everything. First you procrastinate, and before you know it, you’re <a title="The Jargon File: yak shaving" href="http://catb.org/jargon/html/Y/yak-shaving.html">shaving yaks</a>.</p> <p>The only cure is to break the loop: find the determination to do one of those accumulated things. That may lead to a feedback loop that goes the other way: you feel accomplished, energized and ready to tackle the next task, too.</p> <p>I find that lists are useful in getting things done. Writing down the first two or three things, the things I actually have to do, and then continuing the list with the things I don’t want to do is a great tactic. Once I cross off the first items from the list, I often end up having enough momentum to tackle at least one, sometimes all of the tasks I had been avoiding.</p> <p>Unfortunately, all it takes is a little slip-up, and then you’re down that road again: I’m too busy to write a list etc…</p> <p>The periods when it does work, for me, seem to happen at times when I’m breaking other bad habits too. For instance, in the last few days I’ve cooked proper meals several times, washed the dishes as soon as there’s space for them, and even exercised on the Wii Fit. Which is something, by the way, of which I will NOT provide pictures.</p> <p>Today I’ve managed to clear my list for the most part, and I’d still have time to exercise my programming muscles for a bit. I just don’t really feel like doing it. However, there’s one last episode of <a title="IMDb: Blackpool" href="www.imdb.com/title/tt0408375/">Blackpool</a> left for me to watch…</p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-6617055136616634646?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com2tag:blogger.com,1999:blog-8137988221412196692.post-3973437946600094292009-01-24T21:02:00.001+02:002009-01-24T21:04:35.759+02:00OGG files and Windows Media Player 11<p>Ever since I bought my ThinkPad, I’ve been primarily using Vista. And although my <a title="Previous entry: &quot;Vista Impressions&quot;" href="http://blog.rytmis.net/2008/06/vista-impressions.html">initial judgment was “disappointed”</a>, I’ve grown fond of the new interface, and rarely find things that really bug me. I even like the Media Player 11 interface, enough to prefer it for playing music and videos.</p> <p>However, it doesn’t like to work with formats it doesn’t know, and the list of those formats is long. I’m particularly interested in <a title="Wikipedia: FLAC" href="http://fi.wikipedia.org/wiki/FLAC">FLAC</a> and <a title="Wikipedia: Ogg Vorbis" href="http://fi.wikipedia.org/wiki/Ogg_Vorbis">OGG</a>, because most of the music I’ve manually ripped from CD is in those formats.</p> <p>I tried to get things working previously, by installing a filter that was able to play the files, but that alone isn’t enough. If you like the WMP11 interface, you’re likely to want the files to show up there too. This is how it’s done:</p> <p>First, get a codec pack that will play OGGs. The <a title="Combined Community Codec Pack" href="http://www.cccp-project.net/">Combined Community Codec Pack</a> seems to be a fairly popular alternative. Next, get a plugin that will provide metadata support: <a title="SourceForge: WMP Tag Support Extender" href="http://wmptagext.sourceforge.net/">WMP Tag Support Extender</a>. I had it figured this far, and still had no result. Until I found a <a title="Windows Media Player 11 Guide" href="http://vip.chowo.co.uk/wp-content/uploads/jaws/Windows-Media-Player-11-Guide.html">Windows Media Player 11 Guide</a> that had the key information piece: even without the tag support, when the proper codecs are installed, WMP recognizes the OGG and FLAC files as playable media. However, it <em>does not know that they’re music files, so it indexes them as “<strong>other media</strong>” instead</em>. And once the files have been indexed, they won’t be re-added when you scan the music folder with the tag support plugin enabled. The trick is, then, to delete the “other media” and re-add it, after which it gets properly recognized as music.</p> <p>This “other media” view is almost hidden – it took me longer than usual to locate it. It lurks under the note icon in the top left corner:</p> <p>&#160;<img title="mediaplayer_views" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="324" alt="mediaplayer_views" src="http://lh6.ggpht.com/_Mp0Wg4oMQjM/SXtluRBtvHI/AAAAAAAAABs/-KjJcQcjIzc/mediaplayer_views%5B10%5D.png?imgmax=800" width="456" border="0" /> </p> <p>Although there is an alternative way to access it: select “other” in the Library menu. </p> <p>Having removed the offending entries from the index, WMP now correctly figured out that my OGG files were in fact music. Success! Now I can again enjoy my collection of Sentenced and Kamelot. </p> <div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8137988221412196692-397343794660009429?l=blog.rytmis.net'/></div>Rytmishttp://www.blogger.com/profile/12374027147684239989noreply@blogger.com1