Thursday, August 31, 2006

Metastorm e-Work 7 and DEP

I've already written about Metastorm e-Work 7, so I was quite excited when I got hold of the CD and immediately started to install it on a test machine. That is until I read the Installation Guide which said "Before attempting to install Metastorm BPM ensure the Data Execution Prevention (DEP) feature is disabled.". Er, excuse me? I read on and was dumbfounded to see that I had to turn off DEP for the whole machine before I could install version 7. I ignored the advice and tried to install anyway but the Installation guide was telling the truth. I couldn't install because DEP was enabled.

What is DEP and why should you worry? Applications on your computer have a code section and a data section. Executable code is contained within the code section and any other data required by the application is within the data section. Most applications will only ever execute code from the code section but until recently nothing stopped you from writing an application that ran code from the data section. This could be potentially useful if you need to write self-modifying code, but there is a very small minority of applications that would ever need to do this. In fact the overwhelming number of applications that do execute code in the data section are viruses, trojans and other malware. So Microsoft have recently introduced DEP that will stop applications executing code in the data section. There are two flavours of DEP, software and hardware. The hardware version only runs on the most recent processors but other than that I'm not sure of the differences. But one thing is for sure, DEP is a good thing! It is just one line of protection for your PC but an important one. Disabling it is asking for trouble.

So why does e-Work 7 require me to disable DEP? To be blunt, the software has a bug. Clearly Metastorm thought disabling DEP was an easier option than fixing the bug. What I do find odd is the fact that it is possible to disable DEP on a per-application basis, so I don't understand why they didn't go down this route. I would certainly consider installing the software if this was how it was set up. As it is, e-Work 7 will be remaining on my shelf. If I was Metastorm I'd be somewhat concerned about the possibilities of a lawsuit caused by a server being compromised due to DEP being disabled...

Wednesday, August 30, 2006

Delphi the best tool for .NET? Er, no

Nick Hodges is doing a fine job of evangelizing Delphi which makes me think Delphi may have some kind of future but in his latest post, he suggests that Delphi is the best choice for .NET development. Delphi is certainly still a great choice for native Win32 application development but it just can't compete in the .NET world. There still isn't a version that supports .NET 2 so Delphi developers don't get to play with all the new features. Delphi is always likely to be playing catch-up in this respect. Also, almost all .NET code examples on the web are in C# or VB.NET which would make life more difficult for anyone developing in Delphi for .NET.

There are situations where using Delphi in a .NET environment makes sense. If you have a large Delphi code base that you want to get to .NET, rewriting in C# or VB.NET isn't likely to be the most cost-effective solution. If for some reason you need to target Win32 and .NET, Delphi would also be a good solution, in fact probably the only solution.

Finally, looking round at new applications coming out, we are now starting to see .NET managed desktop apps appearing. How many of them are written in Delphi? I don't know of one. In the world of ASP.NET I guess it's harder to know what language is being used for the development but I'd guess the vast majority of them are in C# or VB.NET. Compare this to the world of Win32 development where there are quite a few high quality apps being actively developed in Delphi and it's clear that .NET developers also don't think Delphi is the best tool for the job. 

Sunday, August 27, 2006

Getting into MySql with PHP

Our host for the Random Pub Finder has been providing MySql integration for a while. I've been holding off using it for a while because I was thinking of converting the RPF to ASP.NET. But I eventually decided that was going to be too much like hard work and would break any links in. OK, I could probably do some URL rewriting to get round that but again it seemed like a lot of bother and PHP does pretty much everything we need.

Anyway, I signed up for the MySql integration and I've been pleasantly surprised with how good the phpMyAdmin web interface is. RPF has been running off several text files for the last five years so I had to make quite a few changes to our code but getting the data in to MySql was pretty straightforward (phpMyAdmin will suck in any kind of delimited text file). Setting up phpMyAdmin on my local machine was pretty straightforward. OK, it's not MS easy, but then this is a free bit of software developed by people in their spare time. So I had to tweak a few text config files to get it working and I couldn't get it to play with PHP 5 but PHP 4 is fine for our needs. And now it's working I'm presuming I won't need to touch it again.

Updating the RPF live site is now much simpler, I just insert a new row in a table and a new pub appears on the site. Previously I had to update one of our text files and email it to myself, run to my other half's laptop, download the email and FTP it to our host via a phone modem, because they won't let me connect to the FTP site via our broadband connection. I guess that's because their business model is based on getting revenue from phone calls... 

