HNHacker News
TopNewBestAskShowJobs

pmahoney

632 karma · joined December 22, 2011

submissionscomments
pmahoney··on Elon Musk Calls Hydrogen Fuel Cell Cars ‘Bullshit’
I know this is somewhat tongue-in-cheek, but what would the long-term consequences be of importing large quantities of hydrogen from off-planet and then binding it to local oxygen?

I suppose if we had the tech to do that, we might be able to find off-planet oxygen as well...? Except wasn't most of ours produced by plants splitting carbon-dioxide?

pmahoney··on A Penny Saved: Psychological Pricing
Back when I worked at Target, it was also this way. As I understood it, the system simply did not allow for a multiple item discount. The "3 for $4" ads did always say, in fine print, something like: unit price $1.33.

What got me was that a 12-pack of certain replacement razors was more expensive than three four-packs. I distinctly remember that one, having done a double take and checking my math with a friend.

pmahoney··on In emergency cases a passenger was selected and thrown out of the plane (2004)
I'm curious why you wouldn't recommend it. I've never used it myself, but I've been reading about it the past few weeks. The design seems really well done compared to init.d scripts in the sense that every init script must reimplement daemonization, pid files, etc. (which is helped by examples, start-stop-daemon, etc. but is still a huge and delicate chore in my experience).

Is your objection that daemontools is largely unused / unmaintained and lacks features (such as flapping-avoidance)? Or something else?

Just curious, thanks.

pmahoney··on Gnome's Web Browser Ditches Google For DuckDuckGo
I wonder if there's an element of users learning how to optimize their query for Duck Duck Go. I've been using it as a default for some months now, but I often fall back to Google for software error message strings and other things.
pmahoney··on Learning how to think
But not every car has that. I've been in a ~6-8 year old Honda Civic that lacked any indication as far as I could see.
pmahoney··on The one HR benefit every startup should add
I don't have numbers, but back when I had no dental insurance, my dentist reduced the price without any prodding. I'd be surprised if this wasn't common.
pmahoney··on Nginx Plus
I assume he was correcting the line "we'd be running abominations like MS IIS". Many of us were running Apache httpd prior to Nginx (and Apache remains a very competitive server; still the easiest way to run PHP, and Rails+Passenger+Apache is arguably simpler than Rails+Unicorn+Nginx).
pmahoney··on Containers and Docker: how secure are they?
> we keep saying docker is not yet production-ready

Just a heads-up: I know this isn't your fault, but docker.io does not say this on the front page, About, or FAQ that I can see. In fact, it currently says "same container that a developer builds and tests on a laptop can run at scale, in production".

Docker looks very interesting, thanks for your work.

pmahoney··on Rewriting a large production system in Go
Tomcat (and other app servers) has support for doing hot reloads of Java web apps while not reloading the HTTP layer (and not dropping TCP connections).

http://www.javacodegeeks.com/2011/06/zero-downtime-deploymen...

I have implemented a similar system for JRuby apps running inside a Servlet container. There are many caveats. I don't actually recommend it because for a while you're using nearly twice the memory (and JRuby is particularly memory hungry). Also there are many ways to leak the old class definitions such that they are not GC'd (e.g. thread locals). But it's certainly possible.

I suspect that Erlang, Java, and all languages are in the same boat: some parts can be upgraded live in the VM while other parts require a full restart (maybe coordinating with multiple nodes and a load balancer to achieve zero-downtime).

pmahoney··on Human-Powered Helicopter Wins the $250,000 Sikorsky Prize
The claim that a 4-minute mile was once thought to be impossible by informed observers was and is a widely propagated myth created by sportswriters and debunked by Bannister himself in his memoir, The Four Minute Mile (1955). The reason the myth took hold was that four minutes was a nice round number which was slightly better (1.4 seconds) than the world record for nine years, longer than it probably otherwise would have been because of the effect of World War II in interrupting athletic progress in the combatant countries.

https://en.wikipedia.org/wiki/Roger_Bannister

pmahoney··on Why Ruby rocks
I suppose the author was trying to be explicit for the sake of a reader unfamiliar with Ruby. The typical way to avoid that boilerplate is by using 'attr_accessor :sanity', which defines those getter and setter methods (and it is possible to implement attr_accessor or similar directly in Ruby, should you need more boilerplate-reducing helpers).
pmahoney··on Omni: The "Oculus Rift" of 3D Treadmills
Is it possible your bad knees make running unpleasant and not the other way around?

