<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.6(BH)" -->
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Blog</title>
        <description></description>
        <link>http://nemein.com/fi/blog/</link>
        <lastBuildDate>Mon, 20 May 2013 07:27:35 +0000</lastBuildDate>
        <generator>FeedCreator 1.7.6(BH)</generator>
        <item>
            <title>Automated linking with rich text editors</title>
            <link>http://nemein.com/fi/blog/automated_linking_with_rich_text_editors/</link>
            <description><![CDATA[
<p>The web is built of links, of pages linking to other resources on the internet. But making those links manually is tedious. This is another area where <a href="http://createjs.org">modern inline editors</a> could do better.</p>

<p>Yesterday on Hacker News, there was a thread about <a href="http://www.wikidata.org">Wikidata</a>, Wikimedia Foundation's new knowledge base. <a href="https://news.ycombinator.com/item?id=5627968">This comment</a> struck me especially:</p>

<blockquote><p>I was using Wikipedia the other day and it occurred to me how primitive it is to have all the inner links to other Wikipedia articles defined manually, surely these should have been automated by now (i.e., marking a word or two would link you to the relevant article).</p></blockquote>

<p>And indeed, this is a usability problem that can already be fixed with the <a href="http://viejs.org/">Semantic Interaction stack</a> underneath Create.js.</p>

<h2>Introducing Annotate.js</h2>

<p><strong><a href="https://github.com/szabyg/annotate.js">Annotate.js</a></strong> is a VIE widget built by Szaby Grünwald. It works very similarly to a spell checker in traditional text editors &mdash; you write text, and it highlights the potential entities you might want to link to. You then can either accept or decline these link suggestions by clicking them. In case of multiple potential matches, you can also disambiguate between them by selecting from an offered list.</p>

<p><a href="http://www.youtube.com/watch?v=zAMUpd6rb9k&amp;feature=share&amp;list=UUnPE7t9tqwcsO0LLyw5zuPQ">Here is a quick video</a> of Annotate.js in action:</p>

<iframe width="560" height="315" src="http://www.youtube.com/embed/zAMUpd6rb9k?list=UUnPE7t9tqwcsO0LLyw5zuPQ" frameborder="0" allowfullscreen></iframe>


<p>You can also try it yourself <a href="http://szabyg.github.io/annotate.js/">with an online demo</a>.</p>

<p>Currently Annotate.js <a href="https://github.com/bergie/hallo/blob/master/src/plugins/annotate.coffee">has been integrated</a> with the <a href="http://hallojs.org">Hallo rich text editor</a>, but it would be easy to do the same with other popular editors like Aloha and CKEditor.</p>

<h2>Connecting to entities</h2>

<p>The big question with automatic linking is <em>where the entities come from</em>. There are services like <a href="http://www.opencalais.com/">OpenCalais</a> that can provide these suggestions for your content, but most of them are focused only on shared knowledge bases of big companies, famous people, and major cities.</p>

<p>Unless you're running a newspaper, it is unlikely that these are the things your content is about.</p>

<p><strong><a href="http://stanbol.apache.org/">Apache Stanbol</a></strong> is an open source engine that can provide the enhancements for you. Out of the box it provides suggestions based on the Wikipedia knowledge repository. But more importantly, you can feed it with your own entities.</p>

<p>This way the enhancements you get for your content can be tuned to be meaningful to your content and your audience. If you write about medicine, they could be about symptoms and diseases, or if you're writing about technology, they could be specific open source projects and their contributors. With Stanbol, the choice is yours.</p>

<p>The current downside of Stanbol is that you'll have to run it yourself, but there may be <a href="http://signup.redlink.co/">solutions coming for that as well</a>.</p>

<h2>Beyond editing</h2>

<p>Like <a href="http://bergie.iki.fi/blog/never-lose-content/">never losing your content</a> or <a href="http://bergie.iki.fi/blog/create-collections/">managing collections</a>, Annotate.js shows what we can do to improve the editing experience when we interact with it in a <em>semantically meaningful</em> manner.</p>

<p>What Annotate.js does is not merely creating links, but it also marking the machine-readable relationship between them and the HTML content being edited. This can then be used by yet another set of tools &mdash; like search engines &mdash; to understand and organize the content better.</p>

<p>It is easy to see Create.js (like Drupal did, <a href="http://drupal.org/node/1979784">unfortunately</a>) as just an easy way to add nice inline editing features to your CMS. However, while that is a good initial step, the addition of being able to interact with your content on the semantic level can do a lot more. Automated linking is just another demonstration of that.</p>

<p>As the ecosystem around Create.js and VIE matures, and it ships in more systems, there will be things that we can't even imagine now built on the stack.</p>

<p>If your CMS is <a href="http://bergie.iki.fi/blog/decoupling_content_management/">properly decoupled</a>, you can benefit from that immediately.</p>
]]></description>
            <author>henri.bergius@nemein.com (Henri Bergius)</author>
            <category>feed:e1ac443192c214d3dd05c950b16e0929</category>
            <pubDate>Tue, 30 Apr 2013 07:00:00 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e2b189723e5c42b18911e2859c0515f2adfbd1fbd1</guid>
        </item>
        <item>
            <title>Working on an Android tablet: first six weeks</title>
            <link>http://nemein.com/fi/blog/working_on_an_android_tablet-first_six_weeks/</link>
            <description><![CDATA[
<p>I've been <a href="http://bergie.iki.fi/blog/working-on-android/">working full time on my Android workstation</a> for over a month now, and it is time to write an update about it. How has it worked out?</p>

<h2>What I've been doing</h2>

<p>I would love to tell stories of working from parks and cafes, like <a href="http://yieldthought.com/post/31857050698/ipad-linode-1-year-later">Mark O'Connor has on his iPad setup</a>, but unfortunately we had a backlash of winter here in Berlin and the warm spring weather only came back this week.</p>

<p>Instead &mdash; <a href="http://bergie.iki.fi/blog/all-you-need-is-good-backpack/">quite atypically</a> &mdash; I've been mostly desk-bound in this time. The <a href="http://iks-project.eu">EU projects</a> that mandated a lot of travel have now ended, and my current projects are more about software development than evangelism.</p>

<p>But that actually makes this experiment even more useful, as it means most of the six week has been actual programming, which is what most of my readers also do.</p>

<p>For those who missed my setup in <a href="http://bergie.iki.fi/blog/working-on-android/">the previous post</a>, this is how it looks in action:</p>

<p><a href="http://bergie.iki.fi/files/nexus10-desk2.jpg"><img src="http://bergie.iki.fi/files/nexus10-desk2-small.jpg" alt="Nexus 10 as a programming workstation" /></a></p>

<p>On-screen are <a href="http://tmux.sourceforge.net/">tmux</a>, <a href="http://www.vim.org/">vim</a>, and a <a href="http://gruntjs.com/">Grunt</a> test automation <a href="https://github.com/gruntjs/grunt-contrib-watch#readme">watcher</a> running inside a <a href="http://mosh.mit.edu/">MOSH client</a>.</p>

<p><a href="http://bergie.iki.fi/files/nexus10-shell.png"><img src="http://bergie.iki.fi/files/nexus10-shell-small.png" alt="Nexus 10 as a programming workstation" /></a></p>

<p>Here are some things I've done in the last month:</p>

<ul>
<li>Porting the <a href="http://noflojs.org">NoFlo flow-based programming engine</a> to run in both browser and Node.js with the same codebase, including a <a href="http://bergie.iki.fi/blog/sharing-javascript-libraries-node-browser/">tutorial on how others can do the same</a></li>
<li>Writing and publishing an implementation of <a href="http://bergie.iki.fi/actionbar/">Android-style Action Bars for web apps</a></li>
<li>Adding multiple major features to the <a href="https://github.com/bergie/noflo-ui">web-based NoFlo IDE</a></li>
<li>Dealing with the issues raised with the release of jQuery UI 1.10 and Backbone 1.0.0 with <a href="http://createjs.org">Create.js</a> and <a href="http://viejs.org">VIE</a></li>
<li>Blogging, including publishing <a href="http://bergie.iki.fi/blog/no-smartphones/">some</a> <a href="http://bergie.iki.fi/blog/wordpress-decoupled/">quite</a> <a href="http://bergie.iki.fi/blog/working-on-android/">popular</a> posts</li>
</ul>


<p>In general the experience has been a positive and productive one. I'll write about some nuances here.</p>

<h2>Web debugging</h2>

<p>As you can see from the list above, much of my recent work has been client-side. With this, the unavailability of web debuggers on mobile browsers can become a problem.</p>

<p>I've tackled this issue in two ways:</p>

<ul>
<li><em>More tests</em>. Instead of poking around in a debugger, I try to write <a href="http://visionmedia.github.io/mocha/">Mocha tests</a> for most aspects of my applications. This also has the benefit of automation, meaning that <a href="http://phantomjs.org/">PhantomJS</a> will test everything in my application every time I commit</li>
<li><em>VNC and desktop browsers</em>. When I really need one, I can still use the web debugging tools of traditional web browsers via VNC</li>
</ul>


<p><a href="http://bergie.iki.fi/files/nexus10-vnc.png"><img src="http://bergie.iki.fi/files/nexus10-vnc-small.png" alt="Web debugging via VNC" /></a></p>

<p><a href="http://yieldthought.com/post/12638596672/setting-up-an-ipad-linode">See Mark O'Connor's setup instructions</a> for VNC on one of these tablet workstation setups.</p>

<h2>Post-PC means post-Office</h2>

<p>One area where tablets are really lacking is support for traditional office tools like word processors and spreadsheets. There is a Google Drive client, but it is very slow (even small spreadsheets can take minutes to load) and mostly non-functional (word processor doesn't even support headlines).</p>

<p>There are also some <a href="http://androidheadlines.com/2012/05/featured-top-10-android-office-suites.html">other office suites</a> available, but even these are better used for viewing documents than actually making changes to them.</p>

<p>But the bigger question is whether traditional office tools even have a place in this modern world. The commentary on constant <a href="http://macsparky.com/blog/2011/11/30/microsoft-office-and-the-ipad.html">delays with Microsoft Office for iOS and Android</a> shows that people don't see them as that relevant any longer:</p>

<blockquote><p>For the longest time, Office was the ubiquitous productivity suite. Everybody used it. Nobody considered using anything else. However, since this mobile revolution started, even non-geeks are starting to question whether Office is still <em>all that</em>. I had breakfast this morning with a CPA who does all of his work in Google docs. There is an entire generation of future workers going through high school and college now who don’t even have Office installed on their computers. If Microsoft has any hopes of keeping Office relevant, it needs to be everywhere, including the iPad.</p></blockquote>

<p>Personally, I might be a lot better off writing my documents in <a href="http://daringfireball.net/projects/markdown/">Markdown</a>, versioning them with git, and maybe using custom data-gathering applications with <a href="http://bergie.iki.fi/blog/business_analytics_with_couchdb_and_noflo/">CouchDB map-reduces for data visualization</a>.</p>

<p>The <a href="http://bergie.iki.fi/blog/tablet-productivity/">story of tablet productivity</a> is still evolving. The new tools and interaction techniques we have will eventually give rise to new kinds of productivity applications. That may signal the end of the Office hegemony.</p>

<h2>Presenting from the tablet</h2>

<p>On the first week of this experiment I was actually traveling. The final review meetings for both of the EU projects were being held in Brussels and Luxembourg, and I had to present our results.</p>

<p>As the presentation tools on Android are not very good, I took this as an opportunity to finally start using an HTML-based presentation system. For this, I picked <a href="http://paulrouget.com/dzslides/">DZSlides</a>, with a custom Jekyll-based flow for constructing slide decks from <a href="https://github.com/bergie/talks">individual assets stored in git</a>.</p>

<p>The results are <a href="http://bergie.iki.fi/talks/2013/jquery-europe/">quite nice</a>, and I love being able to <a href="http://bergie.iki.fi/talks/2013/jquery-europe/#12.0">embed live demos</a> inside the slides.</p>

<iframe src="http://bergie.iki.fi/talks/shells/embedder.html#http://bergie.iki.fi/talks/2013/jquery-europe" width="460" height="345"></iframe>


<p>With every computing platform, there is always some fiddling involved with getting your device connected to a beamer. I was positively surprised with how easily the Nexus 10 worked. Simply connect using a <em>micro-HDMI to VGA</em> adapter, and you'll have the tablet screen up on the projector.</p>

<h2>Minor annoyances</h2>

<p>Everybody knows about the <a href="http://www.businessinsider.com/google-lacking-android-tablet-apps-2012-11">common gripes with Android on large tablets</a> &mdash; most apps have been written with a narrow phone screen in mind, and simply look bad on a wide 10" screen. <a href="https://twitter.com/bergie/status/319710122349838336">Twitter is a good example</a> of the typical neglect of <a href="http://developer.android.com/design/index.html">Android's UI guidelines</a>.</p>

<p>Somewhat surprisingly, this even applies to Google's own tablet applications. Apps like Google+ and Google Drive are a lot more functional on an iPad than on a large Android tablet.</p>

<p>However, these are more of a problem when using something like my <a href="http://www.google.com/nexus/10/">Nexus 10</a> as a <em>media tablet</em>, and don't really affect how well it works as a <em>programming workstation</em>.</p>

<p>For programming work, what matters is things like the beautiful screen, Android's reasonably good support for hardware keyboards, user-accessible file system, and the ability to share information between applications. These are the main reasons why I went with Android instead of an iPad.</p>

<p>However, not all is sunshine. So far, the main annoyances for me have been:</p>

<ul>
<li><a href="https://code.google.com/p/android/issues/detail?id=39665">Regressions in Magic Trackpad support</a> mean that it is practically unusable when you also have a Bluetooth keyboard. A lot of character presses get duplicated, making typing near-impossible. I'm assuming other mouse devices would however work</li>
<li><a href="http://dan.drown.org/android/mosh/">MOSH ConnectBot</a> &mdash; which I'm using for my programming sessions &mdash; makes <a href="https://code.google.com/p/irssi-connectbot/issues/detail?id=26">Ctrl and Esc keys not work</a>. Luckily I was able to <a href="https://code.google.com/p/irssi-connectbot/issues/detail?id=26#c4">find a workaround</a></li>
<li>Android 4.2.2 is buggy on the Nexus 10. Especially <a href="http://forums.androidcentral.com/google-nexus-10-tablet/254863-chrome-causes-my-crashes.html">Chrome can cause the system to crash</a>. Other browsers help here, and hopefully Google will fix the issue soon</li>
</ul>


<p>Now, crashes and freezes may sound like a big deal. But thanks to using <a href="http://tmux.sourceforge.net/">tmux</a>, they just mean a short interruption, and not any lost work. I just restart my tablet or MOSH client, attach back to the tmux session I was working with, and I'm right back to where I was, cursor position, vim splits, and all.</p>

<h2>Quantifying productivity</h2>

<p>Calculating <a href="http://en.wikipedia.org/wiki/Programming_productivity">programming productivity</a> is notoriusly difficult. While <a href="http://yieldthought.com/post/31857050698/ipad-linode-1-year-later">Mark was able to show impressive figures</a> from his iPad setup, I don't have anything similar because:</p>

<ul>
<li>I haven't had the time to <a href="http://yieldthought.com/post/6070927890/metagame-productivity-boost-stats-and-charts">crunch the numbers</a> on the work I do</li>
<li>The ending of the EU projects meant that I'm now doing different things than I did with my laptop, and so comparing results from the two is hard</li>
</ul>


<p>And in the end what matters more is the results of the work, not the effort spent getting there.</p>

<p>But still, it would be good to have a bit more data on how well the setup works besides the subjective "<em>it feels like a good way to program</em>".</p>

<p>To this end, I recently started using the <a href="https://www.rescuetime.com/">RescueTime</a> tracker on both of my Android devices. It keeps calculates how much time I spend with different applications each day, and even allows me to give some sort of productivity scores for them:</p>

<p><a href="http://bergie.iki.fi/files/nexus10-rescuetime.png"><img src="http://bergie.iki.fi/files/nexus10-rescuetime-small.png" alt="Scoring applications on RescueTime" /></a></p>

<p>I'll be running this for a while, and will try to combine it with some statistics from <a href="https://github.com/bergie">my GitHub account</a>. Those two should be able to paint a picture of how I work.</p>

<h2>Conclusions</h2>

<p>In the beginning, like with any new tool you have to start using, the Android tablet setup felt weird and limiting. But it has grown on me since, and right now <em>I'm not regretting giving my laptop away.</em></p>

<p>But at the same time, if a new interesting device came out, the cost of switching to that would be minimal. After all, the Nexus 10 for me is essentially just a window into the web and my terminal running somewhere else.</p>

<p>In a way this decoupling is similar to the traditional desktop PC setup where you have a separate computer, screen, mouse, and a keyboard. The difference here is that none of those parts are bound to a desk or connected with cables. Instead, the peripherals talk with my screen over Bluetooth, and my screen with the "computer" over the Internet.</p>

<p>If I for instance want a <a href="http://matias.ca/laptoppro/mac/">better keyboard</a>, I can just buy one and replace that part without having to change anything else with my setup.</p>

<h3>Cost advantage</h3>

<p>One aspect that people have remarked on is cost. Over the course of two years &mdash; which is the typical replacement cycle of a professional workstation &mdash; this setup is cheaper than a <a href="http://bergie.iki.fi/blog/11-macbook_air-the_best_computer_i-ve_ever_had/">MacBook Air</a>. And with that price I get a lot better screen and about double battery life, and even a smartphone.</p>

<p>What I lose is the ability to work fully offline, though somewhat alleviated by having local vim and git via <a href="https://play.google.com/store/apps/details?id=com.spartacusrex.spartacuside&amp;hl=en">Terminal IDE</a>.</p>

<h3>Moving forward</h3>

<p>The experiment will keep continue. In these six weeks, I haven't seen any negative impact on my productivity from working on an Android tablet instead of a laptop, and many positive ones. <em>Portability, battery life, and the emphasis on tests and automation</em> are probably the foremost.</p>

<p>Of course, new devices come to the market, and eventually something will come that beats the current setup. But then I'll be able to switch without even losing my cursor position, so the only cost is the hardware itself.</p>

<p>In time, I will write more about how things are going.</p>
]]></description>
            <author>henri.bergius@nemein.com (Henri Bergius)</author>
            <category>feed:e1ac443192c214d3dd05c950b16e0929</category>
            <pubDate>Tue, 16 Apr 2013 07:00:00 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e2a6aaa6e76324a6aa11e2a1930b3961ee3d323d32</guid>
        </item>
        <item>
            <title>Writing reusable, multi-platform JavaScript with Component</title>
            <link>http://nemein.com/fi/blog/writing_reusable-multi-platform_javascript_with_component/</link>
            <description><![CDATA[
<p>I'm currently in the process of porting the <a href="http://noflojs.org">NoFlo</a> Flow-Based Programming environment to run also in the browser. While there are some obvious differences in things like filesystem interaction and component loading, the goal here is to reuse as much of the same code as possible between these two platforms.</p>

<p>Many of the building blocks are already in place, and so the port should be complete still this week. You can track the work in <a href="https://github.com/bergie/noflo/issues/63">issue 63</a>.</p>

<h2>A fragmented ecosystem</h2>

<p>The current client-side JavaScript ecosystem is quite fragmented. While on general level any code can be used anywhere, there are many different approaches at packaging, code loading, and templating. In many ways this resembles the PHP landscape before <a href="http://bergie.iki.fi/blog/composer_solves_the_php_code-sharing_problem/">Composer solved the problem there</a>.</p>

<p>On Node.js we haven't had this problem for a while, as <a href="https://npmjs.org/">NPM</a> provides an excellent way to share and install code. With more than 27000 modules available, it is truly the default solution for JavaScript package management server-side. Some frameworks like Meteor tried to deviate from this by introducing their own package managers, but eventually <a href="http://meteor.com/blog/2013/04/04/meteor-060-brand-new-distribution-system-app-packages-npm-integration">came back to the fold</a>.</p>

<h3>Module definitions</h3>

<p>There are many different ways for handling loading and encapsulation of JavaScript code. The <a href="http://www.adequatelygood.com/JavaScript-Module-Pattern-In-Depth.html">module pattern</a> is quite popular building block. Many also expose their code as <a href="http://plugins.jquery.com/">jQuery plugins</a> even though that really only makes sense or DOM handling.</p>

<p>Here is how you would define a jQuery plugin:</p>

<pre><code>(function ($) {
  $.fn.somePlugin = function () {
    // some code here
  };
})(jQuery);
</code></pre>

<p>Some efforts towards standardization have been made, including the <a href="http://requirejs.org/docs/whyamd.html">Asynchronous Module Definition</a> spec, and the synchronous <a href="http://dailyjs.com/2010/10/18/modules/">CommonJS module</a> spec that Node.js also uses.</p>

<p>Here is how an AMD wrapper for code looks like:</p>

<pre><code>define('somePlugin', ['jquery'], function ($) {
  return function () {
    // some code here
  };
});
</code></pre>

<p>The CommonJS definition for something similar would be the following. This will look familiar to Node.js developers:</p>

<pre><code>var $ = require('jquery');
exports.someFunction = function () {
  // some code here
});
</code></pre>

<p>Harmony is the proposed next generation of the JavaScript language, and it includes a <a href="http://wiki.ecmascript.org/doku.php?id=harmony:modules">new module syntax</a>:</p>

<pre><code>module 'myModule' {
  import 'jquery' as $;
  export function someFunction () {
    // some code here
  }
}
</code></pre>

<p>It is no wonder many developers feel a bit lost on how they should expose their code or widgets!</p>

<p>The Harmony module spec may eventually harmonize this, but it will take a while before you can actually ship code like that for even a reasonably majority of browsers.</p>

<h3>Module installation and loading</h3>

<p>Once you've picked the module pattern to follow, the next question is how to actually get your dependencies installed.</p>

<p>The traditional way is to fetch "known good" versions of the libraries, add them to your project repository, and then just include each library with its own <code>script</code> tag. But this means having to maintain all the libraries in your own project, and cluttering your repository and change log with them.</p>

<p>A variant of this is loading common libraries from a Content Delivery Network <a href="https://developers.google.com/speed/libraries/">like Google</a>. This has the advantage that your users won't have to download something like jQuery separately from each web server, and that you don't need to duplicate the library files in your own code repository. But at the same time, this relies on the CDN provider not breaking things, and complicates offline usage.</p>

<p>And you still have to write <code>script</code> tag for each of them.</p>

<h4>Bower</h4>

<p>Twitter's <a href="http://twitter.github.io/bower/">Bower package manager</a> aims to help with dependency management. You declare the libraries your code needs in a <code>component.json</code> file, run Bower, and you'll get the correct versions downloaded to your system.</p>

<p>Bower only handles dependency resolution and downloading, and so you'll still be writing <code>script</code> tags for all modules you installed. But at least this allows you to keep the library files out of your repository.</p>

<h4>Require.js and volo</h4>

<p>The <a href="http://requirejs.org/">Require.js</a> project seeks to solve this by handling module loading for you in an automated manner. They even provide the <a href="http://volojs.org/">volo package manager</a> for installing all the libraries you need.</p>

<p>Require.js is a quite popular way of solving this, but means that you will need to follow the Asynchronous Module Definition specification with your code.</p>

<h4>Component</h4>

<p><a href="https://github.com/component/component">Component</a> is a newer solution for this started by TJ Holowaychuk of <a href="http://expressjs.com">Express</a> and <a href="http://visionmedia.github.io/mocha/">Mocha</a> fame.</p>

<p>The system is explained a lot better in <a href="http://tjholowaychuk.com/post/27984551477/components">the introductory blog post</a>, but in nutshell Component is a combination of a package manager and a module loading system based on CommonJS.</p>

<p>With Component you can easily write and distribute reusable JavaScript modules, including user interface components that may include HTML templates and CSS. There is a <a href="http://tjholowaychuk.com/post/37832588021/building-a-date-picker-component">component writing tutorial</a> available.</p>

<p>The Component installer will pull all the dependencies for you, and construct a single, easy-to-include JavaScript file out of them and your own code. <em>If you want to think of it in that way, this is sort of similar to <a href="http://getcomposer.org/doc/01-basic-usage.md#autoloading">Composer generating an autoload file</a> for PHP code</em>.</p>

<h3>Which to choose?</h3>

<p>Given the multitude of options available, it can be <a href="http://stackoverflow.com/questions/14967521/what-is-the-difference-between-component-and-bower">hard to choose</a> which one to go with. Eventually a winner may emerge, but in the meanwhile, my approach is the following:</p>

<ul>
<li><strong>Component</strong> for client-side libraries and widgets</li>
<li><strong>NPM</strong> for Node.js libraries</li>
</ul>


<p>If I was just writing client-side code, Require.js and volo may have been just as good option, at least if I want to deal with AMD.</p>

<p>However, the big advantage of Component is that it is based on CommonJS modules, which Node.js also uses. With it, I can share library code a lot more easily between browser and the server, the two main platforms of the <a href="http://bergie.iki.fi/blog/the_universal_runtime/">Universal Runtime</a>.</p>

<p><em>CommonJS modules run nicely in the browser, on Node.js, and <a href="http://en.wikipedia.org/wiki/Comparison_of_server-side_JavaScript_solutions">other server-side JavaScript runtimes</a>.</em></p>

<h2>Writing a multi-platform library</h2>

<p>Writing widgets with Component is covered nicely in the <a href="http://tjholowaychuk.com/post/37832588021/building-a-date-picker-component">building a date picker component</a> tutorial, and so I'm focusing on how to build more general-purpose libraries here.</p>

<h3>Getting Component</h3>

<p>The first step with Component is getting the tooling in place. Component &mdash; like most of the JavaScript dependency managers &mdash; is written on top of <a href="http://nodejs.org/">Node.js</a>. It would be possible to implement the <a href="https://github.com/component/component/wiki/Spec">Component spec</a> in other languages for easier integration in their native toolchain, but for now Node.js is what you must install.</p>

<p>Once you have Node.js running, getting the Component tools is easy:</p>

<pre><code>$ sudo npm install -g component
</code></pre>

<p>This will give you the <code>component</code> command. You can run it to see the functionality it provides.</p>

<h3>Finding dependencies</h3>

<p>The next step is to find the libraries you need. Quite a lot of libraries and widgets are already available, and can be found from <a href="https://github.com/component/component/wiki/Components">the Component Wiki</a>.</p>

<p>You can also use the Component command to look up modules:</p>

<pre><code>$ component search underscore

component/underscore
url: https://github.com/component/underscore
desc: JavaScript's functional programming helper library.

nathan7/memoize
url: https://github.com/nathan7/memoize
desc: underscore's memoize
</code></pre>

<p>As you can see, the components use a "GitHub-like" naming scheme of <code>&lt;vendor&gt;/&lt;module&gt;</code>. This is again similar to vendor names in Composer:</p>

<blockquote><p>The package name consists of a vendor name and the project's name. Often these will be identical - the vendor name just exists to prevent naming clashes. It allows two different people to create a library named json, which would then just be named igorw/json and seldaek/json.</p></blockquote>

<p>Since <a href="http://noflojs.org">NoFlo</a> relies heavily on Node's <a href="http://nodejs.org/api/events.html">event API</a>, we need to find an equivalent library for Component. After a quick look through <code>component search events</code>, it turns out <a href="https://github.com/component/emitter">component/emitter</a> does the job.</p>

<h3>The component.json file</h3>

<p>Each Component module must provide a <code>component.json</code> file where you declare things like the name of the package, the version number, the software license, the files provided, and the possible dependencies. This is quite similar to the <a href="http://package.json.nodejitsu.com/">package.json file in NPM</a>.</p>

<p>I'm using a very simplified version of NoFlo's Graph class as the example here, so I can call the library <code>bergie/graph</code>. Like most JavaScript libraries, this will be under the <a href="http://en.wikipedia.org/wiki/MIT_License">MIT license</a>.</p>

<pre><code>{
  "name": "graph",
  "repo": "bergie/graph",
  "description": "Simple graph class",
  "license": "MIT",
  "version": "1.0.0",
  "scripts": [
    "graph.js"
  ],
  "dependencies": {
    "component/emitter": "*"
  }
}
</code></pre>

<p>For Node.js support you'll also need a corresponding <code>package.json</code> file:</p>

<pre><code>{
  "name": "graph",
  "description": "Simple graph class",
  "main": "./graph.js",
  "version": "1.0.0"
}
</code></pre>

<p>Once the dependencies are declared, run the installation:</p>

<pre><code>$ component install
</code></pre>

<p>The example only uses Node.js's built-in libraries, so NPM installation is not yet needed. If you add third-party libraries, you need to install them also:</p>

<pre><code>$ npm install
</code></pre>

<h3>Module code</h3>

<p>Writing a Component module is very similar to writing Node.js modules. Create the file we just declared in the JSON file and open it in your favourite editor.</p>

<p>Since we're aiming for multi-platform code, the main difference is dealing with platform-specific differences. For example, the event emitter library in Node.js is called <code>events</code>, and the Component equivalent is called <code>emitter</code>.Luckily their APIs are exactly the same, so we only have to do loading conditionally:</p>

<pre><code>var EventEmitter;
if (typeof process === 'object' &amp;&amp; process.title === 'node') {
  // Node.js
  EventEmitter = require('events').EventEmitter;
} else {
  // Browser
  EventEmitter = require('emitter');
}
</code></pre>

<p>This way, we have the correct event emitter implementation available for our code. Now we just create a constructor function to inherit from that:</p>

<pre><code>// The constructor, just call "super"
function Graph () {
  this.nodes = [];
  EventEmitter.call(this);
}

// Set up inheritance
Graph.prototype = Object.create(EventEmitter.prototype);

// Define methods
Graph.prototype.addNode = function (name) {
  this.nodes.push(name);
  this.emit('node', name);
};
</code></pre>

<p>Once the code is there, we need to expose it as a CommonJS module:</p>

<pre><code>module.exports = Graph;
</code></pre>

<h3>Running the module in Node.js</h3>

<p>For Node, this is all we need to do to be able to use our Graph as a module:</p>

<pre><code>// Include the module
var Graph = require('./graph');

// Instantiate
var g = new Graph();

// Hook into events
g.on('node', function (name) {
  console.log("Node added " + name);
});

// Call a method
g.addNode('Foo');
</code></pre>

<p>Running this should end up with message <code>Node added Foo</code> shown on the console.</p>

<h3>Running the module in browser</h3>

<p>To be able to run the module in the browser, we need to run Component's build process.</p>

<pre><code>$ component build
</code></pre>

<p>This will generate a JavaScript file <code>build/build.js</code> which provides CommonJS module loading support, and all the JavaScript code we've declared in the JSON file.</p>

<p>Now you can include that file in your HTML, and start using the Graph module:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;script src="./build/build.js"&gt;&lt;/script&gt;
    &lt;script&gt;
      var Graph = require('graph/graph.js');
      var g = new Graph();
      g.on('node', function (name) {
        alert("Node added " + name);
      });
      g.addNode('foo');
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<h2>Conclusion</h2>

<p>Component can be used for solving the JavaScript code-sharing problem. They let you build full applications out of smaller, reusable modules. And thanks to the CommonJS module specification, it is quite easy to write these modules in away which enables them to be used also under Node.js and other JavaScript runtimes.</p>

<p>This post, and the <a href="http://tjholowaychuk.com/post/37832588021/building-a-date-picker-component">date picker tutorial</a> should give you enough information needed for starting to decouple your front-end applications, and to participate in the emerging <a href="https://github.com/component/component/wiki/Components">open source Component ecosystem</a>.</p>

<p>Even with more than <a href="https://twitter.com/tjholowaychuk/status/316267708381528064">800 components available</a>, it is too early to declare Component the winner in the front-end dependency management space, but it is a well-designed system that works quite well.</p>

<p>I will be utilizing Component for some of my <a href="https://github.com/bergie">JavaScript projects</a> in the future.</p>
]]></description>
            <author>henri.bergius@nemein.com (Henri Bergius)</author>
            <category>feed:e1ac443192c214d3dd05c950b16e0929</category>
            <pubDate>Thu, 11 Apr 2013 07:00:00 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e2a2c534ba3d0aa2c511e29562796164e37df37df3</guid>
        </item>
        <item>
            <title>There are no smartphones</title>
            <link>http://nemein.com/fi/blog/there_are_no_smartphones/</link>
            <description><![CDATA[
<p>iPad is three years old now, and many tech blogs are writing stories <a href="http://arstechnica.com/gadgets/2013/04/i-was-an-ipad-skeptic/">to reflect what has changed</a>. More than 100 million of them have been sold, alongside other popular tablets like the Kindle Fire and Nexus 7. But originally the reception was quite sceptical.</p>

<p>Many made the argument that the tablet was <em>"<a href="http://www.pcworld.com/article/187888/ipad_first_impressions.html">just a big iPod Touch</a> or iPhone"</em>:</p>

<blockquote><p>at the end of the day, the show's centerpiece - the iPad -- is just a big iPod Touch. Lots of folks will want it, in a hypothetical sort of way. But it's hard to imagine all that many of them will fork over the initial $499 for a crippled version</p></blockquote>

<p>The funny thing about this argument is that &mdash; while the skepticism was misplaced &mdash; the core point was true: The iPad is just a big iPhone.</p>

<p>Or to put it the other way, <em>the iPhone is just a pocket-sized iPad.</em></p>

<h2>Tablets of different sizes</h2>

<p>There was a recent <a href="http://techland.time.com/2013/04/02/an-interview-with-computing-pioneer-alan-kay/">Time interview of the computer science legend Alan Kay</a>. I shared it <a href="https://plus.google.com/100751105859582805241/posts/G2XKvZEJjDJ">on Google+</a>, and there was some discussion. I made the following argument:</p>

<blockquote><p>In the end there are no phones any longer. Just tablets of different sizes, from tabletop (iPad, Surface) to pocketable (what we call smartphones)</p></blockquote>

<p>The chances are that if you're reading this post, you will have what you consider a smartphone. Look at it, and consider how you use it. Is it really a <em>phone</em>, or is the way you use it a lot closer to what you'd consider a <em>tablet</em>?</p>

<p>Back in mid-to-late 2000s, we had <a href="http://bergie.iki.fi/blog/meego-diaspora/">Nokia's Internet Tablet devices</a>. We considered them tablets, and did tablet-like things on them. The Nokia 770 tablet had a 4.13" screen. The iPhone has a 4" screen, and the Nexus 4 has a 4.7" screen. And yet somehow the first device was seen as a tablet, and the two latter as smartphones.</p>

<p>The software running on smartphones and tablets is nearly identical, as are the use cases.</p>

<h2>Phablets meet in the middle</h2>

<p>Smartphones and tablets are converging, quickly. Manufacturers know this, and the device-buying public is starting to see it too. But still the <a href="http://arstechnica.com/gadgets/2013/04/a-massive-6-3-inch-smartphone-from-samsung-may-be-in-the-works/">gadget blogs love to diss</a> the large <em>"phablet"</em> devices, even though they <a href="http://arstechnica.com/gadgets/2012/03/samsung-announces-5-million-galaxy-notes-sold-and-premium-update-upgrade/">sell quite well</a>.</p>

<p>The problem here is that many technology bloggers still try to keep the two categories of devices &mdash; smartphones and tablets &mdash; separate, even though they really aren't. Maybe these devices are two big for holding against your head for a phone call, but who really does that anymore?</p>

<p>In reality all of them are tablets &mdash; <a href="http://alistapart.com/column/windows-on-the-web">windows on the web</a> &mdash; and the only difference is that some of them fit in your pocket, and others need a bag, providing a bigger canvas to see information and work on in exchange.</p>

<p>This is the use case I have. For most of my internet and communication needs, I'm using a Nexus 4 as a pocketable tablet. I also have a larger tablet, which I <a href="http://bergie.iki.fi/blog/working-on-android/">use as my workstation</a> and for some things where a bigger screen is nicer, like graphic novels.</p>

<p>Some are even <a href="http://www.citeworld.com/mobile/21577/man-did-all-his-work-smartphone-one-year-heres-what-he-learned">able to do all their work on the smaller phablets</a>.</p>

<h2>End of telephony</h2>

<p>The big news here is that the <em>telephony</em> part of a smartphone is not going to matter for much longer. Internet-based communication tools like instant messengers, email, and hangouts provide richer ways to interact, and don't tie you down to a specific device, or a specific telecommunications provider.</p>

<p>In the long run, this means an end to phone subscriptions. As I wrote <a href="http://bergie.iki.fi/blog/toolkit-2012/">on my "hacker's toolkit"</a>, buying prepaid data is cheaper and easier:</p>

<blockquote><p>As the MiFi is only used for Internet access, I can buy cheap pre-paid SIMs from each country I travel to. Paying somewhere around ten euros for a month of Internet abroad certainly beats the usual roaming charges!</p></blockquote>

<p>This is already happening. For example, <a href="http://www.asymco.com/2013/01/18/whats-up-with-text-messaging/">Asymco reported on dropping SMS volumes in Spain</a>:</p>

<blockquote><p>After peaking at the end of 2008 at about €450/quarter, revenues have fallen by 60% to about €171 million in the third quarter of 2012. These figures represent almost 100% operating profit for operators so the impact is felt directly in the bottom line.</p>

<p>The culprit is IP-based messaging. Services like Whatsapp, iMessage and even Facebook offer “free” messaging to users who have a smartphone and a data plan. I’ve been told that 97% of Spanish smartphone users have Whatsapp installed. In some markets this “free” messaging is offered via BlackBerry Messaging.</p></blockquote>

<p>This obviously is a development telecommunications companies are scared of. But while SMS and call volumes go down, the other change is that <em>all these new devices will have SIM slots</em>, and so the operators can sell a lot more of data plans.</p>

<p>Some of them are already targeting this new world. <a href="http://mobile.slashdot.org/story/13/03/26/2048233/t-mobile-ends-contracts-and-subsidies">T-Mobile recently killed their traditional subscriptions and subsidies</a> in favor of prepaid plans.</p>

<h2>This is a new world</h2>

<p>The computing world is <a href="http://bergie.iki.fi/blog/why_the_tablet_form_factor_is_winning/">switching to tablets</a> rapidly. These tablets can be smaller or bigger depending on the requirements of the user, but they all are internet-connected, touch-capable and full of sensors. They already fit use cases from <a href="http://yieldthought.com/post/31857050698/ipad-linode-1-year-later">software development</a> to watching media or social networking.</p>

<p>This will mean <a href="http://al3x.net/2011/01/10/a-thought-on-communication.html">eventual changes in our culture</a>:</p>

<blockquote><p>My generation will be at something of a loss when this new world comes about. In my life, I’ve been rewarded for communicating effectively online via text. I’m a reasonably effective verbal communicator, but not nearly as good as I’ll need to be to compete with the telepresence-native adults that the children of today will grow up to be.</p>

<p>Today’s digital natives will be tomorrow’s telegraph operators. The only way to survive will be to understand the impact of pervasive video communication before it sweeps us under our keyboards.</p></blockquote>

<p>PCs will still remain as the main productivity tool for some years, mainly thanks to all the legacy software built around that ecosystem. But the <a href="http://bergie.iki.fi/blog/tablet-productivity/">VisiCalc moment of tablets</a> will come, sooner or later:</p>

<blockquote><p>Every major shift in computing has brought its new big companies. PCs gave us Microsoft, web Google and Facebook. In the tablet space the focus has so far been on hardware and platforms, but I'm quite certain there will be winners in the productivity software space as well, companies that we may not have even heard of yet. Maybe your company is going to be one of them?</p></blockquote>

<p>For now, I'm considering my adventures in the tablet productivity world an experiment. But day by day, my <a href="http://bergie.iki.fi/blog/working-on-android/">work tablet setup</a> is feeling more and more comfortable.</p>

<p>Right now I don't miss my laptop. Or having a phone number.</p>
]]></description>
            <author>henri.bergius@nemein.com (Henri Bergius)</author>
            <category>feed:e1ac443192c214d3dd05c950b16e0929</category>
            <pubDate>Wed, 03 Apr 2013 07:00:00 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e29c8443159f809c8411e294bdc1c7cbbe2cd62cd6</guid>
        </item>
        <item>
            <title>Why WordPress needs to get Decoupled</title>
            <link>http://nemein.com/fi/blog/why_wordpress_needs_to_get_decoupled/</link>
            <description><![CDATA[
<p>Couple of days ago there was an interesting post on <a href="http://jshakespeare.com/the-dire-state-of-wordpress/">the Dire State of WordPress</a>, talking about the issues developers have when working with this <a href="http://en.wordpress.com/stats/">hugely popular</a> content management system:</p>

<blockquote><p>When you learn PHP from WordPress as I (and probably many other people) did, you just assume that all the idiosyncrasies and illogicalities are par for the course when building a CMS-driven site. It’s taken me several years to realise that it doesn’t have to be like this. In fact, it wasn’t really until I started learning more about OO principles and working with frameworks that I started looking at WP in a different light. Why is every instance of every model treated like a post? Why can’t I extend the functionality of a post type without writing a whole mess of hooks, filters and functional code into a file that isn’t semantically related to that post in any way?</p>

<p>These may sound like the gripes of someone whose needs will never be met by something like WordPress, but the lack of fundamental logic that gives rise to the above issues is what makes WordPress problematic for developers at all levels. And because the crossover on the venn diagram of ‘people who know good application development practises’ and ‘people who build sites in WordPress’ is such a thin sliver, it just trundles along in its current hokey state, baffling both the unseasoned and the proficient developer alike.</p></blockquote>

<p>As expected, this generated a <a href="https://news.ycombinator.com/item?id=5407879">lively discussion on Hacker News</a>.</p>

<h2>Technical debt</h2>

<p>Now, I've used WordPress on-and-off ever since it was <a href="http://codex.wordpress.org/History">still called b2 cafelog</a>, but I wouldn't consider myself a WordPress developer. But still, looking at it mostly from the outside, it is clear that many of the issues WordPress users and developers face today result from <a href="http://en.wikipedia.org/wiki/Technical_debt">technical debt</a> accruing from bad architectural decisions done a decade ago, and the missing will to correct those.</p>

<p>WordPress is still undergoing a transition from a blogging platform <a href="http://www.ducttapemarketing.com/blog/2011/02/28/wordpress-3-1-is-big-leap-into-cms/">to a general-purpose CMS</a>. The changes this requires mean that without a sound architecture, the problems with the underlaying engine will only become exacerbated.</p>

<p>This is not something unique to WordPress. Many popular CMSs, including Drupal and TYPO3 have been suffering from the same problem. We all in the open source CMS community have been there. The difference however is that these projects have identified this issue, and have taken steps to correct it.</p>

<h2>Start decoupling</h2>

<p>The reason why CMSs become so messy is because they all try to be so many things at once. A CMS is a web framework, a CMS is a web editing tool, and a CMS is a content store. But each of these are in reality their own, specialized areas, and so the principle of <a href="http://en.wikipedia.org/wiki/Separation_of_concerns">separation of concerns</a> tells us that they should be handled by separate pieces of software.</p>

<p>I wrote a still-popular post titled <a href="http://bergie.iki.fi/blog/decoupling_content_management/">Decoupling Content Management</a> two years ago to argue just that. Projects like <a href="http://phpcr.github.com">PHPCR</a> and <a href="http://createjs.org">Create.js</a> have since then sprung up to move that from idea to practice, and have already been adopted by many CMSs.</p>

<p>In nutshell, the transition I want CMSs &mdash; WordPress included &mdash; to make is this:</p>

<p><img src="http://bergie.iki.fi/files/decoupled-cms-architecture.png" alt="Decoupling Content Management" /></p>

<p>Here is my <a href="http://youtu.be/j4NoAFK-KNY">talk on the subject</a> from JS.everywhere in Paris late last year:</p>

<iframe width="560" height="315" src="http://www.youtube.com/embed/j4NoAFK-KNY" frameborder="0" allowfullscreen></iframe>


<p>We also talk about the cross-CMS collaboration this enables in the <a href="http://vimeo.com/50883868">TYPO3 Neos launch video</a>.</p>

<p>Think about it, developers from Midgard CMS and TYPO3 working together and sharing substantial parts of the user interface codebase, while still enabling each project to retain a unique look-and-feel!</p>

<h2>Non-participation</h2>

<p>Over the past two years I've given tens of talks about Decoupled Content Management in various developer and CMS conferences. In these events I've talked with a lot of developers from various different CMSs from both the open source and proprietary worlds. But despite its popularity, WordPress core developers have been absent.</p>

<p>Symfony activist Lukas Smith <a href="https://news.ycombinator.com/item?id=5414441">has noticed the same</a>:</p>

<blockquote><p>I think the first step would be that the WordPress core developers start to mingle with the PHP community. I simply have not met a single WordPress core developer at any PHP conference and I tend to go to 6-10 a year in various countries around the world.</p>

<p>I have also not seen any WordPress core dev participate on an php-src internals discussion let alone something like the Framework Interoperability Group that outs out the PSRs.</p>

<p>But without communication the chances of collaboration are low and without collaboration imho its going to be hard for WordPress to identify and assess the potential for new directions.</p></blockquote>

<h2>Moving forward</h2>

<p>While WordPress is still the top dog of the CMS world, it is a precarious position that shouldn't lull them into complacency. The web moves forward, things change, and all technical debt must be paid eventually. And that is what can fatally slow down a project.</p>

<p>Solving the architectural issues is a big amount of work, and so I would start by examining how other projects like <a href="http://bergie.iki.fi/blog/drupal-and-collaboration/">Drupal have made their transition</a>. The part <em>Symfony components to the rescue of your PHP projects</em> of my <a href="http://bergie.iki.fi/blog/symfony-live/">Symfony Live Paris liveblog</a> is a good place to start.</p>

<p>For WordPress, like for any PHP content management system, <a href="http://bergie.iki.fi/blog/my_secret_agenda_for_php_content_management_systems/">my secret agenda for PHP CMSs</a> should apply. If you're a WordPress core developer, I'd love to chat about how to move forward.</p>
]]></description>
            <author>henri.bergius@nemein.com (Henri Bergius)</author>
            <category>feed:e1ac443192c214d3dd05c950b16e0929</category>
            <pubDate>Fri, 22 Mar 2013 07:00:00 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e292f4beeeeef292f411e28f0117d21b3d1f601f60</guid>
        </item>
        <item>
            <title>Google Glass and the fear of the future</title>
            <link>http://nemein.com/fi/blog/google_glass_and_the_fear_of_the_future/</link>
            <description><![CDATA[
<p><a href="http://www.google.com/glass/start/">Google Glass</a> is coming this year, a wearable display that can keep you connected at all the times and supply information and instructions when you need them. And it can record video or take pictures of whatever you see, when you want it to.</p>

<iframe width="560" height="315" src="http://www.youtube.com/embed/v1uyQZNg2vE" frameborder="0" allowfullscreen></iframe>


<h2>The privacy scare</h2>

<p>Much of the <a href="http://www.google.com/glass/start/how-it-feels/">Glass marketing</a> focuses on the camera aspect, as does the <a href="http://stopthecyborgs.org/about/">criticism and fearmongering</a> around it. Some feel that the device would bring about an era of ubiquitous surveillance and loss of privacy. Some even label these people <a href="http://www.internetevolution.com/author.asp?section_id=2724&amp;doc_id=260938&amp;">as Luddites</a>:</p>

<blockquote><p>StopTheCyborgs and other Neo-Luddite groups make some pretty compelling arguments against AR, including the credible threat that people could be recorded at any time without their knowledge or permission. Nobody could ever consider conversation in the presence of Google Glass wearers completely private. Any entity that could tap into and process all the information from Google Glass on a minute-to-minute basis could track anyone or any conversation anywhere near the wearers. Google Glass may well begin the destruction of our current definitions of privacy.</p></blockquote>

<p>The mislabeling aside (the historical Luddites were more concerned about machinery taking away their jobs, as they and globalization together eventually did), the criticism is generally baseless.</p>

<p>We live in cities filled with thousands of surveillance cameras monitoring our every move. We pay for our groceries with credit cards that leave a mark on everything you bought &mdash; when, and where &mdash; into a database. We carry smartphones that are constantly reporting their location back to the operator. We post our private pictures and current activities to social networks. There is very little privacy left. If you'd see how detailed information law enforcement can get out of our every movement from your operator, you'd know that too.</p>

<p>In a world where a hidden, <a href="http://www.pathgadget.com/spy-pen-page-1.html">pencil-shaped spy camera</a> can be bought for about 30$, is a very obviously visible Google Glass device really the biggest risk to privacy? And yet, <a href="http://arstechnica.com/gadgets/2013/03/seattle-bar-bans-google-glass-still-loves-beer-goggles/">places are banning them</a> already, a lot before they actually hit the market.</p>

<h2>This is the future</h2>

<p>The anti-Glass movement has a benefit. While not exactly a flying car, it is yet another sign that we're living in the future that science fiction authors envisioned. I mean, consider the fact that there is A <em>movement to ban cyborgs</em>.</p>

<p><img src="http://bergie.iki.fi/files/surveillance-ban.png" alt="Stop the Cyborgs" /></p>

<p>They even <a href="http://www.redbubble.com/people/stopthecyborgs">sell stickers</a>.</p>

<h2>Consider the possibilities</h2>

<p>Since the privacy battle is already lost, shouldn't we instead focus on the possibilities they can bring? While Google has shown very little of the capabilities of the Glass software apart from videoconferencing and making web searches, various books can provide clues.</p>

<p>Many of them describe a world where you can share with anybody what you see with your own eyes, or access any information without having to hold a bulky device.</p>

<p>It is a little hard to provide good context of the use cases from the books just by short snippets, but here are some. Feel free to provide your own in the comments.</p>

<p>In Daniel Suarez's <a href="http://en.wikipedia.org/wiki/Daemon_%28technothriller_series%29">Daemon series</a>, Glass-like devices are used for connecting and coordinating a full economy, called the Darknet. Here is a view of an office with augmented reality displays and <a href="https://www.leapmotion.com/">motion controls</a>:</p>

<blockquote><p>The center of the room looked to be a staging area, bustling with your people, all wearing eyewear and gloves. To the side was a raised platformn lined with office chairs where a dozen people were grabbing, pulling, and pushing at invisible objects in the air. They were all speaking to unseen people, as though it were a call center.</p></blockquote>

<p>I could easily imagine manipulating my <a href="http://noflojs.org">flow based programs</a> in this way.</p>

<p>The Daemon series also feature other Google products, like <a href="http://en.wikipedia.org/wiki/Google_driverless_car">driverless cars</a> and an augmented reality game much like <a href="http://www.ingress.com/">Ingress</a>.</p>

<p>Vernor Vinge's <a href="http://en.wikipedia.org/wiki/Rainbows_End">Rainbows End</a> has everybody using augmented reality glasses as an everyday matter. They even change how you see a city like Barcelona:</p>

<blockquote><p>Vaz strolled to the stone barrier and looked down. If he blocked out all the tourism fantasy [augmented by the Glass], he could see the freight harbor almost two hundred meters below and a kilometer away. The place was an immensity of freight containers rambling this way and that, chaos. If he invoked his government powers, he could see the flow of carge, even see the security certificates...</p></blockquote>

<p>And of course people interact with the augmented reality projections of others just like they were present:</p>

<blockquote><p>Even when her friends were gone physically, they were often still around, invisible presences [without the Glass] like Robert's doctors. Miri walked around the backyard talking and arguing with nobody&mdash;a parody of all the cellphone discourtesy that Robert remembered</p></blockquote>

<p>For the less pleasant view of something like Glass, Neal Stephenson's <a href="http://en.wikipedia.org/wiki/Snow_Crash">Snow Crash</a> focuses on the surveillance aspects, with people using AR displays being called <em>Gargoyles</em>:</p>

<blockquote><p>Gargoyles are no fun to talk to. They never finish a sentence. They are adrift in a laser-drawn world, scanning retinas in all directions, doing background checks on everyone within a thousand yards, seeing everything in visual light, infrared, millimeter-wave radar, and ultrasound all at once. You think they’re talking to you, but they’re actually poring over the credit record of some stranger on the other side of the room, or identifying the make and model of airplanes flying overhead.</p></blockquote>

<p>Then again, talking with a Facebook addict can already be a lot like that.</p>

<h2>How this will play out</h2>

<p>If the glass does what people want it to do, it will become popular.</p>

<p>Just like we've taken smartphones and tablets into our lives and homes, eventually we will live in a world where you will feel naked if you step out of your home door without the glass on. <em>How am I supposed to connect and communicate now?</em></p>

<p>I'd love to have Glass, even if it is clunky in the beginning.</p>

<p>Wearable computing is one of the possible trajectories we're going with, from room-sized mainframes to desk-bound personal computers to these amazing small slabs of glass and antennas we now carry in our pockets.</p>

<p>Just like with <a href="http://bergie.iki.fi/blog/smart-collaboration-space/">smart spaces</a>, or <a href="http://bergie.iki.fi/blog/the-real-hitchhiker-s-guide-to-the-galaxy/">tablets many years ago</a>, I'm keen to explore the new interaction possibilities.</p>
]]></description>
            <author>henri.bergius@nemein.com (Henri Bergius)</author>
            <category>feed:e1ac443192c214d3dd05c950b16e0929</category>
            <pubDate>Fri, 22 Mar 2013 07:00:00 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e2931ea7cb5efc931e11e2947f1da95a93e2ece2ec</guid>
        </item>
        <item>
            <title>Working on an Android tablet</title>
            <link>http://nemein.com/fi/blog/working_on_an_android_tablet/</link>
            <description><![CDATA[
<p>As mentioned in my post <a href="http://bergie.iki.fi/blog/toolkit-2012/">Hacker-nomad's toolkit, 2012 edition</a>, the lease period of my lovely &mdash; Linux-driven &mdash; <a href="http://bergie.iki.fi/blog/11-macbook_air-the_best_computer_i-ve_ever_had/">11" MacBook Air</a> expired this month, and I had to consider what kind of gear to go with next.</p>

<p>The safe bet would've been to just get a newer version of the Air, or maybe the <a href="http://arstechnica.com/apple/2012/11/13-retina-macbook-pro-review-more-pixels-less-value/">13" Retina MacBook</a> with its great screen. A fresher approach would be a ChromeBook, either the cheap and light <a href="http://arstechnica.com/gadgets/2012/11/review-samsungs-new-arm-chromebook-gets-by-without-intel-inside/">ARM ChromeBook</a>, or the <a href="http://arstechnica.com/gadgets/2013/03/review-chromebook-pixel-is-too-expensive-and-too-good-for-chrome-os/">Pixel</a> with awesome screen and design but crappy battery life.</p>

<p>I'm spending most of my days developing software, and so I should be able to work with a ChromeBook and a remote Linux box. But if that works, why not <a href="http://yieldthought.com/post/12239282034/swapped-my-macbook-for-an-ipad">try working on a tablet</a>? They're cheap, light, durable, and have an all-day battery life. And if Mark O'Connor was able to <a href="http://yieldthought.com/post/31857050698/ipad-linode-1-year-later">work productively a whole year</a> with one, why couldn't I?</p>

<p>Since I already had a <a href="http://arstechnica.com/gadgets/2012/11/nexus-10-tablet-is-a-solid-house-built-on-shifting-sands/">Nexus 10</a>, this is what I decided to try.</p>

<h2>The setup</h2>

<p><img src="http://bergie.iki.fi/files/nexus10-mobile-small.jpg" alt="Nexus 10 as a laptop" /></p>

<p>The Nexus tablet has a great, "better than retina" screen, which can render my coding sessions and web user interfaces beautifully. The 10" screen is somewhat smaller than what I had on my Air, but not terribly so.</p>

<p>However, the big problem with <a href="http://bergie.iki.fi/blog/tablet-productivity/">tablet productivity</a> is text input. Much of our current work environment is still textual, and typing on a non-haptic glass touch-screen is simply not very nice.</p>

<h3>Hardware keyboard</h3>

<p>To fix this I purchased a <a href="http://m.tomshardware.com/news/Wedge-bluetooth-keyboard-mouse-review,17633.html">Microsoft Wedge Keyboard</a>, which connects to the tablet over Bluetooth. Recent Android versions have quite full support for external keyboards, allowing me to use it for all text entry, and even for some keyboard navigation. So yes, <em>Alt-Tab</em> works.</p>

<p>The Wedge keyboard is about the same size as typical keyboards on compact laptops. Microsoft has always made good hardware, and the keyboard is no exception, providing a quite nice feel for the size it has. A handy additional feature is the included cover, which puts the keyboard to sleep automatically, and can act as a tablet stand when opened. No more issues with keyboard waking up in your bag and <a href="http://andrewhy.de/two-months-with-ipad-as-my-computer/">deleting everything</a>.</p>

<p>For those prepared to lug a heavier option, there is <a href="http://matias.ca/laptoppro/mac/">a Bluetooth mechanical keyboard</a>, which is probably a lot better than any laptop keyboard on the market. And if you already have a good keyboard, Android supports most of the USB ones via an OTG cable.</p>

<h3>Desk setup</h3>

<p>While I'm spending quite a lot of my time on the road, <a href="http://bergie.iki.fi/blog/all-you-need-is-good-backpack/">living out of my backpack</a>, I do have a regular desk in the Berlin office I share with <a href="http://www.contentcontrol-berlin.de">Content Control</a>. Since my coding sessions are often long, I've been a bit concerned with my <a href="http://www.codinghorror.com/blog/2007/08/computer-workstation-ergonomics.html">programming ergonomics</a> for a while now, even considering a <a href="http://blog.liangzan.net/blog/2012/09/29/my-standing-desk-experiment/">standing desk</a>.</p>

<p><img src="http://bergie.iki.fi/files/nexus10-desk-small.jpg" alt="Nexus 10 as a desktop" /></p>

<p>Tablet has the same advantage as a traditional display in that it is decoupled from the input devices, giving you greater freedom in how to position them. I have a <a href="http://youtu.be/Mmx1wh72hv0">Callstel tablet stand</a> that allows me to place the tablet in practically any place and height above my desk. The current setup is just slightly below my eye height in the normal sitting position, but I'm still experimenting with that.</p>

<h3>Gorilla arms</h3>

<p>The <a href="http://www.wired.com/gadgetlab/2010/10/gorilla-arm-multitouch/">Gorilla arm syndrome</a> is what everybody brings up with every touchscreen computer &mdash; it is simply not nice to constantly lift your arm to touch the screen.</p>

<p>In my experience this isn't so much of an issue when you're using the tablet positioned similarly as a laptop screen would. But when the screen is up in a more ergonomic position, like it is on my desk, then this quickly becomes an issue.</p>

<p>To solve this I bought a Apple Magic Trackpad, which connects to the tablet again via Bluetooth, and allows both regular mouse usage with Android, as well as many multitouch gestures.</p>

<h2>Why Android</h2>

<p>Most people experimenting with replacing computers with tablets go with an iPad, the established market leader. iPad has many benefits over the Nexus 10, including a more mature software ecosystem, and better availability &mdash; if you break or lose your tablet, you'll be able to pick up a new one from practically anywhere, whereas the Nexus devices are only available online.</p>

<p>The reasons for me to go with Android have to do with openness. Since the core operating system is open source, there are <a href="http://www.cyanogenmod.org">custom ROMs</a> I could use if I wanted, and I can <a href="http://www.mondaynote.com/2013/02/24/ipad-and-file-systems-failure-of-empathy/">do file management</a> the traditional way when I need to. An even bigger reason is that the <a href="http://developer.android.com/training/sharing/send.html">sharing system</a> makes it possible to connect various applications together. Being able to run multiple broser engines is also nice for a web developer.</p>

<p>Another bonus is the <a href="http://en.wikipedia.org/wiki/Android_Beam">availability of NFC</a> on the tablet. I'm quite often sharing content between it and my smartphone. If I run into an interesting web article, I can either send it to my <a href="http://david-smith.org/blog/2012/10/11/instapaper-on-the-kindle-paperwhite/">Kindle to read later</a>, or touch the tablet with my phone and read the article on that. This is surely a feature that will gain more mindshare whenever it is introduced to iPhones.</p>

<p>I also prefer the rugged, rubberized look-and-feel of the Nexus 10 to the cold metallic iPad, even though a 4:3 screen would be better than the widescreen I have now.</p>

<h3>Software used</h3>

<p><img src="http://bergie.iki.fi/files/nexus10-homescreen-small.jpg" alt="Nexus 10 homescreen" /></p>

<p>I really don't need much for my daily work &mdash; just a browser and a terminal. Here are the apps I use on a daily basis:</p>

<ul>
<li><a href="https://play.google.com/store/apps/details?id=com.android.chrome">Chrome</a> and <a href="https://play.google.com/store/apps/details?id=org.mozilla.firefox">Firefox</a> web browsers</li>
<li><a href="https://play.google.com/store/apps/details?id=com.sonelli.juicessh">JuiceSSH</a> SSH client to access my remote Linux server</li>
<li><a href="https://play.google.com/store/apps/details?id=com.tapchatapp.android">TapChat</a> IRC client</li>
<li><a href="https://play.google.com/store/apps/details?id=com.rhmsoft.fm.hd">File Manager HD</a> for moving stuff around, including between file servers</li>
<li><a href="https://play.google.com/store/apps/details?id=com.aor.droidedit.pro">DroidEdit Pro</a> for quick local file edits</li>
</ul>


<p>In addition I'm using some of the built-in Google apps, like Google Talk, GMail, and Google+ for Hangouts.</p>

<p>For offline development I have an installation of <a href="https://play.google.com/store/apps/details?id=com.spartacusrex.spartacuside">Terminal IDE</a> that allows me to run Linux utilities like vim and git locally. If I would root my tablet I could also install a Ubuntu chroot and run whatever I need. With a previous tablet I even was able to run Node.js servers and databases on the thing!</p>

<p>My development virtual machine is from <a href="https://www.digitalocean.com/">DigitalOcean's</a> Amsterdam site, providing quite nice fast connections here in Europe. I mostly work on it via <a href="http://tmux.sourceforge.net">tmux</a> and <a href="http://www.vim.org">vim</a>, and run whatever processes I need, including long-running <a href="http://noflojs.org">NoFlo</a> flows.</p>

<h2>Pros and cons</h2>

<p>Based on my initial experiences of working with this setup for a week, working on a tablet is quite different from a traditional computer. Here are some good things:</p>

<ul>
<li>Battery life: the Nexus can easily get me through a full workday with a single charge, meaning that I only need to connect it to a wall overnight. It also charges via standard micro-USB meaning that I don't need any extra power bricks with me</li>
<li>Portability: most tablets are smaller and lighter than full laptops. And they can be used more easily when standing, sitting on the couch, etc.</li>
<li>Instant on: there is no suspend/resume cycle. I press the power button, the tablet recognizes my face via the camera, and I'm instantly back to where I left off</li>
<li>Modularity: with a tablet, my work environment is built out of multiple modular pieces that I can take with me, or leave at the office depending what I intend to do. And I can set them up in different configurations when working</li>
<li>Touch: for software developers, working on a tablet really drives home the importance of touchscreen friendliness. I've already noticed this affecting my UI designs</li>
<li>Focus: everything is full screen, meaning no need for window management. Tablet software also tends to be simpler and has less configuration to fiddle with</li>
</ul>


<p>But obviously there are some downsides as well:</p>

<ul>
<li>Office documents: the office suites available for Android are quite poor, and the mobile version of Google Docs is simply terrible. One solution would be using MS Office or LibreOffice over a VNC connection</li>
<li>Mobile-first web: quite a few websites try to offer even large tablets like the Nexus 10 their silly mobile sites. Thankfully this is becoming less prevalent due to media queries and responsive design</li>
<li>Offline: much of my current tablet workflow requires me to be online. I could write code and blog posts offline with tools like Terminal IDE, but there would be no way to run and test software</li>
<li>Bugs: many tablet applications are still in their first generation and lack the maturity and robustness that their desktop counterparts have had time to gain</li>
<li>Web debugging: while <a href="http://debug.phonegap.com">WEINRE</a> sort of helps here, it is still a lot less convenient than the web development tools that come with desktop browsers</li>
</ul>


<h2>Conclusion</h2>

<p>This tablet work setup is for now an experiment. If I find it hindering my productivity, I'll just have to get one of the laptops mentioned in the beginning of this post and work in more traditional manner. But if it works, then great! In that case I have finally found a more modern setup for programming work &mdash; one that gives me both better ergonomics and mobility.</p>

<p>I will try this setup for some period of time, and then report the results <a href="http://bergie.iki.fi">here on my blog</a>.</p>
]]></description>
            <author>henri.bergius@nemein.com (Henri Bergius)</author>
            <category>feed:e1ac443192c214d3dd05c950b16e0929</category>
            <pubDate>Tue, 19 Mar 2013 01:00:00 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e290025fb57c02900211e2bc5d7506657e1a331a33</guid>
        </item>
        <item>
            <title>Building a smarter workplace</title>
            <link>http://nemein.com/fi/blog/building_a_smarter_workplace/</link>
            <description><![CDATA[
<p>As part of the <a href="http://smarcos-project.eu">SmarcoS</a> project, <a href="http://nemein.com">we</a> have been investigating how to make workplaces smarter through sensors and <a href="http://worrydream.com/MagicInk/">context awareness</a>. Here is <a href="http://youtu.be/P5cdlLTqb24">a video showing what we've built</a>:</p>

<iframe width="640" height="480" src="http://www.youtube.com/embed/P5cdlLTqb24" frameborder="0" allowfullscreen></iframe>


<p>The idea here is to facilitate collaboration and smoother project communications through various different tools that I'll describe below. While this already does a lot, it is obviously only the first step on the path to making offices smarter.</p>

<h2>Office presence</h2>

<p>An important part of collaboration is to know who is where. Maybe some people are having a lunch break, or are working remotely? The Office Presence Display system knows these things, thanks to various sensors:</p>

<ul>
<li>Bluetooth sensors can see smartphones and other mobile devices in the space</li>
<li>WiFi sensor can see what computers are connected</li>
<li>Google Talk sensor knows who are connected and active on their work accounts</li>
</ul>


<p>With these, we know pretty well when you arrive to the office, and when you leave. Thanks to the sensor watching the company instant messaging system, we also know when people working remotely are available.</p>

<p><img src="http://bergie.iki.fi/files/opd-small.png" alt="Office Presence Display" /></p>

<p>In addition to letting people know where the other members of the team are, this system can help with the perpetual annoyance in many companies: <em>having to fill timesheets</em>. We have a logger process that listens to the sensors, and logs the data into a <a href="http://bergie.iki.fi/blog/business_analytics_with_couchdb_and_noflo/">CouchDB</a> database. From there you can easily visualize working hours and availability trends:</p>

<p><img src="http://bergie.iki.fi/files/opd-stats-small.png" alt="Office presence stats" /></p>

<p>In many situations it is of course not enough to know whether people are present, but also to know what they're working on. The next component of the system helps with that.</p>

<h2>Electronic Kanban wall</h2>

<p>Instead of the clumsy waterfall style, more and more companies are managing their projects in tight, recurring iterations. A Kanban wall is a great way to keep track of tasks as they move through the process, and to see who is doing what, and what could be possible to do next. The <a href="http://blog.crisp.se/2009/06/26/henrikkniberg/1246053060000">One day in Kanban Land</a> post explains the concept well.</p>

<p>If everybody working on a project sits in the same room, and that room is also where all decisions about the project are made, then the traditional solution of whiteboards and Post-It notes is probably the best way to visualize Kanban. But for distributed teams and more flexible work, an electronic version is a lot better option. This way everybody can see the Kanban wall in its current state from their computer, a TV in an office room, or a tablet.</p>

<p><img src="http://bergie.iki.fi/files/webkanban.png" alt="Webkanban" /></p>

<p>Our Kanban wall implementation provides exactly that. The same wall (or, in case of multiple projects or teams, a set of walls) is available through any web browser. You can also display it on a big screen in an office or a meeting room, and control that screen with the <a href="http://bergie.iki.fi/blog/qt-air-cursor/">Kinect Air Cursor</a>.</p>

<p>Now, for most companies this is not meant to be the <em>master database</em> of projects and tasks, but instead just to be an alternative view and controlling tool to wherever your project information resides. Maybe you're already using <a href="http://www.pivotaltracker.com">Pivotal Tracker</a>, <a href="http://basecamp.com">Basecamp</a>, or <a href="http://openpsa2.org">OpenPSA</a>? The Kanban wall server has a full REST API available, and so it is easy to integrate with any existing system. If a task is moved on the Kanban wall, it can be updated to the project tracking system, and vice versa.</p>

<p>If you're using both systems, then the Kanban wall is also aware of the presence information. We show a differently colored border around the "person tokens" depending on the availability state. You can also set different Work-in-Progress limits for different people and states.</p>

<h2>Interested yet?</h2>

<p>So far we've only trialed the system in our own office, but are now looking for some pilot customers to try the system out. If you're interested in making your workplace smarter, <a href="mailto:info@nemein.com">get in touch</a>.</p>

<p>For those who like to tinker with these things, all the sensor software is available as open source at <a href="http://github.com/nemein">http://github.com/nemein</a>.</p>
]]></description>
            <author>henri.bergius@nemein.com (Henri Bergius)</author>
            <category>feed:e1ac443192c214d3dd05c950b16e0929</category>
            <pubDate>Fri, 08 Mar 2013 08:00:00 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e287fcced072c687fc11e28cc50f23e58984298429</guid>
        </item>
        <item>
            <title>Travel: all you need is a good backpack</title>
            <link>http://nemein.com/fi/blog/travel-all_you_need_is_a_good_backpack/</link>
            <description><![CDATA[
<p>In the last year, I've spent a lot of time on the road, mainly through client work and the <a href="http://iks-project.eu">European projects</a> I've been involved with. To be more exact, I've spent more than half of my time traveling. This year should definitely be more light on conferences!</p>

<p>Now, people have very different styles of traveling. Some plan everything in advance, and pack for every possible contingency. But not me.</p>

<p>Over the years I've built a style of traveling that involves very minimal planning and late arrangements. This can fire back &mdash; making flights or trains more costly, but it is still often worth it through the added flexibility. Maybe there is a meeting or a conference that pops up at the last moment, and can be combined with the trip with minimal detours?</p>

<p>An important component of that is to have travel gear that gives you the needed flexibility. For me this means a largish backpack that can carry <a href="http://bergie.iki.fi/blog/toolkit-2012/">all the work gear</a> I need, and also fit about a week's worth of clothes and other things I need on daily basis. No need to wonder what extra to pack when the space is limited, and no need to check in luggage when flying.</p>

<p>And even more importantly, having a light and easy to carry bag so that you can just keep it with you for a day out in the city instead of having to first visit the hotel to drop it.</p>

<p><img src="http://bergie.iki.fi/files/haglofs_connect_small.jpg" alt="Haglöfs Connect" /></p>

<p>My current backpack is a <em>Haglöfs Connect 17"</em> that I got last Christmas. Prior to that, I was traveling with another backpack that I originally acquired for the long <a href="http://www.flickr.com/photos/bergie/sets/72157605264157805/">walk to Santiago de Compostela</a>. That backpack was great for anything from daily commute to <a href="http://www.flickr.com/photos/bergie/sets/72157624858157408/">month-long trips around Europe</a>, but was starting to be quite beaten up.</p>

<p>The new one is slightly smaller, more stylish, and most importantly, organized better. Now, for instance, I have a separate compartment just for my computer and its accessories. This makes airport security a lot smoother than trying to dig the computer up from behind clothes and other random things before putting it on the tray.</p>

<p>To keep the bag organized, I have an Eagle Creek packing cube to keep my clothes together, and occasionally one of their shirt folders whenever more businessy attire is required. I also have two toiletry bags, one of the actual toiletries and the other for cables and whatever adapters I need to connect when giving presentations.</p>

<p>One week's worth of clothes can sound like too little, given that often the trips can be longer than that. The solution for this is to use either laundromats, or, in a pinch, to pay for hotel laundy service.</p>

<p><em>All you need for travel is a good backpack.</em> The <a href="http://packlite.tumblr.com">Pack Lite</a> blog shows other examples of packing lite for both work and holiday travel.</p>
]]></description>
            <author>henri.bergius@nemein.com (Henri Bergius)</author>
            <category>feed:e1ac443192c214d3dd05c950b16e0929</category>
            <pubDate>Thu, 07 Mar 2013 08:00:00 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e28776b3316c40877611e28383dda1c0236b5c6b5c</guid>
        </item>
        <item>
            <title>Thinking about the flow-based programming user interface</title>
            <link>http://nemein.com/fi/blog/thinking_about_the_flow-based_programming_user_interface/</link>
            <description><![CDATA[
<p>As readers of this blog already know, I've been working on the <a href="http://noflojs.org/">NoFlo</a> flow-based programming environment for JavaScript. Lately the development effort has received a large boost from both the EU-funded <a href="http://smarcos-project.eu/">SmarcoS Project</a> and client work, and so the question of a <a href="https://github.com/bergie/noflo/issues/1">flow design UI</a> has become even more urgent.</p>

<p><img src="http://bergie.iki.fi/files/fbp-ui/noflo.png" alt="NoFlo" /></p>

<p>In nutshell, <a href="http://en.wikipedia.org/wiki/Flow-based_programming">flow-based programming</a> (FBP) is a paradigm where programs are built from components that have a set of defined input and output ports. These ports are then wired together to make a graph that defines the logic and the data flow.</p>

<h2>Where we are now</h2>

<p>At the moment there are two user interfaces that can be used for defining NoFlo graphs visually. <strong><a href="http://www.jpaulmorrison.com/graphicsstuff/">DrawFBP</a></strong> is a desktop application that can define flow-based program graphs for both NoFlo and the Java and C# flow runtimes.</p>

<p>This is the most functionally-complete FBP user interface, but is somewhat limited by Java's cross-desktop capabilities and the inability to introspect the information available via NoFlo's <a href="http://bergie.iki.fi/blog/distributing-noflo-components/">component loading interface</a>. In any case, it is a great place to start exploring NoFlo development visually:</p>

<p><a href="http://bergie.iki.fi/files/fbp-ui/drawfbp.png"><img src="http://bergie.iki.fi/files/fbp-ui/drawfbp-small.png" alt="DrawFBP" /></a></p>

<p>I've been working on a web-based user interface purpose-built for NoFlo called <strong><a href="https://github.com/bergie/noflo-ui">noflo-ui</a></strong>. Here input ports are on the left, and output ports on the right. Boxes depict ArrayPorts:</p>

<p><a href="http://bergie.iki.fi/files/fbp-ui/noflo-ui.png"><img src="http://bergie.iki.fi/files/fbp-ui/noflo-ui-small.png" alt="noflo-ui" /></a></p>

<p>The noflo-ui interface benefits from being able to talk directly to NoFlo itself, and so getting all the metadata about components and their ports. The current iteration was built with the <a href="http://www.jsplumb.org/">jsPlumb</a> library, and works also on touchscreen devices. Imagine programming your NoFlo graphs on a tablet!</p>

<h3>Visualizing written flows</h3>

<p>While the user interface is missing, the typical way to visualize NoFlo graphs is using <a href="https://github.com/bergie/noflo#language-for-flow-based-programming">the <code>.fbp</code> domain-specific language</a>. In that, the graph shown in the screenshots above would be written as:</p>

<pre><code># Read a file
'package.json' -&gt; IN Read(ReadFile)
# Split the file contents by newlines
Read() OUT -&gt; IN Split(SplitStr)
# Count the packets
Split() OUT -&gt; IN Count(Counter)
# Send the total count to display
Count() COUNT -&gt; IN Display(Output)

# Display also file read errors
Read() ERROR -&gt; IN Display()
</code></pre>

<p>The <strong><a href="https://github.com/bergie/noflo-graphviz">noflo-graphviz</a></strong> tool can be used for generating visual graphs out of this syntax:</p>

<p><a href="http://bergie.iki.fi/files/fbp-ui/noflo-graphviz.png"><img src="http://bergie.iki.fi/files/fbp-ui/noflo-graphviz-small.png" alt="noflo-graphviz" /></a></p>

<p>While in the real world you'd probably want to edit the graphs visually, at least the graphviz tool can be useful for autogenerating documentation for larger flow-based programs.</p>

<h3>Potential collaboration</h3>

<p>Flow-based programming is not a new idea, and there are many other implementations available, from programming languages like <a href="https://github.com/trustmaster/goflow">Go</a> to <a href="http://meemoo.org/">purely browser-based</a> environments. The <a href="https://github.com/meemoo/dataflow">dataflow library</a> aims to provide a common web-based toolkit for managing flows in any FBP environment:</p>

<p><a href="http://bergie.iki.fi/files/fbp-ui/dataflow.png"><img src="http://bergie.iki.fi/files/fbp-ui/dataflow-small.png" alt="dataflow" /></a></p>

<p>When the library matures a bit more, it is likely to be the basis for NoFlo's graph editing interface.</p>

<h2>Inspiration</h2>

<p>The key part of making a user interface for NoFlo should be to make flow-based programs easier to make and to understand. As described in <a href="http://www.youtube.com/watch?v=PUv66718DII">Bret Victor's great Inviting on Principle talk</a>, development tools could do a lot more to make the flow of the software and the different options and settings understandable:</p>

<iframe width="500" height="281" src="http://www.youtube.com/embed/PUv66718DII" frameborder="0" allowfullscreen></iframe>


<p>Flow-based programming tools can help a lot here, as the main logic of a program is anyway depicted as a visual graph.</p>

<p>With NoFlo we can even connect the user interface to a already running piece of software, allowing users to see what is going on and to make changes while the application is runs. Think of the <a href="http://ec.europa.eu/avservices/photo/photoDetails.cfm?sitelang=en&amp;mgid=503#14">mimic boards in nuclear power plants</a> where the operators can constantly see the status of every part of the process.</p>

<p><img src="http://bergie.iki.fi/files/fbp-ui/mimicboard.png" alt="Mimic board in a power plant" /></p>

<h3>Visual identity</h3>

<p>We're building something new and exciting with NoFlo here, and so the visual identity should also reflect that. No need to follow the drab look-and-feel of traditional IDEs!</p>

<p>Consider this line from <a href="http://en.wikiquote.org/wiki/Tron:_Legacy#Dialogue">Tron: Legacy</a>:</p>

<blockquote><p>The grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? Motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then one day...</p></blockquote>

<p><img src="http://bergie.iki.fi/files/fbp-ui/tron.png" alt="Tron: Legacy opening titles" /></p>

<p>There is certainly something of flow-based programming right there. And this is why the current NoFlo UI has a distinct <a href="http://youtu.be/uSaMncmaz8g">Tron-like look</a> to it.</p>

<p>Another approach would be more organic, from how <a href="http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en">Alan Kay described object-oriented programming</a>:</p>

<blockquote><p>I thought of objects being like biological cells and/or individual computers on a network, only able to communicate with messages</p></blockquote>

<p>The honeycomb flow graph on the <a href="http://api.spreecommerce.com/">Spree API documentation</a> also looks cool:</p>

<p><a href="http://bergie.iki.fi/files/fbp-ui/spree.png"><img src="http://bergie.iki.fi/files/fbp-ui/spree-small.png" alt="Spree API" /></a></p>

<h3>Prior art</h3>

<p><a href="http://pipes.yahoo.com/pipes/">Yahoo! Pipes</a> is what most people bring up when I describe flow-based programming. They have a quite nice web-based UI:</p>

<p><a href="http://bergie.iki.fi/files/fbp-ui/yahoo-pipes.png"><img src="http://bergie.iki.fi/files/fbp-ui/yahoo-pipes-small.png" alt="Pipes" /></a></p>

<p>Apple's <a href="http://en.wikipedia.org/wiki/Quartz_Composer">Quartz Composer</a> is a very slick implementation of the same concept, but for the desktop:</p>

<p><a href="http://bergie.iki.fi/files/fbp-ui/quartz-composer.png"><img src="http://bergie.iki.fi/files/fbp-ui/quartz-composer-small.png" alt="Quartz Composer" /></a></p>

<p>If Apple made a finger-friendly version of this for the iPad, we would be pretty close to the UI NoFlo needs to have.</p>

<h3>The big picture</h3>

<p>A problem with most of the existing flow-based editors is that they go into too much detail, making bigger graphs hard to decipher. Of course, moving chunks of a graph to subgraphs and using those as components helps, but still a complex program can be a confusing tangle of crisscrossing lines.</p>

<p>Luckily, there is an area of information design which has tackled this problem already: <a href="http://en.wikipedia.org/wiki/Transit_map">transit maps</a>.</p>

<p>If you consider the transportation system of a big city as a flow-based program, it consists of a huge number of nodes and connections. And yet it is easy for people to figure out how to get around. Just look at this part of the Berlin subway map:</p>

<p><a href="http://bergie.iki.fi/files/fbp-ui/bvg.png"><img src="http://bergie.iki.fi/files/fbp-ui/bvg-small.png" alt="Berlin subway" /></a></p>

<p>The different tariff zones even map quite nicely to the idea of <a href="https://groups.google.com/d/topic/flow-based-programming/ycrFDIu2RHw/discussion">subgraphs in FBP</a>.</p>

<p>There are some key points here:</p>

<ul>
<li>Don't focus on the details too much. You have nodes, and connections between them. Why show the port names on this level?</li>
<li>Use color. Different flows in your program could be depicted as their own "subway lines"</li>
<li>Nodes that are only connected to a single flow (for example, filters and converters) can be minimized, and more focus given to nodes where different flows interspect</li>
</ul>


<p><a href="https://github.com/bergie/noflo/blob/master/CHANGES.md#031-git-master">NoFlo 0.3.1</a> will make it possible to annotate connections in a flow with arbitrary "route names" that can then be assigned to colors for visualization purposes.</p>

<p>Quite some research and tools already exist for <a href="http://blog.visualmotive.com/2009/automatic-generation-of-transit-maps/">automatic generation of subway maps</a>. Maybe some of these could be repurposed to give the NoFlo UI a "bird's eye view" to your flow-based programs?</p>

<h2>Moving forward</h2>

<p>So, how to make this user interface happen? As mentioned, I'm building software with NoFlo on daily basis now, and so better tooling is certainly urgent. And not just for me, but for all the others <a href="https://github.com/meemoo/dataflow/issues/1#issuecomment-13201934">interested in flow-based programming</a>. In the recent project planning sessions I've allocated some time to this, and so I hope we can get somewhere with a more-or-less working user interface still during this winter.</p>

<p>There are many things to consider:</p>

<ul>
<li>Graph editing on both desktop computers and tablets</li>
<li>Collaborative editing between multiple users, maybe via <a href="http://sharejs.org/">ShareJS</a></li>
<li>Refactoring: moving parts of a graph to its own subgraph, or "blowing up" a subgraph back into the main graph</li>
<li>Browsing the available components and graphs</li>
<li>Seeing compatible port types when making a connection</li>
<li>Writing new <a href="https://github.com/bergie/noflo#components">components</a> and modifying existing, maybe with <a href="http://codemirror.net/">CodeMirror</a></li>
<li>Running the NoFlo graph and seeing the packets passing through the different parts</li>
</ul>


<p>All of this will obviously take a lot of time, but we'll have to see how far we get with the first iteration. Having an editor that people find more usable than <a href="https://github.com/bergie/noflo#language-for-flow-based-programming">writing graphs</a> by hand should be the first goal.</p>

<p>If you're interested in this, please follow the <a href="https://github.com/bergie/noflo-ui">noflo-ui</a> and <a href="https://github.com/meemoo/dataflow">dataflow</a> repositories. The <a href="http://groups.google.com/group/flow-based-programming">Flow-based programming</a> mailing list is also a great place to discuss your ideas.</p>
]]></description>
            <author>henri.bergius@nemein.com (Henri Bergius)</author>
            <category>feed:e1ac443192c214d3dd05c950b16e0929</category>
            <pubDate>Fri, 08 Feb 2013 08:00:00 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e2721556c89c92721511e28bbcebcb646159885988</guid>
        </item>
        <item>
            <title>Joulutervehdys</title>
            <link>http://nemein.com/fi/blog/christmas_greetings-003/</link>
            <description><![CDATA[
<p>Nemein kiittää asiakkaita ja yhteistyökumppaneita kuluneesta vuodesta ja toivottaa iloista joulua ja menestyksekästä uutta vuotta 2013! Tänä vuonna Nemein on lahjoittanut joulukortteihin tarkoitetut varat Suomen Punaisen Ristin  Katastrofirahastoon.</p>]]></description>
            <author>kaisa.lepisto@nemein.com (Kaisa Lepistö)</author>
            <pubDate>Fri, 14 Dec 2012 10:49:30 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e245dbf070c44845db11e2af47197d83bd28f528f5</guid>
        </item>
        <item>
            <title>node.js and GObject Introspection</title>
            <link>http://nemein.com/fi/blog/node-js_and_gobject_introspection/</link>
            <description><![CDATA[

<p>It's <a href="https://live.gnome.org/GObjectIntrospection/Users">already been mentioned</a> there are <a href="https://live.gnome.org/GObjectIntrospection">GObject Introspection</a> bindings for <a href="http://nodejs.org/">node.js</a>. But the stability and functionality of bindings were poor. We at <a href="http://nemein.com/en/">Nemein</a> decided that it's worth to try make it more functional and more stable. I spent some time with <a href="https://github.com/creationix/node-gir">node-gir</a> and finally there's something which looks very promising.</p>

<p>You can take a look at <a href="https://github.com/creationix/node-gir/tree/master/examples">examples</a> or <a href="https://github.com/creationix/node-gir/tree/master/tests/midgard">tests</a>. The latter use <a href="http://midgard-project.org/midgard2/">Midgard</a> content repository as a base.</p>
]]></description>
            <author>Piotr.pokora@nemein.com (Piotr Pokora)</author>
            <category>feed:ca06b7cc4d2cdd654bdc7a23aed4038e</category>
            <pubDate>Wed, 04 Jul 2012 05:20:19 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e1c5b287720d16c5b211e19a526f9c2b2ad0fed0fe</guid>
        </item>
        <item>
            <title>Aamiaisseminaari: Tabletit osana liiketoimintaa</title>
            <link>http://nemein.com/fi/blog/aamiaisseminaari-tabletit_osana_liiketoimintaa/</link>
            <description><![CDATA[
<p>Nemein järjestää aamiaisseminaarin aiheesta tabletit osana liiketoimintaa 5.4.2012 klo 8:30 - 11:00 Radisson Blu         Royal Hotellin auditoriossa osoitteessa Runeberginkatu 2, 00100         Helsinki. Seminaarin tarkoituksena on tarjota laaja-alainen näkemys tablettien hyödyntämiseen yrityksissä - myynnin, markkinoinnin ja liiketoiminnan tukena. Tule kuuntelemaan miten mobiililaitteet saadaan integroitua yrityksille tehokkaiksi työvälineiksi.</p>
<p>Seminaarin tarkempi ohjelma sekä ilmoittautuminen osoitteesta <a href="http://nemein.com/aamiaisseminaari">http://nemein.com/aamiaisseminaari</a>. Toivomme saavamme ennakkoilmoittautumiset 30.3 mennessä.</p>]]></description>
            <author>webmaster@nemein.com (Eetu Simpanen)</author>
            <pubDate>Mon, 19 Mar 2012 12:26:46 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e171becb1be66071be11e1b22643cc5cbf10411041</guid>
        </item>
        <item>
            <title>Nemein hakee lisää osaajia</title>
            <link>http://nemein.com/fi/blog/nemein_hakee_lisaa_osaajia/</link>
            <description><![CDATA[
<p>Hakuilmoitus<br /><br /><a href="http://www.barona.fi/tyonhakijalle/Avoimet-tyopaikat/web_ohjelmistosuunnittelija-10827?branch=1&amp;area=" target="_blank">http://www.barona.fi/tyonhakijalle/Avoimet-tyopaikat/web_ohjelmistosuunnittelija-10827?branch=1&amp;area=</a></p>]]></description>
            <author>kaisa.lepisto@nemein.com (Kaisa Lepistö)</author>
            <pubDate>Fri, 13 Jan 2012 14:03:58 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e13def7024abe63def11e1a8ab9bf6c9e69a769a76</guid>
        </item>
        <item>
            <title>Jouluterveiset</title>
            <link>http://nemein.com/fi/blog/christmas_greetings-002/</link>
            <description><![CDATA[
<p>Nemein kiittää asiakkaita ja yhteistyökumppaneita kuluneesta vuodesta ja toivottaa iloista joulua ja menestyksekästä uutta vuotta!</p>
<p>Tänä vuonna Nemein on lahjoittanut joulukortteihin tarkoitetut varat Suomen Punaisen Ristin  Katastrofirahastoon.</p>]]></description>
            <author>kaisa.lepisto@nemein.com (Kaisa Lepistö)</author>
            <pubDate>Tue, 20 Dec 2011 08:31:15 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e12ae4fb2ff5922ae411e1bf35db93f9c297919791</guid>
        </item>
        <item>
            <title>HelsinkiJS meetup at Nemein office on Monday</title>
            <link>http://nemein.com/fi/blog/helsinkijs_meetup_at_nemein_office_on_monday/</link>
            <description><![CDATA[
<p>The Helsinki JavaScript meetup will be<br />hosted at the Nemein office on Monday 17th starting at 7pm.</p>
<p><a href="http://lanyrd.com/2011/helsinkijs-december/" target="_blank">http://lanyrd.com/2011/helsinkijs-december/</a></p>]]></description>
            <author>kaisa.lepisto@nemein.com (Kaisa Lepistö)</author>
            <pubDate>Fri, 09 Dec 2011 14:01:59 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e1226e5cd79c02226e11e1ac4ddb8859a647804780</guid>
        </item>
        <item>
            <title>Nemeinin ostama Infigo neljäntenä Technology Fast 50 Rising Stars -listalla</title>
            <link>http://nemein.com/fi/blog/nemein-s_purchase_infigo_fourth_on_technology_fast_50_rising_stars/</link>
            <description><![CDATA[
<p>Nemeinin ostama Infigo Finland Oy on sijoittunut Deloitten vuoden 2011 Technology Fast 50 - Rising Stars -listauksessa neljänneksi.</p>
<p><a href="http://www.deloitte.com/view/fi_FI/fi/ajankohtaista/technology_fast_50500/95cf873c19d73310VgnVCM1000001a56f00aRCRD.htm" target="_blank">Deloitten lista</a></p>]]></description>
            <author>kaisa.lepisto@nemein.com (Kaisa Lepistö)</author>
            <pubDate>Tue, 08 Nov 2011 15:54:30 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e10a21f20435d40a2111e1b985a7a3027bd32ad32a</guid>
        </item>
        <item>
            <title>GObject Introspection Content Repository</title>
            <link>http://nemein.com/fi/blog/gobject_introspection_content_repository/</link>
            <description><![CDATA[

<p><a href="http://www.midgard-project.org/api-docs/gicr/GICR/">GICR</a> is an effort to provide set of common API based on <a href="http://en.wikipedia.org/wiki/Content_repository_API_for_Java">JCR</a> one. It's written in vala, so it's fully introspectable by any language which supports GObject Introspection.</p>

<p>The part of <a href="https://github.com/midgardproject/GICR#readme">project's readme</a> summarizes it well:</p>

<p><em>By using GICR APIs, a GObject-based application can use the standard interfaces for nodes, tree management, versioning and structured queries regardless of how the data is actually stored.</em></p>

<p>There's <a href="https://github.com/midgardproject/gicr-midgard2">gicr-midgard2</a> which is first and initial implementation of GICR.</p>

<p>Simple <a href="https://github.com/midgardproject/gicr-midgard2/tree/master/examples">examples</a> demonstrate easy of use:</p>

<p>Initialize repository:</p>

<pre><code>Repository repository = get_repository ();
</code></pre>

<p>Create new session:</p>

<pre><code>var credentials = new SimpleCredentials ("admin", "password");
Session session = repository.login (credentials, null);
</code></pre>

<p>From external xml file, import data to repository</p>

<pre><code>session.import_xml ("/", Environment.get_current_dir () + "/import_example.xml", 0);
</code></pre>

<p>Persist data</p>

<pre><code>session.save ();
</code></pre>

<p>You can create new session for the same repository</p>

<pre><code>Session readSession = repository.login (null, null);
</code></pre>

<p>And get stored node by its path</p>

<pre><code>GICR.Node exampleNode = readSession.get_node ("/tests_general_base/idExample");
</code></pre>

<p>And finally, read node's properties</p>

<pre><code>stdout.printf ("Node type '%s' created at '%s' \n",
    exampleNode.get_node_property ("jcr:primaryType").get_string (),
    exampleNode.get_node_property ("jcr:created").get_string ()
);
</code></pre>
]]></description>
            <author>Piotr.pokora@nemein.com (Piotr Pokora)</author>
            <category>feed:ca06b7cc4d2cdd654bdc7a23aed4038e</category>
            <pubDate>Mon, 07 Nov 2011 11:48:36 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e1094cffc3f5a4094c11e19bbf43936cc347f647f6</guid>
        </item>
        <item>
            <title>Finland's strongest 2007-2011 -certificate to Nemein</title>
            <link>http://nemein.com/fi/blog/finland-s_strongest_2007-2011-certificate_to_nemein/</link>
            <description><![CDATA[
<p>Nemein has achieved the highest credit rating five years in a row. Finland's strongest 2007-2011 -certificate indicates the financial solidity of Nemein and that our company is a reliable partner.</p>
<p style="text-align:center;"><img src="http://nemein.com/en/blog/sv2011_nemein_oy_fi_101124_plat-png.jpg" border="0" alt="SV2011_Nemein_Oy_FI_101124_PLAT.png" title="SV2011_Nemein_Oy_FI_101124_PLAT.png" /></p>]]></description>
            <author>kaisa.lepisto@nemein.com (Kaisa Lepistö)</author>
            <pubDate>Fri, 09 Sep 2011 12:28:23 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e0dadf35d67b9adadf11e09089155f2d40a2aaa2aa</guid>
        </item>
        <item>
            <title>Suomen Vahvimmat 2007-2011 -sertifikaatti Nemeinille</title>
            <link>http://nemein.com/fi/blog/suomen_vahvimmat_2007-2011-sertifikaatti_nemeinille/</link>
            <description><![CDATA[
<p>Nemein on saavuttanut korkeimman luottoluokituksen nyt jo viitenä vuotena peräkkäin.<br />Suomen Vahvimmat -sertifikaatti on merkki siitä, että Nemein on luotettava yhteistyökumppani ja taloudellisesti vakaalla pohjalla.</p>
<p style="text-align:center;"><img src="http://nemein.com/fi/blog/sv2011_nemein_oy_fi_101124_plat-png.jpg" border="0" alt="SV2011_Nemein_Oy_FI_101124_PLAT.png" title="SV2011_Nemein_Oy_FI_101124_PLAT.png" /></p>]]></description>
            <author>kaisa.lepisto@nemein.com (Kaisa Lepistö)</author>
            <pubDate>Fri, 09 Sep 2011 12:23:21 +0000</pubDate>
            <guid>http://nemein.com/fi/midcom-permalink-1e0dade819ff688dade11e0b03c51e5e1c2f65af65a</guid>
        </item>
    </channel>
</rss>
