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,854 other subscribers

Archive for the ‘Delphi’ Category

[FOSDEM 2014] Visualizing Delphi with Moose – YouTube

Posted by jpluimers on 2014/03/20

Jus finished watching this very interesting talk from the last FOSDEM 2014 conference: [FOSDEM 2014] Visualizing Delphi with Moose – YouTube.

It is based on MOOSE (an open-source platform for software and data analysis) and PHARO (a free and open-source Smalltalk environment).

This is how to get started (it is in Dutch, we have great developers and researchers around here).

Be sure to watch the presenter Stefan Eggermont (StackOverflow, Twitter, LinkedIn, GitHub, FOSDEM, website www.legacycode.nl) as this kind of analysis (that is also possible for other languages and tools) can highly speedup your work.

You can download the webm version of the talk from the FOSDEV14 devroom.

–jeroen

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

Turbo Pascal: My 1996 answer to Q: How can I reverse a TP .EXE or .TPU back into source code?

Posted by jpluimers on 2014/03/20

Wow, did I really wrote that 18 years ago?

Yes I did, and I was quoted in the (back then famous) FAQPAS3.TXT from (now Professor Emeritus) Timo Salmi: The third set of frequently (and not so frequently) asked Turbo Pascal questions with Timo’s answers. The items are in no particular order.

From ts@uwasa.fi Fri Nov 8 00:00:56 1996
Subject: Decompiling a TP .EXE

56.
Q: How can I reverse a TP .EXE or .TPU back into source code?

A: This is simply asking too much. You cannot decompile a TPprogram in a manner that would give you back the original source.This method of reverse engineering is not on in actual practice.

Quoting Jeroen Pluimers jeroenp@dragons.nest.nl

“During thecompilation, important information gets lost about variables,types, identifiers etc. Writing a Pascal Decompiler is impossible.The best you can achieve is a disassembler that can help yourecognize some Pascal statements.”

Since then I learned that compilers emit highly predictable CPU code that – with the right, and sometimes complex, algorithms – can be reconstructed into language structures.

Of course you are missing the identifiers and comments, but you can some remarkable info, especially with well structured code.

Two more links about this:

–jeroen

via: FAQPAS3.TXT.

Posted in Delphi, Development, Pascal, Software Development, Turbo Pascal | 2 Comments »

Database Workbench v4 – version: 4.4.5. got released (via: News @ Upscene Productions)

Posted by jpluimers on 2014/03/19

Today, Version 4.4.5 of Database Workbench got released.

It mainly is a bugfix release (15 out of 18 issues were bugfixes, of the rest, 2 are feature requests, 1 enhancement): List of items new/enhanced/fixed in Product: Database Workbench v4 – version: 4.4.5.

Download from the trial/lite download page, or from the customer download page.

