Amazon.com Widgets November 2010

Flotsam and Jetsam #16

By Nick at November 30, 2010 03:42
Filed Under: Flotsam and Jetsam
  • New Delphi Blog of the Week: From Zero To One  The author made an interesting comment on my THMLWriter post, and has given me some ideas.  Looks like an useful set of downloads as well.
  • THTMLWriter Update:  As per the excellent suggestion by Francisco Ruiz, I’ve added a new feature for attributes, enabling you to declare attributes as an indexed property with two strings.  Great idea. 
  • Document Insight has been released and for the present, it is on sale for half price.  I have been making extensive use of Document Insight with the THTMLWriter project, and can easily say that it is one of the coolest Delphi plugins I’ve ever used.  It does exactly what I want, and it is utterly intuitive.  Very nice.  The XMLDoc feature of Delphi is cool once you really start using it, and Document Insight makes it pathetically easy to do.
  • Cool Delphi Open Source Project of the Week:  DotNet4Delphi – This is a brilliant idea, actually.  First, it utilizes generics to create a nice set of collections and lists based on the same set of .Net classes.  But the fun part is that it creates TDataset descendants than enable you to hook those lists and collections to data-aware controls for display and editing.  Very cool idea indeed.  Add this to the growing list of very excellent libraries for Delphi that are taking advantage of generics, RTTI,  and anonymous methods.
  • In Flotsam and Jetsam #14, I mentioned Cliff Stoll’s horrifically inaccurate prediction about the Internet.  Could this be the greatest single example of “Claim Chowder” in the history of the tech business?

Novell, Attachmate and Embarcadero

By Nick at November 25, 2010 12:29
Filed Under: TechBiz

As you’ve probably seen/heard, Novell has been purchased by Attachmate.  I can remember when Novell was a real high flier, right up there with Microsoft and Borland.  Of course, that was in about 1995, but hey, they were all up there during those heady days before Delphi was released.

I also remember when there were some pretty strong and perhaps well founded rumors that Borland and Novell were going to merge, or one was going to buy the other, or something.  Would have been interesting at the time, I guess. 

Anyway, Marco makes an interesting point (via Olaf Monien) – that Attachmate is owned by Thoma Bravo, the same equity firm that owns Embarcadero.  Attachmate is one of those companies where you can stare at their website for a long time and still not be clear about what they do or why you’d want them to do it for you.  (Sort of like Microfocus, who recently also acquired a formerly high flying company….) 

The Thoma Bravo guys were always pretty mysterious.  They never seemed very interested in any particular business needs that Delphi might have had after the Borland years.   They did seem interested in making money, though.  Nothing wrong with that, as that is pretty much exactly what private equity firms do.  

I can also say that being a “sister company” in the Thoma Bravo family to Novell/Attachmate probably means little to nothing for Embarcadero.  TB owns a number of software firms (did you known they own InstallShield, for example? They also own Plato Learning, a former client of mine in Minneapolis who was at the time a pretty big Delphi shop.)   But as far as I know, we never had the occasion to cross paths with any of the other “family members” when I was at Embarcadero.. TB seems to be buying up properties at a fairly furious rate, though, so perhaps that will change at some point. 

I hope so, because there are any number of things that Novell in particular is involved with that might make for some good synergies with Embarcadero, most notably the Mono project and MonoTouch for the iPhone.  It would be cool to see those two members of the “family” working more closely together. For example, one would hope it would make it easier for Embarcadero to include MonoTouch with Prism and RAD Studio. 

Anyhoo – it was an interesting point that Marco and Olaf brought up.  Something to think about and keep an eye on for sure.

Flotsam and Jetsam #15

By Nick at November 22, 2010 07:42
Filed Under: Flotsam and Jetsam
  • A lot of things bug me, but the thing that is bugging me a lot lately is a seeming proliferation of popup windows without a button that says – more or less -- “Save and make me go away”.  For instance, I use LiveWriter to write these posts, and the category drop down box doesn’t have any way to tell it “I’m finished”.  Apparently  you are supposed to just nookaybuttonknow that the way to apply your selections is to click somewhere outside the dialog.  I find this to be bad design and, well, irritating.  I like to know that when a dialog goes away, it has either definitely or definitely not saved my settings.  When clicking outside the box to make it go away, there’s no way to know for sure.  Very irritating.  What’s wrong with a good ol’ “Okay/Cancel” set of buttons? 
  • Hey, this is cool:  The mighty Joel Spolsky himself answered one of my questions on StackOverflow
  • Not surprisingly, since I added moderation to the comments here, I’ve gotten very few of the “Great post, this is exactly what I was looking for, I’m going to bookmark this site and come back later” comments.  What a shocker, eh?  Smile
  • I just discovered that there is a Reddit just for Delphi stuff.
  • If you are looking forward to 64-bit Delphi, then this StackOverflow answer from the prolific and always informative Barry Kelly is must reading.
  • Interesting Article of the Week: Implementing a Partial Serial Number Verification System in Delphi by Brandon Staggs.  Ever wonder where those four-chunked serial numbers come from and how they work?  Brandon does a pretty good job explaining it all and giving a “getting you started” implementation.  Good, interesting stuff.
  • As Allen Bauer taught me – “Shipping is a feature”.

