The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘Delphi’ Category

In case I need JSONPath functionality in Delphi: grijjy/GrijjyFoundation@4ce069a · GitHub

Posted by jpluimers on 2020/03/25

From a while back, but just in case I ever need JSONPath (for JSON, or BSON Path): [WayBack] Added JSONPath functionality · grijjy/GrijjyFoundation@4ce069a · GitHub.

Via: [WayBack] Search for and extract data from your JSON documents using an XPath-like query language. Now part of our JSON and BSON library. – Erik van Bilsen – Google+

It has a small glitch on non-USA systems, so I filed an issue and provided grijjy’s Erik van Bilsen with a pull request:

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

The Delphi Geek: Data-driven Multithreading

Posted by jpluimers on 2020/03/18

Still on my reading list because it is relevant to many programming environments: [WayBack] The Delphi Geek: Data-driven Multithreading.

Related:

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

Fast-Forward »: My Lazarus External Tools (and Delphi External tools)

Posted by jpluimers on 2020/03/17

For my link archive if I want to make Explorer (for Linux caja) or console shortcuts to source or target directories: [WayBack] Fast-Forward »: My Lazarus External Tools with these XML files from [WayBack] Lazarus External Tools · GitHub:

And the Delphi equivalent from 2004: [WayBack] Fast-Forward »: My Delphi Tools, which addes “Open Source in Notepad2” and “Start Resource Explorer”.

via: [WayBack] Ondrej Kelle – Google+

–jeroen

Read the rest of this entry »

Posted in Delphi, Development, Lazarus, Software Development | Leave a Comment »

Working around [Fatal error] F2084 Internal errors like AV101E53EB-R0000000C-0

Posted by jpluimers on 2020/03/17

A few notes from my response to [WayBack] [Fatal error] F2084 Internal error : AV101E53EB-R0000000C-0 I’m getting this when trying to do some code completion. Any idea ? – Stéphane Wierzbicki – Google+:

This compiler related error usually made it go away for me either when it occurs during project compilation or when using code completion: Close the IDE. Delete your DCU files. Then restart the IDE.

Starting fresh gives a high chance if fixing this unless it is indeed a compiler related error in which case it returns. For that you need to trim down your code to see under which circumstances.

Reasoning (please shoot at it when things are wrong/missing):

Both the IDE code completion and the project compilation use the compiler. The DCU cache is shared between these compiler instances. The DCU cache depends on internal memory structures. Various pointer related errors (both from the IDE, compiler and 3rd party extensions) can damage this cache.

Especially weak IDE uses of the compiler are the find symbol and rename symbol functionalities. I’ve stopped using those about a decade ago.

Sometimes the F2084 (which I often mistype as F2048) is indeed an error in the compiler. Over the years, some of them have been fixed too. See my earlier articles on F2084.

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, F2084, Software Development | Leave a Comment »

Bad surprise of the day: SysUtils.TEncoding in XE2+ defaults to ANSI, while in XE it defaulted to UTF-8.

Posted by jpluimers on 2020/03/11

Bad surprise of the day: SysUtils.TEncoding in XE2+ defaults to ANSI, while in XE it defaulted to UTF-8 .Among other things this means that TStringList… – Eric Grange – Google+

Source: Bad surprise of the day: SysUtils.TEncoding in XE2+ defaults to ANSI, while i…

Delphi

Eric Grange's profile photo

+Stefan Glienke Indeed, you’re right. The issue must be deeper somewhere. Don’t have time to investigate too much, I’m bypassing the RTL now (also have to work around the limitation that for utf-8 the TEncoding.GetString method returns an empty string if one character in the buffer isn’t utf-8)

Asbjørn Heid's profile photo

I wouldn’t trust the RTL at all with loading non-ascii text, we’ve had it hang on invalid UTF-8 codes more than once.

–jeroen

Posted in Ansi, Delphi, Development, Encoding, Software Development, UTF-8, UTF8 | Leave a Comment »

Multi-parameter FreeAndNil plus InitialiseNil methods – interesting code ceremony reduction by David Heffernan

Posted by jpluimers on 2020/03/05

