HNHacker News
TopNewBestAskShowJobs

mattdw

625 karma · joined December 14, 2009

NZ-based senior dev/animator. Houdini, WebGL, games, VR, websites, and native apps.

http://mattdw.github.com/ http://problemattic.net/

submissionscomments
mattdw··on How Instagram Feeds Work: Celery and RabbitMQ
Which was where Twitter had to go in their first major refactor, as well. Originally timeline views would be built on-demand, but that approach proved unscalable very quickly, so they moved to preemptively building timelines by copying tweets everywhere they needed to go at publish-time rather than request-time.

It's basically just an inversion; instead of the cache being a read-through layer over the database, the database becomes a write-through layer over the cache.

mattdw··on Rhode Island unintentionally decriminalized indoor prostitution in 2003
Yes and no. Yes, violent stranger rape is a tiny percentage of rapes, but the communication thing is (according to a study by Lisak) largely a post-hoc rationalisation; at the time communication is actually quite clear, but because of this myth, pretending to misunderstand etc proves an effective form of plausible deniability. Alcohol, yes, definitely, as again it's just another cloak of plausible deniability and 'social license'.
mattdw··on Plain text wrapping in Gmail
I disagree, because it's (far) easier to soft-wrap QP long lines than it is to unwrap hard-wrapped short lines. Hard-wrapping essentially causes a loss of information, by not distinguishing between user-inserted and program-inserted newlines.

Any client program can wrap as appropriate (which is not always to 80 chars, but 80 chars would work as well as anything) with QP; the same is not true of hard-wrapped as gmail does it.

mattdw··on A 30-minute Introduction to Rust
I've only ever used GCed (and largely dynamic) languages up until now (Python, JS and Clojure primarily); C is alien and C++ is frankly terrifying. With all that, I've been having a ball using Rust to solve Project Euler problems, with astonishing speed compared to what I'm used to.

It doesn't quite have all the libs you might want for general development yet, but for the things it's currently equipped for it's a lot of fun, and surprisingly easy. (Up until I find myself in a quagmire of lifetime problems of my own making. Looking forward to the coming lifetimes inference enhancement.) It's a surprisingly reasonable functional programming environment too.

mattdw··on Concurrency is the New Memory Management
As far as I'm aware there's two approaches (often both used at once) in modern GUI systems that mitigate this. One is an explicit event loop, which can be locked up by user code but not normally by routine events, and the other approach is running the UI on its own thread. (Or, to put it another way, applications should perform any long-running operations not on the UI thread.) The second, particularly, would avoid the dropping-sockets problem, as network and drawing would very likely be on separate threads.
mattdw··on Tail Calls, Optimization, and ES6
can't throw exceptions that the caller can catch. If an exception falls in the forest, and there's no one there to catch it…
mattdw··on LocalBitcoins received an attack against the site infrastructure
> Unless the "encrypted data" is simply being stored on that server, and not used, this seems like a hopeful statement to make. If a server process is accessing it, then it must have the key, at the very least, in memory (which root can access, though finding the key might be somewhat of a feat)

The attacker got access via a reboot, so something as simple as passphrase-protected private keys would probably be sufficient here - "manual actions" could well refer to "enter the passphrase after startup". Or using something like kerberos, where credentials have to be fetched/validated via a separate server.

