Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
hddqsb
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
121.
▲
by
hddqsb
4y ago
As others have said, this article is not beginner-friendly. The book "Structure and Interpretation of Computer Programs" (SICP) is a classic introduction to Lisp (specifically Scheme), the full text is available online: https:&#x
122.
▲
by
hddqsb
4y ago
First time I'm hearing about `named-let` and tail call optimisation in Emacs, thanks for sharing! A clarification: Tail call optimisation in Emacs is not tied specifically to `named-let`, but it is tied to `cl-labels` (which `named-l
123.
▲
by
hddqsb
4y ago
I was about to post a similar comment. My version might be easier to understand, so here it is. ------------ The author confuses "apply" and "reduce" (aka "fold"). - `apply` calls a function once , passing it
124.
▲
by
hddqsb
4y ago
Hi! It looks quite polished for a weekend-style project :) But the "Current state" section is upfront about it. I should have noticed the commit date; I guess "archiving" the project would have sent a stronger signal. Pl
125.
▲
by
hddqsb
4y ago
Eh, that's just quibbling over the syntax. The `define` forms could be rewritten as `let` to make things look more "pure". (The only situation where `define` might be considered "impure" is if it was used to redefin
126.
▲
by
hddqsb
4y ago
Some comments in case the author is here: 1. You should make it clear in the README that this uses lazy evaluation, because most Lisps use strict evaluation. 2. `lambda` should have an implicit `begin` around its body to allow multiple form
127.
▲
by
hddqsb
4y ago
Ha ha, I had the same initial reaction. That's regular Nix code, which is used to run the Lisp code (the stuff between the first '' and the last '').
128.
▲
by
hddqsb
4y ago
The article's title refers to "code quality", but the word "quality" never appears in the body. The article is about the number of bugs , so I think a more appropriate term is " software quality" (more s
129.
▲
by
hddqsb
4y ago
(But also buggy...)
130.
▲
by
hddqsb
4y ago
This sounds very similar to Emacs' undo history, except Emacs doesn't implement the "window shopping" optimisation. Instead, Emacs has a command `undo-only` which is similar to `undo` except it will skip over undo-redo c
131.
▲
by
hddqsb
4y ago
This. To elaborate, the problem is that without the "window shopping" optimisation, you are forced to repeat all your "window shopping" excursions twice every time you want to go a little further back in time. To ill
132.
▲
by
hddqsb
4y ago
Update: It used to be possible to set the Display URL field to an arbitrary value, see for example https://www.youtube.com/watch?v=AQFR8eJlYxQ&t=100 (2015). Maybe it's still possible somehow.
133.
▲
by
hddqsb
4y ago
That's a good theory, but I don't think it's what happened here. The ads are gone for me now so I can't verify, but when I did get the ad I checked the network monitor and I'm pretty sure there were no redirects via
134.
▲
by
hddqsb
4y ago
Do you know how that can be done? Based on the video https://www.youtube.com/watch?v=jx-gl6K2zQw it looks like only the display path can be edited (not the domain).
135.
▲
by
hddqsb
4y ago
Just to avoid no confusion, the issue here is that the URL displayed in the ad (and also when hovering over it) has a different domain from the page the user lands on when they actually click the ad. It's not about whether the advertis
136.
▲
by
hddqsb
4y ago
That's what I thought too, but I managed to get the malicious ad and confirmed that it's a destination mismatch in Google Ads rather than an open redirect (no requests to gimp.org in the network monitor).
137.
▲
by
hddqsb
4y ago
EDIT: There is definitely a mismatch between the display URL and the landing page URL. It's not clear to me how that can happen; for example https://www.youtube.com/watch?v=jx-gl6K2zQw shows that only the display path
138.
▲
by
hddqsb
4y ago
> Check if the first arg is `-h` or `--help` or `help` or just `h` or even `-help`, and in all these cases, print help text and exit. `-h` and `--help` are fine. But `help` and `h` should only display the help if the script has subcomm
139.
▲
by
hddqsb
4y ago
You can allow more zooming on the Mandelbrot Set by increasing maxIterations. (Note that the colours will change because of the way the code is written. Also, it will require more computation, so it's probably a good idea to only incre
140.
▲
by
hddqsb
4y ago
It works in bash/zsh/ksh but not in sh/dash. Examples: for i in 1 2 3 4 5; { echo $i; } for ((i=1;i<=5;i++)) { echo $i; } (It doesn't work with `while` loops, at least not in bash.)
141.
▲
by
hddqsb
4y ago
Tip: You can use { } instead of do/done to emulate C syntax. Aside: [[ -v x ]] tests if the variable x is set. It should probably be [[ x -ne 0 ]] to match the example from the parent.
142.
▲
by
hddqsb
4y ago
> ...although I just tested it, and the increment and 0-padding only work in non-interactive mode ='( Works for me... $ echo $0 # determine current shell (alternative: "ps -p $$") bash $ echo {01..100..20}
143.
▲
by
hddqsb
4y ago
The article briefly mentions a hypothetical static method "readln", which would help with reading input.
144.
▲
by
hddqsb
4y ago
> But math never decreed that sine and cosine have to take radian arguments! To quote a really important comment posted by Eduardo Vasquez on the article: > [...] all those formulas of derivatives and primitives of trig functions i
145.
▲
by
hddqsb
4y ago
Correct (actually a linked list of blocks[1]). It supports insertion and removal from both ends in O(1), which is very useful. However, it does not support insertion and removal from the middle (via an iterator) in O(1), so it's not a
146.
▲
by
hddqsb
4y ago
The author is confused, their Prolog implementation is clearly a left fold! I'm only half joking :) To elaborate: The variable names "ACC" and "RES" suggest the predicate should be viewed as a left fold, because whe
147.
▲
by
hddqsb
4y ago
EDIT: They appear to be A/B testing the email requirement, at least on reddit.com ( https://news.ycombinator.com/item?id=32438251#32448986 ).
148.
▲
by
hddqsb
4y ago
They appear to be A/B testing the email requirement. I tried reddit.com on desktop again just now, and in some sessions it lets me skip the email but in others it says the email is required.
149.
▲
by
hddqsb
4y ago
Yes. My proposed fix takes O(P * T) time and O(1) memory (but it only supports glob-style wildcards; it doesn't support repetition of specific characters / character classes / sub-patterns).
150.
▲
by
hddqsb
4y ago
[Note: This comment tree is about the Redis code, which uses glob-style patterns rather than regex. So in this comment and in my grandparent comment, "*" means "any string" rather than "zero or more of the previous
More ›