Archive for the ‘Delphi 10.1 Berlin (BigBen)’ Category
Posted by jpluimers on 2017/10/12
I mentioned Asbjørn Heid on wiert.me before. While prepping for the Deadlock Empire workshop at EKON20, I needed a Delphi equivalent for the .NET [Way: Barrier Class (System.Threading)
The game uses that in level deadlockempire.github.io/#H4-Barrier [WayBack].
Edwin van der Kraan found the ThreadBarrier/ThreadBarrier.pas at master · lordcrc/ThreadBarrier implementation via [WayBack] Is there a way to create memory barriers in Delphi? Something like .NET’s System.Threading.Barrier class, java.util.concurrent.CyclicBarrier… – Horácio Filho – Google+
It’s from Asbjoørn who is known as lordcrc on GitHub. Cool stuff!
So yes, there is a Delphi version of If you thought you could do multi-threading, then play “The Deadlock Empire” games. You can find it at https://deadlockempire.4delphi.com/ There are two deadlockempire implementations there:
The workshop was great fun!
This is about a web game focussing on the concurrency issues in multi-threading environments. By the conference there will be a Delphi version of it. At the workshop we will play each round interactively: all attendees play the round followed by a short discussion. This is about collective learning, so the speakers will probably learn… Read More
Source: [Archive.is] If you thought you could do multi-threading, then play “The Deadlock Empire” games – Entwickler Konferenz
–jeroen
Posted in .NET, C#, Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), 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 2017/10/10
Given a variable I: Integer, some people like Inc(I); others like I := I + 1;.
You might think that part of that discussion nowadays should be multithreading.
In practice this does not matter: the compiler will use the same instructions for both statements.
TL;DR: This might make you think they are always atomic. But that’s not always true, as the below differences show. In addition, it can also depend on your processor archicture.
In the Win32 Delphi Compiler, this is how they look:
Read the rest of this entry »
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 5 Comments »
Posted by jpluimers on 2017/08/31
If you want to set all columns to the same value, select all columns in the structure view and then (assuming SizeStyle [WayBack] is already set to ssPercent [WayBack]) set the Value [WayBack] to 0. This will trigger some automatism that makes all of the columns sized equal.
Great answer by Uwe Raabe [WayBack]
Source: Delphi How to use TGridPanel – Stack Overflow [WayBack]
–jeroen
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), 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 2017/08/08
Thanks Stefan Glienke for posting this a while ago:
If you ever wonder why you get no (or incomplete) RTTI from a control that you inherited from a DevExpress one – then look into cxVer.inc where it has the following lines:
{$IFNDEF CXTEST}
{$WEAKLINKRTTI ON}
{$RTTI EXPLICIT METHODS([]) FIELDS([]) PROPERTIES([])}
{$ENDIF}
+Martin Wienold was wondering (and so was I at first) why he could not properly resolve a form from the DI container that inherited from TdxRibbonForm despite writing a public method with [Inject] attribute on it but it was never called.
Warning: If you are using DevExpress or any other source code that does this (changing the $RTTI directive) and build these sources together with your application (in contrast to using precompiled dcus or even packages) on a version <XE6 then you might suffer from this issue: [WayBack] #79943: {$ RTTI} flag scope which causes RTTI to disappear even from units that did not have the $RTTI in them.
Source: If you ever wonder why you get no (or incomplete) RTTI from a control that you…
–jeroen
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2009, Delphi 2010, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, QC, Software Development | Leave a Comment »
Posted by jpluimers on 2017/06/21
A while ago, I had to fix some stuff in an application that would write – using a binary mechanism – UTF-8 and UTF-16 strings (part of it XML in various flavours) to the same byte stream without converting between the two encodings.
Some links that helped me investigate what was wrong, choose what encoding to use for storage and fix it:
–jeroen
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE8, Development, Encoding, Software Development, UTF-16, UTF-8, UTF16, UTF8, XML, XML/XSD | 3 Comments »
Posted by jpluimers on 2017/05/17
Brilliant:
if it is a console program and it was started any other way (from the Windows Explorer, from the Delphi IDE with or without debugger, from another non-console program), then, before the console window can close, it will display:
Press any key...
Source: Delphi Corner Weblog: New: Velthuis.AutoConsole unit [WayBack]
via:
–jeroen
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, FastMM, Software Development | Leave a Comment »
Posted by jpluimers on 2017/04/27
Nice find:
Stefan Glienke+4
Look into the initialization block of FMX.Dialogs. The call to ActivateClassGroup(TFmxObject); turns off all the TRegGroups that don’t contain at least one type that inherits from TFmxObject which also happens to be the group that you register your form class to. GetClass then ignores such groups.
I don’t have the slightest idea what the intention behind all that code is but it certainly is one of the reasons why you cannot mix FMX and VCL officially.
In response to:
I have an VCL application. I need to register some form classes at run time. This is done in the form’s unit implementation section :
Initialization
If GetClass(‘TfmConnectiondialog’) = Nil Then
Classes.RegisterClass(TfmConnectiondialog);
Suddenly my class wasn’t registered anymore. GetClass(‘TfmConnectiondialog’) was always nil and Classes.RegisterClass had no effects.
After some long search, I’ve found that I’ve inadvertently added an FMX.Forms in one of my unit. This was the culprit. Replacing FMX.Forms with VCL.Forms solved my problem.
Behaviour is really strange, why Classes.RegisterClass didn’t throw any exception ? Is this a “Bug” or is this “as expected” ?
–jeroen
Source: Hello, I have an VCL application. I need to register some form classes at ru… [WayBack]
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE7, Delphi XE8, Development, Software Development | 1 Comment »
Posted by jpluimers on 2017/03/29
Marco Cantú posted the below solution when ActiveX is missing in your File -> New dialog which I’ve paraphrased:
OK, you can try this.
- Close RAD Studio/Delphi.
- Open the registry editor.
- Under
HKEY_CURRENT_USER, open the Known IDE Packages\Delphi — that is something like HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\18.0\Known IDE Packages\Delphi —
- Search for the
delphicompro240.bpl, entry
- Edit it: remove the
__ (double-underscore) pre-pended to the value (Untitled). In other word, change “__(Untitled)” into “(Untitled)“.
- Close registry editor.
- Open the IDE.
I ran it it recently and was glad this worked.
–jeroen
Source: Hey! I have a new Delphi :)…Great! And what to do now with my favorite…
Posted in Delphi, Delphi 10.1 Berlin (BigBen), Development, Software Development | Leave a Comment »