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

Archive for November, 2018

SSH: Connection Reset by Peer – Server Fault

Posted by jpluimers on 2018/11/22

One occasion I had SSH throw a Connection Reset by Peer on my when was the SD-card of a Raspberry Pi started failing and the ext4 filesystem got mounted in read-only mode.

Then sshd was still listening on port 22, but since it could not write to disk any more, it threw a Connection Reset by Peer to the client.

It was on OpenSuSE Tumbleweed, but would failed just as well using Raspbian.

Lessons learned:

  • IoT hardware will fail.
  • ext4 breaks when the hardware breaks.

–jeroen

Reference:

Posted in *nix, *nix-tools, Debian, Development, Hardware Development, IoT Internet of Things, Linux, Network-and-equipment, openSuSE, Power User, Raspberry Pi, Raspbian, SuSE Linux, Tumbleweed | Leave a Comment »

FRITZ!Box call http://fritz.box/cgi-bin/system_status

Posted by jpluimers on 2018/11/22

While researching what the cgi-bin of Fritz!Box devices expose, I found this post on http://fritz.box/cgi-bin/system_status:

[WayBack] FRITZ!Box „Service Code“ auslesen und dekodieren – Antary

FRITZ!Box Fon WLAN 7390–B–041711–000121–533176–734744–147902–840604–28179–avm

  • FRITZ!Box Modell (Name)
  • Annex
  • Gesamtlaufzeit der Box (Stunden, Tage, Monate, Jahre)
  • Neustarts
  • Hash
  • Status
  • Firmwareversion
  • Sub-Version
  • Branding

The site has the entries colour coded, but WordPress doesn’t allow for that.

I found out that on a Fritz!Box 7490 you do not need to logon, but on a Fritz!Box 7360 you have to.

The site has a few other interesting Fritz!Box posts as well:

–jeroen

Read the rest of this entry »

Posted in Fritz!, Fritz!Box, Internet, Power User | Leave a Comment »

Delphi sorcery: Loop wars – measuring performance

Posted by jpluimers on 2018/11/21

Interesting read: [WayBack] Delphi sorcery: Loop wars – measuring performance.

It is on optimisation of for…in constructs. More comments at [WayBack] Since there was this offtopic argument going on about performance of for-in versus for-to. – Stefan Glienke – Google+, including penalties for TStrings, string handling and inline methods.

–jeroen

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

Watch “Modifying an old light with LED tape.” on YouTube

Posted by jpluimers on 2018/11/21

Posted in Uncategorized | Leave a Comment »

In operations, code is not your friend. Make things simple, make them boring …

Posted by jpluimers on 2018/11/21

Painful lesson learned a while ago: In operations, code is not your friend. Make things simple, make them boring and make them obvious, and keep an eye on the configuration complexity cloc… – Kristian Köhntopp – Google+

Read the rest of this entry »

Posted in Cloud, Development, DevOps, Infrastructure, Software Development | Leave a Comment »

Date and time conversion is hard in databases: `conversion error from string “30-12-1899″`

Posted by jpluimers on 2018/11/21

Converting string literals to to date/time/timestamp related data is always tricky in many Database environments.

Firebird is no exception, especially because sometimes it truncates a zero time portion from a date-time/timestamp.

So you can get this:

select cast('30-12-1899' as TimeStamp)
from rdb$database

Throwing an error:

conversion error from string "30-12-1899"

And this:

select cast('30.12.1899' as TimeStamp)
from rdb$database

Returning

CAST
30-12-1899 0:00:00

–jeroen

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

A repository with a hierarchy or modules referencing each other might not be a good idea

Posted by jpluimers on 2018/11/20

When creating a library of libraries where the libraries use parts of the other libraries creates a mess when organised as a repository with subrepositories having other subrepositories.

It might be better to have one big repository containing a suite of functionality. This is why darkThreading became part of darkGlass: [WayBack] Why no git submodules for the libraries it depends on? · Issue #1 · chapmanworld/darkThreading · GitHub:

You might want to maintain that suite as one big versioned repository, with a different means of structuring it than a tree of submodules. That way you can keep the more complex interdependencies between the parts you have now.

Example of the mess: [WayBack] Duplicate submodules with Git – Stack Overflow

–jeroen

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

Where does my git question go? – Programmers Meta Stack Exchange

Posted by jpluimers on 2018/11/20

StackOverflow / StackExchange is growing too large:

You’ve got a question about git. Its not uncommon, lots of people have questions about git. But where should the question be asked?

Source: Where does my git question go? – Programmers Meta Stack Exchange

–jeroen

Posted in Development, DVCS - Distributed Version Control, git, GitHub, Opinions, Pingback, Software Development, Source Code Management, SourceTree, Stackoverflow | Leave a Comment »

Reminder to Self: check if NameOf has been implemented yet

Posted by jpluimers on 2018/11/20

It’s been a wish for a very very long time: to get the name of an identifier as a string in Delphi:

For now the best one can do is either using an Assert and catching the exception (it gets you the unit name, source file name and source line number) in the links below, or using debug symbol information (like a MAP or TDS file) mentioned in the StackOverflow questions above.

C# has had a  [WayBack] nameof for many years now that is evaluated at compile time: [WayBackc# – Is nameof() evaluated at compile-time? – Stack Overflow.

There is a request RAD Studio – RSP-13290: NameOf(T) compiler (magic) function in Quality Portal by Horácio Filho about 3 years ago quotes below.

Since it took the C# team about 3 years after the original [WayBackAdd nameof operator in C# – Visual Studio request, I wonder how fast the Delphi team is.

NameOf .NET-like compiler magic (intrinsic) function would eliminate a lot of hand-written exception messages from several units.

C# 6 introduced nameof operator to obtain the simple (unqualified) string name of a variable, type, or member.

With the current Delphi implementation, after changing variables name we have ot change the related exception message as well. Putting variables name in the code is not a good practise, and is here that NameOf taking place saving tons of lines of code. As the result of NameOf(T) function (if so) is evaluated at compile time (according to the C# implementation – http://stackoverflow.com/a/26573179) we need a help from compiler or it could be achieved using RTTI.

There is a discussion on Google+ community [WayBackhttps://plus.google.com/+StefanGlienke/posts/AsGHSLF4rTX.
The function could be designed as
NameOf(x: Identifier)
following the same (or similar) warranties C# provides.

Using Assert:

–jeroen

Read the rest of this entry »

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

RegExr: Online Regular Expression Testing Tool

Posted by jpluimers on 2018/11/19

[WayBack] Kevlin Henney – Google+ reminded me of RegExr. Then I found out I collected the below links in 2010, but never published them. Hopefully a few still exist. Let’s see… yup: all do, but archived just in case.

Some other links (that show how much the landscape changed in 8.5 years time):

–jeroen

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