HNHacker News
TopNewBestAskShowJobs

jamespwilliams

2,548 karma · joined August 15, 2020

https://github.com/jamespwilliams

Submissions != endorsements

submissionscomments
jamespwilliams··on GNU Binutlis 2.37 has been released
iprmoatnt*
jamespwilliams··on Germany knew the floods were coming, but the warnings didn’t work
Unpaywalled version: https://archive.is/kgFIy
jamespwilliams··on Firefox 90
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... for more details for anyone else curious
jamespwilliams··on Generate a Git repository with 2^28 commits—one for every 7-character shorthash
You could set git’s pack.windowMemory option to (say) 128m to avoid git push OOMing.

I expect GitHub wouldn’t handle the push well anyway, though, as mentioned.

jamespwilliams··on Your CPU may have slowed down on Wednesday
Gmail does have a "Basic HTML" mode, FWIW.
jamespwilliams··on Etymological Wordnet
I played with this data a while ago and made a little project which could plot graphs of the etymologies of words: https://github.com/jamespwilliams/etymology.

I was thinking of deploying it somewhere but never got around to it.

jamespwilliams··on Helix: a post-modern modal text editor
I found it straightforward to install based on the documentation in the READMEs of both:

- https://github.com/nvim-treesitter/nvim-treesitter#quickstar...

- https://github.com/neovim/nvim-lspconfig#install

Just by following the instructions I had a pretty good setup already, but I made a couple of further changes, like setting up autoformatting on save, which was a bit trickier. `vim.lsp.buf.formatting` was useful there, but I had to do a bit of research to figure out how to use it (it wasn't immediately available on the READMEs).

jamespwilliams··on Helix: a post-modern modal text editor
Automatic refactoring etc is still a long way off being good in Vim.

But I’ve recently started using a combination of Neovim + treesitter + LSPs, and have found it incredibly powerful. Extremely responsive automatic compilation that feels instantaneous, good inline error messages, very good and fast syntax highlighting through treesitter... At what it does, I’d go as far as saying as it achieves more than any other IDEs I’ve tried. But of course, what it does is more limited.

At the moment I rarely even touch a mouse. I work primarily in Vim, with DWM as a window manager and a Vim extension in the browser. When I have to work in a different environment and use a mouse again, I find the constant context switching very distracting

jamespwilliams··on Oxide: The Essence of Rust (2020)
The most interesting parts of my comp sci degree were in this area - “models of computation”, and later “type systems for programming languages”, which started with lambda calculus, and culminated in studying Haskell’s type system (and its relation to lambda calculus).

It was surprising to me to discover how logical and mathematical Haskell’s type system is.

It’s the kind of topic that I’d probably not ever have thought about if I didn’t do a degree, but has had an impact on how I view other areas of computer science.

jamespwilliams··on Evolution of Random Number Generators
If you’re using Go, you can use rand.Perm (https://golang.org/pkg/math/rand/#Perm), which uses a Fisher-Yates shuffle under the hood.
jamespwilliams··on Swimlanes.io – generated editable sequence diagrams
draw.io is open-source and easily self-hostable, too.
jamespwilliams··on How to navigate directories faster with Bash (2015)
https://github.com/junegunn/fzf also has a “cd mode”, by default triggerable using Alt-C, which can be useful.
jamespwilliams··on Time flies in Google Earth’s biggest update in years
In theory Google could serve their URL shortening service on the root of their .google TLD (links like https://google/xyz123).

Would probably break some apps which don’t correctly handle TLD-only domain names though, I suppose.

jamespwilliams··on Getting better at Linux with mini-projects
sponge from moreutils is useful for this, eg

    cat a b | sponge a
jamespwilliams··on Java 1.0 Turns 25
And C++ and Python only 6 years...
jamespwilliams··on 'Too negative ': Welsh seaside images (1979)
It’s quite difficult to actually get there, for one...
jamespwilliams··on Ask HN: What are you working on?
Is the code for this available somewhere to look at?
jamespwilliams··on Show HN: Array – A Better Python List
Looks cool.

    bool (__bool__) Returns whether all elements evaluate to True.
I’d be worried that this will trip people up who use the

    if l:
        print l[0] # or whatever
pattern
jamespwilliams··on Show HN: Deckmill – affordable, high quality, language-learning flashcards
The fact that this is a $10 one-off fee is very attractive to me. There are so many subscriptions in the language learning world, it’s incredibly refreshing to see a product using a different model.

Also, you can use them with Anki. Perfect. I’m probably going to purchase. Hopefully they live up to expectations.

jamespwilliams··on Bitcoin price hits $40k less than three weeks after shattering $20K
Down to $37k now...
jamespwilliams··on Slack is down
Do you recommend it for use by teams?
jamespwilliams··on School or Prison
In the UK our prisons often look nicer than our (state) schools. Many of our prisons are quite ancient, whereas many of our state schools are 1960s monstrosities.

For example:

* https://hidden-london.com/wp-content/uploads/2018/04/geograp... vs https://upload.wikimedia.org/wikipedia/commons/4/47/James_Ho...

* https://i2-prod.mirror.co.uk/incoming/article1185483.ece/ALT... vs https://upload.wikimedia.org/wikipedia/commons/3/33/Cefn_Sae...

* https://ukhumanrightsblog.com/wp-content/uploads/2020/07/HM_... vs https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/We...

jamespwilliams··on Happy New Year HN
Didn’t expect to see Cymraeg here on HN!
jamespwilliams··on Why London’s NYE Fireworks Display Broke Economics Textbooks
s/in/is
jamespwilliams··on Great Britain road numbering scheme
https://en.wikipedia.org/wiki/Anomalously_numbered_roads_in_... amazing
jamespwilliams··on Git cake: when is my readme’s birthday?
If git is able to detect that the file was renamed - which it will if the only change to the file in the commit is the file’s name - it will work. I’m not sure whether this works if you also change the content of the file in the commit.

Same logic applies to git blame; file history is maintained for renames.

jamespwilliams··on Using GNU Stow to manage your dotfiles (2012)
I’ve been using stow to manage my dotfiles for a long time, works very well.

Recently I’ve moved to NixOS and have been considering trying out Nix’s home-manager (mostly just out of curiosity - I’m perfectly happy with stow). If anyone has tried both stow and home-manager, I’d be interested to know your thoughts on how they compare.

jamespwilliams··on Fun with IP address parsing
> ::ffff:169:254:169:254

Just to note, this should be ::ffff:169.254.169.254

jamespwilliams··on I thought I would have accomplished a lot more today and also before I was 35
I think you posted this comment on the wrong post, but anyway:

In this case, no, and it's actually slightly inefficient to pass those variables as arguments, because a copy of the argument has to be made. This copying matters more if the argument is a big struct or another large value.

However often it is useful to use arguments, for example when calling a goroutine in a loop. For example:

    for i := 0; i < 10; i++ {
        go func() {
            fmt.Println(i)
        }()
    }

vs

    for i := 0; i < 10; i++ {
        go func(i int) {
            fmt.Println(i)
        }(i)
    }
have different behaviours, because the first receives the (changing) `i` variable itself, whereas the second receives a copy of `i` at each iteration. The second behaviour is often the behaviour we actually want.

Something like

    for i := 0; i < 10; i++ {
        i := i
        go func() {
            fmt.Println(i)
        }()
    }
also works as expected.
← PreviousPage 5 of 5