Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
_kst_
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
61.
▲
by
_kst_
2y ago
See my comment above: https://news.ycombinator.com/item?id=41664474
62.
▲
by
_kst_
2y ago
A compiler can reuse memory as much as it likes -- but only if the visible behavior of the program is consistent with the language requirements. If you write: { int n = 42; printf("%d\n", n); } in the
63.
▲
by
_kst_
2y ago
It returns 2. The only reason that might be surprising is that the "return *p;" statement refers to the value of an object at a point (textually) before its definition. But the lifetime of the object named "v" begins on
64.
▲
by
_kst_
2y ago
Background: A %n format specifier in a printf call stores the number of characters written so far into a specified variable. For example: #include <stdio.h> int main(void) { int count; printf("%s%n\n&qu
65.
▲
by
_kst_
2y ago
I tried it in PuTTY on Windows. I ran into two problems. 1. Poor coverage of non-ASCII characters (it won't display simple accented letters, pound sign, euro sign, etc.). 2. []{} are cut off at the top.
66.
▲
by
_kst_
2y ago
I had a similar problem. I've submitted an issue. https://github.com/WeeJeWel/node-google-backup/issues/1
67.
▲
by
_kst_
2y ago
I just discovered that typing man 'printf(1)' or man 'printf(3)' actually works (at least with the man command on Ubuntu, provided by the "man-db" package). You have to quote or escape the parentheses b
68.
▲
by
_kst_
2y ago
To be clear, it's not the terminal emulator (xterm, mintty, iTerm2, etc.) that does this. It's the tty layer. You can use the stty command to change the settings.
69.
▲
by
_kst_
2y ago
For the second, <git://git.subdivi.de/~helmut/tcvt.git> might be useful. It's not quite what you asked for; it emulates a two-column virtual terminal within another (virtual) terminal. If you can extend your t
70.
▲
by
_kst_
2y ago
> emulating a vt340+ like xterm does gives you the first six of these, which is a big reason why people keep writing new programs for that platform, but totally flunks the last one; you can't even display text in a proportional font
71.
▲
by
_kst_
2y ago
Except that in C (at least prior to C23), it should be "int main(void)". I'm fairly sure that all existing C compilers will quietly accept "int main()", but there's an argument that "int main()" cause
72.
▲
by
_kst_
3y ago
https://www.databricks.com/glossary/what-is-parquet (I don't think everyone has moved to it. I had never heard of it myself.)
73.
▲
by
_kst_
3y ago
In addition to a sentence about what this solves relative to Vite, another sentence saying what Vite is would also be helpful to those of us who have never heard of Vite. A link to https://vitejs.dev/ would probably suffice
74.
▲
by
_kst_
3y ago
No, the command is < x Y | Z > w where x and w are files, not commands. Something that "cat file | ..." advocates might be overlooking is that a redirection ("<inputfile", ">outputfile", &q
75.
▲
by
_kst_
3y ago
I think there are two reasons int has not gone from 32 to 64 bits on 64-bit systems. Part of it is backward compatibility: code written to assume 32-bit int could break. (Arguably such code is badly written, but breaking it would still be i
76.
▲
by
_kst_
3y ago
Or include the URL rather than just the HN ID so readers can follow the links.
77.
▲
by
_kst_
3y ago
https://www.youtube.com/watch?v=5rVBu6i6Qwk
78.
▲
by
_kst_
3y ago
https://www.c-faq.com/ question 10.4 "What's the best way to write a multi-statement macro?"
79.
▲
by
_kst_
3y ago
That should only matter if times are stored and sorted as local time. Storing time as UTC (e.g. seconds since 1970) and computing local time from that and the current time zone should avoid DST-related bugs.
80.
▲
by
_kst_
3y ago
Blowing my own horn a little, I have a Perl script that generates random passwords, with options to, for example, generate a 16-character password with lowercase letters, but with one uppercase letter, one digit, and one punctuation mark, a
81.
▲
by
_kst_
3y ago
I suggest updating the title to say "British Columbia". (I thought it might be Baja California.)
82.
▲
by
_kst_
3y ago
Timestamp 1000000000 (Sat 2001-09-08 18:46:40 PDT) triggered a bug in the bug reporting system (Remedy) we were using at the time. The system stored timestamps as a string representing seconds since the epoch, but it assumed it would fit in
83.
▲
by
_kst_
3y ago
Looks like the epicenter was 13.1 kilometers directly below SFO (San Francisco International Airport, which is south of San Francisco). Updated magnitude is 3.7.
84.
▲
by
_kst_
3y ago
A clarification: You can certainly assume that char is 8 bits if you don't mind losing portability to a small minority of systems. If I'm being pedantic, I might add something like #if CHAR_BIT != 8 #error "This cod
85.
▲
by
_kst_
3y ago
You can't assume char is one octet . It is one byte by definition. A byte is CHAR_BIT bits, where CHAR_BIT >= 8. (It's exactly 8 on most implementations; DSPs are the most common exception). short and int are both required to
86.
▲
by
_kst_
3y ago
"LA" is Los Angeles, CA (could also have been Louisiana)
87.
▲
by
_kst_
3y ago
The Arecibo dish was not steerable, so there are large parts of the sky that it couldn't see. China built a similar radio telescope that went into service in 2016. https://en.wikipedia.org/wiki/Five-hundred-meter_A
88.
▲
by
_kst_
3y ago
"But agreed that an explicit --help should print to stderr." I think you meant stdout here, not stderr.
89.
▲
by
_kst_
3y ago
I think the suggestion was not that the tool should page the output, but that the user can easily do so: tool [args] 2>&1 | less Presumably "less" knows how big your terminal is.
90.
▲
by
_kst_
3y ago
I'm reasonably sure this book is still under copyright. It seems that a lot of people don't care about that for certain books.
More ›