Does your condition have a name? I've not seen claims of long-term injuries (as opposed to acute injury) that have names other than osteoarthritis.

Thanks.

pmahoney··on Omni: The "Oculus Rift" of 3D Treadmills
> It's bad enough that I go running an hour every other day

Well you're in luck. Running at sub-elite levels has not been correlated with osteoarthritis.

http://www.ncbi.nlm.nih.gov/pubmed/9489830 http://www.ncbi.nlm.nih.gov/pubmed/22632690

pmahoney··on Linux is not about choice (2008)
I actually find PulseAudio vs. JACK incredibly annoying. I like to play around with "professional" audio. I don't consider it professional, but more relevantly I like to play with certain apps that require JACK.

It's certainly an RTFM thing, but last time I didn't know how to get PulseAudio to go away. I wrote a shell script to keep killing it in a loop (since it restarts itself) long enough to get JACK to take over. I know there must be better ways...

Then inevitably once I've got JACK setup, I'll want to play some background music or watch some Flash video online without tearing down my JACK setup. Oops, does that audio player support JACK natively? Do I have that plugin installed? Can I run Pulse and have it direct output into JACK? None of this has worked smoothly in my experience.

> users of JACK generally buy high-end hardware specifically for that purpose and know what they're doing

This has not been my experience. I love to dabble, but apparently don't know what I'm doing.

pmahoney··on In 1897, a Bicycle Superhighway Was the Future of California Transit
That's a good point. I'm young(ish) and tend to race my past self (while following traffic laws). On one hand, what's the point of biking if I can't get to work faster than by bus? But on the other, a more leisurely pace would surely leave me less sweaty while still providing some exercise benefit.
pmahoney··on In 1897, a Bicycle Superhighway Was the Future of California Transit
I've been lucky to work in areas where theft isn't a huge issue. My biggest problem is the weather.

In the hot, humid summers, I wish my building had a shower, or at least some area to change clothes larger and less smelly than a bathroom stall. When it rains, there isn't always an appropriate place to hang dripping, often muddy clothes (and I hope they dry off before the ride home). I'm also lucky to not need to wear a suit, but I don't envy those whose responsibilities include being more presentable.

If the roads aren't covered with snow and ice, the worst part about winter is the darkness, but that isn't something an office building can solve.

pmahoney··on We Need A Standard Layered Image Format
It also, unlike tar.gz, provides an index for easily seeking to and extracting just one file from the zip archive. My understanding is that doing this in a .tar.gz means unzipping and processing the whole tarball as a stream.
pmahoney··on The Node.js Community is Quietly Changing the Face of Open Source
No conflicts, but a tradeoff of loading two versions of library C. I assume at some point, the cost of multiple versions of everything (in terms of memory usage, for example) becomes an issue?
pmahoney··on Web Framework Benchmarks
For the sake of curiosity, I happen to have recently done a benchmark of a "hello world" rack app (literally just responds "hello world" to every request) on a number of Ruby servers (mostly JRuby, but also Puma on MRI).

They were all run in production mode with logging disabled, etc.

http://polycrystal.org/~pat/scratch/microbenchmark.png

Note that a difference from 10k requests per second seems huge compared to 3k, but if you invert it, you get 100 and 333 micro seconds per request, respectively. In a real, non-"hello world" app, these differences are going to be negligible.

