HNHacker News
TopNewBestAskShowJobs

steventhedev

1,125 karma · joined October 23, 2013

Flawed human being, but always trying to improve
submissionscomments
steventhedev··on Thesis, Automattic, and WordPress: A Conflict of Ideology
You hit it on the head. IANAL, but I would argue that there are two good ways to go about arguing that a theme is not an infringing derivative work:

1. The parent class (more to the point, the interface which must be copied to be compatible as a theme) is not sufficiently specialized to be copyrightable in the first place.

2. Even if the code is derivative, the use and intent in copying is fair use because it was done to be compatible with the greater Wordpress system.

Sadly, because of the names involved (subclass, etc), I doubt that any judge without specific programming knowledge would rule that subclassing isn't automatically derivative.

My gut feeling is that those two idiots are on a collision course to sue each other. I'd say it'll be fun to watch the fireworks, but it's a bit hard to enjoy them when they're aimed at you.

steventhedev··on SQL style guide – a consistent code guide ensuring legible and maintainable code
I suppose if you need a style guide for SQL, then you're likely in the business of building databases to be accessed by multiple applications. However, be aware that the majority of applications are initially developed using a database as a data store, alongside opinionated ORM systems that will prefer a specific naming convention (such as plural forms).

Speaking from experience, you can't even expect native speakers to know all the collective forms. Worse, in some cases the collective form may cause confusion if the collective is the singular of a different table (players in a team, teams in a league, doing a fantasy football league app).

Using the plural, your schema would be player -> team -> league. Using your system, it would be team -> league -> sport. Good luck explaining that to a new hire.

steventhedev··on Suggesting Technical Improvements
In the case of a truly bad idea, it is the duty of the CTO/VP Eng/Team lead to give the employee the time to explore the idea/discuss it and realize why it's a bad idea. The employee should grow as a result of the experience, and become more valuable in the future.

On the off chance they don't learn, and the situation repeats itself, it may be prudent to refuse such requests.

That having been said, the worst situation is when the boss agrees that it needs to get done, but can't find where to sneak it into the schedule. It's effectively saying that you don't value the happiness of your employees and can't schedule/push hard enough.

steventhedev··on SQL style guide – a consistent code guide ensuring legible and maintainable code
I would suggest a different approach: Prefer either the plural or singular form, depending on which your ORM prefers. It may not be pretty from a purely stylistic perspective, but the collective forms have a few specific problems:

- mapping is not intuitive for non-native English speakers (flora, really?!)

- manual table mapping needed for ORM systems

I'd prefer the singular, but ActiveRecord uses the plural, and I'd rather go along with the default, rather than fight and create friction for my team.

EDIT: looking closer, the style guide is great, but the naming conventions are atrocious. I'm reminded of what my Intro to CS TA told us: naming stuff is hard, so try to explain your code. If you have to explain what something is, the explanation should be the name (within reason)

steventhedev··on Setting up your own blog
Hadn't considered that.

On the one hand, GH pages is a fairly popular resource for quick static site hosting, so Google should have had an engineer sit around and come up with a special filter just for that. On the other, I doubt very much that they've actually done that.

All in all, as long as you set canonical tags for your posts, the duplicate content on another domain shouldn't penalize you too very much. In any case, SEO for a personal technical blog isn't a high priority for me. If I were writing books or doing something to earn money with the blog, I would probably shell out for static site hosting using S3 and Cloudfront or something.

steventhedev··on Setting up your own blog
To be honest, I'm not really sure what's duplicated here. Are you talking about the markdown sources being visible through the project?
steventhedev··on Setting up your own blog
I've had a blog[0] on GH pages for a few years now. I wrote a few posts about how to go about setting up feeds/og tags, GA, and I really should write another one about setting up everything else.

Basically, hosting a static blog is a rabbit hole. Keep track of where you came from, and share it out there. It's kinda amazing what you can do with a little bit of effort.

Personal plug: I cofounded Feedio[1], which gives you a widget for doing email subscriptions (among other things).

[0]: https://stevenkaras.github.io

[1]: http://feedio.co

steventhedev··on Apple limits daisychaining of non-Apple displays in OS X
Apple has the right to claim that using unsupported hardware is...well....unsupported. However, it sounds like they nerfed the driver which makes it a non standards complaint driver. This is a problem and Apple needs to be called out on it. At the very least, they could face sanctions or a trademark lawsuit from the display port standards group for using the logo with non compliant products. At the worst, a hefty fine from the EU.

Also, there's no point in "flooding" developers with support requests. Devs will rarely read what customers write anyways in large corporations like Apple. Better to push from the standards org or the govt regulator.

steventhedev··on The Best and Worst Places to Grow Up in the U.S.
Read the fine print at the end.

