Archive for the ‘Delphi 2010’ Category
Posted by jpluimers on 2016/03/14
Initial hack – image via the forums server.
This weekend, the Embarcadero web site was hacked by AnonCoders . Not once (see also [WayBack ] G+ link and [WayBack ] DelphiPraxis link and [WayBack ] image ) but at least twice (see also [WayBack ] G+ link and [WayBack ] image and [WayBack ] Delphi Praxis link and [WayBack ] image ) where the initial hacked simple text “Hacked By AnonCoders ~ Cyber Caliphate” after having been reverted back to the site – hopefully by Embarcadero staff – was replaced with [WayBack] more graphical content later on.
Hack presenting itself in the IDE – image via the forums server.
The Welcome Page inside the Delphi IDE uses the Embarcadero web site, so the Delphi IDE Welcome Page was also affected (see also [WayBack ] this G+ link ).
Because the IDE uses this on-line content, potentially any code could be executed inside the IDE (apart from that page being loaded over http, so any man-in-the-middle could abuse this, but I digress ). This imposes a security risk as many developers run the IDE from accounts having more rights than the average user.
Read the rest of this entry »
Posted in Delphi , Delphi 10 Seattle , Delphi 2005 , Delphi 2006 , Delphi 2007 , Delphi 2009 , Delphi 2010 , Delphi XE , Delphi XE2 , Delphi XE3 , Delphi XE4 , Delphi XE5 , Delphi XE6 , Delphi XE7 , Delphi XE8 , Development , QC , Software Development | 13 Comments »
Posted by jpluimers on 2016/02/24
As Delphi allows to forward declare both classes and interfaces, people often wonder about records.
The short answer: you can’t forward declare record types .
The long answer: you can’t directly, but you can indirectly either reference based (through pointers or callbacks with const parameters ) or operator based (through operator overloading ).
I think the reason forward declaration of classes and interfaces is possible because they both are reference types, so referring does not impose copying.
Anyway, the trick is this:
You can’t have forward declarations for record types. Define both Implicit operators in the second type
Source: delphi – How do I define implicit conversion operators for mutually dependent records? – Stack Overflow
–jeroen
via:
Posted in 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 , Software Development | Leave a Comment »
Posted by jpluimers on 2016/02/17
A wile ago, I had a this error when trying to get the TIME portion of a DATE column:
ORA-00904: "TIME": invalid identifier
This doesn’t work in Oracle, even though when you search for Oracle convert DATE to TIME you end up at this page listing TIME as a function: 12.7 Date and Time Functions . Alas, that page is for MySQL which is owned by Oracle for a while now .
Back to the query which was like this where date_column was of type DATE .
SELECT
id,
date_column,
TIME (date_column)
FROM some_table
That DATE type actually stores date+time , and since it was filled with Delphi TTime values, the date parts would always be “1899-12-30” (yes, I like ANSI DATE and TIMESTAMP formats ). Oracle doesn’t get that, so I wanted to get the time portion.
Solutions:
Read the rest of this entry »
Posted in Database Development , Delphi , Delphi 10 Seattle , Delphi 2005 , Delphi 2006 , Delphi 2007 , Delphi 2009 , Delphi 2010 , Delphi 7 , Delphi XE , Delphi XE2 , Delphi XE3 , Delphi XE4 , Delphi XE5 , Delphi XE6 , Delphi XE7 , Delphi XE8 , Development , OracleDB , Software Development | Leave a Comment »
Posted by jpluimers on 2016/02/14
Now that you’re 21 , have a glass of wine and watch this great presentation by Warren Postma which he made for last years birthday:
VIDEO
–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 8 , Delphi x64 , Delphi XE , Delphi XE2 , Delphi XE3 , Delphi XE4 , Delphi XE5 , Delphi XE6 , Delphi XE7 , Delphi XE8 , Development , Software Development | Leave a Comment »
Posted by jpluimers on 2016/02/03
A while ago I bumped into this: As of Windows 7 (and probably Vista), the standard Windows Common Item (Open and Save) Dialogs expect the main thread to be initialised with STA because it is easier to support apartment threading in single-threaded apartments because COM provides synchronization on a per-call basis and the Windows GUI APIs are not guaranteed to be thread safe.
Windows XP and Server 2003 didn’t enforce this for the classic Windows Open and Save Dialogs , so it only appeared when the software below got run on Windows 7 in a way too late time frame (but the market share of XP is still high ).
The reason is that when using Delphi, the TOpenDialog and TSaveDialog will use the classic Open and Save Dialogs on Windows < Vista and fall-forward to the new Common Item Dialogs handled by TFileOpenDialog and TFileSaveDialog (both will not fall backward).
When you have your COM initialisation done wrong, your application appears to hang. Amidst the plethora of threads started by the COM subsystem, these two dead-lock:
Read the rest of this entry »
Posted in 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 , Software Development | 2 Comments »
Posted by jpluimers on 2015/12/17
DUnit registration can mix TestSuites and TestCases.
Some links:
–jeroen
Posted in Agile , Delphi , Delphi 10 Seattle , Delphi 2005 , Delphi 2006 , Delphi 2007 , Delphi 2009 , Delphi 2010 , Delphi 5 , Delphi 6 , Delphi 7 , Delphi XE , Delphi XE2 , Delphi XE3 , Delphi XE4 , Delphi XE5 , Delphi XE6 , Delphi XE7 , Delphi XE8 , Development , Software Development , Unit Testing | Leave a Comment »
Posted by jpluimers on 2015/12/01
On the todo list:
Interesting use of an IDE plugin: Copy a string from a “Watch” entry to the clipboard without quotes. – Thomas Mueller (dummzeuch) – Google+
Source: delphi – Can I change the display format for strings in the watch list? – Stack Overflow :
Every now and then I use the watch window to display strings which contain sql statements.Now I select Copy Value from the context menu and get
'SELECT NAME FROM SAMPLE_TABLE WHERE FIRST_NAME = ''George'''#$D#$A
but want
SELECT NAME FROM SAMPLE_TABLE WHERE FIRST_NAME = 'George'
The answer by MartynA has an OTA plugin that could be integrated with something like GExperts.
–jeroen
via: Interesting use of an IDE plugin: Copy a string from a “Watch” entry to the clipboard…
Posted in Delphi , Delphi 10 Seattle , Delphi 2005 , Delphi 2006 , Delphi 2007 , Delphi 2009 , Delphi 2010 , Delphi 7 , Delphi x64 , Delphi XE , Delphi XE2 , Delphi XE3 , Delphi XE4 , Delphi XE5 , Delphi XE6 , Delphi XE7 , Delphi XE8 , Development , Software Development | Leave a Comment »
Posted by jpluimers on 2015/11/24
A while ago, I came across a class having (among other members) two methods named like this:
Within one of the other members of the class, I had to (temporarily) Stop processing, then Start it again.
But I couldn’t, as neither Start, nor Stop would make a record of the state it left the instance in.
Always ensure you know the state of an instance.
So I added the state, and tests to ensure a Stop/Start change was indeed not breaking things.
–jeroen
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 , C# 6 (Roslyn) , 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 , Software Development | 1 Comment »
Posted by jpluimers on 2015/11/04
From a chat with a co-worker a while ago:
I’m not against properties. Just something against properties properties that are objects with writeable fields.
So even if you expose such a property as read-only, it can still get its writeable fields overwritten.
That is a pain when those are part of the state of the underlying object.
In other words: encapsulate your state changes.
Here we solved it by making
the type of the property immutable
the property writeable
react on state changes during the write
Proper encapsulation.
In this case it was a project mixing C# and Delphi, but you can easily apply the above to any language featuring classes and properties.
Another solution would have been to extend the type of the property so it can expose an event that fires during change. Much more convoluted.
–jeroen
Posted in .NET , C# , C# 1.0 , C# 2.0 , C# 3.0 , C# 4.0 , C# 5.0 , C# 6 (Roslyn) , 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 , Software Development | 2 Comments »
Posted by jpluimers on 2015/10/22
Recently I bumped into it again with one of the more current Delphi XE* versions and Delphi 2007: the IDE changing the DFM files without reason.
This time it was in a multi-team environment with many branches and DFM merge hell.
A few examples of properties and components getting changes:
Warren P suggests to review your DFM changes before committing to version control and I completely agree: it is the only way to ensure they are indeed unwanted changes.
There are some stop-gab things you could try, but these only partially help
–jeroen
via:
Posted in Delphi , Delphi 10 Seattle , Delphi 2005 , Delphi 2006 , Delphi 2007 , Delphi 2009 , Delphi 2010 , Delphi XE , Delphi XE2 , Delphi XE3 , Delphi XE4 , Delphi XE5 , Delphi XE6 , Delphi XE7 , Delphi XE8 , Development , QC , Software Development | 7 Comments »