code – Unterbahn http://unterbahn.com Wed, 11 Apr 2018 16:40:54 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.5 Strange idea: JS library for interfacing with any circuit via webcam http://unterbahn.com/2012/09/strange-idea-js-library-for-interfacing-with-any-circuit-via-webcam/ Sun, 09 Sep 2012 19:42:56 +0000 http://unterbahn.com/?p=1837 Continue reading "Strange idea: JS library for interfacing with any circuit via webcam"]]> I’ve been pondering the odd way that our use of a webcam in the PLOTS spectrometer allows connecting directly from HTML5/JavaScript to a spectrometer over USB. What if we used a standardized array of LEDs — say, an Arduino shield of ’em — in a dark box facing a webcam. And wrote a standardized library for reading analog & digital pins from the video output… You could then plug many different circuits directly into a webpage.

]]>
Hello worlds http://unterbahn.com/2012/02/hello-worlds/ Thu, 09 Feb 2012 04:48:13 +0000 http://unterbahn.com/?p=1779 ]]>

]]>
Object.hasOwnProperty() in JavaScript http://unterbahn.com/2010/11/object-hasownproperty-in-javascript/ http://unterbahn.com/2010/11/object-hasownproperty-in-javascript/#comments Sun, 07 Nov 2010 21:27:33 +0000 http://unterbahn.com/?p=1564 Continue reading "Object.hasOwnProperty() in JavaScript"]]> On StackOverflow, user Pablo Cabrera points out:

As slashnick pointed out, you can use the “for in” construct to iterate over an object for its attribute names. However you’ll be iterating over all attribute names in the object’s prototype chain. If you want to iterate only over the object’s own attributes, you can make use of the Object#hasOwnProperty() method. Thus having the following.

for (var key in obj) {
if (obj.hasOwnProperty(key)) {
/* useful code here */
}
}

Wish I’d known of that a year ago.

]]>
http://unterbahn.com/2010/11/object-hasownproperty-in-javascript/feed/ 1
Need for a scene graph in Canvas http://unterbahn.com/2010/04/need-for-a-scene-graph-in-canvas/ http://unterbahn.com/2010/04/need-for-a-scene-graph-in-canvas/#comments Tue, 20 Apr 2010 22:54:01 +0000 http://unterbahn.com/?p=1399 Continue reading "Need for a scene graph in Canvas"]]>

Samuli Kaipiainen and Matti Paksula from the University of Helsinki Department of Computer Science wrote a great overview of SVG and Canvas performance issues. The above summarizes some of their thoughts specifically about the need for a scene graph, something I’ve wished for (esp. in regard to WebGL).

Read more

And I’m not just putting this up because they referenced my post on SVG vs. Canvas. Really.

]]>
http://unterbahn.com/2010/04/need-for-a-scene-graph-in-canvas/feed/ 2