The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • Pages

  • All categories

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

    Join 1,854 other subscribers

Archive for the ‘Software Development’ Category

Sparkle and WinSparkle – frameworks to update your applications on Apple Mac OS X / MacOS and Windows.

Posted by jpluimers on 2019/10/29

Since I will need these one day as native apps are useful:

via: [WayBack] Looking for ideas how to display to the users that ‘New version is available’ info… – Mike Torrettinni – Google+ which also has some good tips on how to notify the user about the availability of new updates.

–jeroen

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

Spring4d Marshmallow ORM – ensuring the right identifier quoting is used

Posted by jpluimers on 2019/10/29

When an ORM generates the SQL for a certain database back-end, it needs to use the right quoting.

Normally, the Spring4D Marshmallow project derives that from the back-end specific adapter used.

But if you use a generic TDriverConnectionAdapter, then you need to manually set the QueryLanguage property in your IDBConnection using a valid value from Spring.Persistence.SQL.Interfaces. This then uses the correct SQLGenerator from the TSQLGeneratorRegister to generate the SQL including correct quotes.

To quote identifiers, most back-ends use a double quote, but MySQL uses a backtick.

via:

You obviously already modified that code as the commented out code is the correct one.
I guess you already got that mistake when you started using MySQL via ADO as MySQL needs the backtick.

Set QueryLanguage of your IDBConnection properly (the valid values are in Spring.Persistence.SQL.Interfaces). Then the correct SQLGenerator will be used.
If you are using an adapter that is specific to a certain database then it sets the QueryLanguage properly but if you are using an adapter for components that can connect to multiple databases (like ADO or FireDAC) it does not, hence the need you specify it.

 

–jeroen

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

Delphi code completion fail with anonymous methods – Stack Overflow

Posted by jpluimers on 2019/10/28

[WayBack] Delphi code completion fail with anonymous methods – Stack Overflow.

It also often fails by inserting end; inside if/then/else statements having a proper begin/end blocks.

The reason is that code completion uses a different parser than the regular Delphi compiler.

Chances of these issues to get fixed are close to zero, because another part of the problem is that there is no formalised Delphi language grammar, not even at Embarcadero itself.

I wish there was an Embarcadero sanctioned grammar (see [WayBack] “The arguments that won the day for us here were about strengthening the ecosystem and becoming the best tooled language on the planet. They were about … – Jeroen Wiert Pluimers – Google+). Actually I had that wish like in the end of the 1990s, but I cannot find my forum post archive back.

The best reverse engineered grammar is DelphiAST: a well maintained open source project implementing an Abstract Syntax Tree for Delphi.

Via: [WayBack] SO…/delphi-code-completion-fail-with-anonymous-methods I have seen this question and I am curious. There is an… – Alberto Miola – Google+

–jeroen

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

Taking short 5m breaks throughout the day isn’t such a bad idea at all…

Posted by jpluimers on 2019/10/28

Interesting that the world at large found out about the 1980s Pomodoro Technique:

[WayBack] Taking short 5m breaks throughout the day isn’t such a bad idea at all: “on average, mindfulness participants gained 62 minutes of productivity a week, … – Marjan Venema – Google+

She refers to [WayBack] The Busier You Are, the More You Need Mindfulness which states You can get benefits in as little as two minutes.

–jeroen

