HNHacker News
TopNewBestAskShowJobs

smanek

8,005 karma · joined October 10, 2007

I'm a programmer (fluent in Common Lisp, Javascript, Java, Python, and Perl). I've dabbled in Haskell, Scala, C++, and Objective-C - but still have a lot to learn about them.

I've worked on a few fun projects, including satellite defense for the DoD, a couple of big Lisp webapps, and large distributed systems.

If you need to reach me: {myusername}@gmail.com

Some of me online:

    https://github.com/smanek
    https://twitter.com/smanek
    http://arantaday.com/
My PGP Key is at http://pgpkeys.mit.edu:11371/pks/lookup?op=get&search=0x9526096E
submissionscomments
smanek··on Go is amazing, period.
Incidentally, I've seen unsynchronized access to a Java HashMap cause an infinite loop on .get()s which is (allowably) undefined behavior, and pretty unexpected (see: http://mailinator.blogspot.com/2009/06/beautiful-race-condit...)
smanek··on Scala Macros: “Oh God Why?”
What else do you think macros provide?

As a former professional Common Lisp dev, those two features strike me as the real difference between a macro and function call.

smanek··on Tell President Obama to support the Federal Research Public Access Act
For the lazy, here is the petition: http://wh.gov/04u

Yes, we all know that online Whitehouse petitions won't have as much effect as calling/writing your congressional representatives. But this is such a 'niche' issue that I could imagine something as small as a this having a real effect.

But call/write too, if you are so inclined!

smanek··on Facebook to File for IPO Next Week
The SEC requires private companies that have more than 500 shareholders to file basically the same paperwork/disclosures that a public company has to. FB is probably nearing (or over) the 500 shareholder limit.

Since they are going to go through most of the downside involved with an IPO anyways, they might as well get some cash too.

Plus, share/option holders (employees, investors, etc) are probably clamoring for liquidity. It's great if you own a hundred million dollars of FB stock on paper - but it's even better if you have the option to sell and diversify your holdings.

smanek··on Larry Page to Googlers: If You Don’t Get SPYW, Work Somewhere Else
FWIW, Greplin's cofounder (Robby Walker) went straight from Google to Greplin. Although, to be fair, his last startup was acqui-hired by Google too.
smanek··on The Modern Java Ecosystem (for the Sinatra or web.py lover)
Ah, I see what you mean - thanks!

The full (buildable) source code - including the CsvParam and DateParam classes - are here: https://github.com/smanek/students

smanek··on The Modern Java Ecosystem (for the Sinatra or web.py lover)
Take a look at Jetty (http://www.eclipse.org/jetty/) for the second option.

I tend to use 'mvn tomcat:run' to run my dev server, which I find even easier, fwiw.

smanek··on The Modern Java Ecosystem (for the Sinatra or web.py lover)
Thanks for the clarification and expansion! I was worried about dumping too many details on people while trying to convince them that Java can be easy too ;-)

But you're absolutely right on most of these points.

All the formatting tricks are here: http://news.ycombinator.com/formatdoc

smanek··on The Modern Java Ecosystem (for the Sinatra or web.py lover)
I love it!

And that is the reason I still write in Python or Lisp when I don't need something (Hadoop, Lucene, etc) from the JVM ;-)

smanek··on The Modern Java Ecosystem (for the Sinatra or web.py lover)
In that example I only throw an exception when you try to delete a student who doesn't exist. The reason I do so is that it contains semantic information which is useful for the client.

If I returned a fake value - the client would get a 200 response on his attempt to delete a non-existent resource, which is clearly the incorrect behavior. I could return nothing - but then the client would see a 204. So, I choose to throw an exception with a response 'NOT_FOUND'

  throw new WebApplicationException(Response.Status.NOT_FOUND);
so that the client gets a 404 response.
smanek··on The Modern Java Ecosystem (for the Sinatra or web.py lover)
How would these be any shorter in Python or Ruby?

  @GET
  public Collection<Integer> listStudentIds() {
    return STUDENTS.keySet();
  }
or

  @DELETE
  @Path("{uid: [0-9]+}")
  public boolean deleteStudent(@PathParam("uid") int uid) {
    final Student deletedStudent = STUDENTS.remove(uid);

    if (deletedStudent == null) {
      throw new WebApplicationException(Response.Status.NOT_FOUND);
    } else {
      return true;
    }
  }
