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

<channel>
	<title>Anders Hassis</title>
	<atom:link href="http://hassis.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://hassis.com</link>
	<description>Did mmorpgs overwrite your common sense?</description>
	<lastBuildDate>Tue, 02 Apr 2013 16:29:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Remove Previous, Next and Done buttons from keyboard in Phonegap in iOS</title>
		<link>http://hassis.com/2013/04/02/remove-previous-next-and-done-buttons-from-keyboard-in-phonegap/</link>
		<comments>http://hassis.com/2013/04/02/remove-previous-next-and-done-buttons-from-keyboard-in-phonegap/#comments</comments>
		<pubDate>Tue, 02 Apr 2013 15:30:39 +0000</pubDate>
		<dc:creator>Anders</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Phonegap]]></category>

		<guid isPermaLink="false">/?p=830</guid>
		<description><![CDATA[I&#8217;ve been working on my first Phonegap project together with a friend the last week or so. He&#8217;s been developing most of the app for Android and Eclipse, and my job is to make sure it runs smoothly in iOS. It contains in-apps and some other goodies that I will post about later. Hide buttons [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been working on my first Phonegap project together with a friend the last week or so. He&#8217;s been developing most of the app for Android and Eclipse, and my job is to make sure it runs smoothly in iOS. It contains in-apps and some other goodies that I will post about later.</p>
<h2>Hide buttons</h2>
<p>Since everything in Phonegap is a UIWebView, I needed a way to get rid of the silly previous, next and done buttons when focusing my keyboard. This uses private API:s so it will make your app rejected if you submit with this code.<br />
<a href="/static/uploads/hassis.com/2013/04/6X1vv.png" rel="lightbox[830]" title="Remove Previous, Next and Done buttons from keyboard in Phonegap in iOS"><img src="/static/uploads/hassis.com/2013/04/6X1vv-153x300.png" alt="6X1vv" width="153" height="300" class="alignnone size-medium wp-image-831" /></a></p>
<p>The solution is to modify your AppDelegate.m to something like this:<br />
<script src="https://gist.github.com/parse/5293074.js"></script></p>
<h2>Remove and add focus on keyboard</h2>
<p>When bringing a keyboard in and out, use the following to remove focus from it</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#searchform-1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">blur</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And use this to bring focus to an input field:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#searchform-1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">focus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://hassis.com/2013/04/02/remove-previous-next-and-done-buttons-from-keyboard-in-phonegap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Swedish Startup Space launched!</title>
		<link>http://hassis.com/2013/03/14/swedish-startup-space-launched/</link>
		<comments>http://hassis.com/2013/03/14/swedish-startup-space-launched/#comments</comments>
		<pubDate>Thu, 14 Mar 2013 07:46:02 +0000</pubDate>
		<dc:creator>Anders</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">/?p=829</guid>
		<description><![CDATA[Last week a friend of mine got in touch with me, asking for help about a website he&#8217;s been trying to put together on his own. James now works at Helishopter and previously worked for Jameslist. He wanted to create a community for swedish startups, it was something he and many others felt was missing for the [...]]]></description>
				<content:encoded><![CDATA[<p>Last week a friend of mine got in touch with me, asking for help about a website he&#8217;s been trying to put together on his own. James now works at <a href="http://helishopter.com/">Helishopter</a> and previously worked for <a href="http://www.jamesedition.com/">Jameslist</a>. He wanted to create a community for swedish startups, it was something he and many others felt was missing for the swedish startup scene.</p>
<p>Said and done, <a href="http://swedishstartupspace.com">yesterday we launched our first version</a>. It was running on Heroku for a few hours but the site broke down and I had to move the site in haste to Binero. Since we are running WordPress and all the media assets is on Amazon S3 it is very easy to migrate the site to another host. We will make sure to make the new setup more stable before we attempt to move it again.</p>
<p><a href="http://swedishstartupspace.com">Head over and visit us</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://hassis.com/2013/03/14/swedish-startup-space-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrate Testflight, Flurry and Corona SDK</title>
		<link>http://hassis.com/2013/02/13/integrate-testflight-flurry-and-corona-sdk/</link>
		<comments>http://hassis.com/2013/02/13/integrate-testflight-flurry-and-corona-sdk/#comments</comments>
		<pubDate>Wed, 13 Feb 2013 17:23:03 +0000</pubDate>
		<dc:creator>Anders</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Corona SDK]]></category>
		<category><![CDATA[ios]]></category>

		<guid isPermaLink="false">/?p=824</guid>
		<description><![CDATA[Testflight I use Testflight to coordinate pre-releases of software I develop for the iOS platform. Testflight is an amazing tool and I&#8217;m surprised Apple hasn&#8217;t bought the company yet. You simply create a group of people, send out invites and have them register their devices with Testflight. Unfortunately, the provisioning profile in the iOS ecosystem is [...]]]></description>
				<content:encoded><![CDATA[<h2>Testflight</h2>
<p>I use <a href="http://testflightapp.com/">Testflight</a> to coordinate pre-releases of software I develop for the iOS platform. Testflight is an amazing tool and I&#8217;m surprised Apple hasn&#8217;t bought the company yet. You simply create a group of people, send out invites and have them register their devices with Testflight. Unfortunately, the provisioning profile in the iOS ecosystem is a huge clusterf*ck, so you have to manually and not to mention painfully add these identifiers to your provisioning profile in the Apple Developer Portal.</p>
<p>When the profile is updated with the correct devices, you upload the .IPA to Testflight and add some release notes and hit send. The people participating in your beta release will then get an email that they can download a new version.</p>
<h2>Testflight and Corona SDK</h2>
<p>At work, we use the <a href="http://www.coronalabs.com/">Corona SDK</a> to develop multi platform games. Corona Labs describes their product as follows:</p>
<blockquote><p>Corona SDK is the leading mobile development framework. Build high-quality apps and games for iOS, Android, Kindle Fire and Nook in record time.</p></blockquote>
<p>It works remarkably well, not too much problems and it&#8217;s easy to deploy. Anyway, to integrate Corona SDK and Testflight you need to do a couple of things:</p>
<ul>
<li>Build your software and generate the application and it&#8217;s zip file</li>
<li>Create a new folder called &#8216;Payload&#8217; and move the application file into it</li>
<li>Compress that file and change its extension to .ipa instead of .zip</li>
<li>Upload the IPA to Testflight</li>
</ul>
<h2>Flurry</h2>
<div id="attachment_827" class="wp-caption alignnone" style="width: 590px"><a href="/static/uploads/hassis.com/2013/02/Screen-Shot-2013-02-10-at-13.48.39.png" rel="lightbox[824]" title="Integrate Testflight, Flurry and Corona SDK"><img class="size-large wp-image-827" alt="Screen Shot 2013-02-10 at 13.48.39" src="/static/uploads/hassis.com/2013/02/Screen-Shot-2013-02-10-at-13.48.39-1024x103.png" width="580" height="58" /></a><p class="wp-caption-text">Flurry&#8217;s error log</p></div>
<p>Flurry is a great tool for gathering statistics, I&#8217;ve used it in all applications I&#8217;ve created for iOS and made sure its been used on Android as well. One of the best features for me as a developer is the fact that I get access to the crash reports (see the picture below).</p>
<p>To use Flurry with Corona, you use <a href="http://developer.coronalabs.com/reference/index/analytics">their analytics library</a>.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="lua" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- Import library and initialize with personal application key </span>
<span style="color: #0000aa;">require</span> <span style="color: #ff6666;">&quot;analytics&quot;</span>
analytics<span style="color: #66cc66;">.</span>init<span style="color: #66cc66;">&#40;</span> <span style="color: #ff6666;">&quot;YOUR_APP_KEY&quot;</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">-- Log event ID</span>
analytics<span style="color: #66cc66;">.</span>logEvent<span style="color: #66cc66;">&#40;</span> <span style="color: #ff6666;">&quot;Event ID&quot;</span> <span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>One thing I sometimes wish I would&#8217;ve implemented earlier in the project, is a log inside the app. The log should save the current state and the roadmap with the relevant server/client calls that took them there. It should also include the option to send this log to the developer.</p>
<div id="attachment_826" class="wp-caption alignnone" style="width: 179px"><a href="/static/uploads/hassis.com/2013/02/2013-02-10-13.45.02.png" rel="lightbox[824]" title="Integrate Testflight, Flurry and Corona SDK"><img class="size-medium wp-image-826" alt="2013-02-10 13.45.02" src="/static/uploads/hassis.com/2013/02/2013-02-10-13.45.02-169x300.png" width="169" height="300" /></a><p class="wp-caption-text">Evernote&#8217;s log</p></div>
<p>Evernote has implemented this very neat and it could be of tremendous help when debugging the communication between the server and the clients.</p>
]]></content:encoded>
			<wfw:commentRss>http://hassis.com/2013/02/13/integrate-testflight-flurry-and-corona-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Game of Life implementation in Erlang</title>
		<link>http://hassis.com/2013/01/19/game-of-life-implementation-in-erlang/</link>
		<comments>http://hassis.com/2013/01/19/game-of-life-implementation-in-erlang/#comments</comments>
		<pubDate>Sat, 19 Jan 2013 09:23:00 +0000</pubDate>
		<dc:creator>Anders</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Erlang]]></category>

		<guid isPermaLink="false">/?p=822</guid>
		<description><![CDATA[Background The universe of the Game of Life is a two-dimensional grid of square cells, each of which is in one of two possible states, dead or alive. Each cell interacts with its eight neighbors, those cells that are horizontally, vertically, or diagonally adjacent. At each unit of time the following transitions occur: Any living [...]]]></description>
				<content:encoded><![CDATA[<h3>Background</h3>
<p>The universe of the Game of Life is a two-dimensional grid of square cells, each of which is in one of two possible states, dead or alive. Each cell interacts with its eight neighbors, those cells that are horizontally, vertically, or diagonally adjacent. At each unit of time the following transitions occur:</p>
<ul>
<li>Any living cell with fewer than two living neighbors dies, as if by under-population.</li>
<li>Any living cell with two or three living neighbors lives on to the next generation.</li>
<li>Any living cell with more than three living neighbors dies, as if by overcrowding.</li>
<li>Any dead cell with exactly three living neighbors becomes alive, as if by reproduction.</li>
</ul>
<p>For an assignment at school, my classmate Jonatan and I were to implement this in Erlang.</p>
<h3>Demonstration</h3>
<p>This video demonstrates the finished game and two examples called a pulsar and a glider.<br />
<iframe src="http://www.youtube.com/embed/lZ_pKYiKX8o?rel=0" height="360" width="640" allowfullscreen="" frameborder="0"></iframe></p>
<h3>Source code</h3>
<p>First off, here is the main program. If you would like some more information before seeing the code keep scrolling.<br />
<script type="text/javascript" src="https://gist.github.com/4571521.js"></script></p>
<h4>Data representation</h4>
<p>The input to our program is represented as a list of {X,Y} tuples containing coordinates. Our internal data is represented as a single list using the indices of the list as a one-dimensional representation of the grid. This was chosen over representing the game and its input as multi-dimensional arrays for simplicity.</p>
<p>Note: the worst random access time of a list compared to an array is negligible as random access is only required once during the setup.</p>
<p>Each cell contains information about its coordinate, current state (dead or alive), list of its neighbors, and information about them such as number of living neighbors.</p>
<h4>Synchronization</h4>
<p>To keep our game in sync and avoid race conditions we use a &#8220;master&#8221; process to notify all cells when a new unit of time (tic) begins. Each cell responds by sending its current state to all of its neighbors then waits for its neighbors to send their current state. When all current states have been collected the new cell state is updated and drawn. This avoids synchronization issues by making sure all processes start at roughly the same time.</p>
<p>Source code for supporting files is <a href="https://gist.github.com/4571529">available in this Gist</a>.</p>
<p>To run the program:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #ff3c00;">c</span><span style="color: #109ab8;">&#40;</span>ehtml<span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span> 
<span style="color: #ff3c00;">c</span><span style="color: #109ab8;">&#40;</span>frame<span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span> 
<span style="color: #ff3c00;">c</span><span style="color: #109ab8;">&#40;</span>gol<span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span>
gol:<span style="color: #ff3c00;">gol</span><span style="color: #109ab8;">&#40;</span><span style="color: #ff9600;">40</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">40</span><span style="color: #6bb810;">,</span><span style="color: #109ab8;">&#91;</span><span style="color: #109ab8;">&#123;</span><span style="color: #ff9600;">5</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">4</span><span style="color: #109ab8;">&#125;</span><span style="color: #6bb810;">,</span><span style="color: #109ab8;">&#123;</span><span style="color: #ff9600;">3</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">5</span><span style="color: #109ab8;">&#125;</span><span style="color: #6bb810;">,</span><span style="color: #109ab8;">&#123;</span><span style="color: #ff9600;">5</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">5</span><span style="color: #109ab8;">&#125;</span><span style="color: #6bb810;">,</span><span style="color: #109ab8;">&#123;</span><span style="color: #ff9600;">4</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">6</span><span style="color: #109ab8;">&#125;</span><span style="color: #6bb810;">,</span><span style="color: #109ab8;">&#123;</span><span style="color: #ff9600;">5</span><span style="color: #6bb810;">,</span><span style="color: #ff9600;">6</span><span style="color: #109ab8;">&#125;</span><span style="color: #109ab8;">&#93;</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span></pre></td></tr></table></div>

<p>Open a browser and go to the URL <em>http://localhost:8088/</em></p>
<h3>Known bugs</h3>
<p>The update rate for the browser is not in sync with the actual game update. This causes some irregular behaviour in the visualization of the game.</p>
<h3>Summary</h3>
<p>I would like to try to make a version of Game of Life in Node.js and see what advantages Node.js brings to the table in a GoL-implementation.</p>
]]></content:encoded>
			<wfw:commentRss>http://hassis.com/2013/01/19/game-of-life-implementation-in-erlang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Disqus for comments</title>
		<link>http://hassis.com/2013/01/14/using-disqus-for-comments/</link>
		<comments>http://hassis.com/2013/01/14/using-disqus-for-comments/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 07:42:35 +0000</pubDate>
		<dc:creator>Anders</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Disqus]]></category>

		<guid isPermaLink="false">/?p=821</guid>
		<description><![CDATA[Yesterday I finished the transition for my comments on this blog to Disqus. Let me know if you find any errors. On a side note, me and Pär H spent most of yesterday migrating all comments for another big site, unfortunately we had  70 000 spam comments in the system. Getting those into Disqus was a real treat. After [...]]]></description>
				<content:encoded><![CDATA[<p>Yesterday I finished the transition for my comments on this blog to Disqus. Let me know if you find any errors.</p>
<p>On a side note, me and <a href="http://parhaggstrom.com">Pär H</a> spent most of yesterday migrating all comments for another big site, unfortunately we had  70 000 spam comments in the system. Getting those into Disqus was a real treat. After unsuccessfully trying to run some sort of spam control on them, we decided to mark all comments as spam and go through the comments manually and approve those that weren&#8217;t spam.</p>
<p>Note to self, always use Akismet or something similar.</p>
]]></content:encoded>
			<wfw:commentRss>http://hassis.com/2013/01/14/using-disqus-for-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running PHP applications on Heroku</title>
		<link>http://hassis.com/2013/01/06/running-php-applications-on-heroku/</link>
		<comments>http://hassis.com/2013/01/06/running-php-applications-on-heroku/#comments</comments>
		<pubDate>Sun, 06 Jan 2013 15:56:40 +0000</pubDate>
		<dc:creator>Anders</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Heroku]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">/?p=819</guid>
		<description><![CDATA[These last weeks I&#8217;ve been working on trying to organize my domain names and web hosting accounts. I&#8217;m running this blog and several other websites on a VPS as a WordPress multisite. The other applications that I am running are small PHP applications. I&#8217;ve been looking into running the other applications on Heroku. By moving these [...]]]></description>
				<content:encoded><![CDATA[<p>These last weeks I&#8217;ve been working on trying to organize my domain names and web hosting accounts. I&#8217;m running this blog and several other websites on a VPS as a WordPress multisite. The other applications that I am running are small PHP applications. I&#8217;ve been looking into running the other applications on <a href="http://www.heroku.com">Heroku</a>. By moving these away from my current web hosting account I can cancel that account and use it for domain names and their DNS control panel.</p>
<p>If you would like to try running PHP applications on Heroku I suggest you create an account and create a new app at the Cedar stack (for PHP support). Then sign up for an account at Amazon S3. I use Amazon S3 for their cloud storage and keep my transfers and data (less than 5 GB) beneath their free tier to keep my costs minimal. To stay at Herokus free tier you can&#8217;t store more than 5 MB for the MySQL database and not more than 10 000 rows on the Postgres database. The PHP applications I&#8217;m running at Heroku is using MySQL as a database backend and databases at Heroku can get costly fast, especially when using several dynos.</p>
<p>If you&#8217;re not running your PHP application in the webroot, take a look at <a href="https://github.com/winglian/Heroku-PHP">https://github.com/winglian/Heroku-PHP</a> for instructions on how to change the webroot at Heroku.</p>
<p><strong>Advantages</strong></p>
<ul>
<li>Easy to deploy, my old hosting service didn&#8217;t support SSH access or any other way to do a proper deployment.</li>
<li>Cheap (maybe even free&#8230;?) for small applications.</li>
<li>Minimal maintenance since I don&#8217;t have to administer a VPS.</li>
</ul>
<p><strong>Downsides</strong></p>
<ul>
<li>If you start adding dynos, it gets really expensive.</li>
<li>Your Ruby on Rails applications on the free account winds down after idling for a while and has a startup time that feels like forever. That doesn&#8217;t happen for the paid accounts. This doesn&#8217;t apply on PHP applications though.</li>
</ul>
<p>After doing this test run, I will definitely look into running this WordPress Multisite at Heroku instead of having my own VPS.</p>
]]></content:encoded>
			<wfw:commentRss>http://hassis.com/2013/01/06/running-php-applications-on-heroku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inspect SQL queries generated by Ruby on Rails</title>
		<link>http://hassis.com/2012/12/16/inspect-sql-queries-generated-by-ruby-on-rails/</link>
		<comments>http://hassis.com/2012/12/16/inspect-sql-queries-generated-by-ruby-on-rails/#comments</comments>
		<pubDate>Sun, 16 Dec 2012 15:47:16 +0000</pubDate>
		<dc:creator>Anders</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">/?p=816</guid>
		<description><![CDATA[I&#8217;m currently working on a rewrite of XCStorm, my website dedicated to crawling the web for news about cross country skiing. I&#8217;m using Heroku for hosting and for development I&#8217;m running SQLite and for staging/production its Postgres (I know its bad practice to mix&#8230;). Anyway, I found myself in a situation where I needed to [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m currently working on a rewrite of <a href="http://xcstorm.com">XCStorm</a>, my website dedicated to crawling the web for news about cross country skiing.</p>
<div id="attachment_817" class="wp-caption alignnone" style="width: 603px"><a href="/static/uploads/hassis.com/2012/12/Screen-Shot-2012-12-16-at-16.43.12.png" rel="lightbox[816]" title="Screen Shot 2012-12-16 at 16.43.12"><img class="wp-image-817" title="Screen Shot 2012-12-16 at 16.43.12" src="/static/uploads/hassis.com/2012/12/Screen-Shot-2012-12-16-at-16.43.12.png" alt="" width="593" height="231" /></a><p class="wp-caption-text">Preview of the new filter system at XCStorm</p></div>
<p>I&#8217;m using Heroku for hosting and for development I&#8217;m running SQLite and for staging/production its Postgres (I know its bad practice to mix&#8230;). Anyway, I found myself in a situation where I needed to compare SQL queries generated by the ORM.</p>
<p>Create a file named .irbrc and put this into it:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>.<span style="color:#9900CC;">logger</span> = <span style="color:#CC00FF; font-weight:bold;">Logger</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>STDOUT<span style="color:#006600; font-weight:bold;">&#41;</span></pre></td></tr></table></div>

<p>Afterwards, start your Rails console and enter your query.</p>
<p>The reason I&#8217;m mixing database adapters is because at this point it doesn&#8217;t matter since the data won&#8217;t be complex and its easier for my partner to setup and interact with the database.</p>
]]></content:encoded>
			<wfw:commentRss>http://hassis.com/2012/12/16/inspect-sql-queries-generated-by-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upcoming posts will be written in english</title>
		<link>http://hassis.com/2012/10/07/upcoming-posts-will-be-written-in-english/</link>
		<comments>http://hassis.com/2012/10/07/upcoming-posts-will-be-written-in-english/#comments</comments>
		<pubDate>Sun, 07 Oct 2012 19:00:29 +0000</pubDate>
		<dc:creator>Anders</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">/?p=814</guid>
		<description><![CDATA[A couple of friends from San Jose State University complained that Google Translate didn&#8217;t do the content much justice so I decided to try to write new posts in english.]]></description>
				<content:encoded><![CDATA[<p>A couple of friends from San Jose State University complained that Google Translate didn&#8217;t do the content much justice so I decided to try to write new posts in english. </p>
]]></content:encoded>
			<wfw:commentRss>http://hassis.com/2012/10/07/upcoming-posts-will-be-written-in-english/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Realtidssystem med OSEK och Lego Mindstorms NXT</title>
		<link>http://hassis.com/2012/10/05/realtidssystem-med-osek-och-lego-mindstorms-nxt/</link>
		<comments>http://hassis.com/2012/10/05/realtidssystem-med-osek-och-lego-mindstorms-nxt/#comments</comments>
		<pubDate>Fri, 05 Oct 2012 14:38:58 +0000</pubDate>
		<dc:creator>Anders</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[nxt]]></category>
		<category><![CDATA[osek]]></category>
		<category><![CDATA[Uppsala University]]></category>

		<guid isPermaLink="false">/?p=810</guid>
		<description><![CDATA[Bakgrund Ännu en gång har vi fått leka med Lego på skoltid, första gången var i en tidigare kurs i Distribuerade System för cirka ett och ett halvt år sedan. Senast så utförde vi projektet med hjälp av Lejos NXT och Java, den här gången använde vi nxtOSEK och programmeringsspråket C. Vår uppgift var att [...]]]></description>
				<content:encoded><![CDATA[<h3>Bakgrund</h3>
<p>Ännu en gång har vi fått leka med Lego på skoltid, första gången var i <a href="http://hassis.com/2011/03/22/runestone-2011-wall-e/">en tidigare kurs i Distribuerade System</a> för cirka ett och ett halvt år sedan. Senast så utförde vi projektet med hjälp av Lejos NXT och Java, den här gången använde vi <a href="http://lejos-osek.sourceforge.net/">nxtOSEK</a> och programmeringsspråket C. </p>
<p><a href="/static/uploads/hassis.com/2012/10/2012-09-27-13.29.29.jpg" rel="lightbox[810]" title="2012-09-27-13.29.29"><img src="/static/uploads/hassis.com/2012/10/2012-09-27-13.29.29-300x224.jpg" alt="" title="2012-09-27-13.29.29" width="300" height="224" class="alignright size-medium wp-image-811" /></a>Vår uppgift var att genomföra lite småuppgifter med en robot som vi konstruerade och avsluta med att göra en robot som följer ett streck på marken. I och med att det är en kurs i realtidssystem så måste det finnas något moment av realtid i det hela, så samtidigt som den ska följa ett streck ska den hela tiden avläsa avståndet till en robot som kommer köra framför och hålla 20cm avstånd.</p>
<p>OSEK är en implementation av ett RTOS (real time operating system) som är skapat av ett samarbete av tyska biltillverkare. NXT-implementationen hjälper sedan till med kopplingen mot hårdvaran, dvs sensorer och motorer.</p>
<p>Programmen skrivs i C och har en tillhörande .OIL-fil som innehåller en beskrivning av systemet med alla events, timers osv. Du använder sedan en rad verktyg för att kompilera ihop dessa och få in den på din Lego Mindstorms NXT.</p>
<h3>Vår uppgift</h3>
<p>Den ska som sagt följa ett streck och samtidigt hålla ett konstant avstånd till roboten framför. Uppgiften var hyfsat enkel att genomföra när vi fått klart för oss hur nxtOSEK fungerade, kommit ihåg hur API:erna till roboten fungerade och vilka saker man ska tänka på. </p>
<p>För att nämna några av utmaningarna vi har haft:</p>
<ul>
<li>Hur definieras mörker?</li>
<li>Hur hanterar man en bana som har kurvor? (Skarpa och/eller långa?)</li>
</ul>
<h3>Algoritm</h3>
<p>Vår algoritm för att hålla oss på banan är mycket enkel och bygger på att vi har en fast arm som vår sensor sitter fast på. </p>
<ol>
<li>Vi har ett task (LightTask) som läser av ljuset mot backen</li>
<li>Har ljuset ändrats sedan sist? Isf, läs av och kolla om den är högre eller lägre</li>
<li>Är det ljust så ändra så ena hjulet (hjul 1) går exempelvis 50 och det andra hjulet (hjul 2) går 20</li>
<li>Är det mörkt så ändra så hjul 1 går i 20 och hjul 2 går i 50.</li>
<li>Börja om</li>
</ol>
<p>Vi har gjort lite justeringar på detta så att den kör med en faktor när den räknar ut hur fort den ska köra. Detta för att den ska ha möjlighet att &#8220;smyga&#8221; framåt om det är ganska nära.</p>
<h3>Demonstration</h3>
<p><iframe src="http://www.youtube.com/embed/1v-PiVwC1no" frameborder="0" width="480" height="360"></iframe></p>
<h3>Källkod</h3>
<p><a href="https://github.com/parse/UURealTimeHT2012/tree/master/lab2/part4">Finns på GitHub</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hassis.com/2012/10/05/realtidssystem-med-osek-och-lego-mindstorms-nxt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hett tips för Androidutvecklare, trådlös ADB</title>
		<link>http://hassis.com/2012/09/18/hett-tips-for-androidutvecklare-tradlos-adb/</link>
		<comments>http://hassis.com/2012/09/18/hett-tips-for-androidutvecklare-tradlos-adb/#comments</comments>
		<pubDate>Tue, 18 Sep 2012 19:50:25 +0000</pubDate>
		<dc:creator>Anders</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">/?p=808</guid>
		<description><![CDATA[För alla er som utvecklar för Android och har en rootad telefon, kolla in adbWireless som är en gratis programvara för att kunna köra ADB trådlöst över wifi. Underskatta inte känslan av att kunna testa och köra ADB trådlöst!]]></description>
				<content:encoded><![CDATA[<p>För alla er som utvecklar för Android och har en rootad telefon, kolla in <a href="http://play.google.com/store/apps/details?id=siir.es.adbWireless&amp;referrer=utm_source%3Dandroidcentral%26utm_medium%3Dblog%26utm_campaign%3Dbloglink">adbWireless</a> som är en gratis programvara för att kunna köra ADB trådlöst över wifi.</p>
<p>Underskatta inte känslan av att kunna testa och köra ADB trådlöst!</p>
]]></content:encoded>
			<wfw:commentRss>http://hassis.com/2012/09/18/hett-tips-for-androidutvecklare-tradlos-adb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
