Visit site The Programming Works

May 2011

1
vote
Vote UpVote

Generic musings 2

The Programming Works – It was pointed out in the comments to my previous post that my simple generic sorting routine contains additional overhead compared to TArray Rtl code (Generic.Collections & Generic.Defaults units) because RTTI is used inside the loop. Yes, that is true. Let try to improve the code by taking ...
Details Favorite? Off-Topic? Serg @ 2011-05-11 12:20
1
vote
Vote UpVote

Generic musings

The Programming Works – Delphi (as Pascal descendant) has always had powerful type system. Consider the following sample code implementing simple insertion sort algorithm (I use Delphi 2009): unit InsSort; interface type TItem = Integer; TArray = array of TItem; procedure InsertionSort(var A: TArray); ...
Details Favorite? Off-Topic? Serg @ 2011-05-10 14:24
11
votes
Vote UpVote

Installing Virtual Treeview

The Programming Works – Delphi component’s package installation procedure has always been a mess. If you don’t rely on self-made “automated” installations that just copy compiled binaries and do some registry patches that could easily destroy your Delphi installation beyond repair you should do ...
Details Favorite? Off-Topic? Serg @ 2011-05-06 15:14

April 2011

7
votes
Vote UpVote

Best 1st April joke. Ever.

The Programming Works – My regards to lazarus.su (in Russian). It’s 1st April post was: Lazarus developers announced that the IDE source code is closed and sold to Embarcadero. Under the unconfirmed information the last Lazarus version 0.9.30 will become the base for the next Delphi release – FPC Edition. ...
Details Favorite? Off-Topic? Serg @ 2011-04-03 17:30

February 2011

2
votes
Vote UpVote

How to generate HTML Help with Doc-O-Matic Express

The Programming Works – XMLDoc in-source documentation style is becoming popular among Delphi open-source projects. There is also very good Delphi Documentation Guidelines document which describes what XML tags should be used for in-source XMLDoc-style documenting comments and how to use these tags. Unfortunately currently ...
Details Favorite? Off-Topic? Serg @ 2011-02-11 12:27
6
votes
Vote UpVote

TInteger

The Programming Works – Since the introduction of operator overloading in Delphi one can easily define custom data types that support arithmetic operations. For example it is quite easy to implement arithmetic of complex numbers like this: type PComplex = ^TComplex; TComplex = record Re, Im: Extended; class ...
Details Favorite? Off-Topic? Serg @ 2011-02-01 09:34

November 2010

3
votes
Vote UpVote

Delphi interfaces without reference counting

The Programming Works – Any interface in Delphi inherits from IInterface (which is a nickname for IUnknown). It is nice for reference-counted interfaces, but sometimes we do not need reference counting at all. Consider the following example: unit IValues; interface type IValue = interface(IInterface) function ...
Details Favorite? Off-Topic? Serg @ 2010-11-24 07:19

September 2010

9
votes
Vote UpVote

Synchronization in Delphi TThread class

The Programming Works – VCL sources is a very interesting reading, if you have a time for it. Many Delphi programmers (like me) use VCL TThread class as a simple wrapper for WinAPI kernel thread object, avoiding to use Synchronize and Queue methods by using a custom message processing instead. Still it is worthwhile to ...
Details Favorite? Off-Topic? Serg @ 2010-09-14 11:39

August 2010

3
votes
Vote UpVote

Understanding Threads: Atomic Operations and Memory Ordering

The Programming Works – A common question about threads is: “I need a read/write access to a variable from two or more threads. Should I protect an access to a variable by critical section?” A simple answer is: yes, if you want to be on the safe side always protect the variable by a critical section. A deeper answer ...
Details Favorite? Off-Topic? Serg @ 2010-08-28 06:09
3
votes
Vote UpVote

Thread synchronization in Windows XP and Vista

The Programming Works – An implementation of the thread locks have changed between Windows XP and Vista. To make a long story short, XP locks were fair; starting from Vista (and also Windows 2003 SP1) thread locks are unfair. A lock fairness means that the threads that tries to hold a lock (for example, to enter a ...
Details Favorite? Off-Topic? Serg @ 2010-08-04 09:14

July 2010

0
votes
Vote UpVote

A String of Byte?

The Programming Works – Dynamic arrays are implemented in Delphi as lifetime-managed reference types without “copy-on-write” support. What does it mean on practice can be shown by the following code: program Project1; {$APPTYPE CONSOLE} type TIntArray = array of Integer; var A, B: TIntArray; begin ...
Details Favorite? Off-Topic? Serg @ 2010-07-30 08:43
6
votes
Vote UpVote

The Emperor’s New Clothes

The Programming Works – I had a very disappointing discussion with Embarcadero employees on EDN forums recently on the subject already covered in CR blog or Deltics blog. I have no desire to give a link to the EDN thread – the thread is locked now, it does not bring honour to its participants. Instead I give a link ...
Details Favorite? Off-Topic? Serg @ 2010-07-27 22:15
0
votes
Vote UpVote

Delphi interfaces on binary level

The Programming Works – An interface reference in Delphi is a pointer to pointer to an interface method table (IMT). That follows the COM specifications and is a good starting point to understand what Delphi interfaces are on binary level. Delphi interfaces can be made 100% compatible with COM specifications, but that is ...
Details Favorite? Off-Topic? Serg @ 2010-07-06 07:56

June 2010

0
votes
Vote UpVote

A fUnNy StRiNg

The Programming Works – CR in his recent post about the quality of Delphi help discussed the StrUpper/StrLower code example. I was interested why the original D7 example causes an access violation while the similar D2009 example runs without AV. So I have written the following tests (in Delphi 2009): {$WRITEABLECONST OFF} ...
Details Favorite? Off-Topic? Serg @ 2010-06-18 06:48
0
votes
Vote UpVote

Delphi class helpers: a practical example.

The Programming Works – Using the standard VCL TFileStream class you can’t set a sharing mode for a new file until Delphi 2010. A trick like this var Stream: TStream; begin Stream:= TFileStream.Create('TEST', fmCreate or fmShareDenyWrite); ... is useless since fmCreate or fmShareDenyWrite = fmCreate, and you ...
Details Favorite? Off-Topic? Serg @ 2010-06-15 09:34
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Delphi Tage Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)