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 2,096 other followers

Current state: still fighting the metastases of the rectum cancer; chemos are done, major liver surgery in about 3 weeks

Posted by jpluimers on 2020/08/23

A long follow-up of Current state: still fighting with rectum cancer, but chances for better quality of life which does not even include everything, because so much happened.

So this is the current state; browse back via Twitter for more of the history which you can find at [Archive.is] Jeroen Pluimers on Twitter: “Too much to let sink in …” and [Archive.is] Jeroen Pluimers (@jpluimers) | Twitter.

Too much to let sink in, not just about the hospital results and upcoming surgery, but also about Cindy and Danny Thorpe who just lost their house in the California forest fires, despite it being on the humid side of the Santa Cruz mountains.
If you can help anybody affected by the #CZULightningComplex, please do. Many families there are going through a rough time for the foreseeable future especially because of the combination of fires and COVID.
If you are in that area: be careful, be safe.
For me it is mixed emotions time.
The chemo did make the cancer operable. Some tumors have shrunken, a few small ones are invisible, probably because of the chemo-induced hepatic steatosis, and no new tumor were found.
The prolapse has grown big: extended it is at least 10cm of bowel pushing itself outside of the abdomen causing many stoma leaks (5 full ones in 2 weeks time and 2 almost ones yesterday).
The good news is that it means there is hardly any intestinal adhesion.
The bad news: it takes 4-8 hours a day (of which 1-2 hours during the night) pushing the bowel back into the stoma so the output opening becomes unblocked and the poo can get out.
Though a temporary situation, this eats a lot of energy.
It means I need to find a way to keep my body in shape to prepare for surgery which is in 3-4 weeks (likely mid September).
The surgery will be tough as it will focus on 2 things:
  1. Removing areas of of the liver where the tumors are and were (which is about 30-50% of the liver).
  2. Likely remove the gallbladder, to minimise the chance of bile leakage (which is devastating when it gets into the abdomen)

    (Good news: no chance to get gallstones)

  3. repair the small intestine and remove the stoma.
It is going to be bloody surgery (because of the liver part) taking some 4 hours or more, likely ending up in the IC because the post-surgery risks.
This scares the hell out of me.
In addition recovery will take a long time, and even longer for liver tissue growing back (it will never reach 100%, but should be much more than 50% in a few years time).
I also need to re-learn how to poop, which likely means back to diaper age for quite a while.
So all of this means I feel very confused. Glad on the one side because I will loose the cancer and the stoma, but mixed about the risks and recovery.
More later.

–jeroen

Via [Wayback] Thread by @jpluimers on Thread Reader App: Too much to let sink in, not just about the hospital results and upcoming surgery, but also about Cindy and @danny_thorpe who just lost their house in the California forest fires…

Posted in About, Personal | 1 Comment »

The biggest lie I tell myself is not about new years resolutions.

Posted by jpluimers on 2019/01/01

The biggest lie I tell myself is “I don’t need to write that down, I’ll remember it”

It’s likely older, but the oldest reference I could find was 2012 [WayBack].

So before I forget:

Happy New Year everyone!

With the above quote, it is no coincidence I started my blog even earlier (in 2009): it’s my off-line memory, way better readable than my hand-writing and indexed by various search engines.

Read the rest of this entry »

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

From Delphi 1: Type Compatibility and Identity

Posted by jpluimers on 2020/09/30

A feature overlooked by many Delphi programmer was already introduced in Delphi 1 which is more or less the same as in the Delphi 2007 documentation at [WayBack] Type Compatibility and Identity.

There is a distinction between these explained in the above link:

type
  TMyInteger1 = Integer;
  TMyInteger2 = type Integer;

Where TMyInteger1 is an alias for Integer, TMyInteger2 introduces a new type which is distinct from Integer and TMyInteger. That way the compiler can set them apart, and even generates separate RTTI (Run-Time TypeInformation) for them.

Probably the most used distinct types are these:

TDateTime = type Double;
...
TDate = type TDateTime;
TTime = type TDateTime;
TFontName = type string

These are unlike TColor which is defined as “just” a subrange of Integer, but because it is a subtype, also gets a distinct type:

TColor = -$7FFFFFFF-1..$7FFFFFFF;

Type identity is important because Delphi 1 introduced these mechanisms:

  • the streaming instances and their properties
  • editing instances and properties in the object inspector
  • two way binding of designer (form/datamodule/frame/…) and the underlying Pascal source

Without them, very basic Delphi features would not work.

In addition, a lot of other RTTI based code now enables features like object relational mapping, binding to JSON/XML and many others.

What I did not know is that the Pascal and Delphi type systems have been heavily influenced by ADA. Luckily Lutz Donnerhacke pointed me to ADA [WayBack] Types and Subtypes.

Example

I made an example Distinct type types in Delphi · GitHub showing the differences on RTTI level in these properties:

