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 4,262 other subscribers

Archive for September 11th, 2019

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 »