Announcing THTMLWriter

By Nick at November 22, 2010 00:44
Filed Under: Delphi, Software Development, Tech Stuff

I have started an open source project on GoogleCode called THTMLWriter.

THTMLWriter is a Delphi-based class library that enables you to create HTML code and HTML documents. It uses the fluent interface to make creating HTML text easy and natural.  You can create HTML Documents or HTML “chunks” by  using any tag as a base.

THTMLWriter is all class based.  I started out trying to do some fancy things with interfaces, but it just got too complicated, and so I opted to go with the “simplest thing that will work” option, and now you can write code that looks like this:

 

Temp := THTMLWriter.CreateDocument;
     TempHTML := Temp
                  .OpenHead
                    .AddAttribute('dweezle')
                    .AddText('farble')
                  .CloseTag
                  .OpenBody.AddAttribute('ding')
                      .OpenSpan
                        .AddAttribute('this', 'that')
                        .AddStyle('font: italic')
                        .OpenDiv
                          .AddAttribute('floo')
                          .AddText('Blah')
                        .CloseTag
                      .CloseTag
                      .AddText('Hoorah')
                      .AddBoldText(' Shadooby')
                      .OpenBold
                        .AddText('Goombah')
                      .CloseTag
                  .CloseTag
              .AsHTML;

 

The project more or less produces XHTML code at the 4.01 level – I’ve tried to be XHTML-compatible, but I confess I haven’t been fanatical about it.  That is one of the things I want to in the future.  In addition, I want to update the project to support HTML5.  I’m still thinking about how to do that.

The project is pretty complete – you should be able to construct most HTML constructs.  I’ve provided a lot of overrides and default parameters for many of the “normal” attributes on a given tag.   I’ll continue to update the project with improvements and refinements.  I’ve used HTML & XHTML Pocket Reference from O’Reilly as my guide. I haven’t quite implemented everything, but it’s definitely at the point the that it is ready for you fine  people.

The project includes a full set of DUnit tests to give you confidence that the code actually does what it is supposed to. 

I have added a lot of XMLDoc comments to the code, but it’s far from complete. I’ve used the Documentation Insight plugin from DevJET software – the guys who do the Delphi Spring Framework.  (I can’t recommend this plugin enough – an outstanding contribution to the Delphi community, above and beyond the amazing Delphi Spring Framework.)

You can get the code from Google code using Mercurial.  We are planning on migrating our codebase here at Gateway Ticketing to Mercurial after the first of the year, and this project was my learning curve for using Mercurial.  Now that I’ve been using Mercurial – a distributed source control system – I wonder how we as developers ever managed to use anything but a DVCS.  It is that good and that powerful.  I heartily recommend looking at migrating to a DVCS.  It’s so much more flexible and more powerful than a server based solution such as Subversion

I’d be very happy to add anyone to the project who is interested in contributing.  I’ll also be happy to integrate submitted patches as well.  This have been a fun project to keep my toe in the water of coding – being a manager now means I don’t get to code as much as I want --but living alone in Pennsylvania while my amazing wife moves our house out here has given me a lot of free time to code.

Enjoy and let me know what you think.

Flotsam and Jetsam #14

By Nick at November 12, 2010 07:10
Filed Under: Flotsam and Jetsam
  • One hidden benefit of working at a ticketing company:  Unlimited book marks!
  • Video of the WeekTeacher has trouble showing a video.
  • This article by Cliff Stoll cracked me up. Written in 1995, it basically says “This whole Internet thing is a big mess and will never take off”. The article was a companion piece to his book Silicon Snake Oil: Second Thoughts on the Information Highway.  Stoll is probably most famous for writing one of the first tales of hacking and security on the Internet called The Cuckoo's Egg .  I’m sure that he’s utterly embarrassed by the article – and probably the book -- today. And if he’s not, he should be.  Winking smile
  • I posted this comment on StackOverflow: “Empty catch/except blocks aren't code smells, they are code putrids.” By the way, that whole question is worth reading.  Some good wisdom there.
  • And while we are on the topic of good questions to read, this one about people’s favorite programming quotes is pretty fun to read.  My favorite quote:  “Some people, when confronted with a problem, think ‘I know, I'll use regular expressions.
    Now they have two problems.
    ”  What is your favorite?

