ATOM / RSS and Comments

Posted by David Glassborow Tue, 17 Oct 2006 09:00:00 GMT

After all the effort of changing Weblogs, I’ve realised that Typo ‘out of the box’ does not support comments added to its syndication streams. I’ve hacked around in the code and managed to get something working. Rails XML helpers make this stuff pretty easy.

Weirdly there does not seem to be an agreed format for doing comments in ATOM at all, where as RSS has various different comment tags. I’ve used wfs:commentsRss and slash:comments nodes in both formats, with the comments just in Rss 2. The Feed Validator seems happy.

Anyway the following work well with my aggregator, Rss Bandit, as well as IE 7. If anyone has any problems with other aggregators, can you let me know. Thanks.

Local feeds:

Posted in ,  | Tags  | 1 comment | no trackbacks

Devco Wish List

Posted by David Glassborow Mon, 16 Oct 2006 12:26:00 GMT

This is my wishlist for Delphi when the new company running it is planning the next version. My requests are not large things (except maybe the last one), and are in order of priority.

Summary:

  • Language construct: return
  • . operators on basic types
  • Include all source code (midas, dbExpress)
  • Ruby

Return

Readable concise code is something we all try to acheive when coding. I really miss the ‘return’ statement from C, because it makes code more concise. I’m bored of writing:

if blah then
begin
  Result := -1;
  exit;
end;

I want to be able to write just

if blah then Return(-1);

Shorter, and the intention of the statement is much more obvious. I would imagine it would be fairly easy to add to Delphi as a pseudo function (like ‘continue’ and ‘break’).

Dot Opeators

I’ve been doing a fair amount of Ruby recently, as well as some C#. Having the dot operator available on all basic types is lovely, and makes code much more readable. I’d much prefer

address.length

over

length(address)

Less visual clutter, much more OO. Even if behind the scenes is just syntactic sugar to call the length procedure, that would be a huge win for the readability of Object Pascal in these Object Orientated times.

Source Code

At Concept First we currently use the following third party libraries:

  • Devexpress: Quantim Grid, Quantum Bars
  • TChart charting component
  • CoreLabs dbExpress driver for SQL Server

We will only buy a component if it comes with full source code. Why ?

  1. Fixing bugs when we find them
  2. Adding new features
  3. Tracking their changes under source control

We’ve made changes to all of the components we use, and I have all their source code under Subversion, so I can see what they have changed and see what possible impact it could have on my code.

One of the great strengths of Delphi has always been that the VCL comes with full sources. The two exceptions are the TClientDataset (midaslib.pas) and the dbExpress drivers. Its very annoying not to be able to debug into their code. I know Midas is in C++, but I have the full BDS with C++ support so that is not an issue. I use TClientDataset all over the place, and there are a few easy extensions that could make life much easier.

Ruby

As mentioned before, i’ve been playing around with Ruby and Ruby on Rails recently, and the first thing I had to do with is knock up a quick syntax highlighting editor using the SynEdit control. Having Ruby (and in an ideal world Javascript) in Delphi, with code complete, would be great, something I would be happy to pay for). Web development seems to be the way of the future, and having a nice IDE supporting Ruby could be a big win for Delphi / Devco.

Summary

I don’t know if my use of Delphi is similar to the majority of other users, but my priorities from it are:

  • Fast to develop in
  • Looks nice (generally easy thanks to DevExpress)
  • Source code so I don’t get held up by bugs
  • Reliable and fast IDE
  • Small self contained EXEs, without frameworks to install.

I use delphi for Win32 client applications. I don’t use it for web applications. I now use either Ruby on Rails ( my personal choice ) or Cold Fusion ( trusted in Enterprise environments ).

I’m not interested in:

  • Delphi.net
  • 64 Bit support
  • Mobile development (be nice if Delphi supported, but such a small % of our work I’d be happy enough to use Visual Studio).

Anyway if I could have the requested changes made by the end of next week, that would be great DevCo ;-)

Pretty Please ?

Posted in  | no comments | no trackbacks

Weblog moved to Typo

Posted by David Glassborow Sat, 14 Oct 2006 10:37:00 GMT

What

I’ve moved my blog away from Blogger.com and on to a Typo installation hosted ourselves. Typo is a weblog application that runs on top of Ruby On Rails, the latest posterchild of the open source community. I chose a rails based blog because I’ve been doing work with rails recently, I understand it, and I really like it (I’m half way through writing up an entry about why I like it).

