The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,854 other subscribers

elektronica-shop.nl :Montagedraad.html

Posted by jpluimers on 2020/01/03

The cool thing about elektronica-shop.nl is that they have [WayBackMontagedraad in various colours for most diameters:

A short list:

  • 0.14 mm2: rood/bruin/blauw/groen/geel/oranje/zwart/wit/grijs
  • 0.20 mm2: zwart/bruin/rood/oranje/geel/groen/blauw/paars/grijs/wit
  • 0.75 mm2: blauw/bruin/groen-geel/grijs/oranje/wit/violet(paars)/zwart/rood/geel/groen
  • 1.00 mm2: zwart/rood
  • 1.50 mm2: zwart/rood/blauw/bruin/groen-geel
  • 2.50 mm2: zwart/rood
  • 4.00 mm2: zwart/rood
  • 6.00 mm2: zwart/rood

Translations:

  • rood = red
  • bruin = brown
  • blauw = blue
  • groen = green
  • geel = yellow
  • oranje = orange
  • zwart = black
  • wit = white
  • grijs = grey/gray
  • paars = purple
  • violet = violet
  • groen-geel = green-yellow striped

The maximum current (Amperage) depend on the area through which the current can flow. It can be roughly translated from the AWG (American Wire Gauge). See the table below.

De AWG-code wordt met name in de elektrotechniek om de dikte van elektrische geleiders en de toebehoren daarvan, zoals adereindhulzen, kabelschoenen en -klemmen, aan te duiden.

AWG  -  mm²    -  mm

4   -  21       -   5.2
6   -  13       -   4.1
8   -    8       -   3.2
10   -    6       -   2.6
12   -    4       -   2
14   -    2.5    -   1.6
16   -    1.5    -   1.3
18   -    1       -   1
20   -    0.5    -   0.8
22   -    0.3    -   0.65
24   -    0.2    -   0.5
26   -    0.13  -   0.4
28   -    0.08  -   0.32
30   -    0.05  -   0.25

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

Apple Mac OS X / OS X / macOS versions and history graphs – Wikipedia

Posted by jpluimers on 2020/01/03

Based on [WayBackmacOS – Wikipedia and follow-up of OS X – the versions and their names – as I always forget them and osx – How to find out Mac OS X version from Terminal? (via: Super User)

Release history (with release dates):

The graph with Apple Mac OS X / OS X / Mac OS versions cannot do without a graph showing the BSD and Unix inheritance.

Graph origins:

More complete Mac OS X / OS X / Mac OS and Unix timelines are below from macOS version history – Wikipedia.

–jeroen

Read the rest of this entry »

Posted in Apple, Mac OS X / OS X / MacOS, Mac OS X 10.4 Tiger, Mac OS X 10.5 Leopard, Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion, macOS 10.12 Sierra, macOS 10.13 High Sierra, OS X 10.10 Yosemite, OS X 10.11 El Capitan, OS X 10.8 Mountain Lion, OS X 10.9 Mavericks, Power User | Leave a Comment »

python – Why does “return list.sort()” return None, not the list? – Stack Overflow

Posted by jpluimers on 2020/01/02

list.sort sorts the list in place, i.e. it doesn’t return a new list. Just write

newList.sort()
return newList

The above answer is goden as performing return list.sort() bytes me often, because Python is usually an environment using the functional approach.

Answer from [WayBack] python – Why does “return list.sort()” return None, not the list? – Stack Overflow

Background information:

–jeroen

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

Delphi Programming Blog (by Shaun Roselt): Delphi Communties on: WhatsApp, Telegram, Google+, Facebook

Posted by jpluimers on 2020/01/02

From a while ago by a young (then ~18, now around ~20) enthusiastic Delphi programmer: [WayBackDelphi Programming Blog (by Shaun Roselt): Delphi Communties on: WhatsApp, Telegram, Google+, Facebook

He has an interesting YouTube channel too: https://www.youtube.com/user/shaunroselt/videos

–jeroen

Via: [WayBack] More Delphi communities! – Ilya S – Google+

 

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

GitHub – Libaud/POLCLVCLISO: Pascal Object LCL and VCL ISO standards implementation for CodeTyphon, Delphi, Lazarus

Posted by jpluimers on 2020/01/02

For my link archive: GitHub – Libaud/POLCLVCLISO: Pascal Object LCL and VCL ISO standards implementation for CodeTyphon, Delphi, Lazarus

It implements these standards:

  • ISO standard 3166-1, 3166-2, 3166-3 implementation
    • (all part of the ISO 3166 – Wikipedia that “defines codes for the names of countries, dependent territories, special areas of geographical interest, and their principal subdivisions)”
  • ISO standard 4217 implementation
    • ISO 4217 – Wikipedia  “delineates currency designators, country codes (alpha and numeric)” where the country codes are the same as in ISO 3166
  • ITU E.164 standard implementation
    • E.164 – Wikipedia “E.164 defines a general format for international telephone numbers. Plan-conforming numbers are limited to a maximum of 15 digits, excluding the international call prefix.”

A library like this needs monitoring the standards changes, so hopefully Libaud will do that.

Some of my posts related to ISO 3166 are below.

–jeroen

Related:

 

Posted in Delphi, Development, FreePascal, Lazarus, Pascal, Software Development | Leave a Comment »

Using a main check __main__ to call a main function in Python

Posted by jpluimers on 2020/01/01

[WayBack] __main__ — Top-level script environment — Python 3 documentation recommends code like this:

if __name__ == "__main__":
    # execute only if run as a script
    main()

This has many cool possibilities, including these that I like most as a beginning Python developer:

  • having your def main(): function in a separate source file
  • allowing to return prematurely from your main function (you cannot do this from the main block)
  • allowing a file to distinguish if it is being loaded as a module, or as a main program

Related:

–jeroen

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

How to make a self extracting archive runs your setup.exe, 7zip -sfx

Posted by jpluimers on 2020/01/01

For my link archive step by step instruction on the command-line which can be automated:

Via:

–jeroen

Posted in 7zip, Batch-Files, Compression, Development, Power User, Scripting, Software Development | Leave a Comment »

Delphi multi-threading: confused by TThread.Synchronize / TThread.Queue? You’re not alone. And you need to be aware of exceptions there too.

Posted by jpluimers on 2020/01/01

Below an elaboration on my answer to the question [WayBack] I don’t understand the following part of the second Delphi example:TThread.Synchronize… – Alberto Paganini – Google+:

I was looking at the Task example at the EMB wiki link below

http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Tutorial:_Using_Tasks_from_the_Parallel_Programming_Library

and I don’t understand the following part of the second Delphi example:

TThread.Synchronize(nil,
  procedure
  begin
    Label1.Text := lValue.ToString;
  end);

why is there the need to pass Label1.Text := lValue.ToString; as procedure in TThread.Synchronize ?

Why not a simple Label1.Text := lValue.ToString; ?

Basically that question can be either of these:

  1. Why is there no easier language construct than wrapping the callback in a procedure (anonymous method).
  2. Why a call to TThread.Synchronize at all?

The tutorial that Alberto refers to is [WayBack] Tutorial: Using Tasks from the Parallel Programming Library – RAD Studio. That example uses the TTask feature in Delphi, but the portion he has a question about is general to any multi-treading in Delphi that touches the updating of a VCL or FMX UI from another thread.

This is the more complete code in the meant example:

procedure TForm1.ButtonTask1Click(Sender: TObject);
var
  lValue: Integer;
begin
    Label1.Text := '--';
    TTask.Run(procedure
      begin
          {Some calculation that takes time}
          Sleep(3000);
          lValue := Random(10);
          TThread.Synchronize(nil,
            procedure
            begin
                  Label1.Text := lValue.ToString;
            end);
      end);
end;

What happens here is that the TTask is used to run some code (starting with {Some calculation that takes time}) in a different thread (that is being determined by the framework behind TTask).

I recommend against using TTask (or any other part of the Delphi Parallel Programming Library) as I agree with Stefan Glienke in [WayBack] Hello, Do you know why the “default” keyword of a class property is sometime defined also as an attribute ? – Paul TOTH – Google+:

If that works as well as the PPL does I would not touch it with a 10 foot pole ;)

With “that”, he refers to the APL (Asynchronous Programming Library [Archive.is]) which got introduced in Delphi XE8 and adds asynchronous support for UI controls, but unlike .NET (which implements it on the .NET TControl equivalent) shifted it down to TComponent probably because that’s the common ancestor for both VCL and FMX. But that’s a topic for another day.

The Delphi Parallel Programming Library (DPL) is a complex and intricate framework originally started as Delphi Parallel Library (DPL) and modelled after [WayBackIntel’s Threading Building Blocks (TBB) and Microsoft’s Task Parallel Library (TPL) (not in WayBack, but moved to the CHM file [WayBack], see also[WayBack] Task Parallel Library changes since the MSDN Magazine article | Parallel Programming with .NET)

Most parts of the DPL were written over at least 7 years time by former Chief Scientist Allen Bauer and introduced in Delphi XE7 as the Delphi Parallel Programming Library (PPL), see [WayBack] Delphi Parallel Programming Library & Memory Managers – Steve Maughan and [WayBack] The Oracle at Delphi: Lock my Object… Please!.

Since Delphi XE7, the PPL hardly got maintenance and now most if not all of the people having knowledge about it have left Embarcadero: early 2016, [Archive.is] Delphi Chief Scientist Allen Bauer Has Left Embarcadero/Idera | Hacker News leaving a big gap as “There are no plans that I’m aware of to move someone into my old position… All those that I would consider qualified are either already gone or are currently looking elsewhere.” (it is not in the [WayBack] part of How safe is Delphis future? Who is the new Lead Compiler Engineer? Who is the new Chief Scientist? – Ralf Stocker – Google+, hence the screen shot).

Luckily, Allen copied most of his old Embarcadero blog over to his personal one (including comments!), so there is quite some historic reference, see for instance [WayBack] Thread pools <> Task handling. – Community Blogs – Embarcadero Community and [WayBack] The Oracle at Delphi: Thread pools <> Task handling.

So back ensuring you can execute some code on the main thread and the questions from the G+ post:

  1. Why is there no easier language construct than wrapping the callback in a procedure (anonymous method).
  2. Why a call to TThread.Synchronize at all?

Lets start with the questions in order I answered them, starting with the my response:

Read the rest of this entry »

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

from old school to new frontier: Pattern, naming and MVVM from a Delphi point of view.

Posted by jpluimers on 2019/12/31

On my list of things to check later: FMBC a Delphi implementation of MVVM? [WayBackfrom old school to new frontier: Pattern, naming and MVVM from a Delphi point of view.

via: [WayBack] #FBMC the new MVVM 2.5? – Frank Lauter – Google+

–jeroen

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

Diffie-Hellman Key Exchange graphically explained – Wikipedia/Computerphile

Posted by jpluimers on 2019/12/31

Sometimes a picture or video is better than a thousand words.

I wish that back when I learned about the mathematics of the Diffie–Hellman key exchange – Wikipedia

I had seen the picture on the right from File:Diffie-Hellman Key Exchange-modified.png – Wikipedia (via DHKE General overview) which inspired the Computerphile and Art-Of-The-Problem videos below doing the same dynamically with colorised liquids and paint.

Art-Of-The-Problem has a similar video on RSA as well which is also below.

Usually Diffie-Hellman is combined with RSA to prevent man-in-the-middle and allow for perfect forward secrecy. That’s what the final computerphile video is about.

Excellent!

Finally, Computerphile also posted a video with the mathematics. If you’re into that: nice work too!

Via:

–jeroen

Read the rest of this entry »

Posted in Development, Encryption, Power User, Security, Software Development | Leave a Comment »