HNHacker News
TopNewBestAskShowJobs

jsmeaton

3,857 karma · joined December 16, 2012

Head of Engineering at Kraken Technologies (Australia) https://kraken.tech/

Former Django core developer.

josh.smeaton@kraken.tech

submissionscomments
jsmeaton··on Ask HN: What happened to Twitter poison pill?
It wasn't immediately obvious to me how to sign up without buying a subscription, but https://twitter.com/matt_levine/status/994296126055608320?s=... provides a link to do just that.

I've read a few articles here and there but this was the motivation I needed to properly subscribe.

jsmeaton··on Python’s “type hints” are a bit of a disappointment to me
I really like C# and have done a bunch of work with it in the past! But I also love Python for reasons other than just static vs dynamic typing.

To be honest, I think a lot of Python [or arbitrary dynamic language] developers can be quite sloppy, throwing dictionaries around everywhere because it's easy and leading to some really hard to read code. Type hints guide people away from that sloppiness while still allowing access to most of the features that make dynamic languages so useful and expressive.

It's a best-of-both-worlds situation and I'm here for it.

jsmeaton··on Python’s “type hints” are a bit of a disappointment to me
You can pipe the diff into specific flake8 checkers. Disable the check by default so it's not run over the entire codebase, and have a separate line for running specific checks on just the diff. Eg:

git diff -U0 --relative origin/master... | flake8 --diff --select <custom-codes>

I'll leave the flake8 plugin as an exercise to the reader as ours is intertwined with code I can't share right now.

jsmeaton··on Python’s “type hints” are a bit of a disappointment to me
Adding type hints to Python has increased my productivity by at least a factor of 10. They allow you to reason about code in a local function without having to track back up dozens of call sites to ensure you're getting what you think you're getting. That alone is worth the price of admission. Both when editing code or reviewing someone else's. It's fantastic, particularly in a very large code base.

The editor experience only increases that factor as you can navigate a lot more freely. Even for small code bases type hints are a revelation. Knowing if something is nullable or not, alone, has caught 100's of bugs in waiting.

Most of the complaints here feel like attacking a strawman, particularly the ones arguing what's the point if you're not running mypy. Run mypy! It's like saying what's the point of writing unit tests if you don't run the test suite. For any sufficiently large code base you absolutely should be running mypy with any plugins for your framework of choice added.

For heterogeneous dictionaries use `dict[str, object]` and then you're forced to use the existing duck-typing mechanisms you're used to. Or, you refactor into better types and/or structures.

Is there friction? Sometimes. You don't have to annotate everything. If the cost is too prohibitive for a particular structure or function, ignore it. Sometimes there are mypy bugs that make writing correct code impossible. # type: ignore[reason] that sucker. Don't throw the baby out with the bath water.

We use a flake8 linter to enforce that all new or modified functions at least annotate their return type which makes interacting with functions quite a bit nicer, and encourages all devs to at least do the minimum. Usually you find that most args are appropriately typed at the same time.

jsmeaton··on Changing std:sort at Google’s scale and beyond
Then would a better interview technique be something like - here is a spec for an algorithm. Now implement it. I see very little value in having people studying algorithm implementations for interviews.

Of course, knowing about specific algorithms is handy, and adjusting the question to find an appropriate spec to implement for a given problem could be a nice touch.

I think that either approach above is strictly better than implementing algorithms from memory and would produce a far better signal.

jsmeaton··on Heroku Security Notification
Both heroku and travisci were affected? I wonder if and what the common vector would be for two major providers to lose their OAuth tokens.
jsmeaton··on Block a tweet, its author, and every single person who liked it
You can't think of a single good use case for a tool like this? Consider receiving a bunch of hate-tweets based on some physical aspect of your appearance.
jsmeaton··on Zero-Configuration Django and React
Has anyone used this library before? It looks very very nice. Type safe templates would almost be a win on their own, but being able to use the full power of react to customise views and forms without all of the ceremony of buying into the full react ecosystem sounds like a real sweet spot.
jsmeaton··on Hidetaka Miyazaki sees death as a feature, not a bug
Yep great observation. I started my first FromSoft game last week - Demons Souls remake - and I had no idea what was going on. Making very little progress and restarting levels over and over. So I decided to follow a guide and the game has become so much fun. It’s quite a bit easier because I’m not dying thousands of times to find which way to go. But I wouldn’t have kept at it otherwise.
jsmeaton··on Australian state sets minimum pay for Amazon contractors
Are you talking about Australia Post? If so, the numbers I’m finding are $27-$28/h part time gigs that include leave etc. Are you seeing different numbers or have I got the wrong company?
jsmeaton··on On the Future of 12ft
I’m not confused and I don’t really understand why you think I am.

I believe the content that is indexed is the content you can see. Sites used to be penalised, heavily, for returning different content to google. Hiding the paywall for google falls into that bucket.

At a minimum the search results should display if they’re paywalled and provide tools to exclude that content from results.

jsmeaton··on On the Future of 12ft
Then search engine crawlers should get paywalled too.

The motivation is correct. You run a search on google and get mostly paywalled content. I'm fine with news sites requiring subscriptions to view their articles but they shouldn't also get the benefit of being listed at the top of search results for key terms.

Alternatively, the search list should show if content is paywalled or give you search options to remove paywalled content.

jsmeaton··on America’s Covid job-saving programme gave most of its cash to the rich
> Crafting a targeted policy would have been hard, expensive and slow.

