Amazon.com Widgets Nick Hodges | A man's got to know his limitations

Flotsam and Jetsam #18

By Nick at December 30, 2010 11:30
Filed Under: Flotsam and Jetsam
  • Cool Thing Done with Delphi of the Week:  Now this is the kind of thing where Delphi can really shine – connecting to hardware.  I’m sure some of you got an XBox 360 Kinect controller for Christmas, and if so, you can now write a Delphi app to use it.  Simon Stuart (aka LaKraven) continued his string of writing Delphi interfaces to interesting things (he started with TTwitter, or maybe even something before that that I don’t know about!)  by writing TKinect, a component to connect to, well, a Kinect controller.  Smile  And then the folks at the IT Security Lab made some really cool demos.  The 3D stuff is particularly cool. Definitely worth a look, just for the coolness factor. 
  • As a general rule, I find most everything Seth Godin says to be interesting, but I thought that this post was particularly interesting.  Made me thing “Grow where you are planted”. And it made me think that your job doesn’t have to be that which it is “supposed” to be.  For instance, being a waiter might seem mundane, but you can make it an opportunity to learn how to delight people, as Godin deftly points out. 
  • Great list -- 29 tech phrases you should be punched in the face for using.  And just for the record, I only type “LOL” when I actually do LOL.  Winking smile  (And while we are at it, here’s another great list.)
  • I ran across an interesting coding technique called “Spartan Programming”.  I agree with much, but not all, of the tenants.  I’m definitely in favor of limiting scope as much as possible, creating small interfaces, limiting horizontal and vertical complexity, and minimizing coupling,  But I can’t say I’m a fan of limiting the size of variable names or limiting character count in general.  In that area, I think it pays to be clear and verbose.  I do agree, though, that routines should be short and sweet.  In any event, interesting ideas.
  • Cool Delphi Code of the Week:  TKBDynamic in the kblib project on GoogleCode.  This is a small but really useful library that lets you easily write records to streams, even if the records have relatively complex structures.  Pretty cool – and it isn’t even yet taking advantage of the new RTTI.

Using Your BitTorrent Powers for Good, not Evil

By Nick at December 27, 2010 21:10
Filed Under: Tech Stuff

I’m a big fan of the BitTorrent Protocol.  It’s an amazingly simple yet clever protocol for easily and efficiently moving bits around on the internet.  By grabbing small chunks of a given file from multiple peer computers anywhere in the world, it can quickly and efficiently move files from one place to another. 

Sadly, BitTorrent has a bad reputation, as it is commonly used to move pirated software, music, movies, and TV shows around in violation of any number of copyright laws.  But the fact that it is used for nefarious purposes doesn’t make BitTorrent itself evil or illegal, anymore than cars are illegal for being used as bank robbery getaway vehicles.  It’s a shame that many companies and other organizations feel that they can’t avail themselves of BitTorrent because of its bad reputation.

In fact, there are plenty of legitimate uses for BitTorrent.  Many companies do use it to distribute their software.  For instance, Ubuntu provides torrents for their Linux distributions.  It’s a nice way to make large files available to customers fast and free – there’s no bandwidth limit or any fee associated with BitTorrent.  But be advised of one thing – once a torrent is out in the wild, there is no getting it back. It is totally roaming free out on the Interwebs.

Below is a screenshot of my µTorrent client, showing the torrents that I’m serving up from a server at my house.  Those Ubuntu files are quite popular, and because there are so many “seeders” (that is, other people making the file available for downloading), I was able  to download many of those files at rates over 2MB per second meaning I was downloading 650MB files in a matter of minutes.

Torrent

In addition to the Ubuntu files, I also went to ClearBits.net and downloaded a number of legal, free-and-clear torrents. I leave my client running 24 hours a day, and gladly give up some of my upstream bandwidth to support the good folks at Ubuntu and the furthering of the distribution of fine literature via completely legal torrents.  I like to think of it as a small contribution back to the community and doing my part to contribute to the legal side of BitTorrent.