I'll grant that Java programs often become more verbose than their Python/Ruby counterparts - but I would argue that trait can be held to a minimum with the proper libraries and coding style.
smanek··on Dalai Lama hangs out on Google+ after visa is denied
I'll pay due respect to China's opinion on the matter when evidence is produced that he is directly responsible for one death.

In the meantime, the fact that he is considered a terrorist by the Chinese Govt makes them look like idiots - rather than him look like a terrorist. In the exact same way the US calling Maher Arar makes us look like fools.

smanek··on Texas Judge Leaves His Patent 'Rocket Docket' to Practice Law
I wonder if there was any relation to this story: http://www.techdirt.com/articles/20111005/11133116225/judge-...

I could see him wanting to step down before any sort of formal investigation could occur ...

smanek··on Sequoia’s Doug Leone to Mike Arrington: Why You Want to Be a VC is Beyond Me
Generally, the management fee is 2%, and you get 20% of all profit (known as 'two and twenty').
smanek··on Why Developers Never Use State Machines
I found it more useful to control my Twillio interaction via a Finite State Transducer (FST - http://en.wikipedia.org/wiki/Finite_state_transducer) instead of a FSM.

An FST allows you to accurately model 'outputs' on state transitions (where those outputs can be side-effects like 'make a call' or 'send an invoice.' This allows you to prove things about what sort of side-effects/outputs will necessarily have occurred by the time the FST is in a certain state.

I started with an FSM but, found in practice, I was using it like a poorly written FST.

smanek··on The U.S. Postal Service Nears Collapse
I don't think cutting mail service to 2 days a week would disconnect 'country folks.' Anything time sensitive could use email, fax, or (more expensive) private delivery services.

Plus, it's managed horrifically. What sort of real company would have a union contract that categorically prohibits layoffs and mandates rich pensions for basically unskilled workers?

smanek··on The MassChallenge Startups Raise $90M+ & Create 500 Jobs
Creating tech jobs will drive tech salaries up. That will attract new workers to tech (make it worth the investment to retrain, etc), and 'trickle down' money to manufacturing and other industries.

Making the pie bigger is good.

Of course $90M and a few hundred jobs won't shift equilibrium much on its own, but it's a step in the right direction.

smanek··on Amazon EC2 Outage Takes Down Foursquare, Instagram, Quora, Reddit, Etc
It costs engineering time to do so. Time that could otherwise be used to build features, better protect against more common failures, attract users, etc.

Amazon probably has ~5hrs/year of complete failure of a region. Figure, conservatively, it would take 3 months of engineering time to protect against that, plus a 'continuing' cost of 1/2 a week per month to maintain that protection. You'd also have to (at least) double your provisioned capacity (which may include a larger ops team, etc). Assuming your servers cost $20k/month and devs cost $100/hr (both fully loaded), we're talking about ~$340,000 to prevent 5 hours of downtime (just for the first year).

If downtime costs you more than $50K/hr, then it might make sense to be that fault tolerant. Otherwise, there might be better places for a startup to spend its (limited) resources.

smanek··on What's a Closure?
A lambda is an anonymous function (i.e., a function without a name). It may or may-not be a closure, depending on if it has access to surrounding lexically scoped variables.

A closure is a function, combined with the set of variables declared outside its definition (a 'lexical scope').

A monad has absolutely nothing to do with functions/lambdas/closures. The 5-second explanation is that it's a "design pattern" that's useful for managing control flow (often chaining operations together). But Google around a bit if you're interested.

A function-pointer/function-object in C++ are functions that don't have access to external lexically scoped variables. They can only access their arguments, or dynamically scoped (roughly 'global') variables. They are 1/2 of a closure (the missing half is the definition's lexical environment).

smanek··on Another Airbnb Victim Tells His Story: “There Were Meth Pipes Everywhere”
"""Airbnb, while pointing out that the incident was the first of its kind out of some 2 million stays booked since the company's founding in 2008 ..."""

source: http://travel.usatoday.com/destinations/dispatches/post/2011...

Either USAToday misinterpreted/misreported a quote, Airbnb lied to a reporter on the record, or Troy is making up his story. I can't see any other way to reconcile the evidence put forth.

smanek··on Square Now Processing $4 Million In Mobile Payments Per Day
Some (most?) of that 2.75% is going to other people. I know nothing about Square's internal infrastructure - but they are either paying ~3% to some other payment processor, or have become their own processor and are paying ~2% in interchange fees directly to the issuing bank. So, in the best case, Square is pulling in closer to ~0.75% => $30K/day in revenue.

To make matters worse, that 2% in interchange fees is an average across all credit card transactions. But most interchange agreements are "fixed fee + percent of transaction" and I suspect Square's average transaction is significantly smaller than the average credit card transaction. That would imply their cut is even smaller than the 0.75% that it would be otherwise.

On the plus side, at scale Square should be able to directly negotiate better interchange fees with issuing banks - but I'd be very surprised if they ever drop below 1% on average. It would be impressive (but possible, given Square's pull in the industry via Visa et al.), that they've already pulled off some agreement to that effect.

