<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Teh Tech Blogz0r by Luke Meyer</title>
	<atom:link href="http://sosiouxme.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sosiouxme.wordpress.com</link>
	<description>My life stumbling through technology</description>
	<lastBuildDate>Wed, 04 Jan 2012 22:52:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sosiouxme.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Teh Tech Blogz0r by Luke Meyer</title>
		<link>http://sosiouxme.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sosiouxme.wordpress.com/osd.xml" title="Teh Tech Blogz0r by Luke Meyer" />
	<atom:link rel='hub' href='http://sosiouxme.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Hash collision DoS</title>
		<link>http://sosiouxme.wordpress.com/2012/01/04/hash-collision-dos/</link>
		<comments>http://sosiouxme.wordpress.com/2012/01/04/hash-collision-dos/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 22:52:19 +0000</pubDate>
		<dc:creator>Luke Meyer</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[hashes]]></category>
		<category><![CDATA[CGI]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[vulnerability]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[DoS]]></category>

		<guid isPermaLink="false">http://sosiouxme.wordpress.com/?p=371</guid>
		<description><![CDATA[Have been dealing with this vulnerability a little bit. Amusingly, my old favorite Perl has had the fix for this for years &#8211; salt the hash randomly so an attacker can&#8217;t predict how your entries will hash. That&#8217;s really the only fix, because while you might be able to mitigate the specific case of hashing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=371&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have been dealing with <a href="http://arstechnica.com/business/news/2011/12/huge-portions-of-web-vulnerable-to-hashing-denial-of-service-attack.ars">this vulnerability</a> a little bit. Amusingly, my old favorite Perl has had the fix for this for years &#8211; salt the hash randomly so an attacker can&#8217;t predict how your entries will hash. That&#8217;s really the only fix, because while you might be able to mitigate the specific case of hashing CGI parameters, anything that takes user input in any form from potentially malicious clients could be vulnerable. That&#8217;s a pretty wide use case.</p>
<p>Of course, if the bad guys don&#8217;t know how the processing of input is implemented, it will be tricky for them to find the hole to exploit. So I suppose blocking the specific method (as Tomcat did by limiting the number of parameters it will hash) serves to block opportunistic attacks. But it may still leave possibilities for those who are really determined to cause havoc with a specific site.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sosiouxme.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sosiouxme.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sosiouxme.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sosiouxme.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sosiouxme.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sosiouxme.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sosiouxme.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sosiouxme.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sosiouxme.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sosiouxme.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sosiouxme.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sosiouxme.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sosiouxme.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sosiouxme.wordpress.com/371/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=371&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sosiouxme.wordpress.com/2012/01/04/hash-collision-dos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c06920ae028c4a242ef7102ddc9aa9e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sosiouxme</media:title>
		</media:content>
	</item>
		<item>
		<title>Two bits that annoy me about standard Android apps</title>
		<link>http://sosiouxme.wordpress.com/2011/11/29/two-bits-that-annoy-me-about-standard-android-apps/</link>
		<comments>http://sosiouxme.wordpress.com/2011/11/29/two-bits-that-annoy-me-about-standard-android-apps/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 04:45:20 +0000</pubDate>
		<dc:creator>Luke Meyer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[BS]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[hotspot]]></category>

		<guid isPermaLink="false">http://sosiouxme.wordpress.com/?p=366</guid>
		<description><![CDATA[Perhaps I should start a running list, as there are sure to be more. 1. Facebook &#8211; every link that leads to the browser wastes my time going through some stupid Facebook warning *in the browser* that links can, you know, lead to unpredictable stuff, so be careful. Something that if it were necessary at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=366&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Perhaps I should start a running list, as there are sure to be more.</p>
<p>1. Facebook &#8211; every link that leads to the browser wastes my time going through some stupid Facebook warning *in the browser* that links can, you know, lead to unpredictable stuff, so be careful. Something that if it were necessary at all, would make a lot more sense on a PC (where no such warning is given) than a mobile device IMHO, and did I mention, wastes my freaking time and can&#8217;t be disabled as far as I can see.<br />
2. The email app is atrocious. Not GMail, talking about what you use for e.g. an Exchange account. Has only rudimentary understanding of folders, and no way of getting notifications only for specific folders. Wonder if there&#8217;s a better app for that.</p>
<p>I also had a new idea for an app (probably already implemented somewhere) &#8211; hotspot fast track. When you&#8217;re at a public hotspot (or e.g. one at a hotel), every time you connect it wants you to go to some BS web page (usually requiring BS JavaScript) and click through some BS agreement to actually use the internet. As if everyone only ever used the web and anyone gave a shit about the stupid agreement. When you&#8217;re on a mobile this is a huge PITA, not least because you don&#8217;t tend to maintain a steady connection, and find yourself going back at that BS web page once you notice the network doesn&#8217;t seem to be working. The hotspot fast track app would look for wifi connections, test for BS portal redirections, and automatically &#8220;click through&#8221; known portal types that you authorize.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sosiouxme.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sosiouxme.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sosiouxme.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sosiouxme.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sosiouxme.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sosiouxme.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sosiouxme.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sosiouxme.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sosiouxme.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sosiouxme.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sosiouxme.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sosiouxme.wordpress.com/366/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sosiouxme.wordpress.com/366/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sosiouxme.wordpress.com/366/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=366&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sosiouxme.wordpress.com/2011/11/29/two-bits-that-annoy-me-about-standard-android-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c06920ae028c4a242ef7102ddc9aa9e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sosiouxme</media:title>
		</media:content>
	</item>
		<item>
		<title>Three wavelengths aren&#8217;t enough for realistic CG color</title>
		<link>http://sosiouxme.wordpress.com/2011/09/16/three-wavelengths-arent-enough-for-realistic-cg-color/</link>
		<comments>http://sosiouxme.wordpress.com/2011/09/16/three-wavelengths-arent-enough-for-realistic-cg-color/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 03:37:13 +0000</pubDate>
		<dc:creator>Luke Meyer</dc:creator>
				<category><![CDATA[graphics]]></category>
		<category><![CDATA[CG]]></category>
		<category><![CDATA[CIE]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[computer graphics]]></category>
		<category><![CDATA[interference]]></category>
		<category><![CDATA[photorealism]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[ray tracing]]></category>
		<category><![CDATA[RGB]]></category>
		<category><![CDATA[spectrum]]></category>
		<category><![CDATA[thin films]]></category>
		<category><![CDATA[wavelengths]]></category>
		<category><![CDATA[XYZ]]></category>

		<guid isPermaLink="false">http://sosiouxme.wordpress.com/?p=364</guid>
		<description><![CDATA[A bout of insomnia this morning allowed me to rehash an idea that I&#8217;ve long meant to re-visit. It arises from work I began in the summer of 1994 and refined in 1996, and I think has implications that could improve the realism of computer graphics rendering. Put simply, I believe color should be represented [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=364&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A bout of insomnia this morning allowed me to rehash an idea that I&#8217;ve long meant to re-visit. It arises from work I began in the summer of 1994 and refined in 1996, and I think has implications that could improve the realism of computer graphics rendering. Put simply, I believe color should be represented with a much larger sampling of wavelengths than RGB. I have not searched extensively but I don&#8217;t think this has ever been implemented.</p>
<p>My project in 1994 (at the NSF Geometry Center in Minneapolis) centered around a whimsical topic, soap bubbles (or more generally, &#8220;thin films&#8221;). I wanted to find a way to render them, in particular their swirling iridescent colors, which took me on a foray into understanding their physics. As part of my summer project there, I created a rudimentary ray tracer (more of a proof of concept than anything; I didn&#8217;t know anything about ray tracers when I started) just for the purpose of rendering thin films with some degree of realism. Unfortunately the Geometry Center and any records of my project are all long gone now, though I still have a poster and a video I created, perhaps some code somewhere, and a vague memory of the physics.</p>
<p>The reason thin films are colored has to do with interference effects of light; the film is so thin (on the order of the wavelengths of visible light) that reflections of a coherent light ray from the inner surfaces of the film interfere with the original ray, causing that wavelength to come out lighter or darker depending on the exact thickness of the film versus the wavelength. The physics are explained reasonably well at <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Thin-film_interference" target="_blank">Wikipedia</a>. The variations in color across the film are due to slight variations in thickness (resulting from gravity, evaporation, wind, viscosity, etc.) which cause different wavelengths of light to interfere more or less.</p>
<p>The point is that this is happening at the wavelength level. Now imagine a naive computer graphics approach to rendering this; you would calculate the effect on red, green, and blue light &#8211; three wavelengths &#8211; and that would be your color. But it should be obvious that three wavelengths hardly represent the whole spectrum, at least when the effects are occurring at the level of individual wavelengths. And indeed, the results were pretty unconvincing. For a better approximation, I added three wavelengths, although I can&#8217;t remember now how that worked, but at least it was easy to work into a color model, although it may have been wrong-headed (see for reference <a href="http://www.biotele.com/magenta.html" target="_blank">Magenta Ain&#8217;t A Colour</a>). The color bands did look better. Wish I still had the pictures from then to show here.</p>
<p>In 1996, as part of a computer graphics project course at NCSU, I revisited this problem with the idea of using the full spectrum. In an ideal world, we would model a ray of light as a continuous spectral function I(lambda) &#8211; intensity at each wavelength &#8211; and interactions with objects (such as reflection) similarly as functions R<em>n</em>(lambda) to transform brightness of the light at each wavelength, with the result being simply the product of all interaction functions R<em>n</em> and the original ray of light I. The problem is, what exactly does this look like? We don&#8217;t perceive a spectrum of light; we perceive a single color. How do I translate a wavelength function into an RGB value to display on a computer screen?</p>
<p>In 1996, the web did not extend (as far as I could find &#8211; actually it may have) to a deep practical treatment of how to do this. There may have been articles like <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Color_model" target="_blank">this one now on Wikipedia</a> to explain the concept fairly clearly, but for the actual empirical numbers I had to dig up an obscure book in the library. To summarize, our eyes have color receptors of three different varieties, each of which is stimulated differently by a different range of visible wavelengths &#8211; one mostly by longer wavelengths, one mostly by shorter wavelengths, and one mostly by the mid-range. In fact each could be modeled by a stimulation function S<em>receptor</em>(lambda) which could be multiplied by a spectral function I(lambda) and integrated over the visible spectrum to determine that receptor&#8217;s stimulation by a particular ray of light (see that Wikipedia article).</p>
<p>These functions are my key to mapping a spectral intensity function into values I can display. In the 1930s a set of experiments (I can only imagine as incredibly tedious) mapped typical receptor responses as a function of various wavelengths. The receptiveness of the three receptors defines a three-dimensional space called (somewhat arbitrarily) the CIE XYZ color space. Red (long), blue (short), and green (midrange) light can be used to stimulate the individual receptors almost in isolation, which is why monitors only need to emit three wavelengths of light to cover most of our range of color perception.</p>
<p>But that doesn&#8217;t mean that these three wavelengths are representative of interactions with the entire spectrum, and thin films are a clear example of the inadequacy. Using the forty or so wavelengths sampled in my sources, I got very convincing renderings indeed. My film thickness models were trivial -  just linearly decreasing from bottom to top &#8211; but the bands of color looked very realistic.</p>
<p>Everyone&#8217;s familiar with light sources having different spectra. This is why everything looks amazing in department store lights, and why your digital camera likely has different settings for light sources that are incandescent, fluorescent, sunny, cloudy, etc. We can easily see these effects, yet the standard RGB representation of color contains no hint that more than three wavelengths are involved. We know that color interactions actually occur due to the surface characteristics at the microscopic (indeed, molecular) level where all different wavelengths must be affected differently. So why not treat them that way in computer graphics?</p>
<p>My hope is to integrate my full-spectrum  model into an existing renderer, not only allowing me to render films along with normal scenes, but also to apply texture maps to films as thickness maps, thereby modeling the variations seen in actual films (how cool would it be to write your name on a bubble this way?). An open source project like POVray would be perfect. When I looked at this program in particular, I was hoping that color would be represented by a class that I could simply modify. Unfortunately the implementation was more integrated &#8211; macro-based, as I recall &#8211; probably for performance reasons. Perhaps a different program would be more amenable. But in any case, I would run into the problem of representation: no one is used to specifying colors as a sampling at 40+ wavelengths. Everyone&#8217;s scene definitions use RGB colors, and there&#8217;s no unique mapping of an RGB coordinate into such a representation (which when you think about it is the whole point here &#8211; two surfaces may both appear the same under one light source, but reflect very different colors under another, due to different interaction functions) &#8211; in fact there are infinitely many. In order to specify realistic colors as a full spectrum, we&#8217;d have to go around measuring in the real world with a spectrometer.</p>
<p>Still, this is an intriguing idea to me, and I&#8217;d really like a chance to see how it works out one day.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sosiouxme.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sosiouxme.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sosiouxme.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sosiouxme.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sosiouxme.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sosiouxme.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sosiouxme.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sosiouxme.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sosiouxme.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sosiouxme.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sosiouxme.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sosiouxme.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sosiouxme.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sosiouxme.wordpress.com/364/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=364&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sosiouxme.wordpress.com/2011/09/16/three-wavelengths-arent-enough-for-realistic-cg-color/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c06920ae028c4a242ef7102ddc9aa9e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sosiouxme</media:title>
		</media:content>
	</item>
		<item>
		<title>Android and openness</title>
		<link>http://sosiouxme.wordpress.com/2011/06/11/android-and-openness/</link>
		<comments>http://sosiouxme.wordpress.com/2011/06/11/android-and-openness/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 00:59:54 +0000</pubDate>
		<dc:creator>Luke Meyer</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[nexus one]]></category>
		<category><![CDATA[skyhook]]></category>
		<category><![CDATA[sprint]]></category>
		<category><![CDATA[t-mobile]]></category>
		<category><![CDATA[trilug]]></category>
		<category><![CDATA[unlocked]]></category>
		<category><![CDATA[verizon]]></category>

		<guid isPermaLink="false">http://sosiouxme.wordpress.com/?p=361</guid>
		<description><![CDATA[On Thursday I gave a talk at TriLUG. The slides I used are available but will probably be rather cryptic without my accompanying commentary. Although I understand that Google has had to contend with both the open source zealots and the closed-everything carriers, upon looking at the trend, I find Google&#8217;s actions getting more disturbing. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=361&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>On Thursday I gave a <a href="http://trilug.org/2011-06-09/android" target="_blank">talk at TriLUG</a>. The <a href="https://docs.google.com/leaf?id=0B41WIpMINtBHYjdlOGE2OTUtMjJjZi00YjdkLWJkNTEtYzRlMzM5YmZmMjA3&amp;hl=en_US&amp;authkey=CI6BwvEE" target="_blank">slides I used are available</a> but will probably be rather cryptic without my accompanying commentary.</p>
<p>Although I understand that Google has had to contend with both the open source zealots and the closed-everything carriers, upon looking at the trend, I find Google&#8217;s actions getting more disturbing. Just as Android seems to be coming into its own and Google should have more power than ever to twist arms, Google seems to be wimping out &#8211; or turning evil. I hope I&#8217;m wrong and they&#8217;re just waiting for the right time.</p>
<p>One thing I completely forgot to talk about is the abandoning of the Nexus One. When it came out, it was supposed to herald a new age of cross-carrier, stock-Android phones (with a built-in connection-sharing capability, no less). Only T-Mobile really picked it up &#8211; you could use it on AT&amp;T but without 3G. Verizon and Sprint were supposed to be coming out with support for the same concept and just a different radio, but instead they released their own phones, with the usual modifications and constraints. So why did Google let them? They didn&#8217;t have to; the Skyhook case shows that Google can essentially pull their blessing from any phone for any reason. An Android phone without the Google apps isn&#8217;t going to be very attractive to consumers. Why didn&#8217;t Google force Verizon and Sprint to kowtow to the Nexus One before allowing them to release any more Android phones?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sosiouxme.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sosiouxme.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sosiouxme.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sosiouxme.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sosiouxme.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sosiouxme.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sosiouxme.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sosiouxme.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sosiouxme.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sosiouxme.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sosiouxme.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sosiouxme.wordpress.com/361/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sosiouxme.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sosiouxme.wordpress.com/361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=361&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sosiouxme.wordpress.com/2011/06/11/android-and-openness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c06920ae028c4a242ef7102ddc9aa9e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sosiouxme</media:title>
		</media:content>
	</item>
		<item>
		<title>Broadcom wifi and Fedora</title>
		<link>http://sosiouxme.wordpress.com/2011/05/29/broadcom-wifi-and-fedora/</link>
		<comments>http://sosiouxme.wordpress.com/2011/05/29/broadcom-wifi-and-fedora/#comments</comments>
		<pubDate>Sun, 29 May 2011 12:24:15 +0000</pubDate>
		<dc:creator>Luke Meyer</dc:creator>
				<category><![CDATA[fedora]]></category>
		<category><![CDATA[BCM4312]]></category>
		<category><![CDATA[broadcom]]></category>
		<category><![CDATA[fedora 13]]></category>
		<category><![CDATA[fedora 14]]></category>
		<category><![CDATA[fedora 15]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[gnome 3]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[kmod-wl]]></category>
		<category><![CDATA[mirror video]]></category>

		<guid isPermaLink="false">http://sosiouxme.wordpress.com/?p=358</guid>
		<description><![CDATA[I bought my Lenovo G550 laptop with the idea that, while being fairly inexpensive, Linux would run well on it. And for the most part, that&#8217;s been true. Even the camera worked without a hitch. The main problem I had was that under Fedora 13, I couldn&#8217;t get the video to mirror to the SVGA [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=358&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I bought my Lenovo G550 laptop with the idea that, while being fairly inexpensive, Linux would run well on it. And for the most part, that&#8217;s been true. Even the camera worked without a hitch. The main problem I had was that under Fedora 13, I couldn&#8217;t get the video to mirror to the SVGA output &#8211; the screen would just go black when I tried, rendering it useless for presentations. But that seemed to be solved with Fedora 14, so I chalked it up to temporary machine-specific weirdness.</p>
<p>The real problem since then has been the wifi. When I originally installed the box, I saw that the wifi wasn&#8217;t working. I ran lspci, saw that I had a Broadcom BCM4312 chipset, and found with a quick trip to Google that it needed some proprietary firmware (joy). There were some old articles on the net about how to do that by cutting it out of other drivers, but it seemed the modern way to do this is just to enable the rpmfusion repos and install kmod-wl. So I did that, and it worked. Problem solved and largely forgotten, for a while.</p>
<p>However, as far as I can recall, this never worked on Fedora 14. So I was stuck with either no wifi (Fedora 14), or no presentations (Fedora 13). I chose to run Fedora 13 for my personal hacking, and use the Windows boot (which naturally worked fine) for presentations. Then a month or two ago I updated Fedora 13, and wifi stopped working there too. Even if I booted an earlier kernel; under no version could I get it working. Windows of course still worked, so I knew it wasn&#8217;t hardware.</p>
<p>Fedora 15 just went GA a few days ago. I installed it yesterday, tried the same trick with kmod-wl, and glory be! Wifi worked! Mirrored video worked! I was back in business.</p>
<p>Then I found that my Gnome 3 desktop (which by the way&#8230; not sure I like&#8230; weird merger of Mac and Android) had gotten into a weird state, and ran a system update for bug fixes. Calamity! Wifi was back to broken &#8211; again, with either the original kernel or the updated one. NetworkManager failed to even run &#8211; it would start with a red mark in my toolbar, then just disappear. Maybe it&#8217;s not kernel-specific? Maybe it&#8217;s NetworkManager? I don&#8217;t know.</p>
<p>Well, I just installed again, and ran updates, and then installed kmod-wl (which looks like it might have pulled in an updated broadcom-wl for the new kernel), and it looks like the wifi is back up. But this is a lousy situation &#8211; I&#8217;m going to be fearing making system updates because my wifi will break <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  I&#8217;m not even sure who to complain to&#8230; the driver is 3rd-party, in fact so is the repo, so it&#8217;s not Fedora&#8217;s fault per se. On the other hand maybe the reason it keeps breaking is because Fedora moves too quickly and changes kernel APIs too much for the wifi firmware to keep up.</p>
<p>For now, I guess the solution is to dual-boot F15 with itself, and only update one at a time to make sure one is always working. (Or try Ubuntu, some of you will say; but I like Fedora, and they don&#8217;t share bootloaders very well.)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sosiouxme.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sosiouxme.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sosiouxme.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sosiouxme.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sosiouxme.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sosiouxme.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sosiouxme.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sosiouxme.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sosiouxme.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sosiouxme.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sosiouxme.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sosiouxme.wordpress.com/358/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sosiouxme.wordpress.com/358/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sosiouxme.wordpress.com/358/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=358&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sosiouxme.wordpress.com/2011/05/29/broadcom-wifi-and-fedora/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c06920ae028c4a242ef7102ddc9aa9e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sosiouxme</media:title>
		</media:content>
	</item>
		<item>
		<title>Is this thing on? ::feedback:: ouch&#8230;</title>
		<link>http://sosiouxme.wordpress.com/2011/03/31/is-this-thing-on-ouch/</link>
		<comments>http://sosiouxme.wordpress.com/2011/03/31/is-this-thing-on-ouch/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 01:01:13 +0000</pubDate>
		<dc:creator>Luke Meyer</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[honeycomb]]></category>
		<category><![CDATA[less is more]]></category>

		<guid isPermaLink="false">http://sosiouxme.wordpress.com/?p=353</guid>
		<description><![CDATA[Well &#8211; I don&#8217;t want to let the *entire* month of March go by without a post. I just haven&#8217;t done much with tech this month, though. It sucked. But evidently my absence has caused a surge in popularity, according to my stats. Less is more? If I remember correctly &#8211; is Honeycomb the first [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=353&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well &#8211; I don&#8217;t want to let the *entire* month of March go by without a post. I just haven&#8217;t done much with tech this month, though. It sucked. But evidently my absence has caused a surge in popularity, according to my stats. Less is more?</p>
<p>If I remember correctly &#8211; is Honeycomb the first version of Android where we actually saw a preview, got to fiddle with the SDK platform preview before it was actually embodied in a device? If so, better late than never, and let&#8217;s hope it means we&#8217;re on the way to seeing more of a community effort. Hey, it took a while for Red Hat to learn with Fedora, too, and they didn&#8217;t have voracious proprietary partners to contend with.</p>
<p>I have a meetup or two to arrange, but I hope I get some time to work further with ORMlite shortly.</p>
<p>Happy April Fools Day tomorrow!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sosiouxme.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sosiouxme.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sosiouxme.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sosiouxme.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sosiouxme.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sosiouxme.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sosiouxme.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sosiouxme.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sosiouxme.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sosiouxme.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sosiouxme.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sosiouxme.wordpress.com/353/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sosiouxme.wordpress.com/353/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sosiouxme.wordpress.com/353/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=353&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sosiouxme.wordpress.com/2011/03/31/is-this-thing-on-ouch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c06920ae028c4a242ef7102ddc9aa9e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sosiouxme</media:title>
		</media:content>
	</item>
		<item>
		<title>Trying out OrmLite by migrating LogMyLife #androiddev</title>
		<link>http://sosiouxme.wordpress.com/2011/02/06/trying-out-ormlite-by-migrating-logmylife-androiddev/</link>
		<comments>http://sosiouxme.wordpress.com/2011/02/06/trying-out-ormlite-by-migrating-logmylife-androiddev/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 15:15:59 +0000</pubDate>
		<dc:creator>Luke Meyer</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[LogMyLife]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[broadcastreceiver]]></category>
		<category><![CDATA[checked exception]]></category>
		<category><![CDATA[dao]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[dto]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[license]]></category>
		<category><![CDATA[literal clause]]></category>
		<category><![CDATA[multithread]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[ormlite]]></category>
		<category><![CDATA[plumbing]]></category>
		<category><![CDATA[raw sql]]></category>
		<category><![CDATA[runtime exception]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sqlexception]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://sosiouxme.wordpress.com/?p=345</guid>
		<description><![CDATA[In addition to ActiveAndroid I also took a look at OrmLite for Android. It&#8217;s a little larger than ActiveAndroid, but doesn&#8217;t dwarf my project like DB4O would. And the license is right for an open source dude like myself. Also it looks like it covers more functionality, also allowing you to get at the native [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=345&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In addition to ActiveAndroid I also took a look at <a href="http://ormlite.sourceforge.net/sqlite_java_android_orm.html" target="_blank">OrmLite for Android</a>. It&#8217;s a little larger than ActiveAndroid, but doesn&#8217;t dwarf my project like DB4O would. And the license is right for an open source dude like myself. Also it looks like it covers more functionality, also allowing you to get at the native DB connection (which doesn&#8217;t look possible with ActiveAndroid). And you aren&#8217;t required to subclass anything, though convenience base classes are provided. All good stuff.</p>
<p>When I tried out the demo project (which I also used in my TriDroid presentation), it looked reasonably straightforward. So just now I downloaded the JAR to take a look at what it would look like to convert LogMyLife to use OrmLite. What I didn&#8217;t notice is that the demo project is based on version 4.6, while the current version has jumped up to 4.10 a few days ago, which is apparently a <a href="http://sourceforge.net/news/?group_id=297653&amp;id=296968" target="_blank">significant release</a>. I figured out things were different pretty quickly, though, because the first time I tried to annotate a DTO, the @DatabaseTable annotation couldn&#8217;t be found. I needed to download and link the ormlite-core JAR in addition to the ormlite-android JAR (which would be all that&#8217;s needed in previous releases). I suppose if I were using a maven POM to manage my build this would all be taken care of&#8230; but I haven&#8217;t gotten around to that.</p>
<p>I hope the docs are still reasonably accurate&#8230; I might be a little bit of a guinea pig for this release. We&#8217;ll see.</p>
<h2>Bringing in the OrmLite helper</h2>
<p>So I just went down a long rabbit trail about where exactly to put the OrmLite plumbing. The examples all have a helper that you have to keep track of per-Activity. But didn&#8217;t I just demonstrate for myself that an application-wide DB handle worked fine? So I&#8217;m thinking about just putting the plumbing in my Application subclass and seeing what happens. The complication seems to be multi-threading &#8211; the <a href="https://groups.google.com/group/ormlite-user" target="_blank">Google Group</a> had a <a href="https://groups.google.com/group/ormlite-user/browse_thread/thread/4b48c3f5402db8d3/f9281c06a97d1cb4?lnk=gst&amp;q=application#f9281c06a97d1cb4" target="_blank">discussion</a> pointing to <a href="http://kagii.squarespace.com/journal/2010/9/10/android-sqlite-locking.html" target="_blank">this really interesting article on concurrent Sqlite access</a>. I don&#8217;t really have multiple threads accessing the DB in LogMyLife, with the possible exception of my broadcast handlers &#8211; I&#8217;m not actually sure if they come in as a separate thread, or even a separate process, or what. That&#8217;s something for me to figure out soon. In the meantime, I guess I&#8217;ll go ahead with my scheme to try it in my Application class.</p>
<p>So first, I have to define a helper with callbacks for when I&#8217;m opening a connection and need to make sure the schema is in place, which needs to subclass OrmLiteSqliteOpenHelper (which subclasses the SqliteOpenHelper I&#8217;m used to) and define what to do in when the DB is being created or updated. Looks like it can also define some simple interactions for getting DAOs. This needs to be configured into the OpenHelperManager which is used to actually create my helper in context; the method of configuration is either to configure a string in my strings.xml and let magic happen behind the scenes, or to explicitly set a factory object on OHM that will return my helper. As it&#8217;s not much trouble and (I think) clearer, I do the latter.</p>
<h2>Nuts and bolts</h2>
<p>Soon I run into a little issue. OrmLite refers to SQLException all over the place, but it&#8217;s referring to java.sql.SQLException, generally used for JDBC, as opposed to the android.database.SQLException that&#8217;s usually used for Sqlite exceptions. It would be a nuisance just to have to be conscious of which is relevant. But the real difference is that the android.database.SQLException is a runtime exception, while java.sql.SQLException is a checked exception, so I have to deal with it somehow in any of my code that uses the DB. This forces me to re-think exception handling. Checked vs. un-checked exceptions is kind of an old argument, but I thought after all our experiences with Java the scales were starting to tip toward unchecked? As far as I know Java is the only major language using checked exceptions widely; the dynamic languages gaining popularity don&#8217;t really even have the ability to use them. So it&#8217;s kind of disheartening to see this throwback; although I imagine it arises from the JDBC nature of the rest of the OrmLite package.</p>
<p>Now I go to create a Dao by subclassing BaseDaoImpl, and I&#8217;m given a choice of four different constructors (but must include one). The most obvious-seeming one is evidently to be used with a DI container, so I look at the other ones. Eventually I realize that it&#8217;s probably best to use the one that&#8217;s like the generic DAO constructors, e.g. BaseDaoImpl.createDao(getConnectionSource(), Tracker.class).</p>
<p>While I&#8217;m working on the numerous errors Eclipse is reporting from my brutal refactoring, I realize that my BroadcastReceivers don&#8217;t have access to my Application subclass, so they have their own code for instantiating the DB connection. There&#8217;s no helper base class for them &#8211; reasonable, given they don&#8217;t really have a life-cycle. Suddenly just defining a string looks like a much nicer path for configuring the helper class.</p>
<h2>An example query</h2>
<p>And now I come up against one of my first query refactorings. I have a method like so in my existing domain code:</p>
<pre>public Alert fetchNextAlert() {
 return fetchAlert(
  db_ALERT_ENABLED + " = 1 AND " + db_ALERT_SKIP_NEXT + " != 1 AND " +
  db_ALERT_NEXT_TIME + " &gt; datetime('now', 'localtime')",
  null, null, null, db_ALERT_NEXT_TIME + " ASC", "1"
 );
}</pre>
<p>fetchAlert takes these raw SQL constraints and turns them into a query for a single row from the Alerts table, then converts that row into an Alert DTO. It&#8217;s all fairly ugly code, to be sure. Here&#8217;s my first crack at a replacement in my OrmLite DAO:</p>
<pre>public Alert fetchNextAlert() throws SQLException {
 return queryForFirst(queryBuilder()
  .orderBy(C.db_ALERT_NEXT_TIME, true)
  .limit(1)
  .where().eq(C.db_ALERT_ENABLED, true)
  .and().ne(C.db_ALERT_SKIP_NEXT, true)
  .and().gt(C.db_ALERT_NEXT_TIME, new Date())
  .prepare());   
 }</pre>
<p>Now this is reasonably clear and concise, and in line with how other ORM libraries work. But one thing troubles me: as far as I can tell, there&#8217;s no way to get raw SQL in as part of a where clause; I couldn&#8217;t duplicate the &#8221; &gt; datetime(&#8216;now&#8217;, &#8216;localtime&#8217;)&#8221; constraint, and in my experience, when it comes to time, you want to speak the DB&#8217;s language. But perhaps I&#8217;m wrong this time &#8211; certainly the code above captures the intent. If absolutely needed, I could run a raw query to return the ID of the Alert I want, then just use standard DAO methods to turn that into an Alert DTO; two queries instead of one, though.</p>
<p>I have reasonably-sized swaths of code compiling at this point; time for a break.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sosiouxme.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sosiouxme.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sosiouxme.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sosiouxme.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sosiouxme.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sosiouxme.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sosiouxme.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sosiouxme.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sosiouxme.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sosiouxme.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sosiouxme.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sosiouxme.wordpress.com/345/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sosiouxme.wordpress.com/345/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sosiouxme.wordpress.com/345/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=345&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sosiouxme.wordpress.com/2011/02/06/trying-out-ormlite-by-migrating-logmylife-androiddev/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c06920ae028c4a242ef7102ddc9aa9e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sosiouxme</media:title>
		</media:content>
	</item>
		<item>
		<title>quick look at ActiveAndroid #androiddev</title>
		<link>http://sosiouxme.wordpress.com/2011/01/25/quick-look-at-activeandroid-androiddev/</link>
		<comments>http://sosiouxme.wordpress.com/2011/01/25/quick-look-at-activeandroid-androiddev/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 11:37:05 +0000</pubDate>
		<dc:creator>Luke Meyer</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[Languages/frameworks]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[activeandroid]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[orm]]></category>

		<guid isPermaLink="false">http://sosiouxme.wordpress.com/?p=341</guid>
		<description><![CDATA[Just checking out ActiveAndroid, and while it seems to do a lot to make Android DB access easier, a few criticisms appear right up front: Doesn&#8217;t having to extend the proprietary base class as your Application class seem a little&#8230; invasive? It&#8217;s like saying, this isn&#8217;t my application, this is an ActiveAndroid application! I&#8217;m sure [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=341&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just checking out <a href="https://www.activeandroid.com/" target="_blank">ActiveAndroid</a>, and while it seems to do a lot to make Android DB access easier, a few criticisms appear right up front:</p>
<ul>
<li>Doesn&#8217;t having to extend the proprietary base class as your Application class seem a little&#8230; invasive? It&#8217;s like saying, this isn&#8217;t my application, this is an ActiveAndroid application!</li>
<li>I&#8217;m sure it wasn&#8217;t intended this way, but looking at the <a href="https://www.activeandroid.com/EULA.html" target="_blank">licensing terms</a>:</li>
</ul>
<blockquote><p>The SOFTWARE PRODUCT is licensed as follows:<br />
<strong>(a) Installation and Use.</strong><br />
Michael Pardo grants you the right to install and use copies of the  SOFTWARE PRODUCT on your computer running a validly licensed copy of the  operating system for which the SOFTWARE PRODUCT was designed [e.g.,  Windows 95, Windows NT, Windows 98, Windows 2000, Windows 2003, Windows  XP, Windows ME, Windows Vista].</p></blockquote>
<p>Let&#8217;s ignore for the moment the question of what OS this intended for&#8230; but isn&#8217;t this JAR going to be built into our app? Doesn&#8217;t this technically mean we can&#8217;t distribute the app?</p>
<ul>
<li>This is based on reflection, right? So isn&#8217;t that gonna be kind of slow on Android?</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sosiouxme.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sosiouxme.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sosiouxme.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sosiouxme.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sosiouxme.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sosiouxme.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sosiouxme.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sosiouxme.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sosiouxme.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sosiouxme.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sosiouxme.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sosiouxme.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sosiouxme.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sosiouxme.wordpress.com/341/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=341&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sosiouxme.wordpress.com/2011/01/25/quick-look-at-activeandroid-androiddev/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c06920ae028c4a242ef7102ddc9aa9e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sosiouxme</media:title>
		</media:content>
	</item>
		<item>
		<title>Intercepting SimpleCursorAdapter data #androiddev</title>
		<link>http://sosiouxme.wordpress.com/2011/01/13/intercepting-simplecursoradapter-data-androiddev/</link>
		<comments>http://sosiouxme.wordpress.com/2011/01/13/intercepting-simplecursoradapter-data-androiddev/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 13:37:25 +0000</pubDate>
		<dc:creator>Luke Meyer</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[listviews]]></category>
		<category><![CDATA[LogMyLife]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[adapter]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[numeric]]></category>
		<category><![CDATA[precision]]></category>
		<category><![CDATA[setviewbinder]]></category>
		<category><![CDATA[setviewvalue]]></category>
		<category><![CDATA[simplecursoradapter]]></category>
		<category><![CDATA[viewbinder]]></category>

		<guid isPermaLink="false">http://sosiouxme.wordpress.com/?p=338</guid>
		<description><![CDATA[Normally when you create a SimpleCursorAdapter for a ListView, you specify a one-to-one mapping of the columns from the DB and the views where you want them to end up, and the adapter basically just does a toString() on your data and sticks it in the view. You can, of course, modify this behavior by [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=338&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Normally when you create a SimpleCursorAdapter for a ListView, you specify a one-to-one mapping of the columns from the DB and the views where you want them to end up, and the adapter basically just does a toString() on your data and sticks it in the view.</p>
<p>You can, of course, modify this behavior by overriding <a href="http://developer.android.com/reference/android/widget/SimpleCursorAdapter.html#setViewText(android.widget.TextView,%20java.lang.String)" target="_blank">setViewText</a>, which lets you reformat the text or modify the view as you wish; but it doesn&#8217;t give you the DB cursor, just a String, so you can&#8217;t pull the data yourself or refer to other columns. But not to despair (or turn to the NotSoSimpleCursorAdapter)! You can modify anything you want by providing a ViewBinder to the adapter.</p>
<p>The main reason I&#8217;m talking about this is because I think the <a href="http://developer.android.com/reference/android/widget/SimpleCursorAdapter.html" target="_blank">documentation</a> on this is just a little vague:</p>
<blockquote><p>An easy adapter to map columns from a cursor to TextViews or ImageViews  defined in an XML file. You can specify which columns you want, which  views you want to display the columns, and the XML file that defines  the appearance of these views.   Binding occurs in two phases. First, if a  <code><a href="http://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder.html">SimpleCursorAdapter.ViewBinder</a></code> is available,  <code><a href="http://developer.android.com/reference/android/widget/SimpleCursorAdapter.ViewBinder.html#setViewValue%28android.view.View,%20android.database.Cursor,%20int%29">setViewValue(android.view.View, android.database.Cursor, int)</a></code> is invoked. If the returned value is true, binding has occured. If the  returned value is false and the view to bind is a TextView,  <code><a href="http://developer.android.com/reference/android/widget/SimpleCursorAdapter.html#setViewText%28android.widget.TextView,%20java.lang.String%29">setViewText(TextView, String)</a></code> is invoked. If the returned value  is false and the view to bind is an ImageView,  <code><a href="http://developer.android.com/reference/android/widget/SimpleCursorAdapter.html#setViewImage%28android.widget.ImageView,%20java.lang.String%29">setViewImage(ImageView, String)</a></code> is invoked. If no appropriate  binding can be found, an <code><a href="http://developer.android.com/reference/java/lang/IllegalStateException.html">IllegalStateException</a></code> is thrown.</p></blockquote>
<p>OK, great. This also promises that you can put any kind of data in any kind of view (not just a TextView). But I didn&#8217;t know what it meant by &#8220;if a  <code>SimpleCursorAdapter.ViewBinder</code> is available.&#8221; Turns out it&#8217;s pretty simple:</p>
<ol>
<li>Implement the SimpleCursorAdapter.ViewBinder interface (it has only one method, setViewValue, which gives you the Cursor and the view to work with &#8211; and just return false to let the adapter&#8217;s default behavior handle the binding). I did this for LogCursorAdapter in an inner class.</li>
<li>Instantiate your implementation and use setViewBinder on your SimpleCursorAdapter instance to set it up as the binder. This makes it &#8220;available&#8221; for the process described above.</li>
</ol>
<p>This is arguably better than overriding setViewText because you wouldn&#8217;t even have to subclass the adapter to do it &#8211; or even create a class (it could be an anonymous implementation). And of course you can access all of the cursor columns in any way you please. Nice.</p>
<p>As far as my earlier data retrieval woes, this gave me the ability to pull data out the way I wanted. Sqlite seems to be storing plenty of precision in the NUMERIC column type; it was just a matter of it being retrieved as a String that caused truncation of precision. In this case the solution was just to pull it out as a Long or Double as appropriate and format it myself (I also learned about DecimalFormat which was very helpful).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sosiouxme.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sosiouxme.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sosiouxme.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sosiouxme.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sosiouxme.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sosiouxme.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sosiouxme.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sosiouxme.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sosiouxme.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sosiouxme.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sosiouxme.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sosiouxme.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sosiouxme.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sosiouxme.wordpress.com/338/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=338&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sosiouxme.wordpress.com/2011/01/13/intercepting-simplecursoradapter-data-androiddev/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c06920ae028c4a242ef7102ddc9aa9e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sosiouxme</media:title>
		</media:content>
	</item>
		<item>
		<title>LogMyLife alpha release &#8211; try it out!</title>
		<link>http://sosiouxme.wordpress.com/2011/01/13/logmylife-alpha-release-try-it-out/</link>
		<comments>http://sosiouxme.wordpress.com/2011/01/13/logmylife-alpha-release-try-it-out/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 13:12:05 +0000</pubDate>
		<dc:creator>Luke Meyer</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[LogMyLife]]></category>
		<category><![CDATA[Activity]]></category>
		<category><![CDATA[alpha]]></category>
		<category><![CDATA[label]]></category>
		<category><![CDATA[launucher]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[setTitle]]></category>

		<guid isPermaLink="false">http://sosiouxme.wordpress.com/?p=335</guid>
		<description><![CDATA[It&#8217;s time for LogMyLife to see the light of day outside my house &#8211; I&#8217;m calling it alpha-ready today. Go check it out. I&#8217;ve had it with fiddling around and no one seeing the results It&#8217;s actually pretty functional, but it&#8217;s not as pretty as it could be and I know there are a few [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=335&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time for LogMyLife to see the light of day outside my house &#8211; I&#8217;m calling it alpha-ready today. <a href="https://github.com/sosiouxme/LogMyLife/wiki" target="_blank">Go check it out</a>. I&#8217;ve had it with fiddling around and no one seeing the results <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  It&#8217;s actually pretty functional, but it&#8217;s not as pretty as it could be and I know there are a few corner cases where things are a little wonky. And there&#8217;s so much functionality left to add&#8230; but it&#8217;s been a great project for me to familiarize myself with a lot of Android UI. And that will continue.</p>
<p>Some interesting stuff I just learned recently:</p>
<h2>What&#8217;s in a name?</h2>
<p>The application name and the name you see on its home screen/launcher icon need not match (though it&#8217;s probably wisest if they do). The application has a label in the manifest, and so does each activity (potentially).</p>
<p>If you look up the application in the settings page, it will show the application name (probably also in any market interactions). The launcher icon will show the label on the launcher activity. Presumably this is because you could conceivably have multiple launching activities for the same app (different entry points).</p>
<p>In my case, I wanted to show a different label (&#8220;LogMyLife &#8211; Main&#8221;) to the user once they launch the app than the application name (&#8220;LogMyLife&#8221;), so they&#8217;re oriented once they return; so I just created a shell activity (&#8220;Launcher&#8221;) with the correct app label which simply replaces itself with the real front Activity, just so I could get the labelling right. There&#8217;s probably a better way, like changing the label once the activity launches. In fact, I just tried that out (setTitle at the beginning of onCreate) and it works fine. Heh &#8211; live and learn.</p>
<p>Also interestingly, when I noticed this and changed the label, Android didn&#8217;t handle the change very well, at least in the 1.5 emulator where I test this (likely fixed since). The icon with the old label remained, but it wouldn&#8217;t actually load the app (error), and there was no new icon/label. I had to un-install and re-install the app to get it to launch properly.</p>
<h2>Displaying DB data</h2>
<p>I was going to follow up a bit on my last post, but I think I&#8217;ll do it with another post.</p>
<h2>Onward</h2>
<p>Anyway, the release is out there, so please let me know what you think of it. And feel free to hack it up if you want to see your own improvements! Github can have your own clone set up in seconds.</p>
<p>I may start working on the website for this sooner rather than later. SpringSource released some kind of library to assist with Android so I&#8217;m itching to try it out!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sosiouxme.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sosiouxme.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sosiouxme.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sosiouxme.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sosiouxme.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sosiouxme.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sosiouxme.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sosiouxme.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sosiouxme.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sosiouxme.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sosiouxme.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sosiouxme.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sosiouxme.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sosiouxme.wordpress.com/335/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sosiouxme.wordpress.com&amp;blog=10847948&amp;post=335&amp;subd=sosiouxme&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sosiouxme.wordpress.com/2011/01/13/logmylife-alpha-release-try-it-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c06920ae028c4a242ef7102ddc9aa9e6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sosiouxme</media:title>
		</media:content>
	</item>
	</channel>
</rss>
