When everybody uses (a+b)/2 but should use sqrt((a*a+b*b)/2) or even [Wayback/Archive.is] weigh the RGB parts.
–jeroen
Posted by jpluimers on 2016/01/20
When everybody uses (a+b)/2 but should use sqrt((a*a+b*b)/2) or even [Wayback/Archive.is] weigh the RGB parts.
–jeroen
Posted in Algorithms, Color (software development), Conference Topics, Conferences, Development, Event, Software Development | Leave a Comment »
Posted by jpluimers on 2015/09/09
Over the two decades I’ve come across a lot of Delphi projects.
All of them have one thing in common: even for functionality available in the Delphi libraries, much of that code was self-written.
You even see this in big libraries that have shipped with Delphi bit not originate from the Delphi team. Take Indy: lots of “roll your own” in it.
I’ve made some thoughts about that, and see these main causes with the points below.
What’s your thought on this?
Posted in Conference Topics, Conferences, Delphi, Delphi 10 Seattle, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Event, QC, Software Development | 1 Comment »
Posted by jpluimers on 2015/07/15
Thanks [Wayback] Jørn Einar Angeltveit for sharing this a while ago:
A session by Jon Skeet and Tony the Pony (which has strong teeth) presented during the Polish DevDay 2013 in Kraków, Poland.
[Wayback] +Jon Skeet’s speech [Wayback] “Back to basics” is really a good watch.
In a funny way, he explains why the simplest fundamentals of computer software text, dates and numbers can cause some real headache for the programmer…
In case you didn’t know: Jon Skeet is “Chuck Norris” on [Wayback] stackoverflow.com:
The subtitle is “the mess we’ve made of our fundamental data types”.
Some of the topics covered:
Posted in .NET, C#, Conference Topics, Conferences, Delphi, Development, Encoding, Event, internatiolanization (i18n) and localization (l10), Java, Java Platform, Jon Skeet, Pascal, Scripting, Software Development, Unicode | 2 Comments »
Posted by jpluimers on 2015/01/29
Unit testing has been here for a long time, and so has Unit Testing in Delphi. Below a summary of historic links together with some notes on how the state of affairs changed over the years.
I’ll start with one of the first large Delphi Unit Testing articles was a paper by Charlie Calvert summarizing the state of the art on Delphi Unit Testing in 2004. It is present in the wayback machine as DUnit Talk and on his elvenware.com site.
Note that the elvenwere.com site is sometimes slow or hard to reach. Since his evangelist days at Borland/CodeGear, Charlie has moved through a few evangelist jobs at Falafel and Microsoft and finally went back to his old profession: being a great teacher – this time at Bellevue College – often using script based languages and cloud computing, with less focus on his web-presence.
Many of his IT books (during his writing period, he wrote both as Charles Calvert and Charlie Calvert) are still relevant though.
Posted in Agile, Conference Topics, Conferences, Delphi, Dependency Injection, Design Patterns, Development, Event, FreePascal, History, Inversion of Control / IoC, Pascal, Software Development | 3 Comments »
Posted by jpluimers on 2014/12/01
Every vendor should publish version numbers like this to make it easier for their customers to check if they are current or not.
I can’t promise to have a complete list, or the latest versions, but I will update with the versions I have used.
–jeroen
Posted in Conference Topics, Conferences, Delphi, Delphi XE, Delphi XE2, Development, Event, Software Development | 8 Comments »
Posted by jpluimers on 2014/11/20
Ever since the Delphi build engine got changed to MS Build in Delphi 2007, many people use Delphi build events. Their order is prebuild, prelink and postbuild (or maybe better spelled pre-build, pre-link and post-build).
Before Delphi 2007, you had to fiddler with project groups and dependencies to fake pre-build and post-build events. For an example see Pre and Post-Build Automation in Delphi.
One of the really good things about these events is that build events appear in the output tab of the messages window.
One of the really bad things is that there is hardly any documentation about the build events.
At least two important things are missing:
Let’s explain these. Read the rest of this entry »
Posted in Conference Topics, Conferences, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Event, FastMM, QC, Software Development | 5 Comments »
Posted by jpluimers on 2014/11/04
Normally you would not want to use a reserved word as an identifier. But sometimes it can be very convenient, for instance for a code generator that wraps remoting calls or does ORM.
Both Delphi and C# have an escape for this:
The prefixes are to tell the compiler knows you really know what you are doing, and are using a reserved word as an identifier.
The cool thing: in the Run Time Type Information (Delphi) or Reflection (C# and VB.NET) you will see the names without the prefix.
Some examples from StackOverflow: Read the rest of this entry »
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Conference Topics, Conferences, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Event, Jon Skeet, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0 | Leave a Comment »
Posted by jpluimers on 2014/08/28
Quiz questions:
procedure TestHResult.Test_EOleException;
var
OleException: EOleException;
IResult: LongInt; // == HResult
UResult: Cardinal; // == DWord
begin
IResult := $800A11FD;
UResult := $800A11FD;
try
OleException := EOleException.Create('message', $800A11FD, 'source', 'helpfile', -1);
raise OleException;
except
on E: EOleException do
begin
if E.ErrorCode = $800A11FD then
Exit;
Self.CheckEquals(E.ErrorCode, $800A11FD, 'E.ErrorCode should equal $800A11FD');
end; // E: EOleException
end;
end;
Posted in Conference Topics, Conferences, Delphi, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Event, Software Development | 2 Comments »
Posted by jpluimers on 2014/08/06
A long while ago, I wrote about a (then overdue post) on .NET/C#: Using IDisposable to restore temporary settrings example: TemporaryCursor class.
I had been using a similar technique in Delphi since before I found out about the [WayBack] TRecall class and thought: I think my TTemporaryCursor is smarter, as it is based on interfaces.
TRecall(and the [WayBack] Vcl.Graphics descendants [WayBack] TBrushRecall, [WayBack] TFontRecall, and [WayBack] TPenRecall) store [WayBack] TPersistent properties using the Assign method. They were introduced in Delphi 6.Too bad there are only [WayBack] very few people using TRecall as lots of TPersistent things warrant sasaving and restoring.
My [WayBack] TTemporaryCursor (now [WayBack] at bitbucket) class only stores an integer, so it cannot derive from
TRecall. Besides it is based onIInterfacewhich got introduced in Delphi 6, but was present asIUnknownsince Delphi 3 (see [WayBack] Interface It! A quick guide to the ins and outs of interfaces in Delphi. By Jimmy Tharpe).This means that
TRecallcould have been based onIInterface, so I wonder why it was not.Note I’m not the first to publish about such a class (Malcolm Grooves wrote [WayBack] TCursorSnapshot, SwissDelphiCenter has [WayBack] TMyCursor, Nick Hodges published about [WayBack] TAutoCursor), it’s just that it has been in my tool box for so long, and written memento classes that you will see 2 articles on it this week.
In the mean time (this works with Delphi 2009 and up), I also wrote a small class that does similar things for any [WayBack] anonymous method. More on that tomorrow.
Back to TRecall: it is an example of [WayBack] the memento pattern in Delphi. The [WayBack] memento pattern allows you to restore state.
SourceMaking.com a.k.a. [WayBack] Design Patterns and Refactoring is a great site about [WayBack] Design Patterns, [WayBack] UML, [WayBack] AntiPatterns and [WayBack] Refactoring.
Most pattern example code is available in all of the C#, C++, Delphi, Java and PHP languages.
Great stuff!
One of the constructs for restoring state is a [WayBack] try … finally … end construct: it allows you to always execute something in the finally block, for instance restoring the state to right before the try block. Read the rest of this entry »
Posted in Conference Topics, Conferences, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Design Patterns, Development, Diagram, Event, Software Development, UML | 14 Comments »
Posted by jpluimers on 2014/03/06
If you run FastMM4 in FullDebugMode, then here are two tips that new (and sometimes existing users) often overlook:
FullDebugMode directive in the IDE, build your project.The first makes sure all units are compiled with FullDebugMode (Delphi does not always do that automagically).
The second makes sure your EXE can access the DLL that writes out your *MemoryManager_EventLog.txt file containing memory leaks and other issues FastMM4 detected.
–jeroen
Posted in Conference Topics, Conferences, Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Event, FastMM, Software Development | 2 Comments »