HNHacker News
TopNewBestAskShowJobs

sinkwool

54 karma · joined August 9, 2023

submissionscomments
sinkwool··on Utilities for refactoring and upgrading Ruby code based on ASTs
https://github.com/rubocop/rubocop/issues/8091#issuecomment-...

perhaps they are biased against the tool from participating in a campaign to police the name in the past.

But also, there's nothing wrong with more tools in this space. This is clearly an experiment, it should be welcomed.

sinkwool··on Ask HN: Good sources of math exercises for ~10-17 y/o?
I remember when I was a kid, Kangaroo math puzzles were incredibly fun. I don't know if you can get your hands on some materials, but they were such a blast. https://mathkangaroo.org/mks/

I recommend getting some math olympiad books; at that level they're just like puzzles so should be fun.

https://artofproblemsolving.com/wiki/index.php/Olympiad_book...

Go for general problem books (non-topic-specific), and start with the easiest problems that they find fun.

I remember the following two books were interesting (though might be somewhat harder). You might find them on the internet archive or pdf's online.

Challenging Mathematical Problems With Elementary Solutions (Volume I, Combinatorial Analysis and Probability Theory) - A. M. Yaglom, I. M. Yaglom.

Challenging Mathematical Problems With Elementary Solutions (Volume II, Problem From Various Branches of Mathematics) - A. M. Yaglom, I. M. Yaglom.

Additionally, look into various olympiads:

American AMC 8 and AMC 10 from various years should be easiest:

https://artofproblemsolving.com/wiki/index.php/AMC_Problems_...

And when they feel adventurous, take a look at contests. Some countries (e.g. Romania, Russia) have contests for lower grades, though they are still quite difficult.

https://artofproblemsolving.com/community/c3754998_aops_year...

sinkwool··on New findings point to an Earth-like environment on ancient Mars
so aliens did build the pyramids!
sinkwool··on The math exams of my life
of course they are. The Chinese team selection tests are notoriously more difficult than the IMO, and they enforce a one-time participation limit. If they were to send 24 people, not only would they probably be returning with ~20 golds, they'd be taking away the golds of the other nations (as only the top 1/12 get gold)
sinkwool··on The math exams of my life
Yeah, that was a very weird comparison. Not only do those countries send 6 people each, those four started participating in 1959 while US started in 1974 and China in 1985. Though arguably, those first olympiads featured fewer countries, (with presumably stronger competition) so they had to compete against each other for medals.

Another factor might be the number of distinct participants. I believe the Chinese enforce a one-participation limit, though I don't know if that would make it more or less likely to get gold.

sinkwool··on IT employment grew by just 700 jobs in 2023
There's gotta be something between Satya and "C-tier code out of rural India".

There are of course lots of bad coders in India, but there are also many really good ones. And whereas in the past they had to emigrate to US or Europe to fully make use of their talents, nowadays some(many?) choose to remain in India and work remotely. It's silly to dismiss and underestimate their skills.

As far your experience with developers that follow the specs literally, in an almost maliciously compliant way, that might be learned behavior from working on projects where the tasks are spec-ed and estimated and any attempts at going above and beyond ultimately result in late delivery and punishment, so developers quickly learn to only do the bare minimum of what is described. Granted your examples are extreme and pathological, so maybe you just had the misfortune of working with really bad people.

Additionally, unless you pick the developers yourself, you're at the mercy of the agencies who assemble those offshore teams, and often the economics are such that it doesn't incentivize them to hire the best people available. From my experience, many good developers find work on their own, outside of an agency, contracting directly with the remote company.

sinkwool··on Julia 1.10
aren't most languages invented and initially developed within a private company? Go, Dart, Java, JavaScript, C#, F#, VBA, Kotlin, Erlang, C(at AT&T), Rust (at Mozilla). The list is probably very long
sinkwool··on Math Team
> I always find out both fascinating and alien how much focus the US system puts on extracurriculars

One factor could be that, AFAIU, schools in US have many more electives than in Europe. As a student you have the choice to take more advanced classes for one subject, and only basic in other subjects, whereas in Europe, the curriculum is standard for all. So Universities in US need to compare performance on different axes.

> Of course, that also has its downsides. People end up re-taking HS exams year after year, because someone beat their GPA with a decimal point.

Another downside to the one-size-fits-all standard curriculum, is that it forces you to care about classes that you don't really care about, while not being able to focus on the subjects that you're really interested in. I think in US, if you're really good at something, universities may ignore average-to-poor performance in other areas.

