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,860 other subscribers

Archive for December, 2020

Getting confused with the many YouTube subdomains and first level paths

Posted by jpluimers on 2020/12/28

Just a short list, as there are many more (see zzz and zzz), and the vast amount in the longer lists confuses me:

So the ones I use are below; are there any interesting ones missing?

These I hardly use in the below list, anyone using them often?

Most ad blockers block ads.youtube.com, so I never see it.

–jeroen

Posted in Power User, SocialMedia, YouTube | Leave a Comment »

Syncopation in pop/rock music – Open Music Theory

Posted by jpluimers on 2020/12/25

Because this is explained the basics of off-beat rhytms so well: [WayBack] Syncopation in pop/rock music – Open Music Theory:

Of course there are way more complicated things to do with it, so if you are into that, read the links below.

But if you are new, then listen and watch to the first video below the fold.

More advanced:

Oh, and I learned about bouncy metronome, which is a great tool on Windows:

–jeroen

Read the rest of this entry »

Posted in About, Adest Musica, LifeHacker, Music, Personal, Power User | Leave a Comment »

Mariuz’s Blog: Understanding Debian: The Universal Operating System

Posted by jpluimers on 2020/12/25

Blast from the past: [WayBack] Mariuz’s Blog: Understanding Debian: The Universal Operating System.

