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 September, 2019

C# (and presumably Delphi): why parameterless record constructors are absent

Posted by jpluimers on 2019/09/12

For my link archive.

Full text at: [WayBack] … why the Delphi language does not allow parameterless constructors… – David Heffernan – Google+

Abstract:

+Stefan Glienke deleted his post about parameterless record constructors, presumably due to all the off topic comments.

.net at CLR level does allow parameterless constructors on structs. But the C# language bans them: https://msdn.microsoft.com/en-us/library/saxz13w4.aspx

Jon Skeet posted an answer on SO way back in 2008 on this topic: http://stackoverflow.com/a/333840/ From that answer:

—-
The CLR allows value types to have parameterless constructors, but C# doesn’t. I believe this is because it would introduce an expectation that the constructor would be called when it wouldn’t. For instance, consider this:

MyStruct[] foo = new MyStruct[1000];


—-

My guess is that Embarcadero decided to ban parameterless constructors on Delphi records for the same reason. Or perhaps they just copied the rules from C# without realising that the CLR supported parameterless struct constructors.

References:

--jeroen

Posted in .NET, C#, Delphi, Development, Jon Skeet, Software Development | Tagged: | Leave a Comment »

delphi: you can only access protected identifiers from parent classes in your own “Self” scope, or when you are “friends” with your parent (so you are in the same unit)

Posted by jpluimers on 2019/09/11

An interesting question from a while back: [WayBack] delphi – Should a descendant class’ method’s variable that is identical to Self, have access to its ancestor’s protected methods? – Stack Overflow

In unit A:

TParent = class
protected
  function DoSomething: TParent;
end;

In unit B:

TChild = class(TParent)
public
  procedure DoAnotherThing;
end;

implementation

procedure TChild.DoAnotherThing;
begin
  DoSomething.DoSomething
end;

This won’t compile, throwing a

cannot access protected symbol TParent.DoSomething

The kicker here is that the error message makes you think you are operating in Self context, but you are not as you are calling DoSomething.DoSomething where only the first DoSomething is in your Self context, but the second .DoSomethingis in the context of any TParent instance trying to access a public identifier.

Stefan Glienke posted [WayBack] a more elaborate answer explaining some workarounds.

–jeroen

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

Bouncer – Temporary App Permissions (Beta) – Apps on Google Play

Posted by jpluimers on 2019/09/11

Bouncer gives you the ability to grant permissions temporarily.

Want to tag a location or take a photo, but don’t want that app to be able to use the camera or get your location whenever it wants?

Bouncer gives you exactly that.As soon as you exit the app,

Bouncer will automatically remove the permission for you in an instant so you can get back to doing what you do best, without having to worry about apps invading your privacy and wasting your battery.

  • Increased security, privacy and battery life
  • Never have to worry what apps are doing in the background
  • No complicated setup needed (no root or adb)

Get it at [WayBack] Bouncer – Temporary App Permissions (Beta) – Apps on Google Play

Via:

–jeroen

Posted in Android Devices, Power User | Leave a Comment »

Firebird: RDB$RELATIONS.RDB$RELATION_TYPE and when it can be null

Posted by jpluimers on 2019/09/11

The RDB$RELATIONS.RDB$RELATION_TYPE was introduced in Firebird 2.1 with these enumeration values:

enum rel_t {
    rel_persistent = 0,
    rel_view = 1,
    rel_external = 2,
    rel_virtual = 3,
    rel_global_temp_preserve = 4,
    rel_global_temp_delete = 5
};

You should access it assuming NULL means zero (0), so you better treat it using [WayBackCOALESCE() like COALESCE(RDB$RELATIONS.RDB$RELATION_TYPE, 0).

Background information:

–jeroen

Posted in Database Development, Development, Firebird | Leave a Comment »

Is there a way to use the JVCL’s TJvXxxAppStorage to store float values as s…

Posted by jpluimers on 2019/09/10

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 s… – Thomas Mueller (dummzeuch) – Google+

Relevant sources:

–jeroen

 

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

MS Paint IDE

Posted by jpluimers on 2019/09/10

Oh boy:

Ditch IDEs like Intellij and glorified text editors like Eclipse, and switch to a real IDE, MS Paint.

It wraps around MS Paint.

You can get it at [WayBack] MS Paint IDE and source code at [WayBack] GitHub – RubbaBoy/MSPaintIDE: Programming in MS Paint.

A long thread discussing it, including a tutorial: [WayBack] Resource – Programming in MS Paint [UPDATED] | SpigotMC – High Performance Minecraft

–jeroen

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

GitHub – slikts/js-equality-game: The Worst Minesweeper 💣 Ever

Posted by jpluimers on 2019/09/10

[WayBack] GitHub – slikts/js-equality-game: The Worst Minesweeper 💣 Ever:

It’s in response to claims like this one by the well-known author getify:

However, implicit coercion is a mechanism that can be learned, and moreover should be learned by anyone wishing to take JavaScript programming seriously. Not only is it not confusing once you learn the rules, it can actually make your programs better! The effort is well worth it.

You can play it on [WayBack] JavaScript Equality Table Game: Find out how well you know (or don’t know) the JavaScript == operator rules

It reminds me of the hilarious video on Wat – Destroy All Software Lightning Talk : Gary Bernhardt : Free Download, Borrow, and Streaming : Internet Archive 

Based on:

Via:

–jeroen

Posted in Development, JavaScript/ECMAScript, Scripting, Software Development | Leave a Comment »

What do the three arrow (“>>>”) signs mean in python?

Posted by jpluimers on 2019/09/10

When starting to work with Python, a lot of examples contain the >>> characters on the first line often followed by ... characters on continuing lines.

They are about two things:

  1. interactive Python sessions
  2. doctest

The answers in [WayBackWhat do the three arrow (“>>>”) signs mean in python? give insight in the various Python versions and how they prompt.

References from them:

–jeroen

Posted in Development, Python, Scripting, Software Development | Leave a Comment »

Jim Rohn: You’re The Average Of The Five People You Spend The Most Time With – Business Insider

Posted by jpluimers on 2019/09/09

Interesting point of view: [WayBack] Jim Rohn: You’re The Average Of The Five People You Spend The Most Time With – Business Insider

From quite a while ago, via [WayBack] Select your friends and working partners wisely! “You are the average of the 5 people you spend the most time with.” – Jim Rohn – Marjan Venema – Google+

–jeroen

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

Two Principles for Scaling Any Agile Approach – Spikes And Stories

Posted by jpluimers on 2019/09/09

Food for thought:

Let’s put aside frameworks for the moment and focus on the principles of scaling any agile approach. Why should we scale? When?

TL;DR

  • Make it work before you make it scale
  • Strive for simplicity

Source: [WayBack] Two Principles for Scaling Any Agile Approach – Spikes And Stories

Via [WayBack] Two Principles for Scaling Any Agile Approach – Spikes And Stories – Marjan Venema – Google+

–jeroen

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