So, in conclusion, a thumbs up for PHP, MySql and phpMyAdmin. Perhaps I'll stop being an MS fanboy and become a open-source zealot. Time to grow a beard...

Programmable Web

Just found this site, which looks like a useful resource for knocking together Web 2.0 (God I hate that term) mashups (God I hate that term)

Thursday, August 24, 2006

What is the point of Second Life?

Apparently it's very popular with the young uns but I'm failing to understand why. I've been wandering around for a while and there just doesn't seem a great deal to do, except check out some butt ugly buildings. If I want to live in a fantasy world I want to be able to do some fantastic things, like wield big guns and blow up things, not just socialise...

Worst of all, I seem to have to download a new version every time I log in. 

Wednesday, August 23, 2006

Google Maps and the Random Pub Finder

OK, I got bored waiting for a response to my queries about ripping off people's code so the Random Pub Finder London Map has gone live. Trying not to be too big headed, I think it's superb. None of it would have been possible without phpcoord and overplot. If programming is an art form then the old adage 'good artists borrow, but great artists steal' must be true...

Solving the Google Maps performance problem

Google Maps has a nice API to create your own map interfaces on a website. Unfortunately it has some serious performances problems when you add a large number of markers. In my case, I have about 500 markers and both IE and Firefox grind to a halt on my page. I've seen various suggested solutions, the most common being to reduce the number of markers by only showing one marker when there are several clustered together when zoomed out. I'm sure that would work but I wasn't too keen on the idea because it just sounded like too much work. Fortunately somebody has come up with a nice solution that works well for me. thanks to the wonderful open source nature of the web, I can happily rip off his code. Just need to get approval from him before I show off my new page to the world...

Sunday, August 20, 2006

Pompous rock star is hypocrite shocker

This is old news but apparently Chris Martin, lead singer of Coldplay and a man known for mouthing off incessantly about environmental issues, owns a BMW X5. This Chelsea Tractor will be doing approximately 15mpg as he drives near his central London home. Nice one!

Thursday, August 17, 2006

More Windows Live Writer

A comment to my previous post from Spike Washburn (of the Windows Live Writer team no less!) suggests image uploading won't be supported until Blogger improve their API, which is a shame. So Blogger, get your finger out! And apologies if it appeared that I was suggesting Windows Live Writer deliberately wasn't supporting image uploads to Blogger.

A couple of other points about Writer. First, I'm very pleased to see it is a managed application. Great to see MS dogfooding the .NET Framework and proving it's possible to produce professional apps using WinForms. 

Second, it's great to see developers from MS responding to blog posts from little old me. Fact is I'm a Z-list blogger that no-one reads but I've had two lots of feedback from MS people. That kind of communication will really help build a good feeling towards MS in the IT community.

And yes, I'm using Writer to write this post.

Windows Live Writer

Just playing around with Windows Live Writer and it's mostly pretty cool. The first problem I've encountered is the lack of image support on Blogger, which is pretty much a showstopper. Odd really, because Blogger does support images, but I guess this is a beta...

More fun with <noscript> tags

The guys at BetterDeal wanted to know why their website didn't rank as highly as some of their competitors. Short answer is inbound links, which seems to be the prime ranking decider used by Google. To illustrate I did a link:www<dot>carbroker<dot>com<dot>au search (replace the <dot> with ., don't want them getting anymore inbound links), which is one of their competitors. The odd thing was that one of their inbound links came from a penis enlargement site. Penis enlargement doesn't have a lot to do with new cars, other than the obvious psychological enlargement for men who buy big red Ferraris. Looking at the source of the penis site (purely for research of course) showed up the reason. The link was hidden away in a <noscript> tag. Car Broker are also the guys who have <noscript>betterdeal</noscript> hidden away in one of their pages slagging off reverse auctions, which is why they rank pretty highly for a search on "BetterDeal reverse auction". Although Google know about this, they haven't done anything about it and their algorithm still doesn't seem to handle <noscript> tags too well...

Tuesday, August 08, 2006

Borland goes Turbo