1. Annual income of 500k in the 80's and 90's using 2012 dollars 2. County kids born from '80 to '86 living in during the 80s and 90s.

Basically, if you don't fit the profile of a family that never moved from the same house in the suburbs, you aren't included. Also, take a look at the national map. It would seem the plains are the best place for upward mobility, but I get the feeling they forgot to control for some confounding variable.

Also, the breakdowns show some Simpsons paradox, where individual counties might be very good for boys or girls, but are on average much worse. I'm sure a racial breakdown would show similar issues.

steventhedev··on Prospect – Find Emails from LinkedIn Profiles
Great! Now I can get my recruiter spam directly to my email, so I don't have to open up my linkedin and see it there.

Seriously though, be aware of spam regulations that can apply to whoever you're contacting. At the very least, read up on your local laws before you do something stupid like use this.

steventhedev··on PostgreSQL Data Migration Tips
My instinct here is to write the query in such a way that even if pg changes in the future, or if I migrate to an almost compatible alternative tomorrow, it should work the same way. Perhaps more importantly, it sends the message to future devs (including me) that rows should only be deleted after they've already been archived. It also covers that 0.000000001% chance that everything else went wrong and the intern did it manually and managed to screw it up.

In the end, queries are code, and code is our way to communicate or intent to the next developer, so it's better to do the delete after the insert

steventhedev··on PostgreSQL Data Migration Tips
Bone to pick with the CTE that archives users. I'd rather see it insert them into the archive table first, then delete them. Not much of a difference, but my instinct is to cover all possible failures, and be especially careful around deleting rows.

It also means that god forbid it did die halfway through, and PG isn't smart enough to pick up where it left off safely, you won't lose any data, and at worst would end up with a duplicate archived row (easy enough to catch with some maintenance scripts and origin ids)

steventhedev··on Sass Mixins vs. Extends: The Data
That 600ms difference between load times for the style guide is not something small. In fact, the difference in load times for the merchant portal was also 400ms. Given the importance of page load times for SEO (especially on mobile), this is not a marginal result. For most sites that I've dealt with, consolidating assets makes the biggest impact. But once you've done that, if you can squeeze another 500ms just from your CSS, you'll do it.

For larger sites with tons of visitors, page load speed has a tangible impact on revenues. Being able to trim off another 100ms can result in millions of extra sales every month.

Perhaps we should focus on a CSS optimizer that rewrites CSS rules in the mixin style? Then it makes the whole thing an exercise in code style.

steventhedev··on Email Regex that works 99.99%
Pointless? Methinks you've never worked with Mandrill or another service that penalizes you for hard/soft bounces.

If you validate emails as complying to the email format used by those services, you can reduce your hard bounces to a bare minimum. If you check for a valid mail server at that domain, you can reduce that to 0. If you connect to their server and check for an error for that mailbox, you can reduce your soft bounces to 0 too, but that requires a lot of legwork to set up.

steventhedev··on Email Regex that works 99.99%
Nice idea. But a blind implementation of the grammar set out in the RFC is not performant. It's better to drop the obsolete syntax rules and folding white space. I have yet to see a user legitimately try to input an email with a comment mid-domain.

I implemented this in Ruby a while back, but I also went the next step and added a DNS check for a MX record. That way you can ensure there's a mail server to receive an email. Heck, I even wrote a blog post about it.

http://stevenkaras.github.io/blog/verifying-email-addresses

We've had pretty good feedback so far, but I've also spotted a few emails that people enter that are clearly fake (e.g. asdf at test.com).

steventhedev··on City of Detroit launches open data portal
Nice that they're using Socrata. My only complaint is that Socrata doesn't expose an API to list all the datasets in the catalog.
steventhedev··on Amber: a server-side plugin to keep links working on blogs and websites
Will they be releasing the source anytime soon?

It's a great idea, and one that we've long needed a solution for. However, could this possibly be done as a JS snippet that uses a central server by default, to make it easier to integrate into static sites? As-is, it isn't much use for my blog, or many others who use popular blogging platforms (which allow you to embed whatever JS you want, but you sure as hell can't install a server plugin)

This is the article that first made me aware of the problem: http://www.gwern.net/Archiving%20URLs

steventhedev··on Memory matters, even in Erlang (2010)
Nope. I'm barely literate in Erlang, but it looks like they haven't fixed it, unless they've wrapped the backing queue somewhere:

https://github.com/rabbitmq/rabbitmq-server/blob/master/src/...

steventhedev··on Memory matters, even in Erlang (2010)
Horrible link title: "They said high level languages relieved us from thinking about memory issues"

High level languages do relieve us from thinking about memory. The linker allows you to forget about program layout in memory and executable. C and other "system" languages free you from managing byte alignment for your structures, byte order and more, and very high level languages even manage your memory use with automatic garbage collection. Locality is a concern in all these languages, and there's no abstraction for that (yet).

