Archive for the ‘Delphi XE8’ Category
Posted by jpluimers on 2016/07/06
via: Lesson Learned – I Can’t Get My Git Repo Clean! | DrupalEasy
One file kept getting added to the git modified list: service/src/main/MySOAPdefinition.pas.
It was part of a repository that had been migrated from SVN (more on that in a future blog post) and along the way been renamed in directory service/src/main from MySOAPdefinition.pas to MySoapDefinition.pas. SVN (and TortoiseSVN) don’t object to this. But git does.
You’d see this on the command-line:
>git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)
modified: service/src/main/MySOAPdefinition.pas
no changes added to commit (use "git add" and/or "git commit -a")
>git add service\src\main\MySoapDefinition.pas
>git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)
modified: service/src/main/MySOAPdefinition.pas
no changes added to commit (use "git add" and/or "git commit -a")
Basically the add would do nothing.
On Windows, this is how to get around this:
Read the rest of this entry »
Posted in Delphi, Delphi XE8, Development, git, Mac OS X / OS X / MacOS, OS X 10.9 Mavericks, Power User, Software Development, Source Code Management, SourceTree, Windows, Windows 7 | 1 Comment »
Posted by jpluimers on 2016/06/30
I’ve seen this compiler error in Delphi XE8 and others in Delphi XE6 and XE7 using a project depending on the built-in FastReports:
F2051 Unit fs_iinterpreter was compiled with a different version of fs_isysrtti.TfsSysFunctions
This will probably fail in more recent versions as well.
The easiest workaround is this:
- Fast Report XE6 (4.15.10)
- Fast Report XE7 (Version 5.1.5)
- Fast Report XE8 (Version 5.2)
The problem could be solved with help of technical support (Paul Gursky).
The solution is to remove all pas files from:
- LibD20 (XE6)
- LibD21 (XE7)
- LibD22 (XE8)
- LibD22x64 (XE8)
The above is paraphrased from Fast Reports forum > Fatal Error F2051 when compiling under Delphi XE6 and XE7
The core of the problem is that Fast Reports stores .dcu/.hpp/.pas files in the same directory whereas Delphi itself stores the .dcu/.hpp/.o files in one directory (actually usually in debug and release directories for each supported platform like win32, win64, etc).
Note: the built-in Fast Reports limits a few features, for instance export to Excel is not supported.
–jeroen
Posted in Delphi, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2016/05/24
The background here was a quick project at a client where many .dproj files were in the same directory, but they suffered from conditional define differences. Which meant that even if they were all using the DEBUG configuration, some defines in the .dproj directories were different therefore poisoning shared .DCU files (as Delphi does not automatically rebuild them when the sources have not changed even though the IDE switched to a new project).
There was no quick possibility to reorganise the project structure (a combination of a version system history being problematic and potentially lots of relative path references in the .dproj and .dpr files could still be broken) so I wanted different “Unit Output Directories” for each project preferably using non-hardcoded project name.
So I tried putting $(PROJECTNAME) in a “Unit Output Directory”. But unlike build-events – where that one has a value – in the Directory it hadn’t.
To cut things short, Uwe Raabe did some spelunking in the .dproj file and found that $(SanitizedProjectName) was recognised so I switched to .\$(Platform)\$(Config)\$(SanitizedProjectName).
Putting it in the OutputDirectory (where your .EXE gets emited) fails for most part. Yes, the .EXE gets put in the right directory. No, the debugger cannot find it as it thinks it needs to use %SanitizedProjectName%. No for TestInsight: it cannot find the EXE either because of the % expansion.
Based on SanitizedProjectName, I did some more spelunking coming with the below list. Remember though:
Only tested for Win32 applications for Delphi XE8
I assembled the list by doing a quick sed on a Delphi XE8 Win32 .dproj file transforming all XML element names to $() form then running it through a uniq like script. After that I added each of them in a “Unit Output Directory” prepended with .\_\ (well I cheated a bit, I did them in groups separated by a back-slash and went back to single items in case of failures. A kind of ‘binary search’).
Ensure the ones you use, are defined before you use them. For example: the definition of SanitizedProjectName need to be in the .dproj file before actually using SanitizedProjectName.
These expand to empty strings:
Read the rest of this entry »
Posted in Conference Topics, Conferences, Delphi, Delphi XE8, Development, Event, Software Development | 2 Comments »
Posted by jpluimers on 2016/04/21
The below fragment is one of the favourite kinds of examples in the Ruby world:
5.times { |i| print i, " " }
It uses the times method on Integer and prints:
0 1 2 3 4
There are many implementations of this in other languages, for instance Ruby’s ‘times()’ function in C# | Of Code and Me (which the WordPress.com editor fucked up as it replaced Action<int> with Action which is a totally different thing, so the gist with code is below.
public static class IntExtensions
{
public static void Times(this int i, Action func)
{
for(int j = 0; j < i; j++)
{
func(j);
}
}
}
Which you use as
5.Times(i => Console.Write(i));
It’s slightly off as it prints:
01234
I know; nitpicking, but this code works (did I ever tell I love .NET fiddle?):
5.Times(i => Console.Write("{0} ", i));
Well, Mason Wheeler encouraged Asbjørn Heid for the below Ruby Mania in Delphi; just read the comments at In C# nearly everything is an object, so when writing a unit test for a string…
Since the WordPress.com editor fucks up TProc<Integer> into TProc and TProc behaves differently from TProc<Integer>, I’ve included a gist link with the actual code below.
program RubyManiaConsoleProject;
uses
System.SysUtils;
type
TRubyMania = record helper for ShortInt
procedure times(const IterBody: TProc);
end;
procedure TRubyMania.times(const IterBody: TProc);
var
i: Integer;
begin
for i := 0 to Self-1 do
IterBody(i);
end;
begin
5.times(
procedure(i: Integer)
begin
Write(i, ' ');
end
);
end.
It also shows why I hardly use anonymous methods in Delphi: they’re way too verbose.
–jeroen
Read the rest of this entry »
Posted in Conference Topics, Conferences, Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Event, Software Development | 1 Comment »
Posted by jpluimers on 2016/04/14
Visual Studio is a pretty big product and will take over 30GB of disk space after installation
Source: Visual Studio Frequently Asked Questions
LOL. It’s about half the size of recent Delphi versions.
–jeroen
Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 5.0, C# 6 (Roslyn), Delphi, Delphi 10 Seattle, Delphi XE8, Development, Software Development, VB.NET, Visual Studio 2015, Visual Studio and tools, Xamarin Studio | 4 Comments »
Posted by jpluimers on 2016/04/05
The “Official statement” of Embarcadero about their recent hacks are in the form of comments on public messages mentioning the hacks, some asking to take discussions offline.
They forgot to comment on Delphi: disable or change your welcome page to not use the Embarcadero site (as that site has been hacked twice this weekend) « The Wiert Corner – irregular stream of stuff, so here is their comment from the G+ thread I posted:
FYI: Future versions will no longer have the banner pulled from the website on the start page.
Source: This weekend, the Embarcadero web site was hacked by AnonCoders. once…
I hope it will be the upcoming Delphi 10.1 Berlin version, but given their speed at responding to security threats, I won’t hold my breath.
–jeroen
PS: what a coincidence that I wrote this yesterday on G+:
I know of a few companies that could benefit from more openness.
Ilya Grigorik originally shared: Edge team announced new (EdgeHTML) open issue tracker: http://bit.ly/1S3uhp5 – yay! The times, they are changing.File away!
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, Software Development | Leave a Comment »
Posted by jpluimers on 2016/03/17
Stefan Glienke worded it perfectly: Default(typeIdentifier) is a “magic” function that is implemented into the compiler and causes it to generate the correct code – like for records with managed fields it generates a call to FinalizeRecord and some instructions to zero the remaining fields.
Source: I know I can write MyRecordVar := Default(TMyRecordType) because I asked a qu…
–jeroen
Posted in Delphi, Delphi 10 Seattle, 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/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 »