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

Archive for 2020

Computing History – The UK Computer Museum – Cambridge

Posted by jpluimers on 2020/06/19

On my places to visit:

The Centre for Computing History is a computer museum based in Cambridge, UK. With a collection of vintage computers and game consoles, many of the exhibits are hands on and interactive.

[WayBackComputing History – The UK Computer Museum – Cambridge.

When I bumped into it, this was their collection size, ranging from the 1960s until recent history:

Archive Statistics :

  • Computers = 993
  • Peripherals = 1446
  • Mobile Devices = 31
  • Game Consoles = 213
  • Video Games = 10259
  • Software Packages = 2605
  • Books = 2045
  • Manuals = 4106
  • Magazines = 9057

Looking at their archived brands (having [WayBack] MITS – Altair and [WayBack] Raspberry Pi in the collection) is such a joy.

Archiving the older parts is a tough job, as they stem from way before the web era, so information has been lost, parts are hard to source, a lot of hardware got thrown away or is hard to find at all, people have died. More on that at [WayBack] About – Computing History.

Without a physical visit, you can find what they have at [WayBack] Search Our Archive – Computing History.

The video below on their archive is impressive.

–jeroen

Read the rest of this entry »

Posted in 6502, 68k, Apple I, BBC Micro B, BBS, C64, Commodore, CP/M, dial-up modems, FidoNet, History, IBM SAA CUA, PowerPC, Tesseract, VIC-20, Z80 | Leave a Comment »

Creating a properly aligned partition with parted – twm’s blog

Posted by jpluimers on 2020/06/19

I like the deceptively simple, if you remind that percent signs are the way to go for GNU parted (not to be confused with gparted which is Gnome parted).

At [WayBack] Creating a properly aligned partition with parted – twm’s blog:

mkpart /dev/somedevice ext4 0% 100%

It gets rid of the dreaded “The resulting partition is not properly aligned for best performance”.

References:

Via: [WayBack] Parted is a flexible tool for working with partition tables under Linux. Unfortunately it sometimes seems rather stupid… – Thomas Mueller (dummzeuch) – Google+

–jeroen

Posted in *nix, *nix-tools, parted, Power User | Leave a Comment »

tfs – How to retrieve the hash for the current commit in Git? – Stack Overflow

Posted by jpluimers on 2020/06/18

Based on [WayBack] tfs – How to retrieve the hash for the current commit in Git? – Stack Overflow

Get current hash:

git rev-parse HEAD

Show summary of current commit, including hash:

git show --summary

Show all hashes of all branches (both in heads and in remotes) and tags:

git show-ref

Get current hash with a * marking if it is dirty:

git describe --always --abbrev=0 --match "NOT A TAG" --dirty="*"

The last one was [WayBack] answered by [WayBack] Rado:

display the full sha1 of the commit, but append an asterisk to the end if the working directory is not clean. …

Here is the one liner that does:
git describe --always --abbrev=0 --match "NOT A TAG" --dirty="*"
Result: f5366ccb21588c0d7a5f7d9fa1d3f85e9f9d1ffe*

Explanation: describes (using annotated tags) the current commit, but only with tags containing “NOT A TAG”. Since tags cannot have spaces, this never matches a tag and since we want to show a result --always, the command falls back displaying the full (--abbrev=0) sha1 of the commit and it appends an asterisk if the working directory is --dirty.

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »

Delphi Exception handling code review reminders

Posted by jpluimers on 2020/06/18

I bumped into [WayBack]When an exception is nil in the exception handler – twm’s blog for some legacy code a while ago.

Some code review reminders:

  • raise Exception( is always wrong: no exception instance is created
  • Exception.Create( without a raise is wrong most of the times
  • except end is almost always wrong
  • except and finally in encompassing blocks often is a code smell

I need to check which ones are caught by [WayBack] Code Analysis Tool | FixInsight for Delphi (which is now at [WayBack] TMS Software | VCL, FMX, ASP.NET, .NET controls & components for Delphi, C++Builder & Visual Studio | TMS FixInsight Pro.)

--jeroen

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

Lisette Sutherland: Work Together Anywhere | Lisette Sutherland | TEDxKaunas

Posted by jpluimers on 2020/06/18

[WayBack] TEDx Kaunas, 19 November 2017 – Lisette Sutherland:

“Remote workers aren’t trying to escape doing work. We’re trying to escape the Day Prison. We want to use technology to make better use of our time. We want to spend more time on things that matter to us and less time stuck in traffic.“

The site has the original transcript on the below video: Work Together Anywhere | Lisette Sutherland | TEDxKaunas.

Via: [WayBack] “People think that they want to be in the same place. But what they really want is fast communication” – Work Together Anywhere | Lisette Sutherland … – Marjan Venema – Google+

–jeroen

Read the rest of this entry »

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

Chr equivalent for Unicode in Delphi 7 – Stack Overflow

Posted by jpluimers on 2020/06/17

From a long time ago: [WayBackchr equivalent for Unicode in Delphi 7 – Stack Overflow answered by David Heffernan:

Q

I need to initialize a Widestring in Delphi 7 but I can’t use chrfunction which is ANSI

var
  ws : Widestring;
begin

 ws := chr($FFFF) + chr($FFFF) + chr($FFFF);

end;

What can I use, then ?

A

I’m not sure there’s a simply way to do what you wish. You can convert a Word into a WideChar with a simple cast:

WideChar($FFFF)

but you cannot concatenate WideChar. So this is a compiler error:

WideChar($FFFF) + WideChar($FFFF)

You could use a helper function to get the job done:

function InitialiseWideString(const chars: array of Word): WideString;
var
  i: Integer;
begin
  SetLength(Result, Length(chars));
  for i := 0 to high(chars) do
    Result[i+1] := WideChar(chars[i]);
end;

Then you can call it like this:

ws := InitialiseWideString([$0054, $0069, $006D, $0065, $0020, $0074, $006F, 
  $0020, $0075, $0070, $0067, $0072, $0061, $0064, $0065]);

–jeroen

Posted in Delphi, Delphi 7, Development, History, Software Development | 3 Comments »

Dynamically instantiating instances in Delphi without knowing their full type is hard

Posted by jpluimers on 2020/06/17

For my reading list: [WayBack] So am working on a particular .NET project and came across NewtonSoft JSON.NET Serializer, it allows you serialize Collections such as a generic list an… – Ugochukwu Mmaduekwe – Google+:

Stefan Glienke:
Serializing and mostly deserializing generics in Delphi is a major PITA because we don’t have such capabilities to dynamically work with them like in C# where you can easily create new generic lists at runtime where you don’t know the precise type T at compile time.

–jeroen

 

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

How to return a string value from a Bash function – Stack Overflow

Posted by jpluimers on 2020/06/17

Cool: you can return strings both as a function result, and by reference: they are explained in the question, second and fourth answer of [WayBack] How to return a string value from a Bash function – Stack Overflow.

Returning them by reference has two important benefits:

  1. it is much faster (especially useful in tight loop)
  2. you can use echo (normally used to return a result) for debugging purposes

I also needed a bit of switch magic which I found at [WayBack] bash – Switch case with fallthrough? – Stack Overflow and array magic (from [WayBack] Array variables) as arrays are far more readable than indirection (on the why not, see [WayBack] BashFAQ/006 – Greg’s Wiki: How can I use variable variables (indirect variables, pointers, references) or associative arrays?).

So here is a function that returns a specific IPv4 octet.

function getIpv4Octet() {
  IPv4=$1
  octetIndex=$2
  outputVariable=$3

  slice="${IPv4}"
  count=1
  while [ "${count}" -le 4 ]
  do
    octet[${count}]="${slice%%.*}"
    slice="${slice#*.}"
    count=$((count+1))
  done
   
  case "${octetIndex}" in
    "1" | "2" | "3" | "4")
      ;;
    *)
      octetIndex="4"
      ;;
  esac
  eval $outputVariable="${octet[$octetIndex]}"
}

You call it like this:

$ getIpv4Octet "192.168.178.32" 3 result && echo ${result}
178

–jeroen

Posted in *nix, *nix-tools, bash, bash, Development, Power User, Scripting, Software Development | Leave a Comment »

A Tale of Many Divisions – Naive Prime Factorization Across a Handful of Architectures

Posted by jpluimers on 2020/06/16

[WayBack] A Tale of Many Divisions – Naive Prime Factorization Across a Handful of Architectures

Source code: [WayBack] GitHub – blu/euclid: An extremely naive prime factorizer

Via: [WayBack] Blu looks at how a small piece of code with divisions surprisingly behave on various architecture: #Arm, #MIPS, and #x86. – Jean-Luc Aufranc – Google+

–jeroen

Posted in Assembly Language, C++, Development, Software Development | Leave a Comment »

Being efficient actually holds you back

Posted by jpluimers on 2020/06/16

A while ago, over some period of time, I found a few related posts on being efficient optimising time management, on both professional and personal levels. Fully going the “optiomal” usually isn’t that a good thing.

Basically, you need slack or idle time. Plenty of it. That improves your agility too.

–jeroen

Posted in Agile, Conference Topics, Conferences, Development, Event, LifeHacker, Power User, Software Development | Leave a Comment »