<?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/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Streamhead</title>
	<atom:link href="http://www.streamhead.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.streamhead.com</link>
	<description>The Business of Web Apps</description>
	<lastBuildDate>Thu, 07 Feb 2013 15:53:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>The Modern Node.js Web App and Site</title>
		<link>http://www.streamhead.com/modern-node-js-web-app-site/</link>
		<comments>http://www.streamhead.com/modern-node-js-web-app-site/#comments</comments>
		<pubDate>Thu, 07 Feb 2013 15:53:21 +0000</pubDate>
		<dc:creator>Peter Backx</dc:creator>
				<category><![CDATA[Java and JavaScript]]></category>

		<guid isPermaLink="false">http://www.streamhead.com/?p=3619</guid>
		<description><![CDATA[As projects for the new year have started to roll in, I&#8217;ve noticed some trends in how web sites and applications are built and how they are hosted. If you&#8217;re a one-man shop or a small company, the single most important change is the advent of cloud platforms. If you haven&#8217;t been paying attention the [...]<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></description>
				<content:encoded><![CDATA[<img width="1024" height="748" src="http://www.streamhead.com/wp-content/uploads/2013/02/stream_of_consciousness.jpg" class="attachment-post-thumbnail wp-post-image" alt="Stream of Consciousness" /><p>As projects for the new year have started to roll in, I&#8217;ve noticed some trends in how web sites and applications are built and how they are hosted. <span id="more-3619"></span></p>
<p>If you&#8217;re a one-man shop or a small company, the single most important change is the advent of cloud platforms. If you haven&#8217;t been paying attention the last few years, it&#8217;s about time. Suddenly, you no longer have to worry about system administration. Platforms such as Heroku and Google&#8217;s AppEngine might not be the cheapest, but they certainly are helpful in alleviating a lot of the pain of hosting your own web applications.</p>
<p>However, with cloud platforms comes a major change in development: <strong>expect failure </strong>of even the smallest component and<strong> prepare for it.</strong></p>
<div>The one cardinal rule that you will ignore at first, but will learn the hard way: <a href="http://twitter.com/share?url=http://www.streamhead.com/modern-node-js-web-app-site/&text=Every+component+in+the+system+will+fail.+You+better+prepare+if+you+don%26%238217%3Bt+want+your+users+to+suffer.&via=pbackx&related=pbackx" rel="nofollow" title="Click here to tweet this." target="_blank" class="tweetherder"  >Every component in the system will fail. You better prepare if you don&#8217;t want your users to suffer.</a></div>
<div></div>
<div>The good thing is, you&#8217;re site will be better for it.</div>
<p>With this in mind, I foresee two parallel roads in web development:</p>
<ul>
<li><span style="line-height: 13px;">Highly dynamic single page apps interfacing with highly distributed stateless JSON REST services. These services scale indefinitely (almost) and are ideal for systems that fail over regularly (remember, no state). Suggested technologies: <a href="http://angularjs.org/"><strong>AngularJS </strong></a>and<a href="http://backbonejs.org/"><strong> Backbone.js</strong></a> on the client. Pretty much any lightweight Node.js framework will do. For instance, <a href="http://expressjs.com/"><strong>Express</strong></a> combined with some <a href="https://www.mongohq.com/"><strong>MongoDB</strong></a> or <strong><a href="http://www.heroku.com/">PostgreSQL</a></strong> host.</span></li>
<li>Static SEO optimized read-only content. Ideally for distribution on CDNs. <a href="http://jekyllrb.com/">Jekyll</a> is perfect for this. It isn&#8217;t anything new, before WordPress, Movable Type was already generating static sites. It&#8217;s only common sense, really. But Jekyll puts it into a nice, low-friction package. I haven&#8217;t researched the Node options, but <a href="https://github.com/flatiron/blacksmith"><strong>Blacksmith</strong></a>, <strong><a href="https://github.com/jnordberg/wintersmith">Wintersmith</a></strong> and <strong><a href="http://docpad.org/">DocPad</a></strong> look promising.</li>
</ul>
<p>There will always be an overlap, where the choice won&#8217;t be clear. For instance, I can imagine a typical forum, that you want indexed by Google, will be an interesting exercise.</p>
<p>I&#8217;d love to learn about your vision for web development in 2013 and beyond. Please join me on <a href="https://twitter.com/pbackx">Twitter</a> and <a href="http://www.facebook.com/streamhead">Facebook</a>.</p>

						<div id="pdrp_endAttribution">
						photo by: 
						 
							<a href="http://flickr.com/44124348109@N01/2542450115" target="_blank" class="pdrp_link pdrp_attributionLink">
								jurvetson</a>
						</div>
					<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamhead.com/modern-node-js-web-app-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2013/02/stream_of_consciousness.jpg" />
		<media:content url="http://www.streamhead.com/wp-content/uploads/2013/02/stream_of_consciousness.jpg" medium="image">
			<media:title type="html">Stream of Consciousness</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2013/02/stream_of_consciousness.jpg" medium="image">
			<media:title type="html">Stream of Consciousness</media:title>
		</media:content>
	</item>
		<item>
		<title>Year in Review 2012, Goals for 2013</title>
		<link>http://www.streamhead.com/year-review-2012-goals-2013/</link>
		<comments>http://www.streamhead.com/year-review-2012-goals-2013/#comments</comments>
		<pubDate>Sat, 29 Dec 2012 18:15:33 +0000</pubDate>
		<dc:creator>Peter Backx</dc:creator>
				<category><![CDATA[On Streamhead]]></category>

		<guid isPermaLink="false">http://www.streamhead.com/?p=3607</guid>
		<description><![CDATA[Another year has (almost) passed. It was a very exiting year, in which I threw a lot against the wall to see what would stick. I also managed to implement most of my 2012 goals, although, in hindsight, they were a little too vague. 2012 Lets go over the goals and plans mentioned in my [...]<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></description>
				<content:encoded><![CDATA[<img width="1024" height="768" src="http://www.streamhead.com/wp-content/uploads/2012/12/christmas_time.jpg" class="attachment-post-thumbnail wp-post-image" alt="CHRISTMAS TIME!!!" /><p>Another year has (almost) passed. It was a very exiting year, in which I threw a lot against the wall to see what would stick. I also managed to implement most of my 2012 goals, although, in hindsight, they were a little too vague.</p>
<p><span id="more-3607"></span></p>
<h2>2012</h2>
<p><a href="http://www.streamhead.com/review-and-preview-2012/">Lets go over the goals and plans mentioned in my last review post</a>:</p>
<ul>
<li><strong>eLance</strong>: I&#8217;ve grown extremely tired of the way things work on this type of outsourcing sites. While I will keep helping out my existing customers, I don&#8217;t plan on picking up any new ones.</li>
<li><strong>Java</strong>, for me, is a language very quickly moving towards &#8220;COBOL status&#8221;. Development in Java is slow with an incredible amount of overhead. For no good reason. I did pick up <strong>Groovy</strong> this year and I&#8217;m loving it. While it&#8217;s not perfect, I feel it&#8217;s a good compromise.</li>
<li>After some more <strong>PHP</strong> work, I realized it&#8217;s just not for me. The language is a mix of ideas, seemingly randomly thrown together. No matter what I try, I can&#8217;t really get used to it. Furthermore, due to the sheer number of PHP developers available, the job market itself is such a mess, where the lowest bidder wins, but you eventually end up cleaning up after him.</li>
<li><strong>JavaScript</strong> was the real eye-opener for me this year. Although I haven&#8217;t written too much about it, I&#8217;ve done a lot of Node.JS development last year and I still like it. Yes, you need to properly manage callbacks so they don&#8217;t turn your code into a mess. But the system works. Node.JS development forces you to think about issues that other languages try to hide (and they really shouldn&#8217;t).</li>
<li>I&#8217;ve continued, with mixed success, to market some of my websites. More on that in my 2013 goals.</li>
</ul>
<h2>2013</h2>
<p>So what&#8217;s in store for 2013? In all honesty, I&#8217;m not sure because I have no idea how much time I&#8217;ll have for development work.</p>
<p>In any case, I want to work on just a few, but larger projects. Here&#8217;s what I&#8217;d like to do:</p>
<ul>
<li>Jump into the &#8220;Big Data&#8221; waters. I&#8217;ve previously worked with SOLR, but that was just the start.</li>
<li>Increase revenue for <a href="http://www.streamhead.com/launching-my-first-vaadin-appengine-project/">my Vaadin application</a>. I only plan to do major development if and when I hit my revenue goals. If I do, I&#8217;d love to move the entire app to a more modern language (Gradle instead of Maven, Groovy instead of Java)</li>
<li>Improve <a href="http://www.streamhead.com/discogs-scan/">my Android app</a> and possibly build another one. I have a big idea-file waiting for me, so I will first need to prioritize.</li>
<li>Ideally, I want to do at least one major Node.JS project, but I&#8217;m not sure if I&#8217;ll be able to fit that into my schedule.</li>
</ul>
<p>Enjoy the new year.</p>

						<div id="pdrp_endAttribution">
						photo by: 
						 
							<a href="http://flickr.com/11599314@N00/2122762150" target="_blank" class="pdrp_link pdrp_attributionLink">
								Luz Adriana Villa A.</a>
						</div>
					<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamhead.com/year-review-2012-goals-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/12/christmas_time.jpg" />
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/12/christmas_time.jpg" medium="image">
			<media:title type="html">CHRISTMAS TIME!!!</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/12/christmas_time.jpg" medium="image">
			<media:title type="html">CHRISTMAS TIME!!!</media:title>
		</media:content>
	</item>
		<item>
		<title>Tiny Tower vs The Volcano, Casual Game on Kongregate</title>
		<link>http://www.streamhead.com/kongregate-flash-game/</link>
		<comments>http://www.streamhead.com/kongregate-flash-game/#comments</comments>
		<pubDate>Mon, 27 Aug 2012 13:31:38 +0000</pubDate>
		<dc:creator>Peter Backx</dc:creator>
				<category><![CDATA[Flash and ActionScript]]></category>

		<guid isPermaLink="false">http://www.streamhead.com/?p=3588</guid>
		<description><![CDATA[After my ebook project, two weeks ago, I created an overhaul of a casual Flash game I wrote for the Ludum Dare #23 competition. It&#8217;s available on Kongregate for all the play and comment on. Read on for my experience and lessons learned. Way back in April, I joined the Ludum Dare 48 hours game [...]<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></description>
				<content:encoded><![CDATA[<img width="300" height="250" src="http://www.streamhead.com/wp-content/uploads/2012/08/tinytower_kongregate_header.png" class="attachment-post-thumbnail wp-post-image" alt="Tiny Tower vs. The Volcano is a Flash game made in 48 hours" /><p>After my ebook project, two weeks ago, I created an overhaul of a casual Flash game I wrote for the Ludum Dare #23 competition. <a href="http://www.kongregate.com/games/pbackx/tiny-tower-vs-the-volcano">It&#8217;s available on Kongregate for all the play and comment on</a>. Read on for my experience and lessons learned.</p>
<p><span id="more-3588"></span>Way back in April, <a href="http://www.ludumdare.com/compo/author/pbackx/">I joined the Ludum Dare 48 hours game competition</a>. The idea of the competition is to create a game, all by yourself, from scratch in 48 hours. Going in, I knew I wasn&#8217;t doing this to win, but mostly for the experience.</p>
<p>In hind-side, I&#8217;m pretty happy with how the weekend went. The main reason that I was able to complete this game was that I only kept one gameplay element. Ant throughout those 48 hours, I kept reminding myself not to add anything else. It worked and it was a fun weekend.</p>
<h2>Kongregate</h2>
<p>I choose to put the game on Kongregate, because I find it the best casual game site out there. The community is, in general, very supportive with constructive criticism. And the people behind the site seem to genuinely care about their developers.</p>
<p>That, and there&#8217;s some incredible talent over there.</p>
<h2>Flash Game</h2>
<p>Although it usually isn&#8217;t my first choice, I did go for a Flash game. Simply because, at this point in time, it&#8217;s the default for casual games. Choosing any other platform but Flash to write your casual game in, is severely limiting yourself and the potential reach of your game.</p>
<p>There are also a wealth of free ActionScript game libraries available. I choose <a href="http://flixel.org/">Flixel</a>, which was a good choice, but I did find the documentation was a little lacking.</p>
<p>It&#8217;s clear HTML5/JavaScript is the future for casual games, but I&#8217;m not sure if it&#8217;s already &#8220;there&#8221;, just yet.</p>
<h2>Future</h2>
<p>The game has been on Kongregate for about a week, over which it was played almost 800 times and received a 2.34 rating (which is pretty much the definition of an average game).</p>
<p>I&#8217;m pretty happy with that, given that I did almost no promotion and the gameplay is rather limited.</p>
<p>The commentary was also acceptable and the criticism as expected.</p>
<p>So I&#8217;ve been thinking about either enhancing this game, or creating a 2.0 version.</p>
<p>I love tower defense games and feel that this would be a good direction to enhance the gameplay in. But we&#8217;ll see, those ideas will need some extra time to properly form.</p>
<h2>Conclusion</h2>
<p><a href="http://www.kongregate.com/games/pbackx/tiny-tower-vs-the-volcano">Go play the game and let me know what you think</a>.</p>
<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamhead.com/kongregate-flash-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/08/tinytower_kongregate_header.png" />
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/08/tinytower_kongregate_header.png" medium="image">
			<media:title type="html">Tiny Tower vs. The Volcano is a Flash game made in 48 hours</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/08/tinytower_kongregate_header.png" medium="image">
			<media:title type="html">Tiny Tower vs. The Volcano is a Flash game made in 48 hours</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Make Videos for Free</title>
		<link>http://www.streamhead.com/how-to-make-videos-for-free/</link>
		<comments>http://www.streamhead.com/how-to-make-videos-for-free/#comments</comments>
		<pubDate>Mon, 20 Aug 2012 10:35:13 +0000</pubDate>
		<dc:creator>Peter Backx</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.streamhead.com/?p=3579</guid>
		<description><![CDATA[A well-made video can replace many images and many more words. It&#8217;s thus not surprising that publishing videos is a growing trend. But how do you get started in what appears to be an expensive and time-consuming hobby? Over the last few weeks, I&#8217;ve started experimenting with video. I did publish a few videos a [...]<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></description>
				<content:encoded><![CDATA[<img width="300" height="250" src="http://www.streamhead.com/wp-content/uploads/2012/08/make_videos.jpg" class="attachment-post-thumbnail wp-post-image" alt="make_videos" /><p>A well-made video can replace many images and many more words. It&#8217;s thus not surprising that publishing videos is a growing trend. But how do you get started in what appears to be an expensive and time-consuming hobby?</p>
<p><span id="more-3579"></span></p>
<p>Over the last few weeks, I&#8217;ve started experimenting with video. I did publish a few videos a while ago with mixed results. <a title="Screencast: getting started with dosbox" href="http://www.streamhead.com/screencast-getting-started-with-dosbox/">My DOSBox screencast</a> gathered a pretty nice amount of views over the years, but I was never happy with the montage and voice. <a title="Morphing 101" href="http://www.streamhead.com/visual-effects-101-morphing/">The morph effect demonstration</a> never made any impact. Although it required more time and effort, its purpose wasn&#8217;t clear, people are usually searching how to do something, not just a demo.</p>
<p>So, after almost 4 years, it was time to take a second look at video out how to create good quality video within a reasonable time-frame and budget.</p>
<h2>Make Videos with Kdenlive</h2>
<p>Creating raw video material is actually fairly straightforward these days. However, on the subject of how to cut, combine and make videos, fairly little information is available.</p>
<p>There are a few commercial video editing packages, but they all were way more expensive than what I wanted to pay for an experiment. So I dug up <a title="Kdenlive" href="http://www.streamhead.com/kdenlive/">Kdenlive</a>. It&#8217;s still well-maintained and has all the options you&#8217;ll need.</p>
<p>After all those years, it&#8217;s still not available for Windows, which is a shame, but there are a few workarounds. Booting from a memory stick is one way, but I decided to go to my favorite visualization tool <a title="Streamhead posts about VirtualBox" href="http://www.streamhead.com/tag/virtualbox/">VirtualBox</a>.</p>
<p>I have created an image that is freely available. <a title="Make videos for free" href="http://www.peated.be/books/make-videos/">You can download it from my company site</a> (more on that later).</p>
<h2>Publishing</h2>
<p>After a few takes and a little getting used to Kdenlive, I ended up with this revised DOSBox tutorial. It focuses on going from an old CDROM game somewhere in your closet, to playing it on your computer.</p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/W9VB75N9bfs" frameborder="0" allowfullscreen></iframe></p>
<h2>Kindle ebooks</h2>
<p>While I was at it, I also used this experiment to try my hands on a Kindle ebook. I used a setup <a href="http://www.bit-101.com/blog/?p=3475">almost identical to what Keith at BIT-101 is using</a>.</p>
<p>I intentionally tried to keep it short and cheap, as not to overwhelm any one trying to get into this. You can <a href="http://www.amazon.com/Make-Videos-YouTube-Free-ebook/dp/B008YY5WXE?SubscriptionId=AKIAIXG5C7XJL5DE6CZA&tag=streamhead-20" target="_blank" rel="nofollow" title="" >buy it on the Amazon Kindle store</a>.</p>
<p>If you are reading this blog, chances are you aren&#8217;t going to need the book. You can probably get the image running on your own. And the Kdenlive pages have tutorials and a full manual.</p>
<p>The book is just a focused compilation of just the things you need to get started.</p>
<p><iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&bc1=000000&IS2=1&nou=1&bg1=FFFFFF&fc1=0000FF&lc1=000000&t=streamhead-20&o=1&p=8&l=as1&m=amazon&f=ifr&asins=B008YY5WXE" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamhead.com/how-to-make-videos-for-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/08/make_videos.jpg" />
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/08/make_videos.jpg" medium="image">
			<media:title type="html">make_videos</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/08/make_videos.jpg" medium="image">
			<media:title type="html">make_videos</media:title>
		</media:content>
	</item>
		<item>
		<title>PayPal AppEngine Servlet, Now Cloud-Ready</title>
		<link>http://www.streamhead.com/paypal-appengine-servlet-now-cloud-ready/</link>
		<comments>http://www.streamhead.com/paypal-appengine-servlet-now-cloud-ready/#comments</comments>
		<pubDate>Fri, 10 Aug 2012 15:36:35 +0000</pubDate>
		<dc:creator>Peter Backx</dc:creator>
				<category><![CDATA[Java and JavaScript]]></category>
		<category><![CDATA[paypal]]></category>

		<guid isPermaLink="false">http://www.streamhead.com/?p=3569</guid>
		<description><![CDATA[I&#8217;ve just pushed a major extension to my PayPal AppEngine Servlet. It&#8217;s now much more failsafe and takes the validation work out of your hands. Read on for an overview of the new architecture. A variation of the servlet that was included with the GitHub repo has been running for almost 2 years on my [...]<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve just pushed a major extension to my <a href="https://github.com/pbackx/PayPalIPNServlet">PayPal AppEngine Servlet</a>. It&#8217;s now much more failsafe and takes the validation work out of your hands. Read on for an overview of the new architecture.</p>
<p><span id="more-3569"></span></p>
<p>A variation of the servlet that was included with the GitHub repo has been running for almost 2 years on <a title="eenvoudig boekhouden" href="http://www.fctr.be">my own AppEngine application</a>. And over that time it has been remarkably reliable (given PayPal&#8217;s API), but has also shown some issues. Some minor ones that were easily fixed, but also one major:</p>
<p>Whenever PayPal was down or just a little slow, the serlvet would run into timeout exceptions and would not validate the IPN message and, what was worse, would not process it correctly.</p>
<p>Eventually, I realized this is just part of the day-to-day operations of any application deployed to the cloud, so I&#8217;d better clean up my act and start thinking like a cloud developer.</p>
<p><a href="http://twitter.com/share?url=http://www.streamhead.com/paypal-appengine-servlet-now-cloud-ready/&text=Cloud+development+%3D+make+everything+handle+errors+gracefully+and+retry+on+failure&via=pbackx&related=pbackx" rel="nofollow" title="Click here to tweet this." target="_blank" class="tweetherder"  >Cloud development = make everything handle errors gracefully and retry on failure</a>.</p>
<p>The first part was easy enough and should have been part of the code from the start. The second required a rethinking of my architecture. I&#8217;ve now hooked everything into <a title="Task Queue Java API Overview" href="https://developers.google.com/appengine/docs/java/taskqueue/overview">task queues</a>, which means every part is independent, can be easily retried and does not influence the other parts when it fails.</p>
<h2>Small independent parts</h2>
<p>There are 3 servlets that interact as follows:</p>
<p><a href="http://www.streamhead.com/wp-content/uploads/2012/08/paypal_appengine_servlet_architecture.png"><img class="aligncenter size-medium wp-image-3571" title="paypal_appengine_servlet_architecture" src="http://www.streamhead.com/wp-content/uploads/2012/08/paypal_appengine_servlet_architecture-265x300.png" alt="PayPal AppEngine Servlet Architecture" width="265" height="300" /></a></p>
<p>All interaction between the servlets is through a queue. If you haven&#8217;t used the task queues on Google&#8217;s AppEngine, it&#8217;s about time. I too waited too long, but the push queues are an incredible easy way to build fail safety into your application.</p>
<p>You don&#8217;t need to worry about retries, as long as the servlet returns anything but a 200-299 status code, AppEngine will keep retrying the call. You can specify how long it should wait before retries and when it should just give up.</p>
<h2>Transactions</h2>
<p>Because 3 servlets are writing and reading data for the same entity, I also had to make sure every servlet has a consistent view.</p>
<p>Something that isn&#8217;t as easy as you might think in the DataStore. It only guarantees eventual consistency. Strong consistency can only be guaranteed in the same entity group. No problem for changing single IPN message, but duplicate checking requires a query over the entire table.</p>
<p>I could create one big entity group for all IPN messages, but that would sort-of defeat the entire purpose of cloud computing. I think I now have a good trade-off with only a very minor risk of duplicates entering the system. Which shouldn&#8217;t cause any major issues anyway if your program handles the messages in an idempotent way.</p>
<p>If you know a better way to deal with this, please have a look at the IPNValidationServlet and let me know.</p>
<h2>Conclusion</h2>
<p>Every one&#8217;s feedback has really helped me to improve the previous version of the code, so I hope you try out the new one too and let me know what you think. <a title="PayPal AppEngine IPN Servlet" href="https://github.com/pbackx/PayPalIPNServlet">The readme has all the information to get you started</a>.</p>
<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamhead.com/paypal-appengine-servlet-now-cloud-ready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/08/paypal_appengine_servlet_architecture-300x250.png" />
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/08/paypal_appengine_servlet_architecture.png" medium="image">
			<media:title type="html">paypal_appengine_servlet_architecture</media:title>
			<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/08/paypal_appengine_servlet_architecture-300x250.png" />
		</media:content>
	</item>
		<item>
		<title>My First Android App Now Available: Discogs Scan</title>
		<link>http://www.streamhead.com/discogs-scan/</link>
		<comments>http://www.streamhead.com/discogs-scan/#comments</comments>
		<pubDate>Mon, 06 Aug 2012 15:54:17 +0000</pubDate>
		<dc:creator>Peter Backx</dc:creator>
				<category><![CDATA[Java and JavaScript]]></category>
		<category><![CDATA[android]]></category>

		<guid isPermaLink="false">http://www.streamhead.com/?p=3547</guid>
		<description><![CDATA[After last weeks review of Android in Action, it was inevitable: I just released my first Android app: Discogs Scan. Discogs Scan is a small Android 2.1+ application that allows you to quickly scan the barcodes of all your CDs and records and add it to your discogs.com collection. It&#8217;s my first endeavor into mobile [...]<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></description>
				<content:encoded><![CDATA[<img width="300" height="250" src="http://www.streamhead.com/wp-content/uploads/2012/08/discogs_scan.png" class="attachment-post-thumbnail wp-post-image" alt="discogs_scan" /><p>After last weeks review of <a title="Android in Action second edition review" href="http://www.streamhead.com/android-in-action-second-edition-review/">Android in Action</a>, it was inevitable: I just released <a title="Discogs Scan in the Play store" href="https://play.google.com/store/apps/details?id=com.peated.discogs.scan">my first Android app: Discogs Scan</a>. Discogs Scan is a small Android 2.1+ application that allows you to quickly scan the barcodes of all your CDs and records and add it to your discogs.com collection.</p>
<p><span id="more-3547"></span></p>
<p>It&#8217;s my first endeavor into mobile apps and I immediately got hit by some device specific bugs. After a round of debugging I think the application is now fairly stable and ready for general usage.</p>
<h2>Discogs Scan</h2>
<p>The application itself allows you to quickly scan all your CDs and vinyl. It uses the <a href="https://www.discogs.com/">discogs.com</a> database to find all the details. Once everything is scanned, you can upload it to your personal discogs.com collection, where you can organize it as you see fit.</p>
<p>In my own experiments it has a hitrate of about 85%, which I thought was pretty impressive. Depending on how rare the items in your music collection are, your mileage may vary.</p>
<h2>Android Development</h2>
<p><img class="alignleft  wp-image-3558" title="The Android attack !" src="http://www.streamhead.com/wp-content/uploads/2012/08/the_android_attack_.jpg" alt="" width="233" height="310" />In general, I found Android to be very well documented. Even though things tend to move quickly.</p>
<p>Android does carry some of the Java overhead with it. For instance, multi-threaded code can be a hassle because anonymous inner classes aren&#8217;t exactly easy on the eye. The Eclipse plugin does help with a few things (like managing resource id&#8217;s)</p>
<p>There were a few exceptions were the documentation failed, most notably the &#8220;strict mode&#8221;. This mode exists to force you to make your code behave better (for instance, it forces you to do all operations it considers resource intensive in threads). According to the official documentation, it&#8217;s a development only feature, but it turns out it is enabled on production devices such as the latest Samsung Galaxy&#8217;s.</p>
<p>The developer&#8217;s console on the Play store was instrumental in debugging this. It gathers crash information. Definitely a big plus to have this available.</p>
<h2>Conclusion</h2>
<p>I&#8217;m definitely planning a few more Android apps. Most of which will be more general and less niche than this one.</p>
<p>But in the meantime, try out <a href="https://play.google.com/store/apps/details?id=com.peated.discogs.scan">Discogs Scan</a> and let me know what you think.</p>
<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamhead.com/discogs-scan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/08/discogs_scan.png" />
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/08/discogs_scan.png" medium="image">
			<media:title type="html">discogs_scan</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/08/discogs_scan.png" medium="image">
			<media:title type="html">discogs_scan</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/08/the_android_attack_.jpg" medium="image">
			<media:title type="html">The Android attack !</media:title>
		</media:content>
	</item>
		<item>
		<title>Android in Action, Second Edition, Review</title>
		<link>http://www.streamhead.com/android-in-action-second-edition-review/</link>
		<comments>http://www.streamhead.com/android-in-action-second-edition-review/#comments</comments>
		<pubDate>Mon, 30 Jul 2012 14:00:39 +0000</pubDate>
		<dc:creator>Peter Backx</dc:creator>
				<category><![CDATA[Java and JavaScript]]></category>

		<guid isPermaLink="false">http://www.streamhead.com/?p=3524</guid>
		<description><![CDATA[There are many ways to learn to program for the Android platform that powers many smartphones, tablets and other devices. Google offers fairly extensive and free tutorials and documentation. So why would you want to buy and read a book? Read on for my Android in Action review. One of my long-term goals has been [...]<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></description>
				<content:encoded><![CDATA[<img width="300" height="210" src="http://www.streamhead.com/wp-content/uploads/2012/07/android_in_action_second_edition_review.png" class="attachment-post-thumbnail wp-post-image" alt="Android in Action, second edition review" /><p>There are many ways to learn to program for the Android platform that powers many smartphones, tablets and other devices. Google offers fairly extensive and free tutorials and documentation. So why would you want to buy and read a book? Read on for my Android in Action review.</p>
<p><span id="more-3524"></span>One of my long-term goals has been to <a title="2012 review and goals" href="http://www.streamhead.com/review-and-preview-2012/">get into mobile development</a>. I&#8217;ve always liked the idea of reusing my existing Java knowledge and really learn Android. I used the second edition of Android in Action to give me a quick start.</p>
<h2>Android 2</h2>
<p>First things first, you may be wondering why bother with a book that only covers Android 2. Android is already up to version 4 now.</p>
<p>If you take a look at <a href="http://developer.android.com/about/dashboards/index.html">the platform distribution dashboard</a> you&#8217;ll know why: 2.3.3 has, by far, the largest install base. And I doubt this is going to change soon. Much of the features of the later Android version are simply beyond the possibilities of mobile hardware and are aimed at higher level hardware (like tablets and set top boxes)</p>
<h2>Android in Action</h2>
<p><div id="attachment_3538" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-3538" title="Thought plus action" src="http://www.streamhead.com/wp-content/uploads/2012/07/thought_plus_action-300x225.jpg" alt="" width="300" height="225" /><p class="wp-caption-text">After 4 chapters of Android in Action, you&#8217;ll be ready for real Android action.</p></div></p>
<p>The book consists of a few introductory chapters that focus on a detailed explanation of the Android fundamentals (like intents, activities and services). Afterwards most of the chapters focus on the different parts of the API: notifications, telephony, graphics, etc.</p>
<p>Given that the core of Android is pretty different than the usual Spring/JEE fair, I think the authors made the very wise decision of focusing on it a lot. After you&#8217;ve gone over the first 4 chapters, you will have a good understanding of the basics.</p>
<p>Experienced developers will probably only need those first 4 or 5 (on data storage) chapters. Incidentally, if you&#8217;ve grown used to the JavaScript and Node.JS event-based and non-blocking way of working, you&#8217;ll have a leg up on the other developers.</p>
<p>Part 3, containing chapters 12 and 13 is a little different. These chapters contain an in-depth look at two applications. There&#8217;s still some new knowledge in those chapters (especially 13), but these are mainly aimed at applying what was learned in the previous chapters. I found chapter 12 very useful, but I&#8217;m not sure if chapter 13 will be useful for many people. But it&#8217;s good to know it&#8217;s there if I ever need to create low-level apps.</p>
<p>There&#8217;s also a full chapter on web development (16) which, although a bit brief, is very timely.</p>
<p>The overall quality of writing is excellent. You will need some experience with Java to get the most out of the book. If you don&#8217;t know Java yet, you&#8217;ll probably get stuck too much on the example code.</p>
<h2>Sample code</h2>
<p><div id="attachment_3540" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-3540" title="Wedding Samples" src="http://www.streamhead.com/wp-content/uploads/2012/07/wedding_samples-300x225.jpg" alt="" width="300" height="225" /><p class="wp-caption-text">The examples in Android in Action give your a taste of most of the Android API</p></div></p>
<p>The usage of example code is well chosen and the code does interesting things. The book does not print the entire code, so be sure to download the full example code package before you start.</p>
<p>Many examples integrate various web services and result in pretty impressive apps with little actual development. The disadvantage is that many of the used services are no longer available or have changed their API. There are some limited fixes provided in the book forum, but overall, you&#8217;ll be on your own.</p>
<p>But lets talk about chapter 12. I&#8217;m not sure what happened there, but it feels like an ActionScript developer was let loose on the Java world. I don&#8217;t think I&#8217;ve ever seen the use of underscores to indicate private fields in a Java program, but chapter 12 has them. To top that of, there are lower case class names, uppercase method names and underscore-separated names.</p>
<p>I&#8217;m not sure what happened there, but although the example was very good, the code style was extremely distracting.</p>
<h2>The good</h2>
<ul>
<li>It covers pretty much everything in the Android 2 SDK, including some stuff that you&#8217;re probably never going to need.</li>
<li>Examples are well chosen and explanation is thorough.</li>
</ul>
<h2>The bad</h2>
<ul>
<li>Actual code quality of the examples is a mixed bag.</li>
<li>No in-depth overview of APIs limits the use of the book as a reference.</li>
</ul>

						<div id="pdrp_endAttribution">
						photos by: 
						 
							<a href="http://flickr.com/35034345533@N01/3261773180" target="_blank" class="pdrp_link pdrp_attributionLink">
								magnetbox</a> & 
							<a href="http://flickr.com/11121785@N00/120123885" target="_blank" class="pdrp_link pdrp_attributionLink">
								Tracy Hunter</a>
						</div>
					<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamhead.com/android-in-action-second-edition-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/07/android_in_action_second_edition_review.png" />
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/07/android_in_action_second_edition_review.png" medium="image">
			<media:title type="html">Android in Action, second edition review</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/07/android_in_action_second_edition_review.png" medium="image">
			<media:title type="html">Android in Action, second edition review</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/07/thought_plus_action.jpg" medium="image">
			<media:title type="html">Thought plus action</media:title>
			<media:description type="html">After 4 chapters of Android in Action, you'll be ready for real Android action.</media:description>
			<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/07/thought_plus_action-300x250.jpg" />
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/07/wedding_samples.jpg" medium="image">
			<media:title type="html">Wedding Samples</media:title>
			<media:description type="html">The examples in Android in Action give your a taste of most of the Android API</media:description>
			<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/07/wedding_samples-300x250.jpg" />
		</media:content>
	</item>
		<item>
		<title>Meteor JavaScript Web App Platform Lunch Hour Impressions</title>
		<link>http://www.streamhead.com/meteor-javascript-web-app-platform-lunch-hour-impressions/</link>
		<comments>http://www.streamhead.com/meteor-javascript-web-app-platform-lunch-hour-impressions/#comments</comments>
		<pubDate>Mon, 02 Jul 2012 13:00:31 +0000</pubDate>
		<dc:creator>Peter Backx</dc:creator>
				<category><![CDATA[Java and JavaScript]]></category>

		<guid isPermaLink="false">http://www.streamhead.com/?p=3496</guid>
		<description><![CDATA[In this second installment in the series, I&#8217;m using my lunch hour to take a look at Meteor. It&#8217;s another box filled with all kind of delicious candy that any web app developer will love to use. But is it worth your time? This article is going to sound a lot like a comparison with [...]<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></description>
				<content:encoded><![CDATA[<img width="300" height="250" src="http://www.streamhead.com/wp-content/uploads/2012/06/meteor_full_stack_javascript_framework.png" class="attachment-post-thumbnail wp-post-image" alt="Meteor full stack Javascript framework" /><p>In this second installment in the series, I&#8217;m using my lunch hour to take a look at Meteor. It&#8217;s another box filled with all kind of delicious candy that any web app developer will love to use. But is it worth your time?</p>
<p><span id="more-3496"></span></p>
<p>This article is going to sound a lot like a comparison with <a title="Opa Web Application Platform First Look" href="http://www.streamhead.com/opa-web-application-platform-lunch-hour-experiment/">the previously reviewed Opa platform</a>. And there&#8217;s good reason for that. Meteor is a full stack web application framework. Just as Opa, it comes as a standalone package. Just as Opa, it blurs the distinction between client and server.</p>
<p>Major differences with Opa include: Meteor is absolutely not production ready and Meteor uses JavaScript.</p>
<h2>First Impressions</h2>
<p>I tried Meteor on a <a title="VirtualBox power tool for developers" href="http://www.streamhead.com/virtualbox/">VirtualBox</a> Ubuntu installation. Given the way it is installed, it looks very unlikely that Meteor will run on Windows without a lot of hacking, so I didn&#8217;t even bother.</p>
<p><a href="http://meteor.com/examples/leaderboard">The Meteor site blurs the lines between download and examples</a>. By the time you have installed Meteor, you also have an example app. This feels a little strange at first, &#8220;where&#8217;s that download link?&#8221;, but it&#8217;s a pretty good idea to get you started right away.</p>
<p>The examples are good, yet they couldn&#8217;t help but implement another multiuser live-update system (not a chat this time, though). Again, I think this is a use case that only a very small percentage of developers will encounter in their lives.</p>
<h2>JavaScript All the Way Down</h2>
<p><div id="attachment_3505" class="wp-caption alignleft" style="width: 235px"><img class="size-medium wp-image-3505" title="It's Turtles All The Way Down" src="http://www.streamhead.com/wp-content/uploads/2012/07/its_turtles_all_the_way_down-225x300.jpg" alt="It's Turtles All The Way Down" width="225" height="300" /><p class="wp-caption-text">No, not turtles, to develop in Meteor, you&#8217;ll only need to know JavaScript.</p></div></p>
<p><a href="http://twitter.com/share?url=http://www.streamhead.com/meteor-javascript-web-app-platform-lunch-hour-impressions/&text=Unlike+Opa%2C+Meteor+uses+the+familiar+JavaScript+language&via=pbackx&related=pbackx" rel="nofollow" title="Click here to tweet this." target="_blank" class="tweetherder"  >Unlike Opa, Meteor uses the familiar JavaScript language</a>. Just as Opa, it mixes both server-side and client-side code in the same files. The distinction between client and server is made through a simple &#8220;if&#8221; test. Meteor.is_client and Meteor.is_server tell you where the code is running.</p>
<p>As far as I understand, most existing JavaScript libraries are re-usable straight away. So while the standard API may be pretty limited, your options will be endless. There are about 10 popular web libraries included by default, Bootstrap and Underscore are a few that I will find useful.</p>
<p>It wasn&#8217;t immediately clear from the web pages, but Meteor is build on Node.JS.</p>
<h2>Deploying to the Cloud</h2>
<p>The built-in examples are a great way to get started right away. However, going over them, I&#8217;m a little confused how security works. You can just deploy to any servername you like, so I guess any one can overwrite this &#8220;live&#8221; version of the program. It&#8217;s neat to be able to get started right away, however if you happen to cross paths with some one else using the same name, it&#8217;s probably not so much fun.</p>
<p>Reading further it appears it is possible to set a password for the server, but by default there is none. It&#8217;s also possible to create a self-contained package that can be deployed to Heroku. Which is nice, although I&#8217;m going to need a little more explanation than provided before I can actually deploy it.</p>
<h2>Storing and Viewing Data</h2>
<p><div id="attachment_3507" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-3507" title="MongoDB cup &amp; cards" src="http://www.streamhead.com/wp-content/uploads/2012/07/mongodb-300x199.jpg" alt="MongoDB cup &amp; cards" width="300" height="199" /><p class="wp-caption-text">If you&#8217;re used to SQL, you&#8217;ll find MongoDB&#8217;s API very refreshing.</p></div></p>
<p>Meteor&#8217;s default datastore is MongoDB and as far as I can see, it directly exposes MongoDB&#8217;s JavaScript API. Mongo uses a fairly intuitive interface, so even without experience, you&#8217;ll be able to write a simple CRUD application quickly.</p>
<p>Since there&#8217;s a lot client/server communications build into the API, it looks like it would be fairly difficult to replace MongoDB with your own choice.</p>
<p>On the view side, Meteor comes with Handlebars built in. It has a neat and very clean way of using helper functions to connect the template variables and events to the controller code. You can replace Handlebars with your choice of templating framework, but I see very little reason to.</p>
<h2>Wrapping Up</h2>
<p>Just shooting from the hip here while I wrap up my hour:</p>
<p>As far as I can see, there&#8217;s no dependency management. I&#8217;m not sure why they didn&#8217;t re-use what Node and NPM already offer.</p>
<p>Development is as &#8220;live&#8221; as it will get. You don&#8217;t need to even reload your browser. This all happens behind the scenes for you. An impressive productivity feat.</p>
<p>Meteor seems to use long polling client/server communication similar to Opa.</p>
<p>The documentation is clear and also give a good insight into how the magic works, which is important for an analytical guy like me.</p>
<h2>Why Would You Use Meteor</h2>
<p><a href="http://twitter.com/share?url=http://www.streamhead.com/meteor-javascript-web-app-platform-lunch-hour-impressions/&text=With+Meteor%2C+your+development+time+will+be+spent+almost+100%25+doing+actual+development+work&via=pbackx&related=pbackx" rel="nofollow" title="Click here to tweet this." target="_blank" class="tweetherder"  >With Meteor, your development time will be spent almost 100% doing actual development work</a>. No time lost compiling, deploying or restarting.</p>
<p><a href="http://twitter.com/share?url=http://www.streamhead.com/meteor-javascript-web-app-platform-lunch-hour-impressions/&text=Meteor+is+100%25+JavaScript%2C+a+language+pretty+much+any+developer+on+the+planet+knows&via=pbackx&related=pbackx" rel="nofollow" title="Click here to tweet this." target="_blank" class="tweetherder"  >Meteor is 100% JavaScript, a language pretty much any developer on the planet knows</a>. You can be productive almost immediately.</p>
<h2>Why Would You Not Use Meteor</h2>
<p>Meteor is still extremely experimental. As far as I know, there are no production level apps online. It&#8217;s probably going to be at least a year before you will be able to deploy Meteor apps and sleep at night.</p>

						<div id="pdrp_endAttribution">
						photos by: 
						 
							<a href="http://flickr.com/26782864@N00/2499825928" target="_blank" class="pdrp_link pdrp_attributionLink">
								wwarby</a> & 
							<a href="http://flickr.com/30459997@N07/4941192194" target="_blank" class="pdrp_link pdrp_attributionLink">
								Cesar Rodas</a>
						</div>
					<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamhead.com/meteor-javascript-web-app-platform-lunch-hour-impressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/06/meteor_full_stack_javascript_framework.png" />
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/06/meteor_full_stack_javascript_framework.png" medium="image">
			<media:title type="html">Meteor full stack Javascript framework</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/06/meteor_full_stack_javascript_framework.png" medium="image">
			<media:title type="html">Meteor full stack Javascript framework</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/07/its_turtles_all_the_way_down.jpg" medium="image">
			<media:title type="html">It&#8217;s Turtles All The Way Down</media:title>
			<media:description type="html">No, not turtles, to develop in Meteor, you'll only need to know JavaScript.</media:description>
			<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/07/its_turtles_all_the_way_down-300x250.jpg" />
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/07/mongodb.jpg" medium="image">
			<media:title type="html">MongoDB cup &#038; cards</media:title>
			<media:description type="html">If you're used to SQL, you'll find MongoDB's API very refreshing.</media:description>
			<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/07/mongodb-300x250.jpg" />
		</media:content>
	</item>
		<item>
		<title>The Opa Web Application, Lunch Hour Experiments</title>
		<link>http://www.streamhead.com/opa-web-application-platform-lunch-hour-experiment/</link>
		<comments>http://www.streamhead.com/opa-web-application-platform-lunch-hour-experiment/#comments</comments>
		<pubDate>Wed, 13 Jun 2012 14:00:32 +0000</pubDate>
		<dc:creator>Peter Backx</dc:creator>
				<category><![CDATA[Java and JavaScript]]></category>

		<guid isPermaLink="false">http://www.streamhead.com/?p=3478</guid>
		<description><![CDATA[&#8220;Another day, another framework&#8221;, you might think. And yes, Opa is yet another web framework that is going to revolutionize web development. But don&#8217;t judge it too soon, it has a few tricks up its sleeve that might convince you to try it out. Read on for my first hour of Opa. This is a [...]<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></description>
				<content:encoded><![CDATA[<p>&#8220;Another day, another framework&#8221;, you might think. And yes, Opa is yet another web framework that is going to revolutionize web development. But don&#8217;t judge it too soon, it has a few tricks up its sleeve that might convince you to try it out. Read on for my first hour of Opa.</p>
<p><span id="more-3478"></span></p>
<p>This is a first in what I hope will become a regular feature: I give myself one hour to try out something new and decide whether I will pursue it or not. Feel free to send any suggestions my way.</p>
<h2>First Impressions and How to Deploy</h2>
<p>I love to try out new technology for pet projects and one thing I always worry about is small scale, cheap deployment. I could not find anywhere on the site how you&#8217;d deploy Opa. Is there support for PaaS providers like Heroku? It appears not, you need to have access to and full control over your own VPS (there&#8217;s some limited information on AWS)</p>
<h2>OCaml</h2>
<p><div id="attachment_3487" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-3487" title="opa accordian" src="http://www.streamhead.com/wp-content/uploads/2012/06/opa_accordian-300x196.jpg" alt="" width="300" height="196" /><p class="wp-caption-text">Opa is Dutch for grandfather</p></div></p>
<p>I don&#8217;t understand why the website says the Opa language is JavaScript-like. As soon as you start writing your own thing, you&#8217;ll notice there are some major differences between Opa and JavaScript, so be prepared to learn a new language</p>
<p>Opa is based on OCaml, an objective functional language that has been around for a while and seems to mostly live inside academiccircles.. <a href="http://www.cis.upenn.edu/~dsl/PLAN/">I first used it in 2000</a>, the memories <img src='http://www.streamhead.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Windows Version</h2>
<p>I tried the all-in-one Windows installer.</p>
<p>It automatically installs a plugin for Sublime Text. The plugin itself has a build-in mini tutorial. Which is nice if you&#8217;re a Sublime Text 2 user. Keep in mind that your Opa file must be in the root of the folder tree, otherwise the run command won&#8217;t find the correct file. The plugin also couldn&#8217;t kill the processes it started, which made the build/run integration useless.</p>
<p>Later on, I also discovered that the installer had deleted my path setting. I assume this is a small bug that will be solved in the next release.</p>
<h2>HTML and NoSQL</h2>
<p>Opa only supports NoSQL databases and I have a feeling you&#8217;re in for a lot of hurt if you try to connect to a relational one.</p>
<p>HTML doesn&#8217;t need to be quoted and the compiler checks for correctly closed tags. That&#8217;s pretty cool.</p>
<h2>Type System</h2>
<p><div id="attachment_3489" class="wp-caption alignleft" style="width: 310px"><img class="size-medium wp-image-3489" title="TYPE+" src="http://www.streamhead.com/wp-content/uploads/2012/06/type-300x225.jpg" alt="" width="300" height="225" /><p class="wp-caption-text">Static typing without the overhead</p></div></p>
<p>Opa uses static typing with type inference which made me think of Scala: it gets out of your way, but it&#8217;s there if you mess up. It&#8217;s probably a great feature if you are used to static typed languages but may be an annoyance if you are not.</p>
<h2>Client/Server</h2>
<p><a href="http://hello-opa.tutorials.opalang.org/">Running the Hello world counter example</a> and clicking on the header results in 5 POSTS. The last running to closed. Probabfurthers ever push communication. 5 posts just to transmit one number worries me. It&#8217;s also all Ajax, so no SEO here.</p>
<p>I tried to add the &#8220;server&#8221; keyword in front of the &#8220;page&#8221; function, but that did not remove the ajax updates. I suppose it&#8217;s a little too early for that but <a href="http://doc.opalang.org/manual/A-tour-of-Opa/A-single-language">the documentation seems to indicate that this forces function to run on the server</a>.</p>
<p>The first tutorial is a chat application. I can understand that this is a great demonstration of the language and API, but this is an application only 1% (or less) of the developers ever needs to write.</p>
<p>The chat application is concise, yet I can&#8217;t help but ask myself how you&#8217;d ask a web designer to work on this project. You could argue that CSS is all he needs, but in practice it very rarely works like that. Maybe there&#8217;s a way to externalize the HTML in seperate Opa files (like you&#8217;d split a PHP app in a controlling part and a template part, even though both are technically PHP files) Going over the table of contents, I can&#8217;t really see this explained anywhere</p>
<h2>Integration</h2>
<p>Going to the wiki example, I learn that aside from Bootstrap, also Markdown is built into the API. This is nice. I&#8217;ve always liked Markdown as a simple language for creating content. This has me <a href="http://doc.opalang.org/api">browsing the API documentation</a>, where I also see support for Google Charts, Canvas, Facebook and Twitter. And I also scroll past a &#8220;template&#8221; package, so my fears from the previous paragraph seem to be unfounded.</p>
<h2>Wrapping Up</h2>
<p><div id="attachment_3491" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-3491" title="313/365 Wrapping Up" src="http://www.streamhead.com/wp-content/uploads/2012/06/313365_wrapping_up-300x199.jpg" alt="" width="300" height="199" /><p class="wp-caption-text">An hour is too short</p></div></p>
<p>Because I&#8217;m nearing the end of my one hour, I quickly scoop over the rest of the documentation. I do encounter a more detailed explanation of the client/server keywords and their usage. If I pick up Opa for a new project in the future, it will probably be the first thing I&#8217;ll read.</p>
<p>The one thing that keeps bugging me is the absence of any information on deploying. <a href="http://doc.opalang.org/manual/Hello--scalability">The Scalability chapter</a> touches on this, but it&#8217;s very unclear to me. Probably because I&#8217;m too impatient and I should just try it out. From what I understand the &#8220;opa-cloud&#8221; application will distribute your application over SSH. However, does this also work between operating systems (the command lines presented seem to indicate that it just copies the &#8220;exe&#8221; file that was produced).</p>
<p>Throughout the entire hour, I also can&#8217;t help but think &#8220;Why bother learning Opa, when Node.JS offers a fairly similar model in a language all developers already know&#8221;. <a href="http://www.developer.com/open/node.js-opa-javascript-framework.html">It&#8217;s a valid question and others have looked at it in much more detail</a>. One of the most important things I picked up from that test was how concise Opa applications seem to be. This is probably related to its OCaml heritage.</p>
<h2>Why would you use Opa?</h2>
<p>You can write all of the code for your web application in one concise and type-safe language. Out-of-the-box Opa supports an interesting selection of integrations and its first-class language support for HTML and NoSQL databases is top notch.</p>
<h2>Why would you not use Opa?</h2>
<p>You just want to get started and don&#8217;t feel like learning a new language. You prefer a large community backing your choice framework.</p>
<h2>More resources</h2>
<ul>
<li><a href="http://stackoverflow.com/questions/tagged/opa">Opa questions at StackOverflow</a></li>
<li><a title="The Opa blog" href="http://blog.opalang.org/">The Opa blog</a></li>
<li><a href="http://www.amazon.com/Practical-OCaml-Joshua-B-Smith/dp/159059620X?SubscriptionId=AKIAIXG5C7XJL5DE6CZA&tag=streamhead-20" target="_blank" rel="nofollow" title="" >Practical OCaml, the base for Opa</a></li>
</ul>

						<div id="pdrp_endAttribution">
						photos by: 
						 
							<a href="http://flickr.com/79908182@N00/6923195025" target="_blank" class="pdrp_link pdrp_attributionLink">
								smoorenburg</a> & 
							<a href="http://flickr.com/52085220@N00/3045432776" target="_blank" class="pdrp_link pdrp_attributionLink">
								welcometoalville</a>,
							<a href="http://flickr.com/48778414@N04/6354083681" target="_blank" class="pdrp_link pdrp_attributionLink">
								thebarrowboy</a>
						</div>
					<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamhead.com/opa-web-application-platform-lunch-hour-experiment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/06/opa_accordian-300x250.jpg" />
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/06/opa_accordian.jpg" medium="image">
			<media:title type="html">opa accordian</media:title>
			<media:description type="html">Opa is Dutch for grandfather</media:description>
			<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/06/opa_accordian-300x250.jpg" />
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/06/type.jpg" medium="image">
			<media:title type="html">TYPE+</media:title>
			<media:description type="html">Static typing without the overhead</media:description>
			<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/06/type-300x250.jpg" />
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/06/313365_wrapping_up.jpg" medium="image">
			<media:title type="html">313/365 Wrapping Up</media:title>
			<media:description type="html">An hour is too short</media:description>
			<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/06/313365_wrapping_up-300x250.jpg" />
		</media:content>
	</item>
		<item>
		<title>Developing Node.JS Applications on Virtualbox Tutorial</title>
		<link>http://www.streamhead.com/developing-nodejs-applications-virtualbox/</link>
		<comments>http://www.streamhead.com/developing-nodejs-applications-virtualbox/#comments</comments>
		<pubDate>Tue, 29 May 2012 13:54:51 +0000</pubDate>
		<dc:creator>Peter Backx</dc:creator>
				<category><![CDATA[Java and JavaScript]]></category>

		<guid isPermaLink="false">http://www.streamhead.com/?p=3449</guid>
		<description><![CDATA[While the Node.JS community is quickly evolving all the libraries and making your life as a developer easier every day. One thing you read little about, is the development environment. Every one uses their own cobbled together thing. To get you started with Node.JS, this post is a step by step guide to creating a [...]<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></description>
				<content:encoded><![CDATA[<img width="300" height="250" src="http://www.streamhead.com/wp-content/uploads/2012/05/nodejs_on_virtualbox.png" class="attachment-post-thumbnail wp-post-image" alt="Node.JS, Heroku &amp; VirtualBox, a match made in heaven" /><p>While the Node.JS community is quickly evolving all the libraries and making your life as a developer easier every day. One thing you read little about, is the development environment. Every one uses their own cobbled together thing. To get you started with Node.JS, this post is a step by step guide to creating a full working and reproducible environment that supports deployment to Heroku.<span id="more-3449"></span><a href="http://www.streamhead.com/tag/virtualbox/">I&#8217;ve previously sung praise for VirtualBox</a>. It&#8217;s a tool that any developer should have. It will allow you to create an environment that&#8217;s easily portable and can be quickly reproduced by any new developer on the team.</p>
<h2>Step 1. Installing the Operating System</h2>
<p>If you&#8217;ve previously created a Linux virtual machine with VirtualBox, you can probably skip this step. But for those new and for my own reference, here are my steps:</p>
<ol>
<li>Download the latest ISO image of your prefered Linux. I usually just go for Ubuntu because it has the largest community and thus the most chance any issues you may encounter have already been solved.</li>
<li>Create a new virtual machine, everything is default, except</li>
<ul>
<li>mount the Ubuntu ISO image on the CD-ROM controller.</li>
<li>create a new automounted shared folder (handy for sending files between both operating systems)</li>
<li>1024 MB of memory is plenty. 512 works too, but it&#8217;s a little more comfortable with some more.</li>
<li>the 8GB hard drive space is plenty for all of Node, an Apache server and one or two database engines. If you are going to install anything more, you&#8217;re either going to have to be careful with space (like removing Libre Office), or just make the virtual hard drive 16GB.</li>
</ul>
<li>Start the new VM</li>
<li>If the CD image is mounted, it should automatically start the Ubuntu installation. This is going to take some time, so grab a coffee.</li>
<li>After your first boot in your newly installed VM, first open the update manager and update everything. At least if you intend on keeping your VM up-to-date, if not, it&#8217;s probably best to disable to automated update checks.</li>
<li>For Heroku, Github, etc access, you should also generate a public/private key pair:</li>
<ul>
<li>ssh-keygen -t rsa</li>
</ul>
<li>Feel free to install any editor you like. Depending on my mood, I use VIM or <a title="Geany: text editor and ide" href="http://www.geany.org/">Geany</a>.</li>
</ol>
<h2>Step 2. Integrating Guest and Host</h2>
<p><div id="attachment_3464" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-3464" title="Virtual Reality Center" src="http://www.streamhead.com/wp-content/uploads/2012/05/virtual_reality_center-300x140.jpg" alt="" width="300" height="140" /><p class="wp-caption-text">With VirtualBox you create a virtual computer, completely isolated from your actual PC</p></div><br />
Integration between the Ubuntu guest VM and your host will allow you a few nice perks, like being able to use your full screen, exchange files and even seamlessly integrate both systems (if you like this, it&#8217;s not for every one)</p>
<ol>
<li>Install the VirtualVox Guest Additions from the VirtualBox menu that shows up when your VM is running. Or you can press Host-D (the Host key is associated with the right ctrl button on Windows)</li>
<li>With those additions installed, the shared folder will be mounted. Now you just need to add your user to the correct usergroup so he has access. Open a terminal and type (on the Ubuntu VM):</li>
<ul>
<li>sudo usermod -a -G vboxsf &lt;username&gt;</li>
<li>now logout and log back on</li>
<li>test your share access with &#8220;ls /media/sf_&lt;sharename&gt;&#8221;</li>
</ul>
</ol>
<h2>Step 3. Setting Up and Configuring Node.JS and Heroku</h2>
<p>Now we&#8217;re getting close to getting some actual work done. If you don&#8217;t already have a Heroku account and want to follow along, now is the time to sign up.</p>
<ol>
<li>You can compile Node.JS for yourself. It is a pretty painless operation, but <a href="https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager">via the Ubuntu (well, Debian) package manager it&#8217;s even easier</a>:</li>
<ul>
<li>sudo apt-get install python-software-properties</li>
<li>sudo apt-add-repository ppa:chris-lea/node.js</li>
<li>sudo apt-get update</li>
<li>sudo apt-get install nodejs npm</li>
<li>sudo apt-get install nodejs-dev (Needed for some of the database drivers)</li>
</ul>
<li>Test out your install by creating a helloworld.js that contains:</li>
<ul>
<li>console.log(&#8216;hello world&#8217;)</li>
</ul>
<li>Run: node helloworld.js</li>
<li><a href="https://toolbelt.herokuapp.com/linux">Install the Heroku toolbelt</a></li>
<li>Check the correct installation by login in and adding your key:</li>
<ul>
<li>heroku login</li>
<li>heroku keys:add ~/.ssh/id_rsa.pub</li>
</ul>
<li>And configure your default git e-mail and name:</li>
<ul>
<li>git config &#8211;global user.name &#8220;&lt;username&gt;&#8221;</li>
<li>git config &#8211;global user.email &#8220;&lt;useremail&gt;&#8221;</li>
</ul>
</ol>
<h2>Step 4. Creating a Minimal CRUD App</h2>
<p><div id="attachment_3466" class="wp-caption alignleft" style="width: 210px"><img class="size-medium wp-image-3466" title="Create" src="http://www.streamhead.com/wp-content/uploads/2012/05/create-200x300.jpg" alt="" width="200" height="300" /><p class="wp-caption-text">CRUD = Create Read Update Delete</p></div><br />
You&#8217;re now ready to start developing and deploying your Node.JS application. I like to use <a title="RailwayJS" href="http://railwayjs.com/">RailwayJS</a> to get a head start, but there are many many other options.</p>
<ul>
<li>sudo npm install railway -g</li>
<li>sudo npm install coffee-script -g (avoids having to download this for every railway applications)</li>
<li>railway init blog &amp;&amp; cd blog</li>
<li>npm install -l</li>
<li>railway generate crud post title content</li>
<li>railway server 8888</li>
<li>open http://127.0.0.1:8888/posts</li>
</ul>
<p>This will set you up with a minimal CRUD application that uses an in-memory store for all storage.</p>
<h2>Step 5. Configuring &amp; Deploying to Heroku</h2>
<p>Before deploying, there are a few steps and tweaks you will want to make.</p>
<p>Adding a Redis session store:</p>
<ul>
<li>
<div>sudo apt-get install redis-server</div>
</li>
<li>add&#8221;connect-heroku-redis&#8221; : &#8220;&gt;= 0.1.2&#8243; in your package.json</li>
<li>in the config/environment.js file:</li>
<ul>
<li>HerokuRedisStore = require(&#8216;connect-heroku-redis&#8217;)(express);</li>
<li>app.use(express.session({secret: &#8216;secret&#8217;, store: new HerokuRedisStore }));</li>
</ul>
<li>You may want to replace the secret!</li>
</ul>
<p>Make sure you are using the latest Node version on Heroku, by adding the following to your package.json:</p>
<ul>
<li>
<div>&#8220;engines&#8221; : { &#8220;node&#8221; : &#8220;0.6.x&#8221; }</div>
</li>
</ul>
<p>You probably want to have git ignore the node_modules folder:</p>
<ul>
<li>
<div>echo node_modules &gt; .gitignore</div>
</li>
</ul>
<p>Set up Heroku as the production environment:</p>
<ul>
<li>
<div>heroku config:add NODE_ENV=production</div>
</li>
<li>But disable file logging in the Railwayjs production.js file: remove the line &#8220;app.settings.quiet=true&#8221;</li>
</ul>
<p>I&#8217;m keeping the database configuration for another post, because there&#8217;s just so much choice. But both MongoDB and PostgreSQL can be tested out for free on Heroku and are fairly easy to configure.</p>
<p>The actual deployment looks like this:</p>
<ul>
<li>git init</li>
<li>git add .</li>
<li>git commit -m &#8220;first version&#8221;</li>
<li>heroku create &#8211;stack cedar</li>
<li>heroku addons:add redistogo:nano</li>
<li>git push heroku master</li>
<li>heroku ps:scale web=1</li>
<li>heroku open</li>
</ul>
<p>This should bring up a browser with your deployed application.</p>
<p>During actual development the deployment flow is as simple as:</p>
<ul>
<li>git add &lt;changed file&gt;</li>
<li>git commit -m &#8220;commit message&#8221;</li>
<li>git push heroku master</li>
</ul>
<h2>Conclusion</h2>
<p>A reliable development environment is the best guarantee that you&#8217;ll not only experiment with Node.JS, but also actually get some work done. Developing in Node will bring back the programmer&#8217;s joy you felt before enormous frameworks and gigantic API&#8217;s.</p>
<div class="buynow">If you want a little more assistance, I currently have a special offer running: <a title="dirt cheap node.js web app" href="http://www.streamhead.com/dirt-cheap-node-js-web-apps/">A prototype Node.JS CRUD app for virtually nothing. If you want to get started even faster, check it out</a>.</div>

						<div id="pdrp_endAttribution">
						photos by: 
						 
							<a href="http://flickr.com/31378238@N00/810800207" target="_blank" class="pdrp_link pdrp_attributionLink">
								Daneel Ariantho</a> & 
							<a href="http://flickr.com/50421865@N06/6546499501" target="_blank" class="pdrp_link pdrp_attributionLink">
								Warron Bebster</a>
						</div>
					<p><a href="http://www.streamhead.com/">Also check out the new Getting Started with Web Apps guide.</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.streamhead.com/developing-nodejs-applications-virtualbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/05/nodejs_on_virtualbox.png" />
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/05/nodejs_on_virtualbox.png" medium="image">
			<media:title type="html">Node.JS, Heroku &#38; VirtualBox, a match made in heaven</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/05/nodejs_on_virtualbox.png" medium="image">
			<media:title type="html">Node.JS, Heroku &#38; VirtualBox, a match made in heaven</media:title>
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/05/virtual_reality_center.jpg" medium="image">
			<media:title type="html">Virtual Reality Center</media:title>
			<media:description type="html">With VirtualBox you create a virtual computer, completely isolated from your actual PC</media:description>
			<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/05/virtual_reality_center-300x250.jpg" />
		</media:content>
		<media:content url="http://www.streamhead.com/wp-content/uploads/2012/05/create.jpg" medium="image">
			<media:title type="html">Create</media:title>
			<media:description type="html">CRUD = Create Read Update Delete</media:description>
			<media:thumbnail url="http://www.streamhead.com/wp-content/uploads/2012/05/create-300x250.jpg" />
		</media:content>
	</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.759 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-10 18:48:27 -->

<!-- Compression = gzip -->