Posted by jpluimers on 2017/10/03
Chris Rolliston: +Larry Hengen The Kylix IDE was a fork of the Delphi IDE and used WineLib. It was the applications you built with the Kylix IDE that were QT based.
Via [WayBack] I don’t mean to Whine but, if WINE is mature enough, why doesn’t EMBT officially test and support WINE for development on Mac OS/X and Linux for… – Larry Hengen – Google+
There is a bit of C++BuilderX history as well (which was based on JBuilder).
–jeroen
Posted in Delphi, Development, History, Kylix, Software Development | Leave a Comment »
Posted by jpluimers on 2017/09/27
How I use Linux to write software for multiple target platforms – Kris Kamil Jacewicz – Google+
WINE has come a long way. Many things do not have a native look and feel, but so do many Delphi FMX or Lazarus LCL applications.
In fact I use quite a few tools (including Mikrotik WinBox) through Wine on Mac OS and it runs a lot more stable than quite a few of the FMX applications I’ve tried and ditched.
So for business applications not requiring a platform specific look and feel this indeed is quite acceptable direction to follow.
More at http://kriscode.blogspot.tw/2016/10/how-i-use-linux-to-write-software-for.html
–jeroen
Posted in Delphi, Development, Software Development | 2 Comments »
Posted by jpluimers on 2017/09/25
At the end of April 2014, Roman Yankovsky started a nice [Wayback] discussion on Google+ trying to get upvotes for [Wayback] QualityCentral Report #: 124402: Compiler bug when comparing chars.
His report basically comes down to that when using Ansi character literals like #255, the compiler treats them as single-byte encoded characters in the current code page of your Windows context, translates them to Unicode, then processes them.
The QC report has been dismissed as “Test Case Error” (within 15 minutes of stating “need more info”) by one of the compiler engineers, directing to the [Wayback] UsingCharacterLiterals section of Delphi in a Unicode World Part III: Unicodifying Your Code where – heaven forbid – they suggest to replace #128 with the Euro-Sign literal.
I disagree, as the issue happens without any hint or warning whatsoever, and causes code that compiles fine in Delphi <= 2007 to fail in subtle ways on Delphi >= 2009.
The compiler should issue a hint or warning when you potentially can screw up. It doesn’t. Not here.
Quite a few knowledgeable Delphi people got involved in the discussion:
Read the rest of this entry »
Posted in Ansi, ASCII, Conference Topics, Conferences, CP437/OEM 437/PC-8, Delphi, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Development, Encoding, Event, ISO-8859, Missed Schedule, QC, SocialMedia, Software Development, Unicode, UTF-8, Windows-1252, WordPress | Leave a Comment »
Posted by jpluimers on 2017/09/20
Tools and steps for analysing Delphi or FreePascal code: Dependency Analysis – Pascal Today [WayBack]
Used tools:
–jeroen
Posted in Delphi, Development, Software Development | 2 Comments »
Posted by jpluimers on 2017/09/19
TL;DR: yes it is.
Answer by Allen Bauer at delphi – Is AtomicCmpExchange reliable on all platforms? – Stack Overflow [WayBack]
On Windows, it directly translates into lock cmpxchg which is way faster than the Windows API call [WayBack] InterlockedCompareExchange, as that is a jump to the actual code:
InterlockedCompareExchange:
00417CA8 FF2528E12901 jmp dword ptr [$0129e128]
KERNEL32.InterlockedCompareExchange:
75855E40 8BFF mov edi,edi
75855E42 55 push ebp
75855E43 8BEC mov ebp,esp
75855E45 8B550C mov edx,[ebp+$0c]
75855E48 8B4D08 mov ecx,[ebp+$08]
75855E4B 8B4510 mov eax,[ebp+$10]
75855E4E F00FB111 lock cmpxchg [ecx],edx
75855E52 5D pop ebp
75855E53 C20C00 ret $000c
whereas AtomicCmdExchange looks like this:
Test.pas.20: RestoreValue := AtomicCmpExchange(FieldToBeModfied, 1 {new value}, 0 {expected value}, Success {true if the expected value was found, and new value set});
0111A838 8B45FC mov eax,[ebp-$04]
0111A83B 8D500C lea edx,[eax+$0c]
0111A83E 33C0 xor eax,eax
0111A840 B901000000 mov ecx,$00000001
0111A845 F00FB10A lock cmpxchg [edx],ecx
0111A849 0F9445F2 setz byte ptr [ebp-$0e]
0111A84D 8945D8 mov [ebp-$28],eax
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2017/09/19
I have seen too many projects over the years trying to do input validation by checking KeyPress. This is not limited to Delphi projects (C#, VB and other projects suffer from this just as much). Most of these projects suffer from these::
- Much of the KeyPress logic logic in the UI byusing half-baked copy-pasted code fragments.
- They all fail missing important functionality (like paste, clear, Ctrl-key handling and such) either supporting or suppressing that functionality where needed
If doing Delphi, then that code should be rewritten in a generic way based on examples like like these:
–jeroen
Read the rest of this entry »
Posted in .NET, Delphi, Development, Software Development, Windows Development | Leave a Comment »
Posted by jpluimers on 2017/09/11
I was debugging an issue where a Delphi SOAP implementation was shoe-horned into an Indy server and came across the [WayBack] TWebRequest.UpdateMethodType Method.
The further you get down the if/then/else tree, the more often the indexed property Method is accessed, same for the conversion/comparison code.
property Method: string index 0 read GetStringVariable;
So if the HTTP method is POST (very common), then the calls are being made 3 times:
procedure TWebRequest.UpdateMethodType;
begin
{$IFDEF NEXTGEN}
if Method = 'GET' then { do not localize }
FMethodType := mtGet
else if Method = 'PUT' then { do not localize }
FMethodType := mtPut
else if Method = 'POST' then { do not localize }
FMethodType := mtPost
else if Method = 'HEAD' then { do not localize }
FMethodType := mtHead
else if Method = 'DELETE' then { do not localize }
FMethodType := mtDelete
else if Method = 'PATCH' then { do not localize }
FMethodType := mtPatch;
{$ELSE !NEXTGEN}
if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'GET') = 0 then { do not localize }
FMethodType := mtGet
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'PUT') = 0 then { do not localize }
FMethodType := mtPut
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'POST') = 0 then { do not localize }
FMethodType := mtPost
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'HEAD') = 0 then { do not localize }
FMethodType := mtHead
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'DELETE') = 0 then { do not localize }
FMethodType := mtDelete
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'PATCH') = 0 then { do not localize }
FMethodType := mtPatch;
{$ENDIF NEXTGEN}
end;
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 4 Comments »