Small image below; large image: [WayBackinfographic_debian.png.

Via [WayBack] Adrian Marius Popa – Google+

–jeroen

Posted in *nix, Debian, Linux, Power User | Leave a Comment »

Jira “Preformatted” is not “Preformatted”

Posted by jpluimers on 2020/12/25

Found out that Jira has its own markdown for issues and comments.

I knew the editor for it has a Style drop down with a “Preformatted” entry.

Initially, pasted text looks preformatted, but after saving the issue or comment, often all or part of that text did either:

  • did not display as preformatted
  • had curly braces around them

A co-worker indicated the plus sign on the right can insert blocks (I thought that while it was next to inserting emoticons, it was for inserting unicode symbols like plus).

Alas, no: it is for adding things that are not symbols at all, and too has a “Preformatted” entry.

For sake of consistency, both “Preformatted” entries produce different markup.

The “Style” entry of “Preformatted” basically surrounds all lines with curly braces, then upon saving tries to do some interpretation and removes parts.

The “Plus” entry of “Preformatted” surrounds a block of lines with {noformat} entries at start of end.

Then there is the “Code” entry under “Plus”. It insert a code block, does not allow you to select the language, but assumes everyone loves programming in Java, as now the surrounding entries are {code:java} at the start and {code} at the end. The default block is this one in “Visual” mode:

{code:java}
// code placeholder
{code}

and this one in “Text” mode:

Read the rest of this entry »

Posted in Development, Issue/Bug tracking, JIRA, Power User, Software Development | Leave a Comment »

Electronics-Salon DIN Rail Mount +/-20Amp AC/DC Current Sensor Module, based on ACS712: Amazon.com: Industrial & Scientific

Posted by jpluimers on 2020/12/24

For my link archive (this DIN rail device allow sensing current used by a circuit; models for 5A/20A/30A).

Thanks Matthijs ter Woord for pointing me to this.

Schematics show it uses an LM317 linear voltage regulator (to get 5V out of a 8V-35V range) next to the ACS712 current sensor (based on the [WayBack] Hall effect) available in 5A, 20A and 30A varieties.

Documentation:

Schematics:

 

Read the rest of this entry »

Posted in Development, Hardware, Hardware Development, Hardware Interfacing | Leave a Comment »

Essential versus Accidental Complexity: 2 minute Kevlin Henney video and some links

Posted by jpluimers on 2020/12/24

The topic is as old as the 1986 “No Silver Bullet” book, still relevant, but few people are consciously aware of the difference of these fundamental ideas:

Essential versus Accidental Complexity

TL;DR:

  • Essential complexity is the problem you try to solve
  • Accidental complexity is the problems you have created while solving

The first is what it is all about (it is in your problem domain, and not reducible); the second is what you want to minimise, like technical debt, size effects of quick fixes, bad tool/framework/language choices, long feedback loops.

2 minute video:

Related:

Via:

–jeroen

Read the rest of this entry »

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

Is this code safe? function Some(const Str : AnsiString); var arr : TBytes …

Posted by jpluimers on 2020/12/24

[WayBack] Is this code safe? function Some(const Str : AnsiString); var arr : TBytes absolute Str; begin fSomeMethodWithTBytesParam(arr); <- arr is properly c… – Jacek Laskowski – Google+

Such a seemingly simple question:

Is this code safe?

procedure Some(const Str : AnsiString); 
var arr : TBytes absolute Str; 
begin
  fSomeMethodWithTBytesParam(arr); // <- arr is properly casted to string bytes? 
end;

Such a wealth of information in the comments:

  • No it is not, except for the nil-pointer case
  • The compiler has for instance an implicit length prefix
  • In 32-bit mode, the Length prefix of strings and dynamic arrays are both 32-bits
  • In 64-bit mode, the Length prefix of strings is 32-bits, but the one for dynamic arrays is 64-bits
  • use BytesOf to transform from characters to bytes
  • do not store binary data into strings of single-byte character sets

–jeroen

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

PlasticSCM memories

Posted by jpluimers on 2020/12/23

Spending most of your career as an independent contractor, you bump into a lot of toolchains.

Part of those toolchains usually involved (and by now surely should involve) version control for both development and infrastructure configuration management.

I remember PlasticSCM quite well.

The really good part is the branch overview (called Branch Explorer) in the PlasticSCM UI, as it is:

They also have frequent updates, which however are hard to discover because there is no built-in update mechanism that notifies you of them.

Those updates are badly needed, because I kept bumping into bugs. Which is odd, because I bumped into far less issues when using UI layers for SVN, TFS, Mercurial and git (SourceTree being a major exception, but they seem to have recovered from a long period of bad versions a few years back).

So here are some of my gripes, that might have been fixed by now.

Read the rest of this entry »

Posted in Delphi, Development, PlasticSCM, Software Development, Source Code Management, Versioning | Leave a Comment »

Some links on MS UIA: UI Automation

Posted by jpluimers on 2020/12/23

For my link archive:

A Delphi implementation:

–jeroen

Posted in accessibility (a11y), Development, Software Development | Leave a Comment »

How to debug Delphi JSON export stack-overflows: watch the fields and their circular references

Posted by jpluimers on 2020/12/23

Unlike Delphi RTL XML support which is property based, the JSON support is field based.

By default, JSON uses all fields (no matter their protection level, so anything from strict private to published  is taken into account).

When there are cycles, they are not detected: it will just stack-overflow with a high set of entries like this:

REST.JsonReflect.{REST.JsonReflect}TTypeMarshaller.MarshalSimpleField($788BFB40,$78AB0150)
REST.JsonReflect.{REST.JsonReflect}TTypeMarshaller.MarshalData($78AB0150)
REST.JsonReflect.{REST.JsonReflect}TTypeMarshaller.MarshalValue((($A9B7E8, Pointer($AFE168) as IValueData, 80, 336, 2024472912, $78AB0150, TClass($78AB0150), 80, 336, 2024472912, 2,77471682335019e+34, 1,00022251675539e-314, 0,00000000737961e-4933, 2024472912, 202447,2912, 2024472912, 2024472912, ($78AB0150, nil), $78AB0150)),???)
REST.JsonReflect.{REST.JsonReflect}TTypeMarshaller.MarshalSimpleField($78A921D0,$78AA69C0)
REST.JsonReflect.{REST.JsonReflect}TTypeMarshaller.MarshalData($78AA69C0)
REST.JsonReflect.{REST.JsonReflect}TTypeMarshaller.Marshal(???)

The easiest way to debug this is to:

  1. Set breakpoints in procedure TTypeMarshaller<TSerial>.MarshalData(Data: TObject);
    1. First breakpoint on the for rttiField loop
      • Watch or log these values (the first two usually are the same, the last two too):
        1. ComposeTypeName(Data) which gives you the fully qualified name (including unit and class) of the type exposing the fields
        2. Data.ClassName as a sanity check
        3. rttiType.Name which should be the same as Data.ClassName
    2. Second breakpoint inside the for rttiField loop on the if not ShouldMarshalstatement
      • Watch or log these values:
        1. rttiType.Name inside the loop, it changes value to match rttiField.Name, because of a debugger bug not showing it as E2171 Variable 'rttiType' inaccessible here due to optimization.
        2. rttiField.Name the actual field name

Tricks to circumvent circular references:

  • remember that fields with a reference to function value are not marshaled, so they are an excellent way of shoehorning in a dependency in (the reference value will be a capture which includes the instance data of the function to be called)
  • applying a [JsonMarshalled(False)] attribute (be sure to use unit REST.Json.Types!) only works when used inside non-generic types:
    • a class like TMySoapHeaderValue<T: IInterface> = class will not expose these attributes
    • a class like TMySoapHeaderValue = class will expose these attributes

You can check the JsonMarshalled problem by setting a breakpoint inside function LazyLoadAttributes(var P: PByte): TFunc<TArray<TCustomAttribute>>; on the line Exit(nil); and watch the value for Handle^.

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