I’m probably getting a truckload of anti-FreeAndNil folks over me, but there are cases this comes in useful, so having an overloaded version cutting down code ceremony makes sense: [WayBack] interface – Avoiding nested try…finally blocks in Delphi – Stack Overflow

Which means I need to update my type safe FreeAndNil one day.

This should be relatively straightforward, given that David published a python generator for his Delphi code [WayBack].

–jeroen

Via: [WayBack] Interesting approach by David Heffernan (*1) to the nested try..finally blocks because of multiple object creations: Overloaded InitializeNil and FreeA… – Thomas Mueller (dummzeuch) – Google+

Read the rest of this entry »

Posted in Delphi, Development, Software Development | Leave a Comment »

Use SetString if your source memory reagion with characters is not null-terminated…

Posted by jpluimers on 2020/03/03

Too many people forget this (including myself) every now and then) so here is a reminder to use the [WayBackSetString method when assigning strings from memory regions having characters but no null terminator:

Anyway, assuming that you use a Unicode Delphi you want to use SetString in its place:

SetString(password, PWideChar(Credential.CredentialBlob), Credential.CredentialBlobSize div 2);

It was by David Heffernan commenting on [WayBack] I have this code sample on StackOverflow using a function WideCharToWideString… I can’t seem to find anything on this function… – Nils Guillermin – Google+.

Note that like the above Delphi 2009 link (where it is a WideChar function to Unicode string conversion function), it was also available in Delphi 2007 and earlier as [WayBack] SetString.

–jeroen

 

Posted in Delphi, Development, Software Development | Leave a Comment »

What is the easiest way of getting Delphi to accept a newly added file as a frame and to treat it as such? – Stack Overflow

Posted by jpluimers on 2020/02/26

As this is still an issue with current Delphi versions: every now and then it looses which designers are needed for a frame:

[WayBack] What is the easiest way of getting Delphi to accept a newly added file as a frame and to treat it as such? – Stack Overflow (by Brian Frost)

<DCCReference Include="x\y\z\myFrame.pas">
  <Form>frameMy</Form> 
  <FormType>dfm</FormType>
  <DesignClass>TFrame</DesignClass>
</DCCReference>

Then check your .dfm file to see if it starts with the correct inherited or object as per Delphi – TInterfacedDataModule revisted – use ‘inherited’ in your .dfm files when your datamodules look like forms in the designer.

Oh and at design time, be very careful embedding frames. Better not to do it at all and for certain: do not embed frames in a nested way: [WayBack] Frames in 10.2.2 Hi Has anyone else had issues with frames under 10.2.2? The project seems to have lost its links to the frames? If I went to the Too… – Vince Bartlett – Google+

–jeroen

Posted in Delphi, Development, Software Development | 1 Comment »

Not all XSD mappings to programming language constructs are possible

Posted by jpluimers on 2020/02/26

This post is a reminder to myself that not all mappings from XSD to programming languages are possible.

There are many impossible cases, so this is just a general reminder.

A Delphi specific case for instance is the mapping of enumerations: one reason is that XSD enumerations are case sensitive, but the Delphi language is not: [WayBackUsing XML Enumerations with Delphi XML Data Binding Wizard – Stack Overflow.

More generic examples from my answer to the above question:

  • In XSD you can derive from an existing type in two ways: extending it and limiting it. Object Oriented languages only allow you extend when deriving.
  • Delphi is not alone in these kinds of limitations. Generating wrappers from XSD schema’s is the field of specialized tools, even in the Java or .NET world.

I’ve seen horrible things with wildcards that are sort of mappable to Java, but not to C#. This could likely go on for much longer…

–jeroen

Posted in C#, Delphi, Development, Java, Java Platform, Software Development, XML, XML/XSD, XSD | 2 Comments »

Delphi Conference 2018 – Barnsten.com

Posted by jpluimers on 2020/02/25

I missed this one, so I was glad I archived it because I was curious for Daan van der Werf – Delphi op de werkvloer “Groothandel & Magazijn”.

So here it is: [WayBack] Delphi Conference 2018 – Barnsten.com, with fixed and archived links where possible.

Presentations and code from the Delphi Conference 2018

–jeroen

Posted in Conferences, Delphi, Development, Event, Software Development | 2 Comments »