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

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 »

Simplicity • Stuff that Happens: What can we learn about usability…

Posted by jpluimers on 2019/12/31

[WayBack] Simplicity • Stuff that Happens: What can we learn about usability…

With a comment from Uwe:

It is really disappointing that most customers are looking for solutions that don’t fall into the categories: “search” and “switch on/off”.

Developer: “So which of the fields do you actually need in this screen?”
Customer. “All of them!”
Developer: “Well, that will make the screen pretty cluttered information”.
Customer: “And please allow to add more easily whenever we need them.”
Developer: “That would be hard to achieve unless you exchange all your monitors to bigger ones.”
Customer: “OK, then. Can you make it work on my Apple Watch?”

[WayBack]

I very much can relate to this: somehow a lot of business driven applications have cramped user interfaces that are very hard to use because the overwhelming number of UI controls and features per screen.

This holds even for web applications.

Let’s hope this will slowly change for the better over time.

Via:

–jeroen

 

Posted in Development, Software Development, Usability, User Experience (ux) | Leave a Comment »

Delphi, decoding files to strings and finding line endings: some links, some history on Windows NT and UTF/UCS encodings

Posted by jpluimers on 2019/12/31

A while back there were a few G+ threads sprouted by David Heffernan on decoding big files into line-ending splitted strings:

Code comparison:

Python:

with open(filename, 'r', encoding='utf-16-le') as f:
  for line in f:
    pass

Delphi:

for Line in TLineReader.FromFile(filename, TEncoding.Unicode) do
  ;

This spurred some nice observations and unfounded statements on which encodings should be used, so I posted a bit of history that is included below.

Some tips and observations from the links:

  • Good old text files are not “good” with Unicode support, neither are TextFile Device Drivers; nobody has written a driver supporting a wide range of encodings as of yet.
  • Good old text files are slow as well, even with a changed SetTextBuffer
  • When using the TStreamReader, the decoding takes much more time than the actual reading, which means that [WayBack] Faster FileStream with TBufferedFileStream • DelphiABall does not help much
  • TStringList.LoadFromFile, though fast, is a memory allocation dork and has limits on string size
  • Delphi RTL code is not what it used to be: pre-Delphi Unicode RTL code is of far better quality than Delphi 2009 and up RTL code
  • Supporting various encodings is important
  • EBCDIC days: three kinds of spaces, two kinds of hyphens, multiple codepages
  • Strings are just that: strings. It’s about the encoding from/to the file that needs to be optimal.
  • When processing large files, caching only makes sense when the file fits in memory. Otherwise caching just adds overhead.
  • On Windows, if you read a big text file into memory, open the file in “sequential read” mode, to disable caching. Use the FILE_FLAG_SEQUENTIAL_SCAN flag under Windows, as stated at [WayBack] How do FILE_FLAG_SEQUENTIAL_SCAN and FILE_FLAG_RANDOM_ACCESS affect how the operating system treats my file? – The Old New Thing
  • Python string reading depends on the way you read files (ASCII or Unicode); see [WayBack] unicode – Python codecs line ending – Stack Overflow

Though TLineReader is not part of the RTL, I think it is from [WayBack] For-in Enumeration – ADUG.

Encodings in use

It doesn’t help that on the Windows Console, various encodings are used:

Good reading here is [WayBack] c++ – What unicode encoding (UTF-8, UTF-16, other) does Windows use for its Unicode data types? – Stack Overflow

Encoding history

+A. Bouchez I’m with +David Heffernan here:

At its release in 1993, Windows NT was very early in supporting Unicode. Development of Windows NT started in 1990 where they opted for UCS-2 having 2 bytes per character and had a non-required annex on UTF-1.

UTF-1 – that later evolved into UTF-8 – did not even exist at that time. Even UCS-2 was still young: it got designed in 1989. UTF-8 was outlined late 1992 and became a standard in 1993

Some references:

–jeroen

Read the rest of this entry »

Posted in Delphi, Development, Encoding, PowerShell, PowerShell, Python, Scripting, Software Development, The Old New Thing, Unicode, UTF-16, UTF-8, Windows Development | Leave a Comment »

How to text from your computer with Android Messages – The Verge

Posted by jpluimers on 2019/12/30

Boy, I totally missed this was possible: [WayBack] How to text from your computer with Android Messages – The Verge

Texting from the web gives you a lot more flexibility in how and where you can continue conversations. Here’s how to set it up and get started.

  1. Make sure you’ve got the latest version of Android Messages installed on your phone.
  2. Go to messages.android.com on the computer or other device you want to text from. You’ll see a big QR code on the right side of this page.
  3. Open up Android Messages on your smartphone. Tap the icon with three vertical dots at the top and to the far right. You should see a “Messages for web” option inside this menu. If you don’t, just give it some time. Google is rolling out the feature gradually to everyone over the next week.
  4. Tap “Scan QR code” and point your phone’s camera at the QR code on your other device. In less than a second, your phone will vibrate and the two will be linked up. You should notice your conversations show up in the left column of the browser window. Google says that “conversation threads, contacts, and other settings will be encrypted and cached on your browser.”
    Note: this doesn’t mean your actual text conversations are encrypted. They’re not.

 

–jeroen

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