<?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>Robert Accettura&#039;s Fun With Wordage &#187; sqlite</title>
	<atom:link href="http://robert.accettura.com/blog/tag/sqlite/feed/" rel="self" type="application/rss+xml" />
	<link>http://robert.accettura.com</link>
	<description>Robert Accettura&#039;s Personal Blog on Web Development and Tech</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:43:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://robert.accettura.com/?pushpress=hub'/>
<cloud domain='robert.accettura.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Mork And Casey Anthony</title>
		<link>http://robert.accettura.com/blog/2011/07/20/mork-and-casey-anthony/</link>
		<comments>http://robert.accettura.com/blog/2011/07/20/mork-and-casey-anthony/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 00:55:13 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[In The News]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mork]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[Thunderbird]]></category>

		<guid isPermaLink="false">http://robert.accettura.com/?p=5886</guid>
		<description><![CDATA[Jamie Zawinski linked to a very interesting blog post about the forensics problem in the recent Casey Anthony trial. To summarize, she was using an older version of Firefox, which stores its history in a Mork DB. For those not &#8230; <a href="http://robert.accettura.com/blog/2011/07/20/mork-and-casey-anthony/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://jwz.livejournal.com/1454795.html">Jamie Zawinski</a> linked to a <a href="http://wordpress.bladeforensics.com/?p=357">very interesting blog post</a> about the forensics problem in the recent Casey Anthony trial.  To summarize, she was using an older version of Firefox, which stores its history in a <a href="https://developer.mozilla.org/en/Mork_Structure">Mork DB</a>.  For those not familiar with Mozilla internals, Mork is (I&#8217;m <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=241438#c0">quoting</a> JWZ here): </p>
<blockquote cite="https://bugzilla.mozilla.org/show_bug.cgi?id=241438#c0"><p>
…the single most braindamaged file format that I have ever seen in my nineteen year career&#8221;.
</p></blockquote>
<p>That bug was actually one of two times where I <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=241438#c3">brushed with Mork</a>, that time learning, and another time shortly afterwards where I learned first hand how impossible it really is to work with as part of a hack I was trying to build and later abandoned.  Perhaps it was my experience at the time that just made it impossible, perhaps it really was Mork.</p>
<p><span id="more-5886"></span></p>
<p>Coincidentally Mork is now <a href="https://twitter.com/chrisblizzard/status/88314721631076352">completely dead</a>.  I suspect the last bits were actually Thunderbird who used Mork pretty extensively as Mail really is a giant database of messages, and another giant database of addresses that you interact with.  I&#8217;m speculating as I haven&#8217;t been following that closely.</p>
<p>Long live <a href="https://developer.mozilla.org/En/Storage">SQLite</a>.  I still find you slightly odd at times, especially your locking which seems foreign to me, however I just think of Mork and all of a sudden, it&#8217;s OK.</p>
<p>The most amusing, interesting and strange comment header I&#8217;ve ever found in a <a href="http://www.jwz.org/hacks/mork.pl">script</a> goes to mork.pl for this:</p>
<pre>

##############################################################################
#
# And Now, The Ugly Truth Laid Bare:
#
#   In Netscape Navigator 1.0 through 4.0, the history.db file was just a
#   Berkeley DBM file.  You could trivially bind to it from Perl, and
#   pull out the URLs and last-access time.  In Mozilla, this has been
#   replaced with a &quot;Mork&quot; database for which no tools exist.
#
#   Let me make it clear that McCusker is a complete barking lunatic.
#   This is just about the stupidest file format I've ever seen.
#
#       http://www.mozilla.org/mailnews/arch/mork/primer.txt
#       http://jwz.livejournal.com/312657.html
#       http://www.jwz.org/doc/mailsum.html
#       http://bugzilla.mozilla.org/show_bug.cgi?id=241438
#
#   In brief, let's count its sins:
#
#     - Two different numerical namespaces that overlap.
#
#     - It can't decide what kind of character-quoting syntax to use:
#       Backslash?  Hex encoding with dollar-sign?
#
#     - C++ line comments are allowed sometimes, but sometimes // is just
#       a pair of characters in a URL.
#
#     - It goes to all this serious compression effort (two different
#       string-interning hash tables) and then writes out Unicode strings
#       without using UTF-8: writes out the unpacked wchar_t characters!
#
#     - Worse, it hex-encodes each wchar_t with a 3-byte encoding,
#       meaning the file size will be 3x or 6x (depending on whether
#       whchar_t is 2 bytes or 4 bytes.)
#
#     - It masquerades as a &quot;textual&quot; file format when in fact it's just
#       another binary-blob file, except that it represents all its magic
#       numbers in ASCII.  It's not human-readable, it's not hand-editable,
#       so the only benefit there is to the fact that it uses short lines
#       and doesn't use binary characters is that it makes the file bigger.
#       Oh wait, my mistake, that isn't actually a benefit at all.
#
# Pure comedy.
#
##############################################################################
</pre>
<p><small>The title of this blog post is in no way a play on <a href="http://www.imdb.com/title/tt0077053/">Mork &#038; Mindy</a> <img src='http://robert.accettura.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </small>
<div id="rja_commentCountImage"><a href="http://robert.accettura.com/?p=5886#comments"><img src="http://robert.accettura.com/wp-content/commentCount/2011/07/5300ef4.gif" alt="Comment Count" style="border:0;" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://robert.accettura.com/blog/2011/07/20/mork-and-casey-anthony/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Public Domain vs. Open Source</title>
		<link>http://robert.accettura.com/blog/2008/02/28/public-domain-vs-open-source/</link>
		<comments>http://robert.accettura.com/blog/2008/02/28/public-domain-vs-open-source/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 02:57:58 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[licensing]]></category>
		<category><![CDATA[public domain]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://robert.accettura.com/archives/2008/02/28/public-domain-vs-open-source/</guid>
		<description><![CDATA[Ok, I promise to slow down on the use of X vs. Y on this blog, but after this post. CNet has an interesting blog post by Stephen Shankland essentially asking is public domain software open source? A very interesting &#8230; <a href="http://robert.accettura.com/blog/2008/02/28/public-domain-vs-open-source/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ok, I promise to slow down on the use of X vs. Y on this blog, but after this post.  CNet has an interesting blog post by Stephen Shankland essentially asking is <a href="http://www.news.com/8301-13580_3-9881858-39.html?part=rss&#038;subj=news&#038;tag=2547-1_3-0-20">public domain software open source</a>?  A very interesting question.</p>
<p>This little bit of information from Richard Hipp, founder of SQLite, I found to be particularly interesting:</p>
<blockquote cite="http://www.news.com/8301-13580_3-9881858-39.html?part=rss&#038;subj=news&#038;tag=2547-1_3-0-20"><p>
&#8220;&#8230;The consensus there seems to be that &#8216;public domain&#8217; is valid and is a proper subset of &#8216;open source&#8217;&#8211;except in France and Germany where the concept of &#8216;public domain&#8217; is not recognized&#8230;&#8221;
</p></blockquote>
<p>In my opinion, as long as the project stipulates that all contributions be released as public domain (defined as intellectual property not owned or controlled by anyone, and available for use by anyone for any purpose without restriction) for perpetuity, I think that in itself is an open source license.  It&#8217;s also the cleanest and most easy to read.
<div id="rja_commentCountImage"><a href="http://robert.accettura.com/archives/2008/02/28/public-domain-vs-open-source/#comments"><img src="http://robert.accettura.com/wp-content/commentCount/2008/02/e449b93.gif" alt="Comment Count" style="border:0;" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://robert.accettura.com/blog/2008/02/28/public-domain-vs-open-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Winner For Most Embedded Is: SQLite</title>
		<link>http://robert.accettura.com/blog/2008/02/26/and-the-winner-for-most-embedded-db-is-sqlite/</link>
		<comments>http://robert.accettura.com/blog/2008/02/26/and-the-winner-for-most-embedded-db-is-sqlite/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 02:42:05 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[adobe air]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[google-gears]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[iphone sdk]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[microsoft silverlight]]></category>
		<category><![CDATA[mozilla prism]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[software-development]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://robert.accettura.com/archives/2008/02/26/and-the-winner-for-most-embedded-db-is-sqlite/</guid>
		<description><![CDATA[So the format war of Blue-ray vs. HD-DVD is over. There are still several other rather significant battles going on in the tech world right now that aren&#8217;t Microsoft vs. Apple or Yahoo vs. Google. For example: Adobe Air vs. &#8230; <a href="http://robert.accettura.com/blog/2008/02/26/and-the-winner-for-most-embedded-db-is-sqlite/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So the format war of Blue-ray vs. HD-DVD is over.  There are still several other rather significant battles going on in the tech world right now that aren&#8217;t Microsoft vs. Apple or Yahoo vs. Google.  For example:</p>
<p><a href="http://www.adobe.com/products/air/">Adobe Air</a> vs. <a href="http://labs.mozilla.com/2007/10/prism/">Mozilla Prism</a> vs. <a href="http://silverlight.net/">Microsoft Silverlight</a></p>
<p><a href="http://gears.google.com/">Google Gears</a> vs. <a href="http://www.whatwg.org/specs/web-apps/current-work/#offline">HTML5 Offline support</a></p>
<p><a href="http://code.google.com/android/">Android</a> vs. <a href="http://developer.apple.com/iphone/">iPhone SDK</a> vs. <a href="http://www.symbian.com/">Symbian</a></p>
<p><a href="http://www.rubyonrails.org/">Ruby On Rails</a> vs. <a href="http://www.php.net">PHP</a></p>
<p>Not every case will have a true &#8220;winner&#8221;.  That&#8217;s not really a bad thing.  Choice is good.  In some cases they will merge to form one standard, such as what&#8217;s likely for offline web applications.  </p>
<p>What is interesting is that <a href="http://sqlite.org">SQLite</a> really dominates right now.  Adobe Air, Mozilla Prism, Google Gears, Android, iPhone SDK (likely through Core Data API), Symbian, Ruby On Rails (default DB in 2.0), PHP 5 (bundled but disabled in <code>php.ini</code> by default).  It&#8217;s becoming harder and harder to ignore that SQL survived the transition from mainframe to server, and now is going from server to client.</p>
<p>No longer is the term &#8220;database&#8221; purely referring to an expensive RAID5 machine in a datacenter running Oracle, MySQL, DB2 or Microsoft SQL Server.  It can now refer to someone&#8217;s web browser, or mobile phone.</p>
<p>This has really just begun to have an impact on things.  The availability of good information storage, retrieval, and sorting means much less of these poorly concocted solutions and much better applications.  Client side databases are the next AJAX.</p>
<p><small><strong>Edit [2/27/2008 9:14 AM EST]:</strong> Added Symbian, since they also use SQLite.  Thanks Chris.</small>
<div id="rja_commentCountImage"><a href="http://robert.accettura.com/archives/2008/02/26/and-the-winner-for-most-embedded-db-is-sqlite/#comments"><img src="http://robert.accettura.com/wp-content/commentCount/2008/02/7d12b66.gif" alt="Comment Count" style="border:0;" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://robert.accettura.com/blog/2008/02/26/and-the-winner-for-most-embedded-db-is-sqlite/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Thunderbird Sync With iPhone/iPod touch</title>
		<link>http://robert.accettura.com/blog/2008/01/21/thunderbird-sync-with-iphoneipod-touch/</link>
		<comments>http://robert.accettura.com/blog/2008/01/21/thunderbird-sync-with-iphoneipod-touch/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 22:22:32 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ipod-touch]]></category>
		<category><![CDATA[isync]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[macfuse]]></category>
		<category><![CDATA[mozPod]]></category>
		<category><![CDATA[mozstorage]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[Thunderbird]]></category>

		<guid isPermaLink="false">http://robert.accettura.com/archives/2008/01/21/thunderbird-sync-with-iphoneipod-touch/</guid>
		<description><![CDATA[I&#8217;ve gotten quite a few emails over the past several months from people who want to know how to sync their iPhone (or iPod touch) with Thunderbird. Quite a few are disappointed to find mozPod doesn&#8217;t support these newer devices. &#8230; <a href="http://robert.accettura.com/blog/2008/01/21/thunderbird-sync-with-iphoneipod-touch/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve gotten quite a few emails over the past several months from people who want to know how to sync their iPhone (or iPod touch) with Thunderbird.  Quite a few are disappointed to find <a href="http://mozpod.mozdev.org">mozPod</a> doesn&#8217;t support these newer devices.  It&#8217;s not quite my fault as I&#8217;ve yet to see any indication that it&#8217;s practical to implement.</p>
<p>I should note I do not own either device, but from what I&#8217;ve read, it doesn&#8217;t matter.  Hopefully by 2nd or 3rd generation when I&#8217;m on the market Apple will have come to their senses.</p>
<p>The problem is that Apple hasn&#8217;t provided a good method for anyone to provide sync with the iPod.  Even on older devices it wasn&#8217;t pretty, but it was workable.  There is no real sync API outside of iSync, which is Mac only and not a public API.  Instead what was done is mount the iPod file system and send it your data.  While not awesome, this has been workable and provided many Thunderbird users with mobile data.  </p>
<p>On the iPhone and iPod touch it&#8217;s not even possible to easily mount the filesystem.  The best method I&#8217;ve heard of is hacking it so you can mount your phone using sshfs with something like <a href="http://fuse.sourceforge.net/">FUSE</a>.  I know myself and some Linux and Mac users (horray for MacFUSE!) could manage, but I wouldn&#8217;t dare try to explain to someone how to do that.  From what I&#8217;ve read the iPhone manages data using <a href="http://www.sqlite.org/">SQLite</a> 3. Therefore it seems possible to use <a href="http://developer.mozilla.org/en/docs/Storage">mozStorage</a> to interface with it.  Perhaps someone with more experience with mozStorage and db&#8217;s generated outside mozStorage would know better about any potential compatibility issues.</p>
<p><strong>Calendar:</strong><br />
/var/root/Library/Calendar/Calendar.sqlitedb</p>
<p><strong>Address BookL</strong><br />
/var/root/Library/AddressBook/AddressBook.sqlitedb<br />
/var/root/Library/AddressBook/AddressBookImages.sqlitedb</p>
<p>Seems to me Apple could turn this into an API pretty easily by re-creating the old iPod style USB storage device mounting and give us access to these files.</p>
<p>In my mind the ideal implementation would be for Apple to just have a iTunes embed a mini web server locally accessible (obviously) and create a REST api to work with all data on the device.  That would open up a whole new way of interacting with the device.  Essentially you would interact with 127.0.0.1:[port#] and GET/POST your way through the interface.  Perfect for Calendar, Address Book, Notes, or whatever else Apple comes up with.</p>
<p>To get a <a href="http://www.imc.org/pdi/">vCard</a> for someone:</p>
<pre>
  GET /contact/vcard/?last_name=Jones HTTP/1.1
  Host: localhost
  User-Agent: mozPod/0.3
</pre>
<p>vcard can also be done <a href="http://www.w3.org/TR/vcard-rdf">as xml</a> (ooh DOM parsing for iPhone!), so there&#8217;s lots of possibilities.</p>
<p>To add a contact:</p>
<pre>
  POST /contact/add/ HTTP/1.1
  Host: localhost
  User-Agent: mozPod/0.3
  Content-Length: 450
  Content-Type: application/x-www-form-urlencoded

  fname=John&#038;lname=Doe&#038;address=1%20Large%20Road...
</pre>
<p>Though it would likely make sense to go with a more vcard like naming structure.</p>
<p>For calendar <a href="http://tools.ietf.org/html/rfc2445">iCalendar</a> or <a href="http://www.imc.org/pdi/">vCalendar</a> would make most sense:</p>
<pre>
 GET /calendar/ical/?start=1-1-1970&#038;end=1-19-2038 HTTP/1.1
  Host: localhost
  User-Agent: mozPod/0.3
</pre>
<p>You get the idea.  Dead simple access.  You could then use something like<a href="http://curl.haxx.se/">curl</a> to manipulate the iPhone&#8217;s address book via your existing application.  It would be only accessible locally, so it&#8217;s as secure as your system.  It would actually make things more secure since it would be one less reason for tinkering on the actual device, and it would open up a whole new market of iPod/iPhone software to go with all those accessories that have helped boost Apple&#8217;s market share.  <a href="http://www.openmobilealliance.org/tech/affiliates/syncml/syncmlindex.html">SyncML</a> is cool, but SyncML is also a beast and reminds me of SOAP, WSDL etc.</p>
<div id="rja_commentCountImage"><a href="http://robert.accettura.com/archives/2008/01/21/thunderbird-sync-with-iphoneipod-touch/#comments"><img src="http://robert.accettura.com/wp-content/commentCount/2008/01/a981f2b.gif" alt="Comment Count" style="border:0;" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://robert.accettura.com/blog/2008/01/21/thunderbird-sync-with-iphoneipod-touch/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

