HNHacker News
TopNewBestAskShowJobs

rodovich

87 karma · joined March 30, 2016

submissionscomments
rodovich··on Ask HN: What's your favorite elegant/beautiful algorithm?
My first programming project was a tic-tac-toe game with a computer opponent. I painstakingly copy-pasted about a hundred nested `if` statements to check for a winner & decide the computer’s next move.

Several years later I saw a Matlab demo that did this by indexing the grid using values from a 3x3 magic square[1]. In a magic square, every row, column, and diagonal has the same sum. So checking for a winner was just checking if a player’s three moves added up to 15. Finding a space that would make the computer win, or block the human opponent from winning, was subtracting two moves from 15 and checking if that spot was available.

[1]: https://en.wikipedia.org/wiki/Magic_square

rodovich··on Show HN: 15-question programming quiz with answers
Additionally, question 2 amounts to "what is the usage of python's queue class", question 4 requires knowing whether array indexes start at 0 or 1 in python, and question 8 amounts to "what is the usage of python's bytearray class".
rodovich··on ‘Reined-In’ N.S.A. Still Collected 151M Phone Records in 2016
Not that this greatly affects your counterpoint, but your calculation is off by three orders of magnitude:

151,000,000 calls/year ÷ (365 days/year * 10,000,000,000 calls/day) ~= 0.000041 = 0.0041%.

rodovich··on Google plans ad-blocking feature in Chrome browser
> To my mind if someone creates something of value, the creator should have a say over how that something is consumed. To use something without the permission of the owner feels a bit dirty.

I agree. That's why I want a say in how my data is consumed.

rodovich··on Google plans ad-blocking feature in Chrome browser
I'm glad you understand what that price is and are happy to pay it. I personally have a hard time evaluating the price because the _whats_ and _hows_ of a site's tracking seldom are disclosed in a clear and concise manner that I can review ad understand before the tracking occurs. And even if it was, that would be a lot of friction to do for every site I might visit.

I find it much easier to control by deciding on a policy up front and letting my browser help me enforce it.

rodovich··on No, I Don’t Want to Subscribe to Your Newsletter
> position:fixed (auto-replace to position:static)

I've gotten pretty good results from a bookmarklet that converts `position: fixed` elements to `display: none`.

rodovich··on How to Write a Git Commit Message (2014)
I understand this rationale, but I think most developers will encounter commit messages written by bozos who don't press enter after every 72 characters, far more frequently than commit messages that contain stack traces or other fixed-format artifacts. (Disclosure: I am one of these bozos.) The tool flubs every non-wrapped paragraph just so it can preserve the occasional blob of ASCII art.

If the tool applied reasonable wrapping heuristics and got it wrong once in a while, it could easily offer a `--no-wrap` option to let users see the message exactly as it was composed.

rodovich··on Google AI invents its own cryptographic algorithm
This is a good point, but the developer also can deploy AI tools to help analyze the behavior.
rodovich··on WikiLeaks plans to release documents on US election and Google
If leaked-but-redacted documents were of interest for a prosecution, couldn’t the originals be obtained by subpoena, either to WikiLeaks or (preferably) their original source?
rodovich··on Reddit now tracks all outbound link clicks by default, existing users opted in
> If you want to be private, don't use a social network where you are the product.

That's all well and good, until someone posts a photo of you, tags you in a message, or embeds its tracking widgets on another page you visit, and you become its product despite not being its user.

rodovich··on Does More Security at Airports Make Us Safer or Just Move the Targets?
Not the TSA in that case, either.
rodovich··on IRS Security
> Or, better yet, eliminate payroll deductions entirely and ensure everyone has a liability come April. Pretty hard to defraud a liability.

Much easier to not pay a liability -- especially if it's a double-digit percentage of your annual income, and not just a small rounding error like it typically is today.

rodovich··on Your iPhone just got less secure. Blame the FBI
> I do not believe governments (especially ones engaged in clandestine surveillance operations) have an obligation to share security vulnerabilities with companies.

Is this view particular to software defects? For example, do government inspectors have an obligation to report food safety violations that they've discovered? In either case, the problem puts the public at risk.