property IntegerProperty: Integer read FIntegerField write FIntegerField;
property ColorProperty: TColor read FColorField write FColorField;
property DoubleProperty: Double read FDoubleField write FDoubleField;
property DateTimeProperty: TDateTime read FDateTimeField write FDateTimeField;
property DateProperty: TDate read FDateField write FDateField;
property TimeProperty: TTime read FTimeField write FTimeField;
property StringProperty: string read FStringField write FStringField;
property FontNameProperty: TFontName read FFontNameField write FFontNameField;

The generated table (see also the source below using [Archive.is] TRttiContext added in Delphi 2010) indeed shows distinct types on the RTTI level:

Name Type.Name Type.QualifiedName Type.TypeKind
IntegerProperty Integer System.Integer tkInteger
ColorProperty TColor System.UITypes.TColor tkInteger
DoubleProperty Double System.Double tkFloat
DateTimeProperty TDateTime System.TDateTime tkFloat
DateProperty TDate System.TDate tkFloat
TimeProperty TTime System.TTime tkFloat
StringProperty string System.string tkUString
FontNameProperty TFontName System.UITypes.TFontName tkUString

This post was inspired by an interesting discussion on [WayBack] What’s the technical term for the following construct: type intx = type integer; type inty = integer; What term would you use to describe the differen… – Johan Bontes – Google+

Documentation:

RTTI dump inspired by [WayBack] delphi – How can I distinguish TDateTime properties from Double properties with RTTI? – Stack Overflow.

–jeroen

Read the rest of this entry »

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

A series of Medium posts introducing functional programming in manageable bits and pieces

Posted by jpluimers on 2020/09/30

I have summarised the main topics of each part in this table of contents, and indicated at the time of writing which parts I did not get yet:

  1. [WayBack] So You Want to be a Functional Programmer (Part 1) – Charles Scalfani – Medium
    • pure functions (only operate on input parameters: without side effects)
    • immutability (no variables! loops through recursion)
  2. [WayBack] So You Want to be a Functional Programmer (Part 2) – Charles Scalfani – Medium
    • refactoring leads to the need of higher-order functions
    • higher-order functions: passing a function as a parameter, or returning functions as a result
    • closure: when a returned function has access to the captured parameter(s) of the function creating the returned function
  3. [WayBack] So You Want to be a Functional Programmer (Part 3) – Charles Scalfani – Medium
    • functional decomposition (I still need to wrap my head around this)
    • point-free notation (same)
    • both lead to currying (which I also need to wrap my head around)
  4. [WayBack] So You Want to be a Functional Programmer (Part 4) – Charles Scalfani – Medium
    • currying: when you want to combine functions having different parameter counts
    • refactoring based on currying (I still need to wrap my head around this)
    • map/filter/reduce functional building blocks (I still need to wrap my head around this)
  5. [WayBack] So You Want to be a Functional Programmer (Part 5) – Charles Scalfani – Medium
    • referential transparency (I still need to wrap my head around this)
    • execution order: in a pure functional language the compiler can determine the order when functions are completely independent
    • type annotation: I do not yet get why you would do without this
  6. [WayBack] So You Want to be a Functional Programmer (Part 6) – Charles Scalfani – Medium
    • Functional JavaScript and ELM: two functional languages, of which Ramba can help make better JavaScript code

Via: [WayBack] So You Want to be a Functional Programmer (Part 1) Link to part 2 in the article. https://medium.com/@cscalfani/so-you-want-to-be-a-functional-programm… – Lars Fosdal – Google+

–jeroen

Posted in Development, Functional Programming, Software Development | Leave a Comment »

When your ORM does not support string concatenation by || or + operator…

Posted by jpluimers on 2020/09/30

If your ORM does not support string concatenation by operator (standard double pipe || or non-standard plus +), you can usually revert to the CONCAT function.

Very often, the CONCAT function supports more than 2 parameters.

References:

–jeroen

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

When did we stop caring about memory management? – Scott Hanselman

Posted by jpluimers on 2020/09/29

Still relevant [WayBack] When did we stop caring about memory management? – Scott Hanselman

Via: [WayBack] Jeroen Wiert Pluimers – Google+

–jeroen

Read the rest of this entry »

Posted in Development, Software Development | Leave a Comment »

variables – What is “_,” in a Golang declaration? – Stack Overflow

Posted by jpluimers on 2020/09/29

As a (then) go lang n00b, the less upvoted answers helped me e lot: [WayBack] variables – What is “_,” in a Golang declaration? – Stack Overflow:

  • The Go compiler won’t allow you to create variables that you never use.

    for i, value := range x {
       total += value
    }

    The above code will return an error message “i declared and not used”.

    Since we don’t use i inside of our loop we need to change it to this:

    for _, value := range x {
       total += value
    }
  • _ is the blank identifier. Meaning the value it should be assigned is discarded.

    Here it is the value of example key that is discarded. The second line of code would discard the presence boolean and store the value in prs.
    So to only check the presence in the map, you can discard the value. This can be used to use a map as a set.

–jeroen

Posted in Development, Go (golang), Software Development | Leave a Comment »

 
%d bloggers like this: