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’ Category

CodeRage Mobile day 2 QA

Posted by jpluimers on 2013/06/19

I had a bit of trouble getting into CodeRage Mobile: somehow the confirmation email never reached the pluimers.com servers. After retrying today, @EmbarcaderoTech sent a GotoMeeting link that worked.

Later I will try to trace back about the mail issue (:

I’m in now, and since I usually loose the QA information, here is a dump of the QA for today so far.

Will try to find time for post editing and getting the URLs clickable.

Welcome to CodeRage Mobile! Read the rest of this entry »

Posted in Delphi, Delphi XE4, Development, FireMonkey, JavaScript/ECMAScript, jQuery, OS X FMX, Scripting, Software Development | Leave a Comment »

Vintage Dave is working on a new multithreaded memory manager for Delphi that does not have a global lock

Posted by jpluimers on 2013/06/19

The comment thread at via [WayBack] The Oracle at Delphi » Give in to the ARC side (now at [WayBackplace 1 and [WayBack] 2) is very interesting.

So soon after writing a StackOverflow [WayBackanswer on Delphi Memory Managers yesterday, [WayBack] this one by [WayBack] David M (aka vintagedave) caught my eye:

This is unannounced at the moment, but I am working on a new memory manager which does not have a global lock, and is designed for multithreaded usage, including cases where memory is allocated in one thread and freed in another, and many threads are allocating and freeing at once. It also uses a more secure design than FastMM4, which may be important for world-facing code, eg web servers. It’s a personal project which I have not yet announced, but if you are interested (Allen, Guenther, others) please feel free to contact me at vintagedave@gmail.com.

I wonder if it is better than the multithreaded Delphi memory managers I mentioned in the answer:

As a side note:

One of the reasons for using FastMM is the excellent debugging capabilities. It looks like – though not free – DDDebug extends this a lot!

I found it in Wanted: live leak detection for FastMM – DelphiFeeds.com and [WayBackTURBU Tech » Blog Archive » Wanted: live leak detection for FastMM.

–jeroen

via The Oracle at Delphi » Give in to the ARC side.

Posted in Delphi, Delphi XE4, Development, FastMM, Software Development | Tagged: , , , , | 9 Comments »

Delphi XE2: Update 4 is not the final update… Be sure to check out HotFix 1

Posted by jpluimers on 2013/06/18

When at clients, I often see Delphi XE2 only updated until Delphi XE2 Update 4 (sometimes not even Update 3 is installed, which means you can run into Strange Format result in Delphi XE2 when using Currency data types).

Update 4 is the latest update offered by the ‘check for updates’. But the actual latest update is CodeCentral ID: 28881, RAD Studio XE2 Update 4 Hotfix for FireMonkey and C++.

The final ISO does include this update, so if you ever need to re-install, do it from CodeCentral ID: 28882, Delphi XE2 and C++Builder XE2 ISO (includes Update 4 Hotfix).

You can check which updates you have installed in the Help -> About box of Delphi:

  • RAD Studio XE2 Update 4:
    version 16.0.4429.46931;
    Delphi XE2 and C++ Builder XE2 Update 4
  • RAD Studio XE2 Update 4 hotfix 1:
    version 16.0.4504.48759;
    Delphi XE2 and C++ Builder XE2 Update 4 HotFix1
    Delphi XE2 and C++ Builder XE2 Update 4

So be aware: sometimes the HotFix is only recognizable as the version number, not the version text.

Though HotFix is advertised as FireMonkey and C++ update, it also includes some Delphi fixes and makes sure you don’t get the below error messages from IDE Fix Pack 5.1 for 2009-XE3.

As a matter of fact, shortly after releasing, the author Andreas Hausladen posted IDE Fix Pack 5.1 for XE2 requires XE2 Hotfix 1.

Andreas Hausladen releases new versions of the IDE Fix Pack at irregular intervals. Watch the release page. Currently it is at version 5.3: IDE Fix Pack 5.3 and for Delphi XE2 it indicates “IDE Fix Pack 5.3 for XE2+UP4+Hotfix1”.

While installing the Hotfix 1, you can get messages like these:

---------------------------
Embarcadero RAD Studio XE2
---------------------------
Error
Error applying patch to file C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\lib\win64\release\IdSSLOpenSSLHeaders.dcu.  It has probably been updated by other means, and can no longer be modified by this patch.  For more information contact your patch vendor.
---------------------------
Abort   Retry   Ignore
---------------------------

The reason is that the installer thought it had enough disk space, but the dynamic swap file growth of Windows systems decreased the disk space after the initialler estimate.

Make sure you have at lease 4 gigabytes of disk space free before installing RAD Studio XE2 Update 4 Hotfix 1.

These are the error messages you can get: Read the rest of this entry »

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

Delphi XE4 Update 1 is out (via: Installing the Platform Assistant on a Mac – RAD Studio)

Posted by jpluimers on 2013/06/12

Over the last couple of days, I was asking myself

“wow, the docwiki has been updated for the Delphi XE4 update 1 version of the Mac edition of the Platform Assistant, how long until the official update is out?”

These URLs from Installing the Platform Assistant on a Mac – RAD Studio didn’t work for a couple of days:

Now they do!

The reason is that yesterday Embarcadero released 29446 Update 1 for Delphi, C++Builder and RAD Studio XE4 that fixes lots of stuff: Fix list for Update 1 for RAD Studio XE4, Delphi XE4 and C++Builder XE4.

Note it is not referring to Readme – Help Update 1 for Delphi and C++Builder XE4 – RAD Studio which got released last week as 29436 Help Update 1 for Delphi, C++Builder and RAD Studio XE4. It is the real Delphi XE4 Update 1.

The cool thing: finally it is a binary patch. Not fast about as fast as a full uninstall/reinstall), but at 336 megabytes a much smaller download than the 3.7 gigabytes of 29451 Delphi XE4 and C++Builder XE4 ISO (including Update 1).

Patched update versus full uninstall/install is a trade off:

  • Patch can take a couple of hours, and is CPU bound (too bad most of it is bound to a single CPU core)
  • Uninstall/reinstall is disk-speed and disk-size bound (make sure you have 15+ gigabytes free; an SSD improves this process a lot)

altd, ftpd, keeping off-line downloads Read the rest of this entry »

Posted in Delphi, Delphi XE4, Development, Software Development | Tagged: , | 2 Comments »

Delphi XE4: installer batch file for “experimental GExperts + code formatter for Delphi XE4”

Posted by jpluimers on 2013/06/12

Slightly more than a month ago, Thomas Müller release the experimental GExperts + code formatter for Delphi XE4.

Since there is no official GExperts for Delphi XE4 build yet, his installation instructions include this:

Use the ExpertManager tool to register GExperts to Delphi XE4.

The thing is: ExpertManager is part of GExperts, so this introduces a “chichen-and-egg” situation.

So I wrote a small batch file and a bit of documentation to install it.

Just in case you cannot download that SVN changeset easily, here are the documentation and batch-file:

Documentation

Steps to install:
0- Quit Delphi XE4
1- Download the GExperts XE4 experimental from http://blog.dummzeuch.de/2013/04/28/experimental-gexperts-code-formatter-for-delphi-xe4/
2- Recursively unpack that download
3- Copy the batch file Install-GExperts-XE4-experimental–run-as-administrator-from-ExpertManager.exe-directory.bat into that directory
4- From that directory, run the copied Install-GExperts-XE4-experimental–run-as-administrator-from-ExpertManager.exe-directory.bat
5- Run Delphi XE4
6- Check if GExperts is installed

Batch file

:: check if user is administrator

  "C:\Windows\system32\cacls.exe" "C:\Windows\system32\config\system" 1>nul 2>&1  && (goto :isAdmin)
:isNoAdmin
  echo you need to be Administrator, and (when under Vista or higher) run this using using UAC
  goto :exit

:isAdmin

:: Gets the right link for x86 (32-bit) program files
IF /I %PROCESSOR_ARCHITECTURE% == amd64 goto :x64
IF /I %PROCESSOR_ARCHITEW6432% == amd64 goto :x64
goto :x86
:x64
   :: OS is 64bit
   set ProgramFilesX86=%ProgramFiles(x86)%
  goto :continue
:x86
   :: OS is 32bit
  set ProgramFilesX86=%ProgramFiles%
  goto :continue

:continue

:: create the right directory and copy the files

  setlocal

  set TargetDirectory=%ProgramFilesX86%\GExperts for RAD Studio XE4

  mkdir "%TargetDirectory%"
::  set FilesToCopy=DbugIntf.pas ExpertManager.exe GExperts.chm GExpertsDebugWindow.exe GExpertsGrep.exe regularexpert\GExpertsRSXE4.dll Readme.txt preview.pas
  set FilesToCopy=ExpertManager.exe GExperts.chm regularexpert\GExpertsRSXE4.dll preview.pas

  for %%f in (%FilesToCopy%) do copy /y %%f "%TargetDirectory%\"
  set RegFile="%TargetDirectory%\ExpertsXE4.reg"
::  explorer /select,"%TargetDirectory%\GExpertsRSXE4.dll"

:: expand backslash into double backslash for .REG file
  set ExpertTarget="%TargetDirectory%\GExpertsRSXE4.dll"
  set ExpertTarget=%ExpertTarget:\=\\%

::Windows Registry Editor Version 5.00
::
::[HKEY_CURRENT_USER\Software\Embarcadero\BDS\11.0\Experts]
::"GExperts"="C:\\Program Files (x86)\\GExperts for RAD Studio XE4\\GExpertsRSXE4.dll"
::
  echo Windows Registry Editor Version 5.00 >%RegFile%
  echo. >>%RegFile%
  echo [HKEY_CURRENT_USER\Software\Embarcadero\BDS\11.0\Experts] >>%RegFile%
  echo "GExperts"=%ExpertTarget% >>%RegFile%
  echo. >>%RegFile%
::  explorer /select,%RegFile%
  regedit /S %RegFile%

  endlocal

  goto :exit

:exit

–jeroen

via: experimental GExperts + code formatter for Delphi XE4 « twm’s blog.

Posted in Batch-Files, Delphi, Delphi XE4, Development, Scripting, Software Development | 2 Comments »

Crap: the outsourcing party of the client wrote C-code like this in 2005, and nobody scrutinized it

Posted by jpluimers on 2013/06/12

I was involved in a big project migrating a complex stack from Windows XP to Windows 7 x86, and got scared this !@#$ out of me.

The stack communicated to WebSphere MQ on AS/400 from Windows, and on the Windows side of things consisted of a UI developed in in Cool:Gen, a C interface to a Delphi DLL, which takes care of the communication to WebSphere MQ.

Digression:

This all was histerically grown. In the beginning (early to mid 90s last century) it was a big Borland Pascal/Turbo Pascal application – running on DOS, Windows 3.1x, Windows 95 and OS/2 2.x/3.0 – that talked over a propriatary layer over SNA to AS/400.
The vendor of that layer didn’t respond to a request for Windows NT 4.x compatibility, and meanwhile some client applications were about to be developed in Delphi.

So in 1997/1998 – together with a great AS/400 software developer – I wrote a SNA based APPC/CPI-C communication layer in Delphi 3 that could be accessed from both Turbo Pascal (using a file based interface) and Delphi (using an object interface).
The DOS interface was an executable around the Delphi interface, which was a set of classes.

Delphi part

The Delphi part of the DOS interface was centered around FindFirstChangeNotification/CreateProcess combined with MsgWaitForMultipleObjects/WaitForSingleObject to make the waiting as efficient as possible.

DOS part

DOS part

The DOS part of the Delphi interface was centered around this piece to make waiting efficient:

asm
  int $28
  mov ax, $1000
  int $15 { DESQview/TopView give up time slice }
  mov ax, $1680
  int $2F
end;

Thanks to the RBIL: Ralf Brown’s Interrupt List (there are now multiple HTML versions of it), it makes use of these tricks so DOS applications can efficiently wait : Read the rest of this entry »

Posted in C, CVS, Delphi, Delphi 2006, Delphi 3, Delphi 5, Delphi XE2, Development, Dimensions CM by Serena, MKS Integrity, Software Development, Source Code Management | 3 Comments »

Are Delphi programmers more happy than other programmers? (via: Sentiment Analysis of Github Commits)

Posted by jpluimers on 2013/06/07

Interesting graph here: Evented Github Adventure – Sentiment Analysis of Github Commits.

It seems that Delphi programmers have a much better happy/sad word rate than other programmers.

–jeroen

 

Posted in Delphi, Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

Things That Turbo Pascal is Smaller Than

Posted by jpluimers on 2013/06/04

Things That Turbo Pascal is Smaller Than.

Well basically anything.

About 30k was the size our complete IDE in the 80s century.

(Thanks @pstalenh and @rand)

–jeroen

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

Run batch file from Delphi IDE (via: Stack Overflow)

Posted by jpluimers on 2013/05/29

In pre-Galileo versions of Delphi it was easy to run a .BAT or .CMD file as a main project file: just press F9.

Thanks to iManBiglary for posting how to do this in modern Delphi versions. Paraphrased:

Add the file path to cmd.exe (easieist is to add $(ComSpec) which expands the %ComSpec% environment variable) in the tools menu, with /c$EDNAME as the parameter.
In addition, you can tell the IDE to save your file before running the external tool with the $SAVE macro

One of the things you can do with this is add a project containing a batch file that starts to assemble your build results to create a deployment set.

–jeroen

via: Run batch file from Delphi IDE – Stack Overflow.

Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Development, Software Development | Leave a Comment »

IBM Pascal Compiler Aug81 pdf (via: Bitsavers’ Index of /pdf/ibm/pc/dos)

Posted by jpluimers on 2013/05/26

Wow, I didn’t know that IBM had their own DOS based Pascal compiler for the PC in 1981, but they did, and BitSavers just uploaded their manual
IBM_Pascal_Compiler_Aug81.pdf

Edit:
document moved from http://bitsavers.trailing-edge.com/pdf/ibm/pc/dos/IBM_Pascal_Compiler_Aug81.pdf
to: http://bitsavers.trailing-edge.com/pdf/ibm/pc/languages/IBM_Pascal_Compiler_Aug81.pdf

It is part of their “Personal Computer Computer Language Series”

From the era of DOS Pascal compilers before Turbo Pascal.

–jeroen

via Index of /pdf/ibm/pc/dos.

Posted in BitSavers.org, Delphi, Development, History, IBM Pascal, Pascal, Software Development | 7 Comments »