HNHacker News
TopNewBestAskShowJobs

squaresmile

426 karma · joined May 26, 2017

squaresmile@protonmail.com https://github.com/squaresmile
submissionscomments
squaresmile··on We are far from a better Heroku for production apps in a hyper cloud
Yeah, I agree with the comments that the "for production apps" distinction is a bit weird. I would title it "We are building a Heroku-like experience for big cloud providers".

I can see the point of a service like this and the comparison is cool but there's no need to complain about Heroku, especially when the Gitlab services are not 100% equivalent. If you come for the champ, you'd better not miss and all that.

squaresmile··on Apple has gone to extraordinary lengths to make scroll bars invisible
Hah if your Github repo name is at the right length, you'll get that bug with the fork pop-up window.

[0] https://i.imgur.com/dS5acnx.gifv The gif doesn't have enough fps. IRL the animation is about 10x faster than that so there's no time to click the username.

Reported it but the support agent couldn't reproduce ¯\_(ツ)_/¯

squaresmile··on I don't want to learn your query language (2018)
I couldn't find exactly an only Core example that you are looking for in the examples folder [0] so here is a more complicated tutorial query [1] and here's how I use Core in my project [2] (mostly short select statements so not really a comprehensive demonstration of SQLAlchemy Core's capabilities).

[0] https://github.com/sqlalchemy/sqlalchemy/tree/master/example...

[1] https://docs.sqlalchemy.org/en/14/core/tutorial.html#common-...

[2] https://github.com/atlasacademy/fgo-game-data-api/tree/maste...

squaresmile··on The new Google Pay repeats all the same mistakes of Google Allo
I mean they depreciate the old app and force upon us the new app. I don't think you can look too much into the download number.
squaresmile··on The Pretty JSON Revolution
The human style format reminds me of the default format of js-beautify [1]. We use it to get the "human-style" instead of the "One Line Per Node" for a project where we store json files in a git repo. That way the git diff is pretty easy to read and not bloated. Too bad, not many tools have the "human-style" option.

[1] https://github.com/beautify-web/js-beautify

squaresmile··on Changes to LastPass Free
I agree with other comments that in the current market, Lastpass is not worth it at $36/y. The way they increased the price is arguably more annoying than the price tag.

I happily paid for Lastpass at $12/y. Logmein raised price and I switched to free. Logmein limited free capabilities and I will switch to Bitwarden or 1Password and pay them. I'm not staying with Lastpass to get the rug pulled out under me the third time.

squaresmile··on Python’s tug of war between beginner-friendly and advanced features
I assume you meant using leetcode's editor without type checking then yeah, there's much less benefit using type hints there.

In my vscode setup with mypy strict, pylance basic and python 3.9 though, type hints all days for me. I personally forget the arguments types like 1 second after I write the function. Maybe I'm conditioned by typed python.

Leetcode codes usually have simpler data structure and without 3rd party libraries so that's even easier to add types for.

Edit: Oh looks like Leetcode python code template has type hints

squaresmile··on Python’s tug of war between beginner-friendly and advanced features
Interesting, I'm using this [0] to test and got different results. The Pythonic function is 2% slower on 3.9.1 AMD 4900HS but 17% faster on 3.9.1 E5-2660 v2 VPS and 6% faster on 3.6.9 i5-3570S bare metal.

I personally think either function is fine. The max finding code pattern in the long function should be familiar to most. For the Pythonic function, I don't think it's less obvious enough to matter. You have a list of stuffs and you want to find the max so you wrap it in the max function. Maybe zip(xs, xs[1:]) can take a bit to recognize but I think it's eh. For the Pythonic one, one can also write

    all_diffs = [x2-x1 for x1, x2 in zip(xs, xs[1:])]
    return max(all_diffs)
Using list is also markedly faster than the Pythonic generator for me, which is to be expected: ~16% faster than both.

[0] https://gist.github.com/squaresmile/8dd08898851a4e19359cdb30...

squaresmile··on It’s time for a new, progressive supply-side economics
If one considers everything spent on health insurance companies a waste, which I disagree with, one should look at the loss ratio to see how much the insurance is extracting. In the linked report, the loss ratio is 84% so the insurance companies extracted ~16%.

The comment by orwin says that 22% is spent on bureaucracy in France public healthcare. 16% doesn't look that bad.

I'm not saying US healthcare doesn't have problems and there aren't some weird practices but if you can't measure or identify the problems correctly, you are not going to fix it.

squaresmile··on FastAPI framework, high perf, easy to learn, fast to code, ready for production
Another thumb up from me for whatever it's worth. Thanks to FastAPI, I was able to create an API for the community with very little experience, in turn enabling a bunch of downstream apps to be made: a bunch of Discord bots, a few calculators, a few websites.

For the front-end, we have a React/Typescript website that is quite easy to extend. The original programmer did a great job organizing the site but I do think FastAPI and React/Typescript helped us along the way.

squaresmile··on I no longer trust The Great Suspender
I'm pretty sure if you enable Extension Developer Mode, you won't get that nagging message on launch.
squaresmile··on Soyuz spacecraft digital clock teardown
This is not academic writing though. This is an interesting story posted on somebody's blog. If I tell my friends a cool story, I would need to walk them through the story and drop the punch line/conclusion at the end. I also enjoy it very much when somebody tell me a story that way. Not everything, even technical teardown, needs more efficient allocation of effort.

Interestingly, this is the second time I see this kind of comment recently and turns out it's from the same person. Maybe I'm on HN too much.

squaresmile··on Amazon Echo Flex: Microphone mute button appears to be real and functional
I personally enjoy a good story. I think articles like this are about the story as much as if not more than their informational aspect. They are kind of like cool stories you tell your friends. You can see it the conversational sentences in this article.

Especially if it's an article and not a video when I could easily skim to the end to read the conclusion if I don't want to read the story. I feel disrespectful towards the author if I want the conclusion up front.

squaresmile··on Amazon, Apple and Google Cut Off Parler
I don't think that's a fair comparison. You can switch from 10S to normal mode in a few buttons.

https://support.microsoft.com/en-us/windows/switching-out-of...

squaresmile··on YouTube-dl has received a DMCA takedown from RIAA
I agree that they probably shouldn't have done this legally but programming wise, those videos are special (and that's why they are in tests) and looks like only VEVO can upload special videos like that and not a random pleb.
squaresmile··on Japan’s lost generation is still jobless and living with their parents
> When the discussion is about economics (the topic I have studied at uni) most comments are just plain wrong and show a complete ignorance about the topic.

