Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
kbd
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
54 ms
·
301.
▲
by
kbd
7y ago
Despite controversy, walrus operator is going to be like f-strings. Before: "Why do we need another way to..." After: "Hey this is great". People are wtf-ing a bit about the positional-only parameters, but I view that as
302.
▲
by
kbd
7y ago
Sure. Something is generally considered more elegant ("nicer") when it has fewer terms. (I'm really happy with my own argument above why Python's indexing is "optimal".) But I'd put what I think you'r
303.
▲
by
kbd
7y ago
I don't think that's a correct reading. You're talking about this section, correct? > When dealing with a sequence of length N, the elements of which we wish to distinguish by subscript, the next vexing question is what su
304.
▲
by
kbd
7y ago
I wasn't arguing so much that it was "objective proof", but that in contrast to "The reason for zero indexing is historical, related to pointer offsets. I don’t think anyone chose them to be easier for people.", I w
305.
▲
by
kbd
7y ago
> The classic example is getting the last element of an array. Good point, in Python I don't notice that the last element is arr[len(arr)-1] because Python provides arr[-1]. I think in general your point is that it's natural fo
306.
▲
by
kbd
7y ago
I can't believe I'm jumping into the inevitable 1-based indexing discussion, but I'm surprised to see you say that one-based indexing results in "less "+ 1" or "- 1" things in your code". Most ar
307.
▲
by
kbd
7y ago
This I can agree with. Rust, appropriately, has special syntax for similar semantics.
308.
▲
by
kbd
7y ago
It's just syntactic-sugar. From the proposal ( https://github.com/golang/go/issues/32437 ): f, err := os.Open(filename) if err != nil { return …, err } is simplified to: f
309.
▲
by
kbd
7y ago
I'm excited/hopeful about Nim's prospects. The list of "high level languages with garbage collection and exceptions that compile down to an efficient native binary" is very small.
310.
▲
by
kbd
7y ago
Cats nails are naturally needle sharp, they can't help but hurt you if they catch. They actually grow out from underneath so as soon as new nail becomes exposed it's super sharp. Cats also have instinctual behaviors that involve s
311.
▲
by
kbd
7y ago
A couple of the things that make it much better for me are plugins: zsh-autosuggestions and zsh-syntax-highlighting. I think those are both fish-inspired, but getting those features in a bash/posix-compatible shell is the best of both
312.
▲
by
kbd
7y ago
Can't edit this anymore. pick-status-files = "!f() { git status -z | xargs -0n1 | cut -c4- | fzi --print0 | xargs -0to git "$@"; }; f" can just be: pick-status-files = !git status -z | xargs -0n1 | cu
313.
▲
by
kbd
7y ago
Yay. Btw, one more improvement. TIL xargs will skip blank inputs (depending on bsd/gnu xargs, flags etc...), so my version above: rif = "!f() { rev=$(git pick-commit); [[ $rev ]] && git ri $rev~; }; f" can ju
314.
▲
by
kbd
7y ago
Sure: https://github.com/kbd/setup Here's my git config with a bajillion aliases: https://github.com/kbd/setup/blob/master/HOME/.config/git/co... Since git comma
315.
▲
by
kbd
7y ago
This is a great idea, thanks for it! I've done similar things with using fzf to git add, git diff, and so on, but I hadn't thought of using it to pick a commit to rebase from. I made a few changes so I figured I'd post them b
316.
▲
by
kbd
7y ago
Just tested it and 'history -a' behaves how you say. Maybe it was an older version of bash that had this behavior. Edit: now I'm obsessing about reproducing this behavior from years ago! If anyone knows what I'm talking
317.
▲
by
kbd
7y ago
Yeah I know, I was just making a distinction from cortesoft's "I want everything I've ever done" in my history. I was saying "so do I, except I want active sessions separate" (which as you point out, they are
318.
▲
by
kbd
7y ago
Yes what I wrote doesn't exclude that. The only distinction is that you generally don't want all your sessions' histories interleaved. I.e. when you up-arrow, you only want your current session's history, without random
319.
▲
by
kbd
7y ago
Bash's broken history is what finally got me to switch to Zsh. The history behavior you want is: 1. each line of history is appended incrementally, but 2. each shell session only has access to its own history unless you specifically re
320.
▲
by
kbd
7y ago
It's frustrating when Internet articles don't include publication dates. It's not like it's paper where someone didn't think to record the date. The date certainly exists in the database, filesystem, etc, the auth
321.
▲
by
kbd
7y ago
> I'm not sure it's any better than CSV or PSV (pipe), and it also doesn't interoperate with existing tools. I think the point is that it's largely a formalization of what unixy tools already do.
322.
▲
by
kbd
7y ago
That actually seems to be the de-facto Python style. Even Guido said at some point that that's his convention.
323.
▲
by
kbd
7y ago
Thanks for mentioning that project. I'm wasn't familiar with it, but the difference seems to be that Jupytext is a tool to convert notebooks between ipynb and text formats, while VSCode supports the same format (#%% cell delimiter
324.
▲
by
kbd
7y ago
If you ever put notebooks in source control, you owe it to yourself to try the text-based notebooks supported in Visual Studio Code[1]. They're round-trippable with real (i.e. browser-based) notebooks, yet are much better for collabora
325.
▲
by
kbd
7y ago
I know that's the answer for running multiple sessions at once, but even if you're a tmux expert I don't see how people live with only one window . I constantly have multiple iterm windows open and frequently open new window
326.
▲
by
kbd
7y ago
How do people use Alacritty as a daily driver when it can't open more than one window?
327.
▲
by
kbd
7y ago
I keep all my config source controlled and have my own setup program that creates symlinks and so on, along with a "bootstrap" script that starts from a clean Mac and installs and configures everything I need: https://g
328.
▲
by
kbd
8y ago
See the top couple comments on this thread (from within the past month) by q3k: https://news.ycombinator.com/item?id=19254828 That should be impossible in Fuchsia.
329.
▲
by
kbd
8y ago
Agree about some of the inconsistency, especially in preferences. It really feels like creaking around old corners of the 20+ year old UI it is. Microsoft needs to work on that. Also swipe-typing on the keyboard doesn't work in all app
330.
▲
by
kbd
8y ago
I second this recommendation for anyone looking for a (non-Apple) tablet these days. The Surface Go is a good tablet and its built-in stand works really well. It's a "real computer" too, with a surprisingly usable snap-on key
More ›