<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Benjamin Farrell</title>
	<atom:link href="http://www.benfarrell.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benfarrell.com</link>
	<description>creative developer</description>
	<lastBuildDate>Mon, 03 Jun 2013 00:26:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Back from JSConf</title>
		<link>http://www.benfarrell.com/2013/06/02/back-from-jsconf/</link>
		<comments>http://www.benfarrell.com/2013/06/02/back-from-jsconf/#comments</comments>
		<pubDate>Mon, 03 Jun 2013 00:26:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[nodejs]]></category>

		<guid isPermaLink="false">http://www.benfarrell.com/?p=1055</guid>
		<description><![CDATA[Oh good, someone already posted the &#8220;dripping with love&#8221; review of JSConf and organizers Chris and Laura Williams: http://adambrault.com/post/52004360603/just-a-person I&#8217;m so glad that&#8217;s out of the way because I really didn&#8217;t want to do it. It&#8217;s not that JSConf wasn&#8217;t...]]></description>
				<content:encoded><![CDATA[<p>Oh good, someone already posted the &#8220;dripping with love&#8221; review of JSConf and organizers Chris and Laura Williams:</p>
<p><a href="http://adambrault.com/post/52004360603/just-a-person">http://adambrault.com/post/52004360603/just-a-person</a></p>
<p>I&#8217;m so glad that&#8217;s out of the way because I really didn&#8217;t want to do it. It&#8217;s not that JSConf wasn&#8217;t crazy good (it was), and it wasn&#8217;t that Chris and Laura didn&#8217;t go completely over the top in a good way for everyone involved (they did), it&#8217;s just that I don&#8217;t want to be the guy writing those posts because there&#8217;s so much more good to talk about &#8211; especially when I&#8217;m pretty certain if you asked ANYONE at JSConf if they&#8217;d recommend going next time you&#8217;d get a yes. Seriously, anyone&#8230;I really can&#8217;t think of a thing wrong with the conference aside from the horrible cellular coverage in Northern Florida on T-Mobile while I&#8217;m selling a house and looking for a job.</p>
<p>So with that out of the way, dripping love for JSConf aside&#8230;</p>
<p>There was an undertone to this conference and the community there. Maybe I&#8217;m reading into it because I want it to exist &#8211; but I don&#8217;t think that&#8217;s it. I think it was really there: in the sessions, in the people, all around.</p>
<p>Javascript has a community both young and old because of the nature of the newfound revival of a language that&#8217;s been used for 18 years. Javascript is also a language that nobody can tell you the &#8220;right&#8221; way to do things. There is no &#8220;one&#8221; MVC framework  - in fact, there are oodles.</p>
<p>Given how often we adopt, drop, and rework our flow in Javascript, when large groups of us meet to talk about Javascript it&#8217;s chaos. And I love the chaos &#8211; it&#8217;s like a mix of hardcore language basics and boundless creativity and rocketscience from all walks of life.</p>
<p>Let me explain with the rise and peak of Adobe/Macromedia Flex that I lived through:</p>
<p>I used to use Flash quite a bit &#8211; it was my favorite platform several years back (though I didn&#8217;t have that much experience in others at the time). I was drawn into it by the creativity being sparked in the community. It was THE creative tool to use, hands down. Something happened, though &#8211; we adopted a framework. Flex is/was pretty damn good actually. It shares a lot with other similar things like Silverlight/XAML and Android/XML. Nothing wrong with Flex.</p>
<p>Here&#8217;s the problem, though &#8211; I remember being at a 360Flex (great conference BTW) several years ago and EVERYONE was doing business applications and throwing Flex at it. There really wasn&#8217;t much talk about other tools/technology/creativity &#8211; just how to do stuff in Flex. I know, I know &#8211; Flex conference&#8230;but it really highlighted the shift in my favorite creative platform to the business side of things. Everyone was talking about Flex, not so much about Flash &#8211; just Flex. Adobe pushed that stuff hard to Java devs, and with the huge marketing focus on &#8220;Flex: The One Framework to Rule Them All (better than crappy Java) ™&#8221;, Flash was sort of forgotten about by lots of money seeking entrepreneurs and also folks who just didn&#8217;t want to get left out of the new technology standards.</p>
<p>At the time, I thought that the entire community settling on a single framework was a good thing &#8211; but for me, it really sucked the creative juices and talent from an awesome animation/interactive platform.</p>
<p>Compare this to what I&#8217;m witnessing in the Javascript community. &#8220;OMG I love Dojo&#8230;wait no! Backbone is for me! But look over there, it&#8217;s Google Clo&#8230;.oh wait its Angular now!&#8221; We&#8217;re talking about MVC frameworks, and we&#8217;re talking about boring old business applications &#8211; but things are moving too swiftly to settle in. As a result, we can have rigorous and intelligent conversations about Require.js, but we&#8217;re not going to get it crammed down our throats at JSConf.</p>
<p>The lack of a solid direction here is a huge opportunity that I&#8217;m seeing folks at JSConf take in spades. Instead of obsessing over one thing -we&#8217;re obsessing over a huge number of things in completely separate directions. This is what makes a community absolutely fun and thriving.</p>
<p>We had Janessa Det obsess over beat detection and sound. We had Steven Wittens obsess over WebGL, we obsessed over Nodebots, Nodecopters, and 3D printing. Would we have seen this if 2 years ago someone had declared Backbone.js &#8220;The One Framework to Rule Them All (ps: Flash sux)™&#8221;? I&#8217;m obviously not a JSConf organizer, and having met Chris Williams once for 4 seconds, I certainly can&#8217;t speak for him. However, perhaps I&#8217;d think as an organizer, I should load my conference up with Backbone tracks and Backbone training.</p>
<p>As a result of all of this, I&#8217;m seeing loads of creativity and creative uses of Javascript &#8211; much of this knowledge coming from communities and research that has nothing to do with Javascript or the web. This makes me very happy.</p>
<p>Perfectly capping it all off, we were treated to Seb Lee-Delisle. I truly hate being a fan of anyone, but its really hard not to be a fan of Seb&#8217;s. In addition to showcasing some jaw-dropping interactive installations, he treated us to a short Creative.js training session with generative art in the HTML canvas. His session was the perfect mix of humor, self-deprecation, humbleness, and inspiration. He had one piece of great advice that I&#8217;ve only been smart enough to adopt recently &#8211; &#8220;Think small and FINISH YOUR PROJECT &#8211; Nobody will see it or know about it if it&#8217;s 90% done&#8221;.</p>
<p>Seb&#8217;s was the perfect end session to spark a thought in my head. The thought is that this community has some very creative and curious folks. And for me, knowing that there are lots of other creative and curious folks creates quite the inspiration to continue what I&#8217;m doing&#8230;.and of course finish more of what I start!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benfarrell.com/2013/06/02/back-from-jsconf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adventures in Silicon Valley Job Hunting</title>
		<link>http://www.benfarrell.com/2013/05/27/adventures-in-silicon-valley-job-hunting/</link>
		<comments>http://www.benfarrell.com/2013/05/27/adventures-in-silicon-valley-job-hunting/#comments</comments>
		<pubDate>Tue, 28 May 2013 01:06:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.benfarrell.com/?p=1047</guid>
		<description><![CDATA[Admittedly, I&#8217;ve been quiet lately&#8230;too quiet. That&#8217;s because I&#8217;m taking the plunge and looking for work in the California Bay Area! For me, a UI developer, the North Carolina Triangle Area, while a hotbed of awesome tech and startups, is...]]></description>
				<content:encoded><![CDATA[<p>Admittedly, I&#8217;ve been quiet lately&#8230;too quiet. That&#8217;s because I&#8217;m taking the plunge and looking for work in the California Bay Area!</p>
<p>For me, a UI developer, the North Carolina Triangle Area, while a hotbed of awesome tech and startups, is still too data-centric. I don&#8217;t mind data &#8212; data is good, but I want great interaction and visualization to back it up. To be fair, I did tell someone my line of reasoning and they offered to hook me up with several places that offered that if I&#8217;d stay in town.</p>
<p>But our minds (my wife&#8217;s and mine) are made up! I think I&#8217;m making the right decision. Looking on Meetup.com, I see 20 times the interesting meetups in the Bay Area than in the Triangle. Browsing Craigslist, I see 2 RTP area jobs per day in the internet engineering section, whereas in the Bay, I see 20 per day.</p>
<p>These are the things I justify the decision with, as right or as wrong as they may be.</p>
<p>So as a result, we are selling our house, moving (probably) to the Bay Area, and I&#8217;m finding a new job. As anyone in this nerve-racking situation would do, I jumped in immediately to search for jobs from afar &#8212; and that&#8217;s how I&#8217;ve come to learn the ways of Silicon Valley style job hunting. I think I finally have a decent feel for it, though I&#8217;ve done a lot of stumbling.</p>
<p>I&#8217;m of the opinion that my resume is fairly strong, so getting callbacks hasn&#8217;t been a huge issue &#8212; but they do take a while. Most have taken around 2 weeks for a response from the time of submitting online. Submitting online is a huge hassle but one you just put up with. You&#8217;re subscribing to any number of recruitment sites to submit your resume and cover letter. Brassring.com comes to mind. Or if the company is big enough, they have their own internal submission tools. Either way you&#8217;re entering in your information over and over and over again. Even when linking your profile with LinkedIn, you generally have to enter it somewhere else for each job.</p>
<p>Annoying, yes. End of the world, no.</p>
<p>&nbsp;</p>
<h3>The Recruiter</h3>
<p>Next you talk with a recruiter. I&#8217;ve actually enjoyed talking with the recruiters &#8212; you get to brag a little, and it&#8217;s their job to stroke your ego and reel you in. The bigger companies have whole recruiting departments. In one case, I was passed through 4 different people before I landed on the one that could help me out.</p>
<p>I think the only way you&#8217;ll screw things up at this stage of the game is to start swearing profusely or making death threats. Of course, I&#8217;ve passed with flying colors &#8212; making 0 death threats. I haven&#8217;t even WANTED to drop the f-bomb; they have simply been pleasant people to talk with. When you pass this phase, it becomes their job to schedule a tech interview.</p>
<p>Prior to my first ever failed Silicon Valley style tech interview, which was with Google, I didn&#8217;t know what I was getting into. The recruiter basically said, &#8220;You know the drill.&#8221; I thought to myself, &#8220;Sure, I know the drill. We&#8217;ll get technical and maybe throw in some questions to prove my domain knowledge.&#8221; Nope, I was unprepared for this next world of hurt.</p>
<p>&nbsp;</p>
<h3>The Initial Tech Screen</h3>
<p>So, I had an appointment at a specific time. I was also passed a Google Doc link so the interviewer and I could share a screen and collaborate via code. That was new to me, but I rolled with it, unsure of what would happen.</p>
<p>Since I WAS unsure, I reached out to one of my wife&#8217;s friends who worked at Google to learn what to expect. He told me to read the book <em>Programming Interviews Exposed</em>.</p>
<p><iframe style="width: 120px; height: 240px;" src="http://rcm.amazon.com/e/cm?lt1=_blank&amp;bc1=000000&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=media0477-20&amp;o=1&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=B008SGNJOW" height="240" width="320" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>I picked it up on my Kindle &#8212; but I was already at t-minus 2 days until my tech screen, so I skimmed. While I skimmed, I recognized that it was a pretty decent book, but I didn&#8217;t think it was AT ALL applicable to my situation. After all, I was a UI programmer going for a Javascript role for god&#8217;s sake. I thought that as long as I could express some domain knowledge and maybe explain what my jQuery was doing under the hood, I&#8217;d be set.<a href="http://www.amazon.com/Programming-Interviews-Exposed-Secrets-Landing/dp/1118261364/ref=sr_1_1?ie=UTF8&amp;qid=1369700787&amp;sr=8-1&amp;keywords=programming+interviews+exposed"><br />
</a></p>
<p>The book covered sorting, trees, binary trees, graphs, implementing linked lists, Big-O analysis, and more. I must say that I brushed it all off before my first interview. Those are concepts I really haven&#8217;t discussed or seen since my college courses (13 years ago), and especially given the discussion on pointers in the linked lists and graphs, I really thought I&#8217;d be more preparing for a C++ interview with this book&#8230;.not a Javascript/HTML one!</p>
<p>I was wrong, so wrong. Try giving a friend or loved one a call RIGHT NOW and explain how to do a breadth-first search on the phone without first refreshing your memory. It didn&#8217;t work for me. BIG FAIL for me in fact. In fact, the breadth-first search problem is a great example of what to expect on a couple different levels.</p>
<p>For me, being asked that proved that not all code you&#8217;ll be writing in the interview has a sexy, elegant solution when you&#8217;re on the phone with your interviewer. For those that don&#8217;t know breadth-first search, you&#8217;re basically taking a tree like an XML file or any other nested structure. Instead of searching the root, then the child, then the child of the child, you&#8217;re searching the root, then all the 2nd level, then all the 3rd level. The solution here is to push all the child nodes into a stack and shift off the first one with the important thing being that you need a list/array to store things in memory.</p>
<p>I didn&#8217;t even want to go there for that question and other questions in the interview. I thought there had to be some easy, recursive solution that spanned like 3 lines of code. Why would they ask something overly complicated and unelegant over the phone?</p>
<p>Well, they do. They want to see error checking. They want to see the solution as messy as it may be.</p>
<p>In the end, that book proved to be the perfect preparation guide, which I was able to absorb for my subsequent interviews.</p>
<p>One other thing this book teaches is that it&#8217;s OK to stumble if you don&#8217;t know the solution to a problem that the interviewer asks. It&#8217;s necessary to just keep talking to them. Don&#8217;t choke, just keep talking. Tell them why you are going down a path to solve the problem and what you are thinking on the fly. If you don&#8217;t solve it, they may give you some hints. Even if you think you fail at solving the problems, they may be impressed with your problem-solving process and still continue on to the next round of interviews.</p>
<p>My first interview with Google? I did NONE of that. And you know what else? I never got called back. After that bomb of an interview, I was able to have some really good ones based on what I learned.</p>
<h3></h3>
<h3>The Domain Knowledge Interview</h3>
<p>After all that, I&#8217;ve had some good interviews &#8212; but my best ones have been when the interviewer asked for domain knowledge. You know, that interview where it&#8217;s not like an interview, but you just nerd out and talk about what you do at your job and what you like or dislike. Those are the ones that have made me feel like a real person, not a piece of meat, and it&#8217;s shown.</p>
<p>Even my Google interview might not have been my worst. That was probably the one when the interviewer was a guy less than 1 year out of college. I don&#8217;t say his age to be dismissive. I have no doubt he is very smart, but he didn&#8217;t have much experience giving a tech interview &#8212; which meant he picked random problems out of a data structures and algorithms book. But I kept talking and giving him my thought process, despite getting every question potentially wrong. To my surprise, I got a callback for a second interview after that debacle, which was more of a tech conversation that went quite well.</p>
<p>&nbsp;</p>
<h3>Next Up: The On-Site Interview</h3>
<p>Right now, I have a few on-site interviews lined up. The kind where you get flown out like royalty and put up in a hotel room. My initial reaction to getting asked out for them was that they must really be formalities, and if a company drops that kind of money on me, it&#8217;s mostly a sure bet I&#8217;ll need to screw up pretty bad to get rejected. But given how wrong I was before, I&#8217;m not taking any chances! Prepare for the worst is what I&#8217;ll do!</p>
<p>&nbsp;</p>
<h3>HTML/Javascript is Weird to Interview for</h3>
<p>As a final thought, I want to talk about how weird it is going for a front-end job these days that focuses on HTML/CSS/Javascript. Even the domain knowledge interview is a disaster.  There is little chance you&#8217;ll talk about the same frameworks in most of the interviews given there are so many popular ones (especially MVC style). To top that off, you really do feel like an idiot if they ask native Javascript questions. No, I am not a jQuery scripter that copies and pastes. However, because I use jQuery a lot, I sometimes forget the exact native Javascript syntax . See the problem? To prove you&#8217;re a bad-ass Javascripter, you must recite things you never use in your day-to-day life.</p>
<p>I also got a rather nice interviewer once who unfortunately didn&#8217;t really know a thing about Javascript/UI. I ended up switching gears to talk about Java and back-end stuff. Front-enders are in demand, and as a result, you might be interviewed by someone sorely needing a front-ender&#8230;to the point where they have none to interview you properly!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benfarrell.com/2013/05/27/adventures-in-silicon-valley-job-hunting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My first Node.js plugin for 3D motion sensing</title>
		<link>http://www.benfarrell.com/2013/05/06/my-first-node-js-plugin-for-3d-motion-sensing/</link>
		<comments>http://www.benfarrell.com/2013/05/06/my-first-node-js-plugin-for-3d-motion-sensing/#comments</comments>
		<pubDate>Tue, 07 May 2013 02:49:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[kinect]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[nui]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.benfarrell.com/?p=1038</guid>
		<description><![CDATA[Well that&#8217;s a little bit of an awkward title &#8211; its not ONLY my first Node.js plugin I&#8217;ve released on NPM but it ALSO does 3D motion sensing! So brand new on both counts &#8211; I&#8217;m no Node.js plugin/addon veteran...]]></description>
				<content:encoded><![CDATA[<p>Well that&#8217;s a little bit of an awkward title &#8211; its not ONLY my first Node.js plugin I&#8217;ve released on NPM but it ALSO does 3D motion sensing! So brand new on both counts &#8211; I&#8217;m no Node.js plugin/addon veteran by any means!</p>
<p>You can grab my NuiMotion project version 0.1 on <a href="https://npmjs.org/package/nuimotion">NPM</a> and <a href="https://github.com/bengfarrell/nuimotion">Github</a>. You can read why I did it, and about how I&#8217;m on a crusade for letting your interfaces move your body on the <a href="http://www.sweatintotheweb.com/nuimotion-for-node-js/">project page</a>.</p>
<p>That said, I learned a lot of stuff. I think the project serves as a shining example of how one guy accomplished some rather difficult and not so ordinary things you&#8217;d need to do with Node.js. I won&#8217;t claim it&#8217;s necessarily the right way &#8211; just one way. I was a little scared of C++ before all of this, but I jumped in because I had a need that I wanted to fill, and C++ was the only way to get it done.</p>
<p>The C++/Javascript bridge is pretty cool to see how it works. There are all sorts of problems you run into with type conversion &#8211; your C++ variables to those loose Javascript variables.</p>
<p>The hugest hurdle was breaking down the architecture to something that wouldn&#8217;t block the entire Node.js main process. In all of the OpenNI examples, they would run a big old while loop that will grab frames of video/depth and pull out the features we need like gestures and skeleton data.</p>
<p>This is SO not cool for Node.js, so I needed to delve into how to achieve threading in the V8 engine with &#8220;lib_uv&#8221;. I still don&#8217;t understand everything about the final lib_uv code I used (why some things are declared as they are), but I successfully broke it out into a new thread that runs as fast as your machine will let it. We reach in and grab our joints using a custom defined interval to poll at, and we event out when gestures and other events are encountered.</p>
<p>Of course, all of this NEEDS to be threadsafe. If you access the wrong thing inside a thread, you crash your entire process.</p>
<p>You can checkout the main logic of all of this, completely with C++/JS communication and threading here:</p>
<p><a href="https://github.com/bengfarrell/nuimotion/blob/master/src/Main.cpp">https://github.com/bengfarrell/nuimotion/blob/master/src/Main.cpp</a></p>
<p>I didn&#8217;t do this alone, either. I asked a couple questions to the extremely awesome Node.js Google Groups. One was around the threads question, and the other was around C++ compiling. To demonstrate how much of a noob I was, my compiling question was that I didn&#8217;t realize you had to include ALL your *.cpp files in your sources target. I thought since the main.cpp references other things, they would be automatically included. NOPE! Live and learn.</p>
<p>Anyway &#8211; I&#8217;m of the opinion that this project probably represents some of the most difficult things you could ever need to know how to do in a Node.js addon (without getting into domain specific C++ code which could be infinitely complex for sure). So feel free to have a gander and learn!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benfarrell.com/2013/05/06/my-first-node-js-plugin-for-3d-motion-sensing/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>I got my Oculus Rift VR Headset Today</title>
		<link>http://www.benfarrell.com/2013/04/18/i-got-my-oculus-rift-vr-headset-today/</link>
		<comments>http://www.benfarrell.com/2013/04/18/i-got-my-oculus-rift-vr-headset-today/#comments</comments>
		<pubDate>Fri, 19 Apr 2013 00:38:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.benfarrell.com/?p=1028</guid>
		<description><![CDATA[Ooooog.  I&#8217;ve been noodling around with this thing for about an hour.  I think I&#8217;m at a good stopping point because I&#8217;m a little motion sick.  It&#8217;s weird because I think I&#8217;m only getting motion sick when I take OFF...]]></description>
				<content:encoded><![CDATA[<p>Ooooog.  I&#8217;ve been noodling around with this thing for about an hour.  I think I&#8217;m at a good stopping point because I&#8217;m a little motion sick.  It&#8217;s weird because I think I&#8217;m only getting motion sick when I take OFF the goggles.  Maybe I just can&#8217;t adapt to real-life anymore.</p>
<p>So, for those that know what the <a href="http://www.oculusvr.com/">Rift</a> is&#8230;awesome.  But those that don&#8217;t &#8211; it seems like it may be the first legit, consumer-grade (read: affordable) VR headset.</p>
<p>The Oculus Rift is the very first thing I&#8217;ve ever backed on Kickstarter (my wife has since backed the Veronica Mars movie).  But the experience was harrowing.  I mean &#8211; you&#8217;re waiting for this thing for almost a year after dropping $300.  At the time, I thought $300 was a pittance to pay for something so potentially cool.</p>
<p>Then the delays started happening.  Oculus was supposed to have this thing out in my hands for December.  I just got it now in April.  It was supposed have Doom 3 support when I got it &#8211; it doesn&#8217;t, ID Software backed out I guess.  Bad news?  No, actually&#8230;.just no.  Oculus, the company behind this, with these setbacks COULD have been so shady about all of this, but instead they&#8217;ve been an extreme class act every step of the way.</p>
<p>Something this cool was bound to have setbacks, and yah&#8230;Kickstarter&#8230;I&#8217;m probably lucky I got anything for my $300.  Oculus has been very communicative every step of the way since August.  They&#8217;ve done interviews, showed their tech off at game conventions, everything.  They kept me drooling and happy to wait with them through the problems.</p>
<p>No Doom 3 support?  Man that sucks.  But, the second this was announced, Oculus stepped up and offered a complete refund, a Steam Store credit, or an Oculus store credit for $25.  Way to go, guys &#8211; even after Team Fortress 2 support was announced in lieu of Doom.  Yah, there were setbacks, but they handled it like champs.</p>
<p>Imagine my&#8230;.OK&#8230;non-surprise (since I had the shipping notification this week) when I got home and my Oculus was there waiting for me.  Given the trivial amount (yes I think $300 is trivial for a VR headset) you&#8217;d expect them to do a shoddy job packaging it.  Nope. I have a hard case with foam cutout inside that molds itself to all my pieces.  What the hell guys&#8230;.this is more pro than real store-bought finished products.  I was even more impressed that it came with DVI and HDMI cords to connect my machine to the breakout box.  They could have made me go to the store to buy these, but nope &#8211; comes with.</p>
<p><a href="http://www.benfarrell.com/2013/04/18/i-got-my-oculus-rift-vr-headset-today/13-1/" rel="attachment wp-att-1030"><img class="alignnone  wp-image-1030" alt="13 - 1" src="http://www.benfarrell.com/wp-content/uploads/2013/04/13-1.jpg" width="401" height="301" /></a></p>
<p><a href="http://www.benfarrell.com/2013/04/18/i-got-my-oculus-rift-vr-headset-today/13-1-1/" rel="attachment wp-att-1031"><img class="alignnone size-full wp-image-1031" alt="13 - 1 (1)" src="http://www.benfarrell.com/wp-content/uploads/2013/04/13-1-1.jpg" width="408" height="306" /></a></p>
<p>Whatever though&#8230;.what&#8217;s the experience like?</p>
<p>It&#8217;s incredibly fascinating.  The best demo so far that I&#8217;ve seen after playing around for an hour, is the &#8220;Tuscany&#8221; demo. This seems to be their showcase piece for now.  Basically, they&#8217;ve created a Unity demo with a quiet little cottage in Tuscany. You start out in the cottage in front of a roaring fire.  Putting on your goggles for the first time is a very wowing experience.  It&#8217;s so unusual, but your brain adapts pretty quickly &#8211; so quickly in fact that when I looked down and put out my hands, it was very disorienting to not see my body when I KNEW it was there.</p>
<p>You look around and you feel like you&#8217;re there.  The roaring fire is a nice touch.  It was a little awkward fumbling around to feel where my laptop keyboard and trackpad were, but I eventually found the keyboard controls and walked outside (no bounce to my step&#8230;.that woulda been way cool).</p>
<p>After wandering outside, I immediately stepped towards the ocean and had a sensation that I didn&#8217;t want to get too close or I&#8217;d fall down the cliff.  After getting over this, I looked around &#8211; dandelion particles were drifting through the air&#8230;a VERY nice touch.</p>
<p><a href="http://www.benfarrell.com/2013/04/18/i-got-my-oculus-rift-vr-headset-today/tuscany_smaller/" rel="attachment wp-att-1029"><img class="alignnone size-full wp-image-1029" alt="tuscany_smaller" src="http://www.benfarrell.com/wp-content/uploads/2013/04/tuscany_smaller.jpg" width="512" height="352" /></a></p>
<p>The extreme novelty wore off after a bit of wandering around, which was then around the point where I started to scrutinize things.  Walking up to things and looking close of course revealed the flat/3D polygonal look of the trees and other objects that from far away look awesome.  You can&#8217;t NOT expect this really &#8211; I mean, realtime 3D environments are what they are, but it was interesting to experience this!</p>
<p>Then if you shift your focus, you can make out the individual pixels on the screen &#8211; as if you were inches away from a TV.  You can easily choose to forget this and enjoy the experience, but it detracts&#8230;just a little bit.  Now that I think of it, one of the little demos that I downloaded from their forums by a fellow developer was mostly over a black sky, and generally dark, which removed the razor thin black border that goes along with these pixels.</p>
<p>The biggest detractor was the head movement.  The best I can describe it when you move your head fast is choppy.  It felt a little like the headset was polling your head&#8217;s movement at a lesser interval than needed to stay smooth &#8211; and the view in front of you chopped along.  My wife actually made the stellar point that using the mouse to move didn&#8217;t produce this &#8211; so my theory of refresh rate was shot down.  Also if you take off the headset and move it with your hands while you watch your 2D computer display, it&#8217;s not noticeable on there.  There must be some weird headset/display refresh rate combo effect going on.  Also, slower head movements didn&#8217;t do this for me.  Another demo seemed worse and another better &#8211; so I think this, my biggest issue so far, may just be a software improvement &#8211; and this is A-OK with me!</p>
<p>Anyway &#8211; I dreamt that this thing would be perfect.  It&#8217;s not, but it&#8217;s more amazing than the cynic in me expected.  There will be improvements as we go along &#8211; Oculus NEVER said these dev kits would be consumer grade yet. I&#8217;m looking forward to playing more and definitely checking out Team Fortress 2 this weekend!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benfarrell.com/2013/04/18/i-got-my-oculus-rift-vr-headset-today/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Painting with Chrome&#8217;s WebSpeech API</title>
		<link>http://www.benfarrell.com/2013/04/02/painting-with-chromes-webspeech-api/</link>
		<comments>http://www.benfarrell.com/2013/04/02/painting-with-chromes-webspeech-api/#comments</comments>
		<pubDate>Wed, 03 Apr 2013 03:22:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[nui]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.benfarrell.com/?p=1010</guid>
		<description><![CDATA[A while back, when Chrome 25 was still unreleased, I tried out the beta version.  I was directing my attention at the &#8220;WebSpeech API&#8221;.  It failed MISERABLY.  I don&#8217;t know if the ambient noise in my room was having a...]]></description>
				<content:encoded><![CDATA[<p>A while back, when Chrome 25 was still unreleased, I tried out the beta version.  I was directing my attention at the &#8220;WebSpeech API&#8221;.  It failed MISERABLY.  I don&#8217;t know if the ambient noise in my room was having a bad day or what, but I spoofed their &#8220;Writing your Dad a Message&#8221; video that Google put out.</p>
<p><a href="http://www.benfarrell.com/2013/01/31/i-wrote-my-dad-a-letter-with-the-webspeech-api/">http://www.benfarrell.com/2013/01/31/i-wrote-my-dad-a-letter-with-the-webspeech-api/</a></p>
<p>But that&#8217;s all in the past &#8211; I&#8217;m blown away with how it works now.  True &#8211; if you have a good deal of ambient noise in your room, it looks like Chrome has a hard time differentiating between you and the background noise.  Given a relatively quiet environment, or if you&#8217;re up close to your microphone, it works magnificently.</p>
<p>I liked it so much, I created a little painting demo with it and a Kinect like depth camera.  You can still use your mouse to paint in my demo though &#8211; so even if you don&#8217;t have a Kinect working over websockets or the like, it&#8217;s still functional!</p>
<p>I set up several keywords that the WebSpeech API listens for: red, green, yellow, purple, blue, orange, and black.  These voice commands are to switch colors.  I also added a &#8220;start over&#8221; command to clear the canvas.  Lastly&#8230;invoke &#8220;Bob Ross&#8221; for a little surprise!</p>
<p>Chrome listens to your speech, chops it up, and sends requests over to its servers.  You&#8217;ll get back &#8220;interim&#8221; speech and &#8220;final speech&#8221;.  Interim speech doesn&#8217;t make too much sense as you see it.  It&#8217;s putting together it&#8217;s best guess at phrasing as you go along, picking out the words it can without paying much intention to intended meaning.  The &#8220;final&#8221; speech comes delayed by a second or two.  Chrome things you&#8217;re finished speaking, and it waits a tick to make sure.  Then it puts together it&#8217;s thoughts and gives you something final.  It&#8217;s probably going to be grammatically correct and nicely accurate.</p>
<p>Some of the shorter commands you&#8217;ll need to enunciate.  It has a big problem when I say &#8220;green&#8221; sometimes, but honestly, when I&#8217;m making voice commands, there&#8217;s really no context in my grammar to pick up on.</p>
<p>I went ahead and wrapped up the WebSpeech API for Chrome 25 in a little Javascript library.  I allow you to add commands to listen for along with callback methods to call when those commands are spoken.  I also allow it to &#8220;keepAlive&#8221;, which means if Chrome thinks you&#8217;ve stopped talking for good, I go ahead and start the speech API right back up.   I also event out the surrounding words with a command if you care to make something like &#8220;search&#8221; a command and want the words that we spoken after it.</p>
<p>You can checkout the library I made here (its in a repo I made for motion/gesture control as a demo to add speech to the mix):</p>
<p><a href="https://github.com/bengfarrell/node-sweatintotheweb-examples/blob/master/activities/common/js/speechrecognition.js">https://github.com/bengfarrell/node-sweatintotheweb-examples/blob/master/activities/common/js/speechrecognition.js</a></p>
<p>&nbsp;</p>
<p>One annoying, but understandable thing is that to allow the Web Speech API to work, the user has to click to allow the microphone.  This needs to occur every time you start the API.  There could have been an error, or it could simply think you&#8217;re done talking &#8211; then when you go to start it up again, the user needs to click to allow.  Bad for natural interaction if you&#8217;d like to keep it running and listening at all times on your page.  GOOD if you don&#8217;t want web pages spying on you!</p>
<p>You can work around this by serving your page over HTTPS.  If you&#8217;re secure, then Chrome allows you to always remember the option if the user so chooses.</p>
<p>It&#8217;s a very cool feature that I hope the rest of the browsers adopt soon!  I wouldn&#8217;t mind dropping the HTTPS requirement though in favor of something else!</p>
<p>For my horrible Bob Ross impression AND demo, <a href="http://www.sweatintotheweb.com/?p=83">check out the video I made here</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benfarrell.com/2013/04/02/painting-with-chromes-webspeech-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag and Drop with AngularJS and jQuery UI</title>
		<link>http://www.benfarrell.com/2013/03/30/drag-and-drop-with-angularjs-and-jquery-ui/</link>
		<comments>http://www.benfarrell.com/2013/03/30/drag-and-drop-with-angularjs-and-jquery-ui/#comments</comments>
		<pubDate>Sat, 30 Mar 2013 21:37:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.benfarrell.com/?p=1006</guid>
		<description><![CDATA[I actually haven&#8217;t used jQuery UI much, and been just tooling around with AngularJS.  That&#8217;s why when a recent project came up at work which had the typical ASAP schedule, I thought: &#8220;Let&#8217;s put AngularJS to work!&#8221;  Also, the application...]]></description>
				<content:encoded><![CDATA[<p>I actually haven&#8217;t used jQuery UI much, and been just tooling around with AngularJS.  That&#8217;s why when a recent project came up at work which had the typical ASAP schedule, I thought: &#8220;Let&#8217;s put AngularJS to work!&#8221;  Also, the application I was building was an internal tool, so it could be a little rough around the edges and customers/clients wouldn&#8217;t make fun of me if something wasn&#8217;t quite right.</p>
<p>So&#8230;.low risk, let&#8217;s dive right into Angular!  I also had the assumption that if Angular was all I thought it was cracked up to be, it would save me lots of time, and allow me and others very nice visibility to how my project worked so they could make updates very simply, right in the HTML.</p>
<p>Boy was I right.  I felt like Angular sped things up and gave me what I wanted, with a nice easy, predictable structure.</p>
<p>What I didn&#8217;t expect was that I&#8217;d be mixing jQuery UI in.  What I REALLY didn&#8217;t expect was how SLICK Angular makes it to mix things like jQuery UI in.</p>
<p>&nbsp;</p>
<h2>The Problem: I want to drag something to a drop zone</h2>
<p>Pretty simple right?  Of course, of course I can write this from scratch in Javascript.  And if I wrote it from scratch, I&#8217;d probably cut corners and&#8230;..not necessarily make it all fancy with tags and attributes for my Angular setup.  No, I&#8217;d probably loop through all the elements in my list that I&#8217;d like to drag, attach onmouseout, onmouseover, and onmousemove listeners.  And then keep a separate list of all my drop zones and check positions of things while they are being dragged.</p>
<p>PAIN IN THE BUTT.  I don&#8217;t mind doing cool things by hand, but things that are readily available elsewhere? Boring. So I turn to Google and type in &#8220;AngularJS drag and drop&#8221;.  I came across this gist:</p>
<p><a href="https://gist.github.com/codef0rmer/3975207">https://gist.github.com/codef0rmer/3975207</a></p>
<p>Given what AngularJS is supposed to do, I didn&#8217;t expect to find any functionality in Angular to support drag and drop.  Indeed I didn&#8217;t, but what this gist shows is the ability to declare your own attributes in HTML and have Angular process them, adding your own logic to what those things do.  THAT IS SLICK!</p>
<p>&nbsp;</p>
<h2>Angular Directives</h2>
<p>So let&#8217;s take &#8220;draggable&#8221; and &#8220;droppable&#8221; as our primary examples for an Angular directive.</p>
<p>In our HTML, create a div with your own custom attribute on it:</p>
<p><strong>&lt;html ng-app=&#8221;App&#8221;&gt;</strong></p>
<p><strong>&lt;div class=&#8221;something&#8221; draggable&gt;&lt;/div&gt;</strong></p>
<p><strong>&lt;div class=&#8221;somethingelse&#8221; droppable&gt;&lt;/div&gt;</strong></p>
<p><strong>&lt;/html&gt;</strong></p>
<p>Obviously these two attributes mean nothing to HTML, so we want to process them with Angular.  Luckily we&#8217;ve declared our Angular App as &#8220;App&#8221;.  We can then process our directives:</p>
<pre>var App = angular.module('App', []);
App.directive('draggable', function() {
    return {
        // A = attribute, E = Element, C = Class and M = HTML Comment
        restrict:'A',
        link: function(scope, element, attrs) {
        }
}</pre>
<p>So, above, we&#8217;ve made a reference out of our &#8220;App&#8221; module (our HTML page/app).  Then we&#8217;ll add a directive &#8211; which is simply saying, anything labeled &#8220;draggable&#8221; &#8211; return an object that does something.</p>
<p>I haven&#8217;t tried anything except &#8220;restrict:&#8217;A'&#8221; yet, however this is pretty fancy.  We filter this behavior by attributes, elements, classes, or comments.  For our example, we&#8217;re restricting by our attribute.</p>
<p>Then the link process.  Here you define what you&#8217;d like to when Angular finds the attribute.  We&#8217;d like to hook up the jQuery UI drag behavior:</p>
<pre>      element.draggable({
        revert:true
      });</pre>
<p>Right! So all we do here, is take the element that the Angular directive gives us and call the jQuery UI method &#8220;draggable&#8221; on it.  I left the gist author&#8217;s revert:true in there, cause it&#8217;s pretty nice.  If the drag isn&#8217;t accepted, its animates back over to where it started.</p>
<p>Similar deal with droppable:</p>
<pre>App.directive('droppable', function($compile) {
    return {
        restrict: 'A',
        link: function(scope,element,attrs){
            element.droppable({
                accept: ".itemHeader",
                hoverClass: "drop-hover",
                drop:function(event,ui) {}
    }
}</pre>
<p>We process the directive, filter by attribute, and on link call the &#8220;droppable&#8221; jQuery UI method.</p>
<p>jQuery UI has some nice options here for droppable.  It can be set to only accept items of a certain class or ID (comma delimited lists inside the quotes are cool here).  You can specify a hoverClass as well.  In my case,  the &#8220;drop-hover&#8221; CSS adds a white border to the element.  When you drag your draggable over a dropzone, then the dropzone will light up with a white border.</p>
<p>And then the drop functionality.  What happens when you drop it?  I have my own logic, you&#8217;ll certainly have your own.  An important note is how to get the drag or drop elements using these parameters that you get:</p>
<pre>dragged = angular.element(ui.draggable).parent();
dropped = angular.element(this);</pre>
<p>This, of course is in the &#8220;droppable&#8221; method. If you were in the other &#8220;draggable&#8221; method, angular.element(this) would be the draggable.</p>
<p>Wait theres more! I had to do a little trickery in my application. See, it turned out that not everything could be dragged to everything else. If you picked up a draggable, you can only drop it&#8217;s related dropzones. Other draggables have other dropzones.</p>
<p>I needed a good way to NOT let the user drag something where they shouldn&#8217;t depending on what they picked up, but also make them SEE what they can or can&#8217;t drop on!</p>
<p>&nbsp;</p>
<h2>Start/Stop Drag Listeners</h2>
<p>Luckily, JQuery UI gives us a few more draggable options:</p>
<pre>App.directive('draggable', function() {
    return {
        // A = attribute, E = Element, C = Class and M = HTML Comment
        restrict:'A',
        link: function(scope, element, attrs) {
            element.draggable({
                revert:true,
                start: function(event, ui) {}
                stop: function(event, ui) {}</pre>
<p>So, we can have something happen when the user starts to drag something AND when they stop.  So for me, when &#8220;start&#8221; is fired, I loop through my list of dropzones.  If it&#8217;s determined that the drag is not allowed on a given dropzone, I&#8217;ll add a &#8220;reject&#8221; class to the dropzone.  In my CSS, I fade the background and the text and everything so it looks dim.  And then in my element.droppable.drop function, I check to see if the &#8220;reject&#8221; class is present &#8211; and don&#8217;t do anything if so.</p>
<p>In my stop function here, I simple go through and remove all the reject classes from everything, since the user has stopped dragging.</p>
<p>&nbsp;</p>
<p>Lots of options here for doing drag and drop!  And a pretty nice way of Angular opening the door to other tools as we add non-Angular functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benfarrell.com/2013/03/30/drag-and-drop-with-angularjs-and-jquery-ui/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Finally Picking a Focus &#8211; Sweatin&#8217; to the Web</title>
		<link>http://www.benfarrell.com/2013/03/26/finally-picking-a-focus-sweatin-to-the-web/</link>
		<comments>http://www.benfarrell.com/2013/03/26/finally-picking-a-focus-sweatin-to-the-web/#comments</comments>
		<pubDate>Tue, 26 Mar 2013 04:42:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[kinect]]></category>
		<category><![CDATA[nui]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.benfarrell.com/?p=1000</guid>
		<description><![CDATA[I jump around in technology like nobody&#8217;s business.  One minute you&#8217;ll find me illustrating, another minute you&#8217;ll find me doing web apps, and the next you&#8217;ll find me doing games.  And then I&#8217;ll bust out some PHP or Python back-end...]]></description>
				<content:encoded><![CDATA[<p>I jump around in technology like nobody&#8217;s business.  One minute you&#8217;ll find me illustrating, another minute you&#8217;ll find me doing web apps, and the next you&#8217;ll find me doing games.  And then I&#8217;ll bust out some PHP or Python back-end</p>
<p>Last fall, I started playing around with the Kinect, and I was seriously in awe with how magic it seemed. I started reading up on NUI (natural user interaction) and went further down the rabbit hole.</p>
<p>Months later, I&#8217;m still deep in it.  I&#8217;m finishing up my Node.js natural motion add-on and demo content just in time for some upcoming speaking engagements.  I&#8217;m still not bored.  I&#8217;m still not bored, ready to move on &#8211; and my Leap Motion is shipping in May.  My Oculus VR headset is shipping in a matter of days.</p>
<p>Also after a few months, I&#8217;m still playing the augmented reality game &#8220;Ingress&#8221;.</p>
<p>These things all have something in common to me&#8230;and it&#8217;s pretty much the Natural User Interaction angle.  How do we interact with interactive experiences and apps in a natural way &#8211; whether with a GPS and physical location, or with your whole body as a controller.</p>
<p>Another important thread here&#8230;I&#8217;m out of shape.  I sit at the computer too much.  Rather than make the above endeavors work against me, I&#8217;m going to make them work for me and not do anything in my spare time that doesn&#8217;t encourage moving around a lot.</p>
<p>This means if I develop an interactive experience, it needs to involve moving around.  How much do you debug an app while creating it?  A LOT.  What if testing and debugging necessitated moving around wildly to do this?</p>
<p>So here I am wanting to learn about existing technology that gets you moving and creating my own experiments that get you moving. Not only for the fun of it, but to get myself in shape!  It is time for a non-technical hub for this, and I shall become a &#8220;Digital Fitness Trainer&#8221; in training.  That hub is <a href="http://www.sweatintotheweb.com">Sweatin&#8217; to the Web</a>.  There I will do video reviews of apps, sites, and gadgets that get you moving around.  I&#8217;ll also be posting videos of my creative experiments there, like my work with Kinect-like devices.</p>
<p>It will be pretty non-technical there, but I&#8217;ll follow up on this blog with the actual technical side of things &#8211; how it works, maybe dig into the code if appropriate.</p>
<p>I&#8217;m excited!  I have a Fitbit review up now with a depth camera painting demo coming in the next week or so.  Hope you enjoy, but if not&#8230;I&#8217;ll keep blogging all the technical tidbits here as always</p>
<p><a href="http://www.benfarrell.com/2013/03/26/finally-picking-a-focus-sweatin-to-the-web/sweatin-banner/" rel="attachment wp-att-1001"><img class="alignnone  wp-image-1001" alt="sweatin-banner" src="http://www.benfarrell.com/wp-content/uploads/2013/03/sweatin-banner.jpg" width="508" height="93" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.benfarrell.com/2013/03/26/finally-picking-a-focus-sweatin-to-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Angular + Backbone + Dojo: A Fundown</title>
		<link>http://www.benfarrell.com/2013/03/21/angular-backbone-dojo-a-fundown/</link>
		<comments>http://www.benfarrell.com/2013/03/21/angular-backbone-dojo-a-fundown/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 00:51:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.benfarrell.com/?p=996</guid>
		<description><![CDATA[I&#8217;m trying to avoid internet negativity at all costs lately.  It&#8217;s so passe.  But I was having such a rockin time working with AngularJS today, I just had to tweet that it was my absolute flavor of the moment.  Right...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m trying to avoid internet negativity at all costs lately.  It&#8217;s so passe.  But I was having such a rockin time working with AngularJS today, I just had to tweet that it was my absolute flavor of the moment.  Right after I did that, though, I had a reality check&#8230;will this turn into one of those boring old internet flame wars where my framework is better than your framework?</p>
<p>I got a reply right away.  Luckily @jwaltonmedia was just being friendly.  See, his flavor of the moment is BackboneJS.  We traded some kind words and left it at that &#8211; each sharing some awesomeness.</p>
<p>Got me thinking though, there&#8217;s too many articles out there about MY FRAMEWORK VS YOUR FRAMEWORK:  THE ULTIMATE THROWDOWN.  The winner rocks and we should push it on everyone whether they want it or not.  The loser suffers in shame for eternity.</p>
<p>Well, I was inspired to compare a few of these frameworks, but I don&#8217;t want to use negativity or competitive language.  Because, in all honestly we are in a moment where there are a metric crapton of Javascript frameworks that are ALL GOOD.</p>
<p>Thusly, I&#8217;ve named this article &#8220;fundown&#8221; instead of &#8220;throwdown&#8221;, because the only winner here is you when you try all this good software.  And instead of &#8220;versus&#8221;, we&#8217;re going to use &#8220;plus&#8221;, because while it&#8217;s not necessarily ideal to use 2 or more of these frameworks together, you should use all and more separately as you rock out your badass web app.</p>
<p>I&#8217;ve tried just around 3 frameworks/libraries heavily at one point or another &#8211; and I truly believe that each is the best tool for some job.  My learning process was pretty unscientific and involved me copying and pasting tutorials and code from the web &#8211; so my opinion here will be equally unscientific.</p>
<h2></h2>
<h2>What&#8217;s good in all</h2>
<p>It&#8217;s pretty easy to see that the 3 I&#8217;ve looked at are pretty mature at this point &#8211; Backbone.js JUST reached a 1.0 milestone and been around since October 2010.  Angular is ALSO at 1.0+ and dates back to January 2010.  Dojo is the grandaddy of them all, REACHING 1.0 in 2008.  So, I think it&#8217;s safe to say all mature, and all are well loved by their communities.</p>
<p>All 3 are geared towards helping you get going to mainly build web applications vs web pages.  Many times this will be single page apps, other times there will be lots of event driven data loading and interaction on the page&#8230;.very AJAX-ey, or whatever it is the cool kids are calling it these days (especially since the cool kids are using JSON and not XML).</p>
<p>&nbsp;</p>
<h2>What&#8217;s bad in all</h2>
<p>So, by virtue of just being Javascript, if you screw up something (and you will because you&#8217;re learning), it will silently fail on you.  All of these are relatively complex systems someone set up.  You have to initialize and use it.  Each come with their own dependencies, and somewhere along the line, you&#8217;ll want to use one of those dependencies, and it will fail on you.  It&#8217;s up to you to figure out how you screwed up the initialization of the framework/library.  More often than not, you&#8217;ll get something like &#8220;X doesn&#8217;t exist&#8221;, and you have to figure out what you did wrong in the setup such that X doesn&#8217;t exist.  Errors aren&#8217;t the most helpful here.</p>
<p>&nbsp;</p>
<h2>Dojo</h2>
<p>Dojo was probably the worst of the pack in terms of unknown setups screwing you further down the line.  However, that&#8217;s a testament to how damn powerful this package is.  It probably packs the most power out of any JS toolkit I&#8217;ve used, and it comes at the price of complexity.</p>
<p>I would recommend not using Dojo for your one off web app.  Use it for your enterprise! Many libraries are moving towards modular loading, but I think it&#8217;s safe to say that Dojo had it first.  And as well it should, because it comes with a crazy amount of components and tools.  You definitely wouldn&#8217;t want to load them all up front.  I believe that most frameworks today will do modular loading, but they seem to make you realize that you are relying on <a href="http://requirejs.org/">Require.js</a> as opposed to Dojo who advertises AMD, but doesn&#8217;t really tell you it&#8217;s Require.js &#8211; they seem to kind of brand it as a Dojo thing.</p>
<p>Anyway &#8211; Dojo&#8230;.large amounts of skinnable modular components.  Back when I was trying it out, they were just getting around to a proper MVC implementation.</p>
<p>&nbsp;</p>
<h2>Backbone.js</h2>
<p>Speaking of MVC&#8230;holy hell, MVC is like Backbone&#8217;s mantra.  You&#8217;re actually extending Backbone&#8217;s Model, View, and Collection base classes.  So everything, at least the beginner stuff, you see online is really going to push this way at you.  And that&#8217;s fine &#8211; but it&#8217;s also why I&#8217;ve found that it was hard to get past the concept of a todo app really.</p>
<p>I&#8217;m not going to be stupid here and tell you that a todo app is the only thing you can do in Backbone.  Backbone is plenty powerful and can do wonderful things &#8211; it&#8217;s just my opinion that the beginner&#8217;s material you see when researching seems to not really help you get beyond this simple &#8220;list my data&#8221; type of web app.</p>
<p>I didn&#8217;t really care for the lack of HTML or otherwise markup used in the framework.  It largely looks like you&#8217;re encouraged to work with code and append to the DOM that way.  Let&#8217;s be honest though, on a large app, after you&#8217;re settled in, doesn&#8217;t it end up that way anyway?  I mean, yah, it&#8217;s nice starting out in HTML &#8211; but it starts to get lengthy and messy, and you just wish you modularized your stuff and programmatically did it at the end.  One exception I&#8217;ve found here with Backbone is that people use a &lt;script type=&#8221;text/template&#8221;&gt; tag to contain an &#8220;item renderer&#8221; for their lists.  Basic idea is that, you load your data into Backbone, and you reference this tag, feeding it to Backbone to render each item in the list.</p>
<p>It&#8217;s a nice little hybrid of HTML and programmatically adding to your DOM.  Plus if you get bored with it, and want to go all JS, it&#8217;s easy to break it out.</p>
<p>&nbsp;</p>
<h2>Angular</h2>
<p>Yet, as much as we say it&#8217;s all gonna be programmatic in the end &#8211; I just love markup.  HTML and CSS is the true visual layer in your web app, why pretend and muddy it with Javascript?  Yah&#8230;.right&#8230;..any number of reasons, but none of those you really want to care about when you&#8217;re starting a project.</p>
<p>That&#8217;s why Angular rocks for me.  You put a magic ng-app attribute on your HTML or div tag, and you suddenly have an Angular application &#8211; one that you can attach a Javascript &#8220;controller&#8221; script to.   Your views are your HTML views with some extra Angular tags that are understood by the system.  I did forget to mention that this is one of the things I dig about Dojo as well!</p>
<p>So lets say that your ng-app=&#8221;MyApplication&#8221;.   Well, write up a &#8220;MyApplication&#8221; controller.  Other nested controllers and models that you define in HTML are class variables in your controller that you can access.  The scope is just magic here the way it intermixes your HTML and JS variables to one controller scope.  Using the double-curly braces will output a variable to be rendered on your HTML: {{myvar}}.</p>
<p>And yah, it does list rendering with a repeater.  An list item can be repeated over a Javascript array in your scope by saying:</p>
<p>&lt;li ng-repeat=&#8221;item in mylist&#8221;&gt;{{item.name}}&lt;/li&gt;</p>
<p>So, doing the above will loop through your list and pump out the name property of each item in your list.  Pretty sweet!</p>
<p>And this strikes to the heart of why AngularJS is my flavor of the month.  I wasn&#8217;t told I needed MVC.  Angular tutorials just give me the tiny pieces I need, and it&#8217;s up to me to put them together.</p>
<p>Contrast that with Backbone &#8211; every tutorial I come across is how to hook up the Model, View,  and Collection to render your data.</p>
<p>Can you do other things?  Obviously, because Backbone rocks.  However, Angular presents &#8220;other things&#8221; so much better in the material I come across.  Plus, I&#8217;m just a sucker for doing my views with markup when I&#8217;m starting out a project.</p>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>In conclusion, all of this means nothing.  If I did anything for you, I gave you a sales pitch to try each of these things out.  You should try Ember too!  You should find frameworks I haven&#8217;t tried and try them as well.  Let&#8217;s just feel good about trying new things, and if you have a favorite, that&#8217;s cool &#8211; but don&#8217;t think of it is the knockout champion of everything.  Keep your noggin open to all things.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benfarrell.com/2013/03/21/angular-backbone-dojo-a-fundown/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Anatomy of a Kinect Like Gesture</title>
		<link>http://www.benfarrell.com/2013/03/19/anatomy-of-a-kinect-like-gesture/</link>
		<comments>http://www.benfarrell.com/2013/03/19/anatomy-of-a-kinect-like-gesture/#comments</comments>
		<pubDate>Wed, 20 Mar 2013 02:52:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[kinect]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[nui]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.benfarrell.com/?p=991</guid>
		<description><![CDATA[As anybody who&#8217;s stopped by my blog over the last few months knows, I&#8217;ve been experimenting a lot with depth cameras like the Kinect and making it work as a plugin in Node.js.  Happy to say that I&#8217;m moved the...]]></description>
				<content:encoded><![CDATA[<p>As anybody who&#8217;s stopped by my blog over the last few months knows, I&#8217;ve been experimenting a lot with depth cameras like the Kinect and making it work as a plugin in Node.js.  Happy to say that I&#8217;m moved the disorganized mess of experiments that I had in Github into what I hope would be a cohesive plugin.</p>
<p>I&#8217;d still like to test a bunch before I call it a release, but I think I have something going here to work a Kinect or Kinect like device through Node with the help of an open source library called OpenNI and not-so-open-source middleware called NiTE.</p>
<p>Sending skeleton data, or joints, or body tracking points to Node was relatively straightfoward.  I just needed to take the data and push it through, making it available to Javascript.</p>
<p>Unfortunately, though, one of the main things we associate with the Kinect isn&#8217;t really included in the middleware I&#8217;m using, and you&#8217;re left to your own devices.  I&#8217;m talking about the gesture.  Whether you&#8217;re swiping your hand, waving, or any number of things we associate as &#8220;natural&#8221; interaction mechanisms to trigger something in our interactive experience to happen.</p>
<p>I actually didn&#8217;t know where to start with this.  Do people REALLY do brute force tracking of your appendage at every stage and consider every possible outcome of where your appendage could be at any given moment?  From what I&#8217;d seen, the answer is yes.  I posed my question to a private Kinect G+ Community I&#8217;m a part of.  My question was basically&#8230;&#8221;How do you even start going about programming a gesture?&#8221;.</p>
<p>Because this small knit group of people rock &#8211; I received C# source code almost immediately for a swipe gesture from a Turkish developer named Furkan Üzümcü (@furkanzmc).  I set out to convert it to C++ for my own purposes which I&#8217;ll share in a bit.  It really opened up my eyes to the attention to detail about what you are doing with your body to register a gesture.</p>
<p>Here&#8217;s the anatomy of a swipe right gesture (as performed with your left hand, swiping left to right):</p>
<ul>
<li>First, cancel any swipe right in progress if:
<ul>
<li>a) Left hand is above head &#8211; it doesn&#8217;t seem natural of a person to try to perform a swipe like this</li>
<li>b) Left hand is below left elbow &#8211; it seems more natural to perform a swipe when the upper arm is relaxed and the forearm is raised, with the hand in this position above the elbow</li>
<li>c) Left hand is above hip &#8211; this I think is more subjective, but ideally &#8211; you are purposely creating a gesture if you&#8217;ve raised your hand above your mid-section</li>
</ul>
</li>
<li>Next, if the left hand&#8217;s x position is to the left of the left shoulder, then we are on the left side of our body, and ready to start a swipe &#8211; so flag this, that we&#8217;ve started a gesture.  On the other hand &#8211; if the hand isn&#8217;t far enough to the left, measured by horizontal distance between the left hand and shoulder being less than the horizontal distance between the torso and the shoulder, then cancel the flag and indicate that we have NOT started the gesture.</li>
<li>Next, if the gesture is started and the timestamp hasn&#8217;t been recorded then mark the start time of our gesture.</li>
<li>Finally, if the horizontal position of the left hand is greater than the horizontal position of the torso AND the time it took is between the .1 seconds and 1 second, then we have a gesture!</li>
</ul>
<p>So yeah, I&#8217;d call that brute force.  Not only are you defining an event flow based on MULTIPLE joints (your hand, elbow, shoulder, head, and torso), but you are approximating allowable &#8220;good distance&#8221; for things based on the distance between things like your shoulder and torso.</p>
<p>These are important things to realize.  This arm motion that sounds so easy, just became a whole body affair.  And global/world coordinates really aren&#8217;t that great to use here since people can be closer to or farther away from the camera and people also come in all shapes and sizes.  So, we think of all of our distances as relative to the distance from one body part to the other.</p>
<p>When I was programming this, I started sitting there, and really watching my body motion.  I&#8217;d take my arm and start swinging it around&#8230;just thinking about how it moved.  I felt like Otto the Bus driver from the Simpsons.</p>
<div id="attachment_992" class="wp-caption alignnone" style="width: 310px"><a href="http://www.benfarrell.com/2013/03/19/anatomy-of-a-kinect-like-gesture/otto/" rel="attachment wp-att-992"><img class="size-medium wp-image-992" alt="&quot;they call them fingers but i never see them fing&quot;.... &quot;ohh there they go&quot;" src="http://www.benfarrell.com/wp-content/uploads/2013/03/otto-300x300.png" width="300" height="300" /></a><p class="wp-caption-text">&#8220;they call them fingers but i never see them fing&#8221;&#8230;. &#8220;ohh there they go&#8221;</p></div>
<p>So, for a swipe left, you can imagine how that works.  Just reverse the motion of the left swipe.</p>
<p>Up and down was a little harder.  With the horizontal swipes, we can imagine a user as needing to vertically center the gesture just above their torso.  But what of vertical swipes?  I could easily swipe up at the left, right, or dead center of my body.  Any of these are valid in my opinion, and no starting horizontal position of the swipe invalidates the gesture.</p>
<p>So, I took a page out of the relative distance between joints game.  I said: &#8220;OK &#8211; the distance between your left and right hip is the maximum amount of horizontal variance you&#8217;re allowed to have in your vertical swipe&#8221;.  So if your hand starts below your hip, and your hand is below your elbow, and continues up to where your hand is above your elbow in the right amount of time and with less than the maximum horizontal variance, then you have a swipe up!</p>
<p>Same with swipe down, but reverse of course.</p>
<p>Interesting thing when you listen for both events, though &#8211; if you want to do either a swipe up or swipe down, you make a conscious effort to put your hand into position.  To get it into this position, it seems like a lot of the time, you are causing an accidental swipe up!  I haven&#8217;t resolved this issue yet, but it&#8217;s an interesting one.</p>
<p>Lots of things to consider here.  I also did one on my own &#8211;  a wave gesture.  As in a greeting &#8211; &#8220;hello&#8221;, &#8220;goodbye&#8221; &#8211; you know, a hand wave.  Here, I simply detected if the hand was above the hip, below the head, and above the elbow.  That&#8217;s my starting position.  Then if the hand&#8217;s horizontal position goes left then right in a cycle 6 times where each motion takes less than .2 seconds, we have a wave.</p>
<p>Overall, you&#8217;re considering a lot of different things when designing a gesture.  How &#8220;natural&#8221; it is for your users becomes how intuitive you make it.  Have you considered how different people might interpret a swipe?  If a user thinks perhaps a swipe takes place above their head, will they become frustrated if you don&#8217;t consider this fact?  If a user waves super slow, and each side to side motion takes .3 seconds instead of my .2 seconds as designed, is THAT OK?  Visual feedback can help greatly, but I think that considering all of the edge cases can greatly increase the natural feel and intuitiveness of any gestures you design even before thinking about visual feedback.</p>
<p>As I said, I&#8217;m funneling all this effort into my Node.js plugin.  It&#8217;s probably in the alpha stage right now, so I&#8217;ll just link you to my gesture scripts over on Github:</p>
<p><a href="https://github.com/bengfarrell/nuimotion/blob/master/src/gestures/Swipe.cpp">https://github.com/bengfarrell/nuimotion/blob/master/src/gestures/Swipe.cpp</a></p>
<p><a href="https://github.com/bengfarrell/nuimotion/blob/master/src/gestures/Wave.cpp">https://github.com/bengfarrell/nuimotion/blob/master/src/gestures/Wave.cpp</a></p>
<p>I think as my add-on gets more solid, I&#8217;ll definitely be cleaning these up as well&#8230;organizing code better, removing redundancy, etc.  This should just give you a good idea of the logic behind the gesture.  Thanks again to Furkan Üzümcü for the C# Swipe code that my swipe is largely based on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benfarrell.com/2013/03/19/anatomy-of-a-kinect-like-gesture/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s Kill Javascript with Sensational Headlines!</title>
		<link>http://www.benfarrell.com/2013/03/17/lets-kill-javascript-with-sensational-headlines/</link>
		<comments>http://www.benfarrell.com/2013/03/17/lets-kill-javascript-with-sensational-headlines/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 02:58:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.benfarrell.com/?p=986</guid>
		<description><![CDATA[The following article came across my G+ feed today: http://techcrunch.com/2013/03/15/the-future-of-javascript/ Basically, the article&#8217;s headline indicates a major throwdown is ahead of us.  People will reject Javascript outright&#8230; killing it, or we all open our hearts to JS making it the...]]></description>
				<content:encoded><![CDATA[<p>The following article came across my G+ feed today:</p>
<p><a href="http://techcrunch.com/2013/03/15/the-future-of-javascript/">http://techcrunch.com/2013/03/15/the-future-of-javascript/</a></p>
<p>Basically, the article&#8217;s headline indicates a major throwdown is ahead of us.  People will reject Javascript outright&#8230; killing it, or we all open our hearts to JS making it the ultimate one for all language.  Thankfully, the content of the article is a little better, describing the growing pains as people have adopted the language more and more and speculating how it (and we) will adapt.</p>
<p>To me, though, this and other sensational headlines like it is the same old history repeating itself.  Did we really think that the big buzzword that is HTML5 would last forever?  Sorry to tell you guys this, but people are getting bored.  And when people get bored, the other camp that doesn&#8217;t like technology X comes out with pitchforks with the great big &#8220;I told you so&#8217;s&#8221;.</p>
<p>If the pitchfork dudes can sway opinion, then the snowball rolls and gets bigger&#8230;.and bigger&#8230;and bigger.</p>
<p>But whatever shall replace this hole in our hearts, now that technology X has died?  There&#8217;s always something, and when technology Y is announced, it&#8217;s imagined as a heroic knight riding in on a white horse to save the day.  Once that happens, technology X has &#8220;died&#8221;.</p>
<p>Dig the grave, say your last piece and pull up the hearse.</p>
<p>It will happen to Javascript and HTML5, too.  Does it matter, though?  What happens to a technology when it &#8220;dies&#8221;?  Lets ask Adobe!</p>
<p>Flash is dead, right?  Nah &#8211; just fallen out of favor in the larger context.  Adobe still invests resources into making Flash better and better.  They&#8217;ve remarketed it towards games now, but it still does everything it did before.  Yah, so it doesn&#8217;t do mobile without the help of it&#8217;s little brother AIR.</p>
<p>Is it dead to you because it doesn&#8217;t do mobile?  Guess what genius, there are still plenty of laptops and desktops.  There are still people consuming videos and games and rich media.  Yes, some of this is being eaten by HTML5 adoption.  What are we seeing after Flash has died?  Well, it simply declined.  Some folks moved on.  Others didn&#8217;t.  I still hear of plenty of Flash and Flex projects going on, it&#8217;s just not a compelling story anymore because there&#8217;s been a decline and headline writers are bored with it.</p>
<p>OK&#8230;.maybe it&#8217;s too soon.  Maybe death doesn&#8217;t happen that quickly and my example is bunk.  How about another Adobe product?  Way back in my career&#8217;s beginning, I was in love with a multimedia authoring tool called Director.  That was actually proclaimed dead when Flash started gaining traction.  So&#8230;..2002 or 2003, maybe?</p>
<p>Know what Adobe just released?  Yep, Director 12.  That&#8217;s like 20 years worth of Director by Macromedia then Adobe.  Do people still use it much?  Nope.  Is it still alive?  Yep.</p>
<p>There will always be old projects to update, workflows to continue, but if the new hotness comes along &#8211; yes, your favorite technology will decline in popular favor.</p>
<p>How bout another example?  There was a time when people said Java will take over the world.  I wasn&#8217;t a Java dev until recently, but if you got caught up in the moment, you might seriously believe it would.  I was kinda guilty of thinking the same thing of Flash back in it&#8217;s prime.  Tons of Java jobs sprung up, entire enterprises were taken over, it was injected into college curriculum as the real world thing you&#8217;ll need.</p>
<p>Anddddddddd&#8230;.it declined.   But shit, Java in it&#8217;s decline was probably better than most techs at their peaks.  As a result, Java is still there.  We still need developers for it, and Google bumped it up a little with Android development.  Some people might say that Google brought it back from the dead.  It was never truly dead.  It just lost several percentage points in market favor.</p>
<p>See a pattern?  I do.  I&#8217;ve lived it.  And I&#8217;ve freaked out when my favorite technology was being threatened thinking I&#8217;d die in a gutter doing Flash and Director work for half eaten sandwiches out of a dumpster.</p>
<p>So, Javascript developers, HTML5 developers &#8211; listen up.  Your favorite things will all DIE!  But that doesn&#8217;t mean that they won&#8217;t lead perfectly normal lives after death.  Javascript might do as well as Java so long as browsers exist as they do today.  But just like Java, Javascript will die when marketing people get bored and try to sell you the new hotness.</p>
<p>Having said that, don&#8217;t use my advice for complacency.  Typically when things die, you&#8217;ll still find work, but you&#8217;ll get paid less and gigs might be a little harder to find.  So don&#8217;t get tied in to one tech.  Explore and branch out.  The biggest mistake I ever made, not ONCE, but TWICE was to think that my favorite tech was the bees knees and it would take over the world.  I&#8217;m seeing it happen with front-enders today.  In fact, I can recall one brain melting moment at a meeting when someone suggested that native mobile app development in Objective C and Android was the &#8220;Flash&#8221; of the mobile generation.  It&#8217;s a detriment, when soon folks will see the light and we&#8217;ll all be doing HTML5.</p>
<p>No.  Cross-platform never wins.  It always takes the dive.  Ride it high while it&#8217;s here but don&#8217;t expect it to last.  Just simply get curious about different tools and languages, try them out &#8211; and pay attention to the market.  Nothing you do will be a waste of time.  Anything that dies on you will still be useful, if not in it&#8217;s current incarnation, then through the concepts and ideas it carries over to all other things in our space.</p>
<p>Guess what&#8217;s living now?  All of it.  I can be a Flash developer, a Java developer, a COBOL developer, and a Javascript developer.  I can make awesome HTML5 experience and make some cool Hypercard experiences (I think).  The more technologies that &#8220;die&#8221; the more opportunities we have to do new and cool things, not the same amount of opportunities or less.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benfarrell.com/2013/03/17/lets-kill-javascript-with-sensational-headlines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
