Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
trealira
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
19 ms
·
181.
▲
by
trealira
2y ago
He did. There was the fake electors plot: https://en.wikipedia.org/wiki/Trump_fake_electors_plot He tried to pressure Raffensperger into finding him 11,780 votes: https://en.wikipedia.org/wiki/Trum
182.
▲
by
trealira
2y ago
Yes, and it seems to me equally likely that he likes Trump but is too cowardly to say so. I don't know why others are so certain he's scared of Trump, unless there's a piece of information I'm missing.
183.
▲
by
trealira
2y ago
> This is about a language construct (&& and ||) that I would argue is terrible and should never be used. Something tells me you'd hate my five-line implementation of the standard library function fgets in C. char *fgets
184.
▲
by
trealira
2y ago
Silly mistake: that should read "s[j++] = s[i]".
185.
▲
by
trealira
2y ago
Thanks! I upvoted you but forgot to reply. Those are as interesting as I thought they'd be.
186.
▲
by
trealira
2y ago
Short-circuiting evaluation is also useful for things like this: function insertion_sort(a) { for (let i = 1; i < a.length; i++) { let key = a[i]; let j = i; while (j > 0 && key < a[j
187.
▲
by
trealira
2y ago
> a Space Invaders game > a minimal roguelike in Forth > 3-D rotating objects in ASCII art in 20 lines of Python > an RPN calculator with forward-mode automatic differentiation Those all sound pretty cool. Are those in the link
188.
▲
by
trealira
2y ago
It looks like it could be more concise sometimes. For instance, you could have this: if f(x) is Some(a) and g(x, a) is Some(Right(b)) then h1(a, b) else h2(x) The equivalent pattern matching with a match expression in pseudo-ML:
189.
▲
by
trealira
2y ago
The second edition was released in 1988, and it was based on a draft of the first ANSI C standard, and even then, the line stating that this was undefined behavior was already present. http://jfxpt.com/library/c89-draft
190.
▲
by
trealira
2y ago
Good point. It would be nice if the C standard were slightly clearer here.
191.
▲
by
trealira
2y ago
I was more referring to how, in the K&R example, a function of type "int (*)(char *, char *)" is cast to "int (*)(void *, void *)", in contradiction to what they said here: > Before someone mentions qsort(): the c
192.
▲
by
trealira
2y ago
Ironically, in K&R, they did exactly this for casting comparator functions for their own version of qsort. /* declarations */ void qsort(void *lineptr[], int left, int right, int (*comp)(void *, void *));
193.
▲
by
trealira
2y ago
Kernighan spends a page whittling strcpy down to just that, with various intermediate versions. After showing you that version, he describes it like this: Although this may seem cryptic at first sight, the notational convenience is conside
194.
▲
by
trealira
2y ago
> The DeathStation 9000 features a conforming C implementation which is known to catch all array bounds violations. ;) That actually really does exist already with CHERI CPUs, whose pointers are tagged with "capabilities," whic
195.
▲
by
trealira
2y ago
They can be useful when adding things to an array in a loop. A trivial example which removes a character from a null terminated string: void remove_char(char *s, char c) { size_t i, j; for (i = j = 0; s[i] != '\0'; i+
196.
▲
by
trealira
2y ago
Mistake: r = y; // won't compile This will compile. It will be effectively the same as "x = y". The pointer equivalent is *p = y". My apologies, as it's been a while since I've used C++.
197.
▲
by
trealira
2y ago
&value would be a pointer to that integer. Instead, it's using references, which also use the & character. References use different syntax, but they're like pointers that can't be reassigned. Examples: int x = 0;
198.
▲
by
trealira
2y ago
You might know, but you can set marks to go back when you scroll off. I have to admit it's not as convenient as the cursor just behaving like that automatically, though.
199.
▲
by
trealira
2y ago
I see I accidentally came off implying that I'm disaffected and take no sides - most of the time, right wing politics seems abhorrent to me. Those are the main things I remember because left-wing spaces tend to hate him, and I dislike
200.
▲
by
trealira
2y ago
A few things that I (as someone who doesn't follow Twitter) have heard about from anecdotes and from the news about why people dislike him: - He called some guy who worked for him a pedo for no reason, which he was sued over - Took ove
201.
▲
by
trealira
2y ago
Does transit not always involve a walk, even a small one? It's not like everyone lives next to a subway station, and most destinations aren't right next to a subway station either.
202.
▲
by
trealira
2y ago
> static duck typing What do you mean by this? Macros? C++ templates?
203.
▲
by
trealira
2y ago
It is common to use "they" for singular unknown people, e.g. "Someone left their coat here." I'm not OP, but since I don't know anyone on the Internet, I have the habit of using "they" for everybody,
204.
▲
by
trealira
2y ago
You're totally right, but just a minor correction: the word oui comes from oïl, which was the way to say "yes" in a family of languages called the langues d'oïl. [1] The word oïl is a shortened form of hoc ille
205.
▲
by
trealira
2y ago
I think they're saying the difference is between "played" and "have played." The difference is more distinguished in other verbs, like "ate" vs "have eaten." The word "ate" is the past
206.
▲
by
trealira
2y ago
I'll try to explain it. The article used F#, but I'll explain using Haskell, and first I'll explain dome Haskell notation, because I learned it while learning Haskell. In Haskell, you have types. Concrete types have names tha
207.
▲
by
trealira
2y ago
C is not the smallest or simplest language, but it's pretty small and simple. What's hard is writing large software in it (compared to other languages). It doesn't take that long to learn it, nor is it very difficult to learn
208.
▲
by
trealira
2y ago
Just realized I should have written one of these for the Constant evaluation: eval (Constant n) = Right n eval (Constant n) = return n
209.
▲
by
trealira
2y ago
It makes sense to go into debt to get out of a recession, like the 2008 one. But then during the good times of the economy, we should have been working on paying the debt; instead, we blew it and just took out even more debt.
210.
▲
by
trealira
2y ago
One thing is that pattern matching can make writing tree manipulation code succinct and easier to read. For example, take this article[0] that describes the difference list algorithm (in Haskell). Basically, it's kind of like a rope, b
More ›