HN user

rtuck

17 karma

I'm an American programmer stranded in the Netherlands.

twitter.com/rosstuck

Posts0
Comments9
View on HN
No posts found.

About the pagination example you mentioned: Rather than use link relations, pagination might be better done with URI Templates. This is a spec [1] that allows passing a URI with placeholders to the client which can then fill them in without every option being described up front by the server. It's still a new-ish area but there are library implementations for most major languages now.

Explicit link relations aren't the only way to do hypermedia and the best practices are still moving/being discovered.

[1] http://tools.ietf.org/html/rfc6570

XBMC 11 is released 14 years ago

I can also recommend Zotac's HTPCs for XBMC. While more expensive than the Apple TV ($250~), you get a great little linux-friendly box that does full HD without any issues. If you don't feel like messing with it, you can just drop Openelec on it and you're pretty much done.

They also come with SD card slots so you can buy them without a hard drive and boot from a class 10 SD card as a poor man's SSD (provided you have a NAS). Alternately, it makes a great NAS ;)

I remember the question more in terms of "Does AWS give preferential treatment to Amazon vs other customers?" to which the answer was, of course, "No, it's not workable at such a scale." I imagine there was a large amount of hardware sharing early on and that could be construed as sharing infrastructure; a number of the answers in that session were rather evasive.

I've been looking into a few ways to do exactly that with Raphael. The short answer is that it's possible but a little tricky. I've found three methods so far:

1) If you're using a browser that supports SVG (basically, not IE), Raphael will generate the images as SVG nodes in your DOM tree. You can just grab that entire section of the DOM and send the SVG markup to the server where you render it using the image library of your choice.

2) If you have to support IE the above method won't work. Only IE9 has any SVG support and I've heard reports that it's spotty. In these cases, Raphael falls back on VML, an older MS extension that provides more or less the same experience. Unfortunately, I don't know of a server side generation library that supports VML. What's worse, in my testing, IE won't even print the VML image so you can't even use a PDF writer in the browser.

So, the simplest workaround is use the VML fallback in IE for display but when the user wants to download a final version, generate the same drawing as HTML + Javascript on the serverside and then use wkhtmltopdf on the html. (For those who don't know, wkhtmltopdf is an awesome tool that uses a headless webkit browser to convert HTML files to shockingly good PDFs).

As long as the javascript is triggered on load, wkhtmltpdf will include it in the resulting pdf. This doesn't always work perfectly but odds are it'll work for you.

As an added bonus, SVG bits also seemed to be rendered as vector in the actual PDF. This also prevents any chance of the server side image rendering slightly differently from the user preview.

3) If the wkhtmltopdf method isn't rendering properly or is too exotic for your server, you can try using the great raphael.serialize plugin ( https://github.com/jspies/raphael.serialize ). This works around the SVG/VML problems by exporting the data as a JSON structure. This can be re-rendered inside raphael easily but exporting to PNG is trickier. You can convert the JSON to SVG and render that as in method one, Ben Barnett has a small code example on how to do that: ( http://www.benbarnett.net/2010/06/04/export-svg-from-raphael... ) but there's no complete library for doing this yet so you'll have to write some extra bits yourself. If you do write a library for this, please open source it so I don't have to do it too. ;)

Also, Raphael 2.0 is being launched at jsconf.eu next month so it may have a more clever approach for this but I haven't looked into it yet.

As the umpteen other comments say, yes: Amsterdam is extremely English friendly.

That said, outside of Amsterdam, some rudimentary Dutch helps a lot, especially if you're using public transport. Also, even just trying will automatically garner you a little respect with the locals, they're a bit sick of people who don't even try. ;)

Legally speaking, the larger problem is probably immigration law. The anti-foreigner sentiment here is driving a set of ever more annoying laws and processes.

To digress a bit: For the non-EU crowd, the easiest way into the country is probably with a kennismigrant (knowledge worker) visa. This entitles you to a faster, easier process but there's a few problems: You must work for a company with (or willing to apply for) a special license to have a knowledge worker, you must make over a certain salary, and you're not allowed to do any other sort of work while living here (yes, that probably means your side startup).

Supposedly, you can also set up your own business here and work for yourself directly but I've never met anyone who's successfully done it. I expect you'll probably need to hire a decent lawyer to help sort it out.

Immigration aside, the Netherlands is a nice place to work and there's more to Amsterdam itself then pot and prostitutes. Something interesting is always going on and there's plenty of smart folks bouncing around. Personally, I hope this whole Appsterdam concept (mobile-centric name aside) turns into a huge hit.

If you're going to upgrade to 5.3 (which you should!), I would highly recommend Doctrine 2 (not 1, very different project). It's a loose port of Hibernate from Java and takes a very different tack then most PHP ORMs. The models have no mandatory base class, the pattern is more Data Mapper then Active Record, it allows batch flushing to the database, has associations, and has some really great features like inheritance mapping and an event hook system.

There are pieces to dislike (arguably DQL, soft deletes are almost impossible, etc) but so far, it's a huge step forward from the likes of Zend_Db_Table or Doctrine 1.

http://www.doctrine-project.org/projects/orm/2.0/docs/refere...

I've tried out a few different tools now; the only two I've had any real success with were Capistrano and Fabric.

Capistrano works well, great git integration, but it does have some rails-isms you need to override to make it work sanely. The capistrano-php extension can help with that: http://github.com/namics/capistrano-php but you'll need to use gem to manage it. You'll also definitely want the multistage plugin which doesn't come standard. There were some bugs present in the CVS integration which may be a problem depending on your source control system.

I've also tried Fabric: http://docs.fabfile.org/0.9.2/ I liked the tool. I found it a bit more low level then Capistrano but also a little simpler to work with. It comes prepackaged (albeit an older version) in Ubuntu without any dependencies other than stock python which our sysadmin preferred to using Ruby gems. I do recommend the new version found in pip though. The two main problems with Fabric are its lack of any integration plugins and the Paramiko SSH library it uses has no support for SSH key forwarding (there is a workaround: http://lincolnloop.com/blog/2009/sep/22/easy-fabric-deployme... but it has its own set of problems).

In the end, neither worked out for me. Capistrano had to much of a learning curve for my co-workers and Fabric wouldn't work with our SSH setup. For now, I'm using a script in our working directory that I SSH to, run, and it updates the code in place. Crude, but ultimately effective. That said, definitely looking forward to a replacement.