HNHacker News
TopNewBestAskShowJobs

randomstring

993 karma · joined March 5, 2009

submissionscomments
randomstring··on Apple TV, Apple TV, Apple TV, and Apple TV+
What? No mention of the Apple TV remote, the Apple TV Siri remote, the Apple TV remote app, or the iOS Apple TV remote app shortcut feature on iOS?

The physical Apple remotes are so terrible, I've stopped using Apple TV (all of them). The Apple remote app is better, but is useless for when you need to hit pause, as your phone has gone to sleep.

randomstring··on Public Suffix List Problems
This was a challenge for blekko when we built our search engine. A major component to ranking a URL is the cumulative rank of the domain it is hosted on. You don't wan't URL ranking to leak between independent sites sharing the same top level domain. Blog hosting sites are a prime example.

Another factor was budgeting crawl resources. The crawler has a lot of pages to crawl and if you let it, it'd just do a deep dive on amazon.com and never come back. So dividing crawl budget between domains and subdomains is important. As noted in the article, it can be gamed so you have to guard against that algorithmically and occasionally make special cases.

Prior to the Public Suffix List (https://publicsuffix.org/) project I was using the Mozilla project's list of top level domains. I had code that would download the latest TLD list from Mozilla (and later the publicsuffix.org) and generate a trie that the blekko crawler could traverse to obtain the TLD and the subdomain. Blekko kept all sorts of data on every domain and subdomain, including (but not limited to) domain rank, host IPs, country, language, average porn score per page, etc.

My Perl TLD parsing code is here: https://github.com/randomstring/Net-Domain-PublicSuffix

Interesting aside: the TLD .US (https://en.wikipedia.org/wiki/.us) has some "weird" rules that must have seemed like a good idea when they were proposed, but complicate parsing rules. For instance in the hostname town.windermere.fl.us the "town" is significant to differentiate it from a potentially different entity hosted on co.windermere.fl.us (the county of Winermere Florida, if such a thing exists). Thankfully, few cities/counties/villages/etc use theses convoluted .us domains. Many opt for a more traditional TLD (seattle.gov for instance).

randomstring··on ‘Just four dudes’: Inside EasyList, a community-run ad-blocking list
Maybe Autotrader has hundreds of thousands of template, CSS, and JS files with those paths hardcoded. Imagine the hell it would be to work on that website.

Even so, you could fix everything with a one line Perl command.

randomstring··on Org-mode on web, built with React, for mobile, synced with Dropbox, Google Drive
No mention yet of the very well built iOS app beorg https://beorgapp.com/

Org-mode files are synced via Dropbox, iCloud, or WebDAV.

Having a Siri shortcut to just tell Siri to add something to my TODO list would be a nice feature. Glancing at the shortcuts API, there is an append to file feature. I might have to try to roll my own.

randomstring··on Google’s robots.txt parser is now open source
Where was this 10 years ago when I was reverse engineering the Google robots.txt parser by feeding example robots.txt files and URLs into the Google webmaster tool? I actually went so far as to build a convoluted honeypot website and robots.txt to see what the Google crawler would do in the wild.

Having written the robots.txt parser at Blekko, I can tell you what standards there are incomplete and inconsistent.

Robots.txt files are usually written by hand using random text editors ("/n" vs "/r/n" vs a mix of both!) by people who have no idea what a programming language grammar is. Let alone follow BNF from the RFC. There are situations where adding a newline completely negates all your rules. Specifically, newlines between useragent lines nor between useragent lines and rules.

My first inclination was to build an RFC compliant parser and point to the standard if anyone complained. However, if you start looking at a cross section of robots.txt files, you see that very few are well formed.

With the addition of sitemaps, crawl-delay, and other non-standard syntax adopted by Google, Bing, and Yahoo (RIP). Clearly the RFC is just a starting point and what ends up on website can be broken and hard to interpret the author's meaning. For example, the Google parser allows for five possible spellings of DISALLOW, including DISALLAW.

If you read a few webmaster boards, you see that many website owners don't want a lesson in Backus–Naur form and are quick to get the torches and pitchforks if they feel some crawler is wasting their precious CPU cycles or cluttering up their log files. Having a robots.txt parser that "does what the webmaster intends" is critical. Sometimes, I couldn't figure out what some particular webmaster intended, let alone write a program that could. The only solution was to draft off of Google's de facto standard.

(To the webmaster with the broken robots.txt and links on every product page with a CGI arg with "&action=DELETE" in it, we're so sorry! but... why???)

Here's the Perl for the Blekko robots.txt parser. https://github.com/randomstring/ParseRobotsTXT

randomstring··on Actuarial science ranked as most valuable college major
Having done my BS in Match and CS at a school with a parallel Actuarial program, I got a good look at what being an actuary is about. If you're good at math, and really good at standardized math exams you can advance through the various levels and work your way up the pay-scale ladder. I think this really appeals to people who are good at math, but maybe don't want to go into academia.

That said of all the actuaries I went to school with, none liked their jobs and all eventually moved on to do something else.

randomstring··on Hair Ice
I can report that it does. I've seen this hiking in Snohomish County, WA. Hair ice looks a bit like cotton fluff, like something splitting out of a seed pod. It looks like it is growing out of the pieces of wood or bark. The ice crushes like a lightly packed snowball.

Of course this means you have to go hiking in the cold. Totally worth it.

randomstring··on HTTP headers we don't want
While working on a HTTP server in 2007 I discovered removing the "Server" header significantly delayed the render time in Firefox.

So beware of unexpected side-effects!

randomstring··on Tough questions we get asked: 2018 Annual Letter
Another good book on effective altruism is The Most Good You Can Do by Peter Singer.

https://www.goodreads.com/book/show/23168483-the-most-good-y...

It's clear that Bill and Melinda Gates are practicing effective altruism in an effort to do the most good with their money.

randomstring··on How Schopenhauer’s thought can illuminate a midlife crisis
Another book recommendation:

How Schopenhauer Got Me Through My Mid-Life Crisis by Charles Alonso https://www.amazon.com/How-Schopenhauer-Through-Mid-Life-Cri...

It's fiction, funny, philosophical, about middle age and a quick read.

randomstring··on Let's Encrypt now holds 35% of the market
Agreed. Paying someone money for a bag of random bits is criminal.
randomstring··on The Internet Worm of 1988
Here's a link to Gene Spafford's writeup on the Internet Worm:

http://spaf.cerias.purdue.edu/tech-reps/823.pdf

randomstring··on Audi electric cars will come with solar roofs
Negligible performance improvement at great added cost and increased weight. It's a sales gimmick.

They might be better off installing a lighter roof and reduce overall weight to increase range.

randomstring··on NHTSA’s full investigation into Tesla’s Autopilot shows 40% crash rate reduction
Waiting for the headline: "Human Fails to Prevent Accident, Outraged Public Calls for Banning of all Human Drivers"

The obsession with perfection in self-driving cars is misplaced, they just need to be demonstrably better than humans.

This is obviously the future.

randomstring··on Shell scripts to improve your writing
I read the whole article thinking "this needs to be an emacs mode!" only to get to the punchline at the bottom.

>> Benjamin Beckwith has contributed a "writegood" mode for emacs inspired by these scripts.

This is going into my .emacs right now.

randomstring··on How (Not?) to Use Python’s List Comprehensions
I was about to observation that the python code as posted in the blog missed an important optimization, reordering some of the tests to:

    for b in range(1, 27)
    for n in range(1, 27)
    if b**3 + z**3 + n**3 + o**9 == 1997
    for k in (3,4)
    for e in range(1, 27)
This reduces the number of innermost tests and on my laptop it runs about 18x faster than the blog's solution. That was:

    for k in (3,4)
    for b in range(1, 27)
    for e in range(1, 27)
    for n in range(1, 27)
    if b**3 + z**3 + n**3 + o**9 == 1997
Then I see that @eutectic did the same optimization in his Haskell code. Nice!
randomstring··on Lovelace – The Origin (2009)
I desperately wanted to love this book as it has all the right elements: Lovelace, graphic novel, Babbage, the difference engine, steam punk... However, I felt the number of footnotes were excessive. The footnote material was excellent, but it felt like when movies resort to using a voice over to explain the plot.

I bought and read the book hoping it would be suitable for my kids (10 & 13), but having half its content in footnotes killed it as a kid friendly book.

If you are looking for a good book for kids with smart female leads (a fictionalized Ada Lovelace and Marry Shelley) I highly recommend The Case of the Missing Moonstone (The Wollstonecraft Detective Agency #1) by Jordan Stratford. Probably best for ages 6-10.

randomstring··on The Public Suffix List
This list is used to determine what domains and sub-domains "belong" together, in the sense that they are controlled and/or owned by the same entity. For instance *.google.com is all google, so x.google.com and y.google.com can be trusted to share the same SSL key, safely share javascript (XSS), etc. However x.blogger.com and y.blogger.com are probably two completely separate blogs, people, domains, SSL keys, javascript domains, etc. And you wouldn't want to see x.blogger.com's web pages showing up in search results for y.blogger.com.

Secondly, maintaining this list is a pain. You have hundreds of two letter top level domains, one for each country. Each country with its own NIC in charge of sub-domains. Each NIC with the power to add or delete subdomains (check out https://en.wikipedia.org/wiki/.uk for just one of hundreds of examples). Some "countries" even sell off their top level domain like .nu . Then you have .us (https://en.wikipedia.org/wiki/.us) that has wild card domains like http://vil.stockbridge.mi.us/ where the vil. is fixed and part of the domain and stockbridge.mi is the important domain information. Of course they're always adding more top level domains: .ninja, .wtf, etc (maybe there is a .etc now?). Then you have all the blogging and hosting platforms that use personalized domains for hosting content. Many are listed in the publicsuffix list, but I'm guessing not all!

I ended up writing my own publicsuffix parser in PERL a few years back for the blekko search engine. The main purpose being to be able to group web pages together by site/owner. There is nothing quite like feeding every URL on the internet through your parser to find bugs and corner cases.

randomstring··on More contributions on your profile
I like the change. I keep all my online coursework (Coursera and the like) in Github. This is code and work that cannot be public because it would violate the class code of conduct. It always made me a little sad to see big barren streaks in my contribution graph. Especially when I knew I had been coding more than usual and working on really interesting stuff.
randomstring··on The Idiocy of Hacker Keyboards (2010)
This article is just Hacker News click bait. Despite panning expensive keyboards the page is full of amazon affiliate links.
randomstring··on Understanding and Measuring Vitamix Horsepower
OK, now I want to try boiling water with my Vitamix.

As an added bonus, after 11.5 minutes of listening to a Vitamix on high, you won't need that cup of coffee to wake up.

randomstring··on Emac’s Org Mode will improve your software engineering
MobileOrg on iOS is unusable. I got it working, however you cannot edit or add to your org files from your phone. You can only view them. That makes the app useless in my book.
randomstring··on Watson for President
Not endorsed by IBM. At the bottom of the page you see:

  Watson, the Watson logo, Power7, DeepQA, and the IBM logo are  
  copyright IBM. The Watson 2016 Foundation has no affiliation  
  with IBM. The views and opinions expressed here in no way
  represent the views, positions or opinions - expressed or
  implied - by IBM or anyone else.
According to WHOIS the domain is owned by:

  Registrant Name: Aaron Siegel
  Registrant City: Los Angeles
  Registrant State/Province: California
randomstring··on Walking Every Street in San Francisco
Here is someone who bicycled every road in San Francisco. All tracked with GPS. http://rideallofsf.tumblr.com/

And someone who walked all of Berkeley, CA back in 2007. https://walkingberkeley.wordpress.com/

randomstring··on Walking Every Street in San Francisco
Strava.com will generate a heat map of all the roads you've walked (or biked) on. There is even a club that seeks to "Ride Every Road" of their local town.

http://www.strava.com/clubs/ride-every-road-22350

randomstring··on Dmoz – The Open Directory Project
Dmoz nearly died in 2006...

http://www.skrenta.com/2006/12/dmoz_had_9_lives_used_up_yet....

randomstring··on Perl Already Won
I wouldn't call it #winning. Did Edmund Hillary "win" because he climbed Everest first?

I think the misunderstanding of Perl is based in the "There is more than one way to do it" philosophy. A corollary to that motto could be "There is no right way to do it." Using that corollary, no matter what Perl code you look at the correctness is in the eye of the beholder.

Even looking at your own code a year later, you'll ask yourself "why did I do it that way?" This is because the Perl syntax and choice of modules is so deep and varied that you cannot help but continuously evolve your style.

It takes real world trial and error of writing and reading Perl code to build your own style and get a handle on what good, readable Perl code should be... for you.

Haters are going to hate, but Perl programmers know the power and aren't going to it give up. Winning isn't everything. Getting there first? Well, that just means you should respect your elders. :)

randomstring··on Monty Hall, Erdos, and Our Limited Minds
Which would explain why Erdos might be confounded by the answer. He was an expert at numbers, not psychology.

Proofs are built with an adversarial mind set. Always assuming the worst possible case and proving that a theorem holds in all conditions. The "hand of god" (or in this case the game show host) doesn't move to make theorems easier to prove. That isn't the universe works!

randomstring··on Global heatmap of cycling and running routes
I think you're seeing a couple different effects here.

1. The data is reported from a many varieties of GPS devices and phones. So the data is noisy. Some singles tracks will be very noisy, to the point of being fiction.

2. Not all of these tracks are on the road. If you click between bike/run/both you'll see the bike rides are more correlated with roads and the runs seem to have more "off roading."

3. some of those paths are sidewalks and pedestrian bridges and underpasses.

randomstring··on Google+ Is Walking Dead
So they killed Google Reader (and RSS with it) for nothing?
← PreviousPage 3 of 4Next →