HNHacker News
TopNewBestAskShowJobs

rav

1,270 karma · joined February 20, 2013

[ my public key: https://keybase.io/ravv; my proof: https://keybase.io/ravv/sigs/iqfti_2jqJcDaAHMPVlrVndLEH7npqbzA7qHMvhSCmY ]
submissionscomments
rav··on Gross domestic product is a misleading measure of national success (2014)
Needs (2014) in the title.
rav··on Linker, can you spare a meg? (2021)
Personally I can't fathom writing an app on a 15 MB memory budget in a language with such a heavy focus on garbage collection. I mean, the blog post talks about allocations of single 24-byte structs, and allocations happening all the time - why wouldn't that 24-byte struct be on the stack or be part of a large homogeneous array or be a statically-allocated global?

But then again, in my day-to-day work we probably solve problems in languages without GC in ways that would raise eyebrows with the Go specialists at Tailscale. To each team their own favorite pet language, I guess!

rav··on Patch OpenSSL on November 1 to avoid “critical” security vulnerability
Here's a direct link to the 3.0.7 announcement in the archive:

https://mta.openssl.org/pipermail/openssl-announce/2022-Octo...

rav··on I made a guitar tuner app using Flutter and Rust
Even if you can tune by ear, it can be faster to use a tuner, especially in a noisy environment. Also, if you listen to harmonics when tuning a guitar by ear, you'll get something like just intonation instead of the equal temperament tuning that you would get with typical tuner apps.
rav··on React I love you, but you're bringing me down
Regarding the Inspector/isVisible complaint:

When you want to have "early return" in a component, it's possible to just split the component into two to introduce an "inner" component that contains whatever comes after the early return point in the original component.

Any local variables from before the early return then need to be passed as props to the new inner component.

However, naming this inner component is always an issue for me. Typically I just name them Inspector2, Inspector3, etc. until I have an implementation that works. Then I can start thinking about how to refactor the implementation into something that I can give sensible names.

It's really a code transformation similar to async/await where you derive a state machine from a block of code by identifying transition points. In async/await you have transitions at the await points; in components you have transitions at the early return points. In async/await, no one is forcing you to name the individual states or even write them out explicitly - the compiler takes care of it. Then why do I have to write out the state machine explicitly and name the states explicitly for function components with early return? I would love for React to have some facility like "Consider the rest of this component as a new sub-component; as if this component now returns a single Element pointing to whatever is in the rest of this component". But it's probably a Hard Problem™.

rav··on Introduction to Algorithms (2020)
In the syllabus [1] they state that you need to be able to obtain above a grade C on "Problem Set 0" [2] before you take this course.

In my experience teaching 1st year undergrad algorithms, I'd be surprised if the average 1st year student that has just passed an "Introduction to algorithms" course would even be able to solve Problem Set 0.

However I don't think we should delay teaching algorithms until several years into the CS university curriculum. It's too important and central a topic to miss out on. We really need an intro algorithms curriculum that can teach both the basics (as in Problem Set 0) and the algorithms and data structures in the textbook.

[1] https://ocw.mit.edu/courses/6-006-introduction-to-algorithms...

[2] https://ocw.mit.edu/courses/6-006-introduction-to-algorithms...

rav··on Poll HN: Do you use SSH certificates (not mere public-key authentication)?
To SSH into servers at $work, I need to run a command to 2FA-authenticate against our SSO and obtain a short-lived SSH cert for my local SSH key. We have around 10 tech employees and around 40 servers and it's really nice when onboarding new servers or new employees that we don't have to juggle authorized_keys around, and when offboarding employees we no longer have stale authorized_keys files to worry about, since access will expire automatically after 20 hours once the employee is removed in SSO. There's no hardware backing the CA, and it's all homebrew (NIH style) 2FA-SSO with openssh CA invocations, but it works and is quite convenient. We also use the same CA for host keys (again, certs issued by our NIH-style homebrew fleet management), which allows us to avoid TOFU prompts when onboarding new servers.
rav··on Chrome allows websites to write to the clipboard without the user’s permission
Don't most apps allow you to paste plain text with Ctrl+Shift+V nowadays? That's what I almost always use, unless I have some use for the copied rich text.
rav··on Parsing SQL
Parsing SQL can solve many problems, but before writing/choosing a parser you need to know what your goal is. For example, at work we wanted to have statically-typed SQL statements in Python/mypy to statically identify syntax errors, misspelled column names and bad type mixes. We came up with a home-grown SQL parser [1] and type checker [2] in Rust and a mypy plugin [3]. If someone knows of other solutions for obtaining SQL/mypy integration I'd love to know about it, since parsing SQL is not exactly supposed to be our field of work.

[1] https://github.com/antialize/sql-parse/blob/7869595aa92aed0b... [2] https://github.com/antialize/sql-type [3] https://github.com/antialize/py-mysql-type-plugin

rav··on Dwarf Fortress Update – Tutorials and Tooltips
The development of Dwarf Fortress has been fully funded by donations for well over a decade I believe. I used to donate but I stopped when I was saving up for a home. It seems their financial support has been declining since 2020 - maybe it's time for me to start donating again.

Donations from the beginning in 2007 through to 2021: http://www.bay12forums.com/smf//index.php?topic=179406.0

Donations in 2022: http://www.bay12forums.com/smf//index.php?topic=179926.0

rav··on Dubious Ways to Compute the Zeros of a Polynomial
The author writes about a competing Fortran implementation for computing zeros: "But their software is in Fortran. I was a big Fortran fan for a long time. I used to be considered one of the Fortran gurus at MathWorks. I now don't even have access to a Fortran compiler. So I can't try their stuff myself."

This seems like a dubious claim - the AMVW code seems to provide a makefile that compiles using the free GNU Fortran compiler: https://github.com/eiscor/eiscor

rav··on HTTPS Everywhere will sunset in January 2023
Similar to HTTPS-only being built into web browsers, isn't captive portal detection built into all modern OSes? What's the badly-setup wifi network that requires you to open your browser but doesn't get detected properly by the OS as a captive portal?
rav··on The SymPy/HackerRank DMCA Incident
Given that HackerRank has more than 1000 employees, I agree that it is surprising that they were able to react and apologize on the same day as the takedown and all the buzz on social media.

However, I still think it's a damn shame that HackerRank needed such a high-profile incident before reconsidering their shady arrangement involving probably-automated DMCA takedowns against GitHub repositories. Either they didn't know what that would incur on open source repositories hosted on GitHub and other platforms, or they just didn't care about it as long as it wouldn't cause a huge fuss for themselves (which it did in this case).

rav··on Go will use pdqsort in next release
Given that sorting algorithms are evaluated on practical merits on real-world hardware - when the hardware changes, sometimes the sorting algorithm has to change too.
rav··on Your competitor wrote the RFP you're bidding on
Apparently, "Request for proposal", which is a private-sector equivalent of a tender process (speaking from my point of view of doing a lot of consulting projects for the public sector). A tender process usually requires the agency to pick the quantitatively best bid (by some predetermined ranking scale, usually price or some price-quality combination), whereas an RFP has no such requirement and just lets the agency pick whatever seems subjectively/qualitatively the best choice.
rav··on GNU ed ate my homework
Is it really pronounced "ee-dee"? Here I've been pronouncing it all the time like it was some zany protagonist in a 90's cartoon show!
rav··on Show HN: I made Devzat – It's like Discord but in the terminal, over SSH
After living through Google Chat going down while handling a server incident at work, I created an internal, encrypted chat system in order to have an alternative in case our regular communications channel is down.

However the actual chat part of it is very barebones with a simplistic JSON-based protocol and a simplistic IRC-like interface - quite unlike devzat.

I wonder how hard it would be to untangle the authentication and transport bits from devzat and plug in our own proprietary auth/transport.

rav··on Some discouraging anecdotes on how services handle account deletions
The post paints a discouraging picture overall, but it does have some interesting double standards if you consider these three separate quotes:

> It would seem there is no end to how far businesses can take white-labeling and outsourcing.

> I’m sure engineering time to manually delete data must be more expensive in the long run than creating processes and tools for customers and customer support representatives to handle delectation requests.

> 11 of these were smaller niche online stores.

If I'm a "niche online store", am I somehow excused from these rules? I would think there would be a market for white-labeled online stores for niche online stores, but that's somehow Bad™? But having an in-house engineering team develop the platform and respond to development needs as they arise (to handle the first account deletion request) is also Bad™?

rav··on Cybercriminals who breached Nvidia issue one of the most unusual demands ever
I would imagine that ownership of Nvidia's drivers would be more clear cut than most open source projects. Wouldn't it only be Nvidia's employees and contractors that have worked on the driver code? Then by default Nvidia would own the rights.

If Nvidia doesn't own the code, do you then imagine they're in a sort of licensing agreement with the rightsholders that allows them to distribute the binary blobs but not the code?

I don't understand what situation would lead a corporate-sponsored closed source project such as Nvidia's drivers to be in a position of complicated ownership.

rav··on Don’t point out something wrong immediately
When "something is wrong" in a large system, it might not be straightforward to say which detail is wrong exactly.

One of the reasons that you shouldn't "point out something wrong the moment you see it" is because there might be multiple candidates for the "wrong" thing that needs to be addressed, and addressing any of them is enough to make the system as a whole "not wrong" (or at least, less wrong).

If a colleague says something that sounds immediately wrong, try to let them finish what they're saying and try to figure out why it doesn't immediately seem wrong in their own eyes - it might be that what they're saying is only wrong in the context of a larger system, and the colleague simply has a different understanding of the larger system from you, which causes them to not immediately think that it's wrong. Sometimes the "actually wrong" thing might be somewhere else in the system, and if your colleague hadn't been allowed to finish their thought, no one would have realized where the "actually wrong" thing is!

rav··on Misbrands
It's like when Panel de Pon for the Super Famicon was rebranded and rereleased as Tetris Attack for the Super Nintendo. It has nothing to do with Tetris, but Tetris was a popular game at the time.
rav··on My productivity app for the past 12 years has been a single .txt file (2020)
As dahart mentions in a sibling comment, the todo-list doesn't operate with branching - all edits are performed by one person according to the real-time circumstances. Any Git history divergence is a matter of technical accident and not an expression of feature branching/merging.
rav··on My productivity app for the past 12 years has been a single .txt file (2020)
My productivity app is a Git repository (that happens to be a GitLab wiki git repository at $WORK as well) with my "priority queue" text file and the following bash function. The contents of the text file are similar to what Jeff Huang describes in the blog post (but MUCH less organized). Since it's in version control, I can freely delete old content that's no longer relevant for my day-to-day, and then I frequently use git log -p to search for old text in the file if it becomes relevant. The bash command also pushes and pulls automatically, so it can be used across my devices.

        plan-edit() { 
        cd ~/wiki &&
        git diff --exit-code &&
        vim Rav-priority-queue.txt &&
        ! git diff --quiet Rav-priority-queue.txt &&
        git commit -qm 'Update Rav-priority-queue.txt' Rav-priority-queue.txt &&
        git pull -q --rebase &&
        git push -q
        }
rav··on Fq: Jq for Binary Formats
Does this support out-of-tree format decoders? From an initial glance it looks like all decoders are in-tree and written in golang. We have a lot of internal binary formats at $WORK that I would like to use this on...
rav··on The time complexity of the libc++ deque push_front implementation is O(log n)
It is possible to deamortize the O(n) resizing step, meaning you spend O(1) extra time over the O(n) operations leading to the resize, so that when the resize needs to happen, you don't need to spend O(n) time. This assumes that allocation/deallocation takes O(1) time regardless of the buffer size.

Deamortized resizing can work as follows: When inserting into a vector that is half full, allocate a new buffer twice the size and copy two elements into the buffer. For the subsequent insertions, copy two elements every time you insert one element. This guarantees that you are done copying all elements into the new buffer once the old buffer is full, and you only performed a constant number of instructions with each operation.

It's possible to deamortize many quite advanced data structures in theory - see e.g. the lecture notes on "Maintaining Order in a List" on this course webpage: https://cs.au.dk/~gerth/aa11/

... but as with everything in theoretical computer science you are not guaranteed that the implementation works better in practice than the "naive" approach. Deamortization techniques do have a lot of practical relevance in hard realtime applications, but I don't know how much of "real" hard realtime stuff uses academic techniques and how much of it is mostly engineering.

rav··on I hate password rules
I use the following bookmarklet to fix issues like this. It's similar to the browser addon discussed in sibling comments, but without installing a browser addon. Simply create a bookmark named e.g. "Don't mess with paste" with the following URL:

javascript:void(document.documentElement.addEventListener('keydown',e=>e.keyCode==9&&e.stopPropagation(),true),document.documentElement.addEventListener('copy',e=>e.stopPropagation(),true),document.documentElement.addEventListener('paste',e=>e.stopPropagation(),true))

rav··on Mailgun doesn't validate the email headers of email sent through their system
In my initial investigation, I actually concluded that "Mailgun" and "Mailjet" were two product names from the same organization. I didn't realize they could be the result of a company merger. It's actually Mailjet with its outbound email templating service that I was considering using.
rav··on Mailgun doesn't validate the email headers of email sent through their system
I was recently looking into Mailgun's EU-hosted offering. Does anyone have recommendations for EU-based alternatives?
rav··on How to send a real number using a single bit (and some shared randomness)
Yes, that is covered in this half paragraph:

> Randomized rounding, where the sender sends 1 with probability x and 0 otherwise, and the receiver uses the received bit X as the estimate x', has the property that E[x'] = x. Unbiased estimators are arguably more natural for many estimation problems. Here the measure of performance would be the maximum variance for the estimate over all inputs x, so for randomized rounding the cost is 1/4 (when x = 1/2).

The "cost"/"variance" of 1/4 in the above paragraph is talked about later in the article as the "expected squared error"; the main result is a scheme that has a cost of just 0.04599, which is better than the "send a 1 with a probability x" scheme, which has a cost of 1/4 = 0.25.

rav··on Call of Duty Adds Kernel Level Driver for Anti-Cheat
> I used to run Windows virtualised under Linux with a PCIe passthrough GPU. I remember having to re-install windows directly on my machine at a LAN party once because CS:GO couldn't be run in a VM anymore :(

Have you tried running CS:GO on Linux through Steam on Linux? It's officially supported and for me it runs as well as I expect on low-end hardware. Are there any performance reasons to want to run in a Windows VM instead?

← PreviousPage 4 of 10Next →