HNHacker News
TopNewBestAskShowJobs

joewalnes

1,236 karma · joined August 23, 2010

https://twitter.com/joewalnes https://github.com/joewalnes
submissionscomments
joewalnes··on Convert 2D camera to 3D depth camera with machine learning [pdf]
Video demo: https://www.youtube.com/watch?v=AyCkmbqB7ko
joewalnes··on Ask HN: Object you'd like to see connected to the internet?
Hulk Hogan
joewalnes··on Nginx Tutorial: Developing Modules
I love how this tutorial starts by writing an automated integration test. More tutorials should do this. A fine job. Have a cookie.
joewalnes··on Orbcomm OG2 Falcon 9 Satellite Launch
Awesome! Are they going to repeat the launch for the west coast?
joewalnes··on Ask HN: What projects are you working on?
I'm working on my first consumer hardware project - an external Bluetooth camera flash for iPhone: https://wantnova.com.

The hardware is now shipping and now I'm working on improving the iOS app, which I've made open source: https://github.com/nova-device/nova-ios-app

joewalnes··on Ask HN: What projects are you working on?
So purdy
joewalnes··on Ask HN: What projects are you working on?
That's pretty frickin' sweet!
joewalnes··on Apple To Abandon Headphone Jack? Beats Deal Suddenly Makes Sense
This seems like FUD. Being able to stream audio through Lightning is necessary for audio docks and other accessories. It's quite a leap to say they're going to remove the headphone jack.
joewalnes··on Show HN: Product Hunt – Hacker News for Products
HN and PN are the two sites I now visit daily to keep up with the world. Great job rrhoover (and pg, of course!)
joewalnes··on Go by Example
Agreed. I've been programming Go for a while, and yet I still find this site invaluable. Because I context switch between many languages, I forget syntax a lot. Hmmmm... maybe I'm just getting old. Anyway, I find it much quicker to get the answer I need by looking at GoByExample, than by browsing the Go docs. Kudos to this site.

It helped me build this: https://github.com/joewalnes/websocketd/

joewalnes··on ReconnectingWebSocket
> No ping/pong

Author here.

Are you referring to the ping/pong message frames in the WebSocket transport protocol, or just a general heartbeating protocol layered on top of WebSockets?

If it's the former, then there's nothing ReconnectingWebSocket can do here as this is not exposed by through the standard JavaScript API. Even if it was exposed, I'm not entirely sure what it would do.

The latter requires a custom protocol built on top of the user's WebSocket messages. This would require additional code on the server to process the messages. Libraries would have to be created for the various server side WebSocket implementations. It's a much messier abstraction, and I'd prefer this library to stick to one thing and do it well.

> no mention of what happens to messages in > transit when the connection drops

In this regard it behaves exactly like a regular WebSocket connection - the message is lost. All this library care of is ensuring that a new connection is opened.

joewalnes··on ReconnectingWebSocket
Author here: That's a good feature request. I shall implement a truncating exponential backoff algorithm tonight (maybe tomorrow).

I've been using this in production for over 2 years and my load levels have not caused any usability issues (even without backoff). But no doubt for heavier sites, this will be an excellent feature, so thanks for suggesting it. If you have other feature requests, please add them to the issue tracker as I'm more likely to notice them: https://github.com/joewalnes/reconnecting-websocket/issues

In answer to your question - the use of an abstraction is to allow new features (like the one you suggested) to be added in one place so individual users can easily make use of the additions.

joewalnes··on ReconnectingWebSocket
Socket.IO is awesome, but my understanding is that Socket.IO also requires server side components as it adds a layered protocol on top of the WebSocket transport.
joewalnes··on Ask HN: What are you using Go for?
Here's an example of using it to build a quick Linux system monitoring dashboard: https://github.com/joewalnes/web-vmstats
joewalnes··on Ask HN: What are you using Go for?
This: https://github.com/joewalnes/websocketd
joewalnes··on Turn any application that uses stdin/stdout into a WebSocket server
I don't recommend any kind of input parsing in a shell script. You're better of having websocketd fork something like Python, Ruby, Perl, PHP, etc.

Like CGI, websocketd will pass additional URL path and query parameters as environment variables.

So you could access something like ws://somehost/?a=b and you'd access the QUERY_STRING environment variable in your script (which contains "a=b"). Virtually every scripting language already has a library for parsing CGI environment variables so you can do that.

Basically, websocketd tries to emulate CGI as much as possible, but provide WebSocket streams instead of HTTP responses.

joewalnes··on Turn any application that uses stdin/stdout into a WebSocket server
It solves the problem of users having an older version of Go installed on their system. For example, if they installed it via apt-get.
joewalnes··on Turn any application that uses stdin/stdout into a WebSocket server
huhtenberg: I believe AsymetricCom was referring to being able to compile an executable using perlcc. He wasn't referring to the networking aspects of it (WebSockets have not been around 10 years).