So if you haven’t checked out BitTorrent, give it a look.  There are plenty of legitimate uses for it out there, and there’s no reason you can’t be using it  to distribute your software -- and maybe even providing a bit of bandwidth to the world. 

This Wild Year of 2010

By Nick at December 26, 2010 13:28
Filed Under: General, Personal

This year of 2010 ended up pretty dang good, considering I got fired from my job about half way through it.   For that, I am very thankful.  I’m really quite happy in my new job, my new house, and  my new state.  Things are going well all around. This wasn’t something I fully expected, and so it is an especially nice place to find myself.

In addition, many of you sent words of encouragement and support throughout the year, and for that I’m grateful. 

So all in all, 2010 was a pretty good year. Here’s hoping that 2011 is an even better year for all of us.

Flotsam and Jetsam #17

By Nick at December 15, 2010 17:24
Filed Under: Flotsam and Jetsam, Delphi

Listening

By Nick at December 12, 2010 14:23
Filed Under: Leadership

Imagine this (it shouldn’t be all that hard):  You are a widget manufacturer.  You’ve been tasked to figure out how to make 1000 widgets.  You’ve been planning for weeks.  You’ve gathered data, run the numbers, made estimates, and come up with a plan you believe in. You’ve left a little wiggle room for inevitable unknown obstacles.  You’ve put it all into MS Project and up on the screen in Powerpoint slides.  You are an experienced team – you’ve done this all before many times --  and the guys doing the work are battle-hardened  veterans who know their business.  Everything looks good.

Now it’s time to present your plan to the executive team. You lay everything out in a Powerpoint presentation that you’ve reviewed seventeen times.  But when they hear the plan, they say:  “Sorry, but that’s all wrong.  You say you can make 1000 widgets in fourteen months.  We say it only takes eight months to make that many widgets.  Get to work”.

Terrific.

Now you and your team know how long it will take to make 1000 widgets – 14 months.  But somehow your “leadership” has decided that it only takes much less time than that.  Never mind that these guys have only been with the company for a year or so, and have no real experience with the difficulties and the process of building 1000 widgets.  They are the bosses and their style of “leadership” seems to be to assert their all-knowing authority over the guys who actually know what is going on.  It seems to them that “leadership” means being a hard-ass and “pushing” the team to get more out of them than is possible.  Bottom line:  They didn’t listen and they didn’t trust you.  Why did they ask you to do all that planning when they were just going to tell you the schedule anyway?

We all know what happens next: after about seven months, it becomes hopelessly, overwhelmingly, manifestly clear that there is not going be 1000 widgets on the loading dock in a month.  Now everyone is scrambling to adjust course.  This, naturally, is a vastly worse situation than if they had merely planned on the 1000 widgets being available in 14 months from the start. Or agreed to make the number 500 in seven months instead.

True leaders listen to their people and believe them.  Good people tell you the truth they know they will be trusted.  The last thing you want to do is create a situation where your folks start “gaming” you and telling you what they think you want to hear.  This is a direct result of not trusting them.

If you are a leader and you don’t believe what you are being told, then it is overwhelmingly likely that you are the one with the problem.  You either need to radically change what you are doing or get new people – and again, it is very, very likely that you are the one that needs to change, not your people.  And if you have the wrong people, that is probably your fault, too.

The people in the trenches are the ones closest to the issue, and they know best what is happening “on the ground”.  Believe them, and you can adjust your plans and needs accordingly from the start.  Don’t believe them, and your plans will get adjusted anyway.  You can’t  make a baby with three women in three months, and if your plan requires that you do that, your plan is in trouble no matter how much of a hard-ass you are.  And the team knows that you can’t get a baby in three months, and they will be the ones who suffer for a bad plan.  They learn not to trust you and their morale goes into the tank.

Building and maintaining trust in both directions is a critical requirement for a good leader.  Trusting your people will engender their trust in you. It’s a virtuous circle.  Sometimes you even need to trust them even when they are wrong to help build future trust and to show that you believe in them.  If they trust you, they’ll follow you. Their morale will be up.  They’ll do the extra work and they’ll put in the effort because they want to.  People who are trusted and believed do that as a matter of course.