Why

The main reason is that blogger feed does not include comments people make. I personally read most blogs in an aggregator, and without comments being included, its only one half of the conversation.

For the last year we have been working on a product for a client that uses Queuing Theory to model how servers operate under load, an area known as ‘Capacity Management’. Performance agents log ongoing behaviour on the server, and then the results are plugged into various mathmatical formulae that show how the server will work if your email doubles, your websites have 10 times as much load, etc.

Here at Concept First we have a data centre hosted server that handles email, ftp, and various client’s websites. In the spirit of ‘dog-fooding’, I’ve been running monitoring software on our hosted server, and building models of its spare capacity.

The results are: we have stupid amounts of spare capacity. The server is a 1U rack mounted server from Dell, 1G of RAM, mirrored RAID disks, a single 2Ghz processor. A fairly low spec machine these days, we bought it about 3 years ago. And basically it never does anything. I’ve never seen the CPU loads rise about 5%, same for disk utilisation. Modern hardware is so fast, that a few web requests and a bit of email are not not giving it much of a workout.

For that reason, I’m happy to run an interpreted language framework for this blog, because we really do have CPU cycles to waste, and I don’t have time to waste. Having a Rails app running on my server full time will also allow me to understand if it’s stable under Windows.

How

Style

Typo is easy to install if you’ve worked with Rails, its just a load of files in a directory. You can choose from 2 built in themes or download lots of others. I’ve taken one of the built in ones and just changed it to make use of the full screen.

I hate fixed width websites. What is the point of my lovely 1920 wide screen laptop if the site is only 500 pixels wide !! Adjusting to the display has always been a key strength of HTML. Too many people are still designing for the web as though it was a piece of paper !

However the move away from fixed width has caused a small bug to display in IE 6, when using the search box in the top right hand corner. There is flickering as the AJAX call is done. However the issue does not occur in IE 7 or Firefox so it is no doubt one of the boatload of IE 6 rendering bugs, so i’m not going to pursuit it. Life is too short.

Database

Typo supports just about every database, but I’ve just left it running on a simple SQLite database. Typo caches everything so i don’t really need the hassle of putting it in a real RDBMS. The server is already running SQL Server, MySQL and Oracle XE. Maintaining what apps use what databases, where, is a bit of a headache. A file based database is just easier to manage if you can get away with it.

Webserver

Our server is running, or has run in the past, various different websites running on lots of different technologies: ASP, Websnap, Coldfusion, Zope, Php, Perl. To manage all this, we use Apache 2 running on Windows Server 2000. Apache has been good to us. Its very flexible, well documented, secure, and scalable. It is our Internet facing webserver. It handles SSL, compression (via mod_deflate) and virtual hosting.

To connect our hosted sites up to the Apache ‘gateway’ we’ve tried various things. We’ve tried Apache modules, ISAPI, FastCGI, SCGI, mod_php.

Apache modules / ISAPI: Nice and fast, but too tightly bound. When Apache versions change a recompile is required. Restart the server and you lose server state, like current sessions. Bugs can jeapodise the server stability.

FastCGI: Works well, we have various websnap sites running over FastCGI. However the protocol is complex, binary, and the whole FastCGI protocol is not actively developed any longer.

SCGI: A simpler version of FastCGI, I’ve run a couple of Rails sites on SCGI. The protocol is easier to understand, but its another set of config to learn, and not all technologies support SCGI.

With this in mind, we now use simple HTTP proxing. Each different application runs its own webserver on an internal port number, the firewall preventing any access to the outside world. Apache then uses its mod_proxy settings to pass the request to the applications webserver, before passing it back to the web browser.

Advantages:

  • Debugging is simple. Just fire up a copy of Fiddler.
  • All applications support SSL, Apache handles it.
  • All applications support compression, Apache handles it.
  • All application logged in same format, I can use the same tools.
  • Apache can use its redirect rules to enforce my rules (e.g. admin in Typo must be secure).
  • Upgrading any individual application has no effect on the others, everything is loosly coupled.
  • Most importantly: One set of syntax for me to remember.

It all works beautifully. It’s happily proxing to Rails, to web services exposed in Indy components. It’s fast, and it ‘Just Works’, not often you get to say that in the world of computing …

Posted in  | Tags ,  | no comments | no trackbacks