Mar
19.
2007

I noted at the end of my previous post how not everything was working correctly with my shiny new Subtext installation.

Well, it took a bit of fiddling (pun intended, I used the most excellent Fiddler) with the HTTP traffic to discover that Subtext, just like some other blog engines, did not fully implement MetaWeblog API. What’s funny is that BlogJet’s author is aware of this anomaly and already has a workaround in place, just not for Subtext

But the cool thing is that Phil Haack (the one who started the Subtext development) and Dmitry Chestnykh (BlogJet author) were very responsive and both were willing to do what’s necessary to resolve this. Great support guys!

In the end, Phil filed this as a bug in Subtext, the fix for which should make it into the next Subtext release. In the meantime, only the posts already posted and later fetched, edited and posted back would lose categories, the new posts work just fine, so this is not a critical issue.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
0 Comments
Mar
18.
2007

Upgrading blog engine

Posted by: Drazen Dotlic in Categories: .NET (C#) | general.
Tags:

I kept this blog running on the .Text 0.95 for far too long. I needed to patch the thing couple of times myself and to add a thing or two (CAPTCHA) just to keep it running. Plus, it was the only ASP.NET 1.1 application on the machine so it had to go

For a long time I contemplated about switching to the Community Server. It’s a commercial product but at the same time Open Source and free as in beer. Since I like to customize my blog engine with a bit of code it is important to have source. It’s also important that the engine can import my existing .Text database.

While an importer exists for older versions of Community Server (CS) , there is another problem – I need just the blog engine, not the forum, file and picture gallery and whatnot. CS is big and complicated, I need something simpler.

I’ve had Subtext on my radar for quite some time. It stagnated a bit a after it was announced but really picked up the pace from the middle of 2006. It’s a direct descendant of the .Text codebase and can import your database in a couple of seconds. At least for me, the upgrade was flawless.

If you’re thinking about upgrading, my advice is just go for it. You’ll get actively maintained product that you can submit patches to. There are several nice skins and building a new one shouldn’t be much harder than it was for the .Text.

(Edit) Things are not as smooth as I expected. Posting from BlogJet has been slightly problematic. I’m not sure if I should stick with the .Text as the type of my blog or should I move to the MetaWeblog API. I can’t get categories for my previous nor set the category for this post. The categories are imported correctly though, including all of the old posts’ categories.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
0 Comments
Mar
15.
2007

Internet has come a long way since the end of the 20th century. Large percentage of developed world countries’ population has broadband and the Web site content producers seem to count on that.

Here’s an example: while on a short vacation in Serbia this February I was forced to connect to the Internet through a 56Kb dial-up connection. As I browsed the Internet, I ran into many interesting things that were too much for the dial-up to handle like software downloads, videos and whatnot. So I just locked the tabs in Firefox and left them for later.

One day I had to restart the browser for some reason. At the time, I had about 30 tabs open, “saved” for later. When I re-opened the browser, I had to wait 30 minutes(!) until all the pages loaded – it was about 11–14MB of content. An average page, text and graphics (no videos) was about 300KB. Not dial-up friendly!

Still, this was a bit extreme, opening 30 tabs all at once. But think about Windows updates for a moment. Between now and Windows XP Service Pack 2 (which is what most of the new machines had installed up to recently) Microsoft has issued over 60 updates. Updating the machine over the Internet is a major PITA in this case. It would be nice if someone with a fast connection could download all the updates, burn them to a CD/DVD and give to a poor soul still on a dial-up.

Microsoft does issue ISO images of the security patches, but on a monthly basis and for several OSes at once (Windows 2000, 2003 Server, XP) and for many languages. If you just want an ISO image of all the patches and an easy way to install them, I recommend Offline-Update. The link is to English version of an article describing the utility (hosted in Germany, done by a guy from the University of Kiel), the download is on the page 4.

MicrosoftBaselineSecurityAnalyzerBefore you start downloading, it would be good to check if the target machine needs the updates in the first place. At least this is easy and supported by Microsoft – all you need is Microsoft Baseline Security Analyzer. The picture to the left shows the scan results of my system. I’m on broadband, so naturally I’m always up-to-date, but if I weren’t, the missing patches would show up at the top of the result list.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
0 Comments
Mar
14.
2007

Overclocking your car

Posted by: Drazen Dotlic in Categories: general.
Tags:

Overclocking the car? Am I insane? Well, some people think I am, but that’s not the point

If you’re one of those that assemble their own computers – either because you’re control freak like me, or because you want to get the best features for your money – you know that often the best price/performance ratio is achieved through overclocking.

Usually this means raising the speed of the FSB and letting the CPU follow. This doesn’t work just like that – you need to raise the voltage to the CPU, often to memory too and sometimes even to the bus itself.

If you don’t raise the voltage all kinds of weird effects crashes will ensue. In my case, my mistake was that I did not stress test my new machine after overclocking. On top of that, I added another 2 sticks of 1GB memory modules and for some reason this wouldn’t work without raising the voltage even though the memory wasn’t overclocked.

After raising the voltage, everything worked (and still works) just fine.

And this has to do with the car how? Turns out my car’s (Peugeot 206, nice equipment but nothing too fancy) board computer was showing symptoms of craziness. It wouldn’t crash like a regular computer would, but on a cold start, it would report various (different) problems each time. If I restarted once or twice, everything was fine.

I should have noticed that this started approximately at the same time the car had slight difficulties to start when cold.

The problem was banal – the battery did not provide enough voltage to the car, including the board computer. When the battery was replaced everything was back to normal. Damn, today even the car needs to get enough voltage to work properly.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
0 Comments
Mar
12.
2007

This particular rant was caused by a post that doesn’t really go in the direction I’m about to, but is interesting read nevertheless (check out the comments!): Agile and Test-Driven: A Marriage Made In Hell?

I want to touch a topic concerning single acronym in this post: YAGNI, or You Ain’t Gonna Need It.

In general, I agree that YAGNI is a solid concept. Don’t build too much, especially if you’re going to throw it away later. Makes sense. Less work is better. Less code means less bugs and less time spent for no benefit. Leaves you more time to work on things that a customer wants now. Goodness, right?

Not always. If some of us are crazy for building code even though a customer did not request it (so we’re doing exactly the opposite of what’s recommended) there is a method in our madness. Why exactly are developers building more than necessary?

Sometimes it’s because customer’s behavior is actually not so unpredictable. Customers are not technical people (most of the time). They can’t think in abstract terms. So what they tell you and what they really mean are most often a variations of one and the same thing – a “hardcoded” version they give you, and a more flexible, a bit more generalized version they are vaguely aware of, but can’t express in abstract terms so you can translate it literally to code.

So you detect this situation. You don’t say anything, but you code more generalized version of what customer wants. A few weeks/months later, the customer realizes that his initial idea was too narrow in scope and wants something better/more complicated/more general.

Now, if you followed YAGNI, the chances are that the architecture of the app as is at that moment simply does not support that scenario. If you want to incorporate changes the customer is insisting on, you’d need to refactor large portions of your code. All your unit tests go down the drain, as you’re not testing the same thing any more. You end up writing lots of code with a risk of breaking big chunks of previously written code, plus you have to write a ton of unit tests again.

Contrast this to the “developer premonition” approach above. You have already incorporated the general idea, your tests reflect that so all you need to do now is to expose a GUI item or two and call the right method. You’re done. Besides from not jeopardizing the existing code, you look cool in the eyes of customer because you adapt to change so fast.

This is oversimplification of course, but once you observe the above scenario in the wild, if repeated enough, you’ll start adapting to it and ignore YAGNI. The real issue here, just like with YAGNI, is to know when to stop.

I think it’s precisely because of this – developer’s inability to stop themselves from generalizing too much – that YAGNI was introduced. When in doubt, YAGNI.

But it’s hard to fight the real-world experience. Use your own judgment and most of all, adapt to the customer.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
0 Comments
Mar
6.
2007

Clearly, we have finally reached the limit of the 32–bit processor architecture. 32–bit processors can address exactly 4GB of memory, in an ideal world. The problem is not that your average app will require a lot of memory, but that the total of all your applications will require more than 2–3GB. In reality, some of the address space is reserved (but not used!) for I/O, so you can’t have the full 4GB. The net result is that you can use roughly 3GB of memory on 32–bit Windows XP. If PAE (Process Address Extensions) is not enabled, you are further limited to 2GB per process (this is a Windows imposed limitation). It looks like PAE is enabled automatically on Windows XP SP2 when you have 2GB of RAM or more, at least on my machine.

Modern PC with Vista, everybody seems to agree, will work well with 2GB of RAM. If you want to run a VM or two, you should probably install 4GB (or more, if your motherboard supports it). The same limit of about 3GB usable applies to 32–bit Vista too, which leads us to the only reasonable choice: 64–bit Vista.

Several years ago when AMD built the first desktop 64–bit processor I was really excited about the transition to 64–bit. Some of the business apps I had the chance to work with even required 64–bit machine, mainly because of huge memory requirements. But the transition was slow and especially 64–bit Windows XP did not spread as fast as I expected.

What prevents new operating systems from spreading fast is the driver support. Things are even worse with 64–bit OS-es because they require separate drivers. Microsoft has even stricter requirements for 64–bit Vista: all drivers must be signed. Good thing with Vista is that Microsoft requires from driver manufacturers to certify both 32–bit and 64–bit versions of the driver to get the “Vista ready” logo. Indeed, it took a couple of months (ignore the launch date of 31st of January, Vista was done in November 2006) but there are Vista certified 64–bit drivers for all of the devices on my mainboard. Good thing is that I don’t have scanners, printers or other esoteric peripherals to worry about. If you do and you’d like to run 64–bit Vista, make sure there is a driver for your device first.

As soon as VMWare 6 goes out of beta, I’ll move my current installation of Windows XP into a VM, install 64–bit Vista and enjoy 64–bit goodness. It is amazing how technology allows scenarios previously unheard of – with the VMWare Converter, I am moving my complete setup, 32–bit Windows XP SP2 with all the drivers and apps installed, into a virtual machine that will continue working even after I wipe out the drive and install a completely new OS.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
2 Comments
Mar
2.
2007

Even TV auto-updates itself today

Posted by: Drazen Dotlic in Categories: rant.
Tags:

A few days ago I complained how some applications’ authors did not really get the auto-update concept: it has to be simple and “just work”.

Another crazy example of the auto-update done right is my new HDTV, Samsung LE32R73BD. It’s a wide screen 32 inch LCD TV I bought a month ago. It has a digital tuner (DVB-T) so I can watch over-the-air digital channels of DVD quality.

Since these channels are digital, a portion of bandwidth can be used to push some extra data like subtitles and firmware updates.

Two days ago, my wife called me to check out the question on the TV screen – would you like to update to the latest software? Single click on OK and about a second later the TV was updated and was operational again.

If the TV can update itself, so can your app. It’s a new reality, deal with it.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
0 Comments
Mar
2.
2007

Quite some time after incorporating (considering they already had a product that worked) BitTorrent Inc has finally started selling content (which was their intention from the start). The real question is: will users follow?

BitTorrent as a technology has a reputation of mainly enabling illegal file swapping. As a developer who analyzed and independently implemented the protocol I can confirm that as a file-exchange mechanism it is very efficient and scales extremely well. Most of the BitTorrent related places on the Internet that I am aware of indeed facilitate swapping of copyrighted material including movies, TV series, console and computer games and software.

Let’s compare for a moment a typical usage scenario for an end user who’d like to watch popular TV shows like “Lost”, “Prison Break” or “24”. If possible, the user would probably like to choose the quality – for HDTV owners the only acceptable choice is HDTV but for analog TV owners smaller files of lesser quality probably suffice. Nobody likes to manually check if the new episode is out, so some kind of RSS feed would be nice. Finally, if the files were not protected by a DRM or similar mechanism and if they could work on Macs and/or Linux machines (and not only Windows) that would be great, too. Awesome if the files could be transcoded and uploaded to an iPod or PSP.

If you’re just a bit Internet savvy, you can find several (illegal) places on the Internet that would offer you all of this.

BitTorrent Inc offers some of the important elements, but not all. For example, they give you the RSS feed of the vendor’s account, not yours (maybe they do, since I’m not in the USA, and the business is still USA only, can’t even check). The files are in WMV format, Windows only and protected by a DRM system. At least for TV series, the episodes are bought and not rented and can be watched on 2 machines at most – but the movies are rented and you only have a limited 24 hour window to watch them on one machine. You can not transfer any content to a portable device. At $1.99 per TV episode and for a level of quality they are offering (481MB per episode, that’s slightly better than the standard illegal rip quality) it is expensive. I won’t even comment on $4.99 per movie rental.

So, I can choose between USA only service with lowish quality DRM Windows only video with no RSS feed and $1.99 per episode or HDTV quality unprotected multi-platform video with RSS updates for free?

There’s one other non-obvious element here – motivation for sharing. BitTorrent is a P2P technology that only works if as many as possible people are uploading for as long as possible. When you download illegal content, you’re getting it for free thanks to the kindness of others so you’re motivated to give back too. Thus most of the BitTorrent clients have a minimal upload/download ratio that each of the downloads will have to achieve. At the same time, due to the way BitTorrent works, it is not efficient to share large number of files simultaneously, so it’s important to prune the download list. You need to balance these two things, uploading as much as you can without hurting your overall download speeds.

When you pay to BitTorrent there’ s no moral obligation whatsoever. You paid for the damned things and you don’t care how much you’ll upload. You will upload during the download due to the nature of the protocol, but as soon as you’re done, there’s zero incentive to keep uploading – why would you donate your upload bandwidth to BitTorrent Inc – you paid already, didn’t you? I don’t see how is BitTorrent going to manage this problem. If the point of P2P distribution is that it simplifies the distribution for content producers lowering the prices for the users, I don’t see that in practice. The content is too expensive and the model does not motivate users to share, which made the distribution model theoretically cheap in the first place.

P2P has its uses, but for selling content? I don’t think so.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
0 Comments
Mar
1.
2007

Editing XAML by hand

Posted by: Drazen Dotlic in Categories: .NET (C#).
Tags:

I am a pedal-to-the-metal kind of guy; I always want to see the guts of the technology I’m using. That’s probably why I like Charles Petzold’s WPF book – it shows you the platform from inside out, starting with code only and later moving to the (manual) XAML authoring.

Most of the people, especially designers, will never want to edit XAML by hand. This is quite similar to the way you’d author Web pages – mostly people don’t want to learn HTML. But if the editor is a leaky abstraction you might almost be better off doing everything by hand.

Ergo, we all need a decent editor that will cover most of everybody’s needs. Building a flow layout based editor is a serious task. I once built one flow based engine, quite simpler than the XAML (mine was a subset of XUL) and when the time came to build an editor, I had to resort to generating a tiny subset of markup the engine is capable of supporting. If I tried to implement a full editor I would have spent months if not years building it.

Because of this I understand completely why the authoring tools by Microsoft are not following immediately post WPF/.NET 3.0 launch date – building these tools is hard. Additionally, some of the markup I saw before that looked horribly inefficient was not the markup produced by a Microsoft tool but the result of conversion from a general vector drawing tool.

I am happy to report that some of the newest demos of Microsoft’s Blend (the app formerly known as Sparkle) look great. The tool has come a long way and is shaping up to be the tool for XAML authoring. Current version is beta 2, runs on the RTM release of .NET 3.0 and is free to use for up to 6 months.

My recommendation still stands – if you’re a developer, learn the technology first, author a few XAML files by hand, then jump to the tool. When the time comes (and it sure will) to dive into XAML, you won’t have issues with that. But don’t get stuck with manual XAML editing forever – use a power tool like Blend, it’s worth your attention.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
0 Comments