mattdw··on TrueCrypt Security Assessment [pdf]
I feel like there should be a more efficient way to store these things. You have a complete enumeration of possible inputs (passwords), but unfortunately we need to go in the opposite direction, so we couldn't just index into a n*9 bytes array. Depending on how well distributed the md5 hash space is, it's possible a prefix tree might save you a bit of storage (you'd only have to save a couple of bytes per entry to cancel out the overhead) but I couldn't tell you the numbers there. Otherwise I think you're right, and we'd just have to store a map of md5 -> password.

(Edit: Also being limited to alphanumeric for hashes and printable ascii for input gives you pretty good compression potential.)

mattdw··on Programming With Types, Not Tutorials
My issue with this is that, quite aside from my lack of understanding of what's going on, the author is constantly professing their lack of understanding of the underlying details.

> I still don't know a thing about what F or Coyoneda mean. But it isn't really slowing me down.

They're essentially cargo-culting signatures, and while sometimes that can be enough to stimulate proper understanding, I worry that the first time something goes wrong the author will be hard-pressed to solve it. It seems like a useful way to stumble around in unexplored areas; it doesn't seem like a good way to build software you're going to have to maintain and support.

mattdw··on Why is printing “B” dramatically slower than printing “#”?
option-8 on my mac keyboard is •.
mattdw··on The indignity of no work
Compensation also takes into account the joy the job provides, some jobs are relatively pleasant and thus pay less than some that are much worse.

That's not generally my observation of the world. No-skill-required jobs pay less, skill-required jobs pay more. There's a slight bonus for dangerous jobs, but not a heap, relatively speaking. Pleasure derived or not only appears to have an effect on income levels outside of traditional employment and into freelancing territory, for example with starving artists and writers.

mattdw··on The indignity of no work
An alternative to fixing prices would be just to compete. The government could start building its own housing, recouping the costs straight back from UBI rents, and simultaneously holding privately-owned market prices to a more reasonable level.
mattdw··on The indignity of no work
The idea of a basic income is still sci-fi.

That's untrue. Switzerland is having a national referendum on whether to offer one, and stipends from oil or casino money, while not enough to live on at this point, already exist in a few places. You may be correct that there's not enough money to give everyone enough to live on, but it's far from sci-fi.

(There is plenty of money in the world, it's just tied up in things like insane finance industry salaries, or $500k/yr/person for imprisonment, etc.)

And historically? People looked after their own menial tasks, where they were small enough, and where the tasks were too big for individuals (like roads, or building a town hall) the community got together and did it.

mattdw··on The indignity of no work
> A world in which a healthy adult has the reasonable expectation of earning a decent living while working full-time at a market wage is absolutely a world in which the dignity of work is a useful social value to cultivate. In a world in which that is not a reasonable expectation, the dignity of work can be a harmful concept.

Interesting times ahead. It's going to be painful getting there, if we get there at all, but the idea of a Universal Basic Income seems to be getting more popular. (It wasn't so long ago it was pretty much pure sci-fi.) Particularly I guess as it begins to look like modern capitalism may not actually be good at providing jobs for everyone who needs one.

Potentially UBIs could be very good for the world, freeing people to work on things they personally desire and value, and in some ways redistributing the 'means of production' back to the little guy.

mattdw··on I love you
(it's lucky that all of the letters in "alert" can be found in "true" and "false", although "undefined", "NaN" and "[object Object]" could probably be used too.)
mattdw··on I love you
If he can get a reference to the window or 'this' at any point (which I haven't yet figured out), he can presumably use his string-building tricks to build the string "alert", then use:

    window["alert"]("hello")
mattdw··on I love you
It's actually understandable, just tedious. Lot of dynamic typing/casting tricks.

First, we set var '$' to bitwise NOT of [], which is -1 ([] casts to 0 or false depending on the operator):

     $ = ~[];
Then we re-set $ to an object:

     $ = {___: ++$,
          $$$$: (![]+"")[$],
          ...
Which gives us:

     $.___ == 0 // ($ was still -1, now it's 0)
     $.$$$$ == "f" // I think
The "f" is a bit clever:

     ![] == false
     (![]+"") == "false"
     (![]+"")[$] is an index on the string, and $ is now 0
That's as far as I've bothered. (edited for formatting)
mattdw··on Use this to demonstrate Adaptive, Responsive, Static and Liquid
I quite like this idea. A lot of toolkits already allow a widget to specify a "preferred size." I wonder if a simpler approach to your idea would be similar to e.g. the Accept-Content-Type HTTP header; a widget lists a series of preferred widths (or width ranges) with weights.

  preferred-width: 300px, 1.0; 200px..299px, 0.7; 100px..199px, 0.5;
That's slightly less flexible than a utility curve function, but (especially if ordered) is far easier to optimize for, as choices are ordered and restricted.
mattdw··on Why Games Should Enter The Public Domain
UUID "contained in the work" would be troublesome in many mediums (music recordings, film, paintings, for instance). Perhaps "travels with the work" would be manageable though.

And it's worth considering that every tweet, every photo on Flickr, every video on YouTube, every status update on FB, and so on, constitutes a new copyrightable work. Not everyone will care about the copyrights of their tweets, but some will. How do you copyright something for which you have no control of the identifiers? I assume you don't intend for people to hit up the service for a new UUID before tweeting and embed the token in their tweet?

(Obviously this problem would go away if e.g. Twitter itself signed onto this scheme, automatically registering and UUIDing your tweets on your behalf.)

mattdw··on Graph of Programming Language Influences
Not to mention that it's just repeating whatever myths Wikipedia has picked up, like the connection of Javascript to Scheme. A more rigorously curated graph would be very interesting.
mattdw··on New brand site for Sony uses rendered JPG frames for 3D parallax scrolling
Does it still chop after it's had an extra 30 seconds or so to load? It lets you start scrolling before it's fully loaded, but unfortunately the backfill-loading causes the scrolling to go choppy.
mattdw··on New brand site for Sony uses rendered JPG frames for 3D parallax scrolling
We show lower res while scrolling, load in high-res when stopped. All text, overlays etc are HTML which track frame-by-frame.

Assume all the usual tensions between designers and developers :).

mattdw··on The origin of zero-based array indexing
Related is Dijkstra explaining the pros and cons of different styles of indexing and slicing: http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EW...
mattdw··on The Power of a Pronoun
As he expands on it later, it was a deliberate choice of gendered pronoun given (a) no particular need for it and (b) a perfectly acceptable alternative being provided. Additional context is that Ben not only rejected the PR, but then reverted it after another dev accepted and merged it.
mattdw··on Gulp: The streaming build system
It looks mainly to be pitched as an alternative to Grunt, the current main (I think?) Node.js build tool. And its primary feature seems to be that you don't have to figure out where your intermediate build products go. Beyond that, who knows.

(Grunt, incidentally, strikes me as a system that has learned nothing at all from decades of other build tools. It's about one step better than piping globs to unix commands.)

mattdw··on FBI raids alleged online drug market Silk Road, arrests owner
That was my first lesson in validating any external input. Learned the hard way, in my first six months of building websites professionally. Happily, the hosting provider put me onto a helpful tech guy who walked me through what I'd done and how to avoid it. There was a lot less 'common knowledge' and 'everyone knows' in 2001.
mattdw··on We don't want your coffescript
> The first time I saw CoffeeScript I immediately realized, oh, fuck yes, this is obviously better, and switched over to it immediately. I was productive with it instantly.

Which is fine for you. But I tried it for a project then ditched it, because it didn't justify the extra tooling required in my development pipeline, and because there are ambiguities and inconsistencies in the syntax and the language, and yes, occasionally it's actually worse than Javascript.

Which is only to say that not everyone fits into a "doesn't know CoffeeScript"/"loves CoffeeScript" dichotomy.

mattdw··on Bradley Manning's Post-Sentencing Statement
Hell, Abu Ghraib was just bad apples, officially, and said apples were punished.

So it would have been entirely possible to go to war in its wake without expecting to participate in its like. After all, officially (from the outside), it was condemned.

mattdw··on Hours until NZ spy law passed. Contact your MP.
haha, I'm seeing #blockedbypaul beginning to spread around the tweets. Apparently you're not the only one.
mattdw··on Hours until NZ spy law passed. Contact your MP.
(The companion bill to the GCSB bill, the TICS bill, mandates backdoors/"interception capabilities" for the GCSB in any network or "over the top" systems, which appears to include foreign cloud services. No one is sure how that is possibly going to fly, although Microsoft and Mega have both suggested they'll be pulling cloud services out of NZ if the bill passes.)
← PreviousPage 3 of 7Next →