And isn’t that what we want our folks to do?

Be a Rockstar!

By Nick at December 09, 2010 13:56
Filed Under: General, Delphi

I am hoping that this will get people to stop teasing me about TSmiley sort of in the same way that hitting yourself in the head with a hammer makes you forget that it hurts when you hit your hand with a hammer.

Strange Poster

By Nick at December 08, 2010 16:51
Filed Under: General, Delphi

Someone posted this in our developer lounge this week:

IMAG0035

Flotsam and Jetsam #16

By Nick at November 30, 2010 12: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 21: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 16: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 09: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 16: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 21: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.

Flotsam and Jetsam #13

By Nick at October 29, 2010 14:53
Filed Under: Flotsam and Jetsam
  • Okay, as you’ve might have noticed, I’ve had to turn on moderation for comments until I can figure out how to keep spammers from posting to the comments.  They usually post some comment with a link that they want to be more popular on Google.    Most of them are banal – “Thanks for this great post!  This was exactly what I was looking for!” – but some are funny – “STOP DELETING OUR LINKS!!!”.  That’s what they want, of course, a link to a particular site to try to sway Google into ranking that link higher.  The spam filter catches a lot, but not all, and I am just having to spend too much time deleting these comments.  It’s irritating.  Suggestions gladly accepted.
  • One of the divisions I manage here at Gateway is the folks that do documentation, training, and marketing support.  Basically, if it needs to be written or otherwise communicated outside the company, this team does it.  The team name is “Product Communications”, which I think is a cool name for them.
  • I think I posted this link on my Embarcadero blog, but it is such a good presentation that I want to post it again: Drive: The surprising truth about what motivates us.  Sometimes something you want, read or hear really resonates, and this video really resonates with me.  The notion that people really want the ability to direct themselves,  to master something, and to find purpose in what they do is a profound truth.  I think if companies were to really ingrain this into their culture, you’d see a lot more people doing a lot more amazing things.
  • By the way, you can see more of the excellent whiteboard presentations at the RSAnimate channel on YouTube.  That is a really cool and effective way to listen to/watch a presentation.  For instance, here’s a fascinating presentation called “Changing Education Paradigms” that uses the whiteboard animation technique.
  • “Item Worth Reading” of the Week:  How We Got Rid of Time Reports

Flotsam and Jetsam #12

By Nick at October 25, 2010 18:25
Filed Under: Flotsam and Jetsam, Personal
  • Here’s a great article about roadmaps and how they generally, well, suck.  Smile My favorite quote: “You can’t predict which unexpected events will occur, but you can predict that some unexpected events will occur. Therefore, a rational person builds adequate buffer room into a schedule to accommodate unexpected events.”  That is sound advice for anyone involved in software development.  This is actually one of the best articles I’ve read in the software development field in quite a while. (You can Digg the article if you like.)
  • There is now a chat room for us Delphi people over at StackOverflow.  Seems like a nice centralized place for Delphi developers to hang out.
  • One of the common complaints about the Delphi Market is that there are not many new guys or young guys coming in to the market.  There are a number of reasons for this, and among them is the fact that many young people consider NNTP-based newsgroups to be archaic and old, and when they see that is how most online Delphi discussions get done, they think the same of Delphi.  And I think it is interesting that the same people asking for new, younger customers seem to me to be the same ones that would go into meltdown if the NNTP news server went away.  Winking smile
  • Off-Topic Comment of the Week:  My Economics professor from the Navy Postgraduate School, Dr. David Henderson,  pointed to this amazing collection of interviews by actor/singer Will Smith. I confess I had no idea that Mr. Smith wasn’t just another Hollywood knucklehead, but is instead a rather remarkable man of substance and depth. I’m actually quite stunned and moved by what he had to say.  I loved the story about the brick wall in particular.    I feel bad for my misconception, and am happy to say that I am now a great admirer. And he can even do the Rubik’s Cube in less than a minute.

My Book

A Pithy Quote for You

"Golf is a game of luck. The more I practice, the luckier I get."    –  Ben Hogan

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.

Month List