<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Viking Hammer</title>
	
	<link>http://vikinghammer.com</link>
	<description>Just some rambling</description>
	<lastBuildDate>Thu, 04 Mar 2010 21:23:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/VikingHammer" /><feedburner:info uri="vikinghammer" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Using function scope to build a jQuery event handler</title>
		<link>http://feedproxy.google.com/~r/VikingHammer/~3/AX9wh4Abqvk/</link>
		<comments>http://vikinghammer.com/2010/03/04/using-function-scope-to-build-a-jquery-event-handler/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 21:23:41 +0000</pubDate>
		<dc:creator>sirsean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[haml]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[poll4.me]]></category>

		<guid isPermaLink="false">http://vikinghammer.com/?p=115</guid>
		<description><![CDATA[So here&#8217;s another cool thing from the development of poll4.me that might interest some people.

When I&#8217;m creating or editing polls, I have the option of adding an arbitrary number of answers. I don&#8217;t want to just leave an infinite number of form fields for the user to potentially fill in if he wants to &#8212; [...]]]></description>
			<content:encoded><![CDATA[<p>So here&#8217;s another cool thing from the development of <a href="http://poll4.me">poll4.me</a> that might interest some people.</p>

<p>When I&#8217;m creating or editing polls, I have the option of adding an arbitrary number of answers. I don&#8217;t want to just leave an infinite number of form fields for the user to potentially fill in if he wants to &#8212; that&#8217;s as stupid as it is impossible. So they have to be able to take an action that adds a field dynamically.</p>

<p>The first time I did it, on the poll creation screen, it was just a feature; I didn&#8217;t need to abstract it, so I didn&#8217;t. But once I needed it on the editing screen too, it was time to abstract. So here&#8217;s what it looks like.</p>

<p>First the creation screen, where there are three default answer fields and the ability to add more:</p>

<pre><code>%ol#answers_list
    %li
        %input.answer{ :type =&gt; "text", :name =&gt; "answers[]", :tabindex =&gt; 2 }
    %li
        %input.answer{ :type =&gt; "text", :name =&gt; "answers[]", :tabindex =&gt; 3 }
    %li
        %input.answer{ :type =&gt; "text", :name =&gt; "answers[]", :tabindex =&gt; 4 }
%p
    %a#add_answer_link{ :href =&gt; "#" }="add another answer"
</code></pre>

<p>And now the link needs to be connected to its functionality:</p>

<pre><code> :javascript
    $(document).ready(function() {
        $("#add_answer_link").click(add_answer_callback(3, 5, "#answers_list"));
    });
</code></pre>

<p>I&#8217;m just adding a click event handler to the link, and it&#8217;s the result of the add&#95;answer&#95;callback() function.</p>

<p>Now, the editing screen, where form fields only exist if they&#8217;re filled in. I&#8217;m keeping track of the proper tabindex with a variable here &#8230; it seems dirty to me so if anyone knows enough about Haml to do this more elegantly I&#8217;d like to hear about it.</p>

<pre><code>%ol#answers_list
    - tabindex = 2
    - @answers.each do |answer|
        %li
            %input.answer{ :type =&gt; "text", :name =&gt; "answers[]", :tabindex =&gt; "#{tabindex}", :value =&gt; "#{answer}" }
            - tabindex += 1
%p
    %a#add_answer_link{ :href =&gt; "#" }="add another answer"
</code></pre>

<p>And then connecting the event handler is pretty much exactly the same:</p>

<pre><code>:javascript
    $(document).ready(function() {
        $("#add_answer_link").click(add_answer_callback(#{@answers.count}, #{@answers.count + 2}, "#answers_list"));
    });
</code></pre>

<p>Note that instead of using constants for the parameters, I&#8217;m using calculated values. You can probably tell from here, but the parameters I&#8217;m passing in are: &#8220;the 0-based index of the next answer,&#8221; &#8220;the 1-based tabindex of the next form field,&#8221; and &#8220;the jQuery selector to which to append the field.&#8221; Maybe that wasn&#8217;t as obvious as I thought. It&#8217;s a good thing the code has comments (in the source, that is, I&#8217;m not bothering with them here).</p>

<p>So I&#8217;m calling a function to get the event handler, but the event handler itself is supposed to be a function. This is Javascript now, so that&#8217;s not hard in the slightest.</p>

<pre><code>function add_answer_callback(answer_index, tabindex, append_to) {
    return function() {
        $('&lt;li&gt;&lt;input id="answer_' + answer_index + '" type="text" class="answer" name="answers[]" tabindex="' + tabindex + '" /&gt;&lt;/li&gt;').appendTo(append_to);
        $('#answer_' + answer_index).focus();
        answer_index++;
        tabindex++;
    }
}
</code></pre>

<p>This function takes its three parameters and returns a function that takes <em>no</em> parameters and can be used as an event handler. Nice. But the <em>really cool</em> thing about it is that the answer&#95;index and tabindex variables are incremented inside the event handler (ie, that happens each time you click the link), but since they were parameters on the outer function, they&#8217;re scoped within the add&#95;answer&#95;callback() function, which is only called once (when the page is loaded).</p>

<p>That way, the id and tabindex of each field are set properly as you add more fields, and because you&#8217;re passing them in it doesn&#8217;t even matter how many you started with (crucial for the editing screen, of course).</p>
<img src="http://feeds.feedburner.com/~r/VikingHammer/~4/AX9wh4Abqvk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vikinghammer.com/2010/03/04/using-function-scope-to-build-a-jquery-event-handler/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://vikinghammer.com/2010/03/04/using-function-scope-to-build-a-jquery-event-handler/</feedburner:origLink></item>
		<item>
		<title>Authenticating with MongoMapper</title>
		<link>http://feedproxy.google.com/~r/VikingHammer/~3/1Gwew3v6RGY/</link>
		<comments>http://vikinghammer.com/2010/03/04/authenticating-with-mongomapper/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 18:29:46 +0000</pubDate>
		<dc:creator>sirsean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vikinghammer.com/?p=112</guid>
		<description><![CDATA[For my new poll4.me application, I&#8217;m using MongoDB and need to be able to connect to the authenticated database in production, but not necessarily in my development environment. I couldn&#8217;t find anywhere online that shows specifically how to do that, so I&#8217;ll post it here.

MongoMapper.connection = Mongo::Connection.new(config['db_hostname'])
MongoMapper.database = config['db_name']
if config['db_username']
    MongoMapper.connection[config['db_name']].authenticate(config['db_username'], config['db_password'])
end


Note [...]]]></description>
			<content:encoded><![CDATA[<p>For my new <a href="http://poll4.me/">poll4.me</a> application, I&#8217;m using MongoDB and need to be able to connect to the authenticated database in production, but not necessarily in my development environment. I couldn&#8217;t find anywhere online that shows specifically how to do that, so I&#8217;ll post it here.</p>

<pre><code>MongoMapper.connection = Mongo::Connection.new(config['db_hostname'])
MongoMapper.database = config['db_name']
if config['db_username']
    MongoMapper.connection[config['db_name']].authenticate(config['db_username'], config['db_password'])
end
</code></pre>

<p>Note that I&#8217;m using MongoMapper, which is excellent.</p>

<p>The key here is that I set up a connection using the hostname (or IP address) of the database server, then set the database I want to use. Then <em>if I&#8217;ve specified authentication parameters</em>, it attempts to authenticate against the database server. If I haven&#8217;t specified authentication information, this will assume I want to try to connect unauthenticated (and my database is running in non-authenticated mode).</p>

<p>Pretty simple.</p>
<img src="http://feeds.feedburner.com/~r/VikingHammer/~4/1Gwew3v6RGY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vikinghammer.com/2010/03/04/authenticating-with-mongomapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://vikinghammer.com/2010/03/04/authenticating-with-mongomapper/</feedburner:origLink></item>
		<item>
		<title>Twitter tells the story of the great Hawaii tsunami of 2010</title>
		<link>http://feedproxy.google.com/~r/VikingHammer/~3/jFW1qqs2EzI/</link>
		<comments>http://vikinghammer.com/2010/02/28/twitter-tells-the-story-of-the-great-hawaii-tsunami-of-2010/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 18:43:10 +0000</pubDate>
		<dc:creator>sirsean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vikinghammer.com/?p=108</guid>
		<description><![CDATA[Twas February 26, and it&#8217;d been a long day. I&#8217;d spent most of it in the sun, as it was my first full day in Hawaii. At 8:30 PM local time I dozed off, visions of sugar plums dancing, for whatever reason, in my head.

Minutes later, 6500 miles away, an earthquake rent the earth in [...]]]></description>
			<content:encoded><![CDATA[<p>Twas February 26, and it&#8217;d been a long day. I&#8217;d spent most of it in the sun, as it was my first full day in Hawaii. At 8:30 PM local time I dozed off, visions of sugar plums dancing, for whatever reason, in my head.</p>

<p>Minutes later, 6500 miles away, an earthquake rent the earth in Chile; it rated 8.8 on the Richter scale, a very large quake on the same fault line as the largest ever (9.5), which occurred in 1960. That one caused a tsunami in the Pacific Ocean which ended up killing 61 people in Hawaii. Tons and tons of water raced from the South American coast, at 500 miles per hour or more, speeding towards me as I slept.</p>

<p>I had no idea, of course, that this was happening. I woke up in the middle of the night, about 2 AM or so, as I&#8217;d done the previous night. I turned off the air conditioner and listened to the rain; on Kauai, like Camelot, it apparently only rains at night. I easily fell back asleep, with no knowledge of what was coming.</p>

<p>Before I knew it, I was roused from my sleep by the phone ringing. My mom&#8217;s name was prominently displayed on the screen, and I answered. I quickly found out that she thought it was early in the morning; I checked, and it was 5:40 AM. She was apologetic that she&#8217;d woken me up, and wasn&#8217;t getting to the point. Like a mother, she was trying to soften the blow. I heard my little sister&#8217;s voice in the background: &#8220;Mom, just tell him!&#8221; She told me that there&#8217;d been an earthquake in Chile, which I thought was pretty bad news and I hoped things were okay there &#8230; it hadn&#8217;t been that long since the devastation in Haiti.</p>

<p>Once again, I heard my sister&#8217;s voice. &#8220;Mom, tell him!&#8221; And that&#8217;s when my mom got to the point: <em>&#8220;There&#8217;s a tsunami warning in Hawaii, right now. They&#8217;re sounding the alarm at 6 AM.&#8221;</em> I thanked her and got off the phone as quickly as I could. I sent Darlene to the shower and checked Twitter to confirm whether this was happening; since &#8220;Chile&#8221; and &#8220;Hawaii&#8221; and &#8220;Tsunami&#8221; were all trending, I turned on the TV to find out what was going on; at the time, less than 120 deaths had been reported in Chile, and the local emergency services were warning me to &#8220;stay tuned.&#8221; I looked up the Kauai evacuation plans online, but they seemed outdated and incomplete. Also, it&#8217;s 2010. Can your map please not be a JPEG of black outlines on a white background with few landmarks and no interactivity?</p>

<p><a href="http://twitter.com/sirsean/status/9733766045">sirsean</a>: <strong>This news about a tsunami hitting Hawaii sucks. Hopefully we don&#8217;t get killed.</strong></p>

<p>I threw my laptop and some charger cables in my bag, and was about to take a shower of my own when the clock struck six and the siren sounded &#8212; it was time, as I once heard someone say, to get the h out of d. We left our luggage in the room and went to the lobby, carrying only a Macbook, a couple iPhones, a camera, and a bottle of water. In the lobby Darlene bought a couple handfuls of snacks and we unsuccessfully tried to call a cab; evidently, they were all already busy.</p>

<p><a href="http://twitter.com/sirsean/status/9734866062">sirsean</a>: <strong>Still don&#8217;t know anything. Waiting for evac info. #Hawaii #tsunami</strong> </p>

<p>The woman behind the desk explained that we were supposed to evacuate to the nearby Kapaa High School, and gave us some very rough directions: &#8220;Get to the main highway and turn right.&#8221; We tagged along with a nervous couple who had a rental car, and we set off to high ground; there was another couple stuffed in the back seat with us, but comfort was the last thing on any of our minds (or at least it was the last thing on my mind &#8230; if I&#8217;m wrong about the thoughts of the other people in the back seat with me, well, oops).</p>

<p>The guy in the passenger seat pulled out his Garmin GPS device to find where we were supposed to go. Meanwhile, my iPhone was doing the same thing. When the Garmin (which apparently takes &#8220;a few minutes&#8221; to come up with a route, compared to &#8220;a few seconds&#8221; on the iPhone) chirped &#8220;turn left!&#8221; my head jerked up. The iPhone was saying we needed to go straight for another mile or so. I brought it up, but our ride trusted the Garmin.</p>

<p>It didn&#8217;t seem like a big deal, because we were going up a hill and after a few minutes we found ourselves at what looked like a school. This could be Kapaa High School, right?</p>

<p><a href="http://twitter.com/sirsean/status/9735755504">sirsean</a>: <strong>We got to a &#8220;safe ground&#8221; up at a middle school evac zone. About 50-60 feet above sea level, I&#8217;d say. Maybe more.</strong></p>

<p>Nope. A police officer in the parking lot informed us that it was a middle school; the doors were locked and since it was a state-funded school, the county-funded police couldn&#8217;t get in. We, and the tiny handful of other people who had mistakenly found our way here, had to wait for someone from the school to show up, on a Saturday, to open it up.</p>

<p>The people who took us there left at this point, to go onward to Princeville hotel. For some reason they were only staying out our hotel for one night, and then at Princeville for the rest of their vacation. I&#8217;d heard from my boss that the Princeville hotel offers a delicious brunch, and considered going with them to try it out. But I decided to stay at the school; perhaps moreso, I decided I didn&#8217;t want to try to explain to them why I wanted to keep traveling in their car, didn&#8217;t want to explain to everyone else why my only reason for it was for brunch, and didn&#8217;t want to figure out how to get back afterwards.</p>

<p><a href="http://twitter.com/sirsean/status/9736161057">sirsean</a>: <strong>Phone calls aren&#8217;t going through at least I can get Internet access. (Mom &amp; Dad, I was just about to call you to say I was ok. Don&#8217;t worry.)</strong></p>

<p>I assume a lot of people were trying to use their phones. Since my iPhone uses AT&amp;T, mine is basically useless for that purpose; whenever I tried to make a call that day, it failed to connect. But I had five bars everywhere, and the internet remained fairly responsive. And frankly, I&#8217;d much rather have access to the internet than be able to make a phone call.</p>

<p><a href="http://twitter.com/sirsean/status/9736409193">sirsean</a>: <strong>Yesterday&#8217;s sunrise was more pleasant than today&#8217;s. Just saying. (Damn you, nature!)</strong></p>

<p>It&#8217;d been dark when we left the hotel, and in the confusion of figuring out where we were, the sun had snuck above the horizon without my noticing. At the time, this annoyed me.</p>

<p><a href="http://twitter.com/sirsean/status/9736933355">sirsean</a>: <strong>At least it&#8217;s still scenic around here.</strong></p>

<p><img src="http://img129.yfrog.com/img129/200/wumr.jpg" alt="Scenic" /></p>

<p>By this point, many of my friends had remembered that I was in Hawaii and had wished me good luck and advised me to stay safe, via Twitter mentions. A coworker, Paul, says it best.</p>

<p><a href="http://twitter.com/reaperhulk/status/9736339396">reaperhulk</a>: <strong>@sirsean Twitter has become an essential service for information dissemination to/from those in affected areas. Amazing/crazy/scary.</strong></p>

<p>I couldn&#8217;t agree more. From where I stood, Twitter was by far the most reliable communication medium available during this crisis; it sure beat the phone system. I suppose email would have been as reliable, but for a few things:</p>

<ul>
<li>Who do you decide to send a message to, when so many people may be interested?</li>
<li>Similarly, what if someone else with valuable information <em>doesn&#8217;t</em> send something to you when you might need to know it?</li>
<li>My email inbox was quickly swamped by &#8220;you have a new follower&#8221; emails from Twitter (not yet, of course, but soon). The information density of email is very low, like a mother trying not to frighten you.</li>
</ul>

<p><a href="http://twitter.com/sirsean/status/9737016654">sirsean</a>: <strong>Thanks to everyone for the well-wishes! My battery is still close to full, &amp; I&#8217;m glad for Twitter.</strong></p>

<p>Other people were worried about my battery life, and so was I. I needed to make sure to find some electricity at some point, because I didn&#8217;t know how long the power would last once the tsunami arrived.</p>

<p>The people from the school still hadn&#8217;t arrived, but the grounds were pretty wide open; when building this school they took advantage of the fact that it&#8217;s on Kauai, and replaced all the hallways that normally exist in a school building with open walkways. Every classroom was its own building. So we took it upon ourselves to wander around.</p>

<p><a href="http://twitter.com/sirsean/status/9737353429">sirsean</a>: <strong>Get ready for this view. That&#8217;s the direction the tsunami will be coming from. I&#8217;m going to try to get some footage</strong></p>

<p><img src="http://img111.yfrog.com/img111/8980/efka.jpg" alt="Upcoming view" /></p>

<p>Looking at that picture now, it&#8217;s tough to see the water. That&#8217;s disappointing, because at the time I felt that I could see quite a bit of the water. I suppose it&#8217;s tough for the iPhone camera to take pictures with the sun in the foreground.</p>

<p>The first person exhorting others to follow me for a first-hand account of the coming tsunami was a former coworker, Ray:</p>

<p><a href="http://twitter.com/raykrueger/status/9737051591">raykrueger</a>: <strong>My friend @sirsean is in Hawaii right now waiting for more Tsunami news/instructions. I imagine he&#8217;ll be posting some photos too.</strong></p>

<p>I think the picture of the view I&#8217;d posted didn&#8217;t instill much confidence &#8212; people were telling me to get to high ground. The police had insisted that we were high enough already and that they didn&#8217;t want anyone on the roads. </p>

<p><a href="http://twitter.com/sirsean/status/9739219224">sirsean</a>: <strong>We&#8217;re at the highest ground we&#8217;re going to get to, so now we play the waiting game.</strong></p>

<p>They repeatedly said &#8220;We wouldn&#8217;t leave all our police cars and county vehicles here if it wasn&#8217;t safe.&#8221; Frankly, I thought that was cute. But it&#8217;s a pretty good way to keep people calm, at the maximum possible expense of having to buy new cars (and likely at no cost at all).</p>

<p><a href="http://twitter.com/sirsean/status/9739325877">sirsean</a>: <strong>This is a middle school? I&#8217;d love to have attended. But being a refugee isn&#8217;t as fun as being a student.</strong></p>

<p><img src="http://img110.yfrog.com/img110/9167/y86t.jpg" alt="Kapaa Middle School" /></p>

<p>Seriously, the school looked great. I later learned that it was built in 1997, and that while it&#8217;s designed for 1200 students (grades 6-8), it currently only has 650. Also, the principal said that it&#8217;s a fine shelter during a tsunami, but when they have hurricane warnings it&#8217;s a terrible place to go because the architects wanted &#8220;lots of big glass windows&#8221; and &#8220;light&#8221; &#8212; the only place to be safe from a hurricane was to lock yourself into the one building with no windows (there are dozens of buildings, and even the gym has glass and few walls). It was a good point, but I just found myself glad that the architects liked &#8220;light&#8221; so much and that there wasn&#8217;t a hurricane coming. I ended up never going into that windowless building, but the principal didn&#8217;t make it sound pretty.</p>

<p>Speaking of the gym, they took us there now. By this point, about 500 people had shown up here. Officer DeBlake, the same one who had earlier assured us that we&#8217;d be safe here, briefed us. He explained that we&#8217;d done the right thing by leaving the coastal areas, but that this isn&#8217;t an official shelter so there&#8217;d be no Red Cross support, or medical assistance, or food. He said we were a low priority for the police and other rescue forces &#8212; the people who had not evacuated and were still down by the coast were the highest priorities, followed by those at official shelters. He explained that right after he was done talking, all but one police officer were going to leave and go down the mountain to help others.</p>

<p><a href="http://twitter.com/sirsean/status/9740431808">sirsean</a>: <strong>We were just briefed. They said we should plan to be here 24+ hrs, that all the cops are leaving to help others, and that we&#8217;re low priority</strong></p>

<p>Oh yeah, and he said we had to start planning to be there for 24 hours. My hotel was right on the beach, so if the tsunami actually ended up as anything to worry about, the hotel would be pretty wrecked up anyway. But I didn&#8217;t like hearing about being stuck in a shelter for 24 hours with 500 other people and no food. Darlene and I had already eaten a little bag of Doritos and a peanut bar of some kind. That was about a quarter of our foor supply, so at that point I figured we had to make 500 empty calories last another day between the two of us. It was time to start rationing, so I had to tell Darlene &#8220;no&#8221; when she asked if she could have some food (which was funny, I thought, because she was carrying it and didn&#8217;t need me to say &#8220;yes&#8221;). Still, I knew that she&#8217;d be the one to eat all that food.</p>

<p><a href="http://twitter.com/sirsean/status/9740626553">sirsean</a>: <strong>I know of aftershocks of 6.9 &amp; 6.6 within 2 hours of the 1st quake. Also, they don&#8217;t have many resources to help people here.</strong></p>

<p>Given those aftershocks, I thought maybe the initial wave wouldn&#8217;t be the end of it, and we&#8217;d see some big waves for several hours after it started. Also, office DeBlake had mentioned that Kapaa had only one fire station and one ambulance for the entire town. That, I thought, gave some idea about the level of resources available in town.</p>

<p><a href="http://twitter.com/sirsean/status/9740646582">sirsean</a>: <strong>Found an outlet, so I&#8217;m charging up before the power goes out.</strong></p>

<p>I was already down to 80% after all that tweeting, so I was happy to find outlets available <em>outside</em> the buildings. They thought of everything at this school.</p>

<p><a href="http://twitter.com/sirsean/status/9742545246">sirsean</a>: <strong>They got us a TV. Should calm people down. I asked them if they need help, but they don&#8217;t seem to think they do. They&#8217;ll change their mind.</strong></p>

<p>That was a bit of an exaggeration. When I offered my help, the principal asked me to &#8220;turn off the radio,&#8221; which was 15 feet away and had a prominent &#8220;off&#8221; button waiting to be pressed. (It didn&#8217;t seem like I was being all that helpful.) And here&#8217;s a spoiler alert: they didn&#8217;t change their minds. I don&#8217;t know if they would have if things had gotten bad. Maybe.</p>

<p>My cousin, Darrell, was the next to offer up my Twitter feed to those interested.</p>

<p><a href="http://twitter.com/darrell_schulte/status/9742509327">darrell_schulte</a>: <strong>Follow Minnesota native @sirsean for your Hawaii tsunami coverage. If he drops a F bomb, it&#8217;s not my fault.</strong></p>

<p>I generally don&#8217;t mind swearing, but this made me want to watch my mouth for the rest of the day. You never know how people are going to react when their sensibilities are offended <em>and</em> there&#8217;s a huge natural disaster that costs lives. That&#8217;s a pretty dangerous combination. (Though I&#8217;d contend that &#8220;a huge natural disaster that costs lives&#8221; combined with <em>anything</em> is a pretty dangerous combination. Whatever.)</p>

<p><a href="http://twitter.com/sirsean/status/9742738883">sirsean</a>: <strong>Filled up my water bottle; they&#8217;re shutting off non-emergency water supplies in 17 minutes. #hawaii</strong></p>

<p>I learned from the television that they were shutting off the non-emergency water sources at 10 AM, so it was time to get as much water right now as possible. Since we weren&#8217;t at an official shelter, I didn&#8217;t know if they&#8217;d consider our fountains an &#8220;emergency&#8221; water source.</p>

<p>It shocked me, by the way, how often I had to walk over to someone in the ensuing several minutes and tell them to fill up their water bottles. I don&#8217;t know what they were paying attention to, but it wasn&#8217;t the urgent information about their survival. One woman even argued with me about it; I&#8217;d interrupted her reading a book with an empty water bottle next to her, and after telling her that they might be shutting off the water soon she said &#8220;I didn&#8217;t hear that.&#8221; Her back was turned to the TV and she&#8217;d been pretty engaged in the book &#8212; I didn&#8217;t see how her failing to hear something meant it hadn&#8217;t been said. I thought, for a moment, about what I could say to her. &#8220;Did you hear anything?&#8221; &#8220;Does it matter? You&#8217;re going to want water anyway.&#8221; &#8220;Better safe than sorry.&#8221; But I didn&#8217;t think any of those would get through to her. So: &#8220;They said it 30 minutes ago.&#8221; It worked. She got up and went to refill her water.</p>

<p><a href="http://twitter.com/sirsean/status/9742863613">sirsean</a>: <strong>Just learned there have been 56 aftershocks of more than 5.0</strong></p>

<p>That seemed like a lot of earthquakes. There didn&#8217;t seem to be any reason to doubt that there&#8217;d be some crazy waves coming soon.</p>

<p><a href="http://twitter.com/anoopbhat/status/9742733206">anoopbhat</a>: <strong>Wow. @sirsean I forgot you were in HI. Dude be careful and take photos. We&#8217;re glued to your stream now.</strong></p>

<p>Another coworker, Anoop, told me he was now paying attention. I don&#8217;t know what it&#8217;s like for people who often have an audience, but having people &#8220;glued to [my] stream&#8221; was pretty novel and I thought it was cool. At this point, I was starting to feel some responsibility to report accurately and often.</p>

<p><a href="http://twitter.com/sirsean/status/9742902031">sirsean</a>: <strong>TV is warning: &#8220;Never surf a tsunami.&#8221; I&#8217;m stunned they have to say that. Maybe I shouldn&#8217;t be.</strong></p>

<p>Of course, that doesn&#8217;t mean there shouldn&#8217;t be any levity involved.</p>

<p><a href="http://twitter.com/sirsean/status/9743465821">sirsean</a>: <strong>We&#8217;re 1 hour from some action here. #hawaii</strong></p>

<p>Estimated action, that is. The scientists the newsmedia were talking to estimated that the first wave would arrive at 11:05 AM.</p>

<p><a href="http://twitter.com/sirsean/status/9743679330">sirsean</a>: <strong>Just saw TV footage of a lone surfer still out there, ignoring coast guard &amp; fire department helicopters.</strong></p>

<p>I&#8217;m not going to lie, he looked like he was having fun.</p>

<p><a href="http://twitter.com/sirsean/status/9743778056">sirsean</a>: <strong>TV meteorologist: &#8220;The surfing is great right now. Make no mistake about that.&#8221; This seems like a fun state.</strong></p>

<p>Yeah, the reporters seemed to agree with me. But saying stuff like that probably didn&#8217;t discourage other surfers from hitting the water.</p>

<p><a href="http://twitter.com/sirsean/status/9744041836">sirsean</a>: <strong>We&#8217;re becoming an official shelter in a few minutes. Getting more refugees, and some more people to manage them. Good news.</strong></p>

<p>Apparently they were moving some people from the nearby high school (the one we were supposed to go to) and bringing them here. I didn&#8217;t know why, but if it meant the Red Cross was going to show up with food, I was all for it.</p>

<p><a href="http://twitter.com/sirsean/status/9744206842">sirsean</a>: <strong>Just found out a friend of mine is hiking in Chile right now. I hope she&#8217;s alright!</strong></p>

<p>My sister texted me to tell me about that. Hiking in the mountains during an 8.8 earthquake doesn&#8217;t sound safe at all, does it? At the time of this writing, I still haven&#8217;t heard anything about her safety, one way or the other.</p>

<p><a href="http://twitter.com/sirsean/status/9744257869">sirsean</a>: <strong>Hawaii will be impacted by these waves for several hours or days. I should have bought more candy bars before evacuating.</strong></p>

<p>Given that the waves were traveling at 500 MPH, the fact that they estimated the first wave to arrive at Hilo at 11:05 AM and at Kauai at 11:40 AM confused me.</p>

<p><a href="http://twitter.com/sirsean/status/9745175828">sirsean</a>: <strong>Further delay: the wave isn&#8217;t getting to Kauai for an extra 40 minutes.</strong></p>

<p>But I soon learned that the waves travel quickly when they&#8217;re in deep water, but as they get shallower they slow down tremendously. Also, the reefs surrounding the islands would slow them down even more. They ended up slowing the waves down more than anyone seems to have anticipated.</p>

<p><a href="http://twitter.com/sirsean/status/9745795766">sirsean</a>: <strong>Nothing happening yet in Hilo. The tsunami must be traveling Delta.</strong></p>

<p>It&#8217;s funny, I think, that I was feeling annoyed that the tsunami was late. Of course, the reporters on TV were talking about how great the estimates were, and how hard it is to determine the exact direction and velocity of the waves, and even getting it within an hour is an amazing feat. I wonder if they were just blowing smoke up the collective asses of the scientists they&#8217;d been talking to &#8212; if they&#8217;d ripped the accuracy of the reports they may have lost access to the scientists for the next emergency.</p>

<p>Still, it&#8217;s better to estimate early than late.</p>

<p><a href="http://twitter.com/sirsean/status/9746122307">sirsean</a>: <strong>The Red Cross is here, leisurely setting up.</strong></p>

<p>They sent one pickup truck, with an empty back, and 2-3 people. No food, but they did have some extremely sugary juice in big jugs (the jugs were supplied by the school). I took one sip of the juice and practically had to spit it out. You can&#8217;t drink that crap if you&#8217;re trying to stay hydrated. Plus, I was pretty surprised at their lack of urgency. It was pretty close to the estimated time of arrival.</p>

<p><a href="http://twitter.com/sirsean/status/9746148281">sirsean</a>: <strong>Just heard the water is receding. Danger could be approaching soon, probably.</strong></p>

<p>I gather that the water rushes out right before the wave gets there. That makes sense, and the TV was making a pretty big deal about it.</p>

<p><a href="http://twitter.com/cinatyte/status/9745962812">cinatyte</a>: <strong>Everyone follow @sirsean. He is in Hawaii and is tweeting constantly about his experiences.</strong></p>

<p>I don&#8217;t know who Mac Wilson (@cinatyte) is, but he sparked a wave of new followers for me. That message was retweeted several times, and the deluge of new followers was begun. At this point I was feeling like a vital part of the newsmedia, disseminating information in real time across the globe. It&#8217;s an empowering feeling, even if it is, for the most part, merely an illusion. After all, even with the 40 or so new followers I got that day, I still topped out at just 105. That&#8217;s a pretty small reach for a &#8220;vital&#8221; news source. Or any news source.</p>

<p><a href="http://twitter.com/sirsean/status/9746326148">sirsean</a>: <strong>The attitude here at Kapaa Middle School remains a mixture of calm and apprehensive. I&#8217;m pretty impressed by the people here, not panicking.</strong></p>

<p>Normally I would have said I was impressed by the Hawaiian people, but almost everyone at our shelter was a tourist. I have no idea why they were all so calm.</p>

<p><a href="http://twitter.com/sirsean/status/9746420131">sirsean</a>: <strong>1st hit reported at just a few centimeters. They&#8217;ve been warning all day that the 1st wave may not be the biggest. Still, somewhat promising</strong></p>

<p>All day, they&#8217;d been talking about a much bigger wave. My brother had told me via SMS that CNN had estimated 8 feet. The TV had been saying 5-6 feet when it reached Hawaii. A few centimeters, compared to that, is pretty tiny. Also, it amused me that suddenly they switched their units of measurement. You know, in case nobody was already confused.</p>

<p><a href="http://twitter.com/sirsean/status/9746609049">sirsean</a>: <strong>Water has receded 1-1.5 feet now. That&#8217;s less encouraging.</strong></p>

<p>Reports were coming in from all over the place. Some people were listening to the radio on their headphones and telling me what they were saying. Others were on the phone with people on other islands or back on the mainland who were watching television. I was watching TV myself, and also looking out to sea. Many of the reports seemed to conflict, but I&#8217;m sure they were all true at least on some level. After all, the reefs and level of shoaling at different spots on the islands would have vastly different effects on the waves.</p>

<p><a href="http://twitter.com/sirsean/status/9746836688">sirsean</a>: <strong>Met some German guys, robbed last night at 2am. They have no stuff, no shoes, no money. Talk about a bad day! Those guys need your thoughts.</strong></p>

<p>Those guys, who seemed somewhere between 18 and 30 years old, had one of the worst stories of the day. They were visiting from Germany for a month, and had been in Hawaii for a week already. They&#8217;d been sleeping on the beach when someone robbed them and took everything they had, including all their cash and their shoes. They tried to report it to the police, but were told that a tsunami was coming and they had to be moved away from the beach and that the police didn&#8217;t have the time or resources to investigate the crime.</p>

<p>They had cuts on their feet from walking over rocks and pavement and such, and they asked the Red Cross for help. The Red Cross had no sterilization supplies, no bandages, and no footwear of any sort. These poor guys were out of luck. I felt terrible for them; even if the tsunami wiped out my hotel and destroyed the stuff we&#8217;d left there, we were going to be fine. Meanwhile, even if the tsunami turned out to be nothing, these guys were still screwed.</p>

<p><a href="http://twitter.com/sirsean/status/9747189754">sirsean</a>: <strong>A pretty heavy, steady wind is picking up from the southeast. Don&#8217;t know if it means anything, but it might.</strong></p>

<p>I still don&#8217;t know if that means anything, but that wind didn&#8217;t die down until after the first series of waves had passed, and shortly after it was gone they ended up calling the all clear. So if we think correlation is at all significant, maybe that wind does mean something.</p>

<p><a href="http://twitter.com/BreakingNews/status/9747780918">BreakingNews</a>: <strong>5.6-foot #tsunami wave recorded at Hilo Bay of Hawaii, Pacific Tsunami Warning Center tells NBC News</strong></p>

<p>It&#8217;s funny, I got that report at the same time as another one that said the first 2-3 waves had already passed all the islands, and the TV was still showing nothing happening at Hilo.</p>

<p><a href="http://twitter.com/sirsean/status/9748729098">sirsean</a>: <strong>Just heard a rumor that the first 2 waves have already passed all the islands. There could be many more, but we couldn&#8217;t really see anything</strong></p>

<p><a href="http://twitter.com/sirsean/status/9748443941">sirsean</a>: <strong>Water is receding on the east coast of Kauai now.</strong></p>

<p>I couldn&#8217;t see this, despite facing directly at the east coast of Kauai. I suppose it&#8217;s tough to tell if water has receded a few feet when you&#8217;re a mile from the coast and don&#8217;t have a good angle. I&#8217;d been hoping to be able to see something.</p>

<p><a href="http://twitter.com/sirsean/status/9749046619">sirsean</a>: <strong>From TV: &#8220;Bottom line, the surfing is very, very good right now.&#8221;</strong></p>

<p>They really were talking about surfing a lot &#8230; but I don&#8217;t know if <em>that</em> is what I&#8217;d call the &#8220;bottom line&#8221; <em>while a tsunami is currently hitting the island</em>.</p>

<p><a href="http://twitter.com/sirsean/status/9749314394">sirsean</a>: <strong>A group of people watching the news at the Red Cross HQ here. It&#8217;s less than 10%; others are scattered around</strong></p>

<p><img src="http://img154.yfrog.com/img154/561/1rav.jpg" alt="People watching the news rather than the water" /></p>

<p>I called it the &#8220;Red Cross HQ,&#8221; but really that was through the door (to the right of the Dasani machine, behind the guy in the grey t-shirt. They&#8217;d set up in there, perhaps to hide from the people who mistakenly thought the Red Cross would have food or other supplies of any kind.</p>

<p><a href="http://twitter.com/sirsean/status/9749783219">sirsean</a>: <strong>The reef off the NaPali coast of Kauai is completely exposed by all that receding water. It&#8217;s apparently always covered by water. Wow.</strong></p>

<p>They showed a picture of it on the news. It really was remarkable. It made it seem, at the time, like the feeling that the tsunami had already passed was mistaken.</p>

<p>But then the emotional roller coaster of the day took another turn.</p>

<p><a href="http://twitter.com/sirsean/status/9749923282">sirsean</a>: <strong>The police have returned to our shelter, with smiles on their faces. That has to be good news.</strong></p>

<p><img src="http://img86.yfrog.com/img86/7572/sd0.jpg" alt="Cops returning to the shelter" /></p>

<p>I didn&#8217;t see what the cops did once they got back, but basically it seemed like they walked around for a little bit and then receded back somewhere out of sight.</p>

<p><a href="http://twitter.com/sirsean/status/9750101717">sirsean</a>: <strong>It seems like some people have already left. There used to be more cars parked here.</strong></p>

<p><img src="http://img49.yfrog.com/img49/605/fvrc.jpg" alt="Fewer people than before" /></p>

<p>I did see some cars driving out, back onto the road, but I didn&#8217;t personally see very many of them leaving. Plus, I have no idea where they went, because the Red Cross was insisting that all the roads were closed and that we can&#8217;t leave. Evidently, not everyone cared what the Red Cross had to say.</p>

<p><a href="http://twitter.com/sirsean/status/9750391880">sirsean</a>: <strong>I can see some of the same discoloration off the Kauai coast that was off Hilo during its surges. Nothing major is happening.</strong></p>

<p>Finally, I was able to see some evidence that the water was receding off the east coast of Kauai. The blue of the ocean shifted from a deep blue to a much lighter color, slightly greenish, perhaps aquamarine. There were huge stretches of whitecaps that seemed to just be sitting there, at the line between the blue of the deeper ocean and the green of the shallower water.</p>

<p><a href="http://twitter.com/sirsean/status/9750393953">sirsean</a>: <strong>People seem a little more relaxed and a little more bored. They&#8217;re still watching the water, though.</strong></p>

<p><img src="http://img162.yfrog.com/img162/7380/56rm.jpg" alt="Relaxed and bored" /></p>

<p>By this point, I think it&#8217;d become clear to everyone that nothing was really going to happen. We were safe, our beds were safe, and the realization was starting to sink in that we&#8217;d all sat here calmly, in the sun, for seven hours, without eating any food. (Except for one family that set up right next to the Red Cross HQ and made themselves sandwiches, refusing to share any with anyone else. So they didn&#8217;t look quite as hungry.)</p>

<p><a href="http://twitter.com/sirsean/status/9751168890">sirsean</a>: <strong>The tsunami warning has been cancelled. All roads on Kauai are still closed. They&#8217;re telling us not to leave yet.</strong></p>

<p>TV was reporting that there was no reported damage to any property on any island, nor any deaths or injuries. That wasn&#8217;t surprising in the slightest given the way things had gone, but it was still welcome news. The other welcome news was that the scientists agreed with the feeling of the masses, that the tsunami had passed and that we were not in danger.</p>

<p><a href="http://twitter.com/sirsean/status/9751243430">sirsean</a> <strong>All clear! We can leave the shelter now.</strong></p>

<p>Of course, they told us we <em>can</em> leave the shelter, but we shouldn&#8217;t because the traffic would be terrible as everyone tries to rush back down the mountain at once. But we didn&#8217;t have a car, so we weren&#8217;t worried. We were just going to take a leisurely stroll down towards the water, perhaps going slowly enough that some shops or restaurants might open by the time we passed them, allowing us to eat. (We ended up finding just one open restaurant, a little Chinese place. We did not get the impression that they had closed at all that day, or were aware that there&#8217;d been a tsunami scare. In fact, they seemed confused as to why they hadn&#8217;t gotten any customers all day.)</p>

<p><a href="http://twitter.com/sirsean/status/9751524899">sirsean</a>: <strong>The principal of Kapaa Middle School did a fantastic job today. He deserves lots of kudos.</strong></p>

<p><img src="http://img49.yfrog.com/img49/4885/7d9d.jpg" alt="The principal of Kapaa Middle School" /></p>

<p>After the fact, and with more time to think about it, I still think he did a great job. The police had pointed out that it was a Saturday and he left his family at home to come and help us. The principal pointed out that normally he doesn&#8217;t dress this way. Blah, blah, blah. The important thing was that he kept everything under control, helped keep everyone calm, supplied televisons and radios, opened more and more of the bathrooms on campus, and generally did a fantastic job. We would have been fine if the Red Cross hadn&#8217;t shown up, but it would have been a much rougher day if principal Aiwohi hadn&#8217;t been there. When push was just about to come to shove, he showed that the amazing campus was just the second best thing the students of Kapaa Middle School have going for them.</p>

<p>And that, really, is the end of the story. We went back to the hotel, swam in the pool, sat by the beach, watched some pretty impressive waves and the surfers who enjoyed them, and fell asleep early after a long day. We left our clothes nearby, ready to be leapt into at a moment&#8217;s notice in case there was another tsunami scare in the middle of the night. (Of course there wasn&#8217;t.)</p>

<p>It&#8217;d be a better survival story if there&#8217;d been at least one person who <em>didn&#8217;t</em> survive, and a better story in general if there&#8217;d been any action. But, ultimately, the story of the day in my mind was Twitter proving itself as a viable and valuable global communication tool. My parents would have been worried sick if I&#8217;d been in Hawaii unable to make a phone call while a tsunami raced toward the island. Instead, they were watching my Twitter feed closely, still worried but at least fully aware that I was fine. People interested in following the news don&#8217;t have to rely fully on the television news any more; they can supplement that with the information and pictures supplied by any number of regular people who happen to be on the ground where the action is happening.</p>

<p>In fact, the television anchor said it best:</p>

<blockquote>
  <p>&#8220;We&#8217;re going to switch over to show the Olympics, because I know a lot of viewers out there want to see what&#8217;s going on in Vancouver. But don&#8217;t worry, there are plenty of websites and Twitterers out there to give you the information you need if you still want to follow the tsunami.&#8221;</p>
</blockquote>

<p>Or anything else, for that matter.</p>

<p><em>Note: Some of the images I posted appear to have cut out midway through the upload. I have decided to leave them like that, to show precisely what I was able to communicate in the heat of the moment, and also perhaps to encourage AT&amp;T to realize that uploading data is at least as important as downloading data in the new era of crowdsourced communication.</em></p>
<img src="http://feeds.feedburner.com/~r/VikingHammer/~4/jFW1qqs2EzI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vikinghammer.com/2010/02/28/twitter-tells-the-story-of-the-great-hawaii-tsunami-of-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://vikinghammer.com/2010/02/28/twitter-tells-the-story-of-the-great-hawaii-tsunami-of-2010/</feedburner:origLink></item>
		<item>
		<title>Emitter Progress: Conversations</title>
		<link>http://feedproxy.google.com/~r/VikingHammer/~3/_SqeHU5u73s/</link>
		<comments>http://vikinghammer.com/2010/01/30/emitter-progress-conversations/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 23:53:19 +0000</pubDate>
		<dc:creator>sirsean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vikinghammer.com/2010/01/30/emitter-progress-conversations/</guid>
		<description><![CDATA[I&#8217;ve been making fairly solid progress on Emitter lately. Today&#8217;s additions were threefold:


Mentions
Replies
Conversations


Mentions work exactly the same as they do in Twitter, and aren&#8217;t worth talking about here.

Replies are similar to Twitter, but for now there are still some limitations. For one thing, I haven&#8217;t worked out how to limit the timelines they go into [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been making fairly solid progress on Emitter lately. Today&#8217;s additions were threefold:</p>

<ul>
<li>Mentions</li>
<li>Replies</li>
<li>Conversations</li>
</ul>

<p><strong>Mentions</strong> work exactly the same as they do in Twitter, and aren&#8217;t worth talking about here.</p>

<p><strong>Replies</strong> are similar to Twitter, but for now there are still some limitations. For one thing, I haven&#8217;t worked out how to limit the timelines they go into based on the intersection of followers (though that will almost certainly come soon). Another problem: You can currently reply from your home timeline or a list of a user&#8217;s emissions, but not from an individual emission. But those are simple enough to do later on.</p>

<p>But the real interesting thing here is <strong>Conversations</strong>. A conversation can start from any original emission; ie, from any emission that isn&#8217;t in reply to any other emission. When you emit, there&#8217;s no conversation yet. But once someone replies to you, a conversation is created and your emission becomes the &#8220;original&#8221; for the conversation.</p>

<p>Anyone who then replies to your original emission <em>or</em> the reply is simply adding to the conversation. This second reply points directly to the emission that it was replying to (whether it was the original or the first reply), as well as to the conversation itself. This data structure allows us to easily get <em>all</em> the emissions in a conversation, or to build out the tree of replies in case we want a threaded display.</p>

<p>For now, I haven&#8217;t figured out a good way to build a UI for this; I have to think about how I want to show a conversation to the user. But I think showing a full conversation could be a valuable way for people to consume emissions; it&#8217;s something that you kind of have to maintain in your head when you&#8217;re using Twitter.</p>

<p>What do you think about conversations?</p>
<img src="http://feeds.feedburner.com/~r/VikingHammer/~4/_SqeHU5u73s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vikinghammer.com/2010/01/30/emitter-progress-conversations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://vikinghammer.com/2010/01/30/emitter-progress-conversations/</feedburner:origLink></item>
		<item>
		<title>Open Twitter: What would you name the baby of Email and Twitter?</title>
		<link>http://feedproxy.google.com/~r/VikingHammer/~3/LXfQNadPa9I/</link>
		<comments>http://vikinghammer.com/2010/01/09/open-twitter-what-would-you-name-the-baby-of-email-and-twitter/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 17:46:22 +0000</pubDate>
		<dc:creator>sirsean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vikinghammer.com/2010/01/09/open-twitter-what-would-you-name-the-baby-of-email-and-twitter/</guid>
		<description><![CDATA[Email is the distinguished, reliable, old man of online communication; Twitter is the hot young coed who draws everyone&#8217;s eye as soon as she walks into the room. But what if the two of them met and, say, hit it off?

People like the immediacy and openness of Twitter, and the asynchronous follower model of online [...]]]></description>
			<content:encoded><![CDATA[<p>Email is the distinguished, reliable, old man of online communication; Twitter is the hot young coed who draws everyone&#8217;s eye as soon as she walks into the room. But what if the two of them met and, say, hit it off?</p>

<p>People like the immediacy and openness of Twitter, and the asynchronous follower model of online relationships is brilliant. However, all the data is stuck on Twitter&#8217;s servers, and if you don&#8217;t like the way Twitter is running their systems you&#8217;re stuck. Imagine if email had worked the same way: there&#8217;s only one service, called &#8220;email.com&#8221; or something, and everyone who wants to send email has to sign up for that one service and can only send email to other people on that same service.</p>

<p>It wouldn&#8217;t be very useful, would it? Opening up email across the internet, and across disparate email servers that only need to know two things about a remote server before allowing you to communicate with someone using it: a) where is it? and b) does it support the same email protocol I do?</p>

<p>It seems to me that if the Twitter usage model were opened up such that anyone could run a &#8220;timeline server,&#8221; and you could choose which one you sign up for, and you could follow people on different timeline servers &#8230; well, maybe once you can do that, the usefulness of Twitter will explode in the same way that it did for email.</p>

<p>And there are plenty of people pushing for Twitter to adopt new features &#8212; meanwhile, Twitter is going slowly and trying to maintain control until they can figure out how to successfully monetize their currently-strong position with all these users desperate to use their service and stuck there because there are no alternatives. But if there were an open alternative, and different timeline operators could compete for users on reliability, or speed, or cool new features, it stands to reason that things would get better in a hurry. (Do you think the monolithic &#8220;email.com&#8221; would have an interface as cool as Gmail&#8217;s? Because, without competition for users, I don&#8217;t think it&#8217;s likely.)</p>

<p>So I&#8217;ve been playing with such a system for the past week or so. I&#8217;ve got it so you can follow people across timeline servers, and when they tweet to their timeline server it&#8217;s forwarded to <em>your</em> timeline server so you can see it in your timeline. Some of the API needs to be fleshed out (especially on finer-grained control over how you get tweets back), but it&#8217;s getting there. Soon, I&#8217;ll put it up on GitHub.</p>

<p><strong>But before I do that, I need to crowdsource something: the name.</strong></p>

<p>I can&#8217;t think of a good name for this. I was thinking &#8220;OpenTwitter&#8221; at first, but I don&#8217;t want to include the word &#8220;Twitter&#8221; in the name.</p>

<p>So here&#8217;s my questions for you:</p>

<ol>
<li>Would you prefer to tweet on an open communication platform rather than a single company&#8217;s product?</li>
<li><strong>What name would you give to the baby of Email and Twitter?</strong></li>
</ol>

<p>Thanks for the help, Internet.</p>
<img src="http://feeds.feedburner.com/~r/VikingHammer/~4/LXfQNadPa9I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vikinghammer.com/2010/01/09/open-twitter-what-would-you-name-the-baby-of-email-and-twitter/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<feedburner:origLink>http://vikinghammer.com/2010/01/09/open-twitter-what-would-you-name-the-baby-of-email-and-twitter/</feedburner:origLink></item>
		<item>
		<title>Eclipse-free Java &amp; Flex: Deploying and Running in Tomcat</title>
		<link>http://feedproxy.google.com/~r/VikingHammer/~3/X0XfWSGQh4o/</link>
		<comments>http://vikinghammer.com/2009/12/01/eclipse-free-java-flex-deploying-and-running-in-tomcat/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 22:11:29 +0000</pubDate>
		<dc:creator>sirsean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vikinghammer.com/?p=98</guid>
		<description><![CDATA[Earlier, I (briefly) described my long-running battle with Eclipse, which Eclipse finally won by dropping the proverbial a-bomb and refusing to start. If you want to read that first, be my guest. Here, I describe the next step in setting up my current environment.

Part of the deal with escaping from Eclipse is that I no [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier, I (briefly) described <a href="http://vikinghammer.com/2009/12/01/eclipse-free-java-flex-mxmlactionscript-in-macvim/">my long-running battle with Eclipse, which Eclipse finally won by dropping the proverbial a-bomb and refusing to start</a>. If you want to read that first, be my guest. Here, I describe the next step in setting up my current environment.</p>

<p>Part of the deal with escaping from Eclipse is that I no longer get the benefit of its automatic-publishing to a Tomcat container; from now on, I&#8217;m going to have to do that myself. Here&#8217;s how I&#8217;m doing it.</p>

<p>First, you&#8217;ll need an installation of Tomcat. I already had this, and I&#8217;d put it in my user-specific Applications directory. It&#8217;s located at:</p>

<pre><code>~/Applications/apache-tomcat-6.0.20/
</code></pre>

<p>Yours may differ depending on the version &#8230; but I <em>do</em> recommend putting it in your home directory rather than setting it up in a global location.</p>

<p>Since we&#8217;re using HTTPS for our applications, the first thing you need to do is go into conf/server.xml and uncomment the Connector for port 8443:</p>

<pre><code>&lt;Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" /&gt;
</code></pre>

<p>Mine was on line 81 &#8230; yours might be in a different place, but it should be around there.</p>

<p>The next thing you need to do is increase the memory allotted to Tomcat to run; this <em>may</em> not be totally necessary, but if you&#8217;re running a handful or more services you&#8217;ll probably get some Out Of Memory / PermGen space errors. I know I did.</p>

<p>Go edit bin/catalina.sh, and put the following line around line 200 (right before it sets the JAVA_OPTS variable):</p>

<pre><code>JAVA_OPTS="$JAVA_OPTS -server -ms512M -mx1024M 
    -XX:NewSize=256M -XX:MaxNewSize=256M -XX:PermSize=256M 
    -XX:MaxPermSize=256M -Dcom.sun.management.jmxremote 
    -Dcom.sun.management.jmxremote.port=7799 
    -Dcom.sun.management.jmxremote.authenticate=false 
    -Dcom.sun.management.jmxremote.ssl=false "
</code></pre>

<p><em>* Newlines added for pretty-printing purposes.</em></p>

<p>What this does is take any existing value of JAVA_OPTS and tacks some more options onto it. I set it to a minimum of 512M and a maximum of 1024M, and then set the PermGen space to 256M (the -XX:NewSize, -XX:MaxNewSize, -XX:PermSize, and -XX:MaxPermSize options are responsible for this). You might be able to get away with less than 256M of PermGen space, but I couldn&#8217;t, and this works. I initially had my minimum memory set to 256M, but that failed to start up because it claimed it couldn&#8217;t fit its PermGen space into the heap; that&#8217;s why I bumped the minimum up so high.</p>

<p>The remaining options are there for enabling JMX on the server. I have some JMX-enabled services working on there, so that&#8217;s necessary for my purposes. If you need it too, it&#8217;s worth noting that this is solely for development; if you&#8217;re putting this into production <em>you absolutely should <strong>not</strong> turn off the authentication and SSL options</em>.</p>

<p>The final step is getting your WAR files into the Tomcat webapps directory. I&#8217;m using Maven to compile and build, so I&#8217;ve got my WAR files available in each project&#8217;s target directory. So, to deploy the WARs, I created some scripts in my workspace. The first one deploys the base services, all together:</p>

<pre><code>echo "base-service-one"
rm -rf ~/Applications/apache-tomcat-6.0.20/webapps/base-service-one*
cp base-service-one/web-app/target/base-service-one-webapp-*.war
    ~/Applications/apache-tomcat-6.0.20/webapps/base-service-one.war
echo "base-service-two"
rm -rf ~/Applications/apache-tomcat-6.0.20/webapps/base-service-two*
cp base-service-two/target/base-service-two-*.war 
    ~/Applications/apache-tomcat-6.0.20/webapps/base-service-two.war
</code></pre>

<p><em>* Newlines added for pretty-printing purposes.</em></p>

<p>And so on. (Note that your target directories may be in different locations per project, as mine are, depending on what type of project you&#8217;re dealing with. Be sure to check out each directory structure after Maven&#8217;s done its thing.) The reason I&#8217;m doing &#8220;base-service-two-*.war&#8221; is because Maven will actually create a file like &#8220;base-service-two-0.0.1-SNAPSHOT.war&#8221; or something like that, and I don&#8217;t really care what version it currently is.</p>

<p>Then for each individual project, I have a <em>separate</em> deploy script:</p>

<pre><code>echo "project-one"
rm -rf ~/Applications/apache-tomcat-6.0.20/webapps/project-one*
cp project-one/web-app/target/project-one-webapp-*.war 
    ~/Applications/apache-tomcat-6.0.20/webapps/project-one.war
</code></pre>

<p><em>* Newlines added for pretty-printing purposes.</em></p>

<p>The reason for deleting from webapps <em>before</em> copying the WAR over is so that Tomcat knows to re-deploy. I had some trouble with Tomcat detecting new WAR files, so I&#8217;m just deleting the old WAR <em>and</em> exploded directory to be safe.</p>

<p>Run your deploy scripts after every time you successfully run &#8220;mvn install&#8221; &#8230; and you&#8217;re ready to start Tomcat:</p>

<pre><code>~/Applications/apache-tomcat-6.0.20/bin/startup.sh
</code></pre>

<p>And, bam. Your services are starting. And you didn&#8217;t need to touch Eclipse.</p>
<img src="http://feeds.feedburner.com/~r/VikingHammer/~4/X0XfWSGQh4o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vikinghammer.com/2009/12/01/eclipse-free-java-flex-deploying-and-running-in-tomcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://vikinghammer.com/2009/12/01/eclipse-free-java-flex-deploying-and-running-in-tomcat/</feedburner:origLink></item>
		<item>
		<title>Eclipse-free Java &amp; Flex: MXML/Actionscript in MacVim</title>
		<link>http://feedproxy.google.com/~r/VikingHammer/~3/kPXlxaXTNnU/</link>
		<comments>http://vikinghammer.com/2009/12/01/eclipse-free-java-flex-mxmlactionscript-in-macvim/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 21:05:10 +0000</pubDate>
		<dc:creator>sirsean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vikinghammer.com/?p=94</guid>
		<description><![CDATA[At work, I&#8217;ve been doing Flex &#38; Java work pretty much exclusively for a good long while now, and the standard toolchain for that centers around Eclipse; that&#8217;s what all of us use at work. But Eclipse is slow as molasses and uses a ton of memory &#8230; and tends to break down if you&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>At work, I&#8217;ve been doing Flex &amp; Java work pretty much exclusively for a good long while now, and the standard toolchain for that centers around Eclipse; that&#8217;s what all of us use at work. But Eclipse is slow as molasses and uses a <em>ton</em> of memory &#8230; and tends to break down if you&#8217;re running 15+ Tomcat projects and compiling/building several different Flex projects. Last week, Eclipse finally gave up; it crashed, and then it wouldn&#8217;t start up again. I could have continued fighting with it in a misguided attempt to get back to &#8220;normal&#8221; &#8212; ie, get back to a slow and painful workflow with repeated interruptions while I wait for Eclipse to finish doing whatever it&#8217;s doing.</p>

<p>Instead, I decided to go for an Eclipse-free workflow.</p>

<p>I&#8217;m using Maven to compile my code, run my tests, and build my JAR, WAR and SWF files. MacVim is my editor (though regular old vim would work just fine). I keep a Finder window open to my workspace so I can easily see directory structures and open files. And I&#8217;ve written some scripts that take the Maven-built WAR files and publish them to the Tomcat webapps directory so I can run them.</p>

<p>I posted a while ago over at my old blog about <a href="http://seancode.blogspot.com/2008/01/flex-mxml-highlighting-in-vim.html">how to get syntax highlighting working in vim for MXML and Actionscript</a>; that solution still works well, but it&#8217;s important to note that <a href="http://stackoverflow.com/questions/1107857/macvim-syntax-file-for-cs">vim&#8217;s syntax files go into a different directory* when you&#8217;re using MacVim</a>:</p>

<pre><code>/Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/
</code></pre>

<p><em>* You will have to right-click and select &#8220;Show Package Contents&#8221; to get there.</em></p>

<p>Here are the links to the files:</p>

<ul>
<li><a href="http://abdulqabiz.com/files/vim/actionscript.vim">actionscript.vim</a></li>
<li><a href="http://abdulqabiz.com/files/vim/mxml.vim">mxml.vim</a></li>
</ul>

<p>After putting the two files in the proper location, the following lines go into the ~/.vimrc file:</p>

<pre><code>au BufNewFile,BufRead *.mxml set filetype=mxml
au BufNewFile,BufRead *.as set filetype=actionscript
syntax on
autocmd FileType mxml set smartindent
autocmd FileType as set smartindent
</code></pre>

<p>Frankly, I think this gives vim <em>at least</em> as much syntax-highlighting capability as Eclipse/FlexBuilder <em>ever</em> had, and I don&#8217;t actually find myself missing the code completion all that much. (If anyone knows of any good code completion solutions for MXML/AS beyond the simple ctrl-N &#8230; let me know.)</p>

<p>So far, my Eclipse-free existence has been going brilliantly. I&#8217;ll try to post a few more times, fleshing out a little bit more about the environment.</p>
<img src="http://feeds.feedburner.com/~r/VikingHammer/~4/kPXlxaXTNnU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vikinghammer.com/2009/12/01/eclipse-free-java-flex-mxmlactionscript-in-macvim/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://vikinghammer.com/2009/12/01/eclipse-free-java-flex-mxmlactionscript-in-macvim/</feedburner:origLink></item>
		<item>
		<title>Python/MySQLdb on Snow Leopard</title>
		<link>http://feedproxy.google.com/~r/VikingHammer/~3/cmFMvZYrYaI/</link>
		<comments>http://vikinghammer.com/2009/09/26/pythonmysqldb-on-snow-leopard/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 16:37:44 +0000</pubDate>
		<dc:creator>sirsean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vikinghammer.com/?p=91</guid>
		<description><![CDATA[This one is mostly for me, so I remember how I did this. I like developing webapps using web.py, which obviously requires Python to be able to talk to MySQL if you want to, you know, store anything.

On my old laptop I ran into some difficulty getting that to happen &#8212; for some reason OS [...]]]></description>
			<content:encoded><![CDATA[<p>This one is mostly for me, so I remember how I did this. I like developing webapps using <a href="http://webpy.org">web.py</a>, which obviously requires Python to be able to talk to MySQL if you want to, you know, store anything.</p>

<p>On my old laptop I ran into some difficulty getting that to happen &#8212; for some reason OS X doesn&#8217;t come with the necessary libraries for Python to talk to MySQL, which seems like an oversight to me &#8212; so I just spun up an Ubuntu VM on which to do my web.py development. (sudo aptitude install mysqldb-python (or python-mysql, or something, whatever it actually is, do an aptitude search first) is pretty damn easy.)</p>

<p>But my new MBP came with Snow Leopard, and I wanted to get my development environment working without the VM. So &#8230; first I installed the x86_64 version of MySQL (which says it&#8217;s for Leopard, but it works fine in Snow Leopard). You also need to have XCode installed to compile MySQLdb.</p>

<p>I followed the directions <a href="http://www.mangoorange.com/2008/08/01/installing-python-mysqldb-122-on-mac-os-x/">here</a> and <a href="http://www.brambraakman.com/blog/comments/installing_mysql_python_mysqldb_on_snow_leopard_mac_os_x_106/">here</a>, because neither one of them ended up working by themselves. My ~/.profile ended up looking like this:</p>

<pre><code>export PATH=$PATH:/usr/local/git/bin:/usr/local/mysql/bin

export CC="gcc-4.0"
export CXX="g++-4.0"
</code></pre>

<p>Note from the first link that step 4 appears to be unnecessary in the version of MySQLdb that I downloaded (1.2.3c1), which is newer than the one he used (1.2.2). The C code changes were already done.</p>

<p>I don&#8217;t know if the symlink and setup_posix.py changes were important, but I did them anyway, because what&#8217;s the big deal?</p>

<p>Anyway, now I don&#8217;t have to bookmark those links.</p>
<img src="http://feeds.feedburner.com/~r/VikingHammer/~4/cmFMvZYrYaI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vikinghammer.com/2009/09/26/pythonmysqldb-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://vikinghammer.com/2009/09/26/pythonmysqldb-on-snow-leopard/</feedburner:origLink></item>
		<item>
		<title>The Perch Roulette Simulator</title>
		<link>http://feedproxy.google.com/~r/VikingHammer/~3/AYRBbuCeXZU/</link>
		<comments>http://vikinghammer.com/2009/08/30/the-perch-roulette-simulator/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 17:03:46 +0000</pubDate>
		<dc:creator>sirsean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vikinghammer.com/?p=88</guid>
		<description><![CDATA[So I was drinking off another demoralizing Twins loss on Saturday night, and bemusedly clicking around my Google Reader feeds which have somehow been growing and growing unchecked for the last few weeks. Having not read The Daily WTF for a while, I figured I&#8217;d try to clear some of them out. I came across [...]]]></description>
			<content:encoded><![CDATA[<p>So I was drinking off another demoralizing Twins loss on Saturday night, and bemusedly clicking around my Google Reader feeds which have somehow been growing and growing unchecked for the last few weeks. Having not read The Daily WTF for a while, I figured I&#8217;d try to clear some of them out. I came across one called <a href="http://thedailywtf.com/Articles/Knocking-Me-Off-The-Perch.aspx">Knocking Me Off The Perch</a>, which involved a programmer and a lawyer who walked into a casino,* and ended up inventing an algorithmic roulette strategy wherein they turned $10 into $400 simply by following a few easy steps.</p>

<p><em>* Have you heard this one before?</em></p>

<p>Well, here are the steps, as they described them:</p>

<blockquote>
  <p>Then we realized something. We had just discovered The Perch, a roulette strategy that could not fail. The rules were defined as follows.</p>
  
  <ol>
  <li>Perch someplace where you can see a number of roulette tables at once.</li>
  <li>As soon as a table shows four consecutive blacks or reds, swoop in and place a bet.</li>
  <li>If the bet is successful then return to the Perch. Otherwise, place another bet worth 150% of the previous bet (instead of $10, place $15).</li>
  <li>If the second bet fails, then shrug your shoulders and return to the Perch.</li>
  </ol>
</blockquote>

<p>The programmer ended up concluding, the next morning, that there is no strategy for winning at roulette. The lawyer maintained that there was, and that they&#8217;d discovered it.</p>

<p>None of this was particularly interesting, until the &#8220;Bring Your Own Code&#8221; section where they challenge you to write your own simulator to see just how rare it is to do what they did.</p>

<p><a href="http://github.com/sirsean/perch-roulette-simulator/tree/master">So, I did.</a></p>

<p>According to my simulator, if you use this strategy you&#8217;ll turn $10 into $400 a little over 50% of the time. Which doesn&#8217;t sound bad, except that the games where you actually win and get your $400, you&#8217;re standing there for over 330 spins of the roulette tables. Oh, and in the games you end up losing all your money? Well, those ones only last about 8 spins.</p>

<p>My first question is: If you have a 50% chance of increasing your money 40x over &#8230; do you do it? (Even if it takes several hours?)</p>

<p>My second question is: Is there anything wrong with my simulator? I can&#8217;t imagine that casinos would allow such a <em>huge</em> arbitrage situation to exist on the floor.</p>
<img src="http://feeds.feedburner.com/~r/VikingHammer/~4/AYRBbuCeXZU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vikinghammer.com/2009/08/30/the-perch-roulette-simulator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://vikinghammer.com/2009/08/30/the-perch-roulette-simulator/</feedburner:origLink></item>
		<item>
		<title>googlevoicenotify – A cool idea, but the execution isn’t there yet</title>
		<link>http://feedproxy.google.com/~r/VikingHammer/~3/XXW0HpgIjwU/</link>
		<comments>http://vikinghammer.com/2009/08/11/googlevoicenotify-a-cool-idea-but-the-execution-isnt-there-yet/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 02:29:35 +0000</pubDate>
		<dc:creator>sirsean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vikinghammer.com/?p=83</guid>
		<description><![CDATA[So a friend of mine told me about this cool thing you could do with Google Voice and Prowl: poll Google Voice for new SMS messages and send them to your iPhone with push notifications. It&#8217;d be a cool way to cut out all incoming and outgoing text messages &#8212; and thus save some money [...]]]></description>
			<content:encoded><![CDATA[<p>So a friend of mine told me about this cool thing you could do with Google Voice and Prowl: poll Google Voice for new SMS messages and send them to your iPhone with push notifications. It&#8217;d be a cool way to cut out all incoming and outgoing text messages &#8212; and thus save some money on your plan.</p>

<p>He told me about <a href="http://github.com/mikeyk/googlevoicenotify/tree/master">a Python program that&#8217;d act as a daemon</a> that polls Google Voice, parses out the text messages, and sends them along to Prowl. Sounds like it&#8217;d work great, right? </p>

<p>Well, there were some problems.</p>

<p>The first problem is that it relies very specifically on a certain HTML schema* from Google Voice &#8212; one that has a div element with a class of &#8220;gc-message gc-message-sms&#8221; <em>and</em> an id attribute that uniquely identifies a &#8220;thread&#8221; of conversation. This wouldn&#8217;t be such a problem &#8230; if the Google Voice &#8220;API&#8221; actually supplied its information in that format. There is no such thread-wrapping div, and there does not appear to be any unique identifiers for any threads. At first I only had one thread, so I thought that might have been the problem; so I texted my GV account from another phone, creating two threads. There are still no wrapping divs, and still no thread identifiers (unique or not). So &#8230; that&#8217;s a huge problem.</p>

<p><em>* The last commit to this project was on July 31, and I can only assume that the author had it working for himself at the time. Which means that in the last 10-12 days, Google has changed the schema for this page fairly significantly. I wouldn&#8217;t be at all surprised if it continued to change, perhaps at a fairly rapid pace &#8230; which says to me that this isn&#8217;t going to be a good idea any time soon.</em></p>

<p>Anyway, that&#8217;s a fundamental problem with dealing with Google, and the fact that they don&#8217;t really give a shit about you. But there&#8217;s another problem, and that&#8217;s with the design of the application.</p>

<p>Since Google&#8217;s &#8220;API&#8221; doesn&#8217;t specify which SMS messages are &#8220;new,&#8221; and there&#8217;s no way to mark them as &#8220;read,&#8221; you get <em>all</em> of them at once every time you poll. Given that you don&#8217;t want to get a push notification for <em>every</em> text message you&#8217;ve <em>ever</em> received every 30-60 seconds or so, the program has to determine which ones are new. And it doesn&#8217;t do that very elegantly.</p>

<p>It creates a dict of threads, keyed by the thread id, each of which are an array of text messages. It then pickles this dict and saves it to a file on the filesystem. That has to be pickled and unpickled, obviously, which takes time <em>and gets slower with each text message you ever receive.</em> But the dict of threads itself can be accessed in constant time &#8230; that&#8217;s not true of the array of messages in each thread. In order to query that, you have to use the &#8220;message identifier&#8221; to see if the message exists in the thread, and that&#8217;s an array-in call &#8212; linear time! Woo!</p>

<p>Can it get dumber than that? Yes. Yes it can. I haven&#8217;t told you what the &#8220;message identifier&#8221; is. Well, Google doesn&#8217;t supply an actual identifier &#8230; so the author of this program decided that the unique identifier of a text message would be &#8230;</p>

<p>Drum roll please.</p>

<pre><code>identifier = from_name + ' ' + message_txt
</code></pre>

<p>Yes. That&#8217;s right. I hope nobody you know ever sends you a text message with the same content. Ever. You know, like &#8220;Where are you?&#8221; or &#8220;What?&#8221; or something along those lines. I get (and send) those all the time &#8230; and with this program you would only be notified the first time someone <em>ever</em> sends you one. (Unless there&#8217;s something about the way Google defines &#8220;threads&#8221; that <em>guarantees</em> that there can never be two messages in a thread that have the same content. I doubt it.) So, yes. Unacceptable.</p>

<p>What amuses me even more is that Google <em>does</em> supply something that can come pretty close to guaranteeing that you can get those repeat messages &#8212; there&#8217;s a time field, with precision to the minute. So unless someone&#8217;s sending you messages with the same content multiple times per minute (certainly possible, but you may not <em>need</em> notifications for every one of them, and also your friends are boring), you&#8217;ll get them.</p>

<p>So it gets slower linearly with the number of text messages you&#8217;ve ever received, and it becomes increasingly likely to drop messages as time goes on. I&#8217;m going to go ahead and call bullshit on that.</p>

<p>The way you want to improve this is to create an SQL table with (from, text, time) as the only fields, and make it unique across all three fields. For each message you parse, you first check your database to see if the message exists. If it does, ignore it. If not, insert it and push the notification; lather, rinse, repeat until all the messages have been checked. It ignores the thread problem, and works with the <em>current</em> schema from Google. It also doesn&#8217;t slow down linearly &#8212; and since your database is local, it&#8217;ll take a while before those queries start to slow you down (and it&#8217;ll certainly scale better than reading/writing an ever-growing file and doing in-array operations hundreds of times in a loop.</p>

<p>If I can make some time for this, I&#8217;ll go ahead and fork the project and make these changes. But if someone else does it before I can, do let me know.</p>
<img src="http://feeds.feedburner.com/~r/VikingHammer/~4/XXW0HpgIjwU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://vikinghammer.com/2009/08/11/googlevoicenotify-a-cool-idea-but-the-execution-isnt-there-yet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://vikinghammer.com/2009/08/11/googlevoicenotify-a-cool-idea-but-the-execution-isnt-there-yet/</feedburner:origLink></item>
	</channel>
</rss>