How about simply stating that any firm paying dividends to shareholders or bonuses to execs could not have the loan forgiven? It wouldn't be perfect but it'd cut out the most egregious snakes. Hindsight yadda yadda.

The same thing happened in Australia. Cash to businesses who could show an impact by Covid, but a lot of that money went towards bonuses and dividends. Crazy.

jsmeaton··on Black, the uncompromising Python code formatter, is stable
I think most people felt the same way when adopting black in the early days, I know I did. But you get over it pretty quickly. Now single quotes look so wrong to me.

I also always hated single quote docstrings even in single quote code bases.

jsmeaton··on Do svidaniya, Igor, and thank you for Nginx
I know zero Russian, or any other language other than English. I had a very similar reaction to you. It sounded almost like an obituary.
jsmeaton··on Ask HN: How do you take care of yourself?
Thanks so much for this it's going to help a tonne. When I get a chance I'll pop over and have a chat with them. Casually searching different stores and deals online was a horrible experience, so this is a great motivator to finally pick up some gear.
jsmeaton··on Best Wordle guessing strategy
Agree. I used one of the strategies over a couple of days and it took all of the fun out of the game. Switching to hard mode brought all of that fun right back.

If you're going to write a program to optimise your guesses then why not just go to the source and pull the answer straight from the encoded answer list? I know people derive fun from these things in different ways but that's kind of where I landed.

jsmeaton··on Ask HN: How do you take care of yourself?
I’ve been half seriously looking for equipment (squat rack, bar, bench) for a little while but am having a hard time of it. Can you recommend your gear? I’m also in Melbourne so brands specifically would be helpful.
jsmeaton··on Fortification, Part V: The Age of Industrial Firepower
I’ve really been enjoying this series and others from the same author. Most blogs I subscribe to are tech related and this is one of few that are not. I’ve been on a bit of a war movie/doco binge lately and these articles have slotted in nicely.

Are there any other blogs similar to this one in content that people are enjoying?

jsmeaton··on Advent of Code 2021 with PostgreSQL
Heh I wondered the same thing, but the README says he may not complete every challenge. I actually did the first problem in SQL, and learned a bit about window functions and bounding the range it covers:

https://github.com/jarshwah/advent-of-code/blob/main/sql/202...

Though now I know you can ignore the window and just compare against the 3rd offset, the first solution just needs a `LEAD(depth, 3)` to complete the second question.

Still - I learned about `RANGE BETWEEN` so I'm calling it a win.

jsmeaton··on Dick Smith (Entrepreneur)
Are you talking about the Kogan-clone that took over the online store about 5 or 6 years ago, or prior to that? The online part of the business was sold off to Kogan and became another online store front.
jsmeaton··on Apple buying Google ads for high-value subscription apps
There are pros and cons. As one example my son purchased $500 of skins in Fortnite on Nintendo (I had the card saved, my fault since corrected). Trying to get that refunded was a huge drama because I had to go via Nintendo rather than Epic. In this specific scenario I would have preferred a first party resolution.
jsmeaton··on DJI Mavic 3 Drone
Unsure if I'm just using it wrong, but with a scrollwheel on desktop the jank is *awful*. Same goes with the Apple marketing release sites.
jsmeaton··on Seeding oceans with volcanic ash could be new tool to tackle climate change
Not so. We’re not getting to 0 pollutants any time soon, so to reach a net 0 (or negative) amount of carbon we’re going to need to remove what’s already there.
jsmeaton··on Use of GitHub Enterprise
Yes that's a fair lens to view this situation with, I think, and I've stated a similar view in a sibling comment.
jsmeaton··on Use of GitHub Enterprise
I don't know that they're trying to get away with anything. From reading some of the linked blog posts and issues, it sounds like some people involved in the management of the DNF effectively consider all projects beneath the DNF umbrella to be theirs to administer and change as they see fit.

And it sounds like the maintainers, rightfully, are wary about continuing with the DNF particularly because they haven't been consulted in years.

jsmeaton··on Use of GitHub Enterprise
> The bulk of the projects were migrated around August 2020. This was achieved by filing a GitHub support ticket. This also required an admin user in the org to confirm the changes, for which the dnfadmin user account was used.

Wow. They filed a ticket and then secretly used an admin bot user to accept the change? That sounds incredibly dishonest - not just an oops situation there.

jsmeaton··on Sweden must repay $1.6M in Bitcoin to convicted drug dealer
Oh, I understand why it's happened in this particular case. It's a loophole they'll be closing for sure. My comments were directed at the parent:

> what proceeds should be stripped if you get cash in exchange for drugs and use that cash to buy GME calls which skyrocket?

> but the actual proceeds at the time of the crime have a specific value

The specific value at the time is, in nearly every other situation, irrelevant. The mistake was putting a claim to a monetary value of *asset* rather than the *asset* itself.

jsmeaton··on Sweden must repay $1.6M in Bitcoin to convicted drug dealer
If you use the proceeds of crime to buy a house then can't that house be seized (jurisdictions probably have different rules, but..)?

The house is then auctioned off. It's not valued at the time of arrest and any additional value returned to the person arrested.

I don't understand why it could, or should, be any different for electronic stores of value (stock, options, crypto).

jsmeaton··on Building a Django driver for Psycopg 3
Casually building a django db backend as an acceptance test. Nice work and great write up!

I had déjà vu reading the section on bind parameters in aggregate queries. The oracle backend had a similar issue that was fixed/hacked by comparing values and grouping them into named parameters. https://code.djangoproject.com/ticket/27632

← PreviousPage 4 of 34Next →