Nick just posted an updated Delphi Road Map. Check it out. This looks to be one of the most significant Delphi releases in a long time. This road map is just covers native code, not .NET - that will be in a future road map I guess. Anonymous Methods, Generics and Unicode stand to be huge langauge and framework improvements.
I must say, Delphi Live Templates and the Scripting Engines are REALLY amazing. I wanted to make a new scripting engine, but then I got to thinking that my scripting engines had a lot of similar code, so I figured I would make a Live Template to create Scripting Engines. I based it on Nick’s BaseScriptingEngine from his article on Creating a Live Templates Scripting Engine.
I then created a Template Project for the Scripting Engine Package. So I can pop out a scripting engine now faster then you can say “Delphi Rocks”.
I thought I would share my Scripting Engine Unit Template. You will probably want to make your own Scripting Engine Package Template Project, but if there is enough interest I will share mine out. You will most likely want to modify this template to suite your own framework.
Note: This references my general scripting engine to create a new GUID. You will need to do that manually until I dress up my general scripting engine for public consumption.
Ever wonder what class to write next in Delphi? Well, combine Delphi Live Templates (including a custom scripting engine) with www.ClassNamer.com and you never have to wonder again.
Although how to implement that class is another question.
If there is any interest in the code let me know and I will polish it up and post it. I created a random HTTP parser script engine and then the live template does the rest. I figured this would be a fun way to get familiar with Live Templates and the custom scripting engine. This is a really powerful feature of Delphi.
Joel once again has an interesting article about Marian Headphones. To sum up, IE8 defaults to standards compliant which breaks most of the existing web sites that worked around earlier version’s of IE’s poor standards compliance. Idealists believe that is great! Pragmatists believe that breaking most of the web is a bad idea.
Here is Joel’s prediction:
The IE8 team going to tell everyone that IE8 will use web standards by default, and run a nice long beta during which they beg people to test their pages with IE8 and get them to work. And when they get closer to shipping, and only 32% of the web pages in the world render properly, they’ll say, “look guys, we’re really sorry, we really wanted IE8 standards mode to be the default, but we can’t ship a browser that doesn’t work,” and they’ll revert to the pragmatic decision. Or maybe they won’t, because the pragmatists at Microsoft have been out of power for a long time. In which case, IE is going to lose a lot of market share, which would please the idealists to no end, and probably won’t decrease Dean Hachamovitch’s big year-end bonus by one cent.
What camp are you in? Pragmatist or Idealist?
I don’t think it is completely cut and dry. I am a practical idealist personally - when possible we should do what we can to move toward the ideal standards, but continue to make existing stuff work as much as possible. Maybe with a warning that something is non-standards compliant. I am a big fan of flagging things deprecated when developing libraries. Leave the old methods in place, but let the users know that they will be going away. If possible provide tools and tips to aid in migration.
The point Joel makes that a lot of pages can’t be updated for various reasons is a valid one. Same is true of deprecating and eventually removing methods in a development library. Developers may skip a few updates, or might not have access to all the source code to make the changes required. This is especially a big deal for run time libraries that existing compiled code depends on.
Delphi has typically been really good about marking things as Deprecated and giving users plenty of warning that things might change. Indy on the other hand is pretty bad about breaking things between releases, and not providing a very clear path to making your code work with the new version. Microsoft is usually really good at supporting their users (Office) but not so hot with their developers and leaving code written in earlier IDE’s unable to compile in the new version.
I agree that is good for IE to continue to become more standards compliant, and they are in a mess of their own making, but I do believe that Joel’s point is that a lot of the standards were incomplete or didn’t cover things that were needed. Like the now deprecated <blink> tag was not in the standard, and it was only the fact that Netscape supported it as a result of user demand that caused it to be added. Netscape, Mozilla and Opera still support it, although Internet Explorer has dropped support for it.
I don’t think it is in IE’s best interest to release a browser that appears to all those browser detection scripts as IE and causes the page to render funky for IE when it is no longer necessary. This results in messed up pages. Maybe they need to change the IE user agent based on what mode IE is running in so that if it is running in standards mode then pages don’t assume it is non-standard. . . . Opera does that, which is pretty effective.
If you want to program with Microsoft’s Background Intelligent Transfer Service (BITS) then you will need the TLB or header files. These can be generated from the IDL files that come with the Windows XP SP2 Platform SDK, or any of the subsequent platform SDKs, the latest being Windows SDK for Windows Server 2008 and .NET Framework 3.5. You will need MIDL to generate the needed files. It is rather a pain to download that whole SDK and then generate the useful files.To make your life easier I have generated the useful files, and also ran them through Delphi RAD Studio 2007 for Win32 to create Object Pascal wrappers for your Delphi programming pleasure. Then I wrapped it all up in a zip for easy downloading. Much quicker to download.
As a note, you do not need to deploy any of these files, or the files in the SDK with your application. You just need to ensure that the Background Transfer Service is running on the target machine.
For more information, I have created a hub page on Advanced Downloads with Delphi that I will update with more information as I gather it.
Back in November I hosted the Delphi Robot Rage competition as part of CodeRage. At the time I was unable to contact the author of D-Robots (the program we used). I am not sure if that was a result of outdated contact information or just poor luck (i.e. spam blockers). Well, I received an email from Marcus Oblak AKA “mrqzzz mrqzzz” and the author of D-Robots. Turns out I misspelled his name, for which I apologize. Hopefully we can work something out to get a slight update to D-Robots and use it for another Delphi Robot Rage. I’ll keep you posted.
I’ve compiled all my Advanced Downloads links into a single page to make it easy to find for anyone who was in the Seattle Code Camp session on Advanced Downloads.
Want to know how much memory your program is using? This Delphi function will do the trick.
uses psAPI;
{...}
function CurrentProcessMemory: Cardinal;
var
MemCounters: TProcessMemoryCounters;
begin
MemCounters.cb := SizeOf(MemCounters);
if GetProcessMemoryInfo(GetCurrentProcess,
@MemCounters,
SizeOf(MemCounters)) then
Result := MemCounters.WorkingSetSize
else
RaiseLastOSError;
end;
Update: Thanks to Andreas for a heap free (no GetMem / FreeMem) method of doing this (via his comment!)
Not sure where I got the basics of this, but I added some better error handling to it and made it a function. WorkingSetSize is the amount of memory currently used. You can use similar code to get other values for the current process (or any process). You will need to include psAPI in your uses statement.
The PROCESS_MEMORY_COUNTERS record includes:
PageFaultCount
PeakWorkingSetSize
WorkingSetSize
QuotaPeakPagedPoolUsage
QuotaPagedPoolUsage
QuotaPeakNonPagedPoolUsage
QuotaNonPagedPoolUsage
PagefileUsage
PeakPagefileUsage
You can find all of these values in Task Manager or Process Explorer.
Maybe this would be a good task for one of Delphi’s new records that include methods. . . .
The official standing of the bots was given during the live broadcast of the final session. Although if you run the bots in a new battle, chances are a different bot may win. There certainly is a bit of luck involved. Never the less, these are the official results.
1st Place - Brian Thoman and Codralis of WideOrbit Inc. in Lynnwood, WA
2nd Place - Michael Madsen and Kisai of Logos Consult in Denmark
3rd Place - Ken Adam and Akadamia of Akadamia Ltd in Midlothian, UK
Thanks to everyone who entered a bot! I’ll be arranging the prizes with you all shortly. Thanks to all of the prize contributors too. A special thanks to everyone at CodeGear who made CodeRage possible!
At this point I am not posting the last battle recording. The quality was terrible, and most everyone can run their own battle with the bots and D-Robots (possibly reaching a different outcome though. . . )
I was a big fan of the C64, but I didn’t know you could get Pascal for it. My programming was limited to Commodore Basic, but that was when I cut my teeth on programming and knew what I wanted to do when I grew up.
I didn’t know Anders was using WordPress either until I read that post.