smanek··on The Batman Equation
Assuming copyright/trademark in place on the image, probably not (although, IANAL - so take the following with an appropriate dose of salt).

The short reason why is that bits have color ( http://ansuz.sooke.bc.ca/entry/23).

See http://en.wikipedia.org/wiki/Illegal_prime for a concrete example.

smanek··on Replication, atomicity and order in distributed systems
That provides the same functionality of just using vector clocks, at ludicrously higher cost and complexity (and only addresses half the problem that Alex is discussing).

A big problem is that arbitrary DB writes after split brain (aka network partition) situations are much harder to 'unify' than bitcoin transactions. Check out the Dynamo paper (or Riak docs like: http://blog.basho.com/2010/01/29/why-vector-clocks-are-easy/) for details.

In some cases (e.g., shopping carts) conflict resolution is as easy as it is in bitcoin - but in most common applications it's far more difficult, if not impossible.

smanek··on Google Singleton Detector
and that isn't thread safe lazy initialization either ;-)

it's surprisingly tricky to get lazy init right.

smanek··on ZeroCater (YC W11): Lunch At The Office Doesn’t Have To Be A Complete Pain
IIRC, it started as one of the admins at Justin.tv spending a bunch of time arranging food for them, and then deciding that other startups had the same problem and spinning out Zero Cater.

The YC connection is a great way to get started (incidentally, the YC company I'm currently at (Greplin) has been using them for a few months, and I have no complaints).

smanek··on What Alan T. did for his PhD
The halting problem is a specific instance of the type of problems predicted by the incompleteness theorem (IT).

The first IT says there within any system of logic that's powerful enough to express arithmetic (and consistent), there are always statements that are true that can't be proved true. A specific program, P, that doesn't halt, but can't be proved not to halt, is an example of this. (Or, more precisely, the statement 'The program P halts' is the example.)

The second IT says you can't prove the consistency of a system from within that system itself, but that's another story.

smanek··on Google Loses Access to Twitter Stream, Suspends Realtime Search
Our vision is to have google.com/realtime include Google+ information along with other realtime data from a variety of sources.

The subtext seems to be about as clear a reason as you can hope for from a giant corporation's PR dept.

smanek··on Google Loses Access to Twitter Stream, Suspends Realtime Search
Did you read the article? They had quotes from both Google and Twitter saying the contract wasn't extended
smanek··on The Next Big Thing is Sitting Right in Front of You
From my understanding, most schools used to have hard copy facebooks. I've read Harvard definitely had a (per house) online facebook back when Zuckerberg was a freshman (and, interestingly, still did as of at least ~2008).
smanek··on Clever Names Aren’t Always a Good Thing
You might be right - but you can't logically draw the conclusion that 'lots of people remember the name' based on the evidence presented.

The is no correlation between words people end up reaching your site by, and words that they are trying to find your site by.

Consider the world where 10M people are trying to find Ninite, but forget the name and unsuccessfully google "keep multiple programs up to date". Similarly, 1M people google for some variation of Ninite, and all find your site. Your referrer logs would show that all users reaching your site remembered your name, even though you're throwing away 90% of your potential user base.

That's like trying to disprove the hypothesis: "You don't network enough, so not enough people know you" with the evidence "99% of the calls I get are from people that know me, so clearly a lot of people know me".

← PreviousPage 2 of 31Next →