The simple solution to the issue presented in the article itself is any of the following:

1. Remove the call to len(). Handle the empty case from the drop/get/peek call, which would appear to be the idiomatic style for Erlang.

2. Track the size of the queue as is suggested in the docs, to improve the efficiency of this specific call.

Or, you could tackle the underlying issue, which is a lack of locality in the list data type following a GC cycle. This would probably involve allocating a chunk of nodes at once so it's the size of a cache line on the platform that's running the VM. Seems to me like that would make a patch worthy of being merged upstream rather than prefetching random chunks of memory.

EDIT: formatting

EDIT: After looking up the offending function: https://github.com/rabbitmq/rabbitmq-server/blob/master/src/... it appears that they can't just remove the call to len, since it is part of the API. So please ignore my first "solution"

steventhedev··on Comcast: Simulating shitty network connections so you can build better systems
Don't forget jitter, and simulating an ISP that will shut off your DNS traffic at random (literally anything DNS, not just their own servers).
steventhedev··on Jobs that no longer exist today
Hmmmm....

Anyone want to build an LLVM backend + FFI module? Probably worth a small fortune to shops that want to migrate out of MUMPS

steventhedev··on Show HN: JSON-based standard for job posts
The only thing that jumps out at me is that the salary field should probably include a pay period. Sometimes it can be ambiguous, especially between a fulltime engineer and parttime support personnel. If you also add support for number of weekly shifts (within a range), you can easily do salary comparisons (important).

While we're on the compensation topic, it would be nice to include sick/vacation days, recuperation etc. Pension/IRA matching should probably also be included.

steventhedev··on Using Go to improve your Ruby application's performance
More than just the escaping. You should also clean your environment, providing the child process with a bare minimum of information it needs to do its job.

Otherwise you leave yourself open to future security issues, especially if you keep API keys or DB passwords in ENV.

steventhedev··on A Quick Comparison of Nim vs. Rust
This is more of an option than you might think. Nim plugs in to C libraries much easier than you would expect from an FFI. That means even if the stdlib depends on the GC heavily, you can eschew it for the C stdlib.

For example:

    proc printf(formatstr: cstring) {.header: "<stdio.h>", importc: "printf", varargs.}
I'd be interested in seeing a comparison of higher level language features rather than performance (which is generally a result of data structure choices, etc). Stuff like package managers, concurrency primitives, cross compiler support, memory management, and general syntax.
steventhedev··on Google Analytics, Casualty of Spam
For the server-side analytics, it's simple. Just use the GA Measurement Protocol, or a wrapper like staccato[1]. You can push the cid through ajax and javascript so you can even make proper reports, and just send everything from the JS to a dummy property.

[1] - https://github.com/tpitale/staccato

steventhedev··on In his garage lab, Omahan aims to bend fabric of space
Here's his site, for those who want to start the analysis of his data/methodology:

http://www.paresspacewarpresearch.org/

steventhedev··on Neat Algorithms: Paxos
Oops. I had meant to link the survey. His lecture[0] on the subject is quite approachable, for those who prefer visuals to papers.

[0] http://youtu.be/ebWVLVhiaiY

steventhedev··on Neat Algorithms: Paxos
I strongly suggest Shapiro's paper[0] on CRDTs. In a nutshell, the only really problematic data type are sequences such as arrays or strings. There are some specialized approaches specifically for those, and you can always fall back on a LWW conflict resolution.

In general, I like to think of Paxos as an approach that uses LWW for all value types.

[0] - http://pagesperso-systeme.lip6.fr/Marc.Shapiro/papers/RR-695...

steventhedev··on Sorry Google, No CAPTCHA ReCAPTCHA Doesn’t Stop Bots
Sounds like Google isn't doing any validation beyond checking that the token is valid. At the very least, they should consider adding validation against various accounts (if any), the IPs associated with the token, and a few others. It sounds like it would help to reduce the false positive rate.

As for a bot getting a human to "seed" it, there isn't much they can do aside from throttling the rate of automatic passes to once every 20 seconds or so. They could tune that parameter to balance between usability and bot detection.

steventhedev··on “I am not authorizing you to release a Ruby port of Metaphone 3”
Hardly. Alice v CLS only throws out claims based on "performed on a general purpose computer". Mostly, that is enough to refute the remainder of the claims, as they apply to generic mathematical algorithms.

Systems such as this, however, have enjoyed patent protection in the past (Soundex, notably), and his own metaphone and double metaphone systems are cited in several other patents. Google patent search is your friend here.

Snarky comment: The USPTO has a habit of not denying any applications.

← PreviousPage 8 of 9Next →