I think curating a discussion board to have knowledgeable discussion about many things is a really hard task. On many professional boards, discussions about other subjects are put into an OT corner. HN doesn't split discussions into topics so I guess expectation of comments' quality carries over.

I would just make a mental note: Oh this is not about CS/privacy/programming and adjust accordingly.

I suppose it's one of the reasons one should acquaint themselves with people from a variety of backgrounds and don't run away when others are not as knowledgeable about CS/privacy/programming. Actually

squaresmile··on Tables: Tracking work for teams
I can't believe after years of fiddling with a bottom bar (Home/Duplex/Duet), they couldn't figure it out and just scrapped the whole thing. The killedbygoogle meme is probably exaggerated a bit but I feel like this whole saga just screams a lack of direction.

Also, like all google's mobile apps, the iOS version is just straight up better: https://apps.apple.com/us/app/google-chrome/id535886823

Looks like there's a new flag chrome://flags#enable-conditional-tabstrip [0]. Here we go again.

[0] https://www.androidpolice.com/2020/07/15/chrome-84/

squaresmile··on BlackRock Is Bailing Out Its ETFs with Fed Money and Taxpayers Eating Losses
I'm only a random passerby in finance/economics but I have seen a few blogs like this upvoted on HN. Those blogs are usually (or at least advertised to be) run by a single person (in this case, a couple). When I go to the blogs' about pages, that person barely has any experience working in finance or econ. People with past history of making money get predictions wrong all the time and here we are with bloggers who have never been in the game.

