HNHacker News
TopNewBestAskShowJobs

craigds

1,106 karma · joined July 23, 2013

Software Engineer @ Koordinates in New Zealand

github.com/craigds koordinates.com

submissionscomments
craigds··on Postgres Full-Text Search: A search engine in a database
Unfortunately I don't know enough about elasticsearch to provide a useful comparison. I like the way ES queries are structured JSON instead of obscure compact querystring parameters, but that's not a good reason to choose one over the other :)
craigds··on Postgres Full-Text Search: A search engine in a database
This is the key one for us that makes Postgres a non-starter for FTS (We use postgres for everything else)

We begrudgingly use Solr instead (we started before ES was really a thing and haven't found a need to switch yet)

When you get more than about two different types of filters (e.g. types of filters could be 'tags', 'categories', 'geotags', 'media type', 'author' etc), the combinatorial explosion of Postgres queries required to provide facet counts gets unmanageable.

For example, when I do a query filtered by `?tag=abc&category=category1`, I need to do these queries:

  - `... where tag = 'abc' and category_id = 1` (the current results)

  - `count(*) ... where tag = 'def' and category_id = 1` (for each other tag present in the results)

  - `count(*) ... where tag = 'abc' and category_id = 2` (for each other category present in the results)

  - `count(*) ... where category_id = 1`

  - `count(*) ... where tag = 'abc'`

  - `count(*)`
There are certainly smarter ways to do this than lots of tiny queries, but all this complexity still ends up somewhere and isn't likely to be great for performance.

Whereas solr/elasticsearch have faceting built in and handle this with ease.

craigds··on Zip – How not to design a file format
yeah, fair enough, they seem useless
craigds··on Zip – How not to design a file format
re the streaming thing, I assume the intent is that a server can stream a zipfile trivially while generating its contents on the fly. and then write the central directory at the end. It can't easily be read while streaming, but it's a great choice for writing a stream
craigds··on Sponsored-By Proposal
I believe Git normally refers to these things as "trailers" [0], which seems more accurate since they usually (always?) Follow the commit message rather than preceding it.

[0] https://git-scm.com/docs/git-interpret-trailers

craigds··on Keeping Up with Docker Official Images
seems like we need the equivalent of a lockfile for dockerfiles. i want to build from a sha256 tag, but I want that to be based on a readable tag which is updated via pull requests by dependabot/renovatebot/etc.

that's essentially what this article is doing, but where is the readable tag stored; is it im source control somewhere? it needs to be, otherwise how can I understand it and update it locally?

craigds··on Life after an internet mob attack
> isn't that much

16 thousand people follow him. That's way more than enough to be considered a 'public person'

craigds··on UltraEdit Text Editor
"real refactoring" isn't generally available to those of us using dynamic languages like Python (or at least I've never seen it done well) so multiple cursors is about the best we can get unfortunately.
craigds··on Why is it so hard to see code from 5 minutes ago?
In Sublime Text I actually use a quick Undo-then-Redo to navigate, of all things.

I'll be typing some code and realise I need to check whether the imports at the top of the file are correct.

So I'll Cmd+Up (go to the top of the file) and see that yes, they are correct. Now I have to get back to where I was.

A quick Cmd+Z,Cmd+Shift+Z does the trick - Undo (takes me back to the code I was editing, and undoes some of it) and Redo to put it back to how it was. Works well, but would mess up this researcher's statistics.

