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

Links to alternatives for Delphi REST clients

Posted by jpluimers on 2019/11/13

A few good links to a few alternatives for the built in Delphi REST client [WayBack] Hi looking for good and complete tutorial/course how to create RESTFul services with Delphi. Or if anyone use Delphi for creating RESTFul services feedb… – Gordan Paunovic – Google+

–jeroen

Posted in Communications Development, Delphi, Development, HTTP, Internet protocol suite, JSON, REST, Software Development, TCP | Leave a Comment »

A multi index container: TIndexedStore – Martin C Harvey’s Software Pages

Posted by jpluimers on 2019/11/13

For single-indexed containers, you can use a generic TDictionary, for instance one of these:

Reminder to self: check out if there is a generic version of [WayBackA multi index container: TIndexedStore – Martin C Harvey’s Software Pages anywhere.

Edit 20191220 (thanks Thaddy!) article moved to [WayBack] A multi index container: TIndexedStore – Martin C Harvey’s Pages.

For instance as part of:

The original library has source code in a [WayBack] zip file.

Edit 20191220 (thanks Thaddy!) download moved to [WayBack] IndexedStore.zip.

I got there via:

–jeroen

Posted in Delphi, Development, Software Development | 5 Comments »

Links to debugging COM stuff for Office Automation in Delphi

Posted by jpluimers on 2019/11/12

From a long time ago, but recently I needed them again.

Note the .NET side is much much harder Revisited from the .NET side: Why doesn’t WINWORD.EXE quit after Closing the document from Delphi? (via: Stack Overflow).

[WayBack] Why doesn’t WINWORD.EXE quit after Closing the document from Delphi? – Stack Overflow

Read the rest of this entry »

Posted in Delphi, Development, Office Automation, Software Development | 2 Comments »

Working in a team? DprojSplitter might be helpful! | The Art of Delphi Programming

Posted by jpluimers on 2019/11/12

Reminder to self: split off the user settings from a Delphi .dproj so only the non-user settings get into your version control system.

Some of you are probably already using my DprojNormalizer plugin for Delphi, which tries to reduce the unwanted differences disturbing your version control system. It does this by forcing a dedicat…

So what about them?
DprojSplitter handles the current build configuration and current platform. In addition these settings are handled, too (found in CommonOptionStrs):

sDebugger_RunParams,
sDebugger_RemoteRunParams,
sDebugger_HostApplication,
sDebugger_RemotePath,
sDebugger_RemoteHost,
sDebugger_EnvVars,
sDebugger_SymTabs,
sDebugger_Launcher,
sDebugger_RemoteLauncher,
sDebugger_IncludeSystemVars,
sDebugger_UseLauncher,
sDebugger_UseRemoteLauncher,
sDebugger_CWD,
sDebugger_RemoteCWD,
sDebugger_RemoteDebug,
sDebugger_DebugSourcePath,
sDebugger_LoadAllSymbols,
sDebugger_LoadUnspecifiedSymbols,
sDebugger_SymbolSourcePath

Source: [WayBackWorking in a team? DprojSplitter might be helpful! | The Art of Delphi Programming

via: [WayBack] Oops! I did it again! This is my new IDE plugin – again targeted on dproj files. – Uwe Raabe – Google+

–jeroen

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

PowerShell: fixing `Get-HotFix` having empty `InstalledOn` entries

Posted by jpluimers on 2019/11/12

On some systems, Get-HotFix has many entries with an empty InstalledOn column.

This at least shows there is a date-format difference, but now the Source column is empty.:

Get-HotFix | Select-Object Source,Description,HotfixID,InstalledBy,InstalledOn,@{Name="InstalledOnValue";Expression={$_.psbase.properties["InstalledOn"].Value}} | Out-GridView

I contemplated using Microsoft.Update.Session in the scripts below, but it requires WinRM, the server side implementation of WS-Management – Wikipedia:

[ERROR] [DevMachine] Connecting to remote server DevMachine failed with the following
[ERROR] error message : The client cannot connect to the destination specified in the
[ERROR] request. Verify that the service on the destination is running and is accepting
[ERROR] requests. Consult the logs and documentation for the WS-Management service run
[ERROR] ning on the destination, most commonly IIS or WinRM. If the destination is the
[ERROR] WinRM service, run the following command on the destination to analyze and conf
[ERROR] igure the WinRM service: "winrm quickconfig". For more information, see the abo
[ERROR] ut_Remote_Troubleshooting Help topic.
[ERROR] + CategoryInfo : OpenError: (DevMachine:String) [], PSRemotingTr
[ERROR] ansportException
[ERROR] + FullyQualifiedErrorId : CannotConnect,PSSessionStateBroken

This is a reminder to find and document a proper fix for this.

This at least works:

Get-HotFix | Select-Object Source,Description,HotfixID,InstalledBy,InstalledOn,@{Name="InstalledOnDateTime";Expression={[System.DateTime]::Parse($_.PSBase.Properties["InstalledOn"].Value,[System.Globalization.CultureInfo]::GetCultureInfo("en-US"))}} | Out-GridView

Some links that hopefully help with proper documenting it:

–jeroen

Read the rest of this entry »

Posted in CommandLine, Development, PowerShell, PowerShell, Scripting, Software Development | Leave a Comment »

Tech Debt by MonkeyUser

Posted by jpluimers on 2019/11/07

[WayBack] Tech Debt (by MonkeyUser: Software development satire) is one of the best images on Tech Debt I ever encoutered (via[WayBack] Tech Debt by @ismonkeyuser https://www.monkeyuser.com/2018/tech-debt – ThisIsWhyICode – Google+):

–jeroen

Posted in Agile, Conference Topics, Conferences, Development, Event, Software Development, Technical Debt | Leave a Comment »

UMass Amherst CICS Distinguished Lecture: Daniel Jackson (MIT) “Towards a Theory of Software Design”

Posted by jpluimers on 2019/11/07

A brilliant lecture, worth the 1+ hour watching: UMass Amherst CICS Distinguished Lecture: Daniel Jackson (Massachusetts Institute of Technology) “Towards a Theory of Software Design”

[WayBackTowards a Theory of Software Design

Abstract:  Engineers make things work reliably and efficiently; designers make them useful. In the development of buildings, for example, the civil engineer is concerned with the internal structural that prevents the building from falling down; the designer (i.e., the architect) is concerned with the aspects of the building (light, space, etc.) experienced by its users.

I like how his group tags these to a concept part:

  • name
  • purpose
  • sample uses
  • mechanisms
  • variants
  • misfits
  • related to

During the talk there are many examples from common usage patterns and especially misfits. They range from file-sharing (like dropbox), selection and selection application (files/folders, designer objects) via option selection to the tool we all hate and love: git (more on that tomorrow).

–jeroen

via: [WayBack] Interesting talk about software design. – Asbjørn Heid – Google+

Read the rest of this entry »

Posted in Development, Software Development | Leave a Comment »

How to convert a Delphi enum or set to a JSON value, with different specific values…

Posted by jpluimers on 2019/11/07

As I will probably need this one day: [WayBack] How does one convert a Delphi enum to a JSON value, with different specific values? – CHUA Chee Wee – Google+:

eg, TEnum1 = (test1, test2, test3)

TSomeClass.FEnum := test1;

When converted to JSON, I’d like to see maybe
{"Enum": "Value1"} instead of test1

and test2 to "Godzilla", test3 to "Tiburon"

The solution is in his repository: github/chuacw/EnumJson:

After initially suggesting to look into [Archive.is] Serializing User Objects – RAD Studio, he based his solution on a set of clever tricks circumventing Delphi compiler limitations and bugs:

Later he extended the solution to include sets in additions to enums: [Archive.is] Persisting enumeration and sets to JSON – Chee Wee’s blog: IT solutions for Singapore and companies worldwide (via [Archive.isMade my JSON interceptor demo public. Now you can save your enum and sets to JSON, with customized output to boot! – CHUA Chee Wee – Google+)

Clever!

Hopefully this got Lars Fosdal some ideas to solve [WayBackJSON in Berlin – Can I persuade TJSon to treat “params” as it was a string and not an object for the TJsonRPC class? – Lars Fosdal – Google+

Enums with Delphi

Enums with Delphi and their mapping is a repeating topic, see for instance [WayBack] What’s the easiest (ie., least coding) way to map an enum to a const string and vice versa? (Can attributes be used on enum values yet?) eg., type TMyColor… – David Schwartz – Google+

It shows how much the Delphi language is in need of language enhancements as right now there are way too many open source libraries struggling with the same issues each working around them or providing solutions in slightly different way.

Three things immediately come to mind:

  • the NameOf that – analogous to TypeOf – gets the name of an identifier as a string
  • expose all RTTI for all enum types (especially the ones with non-contiguous values or starting at another value than ordinal zero)
  • allow for attributes on enum values

Some examples of libraries providing enumeration support:

Some more thoughts from a different perspective: [WayBackWhat’s New in Edge Rails: Active Record enums

–jeroen

Read the rest of this entry »

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

Software quality: economics of formality

Posted by jpluimers on 2019/11/06

Interesting read: [WayBackSoftware quality: economics of formality

At one time formal methods were thought to be the only hope for software development. That did not turn out to be the case.

Via: [WayBack] Software quality is better in practice than in theory. Formal methods improve software quality, but at a high cost that is sometimes worthwhile and some… – Jeroen Wiert Pluimers – Google+

Comment there:

Pedro Marcal:

+Jeroen Wiert Pluimers +John Cook , I think that when a code has been in service for even a short time, we can divide the code into two classes. The first is that part that has been executed at least once. The other code has never been executed. The latter code has an error rate that may be measured as a function of the language used. In the old days Fortean had a bug in every seven lines. C used to be 100 to 200 lines. We set up instrumentation to determine the number of lines tested in the first class and found that it was a linear function of the new bugs found. This was a good way to ensure a high quality code.

Related:

–jeroen

Posted in Agile, Code Quality, Development, Software Development | Leave a Comment »

Changing the order of TabSheets in a PageControl in Delphi – twm’s blog

Posted by jpluimers on 2019/11/06

Good to know this as the Structure View sometimes lets me down: modify the PageIndex position as it is less stable than the Object Treeview in Delphi 7 and below.

Via:

–jeroen

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