Posted by jpluimers on 2017/12/07
Since I’m in a C mood today: Free book: [WayBack] Writing 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 »
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: [WayBack] Let’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 »
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.
[WayBack] Oh nice. Feel free to QP. unit ParentUnit; interface type TParent = class …
Posted in Delphi, Delphi XE8, Development, Software Development | 3 Comments »
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 »
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 [WayBack] turns a warning into an error as normally [WayBack] UNSUPPORTED_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 »
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 »
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: [WayBack] XS4ALL gaat stoppen met ondersteuning van ftp – Security.NL
Posted in Communications Development, Development, FTP, Internet protocol suite, Power User, TCP | Leave a Comment »