Come on HN. Surely there are better sources that share these opinions.

squaresmile··on But no, 80-column terminals in 2020 isn't “reasonable” any more
From the comments here, I guess we are so. I have a 1080p 14 inch laptop and with Consolas at 15px and it's pretty much exactly 2 panes of 80 chars in vscode.

I would increase the limit if I can fit more though and I don't mind accommodating others who prefer a higher limit.

squaresmile··on Hypermodern Python
> although you don't have the clean pyproject-dev-prod/lock file separation

That's why I use "poetry export -f requirements.txt > requirements.txt" instead of pip freeze. It only exports prod requirements from the poettry lock file.

squaresmile··on Hypermodern Python
I probably haven't bought into all of poetry yet but for deployment, I have been using "poetry export" to get the pinned requirements.txt, commit it to the repo and install to a virtualenv. A bit of work to keep it in sync with the poetry dependency file but that's ok.

For PATH with cron or others, I use the full path to the virtualenv such as /path/to/project/.venv/bin/python. The path can be extracted by "which" or "Get-Command" when the venv is active.

Using a python version different from the system python version is probably the messiest part but well, targeting 3.6 is alright.

I do agree it could be better and it's not quite as streamlined as other ecosystems.

squaresmile··on Show HN: A syntax highlighter for Git and diff output, written in Rust
I settled on --plus-color="#157330" --minus-color="#731525".
squaresmile··on Why are Soviet math textbooks so hardcore in comparison to US textbooks? (2017)
I think OP's comment focuses on the average outcome and your comment is about the education process. I think both are right. While there are stark differences in the process, the average outcome is probably not much different. Students not in the US can do harder problems in their final exams but how much of that comes from actual understanding of math. How much is retained a day or a month after the exams? This is about the average student, mind you. From my short talks with math educators in the US and in a Soviet-like system, I got the impression that the average math student is a mess in math in both cases.

There are probably more people on the long tail of math talent here so it's understandable their impressions on the two systems are much different. OP's comment also talked about the pipeline for gifted kids and he concurred that the Soviet style is effective for training those students.

squaresmile··on The Decline of Usability
I'm using this userstyles that hide the sidebar when the window width is less than 1500px.

[0] https://gist.github.com/squaresmile/47ed504ba2838f51be451518...

squaresmile··on Windows Subsystem for Linux 2 Moving into General Availability
I feel like they don't advertise this enough. I was under the impression that it's a one way street from wsl1 to wsl2. Since wsl2 is not strictly better than wsl1, it's nice to be able to convert and pick the trade-offs you want.
squaresmile··on Make Linux Fast Again (2019)
which is used to get

> All of the important things, like passwords and emails and secret keys, are in user space memory or in the user readable file system, generally...

In this scenario in OP's comment, user accessible stuffs are still more interesting than kernel things.

squaresmile··on Ask HN: What is the best way to modify the metadata of audio files in Python
It's probably mutagen.
squaresmile··on Apple acquires Dark Sky
His timeline is messed up. A year ago, Weather Timeline got pulled from the app store because sales wasn't covering the API cost. After a month or two, it got sold to the company that made MyRadar.

https://www.reddit.com/r/androidapps/comments/9gti4r/rip_wea...

https://www.androidauthority.com/weather-timeline-android-ne...

squaresmile··on Honda bucks industry trend by removing touchscreen controls
For some more info: https://www.reddit.com/r/aviation/comments/cmypjd/the_finger... It's fun thread. You can catch some actual military pilots there.
squaresmile··on Problems with Japan's Covid-19 reports
I found tabula or camelot to be pretty good at extracting tables from pdf. I worked on a few JP's gov PDFs and they are not fancy so that's nice. Some light post-processing is still needed but the automation probably will keep working if the PDF format doesn't change (big if of course).
← PreviousPage 3 of 5Next →