PS: she means 5 minute breaks, not 5 meter breaks (:

Posted in Agile, Development, LifeHacker, Power User, Software Development | Leave a Comment »

use the JVCL’s TJvXxxAppStorage to store float values as strings while controlling the decimal separator…

Posted by jpluimers on 2019/10/24

For my link archive: [WayBack] Is there a way to use the JVCL’s TJvXxxAppStorage to store float values as strings (e.g. “10.152”) rather than hex dumps and also control the decimal separator… – Thomas Mueller (dummzeuch) – Google+ with a solution by Achim Kalwa:

+Thomas Mueller You may try this:

type
  TMyStorage = class(TJvAppRegistryStorage)
  protected
    procedure DoWriteFloat(const Path: string; Value: Extended); override;
  end;
  TJvAppRegistryStorage = class(TMyStorage);
...
Implementation

{ TMyStorage }

procedure TMyStorage.DoWriteFloat(const Path: String; Value: Extended);
var
  SValue : string;
  FS     : TFormatSettings;
begin
  FS := TFormatSettings.Create;
  FS.DecimalSeparator := '.';
  FS.ThousandSeparator := #0;
  SValue := FloatToStr(Value, FS);
  DoWriteString(Path, SValue);
end;

And you need to set
StorageOptions.FloatAsString := False;

–jeroen

 

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

When the Delphi IDE gets slow…

Posted by jpluimers on 2019/10/24

A few tips for when the Delphi IDE gets slow, try these step by step:

  1. Install Delphi Fix-Pack by Andreas Hausladen (a.k.a. Andy)
  2. Disable “Error Insight”
  3. Disable or install LiveBindings related packages

The first can be hard to find as his site disallows search engine indexing, but I’ve written about it before site:wiert.me delphi fixpack andy.

The second step is not a package, but an IDE setting:

The last step involves packages like these (package path followed by package description in the order of the registry):

$(BDSBIN)\dclBindCompFireDAC220.bpl            LiveBinding Expression Components FireDac
$(BDSBIN)\dclbindcomp220.bpl                   Embarcadero LiveBindings Components
$(BDSBIN)\dclbindcompvcl220.bpl                Embarcadero LiveBindings Components VCL
$(BDSBIN)\dclbindcompdbx220.bpl                LiveBindings Expression Components DbExpress
$(BDSBIN)\dclbindcompfmx220.bpl                Embarcadero LiveBindings Components FireMonkey

In those, $(BDSBIN) and $(BDS)\Bin point to the same directory.

Parts via: [WayBack] EDIT: Pretty sure Fix-Pack solved the speed issue, as I installed it and things started flying. I was trying to be as stock as possible, in order to und… – Vin Colgin – Google+

–jeroen

 

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

Spring4D and factory – for my link archive

Posted by jpluimers on 2019/10/23

So I remember as resolving container things can be tricky:

–jeroen

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

Reminder to self: check progress on Delphi helper requests

Posted by jpluimers on 2019/10/23

One of the things the Delphi language really could use some updates in is helpers.

A semi-random example is in [WayBack… It nags me that I can’t create a record helper for a generic type… – Lars Fosdal – Google+.

So I wonder if there has been any progress, and this is a post to remind me checking it out.

Example feature requests (no more QC, so these have to do) by Horácio Filho:

–jeroen

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

When LinkedIn throws HTTP result code 999 at you it means it does not like you

Posted by jpluimers on 2019/10/23

LinkedIn is very private about itself which means you have a hard time linking to their content.

Too bad, as they make themselves an island.

I sorted this out a while ago to see why the Press-This and other bookmarking functionalities in web-browsers would fail for LinkedIn:

[WayBackWordPress/press-this: Linked-In URLs do not parse correctly

@kraftbj I found the below ones on StackOverflow and a general sentiment from https://www.google.com/search?q=linkedin%20999%20response is “Using the invalid HTTP response 999, LinkedIn blocks vary over time depending on both UserAgent and IP address blocks including many hosting and cloud service providers”.

–jeroen

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

Dokumentation Wie aus Hass Liebe wird. Carola Köhntopp – PDF

Posted by jpluimers on 2019/10/22

If I ever bump into a team that needs someone to get started with proper documentation, I need to re-read WayBack Dokumentation Wie aus Hass Liebe wird. Carola Köhntopp – PDF.

The PDF download there might need a captcha, but this one is – apart from file size – identical, but I could not find links to it: [WayBackwww.guug.de/lokal/berlin/downloads/20100204_guug_doku.pdf

–jeroen

Posted in Development, Software Development | Leave a Comment »