Enjoy (:

–jeroen

via: News @ Upscene Productions.

Posted in Database Development, Delphi, Development, Firebird, InterBase, MySQL, NexusDB, OracleDB, Software Development, SQL Server, Sybase SQL Anywhere | Leave a Comment »

Delphi: reminder to self on differencing memory allocation dumps

Posted by jpluimers on 2014/03/18

Reminder to self: some great ideas to hunt for memory leaks while your application is running: differencing allocation dumps, DDDebug Memory Profiler, etc.

TURBU Tech » Blog Archive » Wanted: live leak detection for FastMM.

Thanks to the TURBU Tech blog from Mason Wheeler.

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

WITH IS EVIL! (via: Paul Foster – Google+)

Posted by jpluimers on 2014/03/13

Yet another example of somehow who got bitten hard by using the with statement (I decided to give with its own category on my blog).

This time it got shared by Paul Foster on G+ and comes down to this:

Even in unsuspiciously looking code, the wit statement can bite you, especially if you need to do refactoring and (because of that) introduce two names in the same scope.

Or in Paul‘s words:

Whilst upgrading the code to remove the Containers unit (its not supported on NextGen platforms, so I have to make things work with Generics.Collections instead, (bye bye D7 support for this code) and refactor a couple stupidities in my original design (they always creep in, don’t they) I ended up with two class members of the same name.  The with block then looked OK but I was in fact not access the member I thought I was. 

–jeroen

via: Paul Foster – Google+ – WITH IS EVIL! God damn it, I know it makes code easier to….

Posted in Borland Pascal, Delphi, Delphi 1, Delphi 2, 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, Delphi XE4, Delphi XE5, Development, Pascal, Software Development, Turbo Pascal, With statement | 18 Comments »

Delphi ARC: Free versus DisposeOf (via: Ondrej Pokorny – Google+)

Posted by jpluimers on 2014/03/12

An interesting discussion about the Delphi ARC compilers and Free versus DisposeOf is at Ondrej Pokorny – Google+ – Just realized: For me the most dangerous thing in ARC is….

Posted in Delphi, Delphi XE4, Delphi XE5, Development, Software Development | 2 Comments »

Interesting Spring4D based `function TDataSetExtensions.Select(): IEnumerable` on reddit

Posted by jpluimers on 2014/03/12

Very interesting helper function:

function TDataSetExtensions.Select<TResult>: IEnumerable<TResult>

–jeroen

via: Reddit: Delphi sorcery: Spring4D roadmap : delphi.

Posted in Delphi, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development | Leave a Comment »

CodeRage 8 replays – Embarcadero Technologies – YouTube

Posted by jpluimers on 2014/03/12

For my own link archive: CodeRage 8 replays – Embarcadero Technologies – YouTube.

Lots of nice sessions, including these REST sessions:

About the REST support in Delphi: make sure you take a look at the REST Debugger application, as you get full source code for it and is an excellent starting point to see how the REST components work together (it is written using the FireMonkey UI framework so it runs on a Mac as well as on Windows).

David I explains more about the REST Debugger here: Sip from the Firehose : Using the REST Debugger will help you prototype your Delphi and C++ REST apps.

Jim McKeeth has a really nice video about it as well on XE5 REST Debugger Supercharged | The Podcast at Delphi.org which describes how to use Delphi the Delphi REST tools to use KimonoLabs to scrape data from web sites:

 kimono : Turn websites into structured APIs from your browser in seconds.

–jeroen.

RestDemo folder with many examples that connect to many social things (Twitter, FaceBook, DropBox, etc).

Posted in Delphi, Delphi XE5, Development, Software Development | Leave a Comment »

Sorting algorithms are art forms. Just see and hear how beatutiful they are.

Posted by jpluimers on 2014/03/10

Image and video art came through SORTING – A visualization of the most famous sorting algorithms and 15 Sorting Algorithms in 6 Minutes – YouTube.

Both via This is why I Code – Google+

Posted in .NET, Delphi, Development, Opinions, Software Development | 3 Comments »

Delphi/Turbo Pascal: AppendWithRetry for text files to retry Append

Posted by jpluimers on 2014/03/10

Every once in a while you have multiple threads or processes wanting to write a short message to the same log file. Append then will give you an I/O error 32 (ERROR_SHARING_VIOLATION), but the below small routine will sleep a bit while retrying a couple of times.

It uses these Delphi aspects around the $I or $IOCHECKS compiler directive:

  • in $I+ mode, you get exceptions when certain “classic” Pascal style I/O operations fail.
  • in $I- mode, you access the IOResult to obtain the results of those I/O operations
  • IOResult gets the result of the last failed operation (if any) or zero if none failed
  • IOResult clears the underlying storage to zero
  • $IFOPT checks for a certain state of a compiler flag
  • You can store the state of $OPT in a temporary conditional define

Note there are a few tables of codes you can get back through IOResult as basically you can get many GetLastError results in IOResult as well: Read the rest of this entry »

Posted in Delphi, Delphi 1, Delphi 2, 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, Delphi XE4, Delphi XE5, Development, Software Development | 2 Comments »