Though perhaps it would be more interesting if instead of just responding "hello, world", the app parsed some query parameters or something. But I was mostly interested in the overhead of different JRuby servers, not comparing different app servers (i.e. overhead from Sinatra should be more or less identical whether you're on Puma, Trinidad, or whatever).

pmahoney··on Web Framework Benchmarks
In development mode, it's nice to be able edit ruby code, then hit reload in the browser to see it in action without restarting the whole app. Sure there are other ways to accomplish this, but reloading code is typically how it's done in Ruby.
pmahoney··on Why Ruby?
I have found RESTEasy (and likely any JAX-RS implementation) to be very nice for creating simple services. With various annotations and static typing to automatically convert various parameters into function arguments, it's easier than Sinatra on Ruby. (Of course, there's a bit of config overhead to hook it into a web.xml, but it's not terrible)
pmahoney··on Why Ruby?
Another option is to build an index of the various parts of $LOAD_PATH. I monkeypatched (JRuby) to do this at runtime (that is, re-index every launch), and I saw a modest speed up in Rails boot time. If there were a standard way to build a semi-permanent index (updated by 'gem install', etc.), I'd expect the index to give even further gains. Of course, this is more invasive than your suggestions.

https://gist.github.com/pmahoney/3996724

pmahoney··on How Corning Created the Ultrathin, Ultrastrong Material of the Future
Crack kills.

Metals are able to deform plastically. A metallic bond is not so directional, and you typically thing of all the molecules in a metal as a big blob with a cloud of electrons that can freely move about (also the reason for good electrical conductivity).

There are "elastic" and "plastic" deformations. Think about bending a paperclip. Use it gently, and you can open it up and get it to squeeze a few papers together. Pull it off and it returns to its original shape. That's elastic. Now open it wider or bend it into another shape, and it will no longer return to the original shape. That's a plastic deformation.

Metals can deform plastically which means layers of atoms are sliding past one another in waves. Sometimes these waves are stopped by various irregularities in the crystal lattice. The waves start to pile up, preventing further plastic deformation. Keep bending that paperclip back and forth; it will eventually snap. But in the meantime, it absorbed a fair amount of energy. That's "toughness".

In a ceramic, the electrons are not free to move about. If a crack develops, it doesn't take much for there to be terrific stress at the tip of the crack (much like a lever and fulcrum). The crack propagates through the material, and you have catastrophic failure.

There are various ways to increase the toughness of ceramics. I'm not all that familiar with them, but a common one is Yttria-stabilized zirconia. That's zirconium oxide with added yttrium. Under stress from a crack, the material can undergo a phase transformation (from one crystal structure to another; not solid to liquid or anything like that). A phase transformation absorbs energy (just like boiling water into steam does) which may be enough to stop the crack from propagating. My ceramics professor had a YSZ hammer that was gifted to him by Coors ceramics (same family as the beer company). YSZ is not transparent however.

http://en.wikipedia.org/wiki/Yttria-stabilized_zirconia

pmahoney··on The DOM isn't slow
"Public service announcement: Object pooling is now a serious performance loss for all but the most heavyweight of objects, and even then it is tricky to get right without introducing concurrency bottlenecks."

  -- Brian Goetz in 2005
http://www.ibm.com/developerworks/java/library/j-jtp09275/in...

This article was also written when Java 6 was starting to get escape analysis, which can result in stack allocations in some cases.

I recall taking a course in 2008 or so (Java 6). We were doing a genetic simulation of sorts, and the professor recommended using an object pool to speed things up. I implemented one and observed no measurable difference in my code's performance (these were very small objects used over and over again evolving new organisms). I hooked up a profiler and used that to guide me to some areas that could be improved, and a valuable lesson was learned.

pmahoney··on How to Watch Netflix in Ubuntu Linux
You're still giving your eyes and attention to "these dicks".

I suggest trying to find and support media that is offered without DRM in the first place, if that is what you consider important.

pmahoney··on Ruby 2.0.0 in Detail
Part of it must be that binary search only works on a sorted array, and most arrays won't be sorted.

Followup question: are there other common array operations that only work on arrays in a particular state? Are any of these in or out of various standard libraries?

A long time ago... I implemented a wrapper around the Gnu Scientific Library matrix operations. I recall trying to be clever by mixing in some extra methods only after getting the LU decomposition (these extra methods required the matrix to be in a specific state). A little too dynamic for my current tastes. It's not a terrible idea perhaps, but this sort of thing tends to kill performance.

pmahoney··on Bullying has to stop, now.
One of my fears about telling kids to defend themselves with force is what if the bully has a gang of friends? An older brother? Access to a weapon? How likely is it that a bully, finally beaten by the victim, escalates further?
pmahoney··on Domain Knowledge or a Lack Thereof
What sort of backgrounds do people working in this field have? More specifically, I have a bachelor's degree in materials science and currently work doing run-of-the-mill web development (were the typical background of my peers is a bachelor's in CS). What steps might I take to move into computational engineering?
pmahoney··on Ruby 2.0.0-rc2 is released
Here's an article from Headius, JRuby developer: http://blog.headius.com/2012/11/refining-ruby.html
pmahoney··on Ruby deploys temporarily disabled
I, too, would love something like this.

You're probably aware, but it's possible to host private gems in a simple static webserver. We have our CI server copy gems over and run a script that calls "gem generate_index -d /path/to/gems".

Completely featureless, of course. Lacks the newer rubygems.org api (so bundler is stuck downloading the whole index), and obsolete versions will stick around without manual intervention (which, if you have too many, is a pathological case for bundler's resolver).

← PreviousPage 6 of 7Next →