Thursday, September 20, 2007

Delphi Contests and Code Challenges

I was reading How I became a Delphi developer on "Thoughts and other things..." a blog by Andreas Hausladen. In his blog post Andy explains that it was something he found interesting in a Delphi Handbook that hooked him on Delphi. It's really quite similar to the events that got me interested in computers and programming and it's a story you hear quite frequently. A comment to Andy by Gerald goes as far as to suggest that: "Maybe CodeGear should have those cool examples and/or books to get people interested in experimenting with programming again.." and I got to thunking. What if went just a little further. I think that it would be really cool if CodeGear [or anyone for that matter] would host a monthly coding challenge for ... well, anyone who wanted to participate.

Yea, there are a lot of sites out there that show you how to perform different/specific functions in Delphi. One of the best that I've used of his type is DelphiForFun by Gary Darby. There are tons of puzzles, tutorials, challenges and example code ... all generally aimed at teaching the principles of Delphi programming. There is one aspect to these types of sites that is missing ... feedback.

When I was just getting into Delphi I stumbled across "Delphi Programming Tic Tac Toe Contest" on About.Com:Delphi Programming hosted by Zarko Gajic. I was very excited running across this site - I had Googled "Delphi Contest" and found something even bigger. Wow, they have contests [challenges] where you submit your code, it is evaluated and your skills/code are graded against a number of peers. Unfortunately for me, on this one, I was away at sea and arrived home to submit my entry several days after the contest closed. I'm sure it would have won :)

The other misfortune was that this was the last contest of this type that they had. I did toss an entry into the "Delphi Programming Quickies Contest" which came into existence shortly after [also hosted on the site] but soon realized that, as things stand, it will probably be a while yet before I'll be submitting entries with titles like; "Adding Regular Expression Filename Filtering to ShellListView" or "Sending messages to non-windowed applications" which are in the current winners list. Some day though :)
FWIW : My entry was "How to Convert Numbers (Currency) to Words" and it was produced as the result of reading a post on one of the Delphi News-Groups. Well ... I thought it was nothing short of brilliant!  :)   Truth be known Zarko had to do a bit of editing to accommodate the international flavor of those that might be interested - the feedback was much appreciated and I learned from it.

I think CodeGear could have a lot of fun with something like this, while providing a huge service to newbies, hobbyists and even professionals that just need a bit of grey matter exercise. No 3rd party tools, no 3rd party code - just your noggin and your favorite Delphi IDE.

Back in Feb 2002 there was a Multi-Threaded Applications Contest ... brilliant idea. From the sound of it, these contests used to occur frequently. One of that particular caliber was probably a bit out of my league, but I'm not so sure that I would let that bother me too much. The contest did produce a huge resource of source code for me to read and learn from - once I get to threading. I noted that part of the article was: "Community programming contests are back!". Wonder why they died out again ... so soon after?

The existing Developer Network is already set up to allow voting on user submitted articles - which can include code. A few minor changes [stop cringing John :) ] to allow contestants to prove a few additional details about themselves [delphi skill, programming skill, beginner-hobbyist-professional ... ] and we're away. Other members of the network can download your entries, evaluate your code and give you a rating. Highest rated entries bubble to the top ... woohoo, your famous. CodeGear could even offer upgrades/software assurance [or even mouse pads, base ball caps, T-shirts ...] as prizes following some established scheme.
It's the closest thing to a mentor that I'm probably ever going to get :)

Just a passing thought ... thanks for stopping by,
Dave

Wednesday, September 19, 2007

Marco Cantù Releases the Delphi 2007 Handbook !!!

The waiting is finally over!

Marco released the long awaited Delphi 2007 Handbook on Lulu today. Needless to say I ordered my copy before letting you know :)  ... relax there are enough for every-one. Lulu is print on demand.

This release has additional benefits for me. I've had the Delphi for Win32 VCL Database Development book by the renown Dr. Bob [aka Bob Swart] sitting in my Lulu shopping basket since it was released a few weeks ago. You can have a look at all Dr. Bobs stuff on his Lulu Storefront.

If these products are as good as The Tomes of Delphi: Algorithms and Data Structures by Julian Bucknall which was my first Delphi book from Lulu, I'll soon be a happy camper indeed.

 Go buy some books !

 

Thanks for stopping by,
Dave

Sunday, September 2, 2007

An Old Friend in Shiny New Interface

Many years ago I was a Sokoban fanatic. For one reason or another I stopped using it and it never seemed to get installed on newer machines. Left, long forgotten in binary limbo, on some hard-drive that is long in the scrap heap, I haven't even thought of it in years. I probably still have it on disk somewhere but there a couple of hundred of them sitting in a desk drawer/box.

A couple of days ago I stumbled upon not one but two freeware versions of the game and both written with Delphi. Needless to say both are installed and I'm getting back up to speed enjoying what I consider to be the only computer game worthy of play.

These ones have likely been around for a while but they're new to me;
Sokoban 3.0 by Delphi Vision
and
Sokoban YASC [Yet Another Sokoban Clone] by Brian Damgaard, Denmark
These should be sufficient to keep me entertained for a while.
I think between them there is about 2,000+ levels to solve.

Thanks for stopping by,
Dave

 

BDS Wizard Gallery Categories

Didja Know ... there's an really easy way to find out what the Category string is for the Category you want to install your Wizard/Expert components in.  You can do this without spending a couple of hours thumping your head against the monitor while trying to figure out what the hieroglyphic like constants [below] in the ToolsAPI.pas actually mean.  Hang on a sec ... would you mind passing that ice pack?  The IOTARepositoryWizard80 interface requires that you add a GetGalleryCategory function to your project.  Part of the process in establishing the Galley Category can involve using the FindCategory function which takes a string as parameter. Figuring out what string to use can be a bit of a bugger.  This trick will lessen the pain somewhat.

  1. Start Delphi.  I'm using D2007, you'll have to test this yourself in other IDEs.
  2. Select ...  »File  »New  »Other to open the Wizards Dialogue.
  3. Click on any item in the "Item Categories" tree on the left.
  4. Click the "Cancel" button [optional I believe].
  5. In Windows, Select ...  »Start  »Run and type in regedit.
  6. In the registry editor work your way down to
    HKEY_CURRENT_USER\Software\Borland\BDS\5.0\Repository
    There you will find and item on the right called "LastFolder"  which holds the value of the item you clicked on in step 3.

Using this procedure I've noted the Constant-Category matches for the ones I could.
{ Gallery Categories }
sCategoryGalileoOther
'Borland.Galileo.Other' ... is the folder marked "Other Files".
sCategoryDelphiNew
'Borland.Delphi.New' ... is the folder marked "Delphi Projects".
sCategoryDelphiNewFiles
'Borland.Delphi.NewFiles'  ... is the folder under "Delphi Projects" marked "Delphi Files".
sCategoryMarkupNew
'Borland.Markup.New'  ... is the folder marked "Web Documents".
sCategoryNewUnitTest
'UnitTest.Test' ... is the folder marked "Unit Tests".
The remainder either were not on the list of constants or D2007 Pro does not have an existing folder for the constant. No matter ... now you know how to figure it out. You can create your own, but I'm not covering that here.

Hope that helps you out in some manner, thanks for stopping by,
Dave