Setting up Hudson to compile Delphi Projects

By Nick at November 05, 2010 12:37
Filed Under: Software Development, Tech Stuff

Just like you should be using Source Control (even if you are a one man operation), you should be doing continuous integration.  We currently use CruiseControl.net, but we are giving Hudson a look here at Gateway Ticketing, and it seems likely that we’ll end up switching and using it.  So naturally, I decided to play around a bit with Hudson. We used Hudson quite extensively at Embarcadero, but I had never really given it a whirl myself.

This is the Hudson Dude whose picture shows up in the Hudson interface. 

hudsondude

He’s quite dapper, no?

Hudson is Java-based, but don’t let that scare you.  You need not know a lick of Java to use it effectively.  It is very, very easy to download, install, and get up and running.  I found this blog post helpful in that regard.  I was up an running in minutes.

Hudson has a very nice browser interface for configuration.  It also has a very large and growing collection of community of plug-ins.  Hudson also makes it really easy to install plug-ins by providing support right in the interface.  Add them isn’t much more than selecting them in a list an clicking install.

Plugins are important, because you are going to need them in order to do a Delphi build.  The first one you’ll want to install is the MSBuild plug-in.  This will allow you to choose MSBuild as a build environment.

screen

All of the popular source control systems have plug-ins. I’ve been using Mercurial on my local machine, and so I chose that plug-in as well. 

I also discovered, after a series of trial and errors that the setenv plug-in is pretty much required as well.  As you may know, to do command line builds of Delphi projects, you need to set a number of environment variables. This is usually done via the rsvars.bat file.  Well, Hudson doesn’t know about that at all, and I didn’t have much luck running it as a batch file before doing the build.  Hudson seems to isolate the environment for each individual action.  The setenv plug-in lets you set global and local environment variables for Hudson.  Since I’ll be doing a lot of Delphi builds, I selected “Manage Hudson” and took the items from rsvars.bat and set them up as Global Properties:screen1

Doing that is critical, as that sets everything up so that Hudson can find the files needed by every Delphi project to define the build targets.  There are a couple of StackOverflow questions about this very topic that recommend passing a few parameters, but I found that if you set up setenv to incorporate what rsvars.bat does, you don’t need to pass any parameters on the MSBuild command line beyond the *.dproj or *.groupproj filename. 

In addition, you need to tell Hudson about MSBuild specifically – that’s easily done in the global configuration as well. Basically you give each installation a name and the full path to the MSBuild.exe for that .net version.  You might want to set up different MSBuild installations for  the .NET 2.0 and .NET 4.0 versions, for instance.

screen3

Once all that is set up, it’s really a matter of setting pretty self-explanatory properties of Hudson.

  1. Select “New Job”. 
  2. From here, I just chose “Build a free-style software project” to do a simple build of a Delphi project group.
  3. Give your job a name and click Ok.
  4. From there, you can pretty much figure things out.   I did the following.
    1. Pointed Hudson to the Mercurial repository I wanted it to pull from, including the branch I wanted.  The settings for Subversion and other SCM systems may have different settings.
    2. I chose to poll Mercurial for changes.  The “code” for setting that up is a bit tricky, but I found pressing the help button gave a pretty good rundown and some examples.  I just set it to poll every minute.  Not a big deal on my local machine, and it makes it easier to see how things are working while testing it out. screen4
    3. The final thing to do was to actually tell Hudson what to build.  That was easy – I have a project group called

      C:\Code\HTMLWriter\HTMLWriterGroup.groupproj
      ,

      and I simply added that as the MSBuild build file after telling Hudson which version of MSBuild to use.
    screen8

And that is pretty much it. From there, you can tell Hudson to build for you on demand, or you can just leave it to run, and it will build everytime it sees a change in your source.  Again, the “tricky” part was getting and using that setenv plug-in.  That simplified everything. 

UPDATE: Christer Fahlgren has also written a very nice blog post about running Hudson on Delphi projects.

My Book

A Pithy Quote for You

"They condemn what they do not understand."    –  Cicero

Amazon Gift Cards

General Disclaimer

The views I express here are entirely my own and not necessarily those of any other rational person or organization.  However, I strongly recommend that you agree with pretty much everything I say because, well, I'm right.  Most of the time. Except when I'm not, in which case, you shouldn't agree with me.