HNHacker News
TopNewBestAskShowJobs

tomn

368 karma · joined November 12, 2009

hn@tomn.co.uk

https://www.tomn.co.uk/

https://github.com/tomjnixon

submissionscomments
tomn··on Groovy Array: it just keeps going...and going...
As I said, I'm sure that it's legitimate, but it's definitely not good code, and I'd rather not have it lurking in my codebase for years on end. If you don't know the original motivation behind writing something like that, you can't really remove it for fear of the original bug cropping up again without you noticing.

(I guess, then this is also what test cases are for...)

tomn··on Groovy Array: it just keeps going...and going...
This is what comments were made for!

I'm sure it's legitimate, but you'd have to be insane to look at that code and not question why it exists.

tomn··on A better iPad keyboard
I hate to be the one to point this out, but the keyboard on Windows Mobile has had something like this for a long time (drag up to shift, left to delete, right for space and down for enter). It makes typing on iOS devices feel really slow and laborious.
tomn··on AWS Compute Cluster #231 on Top 500
For me, the biggest thing about AWS has been easy access to * ridiculously* powerful machines for not very much money -- a few of us decided that we wanted to build a markov chain from the entirety of Wikipedia, which is quite doable if you have access to a box with 68GB of RAM. That's quite a bit more than a standard student laptop.

I think on the last run we got about 2/3 of the way through; we should be able to do the whole thing if i ever get round to running it again.

tomn··on By example: Continuation-passing style in JavaScript
That looks really interesting, though it seems a bit dangerous -- greenlet feels like a bit of a hack.

I wish I'd found diesel before twisted; it seems a lot more elegant if you don't need any of the built-in protocols. The twisted model is good, there's just too much of it.

tomn··on By example: Continuation-passing style in JavaScript
Twisted (a python asynchronous network programming framework) does something similar, but inverted. Twisted functions return a Deferred object without blocking. A Deferred is a promise of a value, so rather than passing the callback into the function, you register a callback with the deferred, and the function promises to call it later.

This type of thing has a few nice properties -- you can easily register more than one callback, as well as using them as a pipeline (kind-of like monads in haskell), which are awkward to implement with callbacks.

As an aside, in python you can trick generators into turning synchronous-looking code into asynchronous, which can actually make things look a lot neater if done properly -- i'll provide code if anyone's interested.

tomn··on Ask HN: Has anyone hacked their homes?
I live in a house with 4 other computer science students, which should answer your question pretty well.

About a year ago we designed a system/protocol called 'SHET' (https://github.com/18sg/SHET) which consists of a central server that links many clients together. Each client can present many properties (get/set), actions (like methods, that can be called), and events (that other clients can listen for). This was implemented by me in python/twisted and makes controlling/monitoring computers around the house really easy.

About a month ago, someone wrote a system called SHETSource (https://github.com/18sg/SHETSource) which allows us to easily connect arduinos onto SHET. Since we don't all leave our computers on all the time, we have one arduino connected to the 'server' (old macbook) near the switch, which arduinos in our rooms connect to via the spare wires in the ethernet (if you only want 100Mbps, two of the wires are spare).

In my room at least, I have a pir, 3 hacked light controllers, a servo and two switches connected via SHETSource, which allows me to write all the logic in python.

Basically, we've written a hacking framework.

← PreviousPage 7 of 7