The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for the ‘Delphi x64’ Category

Please write dates and times so that everyone understands them, not just you. xkcd: ISO 8601

Posted by jpluimers on 2013/02/28

ISO 8601 was published on 06 05 88 and most recently amended on 12 01 04

ISO 8601 was published on 06 05 88 and most recently amended on 12 01 04

Boy, am I glad with the xkcd: ISO 8601 post and image on the right.

One reason:

Please write dates and times so that everyone understands them, not just you.

The alt-text of the comic is hilarious (ISO 8601 was published on 06 05 88 and most recently amended on 12 01 04) showing the confusion of using 2 digit years not knowing which field means which (I thin XKCD author Randall Munroe and Mathematics of the ISO calendar got some of the dates, see PDF search dates below).

I found out in the mid 1980s that people I was communicating with internationally (back then the internet was forming and you already had BITNET Relay chat and email) were using different date formats than I did.

Ever since that, I’ve used the YYYY-MM-DD format of writing dates, encouraging others to use as well and as soon as I found out that was a standard, started to evangelize ISO 8601 (there is an ISO 8601 category on my blog), which – at the time of writing this – had had revisions in 1998 (on 1998-06-15), 2000 (on 2000-12-15) and 2004 (on 2004-12-01).

A lot later I found out that back in 1971, this date format was a recommendation, and in 1976 already a standard. Not nearly as old as Esperanto though (:

Speaking about languages:

At the end of last century, after Delphi 5 added year 2000 support (which made the 16-bit Delphi 1 disappear from the box as the effort to prove the product including all libraries was year 2000 proof), Delphi went cross platform.

The Delphi team working on both Kylix 1 and Delphi 6, the also added a DateUtils unit which provides a lot of cuntionality, including support for weak numbers. The first test version always assumed week 1 was the one with januari first in it. As ISO 8601 also indicates how the first week of a year should be determined, a couple of people (Jeroen W. Pluimers, Glenn Crouch, Rune Moberg and  Ray Lischner) provided code that fixed this and a few other things in the unit. We even got mentioned by Cary Jensen!

That code is now also part of the RemObjects ShineOn library. That DateUtils unit is now on GitHub.
A Delphi XE version of the code (and a Delphi 2007 one) are now at NickDemoCode (Thanks Nick Hodges!).

Delphi is not the only environment having ISO 8601 support. XML has, .NET has, etc: it is now wide spread.
So follow your tools, and start using it yourself as well (:

Too bad the ISO 8601 standard text is not available publicly:

I remember the Y2K preparation era where the ISO-8601 standard was freely available at http://www.iso.ch/markete/8601.pdf, soon after the Year 2000, the PDF got locked behind a payment engine.
ISO suffers from heavy link rot too, for instance the ISO 3166 country codes used to be at http://www.iso.org/iso/prods-services/iso3166ma, but are now at http://www.iso.org/iso/home/standards/country_codes.htm. What about HTTP 303 or 302 redirect here guys?

Luckily people keep cached copies:

  1. “ISO 8601” “First edition” “1988-06-15” filetype:pdf
  2. “ISO 8601” “Second edition” “2000-12-15” filetype:pdf
  3. “ISO 8601” “Third edition” “2004-12-01” filetype:pdf

–jeroen

via: xkcd: ISO 8601.

Posted in .NET, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Development, ISO 8601, Power User, Prism, Software Development | Tagged: , , , , , , , , , , , , , | 10 Comments »

Found a table with Delphi Conditional defines over the Delphi versions/compiler platforms/bitness

Posted by jpluimers on 2013/02/20

Right now, documentation on Delphi Conditional Defines is on pages like Conditional compilation (Delphi) – RAD Studio XE2, but it is limited as it is for one specific version of Delphi only.

However, over the course of Delphi versions, compiler platforms and bitness, and not forget Free Pascal and Turbo Pascal/Borland Pascal, the matrix has become huge.

There is no complete documentation on that in one place. Right now include files like Defines.inc, the DSPack.inc, the JCL include directory the JVCL common include directory and the Jedi.inc documentation contain the collective knowledge about this.

Someone should condense that in a table and – more important – keep it up to date.

At least now there is a post collecting some of the links that contain the knowledge (:

Found one that contains these columns

  • Product & Version
  • VERxxx defines
  • __BORLANDC__ value
  • RTLVersion
  • CompilerVersion
  • Package Version

via Compiler/RTL version overview « Muetze1 wich is now available on the wayback machine: http://web.archive.org/web/20131229055045/http://www.muetze1.de/?page_id=547

–jeroen

Posted in Borland Pascal, Delphi, Delphi 1, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Development, FreePascal, History, Pascal, Software Development, Turbo Pascal | 14 Comments »

MonkeyStyler Blog: should be on DelphiFeeds too.

Posted by jpluimers on 2013/02/15

I mailed the DelphiFeeds people to add the MonkeyStyler Blog by Mike Sutton.

It is a nice Delphi related blog focussing on FireMonkey stuff.

–jeroen

Posted in Delphi, Delphi 1, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Development, FireMonkey, OS X FMX, Software Development | 4 Comments »

Allen Bauer on: delphi – What’s the difference between CreateWnd and CreateWindowHandle? (plus a bit of CreateParams)

Posted by jpluimers on 2013/02/06

One of the really nice contributions on StackOverflow by Allen Bauer is almost 3 years ago.

It is about these three Delphi VCL methods introduced by TWinControl to make control development easier:

The really cool thing is that this API has been stable since 1995, and still allows you to subclass windows controls or create your own controls in a very simple way.

Note that Allen does not cover DestroyWnd or DestroyWindowHandle, but those are just counterparts of CreateWnd and CreateWindowHandle.

In normal Delphi application code, you have less Destroy overrides than Create overrides, and the same holds for control development.

–jeroen

via: delphi – What’s the difference between CreateWnd and CreateWindowHandle? – Stack Overflow.

Posted in Delphi, Delphi 1, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Software Development | 2 Comments »

x64 debugging on Windows: usually not directly by the IDE, but trough a debug helper process (msvsmon / PAServer / dbkw64_16_0)

Posted by jpluimers on 2012/12/07

While developing x64 applications, most Windows development tools are actually running in x86 mode, and use an intermediate x64 layer to debug the x64 process even for local debugging.

For Visual Studio 2008 and up, this is msvsmon.exe (for Delphi XE2 and up it is PAServer.exe for remote debugging or [WayBack] dbkw64_16_0.exe for local debugging, other tools use a similar mechanism).

The fun thing with Visual Studio is that when msvsmon.exe fails to load locally, you get a misleading error message:

[Microsoft Visual Studio]
Error while trying to run project: Unable to start debugging.
The Microsoft Visual Studio Remote Debugging Monitor has been closed on the remote machine.
[OK]

I found two workarounds myself :

  1. Kill msvsmon.exe if it is running but Visual Studio cannot talk to it
  2. Restart Visual Studio if it cannot start msvsmon.exe

I learned the why from Steve Steiner: he posted the StackOverflow answer explaining msvsmon.exe is also used for local x64 debugging.

Delphi XE2 and up sometimes have a similar cryptic message (I forgot to jolt it down, next time I come across it, I will edit this blog post) and usually killing PAServer.exe or dbkw63*.exe or restarting the IDE solves it.

–jeroen

via:

Posted in .NET, Debugging, Delphi, Delphi x64, Development, QC, Remote Debugging, Software Development, Visual Studio 11, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

Great session on how to prevent SQL Injection Myths and Fallacies

Posted by jpluimers on 2012/08/15

A few weeks ago, Bill Karwin did a must watch webinar on the prevention SQL Injection titled  “SQL Injection Myths and Fallacies“.

Bill Karwin (twitter, new blog, old blog, Amazon) is famous for much work in the SQL database community, including InterBase/Firebird, mySQL, Oracle and many more.

He also:

Anyway, his webinar is awesome. Be sure to get the slides, watch the replay, and read the questions follow up.

Watching it you’ll get a better understanding of defending against SQL injection.

A few very valuable points he made: Read the rest of this entry »

Posted in .NET, .NET 3.5, .NET 4.5, .NET ORM, ASP.NET, Batch-Files, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, Cloud Development, COBOL, CommandLine, Database Development, Delphi, Delphi for PHP, Delphi x64, Delphi XE2, Development, EF Entity Framework, F#, Firebird, FireMonkey, History, InterBase, iSeries, Java, JavaScript/ECMAScript, Jet OLE DB, LINQ, LLBLGen, MEF, Microsoft Surface, Mobile Development, PHP, PowerShell, Prism, Scripting, SharePoint, SilverLight, Software Development, SQL, SQL Server, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 7, VB.NET, VBS, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, Web Development, Windows Azure, WinForms, WPF, XAML, xCode/Mac/iPad/iPhone/iOS/cocoa | 1 Comment »

Delphi/Fortran memory allocation difference: row/column major order makes a big difference. StackOverflow answer.

Posted by jpluimers on 2012/08/14

Last week I posted an in depth answer on StackOverflow.com about the memory allocation difference in Delphi and Fortran, or more accurately in two different kinds of languages.

You have:

  • column major order (not only used in Fortran and other science centric languages, but also in the shading languages GLSL and HLSL that can be used in FireMonkey)
  • row major order (used in most other languages, for instance Delphi, C, etc)

A very important aspect is the order of for optimized loops. For column major order, the optimum is inside out (as the inner arrays/records are in consecutive memory locations), but for row major order, it is the exact inverse.

One of the consequences is that in Fortran it is a very fast operation to pass an array of inner fields as parameter to a method.

This is what I wrote: Read the rest of this entry »

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi for PHP, Delphi x64, Delphi XE, Delphi XE2, Development, Fortran, Software Development | 4 Comments »

Dodgy Coder: Coding tricks of game developers

Posted by jpluimers on 2012/04/26

Some very interesting tips from game development that apply juts as well to general software development.

On code health:

Now I always try to dig right down to the root cause of a bug, even if a simple, and seemingly safe, patch is available. I want my code to be healthy. If you go to the doctor and tell him “it hurts when I do this,” then you expect him to find out why it hurts, and to fix that.

Though tools like SourceMonitor can help you track your code health, the best tool is between your ears.

–jeroen

via: Dodgy Coder: Coding tricks of game developers.

Posted in .NET, Batch-Files, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Delphi, Delphi x64, Delphi XE2, Development, JavaScript/ECMAScript, PHP, PowerShell, Scripting, Software Development | 1 Comment »

Applying XE2 Update 3: uninstall IDE Fix Pack first, then apply, then install updated IDE Fix Pack. Also update EurekaLog.

Posted by jpluimers on 2011/12/22

Before installing updates, it is always wise to read the release notes.

In this case, the below quote from the Release Notes for XE2 Update 3 was very important for me, as I use the IDE Fix Pack:

IDE Fix Pack Is Not Compatible with Update 3

The IDE Fix Pack for XE2 is incompatible with XE2 Update 3. If you have the IDE Fix Pack for XE2, you should uninstall the IDE Fix Pack for XE2 before installing Update 3. A revised version of the IDE Fix Pack for XE2 will be made available at http://andy.jgknet.de/fixpack/ .

The cool thing is, on the same day that Delphi XE2 Update 3 got releasedAndy also released the new FixPack 4.6 last week and also explained the cause of the incompatibility.

Note that because of the same reason, more products will need to be updated. EurekaLog also released an update, and I expect more vendors to release updates soon.

Update 3 breaks the monthly release cycle, but for a reason. This update contains way more fixes than the previous ones, in a much wider area and with short turnarounds between reporting and fixing (yes, it does pay to [WayBack] report bugs through QualityCentral). Just [WayBack] read the list of fixes. It is similar to the big updates we used to have for previous Delphi versions.

It also requires a lot more disk space, so make sure you have at least 5 gigabytes of free disk space.

Not related to Update 3, but still nice is that Thomas Müller made available for download the Expertimental GExperts version 1.35-2011-12-18 that is compatible with Delphi XE2. It includes a code formatter that has different bugs than the Delphi XE2 one, but for me usually works better.

–jeroen

via: Release Notes for XE2 Update 3 – RAD Studio XE2.

Posted in Delphi, Delphi x64, Delphi XE2, Development, QC, Software Development | 1 Comment »

Delphi XE2 x64 Extended floating point support: CodeCentral 28488 TExtendedX87: FPU-backed 80-bit Extended type for Win64

Posted by jpluimers on 2011/09/14

in the Delphi 64 world, there is no official support for the Extended data type for various reasons.

If you really need it, then you can use the TExtendedX87 unit by Philipp M. Schlüter as mentioned in this Embarcadero forum thread.

–jeroen

Via: 28488 TExtendedX87: FPU-backed 80-bit Extended type for Win64.

Posted in Algorithms, Delphi, Delphi x64, Development, Floating point handling, Software Development | 2 Comments »