(I absolutely do also use the undo stack for looking at the last few minutes of history too, that's really valuable)

craigds··on Clubhouse’s Inevitability
I got really confused when this didnt start talking about tickets and epics and project management ( https://clubhouse.io/ )
craigds··on Don't use functions as callbacks unless they're designed for it
*in Javascript.

In most other languages where unwanted extra arguments raise an error instead of being silently ignored, this mostly isn't a problem

craigds··on Laser-Guided Lightning May Help Prevent Wildfires
This was my first thought while reading the article - surely if we can intentionally get hit by lightning, we can find a way to harness that energy.

https://engineering.mit.edu/engage/ask-an-engineer/is-there-... discusses the idea a bit. TLDR is: it probably isn't worth it :/

craigds··on GitHub isn't fun anymore
Github's a work tool, not somewhere you go to have fun.

This is a weird article because its main point is about the 'Trending page', which is something I've never heard of in the last 10 years of using github heavily.

I'm vaguely aware there are some social features of github (you can apparently star repos, for instance) but I'd assume hardly anyone uses that stuff...

craigds··on I was blackmailed – any YouTuber could be next
No one's saying not to have algorithms involved at all. Humans don't have to review all of the content, just the stuff the algorithms are unsure about, as well as takedown/review requests.
craigds··on The World's Longest Alphabetical Email Address (2004)
It can be detected, just takes a bit more work (look up the domain's nameservers, see if they point to fastmail, if so rewrite the email address)
craigds··on GitHub is now free for teams
However, looks like the Actions minutes included in the Team plan have dropped from 10K to 3K, so if you're currently paying for a team plan and using Actions your costs might not decrease, or might increase a bit
craigds··on Incarcerated and Facebook
Why do they even have this process? Who cares if someone in prison uses Facebook? This is pretty absurd.
craigds··on How Facebook Avoids Ad Blockers
I wrote a greasemonkey script that runs every 250ms and blocks these. It might be hard with CSS but it's (almost) trivial with a spot of JS
craigds··on The GitHub registry public beta is live
git urls are tricky to use with many tools (like pip-compile) though. At best they're slow, since things like "what's the latest version?" require downloading the repo.

We forked some things into a private DevPI instance at present for that reason (well, also for latency)

craigds··on The GitHub registry public beta is live
Still no python support :(
craigds··on Parsing JSON Is a Minefield (2018)
Yeah I don't believe I've ever seen a json parsing problem in 11 years of software development.
craigds··on The Door Problem of Combat Design
I agree. Until I got to the end and discovered the super gravity gun. Then I used a cheat to start over with that gun and play the whole game with it. So satisfying
craigds··on Comic Code – Monospaced interpretation of the most over-hated typeface
I've never bought a font before. These seem crazy expensive. Is this kind of pricing normal?

I'd expect to pay maybe a dollar or two for a font; it really doesn't seem like it would provide enough value to be worth more than that.

craigds··on What's Coming in Python 3.8
Yep, I can't wait to use the walrus operator. I just tried it out (`docker run -it python:3.8.0b2-slim`) and I'm hooked already.

Also, it's times like these I'm really glad docker exists. Trying that out before docker would have been a way bigger drama

craigds··on Vulnerability in the Mac Zoom client allows malicious websites to enable camera
A few of our team had the Zoom app installed, but no-one had a running webserver on that port. None had used the app in a long time though.

Was this maybe added in a recent version, and perhaps they just haven't updated?

craigds··on Evernote Blows Up the ‘Fail Fast’ Gospel
I never had a use for Evernote, but I was always bitter towards them after they bought and gutted Skitch. Skitch was amazing
craigds··on OctoLinker: a browser extension for GitHub
I was browsing a Ruby file today and clicked a variable name and github showed me where that variable was used elsewhere in the project. It was pretty cool.

I have to assume that's coming to other languages soon, in github itself. Looking forward to Python getting it

craigds··on Abusing SHA-1 collisions for Chromium updates
Why would Chrome return non-deterministic bytes for a versioned release?
craigds··on GitHub Package Registry Will Support Swift Packages
Is there any reason why Python isn't supported?
craigds··on Show HN: Endoflife.date – Site with EOL dates of everything
The Ubuntu page is a little confusing. The "security support" on that page appears to be "Extended Security Maintenance" which is available for kernel security updates, and only if you have a subscription to the Ubuntu Advantage.

Normal security support is over for Ubuntu 14.04.

← PreviousPage 2 of 8Next →