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

Archive for 2019

regex – How to write a search pattern to include a space in findstr? – Stack Overflow

Posted by jpluimers on 2019/12/13

TL;DR:

  1. If you use regular expressions (/R) with FINDSTR, then pass them as /C:"regular-expression-string"
  2. If you forget the /C: the string will be used as a normal search string
  3. If you forget the : after the /C you will get an informal error, but the search will continue giving you wrong results

Details in [WayBackregex – How to write a search pattern to include a space in findstr? – Stack Overflow

–jeroen

Posted in Power User, Windows | Leave a Comment »

Hiding your number when calling from an Android phone

Posted by jpluimers on 2019/12/13

Via [WayBack] This was well hidden outside the regular Anrdoid settings I was trying at first. You need to start with the stock Android phone app, then go to settings… – Jeroen Wiert Pluimers – Google+.

The steps are in the images below, starting from the stock Android phone dialing app.

It helped solving this problem:

[WayBack] Twitter thread

@jpluimers: A friend of mine cannot receive anonymous calls: his #OnePlusOne on @KPNwebcare with latest Android available for it does not ring, not even in safe mode. But calls do appear in recent calls list. This used to work in the past months ago. Any tips?

@KPNwebcare: I suggest he try his SIM-card in a different phone to determine if the problem persists. This helps us figure out if the problem is related to the or our network. If the problem remains then I recommend that your friend contacts us directly!

@jpluimers: OK. I will assist him doing this. Thanks!

@jpluimers: Thanks for the offer. Enjoy your weekend. Somehow it’s the device. To be continued…

@jpluimers: After trying to reset many individual settings, the only thing that worked was a complete phone reset then restore apps from backup. Of course not all apps backup just as well, but that got us 90% with only 10% of manual configuration left. Phew (: And thanks for helping us out.

–jeroen

Read the rest of this entry »

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

Borland’s legendary development tools…

Posted by jpluimers on 2019/12/12

From [WayBack] Borland’s legendary development tools Do you remember Turbo Languages from Borland? There are Pascal, C, Assembler, Basic, Prolog and many other produc… – Jaroslav Beran – Google+:

Borland’s legendary development tools

Do you remember Turbo Languages from Borland? There are Pascal, C, Assembler, Basic, Prolog and many other products. Here there is link to directory containing original documentation of many these products:

http://bitsavers.informatik.uni-stuttgart.de/pdf/borland/

Did you work with some of them? Which one was your favorite?

[WayBack] Bitsavers Index of /pdf/borland:

[ICO] Name Last modified Size Description

[DIR] Ads/ 2011-09-01 20:47
[ ] BRIEF_for_DOS_and_OS2_Version_3.1_Users_Guide_1992.pdf 2009-06-30 22:57 8.9M
[ ] Borland_Brochure_1987.pdf 2009-11-05 02:18 2.1M
[ ] Borland_Turbo_BASIC_Owners_Handbook_1987.pdf 2009-07-30 05:33 15M
[ ] Eureka_The_Solver_Owners_Handbook_1987.pdf 2011-03-20 23:56 8.5M
[ ] Superkey_Owners_Handbook_1986.pdf 2011-02-04 02:01 7.1M
[ ] Turbo_Languages_Brochure_1988.pdf 2011-01-25 04:26 4.0M
[ ] Turbo_Vision_Version_2.0_Programming_Guide_1992.pdf 2010-06-18 19:07 25M
[ ] Windows_API_Guide_Reference_Volume_1_1991.pdf 2009-07-01 03:16 28M
[ ] Windows_API_Guide_Reference_Volume_2_1991.pdf 2009-07-01 03:16 8.7M
[ ] Windows_API_Guide_Reference_Volume_3_1992.pdf 2009-07-01 03:17 24M
[DIR] borland_C++/ 2013-01-17 00:07
[DIR] objectvision/ 2011-06-06 23:47
[DIR] paradox/ 2011-06-06 23:43
[DIR] quatro/ 2014-12-11 03:04
[DIR] quatro_pro/ 2011-06-06 23:47
[DIR] reflex/ 2011-06-06 23:37
[DIR] sidekick/ 2011-06-06 23:38
[DIR] sprint/ 2011-06-06 23:42
[DIR] turbo_assembler/ 2013-01-17 00:07
[DIR] turbo_c/ 2011-06-06 23:37
[DIR] turbo_pascal/ 2011-09-01 19:23
[DIR] turbo_prolog/ 2011-06-06 23:43

Via: [WayBack] Borland’s legendary development tools Do you remember Turbo Languages from Borland? There are Pascal, C, Assembler, Basic, Prolog and many other produc… – Adrian Marius Popa – Google+

–jeroen

Read the rest of this entry »

Posted in Development, History, Pascal, Software Development, Turbo Pascal | Leave a Comment »

Every programmer should read this at their own pace: From design patterns to category theory

Posted by jpluimers on 2019/12/12

Slowly but steadily, I’m now ready to continue reading [WayBackFrom design patterns to category theory.

I found it two years ago after stumbling into [WayBack] Semigroups accumulate and [WayBack] Monoids accumulate. Both articles indicate they are part of two distinct series: [WayBack] Semigroups and [WayBack] Monoids which both in turn indicate the same super-series: [WayBack] Monoids, semigroups, and friends.

That intrigued me, as from a casual interest in Semigroups I got into a really structured coverage of many related topics leading all the way to design patterns. How cool is that!

Back than, I lacked some of the vocabulary I needed to fully grasp this, as part of the posts use the functional programming perspective which – for geeks like me that grew up in the procedural, object-oriented, and interface-polymorphism eras – takes some time to wrap their head around.

I did learn a thing or two back then, for instance the series taught me that some semigroups are not monoids. The diagram on the right shows how the various groups are related. But I could not replicate that knowledge, clearly lacking the words to explain it to myself.

What I really liked is the humble way in which the author – Mark Seeman – indicated that when he first thought about these topics himself, he too had still a lot of things to learn, including acquiring the vocabulary:

My first attempt at answering these questions was in 2010, but while I had the experience that certain abstractions composed better than others, I lacked the vocabulary. I’ve been wanting to write a better treatment of the topic ever since, but I’ve been constantly learning as I’ve grappled with the concepts.

Like me, he is on a life long quest in learning new things every day.

Now that I’ve done more functional programming (mainly from object-oriented code bases), I think I’m more equipped to digest his writings, better understand them and maybe even explain them.

By now there also should be more topics than these ones:

Time to do some reading over the next weeks…

–jeroen

Posted in Design Patterns, Development, Software Development | Leave a Comment »

Delphi ^A syntax: Documented, implied, or undocumented? – Stack Overflow

Posted by jpluimers on 2019/12/12

The syntax is documented. In the Turbo Pasal 3 documentation, i.e. the Z80 era.

Source my answer to [WayBackDelphi ^A syntax: Documented, implied, or undocumented? – Stack Overflow (I have added some WayBack Internet Archive links below) as it is from the Turbo Pascal era where the caret was introduced to support control characters:

This is from long ago as an escape character to enable you to have consts for control characters in a more readable way.
const
  CtrlC = ^C;
begin
  Write(Ord(CtrlC));
end.

This defines a Char constant with value #3, then writes 3 in Borland Pascal 7, and I remember seeing it years before that too.

I just checked the Turbo Pascal 5.0 and Borland Pascal 7.0 languages guides, but could not find it, so it seems undocumented.

Edit: I do remember this was a Borland thing, and just [WayBack] checked: it is not part of the ISO Pascal standard (formerly this was ANSI Pascal Standard, thanks Sertac for noticing this).

It [WayBack] is documented in the Free Pascal documentation [WayBack].

SGI uses the backslash as escape character, as per their docs [WayBack].

More Edit: I found it [WayBackdocumented in Delphi in a Nutshell and the [WayBackDelphi Basics site.

Found it: Just found it on page 37 of the Turbo Pascal 3 Reference Manual [WayBack].

(Marco van de Voort found the Free Pascal documentation)

It in fact originates in the 1984 Turbo Pascal 1 edition, as per the [WayBack] Turbo_Pascal_Reference_Manual_Feb84.pdf:

Read the rest of this entry »

Posted in Borland Pascal, Delphi, Development, FreePascal, History, Pascal, Software Development, Turbo Pascal, Z80 | 1 Comment »

Exceptional Safety

Posted by jpluimers on 2019/12/11

I think I tend to forget with [WayBack] Exceptional Safety is this:

object destruction process must not cause or raise any unhandled exceptions or you will have memory leaks beyond your ability to fix them.

Particulary, that means the BeforeDestruction method – and destructors themselves – must never ever allow exceptions to escape them. Any escaping exception there will always cause memory leak. Period.

–jeroen

via [WayBack] Single or nested try…finally blocks? None will prevent the memory leak if your destructors are broken. – Dalija Prasnikar – Google+

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

Node-RED

Posted by jpluimers on 2019/12/11

Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.

Seems one of the ways to automate our home: [WayBack] Node-RED, as it supports many input and output methods with all kinds of nodes between them:

input output
inject debug
catch
status
link link
mqtt mqtt
http http response
websocket websocket
tcp tcp
udp udp
serial serial

It is based on node.js, seems to need PM2 for running as a service, so I need to first figure out how well it runs on OpenSuSE (with more details than this gist).

After that I need to figure out how to version your configurations using git and document as it looks like the configurations sources are stored in JSON format [WayBack].

For resources:

  • StackOverflow node-red tag
  • Github node-red repositories
  • nodered documentation to:
    • get started (including Installation, Running, Adding non-stock Nodes, Upgrading, Creating your first and second flow, running on Docker / Windows)
      • running on a device (Raspberry Pi, BeagleBone Black, Android) which needs extra device specific modules to hardware inputs/outputs
      • communicating with a device (Arduino)
      • running in the cloud (IBM Bluemix, SenseTecnic FRED, Amazon Web Services, Microsoft Azure)
    • user guide (including Configuration, Security, Logging, Command-line Admin, Writing Functions, Embedding into an existing app)
    • cookbook (with many flows covering Basics, HTTP and MQTT)
    • creating nodes (with a wall of information: Creating your first node, JavaScript File, HTML File, Storing Context, Node properties, Node credentials, Node appearance, Node status, Configuration nodes, Help style guide, Packaging, Internationalisation)
    • flows (hundreds of them)

Code is published as JSON, but I wish more examples also showed the visual representation.

Via: [WayBack] Now I can go to bed :-) Added node-red [1] to my setup and thanks to node-red-contrib-ui [2] (replaced by node-red-dashboard [3]) I can now generate ni… – Jan Wildeboer – Google+ who also provided the large screenshot below.

–jeroen

Read the rest of this entry »

Posted in Development, Hardware Development, IoT Internet of Things, Network-and-equipment, Power User, Raspberry Pi | Leave a Comment »

Delphi/GDIPBitmap at master · tothpaul/Delphi · GitHub

Posted by jpluimers on 2019/12/11

Next time I don’t need something like TPngImage any more:

this little unit let you load any GDI+ supported graphic format (BMP, JPG, PNG or TIF) into a Delphi TBitmapit’s a TBitmap helper, so just add the unit to you’re project and call the method GDIPLoadFromStream

Source: Delphi/GDIPBitmap at master · tothpaul/Delphi · GitHub

Found via: [WayBack] Let’s extend TBitmap with a GDIP loader :) TBitmap.GDIPLoadFromStream can load any GDI+ supported format (JPEG, PNG, TIFF) https://github.com/tothpaul… – Paul TOTH – Google+

–jeroen

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

The ARC vs non-ARC situation adds yet another layer of complexity to creating cross platform code…

Posted by jpluimers on 2019/12/10

Interesting rant on the Delphi cross platform situation, for which this is a reminder to see how the current situation is after 2.5 years: [WayBack] The ARC vs non-ARC situation adds yet another layer of complexity to creating cross platform code. The Linux compiler uses ARC – while Windows and OSX don’t… – Lars Fosdal – Google+

–jeroen

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

If you have a gripe with nested if-then-else statements in any language, then usually it’s time to refactor some code…

Posted by jpluimers on 2019/12/10

Every time I run into complex nested if/then/else statement in any language with truckloads of code blocks, it usually means it is time to refactor in two steps:

  1. the code blocks into separate methods
  2. the decisions and methods into a polymorphic structure

Of course this adds some overhead, but usually you end up with code that is easier to unit-test and understand both the overall structure and detailed implementations of.

I’m all for language enhancements that allow deeply nested logic to be more manageable (for instance by enhancing a case construct), but usually refactoring makes that less of a need and more of a nice to have.

Via: [WayBackAnybody else have a gripe with nested if-then-else statements in Pascal? What if we had the following statement/syntax available in Pascal? … – Gerhard Venter – Google+

–jeroen

Posted in .NET, C#, Design Patterns, Development, Software Development | Leave a Comment »