sinkwool··on I Love Ruby
I believe what GP is saying is: coming from python, which uses `and` and `not` and `or` you expect those to be the binary operators in ruby as well. You are then surprised when they behave unexpectedly. Who is then to blame for your frustration? Is ruby a bad language for having both `and` and `&&`, or are you at fault for not doing enough research? (I don't see why someone coming from python would look any further after trying `and` and seeing that it seems to work just fine). I think this is an unfortunate situation, but one that doesn't really happen to someone that does ruby day-to-day; so it shouldn't really factor in as an argument to write ruby off.

But then is being surprised by `["0","1","10"].map(parseInt) // => [0, NaN, 2]` in JavaScript a sign of bad language design or does it just mean that you don't have enough experience with the language yet?

sinkwool··on I Love Ruby
Kotlin is very ruby-like and performant, check it out. If you don't mind using JetBrains IDEs, I'd give kotlin a try.
sinkwool··on I Love Ruby
`and`, `or`, `not` have much lower precedence than `&&`, `||` and `!` . I would just avoid `and` and `or` in general.

For some more explanation see https://graceful.dev/courses/the-freebies/modules/ruby-langu...

sinkwool··on Bluesky migrates to single-tenant SQLite
> Writers merely append new content to the end of the WAL file. Because writers do nothing that would interfere with the actions of readers, writers and readers can run at the same time. However, since there is only one WAL file, there can only be one writer at a time.

I think the OP meant that updates have to run sequentially.

sinkwool··on Use YouTube to improve your English pronunciation
Or it could be a typo (as in man-made) My guess is that they only use Youtube videos that already have subtitles in the target language.

But I'm curious to know how exactly they've built their database of videos/transcripts. I wonder if they curate the videos manually at all.

sinkwool··on Halfsies
But they don't have the same area. The donut seems to be at least 1.5x larger than the cup (check out the screenshots posted by latexr in another comment. The area covered by the donut is half that of the cup but it's clearly less than half that of the donut, it looks more like a third or even a quarter of the donut)
sinkwool··on Halfsies
Thanks for the reply and for the screenshots. before writing my initial reply, I went back and tried to get a 50/50 split based on your comment and came up with the same solution. But I didn't understand why it worked. I now believe it's either pure luck, or there's something about the sizes that result in a 50/50 split.

I think it's easy to see that if the central hole of the doughnut were either smaller or larger, or if the handle of the cup was smaller or larger, these splits would not work.

> I’m not a mathematician; maybe I got lucky with my approach. Crucially this is a brain teaser so it plays by the rules of a game. I formulated an hypothesis by starting from the assumption that they give you a satisfactory fighting chance.

Sure, that's fair, it's just that your original explanation for how the solution is to swap the problem from splitting the cup to splitting the doughnut was so intriguing and puzzling that got me curious.

sinkwool··on Halfsies
Can you explain more? (I might be stupid and don't see some obvious proof of why your approach is correct), but intuitively it doesn't seem that the fact that the cup is symmetrical is enough. Say if the handle of the cup was really really big, while still preserving symmetry, then its outstanding area would be huge compared to what the doughnut could cover.
sinkwool··on My Love Letter to Rails (and Ruby) – Or, Why RoR Isn't Dead Yet
ruby is strongly typed, in that it doesn't allow you to implicitly coerce between types*: 1 + "1" will raise an error. (As opposed to weak typing in C or JS)

ruby however is not statically typed.

*(there are actually ways to implement certain types of coercions by defining to_ary, to_str, to_int)

sinkwool··on Role of Algorithms
Leetcode is fine: lots of supported languages, large community, lots of solutions and editorials.

Here are some more resources:

- USACO: https://train.usaco.org/ and https://usaco.guide/general/

- Codeforces: https://codeforces.com/ the de facto standard community for competitive programmers, regular contests with editorials, huge archive of problems (https://codeforces.com/problemset) with pretty accurate difficulty ratings so you can focus on problems of suitable difficulty if you want to progress quickly. They also have an incipient EDU section: https://codeforces.com/edu/courses that covers basic algorithms with practice problems.

sinkwool··on Role of Algorithms
Great resource, but it's hard to practice there as a beginner because there are no solutions (unless you solve the problem yourself). So you might have to get comfortable with being stuck. Which is fine when you're experienced, but will demotivate you if you're just starting.
sinkwool··on Show HN: Booklet – Async forums as an alternative to chat
> - not hijack CTRL-f for its own built-in search.

Just in case you(or others) don't know, you can press Ctr-F twice to get the native browser page search.

sinkwool··on In Germany, 27 are in 'preventive detention' b/c they might do climate protests
Never attribute to malice that which can be adequately explained by stupidity.
sinkwool··on How to pass a coding interview with me
Most advice in TFA seems pretty good, but the first point:

> 1. If you do Google the question beforehand, delete your tracks afterwards

IMO, if you ask me the same question that I had found online, that's on you. Do I have to pretend that I didn't prepare for the interview?

sinkwool··on Ukraine uses Australian drones made of cardboard
Do you have any source pls?

Who controls the DJI copter drones? Does the plane act as a relay for the radio signals?

sinkwool··on Ten killed in private jet crash – Wagner leader Prigozhin 'on passenger list'
he also promised them amnesty if they backed down. This is another case in point that his word means absolutely nothing and any negotiation with him is pointless.
sinkwool··on Ten killed in private jet crash – Wagner leader Prigozhin 'on passenger list'
their relationship is more complicated. Some might argue Putin is Karydov's b**h, seeing as how the federal government is paying large amounts of money to keep formal control over Chechnya and Kadyrov's clan happy.
sinkwool··on Ruby's hash is a Swiss-army knife
You don't need the `unless k.key? v` guard. The `Hash.new` block only gets called when the key is not present in the hash.
sinkwool··on My resignation letter as R7RS-large chair
The Unison language JIT is being written in Scheme: https://www.unison-lang.org/whats-new/jit-announce/
sinkwool··on How They Tried to Kill Me
Or maybe they manage to recruit some of the spies/assassins to work as double-agents?
sinkwool··on She invited four people over for lunch. A week later, three were dead
> The truth is that very few people are ever inclined to murder.

I believe that many people are afraid of the consequences if they were to get caught. I think that if there was some "magical" way to murder someone without getting caught, there would be vastly more murders. Just think of any road rage video: I imagine that many of the participants would be capable of murder at that instance if they knew they would get away with it. Or think about school shootings: how many more would there be if the perpetrators were sure that it was consequence free.