huhtenberg: You're right. It's very similar to inetd - that's why the first sentence in the websocketd description is "Like inetd, but for WebSockets".

The thing it adds on top of inetd is it takes care of the protocol so the underlying app doesn't need to. Namely HTTP WebSocket handshaking and data framing.

joewalnes··on Turn any application that uses stdin/stdout into a WebSocket server
Author here. 2 reasons.

1. So developers can do a clean checkout and it will just work. No external dependencies needed (e.g. manually installing Go, setting GOPATH etc).

2. To ensure that anyone who builds and releases it always uses the exact same version of Go.

joewalnes··on Turn any application that uses stdin/stdout into a WebSocket server
It's similar to netcat -e and inetd, except it also handles the WebSocket protocol (negotiating the handshake and message framing), so your apps don't need to.
joewalnes··on Turn any application that uses stdin/stdout into a WebSocket server
Author here. Indeed! The very first version of websocketd was actually written in Node. It's great for this kind of stuff.

The reason I switched to Go was to make distribution/installation for end users easier.

joewalnes··on Turn any application that uses stdin/stdout into a WebSocket server
Author here.

If you use this on top of programs like bash, well ermm, you get what you deserve ;).

Here's an example of how I used websocketd to create a little dashboard for monitoring Linux CPU/memory/IO stats. It basically uses websocketd to stream the output of vmstat to a web-page that plots the numbers: https://github.com/joewalnes/web-vmstats

Other useful examples: tailing log files, executing long running job and monitoring output, or interactive querying of datasets that require a long running 'cursor'.

This is not for everyone or everything. Remember that like CGI, a process is forked for each connection so it's not the kind of thing if you want to handle a million concurrent connections on a single server.

However for dashboards, admin tools, quick mashups, visualizations, etc - it's a pretty handy tool.

joewalnes··on Why PHP continues to thrive in the age of the PaaS
OP nailed it.

PHP has similarities to Bash scripting. Language sucks. Syntax is awful. You wouldn't want to build anything big with it. You feel dirty and ashamed every time you use it.

But... if you just want to get shit done, it's often the path of least resistance. I can live with the shame.

By the way, Mike isn't just talking about PHP here. It also applies to CGI, ColdFusion, ASP, JSP and lots of other old technologies that make you want to cry. Basically anything where you have a web server and you can just drop executable scripts in a directory.

Even though I rarely use PHP any more, I still write a lot of my Python and Ruby web-apps using classic CGI instead of the popular frameworks because it's just so quick and easy (and dirty). Deployment is a breeze, managing servers is simple and it's ideal for quick mashups. Been meaning to write more about this: http://helpmewrite.co/people/joewalnes/ideas#idea-1978

joewalnes··on Resisto.rs: No frills resistor color codes
I've just updated the site to show 4 band vs 5 band resistors (by popular request).
joewalnes··on Resisto.rs: No frills resistor color codes
Yep!
joewalnes··on Pi Crust: Connect things to your Rasperry Pi
A few updates:

OSHPark now sells the bare PCB for $4.60: http://store.oshpark.com/products/pi-crust-v4

There's a Google Group to discuss ideas, etc: https://groups.google.com/forum/?fromgroups#!forum/picrust

joewalnes··on Pi Crust: Connect things to your Rasperry Pi
Indeed it is just a breakout board. It's really just to make it more convenient to connect peripherals. I've found for simple things like LEDs, buttons and some I2C components you can get away without additional protection.

I should probably add a little guide explaining what you can do (and more importantly what you shouldn't do). Thanks for bringing this up.

While I'm plugging... It has a big brother in the works over at http://quick2wire.com/ which is pimped out with a regulator, level shifters and protection diodes. This means to address the issues you raise to make it easier to tinker and reduce the chance of damage.

joewalnes··on Chrome supports TCP & UDP sockets
Here's a plug for an existing plugin that brings these capabilities to standard web-pages. Works in Chrome, FireFox and Safari.

http://sockit.github.com/

Note that this was a research project. It works, but there's no security, so once installed, any malicious web-page could use your browser to connect to TCP/UDP end-points.

joewalnes··on Smoothie Charts: a small javascript charting library for live streaming data
(I'm the author)

An initial version of SmoothieCharts used SVG, but I switched to Canvas because I got slightly better performance (which actually surprised me).

That's not strictly true - for very large charts, the SVG ones performed better, but I optimized for the common case.

Recently I've been experimenting with a WebGL version - it gives MUCH better performance than both Canvas (2D) and SVG, but only works on the most recent browsers.

← PreviousPage 2 of 2