Recent activity

Re: w64devkit: (Almost) Everything You Need 9 hours ago

From Christopher Wellons to ~skeeto/public-inbox

> If you can, could you send details, so that we can fix it?

The error is "multiple definition" of osPlatformId, osMinorVersion, and 
osMajorVersion. There are definitions in both winmisc.c and winpgnt.c. 
The latter is caused by setting PUTTY_DO_GLOBALS before including 
putty.h, which includes puttyps.h, which includes winstuff.h, which 
normally tries to use GLOBAL to avoid the definition.

This is with PuTTY 0.74, the "Unix source archive" download.

Re: Asynchronously Opening and Closing Files in Asyncio 21 days ago

From Christopher Wellons to ~skeeto/public-inbox

Thanks for the tip, though it's not quite what I need. Normally when GDB 
takes control all threads are stopped, but I only want to stop the 
thread calling open(). Fortunately GDB supports "non-stop mode" that 
only pauses the trapped thread.

Unfortunately it appears to be broken in my version of GDB (8.2.1). I 
used the non-thread-specific version of your breakpoint, enabled 
non-stop mode, then ran my GDB aborted as soon as the second 
thread hit the breakpoint, with, "A problem internal to GDB has been 
detected, further debugging may prove unreliable."

gdb$ break open64 if $_memeq($rdi, "/tmp", 4)
gdb$ set non-stop on
gdb$ r

Re: Examples of "optional option arguments"? a month ago

From Christopher Wellons to ~skeeto/public-inbox

Half the various GNU utilities have at least one. Any that produce color 
output (ls, grep, etc.) have a --color option with an optional "WHEN" 
argument. ln, install, and mv have a --backup with optional CONTROL 
argument. df --output has an optional FIELD_LIST argument. mkdir, 
install, mkfifo, and mknod have --context with an optional CTX argument. 
ls and vdir have --hyperlink with an optional WHEN argument. mkdir 
--tmpdir has an optional DIR argument. rm has --interactive with an 
optional WHEN argument and --preserve-root with an optional ALL 
argument. sched has --remove with an optional HOW. od has --width with 
an optional BYTES, and it also comes with a short option version -w also 
taking optional BYTES. pr also has a whole bunch like this. I could keep 
going since GNU has so many examples, but I'll stop here!

Git has a ton of them, too. Its --exec-path option takes an optional

Re: Conventions for Command Line Options a month ago

From Christopher Wellons to ~skeeto/public-inbox

I was just having a discussion with someone the other day about "smart" 
behavior, and I had said I preferred simpler, intuitive behaviors that 
have easily-understood failure modes. Your own latest article about 
Matlab range handling is a perfect example!

Re: Conventions for Command Line Options a month ago

From Christopher Wellons to ~skeeto/public-inbox

Typically the long and short options are associated and so the option 
parser treats them as if they were the same option. The program should 
not care which form, short or long, was actually used, and typically 
there's no way to tell.

Re: Exactly-Once Initialization in Asynchronous Python a month ago

From Christopher Wellons to ~skeeto/public-inbox

Fixed. Thanks, Jakub! I *had* tested all the concepts in a real program, 
but when writing the article I retyped all the code from memory. Even 
with years of working with it, I'm still routinely caught off-guard by 
Python's global and nonlocal declarations.

Re: List of talks 3 months ago

From Christopher Wellons to ~skeeto/public-inbox

Hi, Gabriel, I'm glad you asked! A couple of other people have also also 
asked for an updated list, so I knew there's some interest. I did follow 
CppCon 2019, but unfortunately I didn't carefully keep track of which 
talks I thought we worthy of recommendation, in part because there 
weren't that many this time. However, checking my notes, I had 
enthusiastically shared these talks with others at the time:

CppCon 2019: JF Bastien “Deprecating volatile”

J. Bialek, S. Block “Killing Uninitialized Memory: Protecting the OS Without Destroying Performance”

CppCon 2019: Matt Godbolt “Path Tracing Three Ways: A Study of C++ Style”

Re: inquiring about internship 3 months ago

From Christopher Wellons to ~skeeto/public-inbox

Hi, Amol. I'm glad to hear you've taken an interest in C and that my 
blog has helped you along that path. As you know, C is far from 
obsolete, and anyone saying otherwise doesn't see the larger picture. 
Not only is C still foundational to a greater degree than any other 
language, it remains *the* most popular programming language in the 
world to this day (recently overtaking Java again in the Tiobe index):

So you can cite that for anyone who doubts it. In case you hadn't seen 
it yet, this one of my favorite papers about C and its importance:

Some Were Meant for C

Re: Latency in Asynchronous Python 4 months ago

From Christopher Wellons to ~skeeto/public-inbox

Thanks for the link! I've never heard of this place before, so I would 
have never seen it. 

> That's different from an unbuffered queue, which would have a buffer 
> size of zero – but asyncio.Queue doesn't support those.

Doh! Completely right. I've just made a couple of tweaks to the article 
to correct this.

Re: w64devkit: a Portable C and C Development Kit for Windows 4 months ago

From Christopher Wellons to ~skeeto/public-inbox

> Can you explain what the escape characters do?

The escape is interpreted by awk, and it's just a single quote. I needed 
that because it's triple-nested. The awk "script" is in single quotes, 
awk's strings are in double quotes, and I need single quotes again for 
generating SQL: double quotes are for identifiers, single quotes for 
strings. So ultimately the output from awk is:

INSERT INTO hashes VALUES ('a69...99c6');

> Another approach with the sqlite3 tool is the .import dot command.

I've used .import often for CSV but I easily forget it can be used for 
more than that. Thanks for the tip!