So Borland have revived their Turbo range of products. The originals came out before I did any real programming (the ZX Spectrum probably doesn't count) so I don't how revolutionary they were at the time. But the question remains whether this will help revive Borland/DevCo's fortunes. Microsoft moved the goalposts when it released its Visual Studio Express range for free, and Borland had no choice but to respond by releasing free versions of its own development tools. But free and academic versions don't bring in a lot of revenue and although they may drag people in Borland's direction who may start to pay for products later, that's likely to be a long term effect. For Microsoft, development tools are a loss leader, they don't care if they make money so long as they keep people using Windows. For Borland/DevCo it's essential these products make money or else they're out of business. On another note, although the Delphi community seem to be very excited about these new developments, will the rest of the world care? The people who Borland seem to be aiming for, i.e. new developers, probably don't have a clue what the Turbo range was and because of that the new website probably doesn't look retro and nostalgic, it just looks naff. Saying all that, I am pleased to see Borland/DevCo making some positive moves to sell their development tools, it certainly makes a change from the last few years.

Monday, August 07, 2006

Land Rover's misplaced marketing

Today I received a letter from Land Rover, offering me the chance the test drive their latest model. Whilst I'm sure it would be fun, there's no way I'd ever think about buying a new Land Rover so why are they sending it to me? I'm not sure where they got my address from but I think they need to do some better filtering of their mailing lists. First, I can't afford a new Land Rover. Second, I live in the middle of the largest city in the UK, why on earth would I want to buy a car that has 'authentic off-road ability'? Third, I'm concerned about this environment thing. Why would I want to buy a car with a 4.2 litre engine that does approximately 13 miles to the gallon with CO2 emissions of 374g/km??? It's nice to see their letter was printed on paper from sustainable forests, but perhaps they need to sort out their massive gas guzzling machines as well? To be fair, the original Land Rover is a design classic and before I realised the environmental damage owning one would do, it was near the top of my list of cars to own. Any way, the real reason for this post is to point out there is a way to stop receiving all this junk mail. MPS Online claim that they will stop unsolicited mail coming to your door. I only signed up a week or so ago so it hasn't stopped yet but fingers crossed it will do soon.

Sunday, August 06, 2006

Richmond Park

Truth be told I don't much like London. When hearing this, people will often trot out the usual Samuel Johnson line, but the fact is Johnson lived in an entirely different London to the one I live in now. But one of the great parts of London has to be Richmond Park (although some people will claim this isn't really part of London, because it's in zone 5). When cycling around its huge area, I can almost forget that I'm anywhere near the busy, unfriendly city I know.

Thursday, August 03, 2006

Lots of new posts

Just copied across the interesting posts from my old blog, enjoy!

DesignerSerializationVisibility attribute

When writing .NET components, often you don't want properties to appear in the Property Window. This is well documented and is achieved with the following [Browsable(false)] But what you also generally want to happen is for the property not to get persisted to the form in the InitializeComponent method. Unfortunately the Browsable attribute doesn't do this part of the job, but thanks to one of my colleagues, this is how you achieve that. [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] Perhaps there are occasions where these would be used separately but I can't think when they'd be

Use the tool, tool part 8

OK I lied, the last post wasn't my last post on .NET tools, there's one more. NAnt is a handy tool for automating builds. Although it's possible to drive Visual Studio.NET from the command-line, NAnt does lots of other things, like running your unit tests and zipping up files etc etc via an XML configuration file. I haven't used it a great deal myself, but I will be shortly.

Use the tool, tool part 7

Right I have one more .NET tool to recommend and then I'm done. And that is FxCop. This will analyse your assemblies and tell you all the problems it finds. And my word, does it find a lot of things. The fact is a lot of the rules are just plain anal, but it still finds stuff that could be a problem. And whats more, you can add your own rules, although I can't say I've ever done this.

Use the tool, tool part 6

Documentation is a right pain the behind, or at least it used to be. C# simplifies it a great deal by providing in-built support for it. XML tags can be added to your source code as you go along, so that 2 week task at the end of the project can be avoided. So once you've tagged all your code, what next? Download NDoc and you can generate help files just like the ones in Visual Studio. If it hadn't been for this tool, I'd probably never have got round to releasing a little project of my own into the wild. Another useful tool for generating documentation is GhostDoc, which automatically generates a first attempt at the documentation based on parameter names and method names. It doesn't always get it right, but it's often good enough.

Use the tool, tool part 5

I haven't covered the most useful .NET tool yet, the wonderful Reflector. If you haven't got this yet, download it now. One of the great things about Delphi development was the fact that Borland provides the source to the whole component library, which really helps tracking down weird bugs and work out how their stuff works. Microsoft don't provide the source to the .NET Framework, but with Reflector it doesn't matter. It can reverse-engineer any .NET assembly and you can see how it works. Yes, some class library developers obfuscate their libraries, but Microsoft don't and that's the most important library. Reflector also has several add-ins that do useful things like reverse-engineering a whole assembly which is useful for, er, more nefarious deeds. There are also plug-ins to generate Delphi code and other languages. So, as I said before, if you haven't got it, get it NOW!

Use the tool, tool part 4

If you've written some unit tests, the next thing to find out is how much of your code is covered, since you want to get as close to 100% as possible. This is where AQTime comes in. This profiler does all kinds of profiling but the coverage profiler is what you'll want to use here. AQTime may cost quite a bit of cash but it's worth every penny. Another use of AQTime is to track down performance problems. If I have a performance issue in some code, the first thing I do is turn to AQTime. Some people will think about what is causing their performance problems, but frankly what's the point? The theories they come up with are invariably wrong, because more often than not, the actual problem is caused by some poorly implemented algorithm, that manual analysis completely missed. Performance analysis should always be undertaken with the help of a profiler, since not only will it tell you the cause of the problem, but will also tell you exactly how much time you'll save by fixing it.

Use the tool, tool part 3

According to 'Working effectively with legacy code', any code without unit tests can be considered legacy code. That means pretty much every piece of software I've ever worked on is legacy code. Before .NET, writing unit tests was hard. In my Delphi days I tried to use DUnit but the language didn't lend itself to writing a tool that was simple to use. In .NET, attributes and reflection make it much easier. So we have NUnit, which has been the tipping point for me writing unit tests. As well as testing functionality, unit testing also helps validate the design of a system. If it's hard to write tests for your classes, chances are the design isn't too great. It suggests too much coupling and cohesion between the classes. Unit tests are always mentioned in the context of agile development, but there is no reason why they can't be used without adopting the whole philosophy. I have my doubts about some of the agile approach but I still believe unit tests are worthwhile. In the short term, they certainly add time to the development process, but I believe in the long run they save time and improve code quality. Of course management are often more interested in the short term (understandably since in the short term bills have to be paid), so unit tests may be a hard sell.

Use the tool, tool part 2

OK, before I get onto .NET tools, a bit of a diversion first into the realm of web based tools and HTTP. Fiddler is a great tool to see the traffic between IE and any web servers it's talking to. I've used it to track down performance problems and to see what cookies applications are using so I can hack them (meaning interact with them in a non-supported manner rather than steal credit card details...) If you're interested in HTTP calls that are made through some other app than IE, then TcpTrace is the tool for you. It's a little bit harder to set up than Fiddler (but not exactly difficult) and the UI isn't quite as polished but it gets the job done. It also supports any protocol, not just HTTP.

Use the tool, tool part 1

OK, the title is pinched from an article by Malcolm Groves, but I like it. After a week of having to work on an XLA written in the worst development language of all time, VBA, I suddenly realised the importance of using the right tools. You can be the best programmer in the world, but if you're using crap tools, your solution will still be crap. So here is the first in an occasional series of articles highlighting what I reckon are the best development tools. I spend most of my time doing .NET development, so I'm going to concentrate on that side of things. The first and probably most important tool is your IDE. And the clear choice is VS.NET 2003. OK, it falls over occasionally but I've very rarely lost any work. The choice is also easy just by a process of elimination. VS.NET 2002 was essentially a 1.0 product, so best avoided. VS.NET 2005 is a beta, so best avoided. And is just me, or is it one of the most butt ugly pieces of software ever? Delphi 2005 is, by all accounts, flaky as hell. Note, I still think Delphi is the best development language for Win32 client-side development, but for .NET forget it. SharpDevelop has one thing going for it, it's free, but other than that, it's pretty poor. So, almost by default VS.NET 2003 wins. Next time, more .NET tools

Wednesday, August 02, 2006

BPM software comparison

Over the coming days/weeks/months (depending on when I get bored) I'm going to take a look at some Business Process Management (BPM) software and see if it's any good. What is BPM software? Good question. I'm in no position to give a definitive answer to that and I'm sure a BPM expert would give a different answer but to me it's all about automating all the boring repetitive crap associated with any business so workers can get on with more interesting stuff. Or alternatively workers discover they aren't needed anymore and get shown the door... The BPM market is growing and there are heaps of vendors out there producing software so I'm only going to look at products that meet one criteria, they have to provide a downloadable demo version of their software I can play with. If a company doesn't have the confidence to provide a demo then I am deeply skeptical of their software. So the vendors I'll be looking at will be (in no particular order) Savvion, Fuego, Metastorm, Tibco, Fujitsu and Microsoft. I may cover some more if I find they have demo versions I can download. Keep reading!