Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
matvore
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
31.
▲
by
matvore
4y ago
I tried swapping CAPS and Ctrl, and I understand the appeal, but I guess I just like pressing Ctrl in the default row - sometimes swapped with superkey - with my palm.
32.
▲
by
matvore
4y ago
Huh? People use their fingers to press ctrl? :p
33.
▲
by
matvore
4y ago
For most terminal emulators (and not gVim or editors with Vim bindings), you can also use Alt+[first key you want to type in normal mode]. e.g. Alt+J to enter normal mode and go down one line. Or Alt+Space to enter normal mode and go forwar
34.
▲
by
matvore
4y ago
I sympathize a bit with the dislike of enum. We could also probably get away with replacing typedef's with either #define (for simple types) or one-field structs (for arrays and function pointers; the latter usually need a void* to go
35.
▲
by
matvore
4y ago
Would it be solved with a simple macro such that Ctrl+F2 (i.e. switch to menu bar, which is the way I mostly start to interact with UI using the keyboard) automatically reverted to Latin alphabet input? Hypothetically speaking.
36.
▲
by
matvore
4y ago
Interesting. I've always preferred the input source to be global rather than scoped-to-app. I can remember one input source but I can't remember for every open app, so I always know whether I have to switch. Are you switching betw
37.
▲
by
matvore
4y ago
If you use a font which doesn't have outline data Terminal.app and you set the rendered size to whatever is the native size of the font, Terminal.app will show you the unadulterated bitmap (if you use a multiple of the size, Terminal.a
38.
▲
by
matvore
5y ago
Some related trivia. The `errno` command, for looking up syscall error codes, is not installed in `/usr/bin` in macOS like on typical Linux distros. But the same information is available in `intro(2)`, e.g. $ man 2 intro | gre
39.
▲
by
matvore
5y ago
He's saying on that particular machine there was no video software installed.
40.
▲
by
matvore
5y ago
I am saying you indeed should have descriptive function names. I also agree that if the function's name leaves something to be desired then it should be commented. You are conflating function names--global and relatively non-contextual
41.
▲
by
matvore
5y ago
I just did this grep for single-character function names on the Mako codebase: grep -r '\<[a-z](' . And there were no matches. There were some one-character macros but they were macros repeated dozens of times in a loc
42.
▲
by
matvore
5y ago
I wasn't looking for something fast, as I'm happy to write some code in C anyway for something performance-sensitive, and most of the stuff I was going to write in Janet would be for interactive use. I was more interested in havin
43.
▲
by
matvore
5y ago
I did not hear of it before. Glancing at the website, it looks rather appealing (simple language, C-friendly FFI) but I don't see anything about using Gerbil in the shebang line for scripting purposes? I may give it a closer look somet
44.
▲
by
matvore
5y ago
Thanks for the tips. I will try to keep these in mind so I can stop thinking so much about trivialities. When I was using Java in my day job, I toyed with Clojure a bit and it was a pleasure. My favorite features were protocols and multi-ar
45.
▲
by
matvore
5y ago
> Is IPC Inter-Process Communication? Or is it an unrelated tool? The former. Piping with the shell, or C subprocess hosted by the Janet script, or vice-versa.
46.
▲
by
matvore
5y ago
Good question :) I actually haven't had a good excuse to use the C API yet. When I need C I just code the entire tool in C, or use IPC.
47.
▲
by
matvore
5y ago
I would say that if you're interested, go for it. My complaints about Janet are not too big. I feel like there are many ways to do some things, and they are all basically the same. Most of this excessive flexibility is inherited from C
48.
▲
by
matvore
5y ago
I am a happy though very new Janet user. I started migrating my existing workflow optimization scripts (e.g. Git wrappers) to--and writing new ones--in Janet as of a few months ago. I used to use Perl but I switched to Janet as it is a much
49.
▲
by
matvore
5y ago
Imperfect comparison but still valid. All lives are eventually lost causing some grief. (If I may summarize what you've said) Saying that a large number of coincident deaths causes a collective grief that wouldn't have happened ot
50.
▲
by
matvore
5y ago
This idea doesn't apply so cleanly in Python. The meaning of this: if x=$(foo); then ... fi is that the stdout of running `foo` replaces the contents of $x and the `if` evaluates the exit code of `foo`. Python doesn&#x
51.
▲
by
matvore
5y ago
`set -e` has a couple of surprising corner cases and in the details is pretty hard to understand. The documentation in `man bash` for the `set -e` flag is 28 lines in my terminal, and the other flags are 2 or 3 lines. One such corner case i
52.
▲
by
matvore
5y ago
> edit their messages days later to gasslight you That is a good point. I like to say `s/foo/bar/` to correct myself rather than edit the message. This is also important if people are receiving e-mail notifications
53.
▲
by
matvore
5y ago
> > grep . * > you can "cat *" The advantage of `grep . *` is that it omits empty lines and includes the source file on each matching line by default.
54.
▲
by
matvore
5y ago
> So it's likely that his avocados cannot be found elsewhere. Well, according to the video, there is a 1/10k chance an avocado tree is good each time you "roll the dice." For a sense of magnitude, there are on
55.
▲
by
matvore
5y ago
Interesting. Thank you for sharing.
56.
▲
by
matvore
5y ago
> The idiomatic way to solve that in rust is to re-bind to the same variable name. OK, that's reasonable. Is the idiomatic way to use optionals to introduce a layer of nesting? I prefer keeping functions very "flat"
57.
▲
by
matvore
5y ago
> Well if you have aesthetic objections to the way rust does it, I agree with GP that it is harder to maintain ("messy" they say) if there is more than one variable referring to the same value. It is not so subjective a
58.
▲
by
matvore
5y ago
> why not just return any old pointer type? Using a pointer type in a straightforward manner would entail allocating the object on the heap. If allocated on the stack it has obvious lifetime limitations.
59.
▲
by
matvore
5y ago
Can you give an example? The alternatives to goto cleanup; have drawbacks too - like being less readable (cleanup code is before the main function body or destructors do things implicitly).
60.
▲
by
matvore
6y ago
I love using Perl too (the real one, not Raku) for the same reasons, except I haven't even been using it as long as you (only 4 years or so). One other thing you can do with Perl is transition very smoothly from one-liner, to stand-alo
More ›