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

Writing Bug-Free C Code – free book by Jerry Jongerius

Posted by jpluimers on 2017/12/07

Since I’m in a C mood today: Free book: [WayBackWriting Bug-Free C Code, A Programming Style That Automatically Detects Bugs in C Codeby Jerry Jongerius / January 1995.

Be sure to credit the author.

Via: [WayBack] Writing Bug-Free C Code A Programming Style That Automatically Detects Bugs in C Codeby Jerry Jongerius / January 1995 – Ilya S – Google+

–jeroen

Posted in C, Development, Software Development | 1 Comment »

Let’s stop copying C / fuzzy notepad

Posted by jpluimers on 2017/12/07

Ah, C. The best lingua franca we have… because we have no other lingua francas. Linguae franca. Surgeons general? C is fairly old — 44 years, now! — and comes from a time when there were possibly more architectures than programming languages. It works well for what it is, and what it is is a relatively simple layer of indirection atop assembly. Alas, the popularity of C has led to a number of programming languages’ taking significant cues from its design, and parts of its design are… slightly questionable. I’ve gone through some common features that probably should’ve stayed in C and my justification for saying so. The features are listed in rough order from (I hope) least to most controversial. The idea is that C fans will give up when I call it “weakly typed” and not even get to the part where I rag on braces. Wait, crap, I gave it away.

Great re-read towards the end of the year: [WayBackLet’s stop copying C / fuzzy notepad

Via: [WayBack] Old and busted: emacs vs vi. New and hot: Language war, everybody against everybody else. – Kristian Köhntopp – Google+

–jeroen

Posted in .NET, APL, Awk, bash, BASIC, C, C#, C++, COBOL, CoffeeScript, CommandLine, D, Delphi, Development, F#, Fortran, Go (golang), Java, Java Platform, JavaScript/ECMAScript, Pascal, Perl, PHP, PowerShell, PowerShell, Python, Ruby, Scala, Scripting, Software Development, TypeScript, VB.NET, VBScript | 3 Comments »

Oh nice. Feel free to QP. E2003WithConstsInDescendingClassesConsoleProject

Posted by jpluimers on 2017/12/06

Oh nice. Feel free to QP. Fails at least in Delphi XE8.

program E2003WithConstsInDescendingClassesConsoleProject;

{$APPTYPE CONSOLE}

uses
ParentUnit in 'ParentUnit.pas',
ChildUnit in 'ChildUnit.pas';

begin
end.
unit ParentUnit;

interface

type
  TParent = class
  // section can be strict protected, protected, public, published or nothing
  const
    InitialBooleanValue = False;
    InitialIntegerValue = -1;
  end;

implementation

end.
unit ChildUnit;

interface

uses
  ParentUnit;

type
  TChild = class(TParent)
  // section can be strict protected, protected, public, published or nothing
  const
//    Initial and final values need to be different to test the behaviour
    FinalBooleanValue = not InitialBooleanValue;
    FinalIntegerValue = InitialIntegerValue + 1;
//[dcc32 Error] ChildUnit.pas(13): E2003 Undeclared identifier: 'InitialBooleanValue'
//[dcc32 Error] ChildUnit.pas(14): E2003 Undeclared identifier: 'InitialIntegerValue'
//[dcc32 Error] ChildUnit.pas(14): E2026 Constant expression expected
  end;

implementation

end.

[WayBackOh nice. Feel free to QP. unit ParentUnit; interface type TParent = class …

Posted in Delphi, Delphi XE8, Development, Software Development | 3 Comments »

DNS, glue records and TTL

Posted by jpluimers on 2017/12/06

If I ever need to read why, here are the explanatory links:

TL;DR:

  • You need glue records for your domains if the nameserver is in the same TLD as your domain is (more explanation in the above links).
  • Your domain registrar allows you to change both your DNS servers and the glue at the TLD servers.
  • Glue records have a TTL at the TLD of 48 hours so changing them takes some waiting.
  • This is how you query the glue records so you can verify what’s setup at your DNS servers matches the ones at the TLD servers (in the below examples, replace google.com by your domain name).

dig +trace +additional google.com

 

Notes:

At the time of writing the dig output is this:

Read the rest of this entry »

Posted in DNS, Internet, Power User | Leave a Comment »

Data Science Advent – franz.media

Posted by jpluimers on 2017/12/05

Cool: @filmfranz made an advent calendar on Python data analysis featuring a lot of Pandas examples referring to source code found on the interwebz: [WayBackData Science Advent – franz.media.

First example is to eliminate outliers in the below graph.

He also has a really cool (German) Playlist on data analysis with Python called Datenanalyse in Python and has a great site with examples at franz.media.

–jeroen

via: [WayBack] Very cool idea: an advent calendar with tips for doing data science with Python and Pandas created by @filmfranz 👉 http://franz.media/advent.html – ThisIsWhyICode – Google+

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

Interactive map of Linux kernel

Posted by jpluimers on 2017/12/05

The [WayBackInteractive map of Linux kernel is way better than the static versions below that I got via

[WayBack] Interactive map of the Linux kernel subsystems. A little bit beyond what is required to use Linux. But great for those who want a deeper understanding of the kernel. – Joe C. Hecht – Google+

–jeroen

Read the rest of this entry »

Posted in *nix, Development, Linux, Power User, Software Development | Leave a Comment »

Delphi tip of the day: {$WARN UNSUPPORTED_CONSTRUCT ERROR} to get rid of W1025 when using an undeclared attribute

Posted by jpluimers on 2017/12/04

Delphi tip of the day:

{$WARN UNSUPPORTED_CONSTRUCT ERROR}

It will throw a compiler error when you use an attribute that isn’t defined as the above [WayBackturns a warning into an error as normally [WayBackUNSUPPORTED_CONSTRUCT is only a warning.

Which means that this code now fails:

type
  TmyClass = class
    [djhgfskdhgks]
    procedure One;
  end;

Thanks [WayBack] +Agustin Ortu for posting this tip!

I wish I had known this when I found the G+ post leading to On turning “W1025 Unsupported language feature: ‘customattribute’” into a compiler error.

–jeroen

via:

related:

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

coinmon: In case you don’t want to install 61 packages [1] :)

Posted by jpluimers on 2017/12/04

via: [WayBack] Hacker News – coinmon: In case you don’t want to install 61 packages [1] :) and [WayBack] The curl + jq based approach to check Bitcoin prices looks a bit more attractive than using a node.js package with 61 dependencies, doesn’t it? Source:… – ThisIsWhyICode – Google+

Function to call curl from bash:

    $ coinmon() {
    >     curl "https://api.coinmarketcap.com/v1/ticker/?convert=$1" | jq ".[0] .price_$1"
    > }

    $ coinmon eur
    "6988.4723188"

Or in Python (from the same HackerNew thread): [Archive.is] https://www.pastery.net/jnscrh/

#!/usr/bin/env python3

from urllib.request import urlopen
from decimal import Decimal
import json

def print_coin(coin):
    print("{} ticker:".format(coin["name"]))
    print("Price: {:,} EUR".format(Decimal(coin["price_eur"])))
    print("Market cap: {:,} EUR".format(Decimal(coin["market_cap_eur"])))
    print()


r = urlopen("https://api.coinmarketcap.com/v1/ticker/?convert=eur")
coins = json.loads(r.read().decode("utf8"))

for coin in coins:
    if coin["id"] in ("bitcoin", "ethereum", "ripple", "monero"):
        print_coin(coin)

–jeroe

Posted in Development, JavaScript/ECMAScript, Node.js, Software Development | Leave a Comment »

On the Docker-Kubernetes announcement: if Kubernetes does so much, do you still use Docker?

Posted by jpluimers on 2017/12/03

Must read: [WayBack] Some Thoughts on the Docker-Kubernetes Announcement – Scott’s Weblog – The weblog of an IT pro specializing in cloud computing, virtualization, and networking, all with an open source view

Via a thread with great comments: [WayBack] Two weeks ago, Scott Lowe mused about the Docker-Kubernetes announcement. https://blog.scottlowe.org/2017/10/17/some-thoughts-on-docker-kubernetes-anno… – Kristian Köhntopp – Google+

–jeroen

Posted in Cloud, Containers, Docker, Infrastructure, Kubernetes (k8n) | Leave a Comment »

XS4ALL has stopped providing ftp in the middle of 2017: now you can use sftp or sftp.

Posted by jpluimers on 2017/12/03

As of 20170711, the servername ftp.xs4all.nl does not support the ftp protocol any more; xs4all clients can only use the server sftp.xs4all.nl on port 22.

I missed that because I hardly use ftp except for the few rare occasions where I was in an environment without ftp.

So recently I found out: good move!

Since I still need this every now and then (but far less often than 10 years ago), I have set up a very small ftp server at home with limited storage and very limited users that I can turn on/off when needed.

Much better solution.

–jeroen

Source: [WayBackXS4ALL gaat stoppen met ondersteuning van ftp – Security.NL

Posted in Communications Development, Development, FTP, Internet protocol suite, Power User, TCP | Leave a Comment »