<?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>exploration</title>
	<atom:link href="http://robertcarlsen.net/feed" rel="self" type="application/rss+xml" />
	<link>http://robertcarlsen.net</link>
	<description>accounts of success and misadventure</description>
	<lastBuildDate>Wed, 09 Jan 2013 14:26:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>moar Fusion!</title>
		<link>http://robertcarlsen.net/2012/12/18/moar-fusion-1440</link>
		<comments>http://robertcarlsen.net/2012/12/18/moar-fusion-1440#comments</comments>
		<pubDate>Wed, 19 Dec 2012 03:45:12 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[fusion tables]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile logger]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1440</guid>
		<description><![CDATA[Fusion Tables is neat. Google describes it as &#8216;an experimental data visualization web application to gather, visualize, and share larger data tables&#8217;. Last year I tried out their API which was mostly based on sending SQL statements to create and manipulate tables. Recently, I looked at Fusion Tables again as part of an imminent upgrade [...]]]></description>
				<content:encoded><![CDATA[<p>Fusion Tables is neat. Google <a href="http://support.google.com/fusiontables/answer/2571232/?hl=en" onclick="pageTracker._trackPageview('/outgoing/support.google.com/fusiontables/answer/2571232/?hl=en&amp;referer=');">describes</a> it as &#8216;an experimental data visualization web application to gather, visualize, and share larger data tables&#8217;. Last year I tried out their API which was mostly based on sending SQL statements to create and manipulate tables. Recently, I looked at Fusion Tables again as part of an imminent upgrade to Mobile Logger. The API has been upgraded to &#8220;v1&#8243;, is now much more RESTful and enforces OAuth 2.0 authentication.</p>
<p>Once again, fired up Titanium Appcelerator to dig into the Mobile Logger source code. Every time I look at Appcerelator I&#8217;m reminded why I have opted to focus on Objective-C. Not going to get into a religious war&#8230;it just feels cumbersome. That could just as easily be attributed to my general unfamiliarity with the Titanium Studio and toolchain, since I&#8217;m otherwise using Xcode and Objective-C daily. Still, it&#8217;s much better now than when I first started Mobile Logger in 2009—using vim because Titanium did not have an IDE (or documentation, for that matter).</p>
<p>Back to Fusion Tables&#8230;it&#8217;s fairly easy to create a new table and import all the data from logs. Two authenticated calls: one to create the table and receive it&#8217;s ID, and another to use that ID with CSV data in a batch import. Once in Google Drive it&#8217;s trivial to map the data and play in various ways to chart the data. Nothing special, but here is a quick result from a <a href="http://goo.gl/3OwTK" onclick="pageTracker._trackPageview('/outgoing/goo.gl/3OwTK?referer=');">walk in the park</a>.</p>
<p>For now, I&#8217;ve only gotten a one way trip going. Haven&#8217;t tried to reconcile changes bidirectionally, or enabled updates to existing tables&#8230;but it seems like a promising start. Beta testing the next release of Mobile Logger now. Release likely just after the new year when iTunes Connect reopens. In the meantime, the code is up on <a href="https://github.com/rcarlsen/Mobile-Logger" onclick="pageTracker._trackPageview('/outgoing/github.com/rcarlsen/Mobile-Logger?referer=');">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2012/12/18/moar-fusion-1440/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sorry &#8217;bout that</title>
		<link>http://robertcarlsen.net/2012/04/22/sorry-bout-that-1426</link>
		<comments>http://robertcarlsen.net/2012/04/22/sorry-bout-that-1426#comments</comments>
		<pubDate>Sun, 22 Apr 2012 19:01:09 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hacked]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[yuk]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1426</guid>
		<description><![CDATA[Caught the base64_decode php attack&#8230;stupid world writable dir permissions. Should be better now. Reference: Dan Hill&#8217;s cleanup post]]></description>
				<content:encoded><![CDATA[<p>Caught the base64_decode php attack&#8230;stupid world writable dir permissions. Should be better now. </p>
<p>Reference:<br />
<a href="http://danhilltech.tumblr.com/post/18085864093/if-you-get-eval-base64-hacked-on-wordpress-dreamhost" onclick="pageTracker._trackPageview('/outgoing/danhilltech.tumblr.com/post/18085864093/if-you-get-eval-base64-hacked-on-wordpress-dreamhost?referer=');">Dan Hill&#8217;s cleanup post</a></p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2012/04/22/sorry-bout-that-1426/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(binary) C10CK app in App Store!</title>
		<link>http://robertcarlsen.net/2011/05/12/binary-c10ck-app-in-app-store-1411</link>
		<comments>http://robertcarlsen.net/2011/05/12/binary-c10ck-app-in-app-store-1411#comments</comments>
		<pubDate>Fri, 13 May 2011 04:44:02 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[binary clock]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[sale]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1411</guid>
		<description><![CDATA[My second (personal) iPhone app, C10CK, is now available in the App Store. It is a clock which displays time using binary notation &#8211; the same way everything is (eventually) stored in a digital computer. I&#8217;ve been using a binary clock since a staff member of ITP passed this past year and several alumni recalled [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/05/Screenshot-2011.05.03-23.05.00-1.png" rel="lightbox[1411]"><img class="alignright size-thumbnail wp-image-1385" title="C10CK Binary Coded Decimal display, learning mode, menu visible – iPhone" src="http://robertcarlsen.net/blog/wp-content/uploads/2011/05/Screenshot-2011.05.03-23.05.00-1-150x150.png" alt="" width="150" height="150" /></a>My second (personal) iPhone app, <a href="http://robertcarlsen.net/dev/c10ck">C10CK</a>, is now available in the <a href="http://itunes.apple.com/us/app/c10ck/id435870779?mt=8&amp;ls=1" onclick="pageTracker._trackPageview('/outgoing/itunes.apple.com/us/app/c10ck/id435870779?mt=8_amp_ls=1&amp;referer=');">App Store</a>. It is a clock which displays time using binary notation &#8211; the same way everything is (eventually) stored in a digital computer. I&#8217;ve been using a binary clock since a staff member of ITP passed this past year and several alumni recalled stories of the binary clock she kept on her desk and would happily explain to anyone who asked. I now keep a binary clock on my desk and think of her when people ask me what it is.<span id="more-1411"></span></p>
<p>This app started as a small pet project to work out a simple algorithm for visualizing bit values for integers. Shortly after that was working I added a special learning mode to help me remember the bit values. Eventually, it became an excuse to really play with new features in iOS 4 (gesture recognizers, block based animation, Grand Central Dispatch). I also enjoyed the opportunity to design an app from scratch after nearly a year of deep Cocoa immersion on some rather <a href="http://www.rga.com/work/nike-plus-gps-iphone-app" onclick="pageTracker._trackPageview('/outgoing/www.rga.com/work/nike-plus-gps-iphone-app?referer=');">complex projects</a> at work (I *finally* understand Key-Value-Observing).</p>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/05/Screenshot-2011.05.04-00.14.09.png" rel="lightbox[1411]"><img class="alignright size-thumbnail wp-image-1392" title="C10CK Binary Coded Decimal display, learning mode, menu visible – iPad" src="http://robertcarlsen.net/blog/wp-content/uploads/2011/05/Screenshot-2011.05.04-00.14.09-150x150.png" alt="" width="150" height="150" /></a>It also was a chance for me to make a universal iPhone / iPod touch and iPad app. It wasn&#8217;t so hard to code to take advantage of affordances offered by the larger screen (though, the differences in this app are rather simple). This is also my first (personal) paid app. Many of my reasons have been realized and stated far more eloquently than I could describe &#8211; to put it briefly, there is value in my work. A few dollars is mostly a token, but it&#8217;s recognition of the time and study which is needed to create something noteworthy. I&#8217;ve put in much effort here, even for such a simple app, to design a pleasant visual and user experience with many bits of polish. The audience for this app is limited to be sure (and there&#8217;s hefty competition in the app store) but buying the app is a sign of respect for fine craft, and hopefully something the purchaser finds useful, enjoyable or rewarding &#8211; it is a clock, after all.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2011/05/12/binary-c10ck-app-in-app-store-1411/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weekend project: ShairPort menulet</title>
		<link>http://robertcarlsen.net/2011/04/17/weekend-project-shairport-menulet-1365</link>
		<comments>http://robertcarlsen.net/2011/04/17/weekend-project-shairport-menulet-1365#comments</comments>
		<pubDate>Mon, 18 Apr 2011 01:18:32 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[shairport]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1365</guid>
		<description><![CDATA[Update: New version built around a native Cocoa port of ShairPort, MacShairport: ShairPort-v0.2.1.zip) Recently an open source emulator for AirPort Express / AirTunes was released by James Laird. I&#8217;ve been waiting for something like this for a long while to enable remote music playback on my media center from my laptop and iPhone. However, I lack the [...]]]></description>
				<content:encoded><![CDATA[<p>Update: New version built around a native Cocoa port of ShairPort, MacShairport: <a href="https://github.com/downloads/rcarlsen/ShairPortMenu/ShairPort-v0.2.1.zip" onclick="pageTracker._trackPageview('/outgoing/github.com/downloads/rcarlsen/ShairPortMenu/ShairPort-v0.2.1.zip?referer=');">ShairPort-v0.2.1.zip</a>)</p>
<p><img class="alignright size-full wp-image-1367" title="shairport-tease" src="http://robertcarlsen.net/blog/wp-content/uploads/2011/04/shairport-tease.png" alt="" width="178" height="158" />Recently an open source emulator for AirPort Express / AirTunes was <a href="http://mafipulation.org/blagoblig/2011/04/08#shairport" onclick="pageTracker._trackPageview('/outgoing/mafipulation.org/blagoblig/2011/04/08_shairport?referer=');">released</a> by James Laird. I&#8217;ve been waiting for something like this for a long while to enable remote music playback on my media center from my laptop and iPhone. However, I lack the hardware skills to extract the necessary firmware from the AirPort Express ROM chip. Thanks to James for doing the work and putting out his perl script / c utility. It&#8217;s pretty simple to build and run, and the <a href="https://github.com/albertz/shairport" onclick="pageTracker._trackPageview('/outgoing/github.com/albertz/shairport?referer=');">source</a> includes a nice OS X launcher script, but I&#8217;m looking for a little GUI widget to easily control it lest someone &#8216;inadvertently&#8217; decides to send audio to my computer.</p>
<p>I&#8217;ve been lately transitioning my iPhone-specific Cocoa knowledge to the desktop; this was a nice opportunity to wrap up the ShairPort scripts in an OS X menu bar widget. The source is available on <a href="https://github.com/rcarlsen/ShairPortMenu" onclick="pageTracker._trackPageview('/outgoing/github.com/rcarlsen/ShairPortMenu?referer=');">Github</a>, and you can get the bundled app below. This was made for my specific system, so YMMV.</p>
<p>ShairPortMenu: <a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/04/ShairPortMenu.zip">[download]</a></p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2011/04/17/weekend-project-shairport-menulet-1365/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Hello Fun-A-Day 7!</title>
		<link>http://robertcarlsen.net/2011/02/15/hello-fun-a-day-7-1327</link>
		<comments>http://robertcarlsen.net/2011/02/15/hello-fun-a-day-7-1327#comments</comments>
		<pubDate>Tue, 15 Feb 2011 05:43:45 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[make]]></category>
		<category><![CDATA[artclash]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[funaday]]></category>
		<category><![CDATA[philly]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1327</guid>
		<description><![CDATA[For this year&#8217;s Philadelphia Fun-A-Day project I decided to write &#8220;Hello World&#8221; programs. &#8220;Hello World&#8221; is a traditional programming tradition where a programmer encountering a new language writes a trivial program which displays the phrase &#8220;Hello World&#8221;. This introduces the programmer to the basic syntax of the language and demonstrates that their development environment is [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad-iphone.png" rel="lightbox[1327]"><img src="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad-iphone-150x150.png" alt="" title="fad-iphone" width="150" height="150" class="alignright size-thumbnail wp-image-1338" /></a>For this year&#8217;s Philadelphia <a href="http://artclash.com/" onclick="pageTracker._trackPageview('/outgoing/artclash.com/?referer=');">Fun-A-Day project</a> I decided to write &#8220;Hello World&#8221; programs. &#8220;Hello World&#8221; is a traditional programming tradition where a programmer encountering a new language writes a trivial program which displays the phrase &#8220;Hello World&#8221;.</p>
<p>This introduces the programmer to the basic syntax of the language and demonstrates that their development environment is set up properly to work with that language.</p>
<p>Much of our current environment runs on software, which is generally invisible to us, except when a failure impacts our lives. However, software generally starts as human-readable written text, albeit in a highly defined form using specific vocabulary.</p>
<p>This project attempts to make software visible, in at least a trivial way. The words and structure may differ between languages, but each program is a series of instructions to achieve some end &#8211; here to issue a friendly &#8220;Hello Fun-A-Day 7!&#8221;. Hopefully this can serve to demystify software to some degree, and remind us that software, at some point, has been written by a person.</p>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/Fun-A-Day-Lisp.jpg" rel="lightbox[1327]"><img class="alignright size-thumbnail wp-image-1328" title="Fun-A-Day-Lisp" src="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/Fun-A-Day-Lisp-150x150.jpg" alt="" width="150" height="150" /></a>The programs here demonstrate a Fun-A-Day variant on Hello World in several languages. I made an effort to explore historical and modern languages, compiled and interpreted languages, console and graphical programs, but avoided esoteric languages which are often difficult to understand by design.<br />
<span id="more-1327"></span><br />
The Association for Computing Machinery has a collection of Hello World programs:<br />
<a href="http://www2.latech.edu/~acm/HelloWorld.html" onclick="pageTracker._trackPageview('/outgoing/www2.latech.edu/_acm/HelloWorld.html?referer=');"> http://www2.latech.edu/~acm/HelloWorld.html</a></p>
<p>(Note: I&#8217;m generally referring to high-level languages, not considering assembly or binary code. If you&#8217;ve read this far, and understand what I mean, then you&#8217;ll forgive this simplification made for clarity of purpose)</p>
<hr />
<div style="max-width:500px">
<h3>Language: C</h3>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;stdio.h&gt;

int main(int argc, char* argv)
{
    printf(&quot;hello fun-a-day 7! \n&quot;);
    return 0;
}
</pre>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad-c.png" rel="lightbox[1327]"><img src="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad-c.png" alt="" title="fad-c" width="333" height="210" class="alignnone size-full wp-image-1341" /></a></p>
<h3>Language: JavaScript</h3>
<pre class="brush: jscript; title: ; notranslate">
// Use Rhino intrepreter to run in a shell
// http://www.mozilla.org/rhino/download.html

function sayHello() {
    print('Hello Fun-A-Day 7!');
};

sayHello();
</pre>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad7-js.png" rel="lightbox[1327]"><img src="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad7-js-300x96.png" alt="" title="fad7-js" width="300" height="96" class="alignnone size-medium wp-image-1345" /></a></p>
<h3>Language: Arduino / Wiring (C++)</h3>
<pre class="brush: cpp; title: ; notranslate">

#include &quot;WProgram.h&quot;

// prototypes
void blink(int n, int d);

#define unit 100
void dot(int n);
void dash(int n);
void gap();
void pause();
void space();

// variables
int ledPin = 13;                      // LED connected to digital pin 13

void setup(){
    Serial.begin(9600);               // opens serial port, sets data rate to 9600 bps

    pinMode(ledPin, OUTPUT);          // sets the digital pin as output
    
    // print a friendly message to the serial console:
    Serial.println(&quot;-------------------&quot;);
    Serial.println(&quot; Hello Fun-A-Day 7&quot;);
    Serial.println(&quot;-------------------&quot;);
}

void loop(){
    // display &quot;Hello Fun A Day 7&quot; in morse code:
    dot(4); pause();                  // H
    dot(1); pause();                  // E
    dot(1); dash(1); dot(2); pause(); // L
    dot(1); dash(1); dot(2); pause(); // L
    dash(3);                          // O
    space();
    dot(2); dash(1); dot(1); pause(); // F
    dot(2); dash(1); pause();         // U
    dash(1); dot(1);                  // N
    space();
    dot(1); dash(1);                  // A
    space();
    dash(1); dot(2); pause();         // D
    dot(1); dash(1); pause();         // A
    dash(1); dot(1); dash(2);         // Y
    space();
    dash(2); dot(3);                  // 7
    space();
    dot(3); dash(1); dot(1); dash(1); // end-of-message
    space();space();space();
    space();space();space();
}

void blink(int n, int d){
  for (int i=0;i&lt;n;i++)
  {
    digitalWrite(ledPin, HIGH);
    delay(d);
    digitalWrite(ledPin, LOW);
    delay(unit);
  }
}

// timing as specified by International Morse Code
void dot(int n) {
    blink(n, unit);
}

void dash(int n) {
    blink(n,3*unit);
}

void gap() {
    delay(unit);
}

void pause() {
    delay(3*unit);
}

void space() {
    delay(7*unit);
}

int main(void)
{
    init();
    setup();
    for (;;)
        loop();
    return 0;
}
</pre>
<h3>Language: Perl</h3>
<pre class="brush: perl; title: ; notranslate">
# Fun-A-Day 7
# Perl
#

sub sayHello {
    printf(&quot;Hello Fun-A-Day 7!\n&quot;);
}

sayHello;
</pre>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad-perl.png" rel="lightbox[1327]"><img src="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad-perl.png" alt="" title="fad-perl" width="326" height="220" class="alignnone size-full wp-image-1348" /></a></p>
<h3>Language: Cobol</h3>
<pre class="brush: plain; title: ; notranslate">
 IDENTIFICATION DIVISION.
      PROGRAM-ID. HELLO-WORLD.
      PROCEDURE DIVISION.
          DISPLAY 'Hello Fun-A-Day 7!'.
          STOP RUN.
</pre>
<h3>Language: BASIC</h3>
<pre class="brush: vb; title: ; notranslate">
10 print &quot;Hello Fun-A-Day 7!&quot;
20 goto 10
</pre>
<h3>Language: C++</h3>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;iostream&gt;
using namespace std;

class FunADay {
    public:
        FunADay () {};
        void sayHello() {
            cout &lt;&lt; &quot;Hello Fun-A-Day 7!&quot; &lt;&lt; endl;
        };
};

   
int main()
{
    FunADay *fad = new FunADay();
    fad-&gt;sayHello();
    delete fad;

    return 0;
}
</pre>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad09.png" rel="lightbox[1327]"><img src="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad09-300x236.png" alt="" title="fad09" width="300" height="236" class="alignnone size-medium wp-image-1349" /></a></p>
<h3>Language: bash</h3>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
#
# Fun-A-Day 7
# 

echo 'Hello Fun-A-Day 7!'
</pre>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad7-bash.png" rel="lightbox[1327]"><img src="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad7-bash.png" alt="" title="fad7-bash" width="419" height="230" class="alignnone size-full wp-image-1350" /></a></p>
<h3>Language: Processing</h3>
<pre class="brush: java; title: ; notranslate">
// Fun-A-Day 7
// Processing example

void setup()
{
  // initialize the canvas and set some paramaters
  size(100,100);
  smooth();
  noStroke();
}

void draw()
{
  // partially &quot;erase&quot; the previous screen
  // by drawing a semi-transparent, black rectangle on top
  fill(0,55);
  rect(0,0,width,height);

  // draw another ellipse
  fill(204);
  float x = random(width); float y = random(height);
  ellipseMode(CENTER);
  ellipse(x,y,20,20);
  
  // be friendly
  sayHello();
}

void sayHello()
{
  println(&quot;Hello Fun-A-Day 7!&quot;);
}
</pre>
<h3>Language: Python</h3>
<pre class="brush: python; title: ; notranslate">
# Fun-A-Day 7
# python example
#
# be sure to mind your indentation!

def sayHello():
    print &quot;Hello Fun-A-Day 7!&quot;

sayHello()
</pre>
<h3>Language: Ruby</h3>
<pre class="brush: ruby; title: ; notranslate">
class FunADay
    def sayHello()
        print &quot;Hello Fun-A-Day 7!&quot;
        print &quot;\n&quot;
    end
end

fad = FunADay.new
fad.sayHello
</pre>
<h3>Language: Java</h3>
<pre class="brush: java; title: ; notranslate">
package net.robertcarlsen;

public class FunADay {
	public static void sayHello()
	{
		System.out.println(&quot;Hello Fun-A-Day 7!&quot;);
	}
	
	public static void main(String[] args) {
		sayHello();
	}

}
</pre>
<h3>Language: C#</h3>
<pre class="brush: csharp; title: ; notranslate">
/* Fun-A-Day 7
 *
 * C#
 */

class HelloFunADay
{ 
  static void Main () {  
     System.Console.Write(&quot;Hello Fun-A-Day 7!\n&quot;);
  } 
}
</pre>
<h3>Language: sed (bash)</h3>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash

# This is just a simple example of using sed
# for find and replace.
# echo will just spit out the quoted text
# '|' is the pipe operator, and sends the output from
# echo to the next program, in this case sed
# sed is using the 's'earch operation
# 's/find stuff here/replace it here/'
# the parentheses match stuff that we can refer to later as \1
# .* means match any character, zero or more repeated times
# but it won't include the literal phrase &quot; World&quot; because that's
# specifically written in the match expression.

echo &quot;Hello World&quot; | sed 's/\(.*\) World/\1 Fun-A-Day 7!/'
</pre>
<h3>Language: Lisp</h3>
<pre class="brush: plain; title: ; notranslate">
;;; Fun-A-Day 7
;;; Robert Carlsen
;;;
;;; Lisp version

(defun sayhello ()
  &quot;the basic hello&quot; ; make sure to be friendly
  (format t &quot;Hello Fun-A-Day 7!&quot;)
)
</pre>
<h3>Language: php</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php
    printf(&quot;Hello Fun-A-Day 7! \n&quot;);
?&gt;
</pre>
<h3>Language: Go</h3>
<pre class="brush: cpp; title: ; notranslate">
package main

import &quot;fmt&quot;

func main() {
	fmt.Println(&quot;Hello, Fun-A-Day 7!&quot;)
}
</pre>
<h3>Language: Objective-C / Cocoa</h3>
<p>(There is far too much boilerplate code and dependent project files to paste here, but this is the bit which drives some simple interaction &#8211; displaying an alert if you tap the badger image several times)</p>
<pre class="brush: cpp; title: ; notranslate">
@interface Fun_a_Day7ViewController : UIViewController {
}

@property(nonatomic,retain)IBOutlet UILabel *badgerLabel;
- (IBAction)badger:(id)sender;
@end

@implementation Fun_a_Day7ViewController
@synthesize badgerLabel;

static int count = 0;

- (IBAction)badger:(id)sender;
{
    self.badgerLabel.hidden = !self.badgerLabel.hidden;
    
    if(++count &gt; 4) {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@&quot;Badger&quot;
                                                        message:@&quot;No, seriously...quit badgering me!&quot;
                                                       delegate:nil
                                              cancelButtonTitle:@&quot;Stop it&quot;
                                              otherButtonTitles:nil];
        [alert show];
        [alert release];
        count = 1;
    }
}
@end
</pre>
<h3>Language: R</h3>
<pre class="brush: bash; title: ; notranslate">
# Fun-a-day 7
# R language for statistical computing
#
fad_peeps &lt;- c(43,64,72,84,74,68)
years &lt;- seq(2010-5,2010)
data.frame(years,fad_peeps) -&gt; fadData
fadData
#  years fad_peeps
#1  2005        43
#2  2006        64
#3  2007        72
#4  2008        84
#5  2009        74
#6  2010        68
require(ggplot2)
qplot(years,fad_peeps,fadData) + geom_smooth()
</pre>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad-r.png" rel="lightbox[1327]"><img src="http://robertcarlsen.net/blog/wp-content/uploads/2011/02/fad-r-300x226.png" alt="" title="fad-r" width="300" height="226" class="aligncenter size-medium wp-image-1337" /></a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2011/02/15/hello-fun-a-day-7-1327/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling tesseract v3 for iPhone</title>
		<link>http://robertcarlsen.net/2010/09/24/compiling-tesseract-v3-for-iphone-1299</link>
		<comments>http://robertcarlsen.net/2010/09/24/compiling-tesseract-v3-for-iphone-1299#comments</comments>
		<pubDate>Fri, 24 Sep 2010 05:03:23 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[crosscompile]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[lazyweb]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tesseract]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1299</guid>
		<description><![CDATA[Update 2: Before using the script, ensure that you can build tesseract for your host system normally. Also, I only tested the script with the v3 release of tesseract, not svn HEAD. If you get build errors, please try with rev 498. Update: The script has been updated, thanks mostly to the prompting of fopen2003 [...]]]></description>
				<content:encoded><![CDATA[<p><strong>Update 2: Before using the  script, ensure that you can build tesseract for your host system normally. Also, I only tested the script with the v3 release of tesseract, not svn HEAD. If you get build errors, please try with rev 498.</strong></p>
<p><strong>Update: The script has been updated, thanks mostly to the prompting of fopen2003 in the comments below. I&#8217;ve successfully tested the resulting libs in both Simulator and an iPhone 4 (both at iOS4.x) using the <a href="http://github.com/rcarlsen/Pocket-OCR" onclick="pageTracker._trackPageview('/outgoing/github.com/rcarlsen/Pocket-OCR?referer=');">PocketOCR</a> project.</strong></p>
<p>After many requests, I finally got around to looking into updating the build script to cross-compile tesseract ocr v3 for use with iPhone. Here&#8217;s the script. It seems to build the static, fat library without error. I haven&#8217;t tried to update my app to use it yet, so I really don&#8217;t know if it even works. Let me know in the comments if it actually does indeed work.</p>
<ol>
<li>Check out the svn source of tesseract: http://code.google.com/p/tesseract-ocr/source/checkout</li>
<li>Copy this script into the source directory and run from there</li>
<li>Profit???</li>
</ol>
<p><span id="more-1299"></span></p>
<p>The libraries will be in a directory named &#8220;outdir&#8221;</p>
<pre class="brush: cpp; title: ; wrap-lines: true; notranslate">
#!/bin/sh
# build_fat.sh
#
# Created by Robert Carlsen on 15.07.2009. Updated 24.9.2010
# build an arm / i386 lib of standard linux project
#
# initially configured for tesseract-ocr v2.0.4
# updated for tesseract prerelease v3

outdir=outdir
mkdir -p $outdir/arm $outdir/i386

libdirs=( api ccutil ccmain ccstruct classify cutil dict image textord training viewer wordrec )
libs=( api ccutil main ccstruct classify cutil dict image textord training viewer wordrec )
count=${#libdirs[@]}


make distclean
unset CPPFLAGS CFLAGS LDFLAGS CPP CXX CC CXXFLAGS DEVROOT SDKROOT LD

export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS4.1.sdk
export CFLAGS=&quot;-arch armv6 -pipe -no-cpp-precomp -isysroot$SDKROOT -miphoneos-version-min=3.0 -I$SDKROOT/usr/include/&quot;
export CPPFLAGS=&quot;$CFLAGS&quot;
export CXXFLAGS=&quot;$CFLAGS&quot;
export LDFLAGS=&quot;-L$SDKROOT/usr/lib/&quot;
export LD=&quot;$DEVROOT/usr/bin/ld&quot;
export CPP=&quot;$DEVROOT/usr/bin/cpp-4.2&quot;
export CXX=&quot;$DEVROOT/usr/bin/g++-4.2&quot;
export CC=&quot;$DEVROOT/usr/bin/gcc-4.2&quot;
./configure --host=arm-apple-darwin 
make -j3

index=0
while [ &quot;$index&quot; -lt &quot;$count&quot; ]
do
    cp ${libdirs[index]}/.libs/libtesseract_${libs[index]}.a $outdir/arm/libtesseract_${libs[index]}_armv6.a
    ((index++))
done


make distclean
unset CPPFLAGS CFLAGS LDFLAGS CPP CXX CC CXXFLAGS DEVROOT SDKROOT LD

export DEVROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneSimulator4.1.sdk
export CFLAGS=&quot;-arch i386 -pipe -no-cpp-precomp -isysroot$SDKROOT -miphoneos-version-min=3.0 -I$SDKROOT/usr/include/&quot;
export CPPFLAGS=&quot;$CFLAGS&quot;
export CXXFLAGS=&quot;$CFLAGS&quot;
export LDFLAGS=&quot;-L$SDKROOT/usr/lib/&quot;
export LD=&quot;$DEVROOT/usr/bin/ld&quot;
export CPP=&quot;$DEVROOT/usr/bin/cpp-4.2&quot;
export CXX=&quot;$DEVROOT/usr/bin/g++-4.2&quot;
export CC=&quot;$DEVROOT/usr/bin/gcc-4.2&quot;
./configure
make -j3

index=0
while [ &quot;$index&quot; -lt &quot;$count&quot; ]
do
    cp ${libdirs[index]}/.libs/libtesseract_${libs[index]}.a $outdir/i386/libtesseract_${libs[index]}_i386.a
    ((index++))
done


# are the fat libs making the bundle too big?
index=0
while [ &quot;$index&quot; -lt &quot;$count&quot; ]
do
    /usr/bin/lipo -arch armv6 $outdir/arm/libtesseract_${libs[index]}_armv6.a -arch i386 $outdir/i386/libtesseract_${libs[index]}_i386.a -create -output $outdir/libtesseract_${libs[index]}.a
    ((index++))
done

unset CPPFLAGS CFLAGS LDFLAGS CPP CXX CC CXXFLAGS DEVROOT SDKROOT
</pre>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2010/09/24/compiling-tesseract-v3-for-iphone-1299/feed</wfw:commentRss>
		<slash:comments>101</slash:comments>
		</item>
		<item>
		<title>Mobile Logger progress</title>
		<link>http://robertcarlsen.net/2010/09/21/mobile-logger-progress-1297</link>
		<comments>http://robertcarlsen.net/2010/09/21/mobile-logger-progress-1297#comments</comments>
		<pubDate>Tue, 21 Sep 2010 17:30:06 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[mobile logger]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1297</guid>
		<description><![CDATA[I&#8217;ve been working sporadically on the app, trying to get the next release out the door. Currently, the last feature holding up release is the post log upload&#8230;there are intermittent timeouts occurring and I&#8217;d like to determine if there is a lightweight way to mitigate them. This upcoming release will likely change the &#8220;real-time&#8221; uploading [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been working sporadically on the app, trying to get the next release out the door. </p>
<p>Currently, the last feature holding up release is the post log upload&#8230;there are intermittent timeouts occurring and I&#8217;d like to determine if there is a lightweight way to mitigate them.</p>
<p>This upcoming release will likely change the &#8220;real-time&#8221; uploading to opt-in. There are two primary reasons: conserve significant battery life and to alleviate the server load from new data.</p>
<p>The battery savings are great&#8230;I&#8217;ve gone from close to 20% to less than 10% use over a 35 minute ride.</p>
<p>I&#8217;m getting low on space on the server, with about 550 hours of data logged &#8211; which is awesome &#8211; thanks to everyone who has shared their log data. However, I haven&#8217;t yet had an opportunity to visualize it and am feeling a bit overwhelmed by it. Hopefully this will throttle that a bit.</p>
<p>So, that&#8217;s the status&#8230;stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2010/09/21/mobile-logger-progress-1297/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Logger &#8211; DB export and zip compression</title>
		<link>http://robertcarlsen.net/2010/08/14/mobile-logger-db-export-and-zip-compression-1287</link>
		<comments>http://robertcarlsen.net/2010/08/14/mobile-logger-db-export-and-zip-compression-1287#comments</comments>
		<pubDate>Sat, 14 Aug 2010 21:44:39 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1287</guid>
		<description><![CDATA[Got two new features rolled into Mobile Logger at once&#8230;raw database export and zip compression. This sounds exciting, right?! Actually, it&#8217;s pretty cool and useful. Some of these new export formats (GC and GPX, I&#8217;m looking at you) are XML-based and thus quite verbose. What was a manageably small CSV file or JSON string has [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2010/08/db-zip.png" rel="lightbox[1287]"><img class="alignright size-thumbnail wp-image-1289" title="db-zip" src="http://robertcarlsen.net/blog/wp-content/uploads/2010/08/db-zip-150x150.png" alt="db-zip" width="150" height="150" /></a>Got two new features rolled into Mobile Logger at once&#8230;raw database export and zip compression. This sounds exciting, right?!</p>
<p>Actually, it&#8217;s pretty cool and useful. Some of these new export formats (GC and GPX, I&#8217;m looking at you) are XML-based and thus quite verbose. What was a manageably small CSV file or JSON string has become inflated much larger from all the tagging in these formats. Exporting a log in one of these formats means having send a doubly large file (approx. 300kB -&gt; 600kB). However, all the repeated tags makes them great candidates for zip compression. Those logs are about 70kB afterwards. So there&#8217;s that.<span id="more-1287"></span></p>
<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2010/08/db-settings.png" rel="lightbox[1287]"><img class="alignright size-thumbnail wp-image-1288" title="db-settings" src="http://robertcarlsen.net/blog/wp-content/uploads/2010/08/db-settings-150x150.png" alt="db-settings" width="150" height="150" /></a></p>
<p>Secondly, I have been thinking of making it easy to get the raw database off the device. It&#8217;s a good idea for backup and since it&#8217;s sqlite, advanced tinkerers could run custom queries and maybe figure out neat things&#8230;like where do I ride fastest, generally? To that end I&#8217;ve added a row in the settings panel to e-mail the raw database directly. This is what really pushed the compression initiative forward. The db on my device is 14MB, which is difficult for the phone to e-mail (lots of memory warnings and it took forever to send). Compressing the file makes it about 3MB, which is still large but quick enough over WiFi.</p>
<p>However, making the raw database available does expose a pretty big shortcut that I took when first putting the app together. All the sensor/log data is stored in the db as big JSON strings. This made it really easy to save locally and send to couchDB on the fly while a log was being recorded. Also, it didn&#8217;t matter what data I was storing &#8211; couchDB is schema-less and it was nice to not have to define a local schema. The huge downside is that every export feature parses the JSON strings and then formats each datum as necessary&#8230;it takes a bit of work on the phone&#8217;s part. Further, it makes it very difficult to use SQL queries to inspect the log data&#8230;aggregates, relationships&#8230;all that would have to be parsed into memory first. Ugh. Not happening.</p>
<p>So, on the horizon I suppose is gutting the data model and implementing the schema properly. The sensors on the iPhone aren&#8217;t changing &#8211; at least until we get to connect to external sensors ;) .</p>
<p>As always, code is on <a href="http://github.com/rcarlsen/Mobile-Logger" onclick="pageTracker._trackPageview('/outgoing/github.com/rcarlsen/Mobile-Logger?referer=');">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2010/08/14/mobile-logger-db-export-and-zip-compression-1287/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling Golden Cheetah with Twitter+OAuth</title>
		<link>http://robertcarlsen.net/2010/08/12/compiling-golden-cheetah-with-twitteroauth-1279</link>
		<comments>http://robertcarlsen.net/2010/08/12/compiling-golden-cheetah-with-twitteroauth-1279#comments</comments>
		<pubDate>Fri, 13 Aug 2010 02:06:01 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Golden Cheetah]]></category>
		<category><![CDATA[biggerbrain]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[posterity]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1279</guid>
		<description><![CDATA[Justin added a Twitter posting feature to Golden Cheetah a couple weeks ago. However, it used basic authentication, which Twitter has announced is going away in favor of OAuth only. So, after several more days of coding he did a bang up job of rolling in support using liboauth. Now, getting liboauth and it&#8217;s prerequisites [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2010/08/Screen-shot-2010-08-12-at-22.01.08.png" rel="lightbox[1279]"><img class="alignright size-thumbnail wp-image-1283" title="Screen shot 2010-08-12 at 22.01.08" src="http://robertcarlsen.net/blog/wp-content/uploads/2010/08/Screen-shot-2010-08-12-at-22.01.08-150x150.png" alt="Screen shot 2010-08-12 at 22.01.08" width="150" height="150" /></a>Justin added a Twitter posting feature to Golden Cheetah a couple weeks ago. However, it used basic authentication, which Twitter has announced is going away in favor of OAuth only. So, after several more days of coding he did a bang up job of rolling in support using liboauth.</p>
<p>Now, getting liboauth and it&#8217;s prerequisites configured to play nicely with my Golden Cheetah dev environment has been another struggle. I have been making the OS X releases of Golden Cheetah for a while &#8211; and we package them as a universal binary (i386/ppc) with 10.4 support. I&#8217;ve had to custom compile Qt, QWT, srmio and all that stuff to enable this.</p>
<p>In brief, liboauth needed to be compiled against the same arch that GC and co. have been, and it really wanted to go native, eg x86_64 on my MacBook Pro. After a night and day of tinkering&#8230;here&#8217;s what worked. Thanks to Justin for getting this going.</p>
<p><strong>Export config flags</strong> (just makes life easier on the command line):</p>
<pre class="brush: cpp; title: ; notranslate">
export CFLAGS=-mmacosx-version-min=10.4
export CPPFLAGS=-mmacosx-version-min=10.4
</pre>
<p><strong>openssl 1.0.0a:</strong></p>
<pre class="brush: cpp; title: ; notranslate">
./config -m32
</pre>
<p><strong>liboauth 0.8.8 / curl 7.21.1:</strong></p>
<pre class="brush: cpp; title: ; notranslate">
./configure CC=&quot;gcc -arch i386&quot; CXX=&quot;g++ -arch i386&quot; -host i386
</pre>
<p><strong>Golden Cheetah:</strong></p>
<p>After getting linker errors for a while, I realized that I had to directly link to the static version of libcrypto that was installed alongside libssl in /usr/local/ssl.</p>
<pre class="brush: cpp; title: ; notranslate">
Undefined symbols:
  &quot;_EVP_MD_size&quot;, referenced from:
      _oauth_body_hash_file in liboauth.a(liboauth_la-hash.o)
      _oauth_body_hash_data in liboauth.a(liboauth_la-hash.o)
ld: symbol(s) not found
</pre>
<p>Here&#8217;s the relevant bit of src.pro:</p>
<pre class="brush: cpp; title: ; notranslate">
!isEmpty( LIBOAUTH_INSTALL ) {
INCLUDEPATH += $${LIBOAUTH_INSTALL}/include
LIBS += /usr/local/ssl/lib/libcrypto.a
LIBS +=  $${LIBOAUTH_INSTALL}/lib/liboauth.a
LIBS += -lz
LIBS += -lcurl
DEFINES += GC_HAVE_LIBOAUTH
SOURCES += TwitterDialog.cpp
HEADERS += TwitterDialog.h
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2010/08/12/compiling-golden-cheetah-with-twitteroauth-1279/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Logger &#8211; GPX extensions</title>
		<link>http://robertcarlsen.net/2010/08/10/mobile-logger-gpx-extensions-1275</link>
		<comments>http://robertcarlsen.net/2010/08/10/mobile-logger-gpx-extensions-1275#comments</comments>
		<pubDate>Wed, 11 Aug 2010 04:55:20 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[gpx bike]]></category>
		<category><![CDATA[mobile logger]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://robertcarlsen.net/?p=1275</guid>
		<description><![CDATA[Rolling the extra logged sensor data into the GPX export took more effort that it should have&#8230;but I uncovered and fixed a latent bug in the export feature, so that&#8217;s a win right? Regardless, it&#8217;s was nice to use the new issue tracker at bugs.robertcarlsen.net for real(z) for the first time. I&#8217;m looking to get several [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://robertcarlsen.net/blog/wp-content/uploads/2010/08/gpx-ext.png" rel="lightbox[1275]"><img class="alignright size-thumbnail wp-image-1276" title="gpx-ext" src="http://robertcarlsen.net/blog/wp-content/uploads/2010/08/gpx-ext-150x150.png" alt="gpx-ext" width="150" height="150" /></a>Rolling the extra logged sensor data into the GPX export took more effort that it should have&#8230;but I uncovered and fixed a latent bug in the export feature, so that&#8217;s a win right? Regardless, it&#8217;s was nice to use the new issue tracker at <a href="http://bugs.robertcarlsen.net" onclick="pageTracker._trackPageview('/outgoing/bugs.robertcarlsen.net?referer=');">bugs.robertcarlsen.net</a> for real(z) for the first time. I&#8217;m looking to get several other features implemented before the next released update&#8230;planning on a few weeks. Otherwise, code is available, as always, on github.</p>
]]></content:encoded>
			<wfw:commentRss>http://robertcarlsen.net/2010/08/10/mobile-logger-gpx-extensions-1275/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
