<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.2" -->
<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/"
	>

<channel>
	<title>Bogle's Blog</title>
	<link>http://thebogles.com/blog</link>
	<description>Things I care about</description>
	<pubDate>Wed, 09 Jun 2010 21:37:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>
	<language>en</language>
			<item>
		<title>Code Reviews at Google</title>
		<link>http://thebogles.com/blog/2010/06/code-reviews-at-google/</link>
		<comments>http://thebogles.com/blog/2010/06/code-reviews-at-google/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 23:03:40 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
	<category>Google</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2010/06/code-reviews-at-google/</guid>
		<description><![CDATA[I wanted to share a little bit about how Google does code reviews, because both the infrastructure and the philosophy are potentially useful to developers in many companies.
Google tries to do as much as possible through the browser, and that extends to code reviews.  We use a web-based code review tool called Mondrian that [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to share a little bit about how Google does code reviews, because both the infrastructure and the philosophy are potentially useful to developers in many companies.</p>
<p>Google tries to do as much as possible through the browser, and that extends to code reviews.  We use a web-based code review tool called <a href="http://www.youtube.com/watch?v=IHHAL1pqsPk">Mondrian</a> that integrates with the rest of the development infrastructure to provide some unique features. </p>
<p>For example, as you revise files on your local disk over the course of a code review, Mondrian automatically snapshots each revision, without requiring any interaction with the source control system. Mondrian allows reviewers to diff between any two snapshots or the repository version of a file to be sure that all comments have been addressed.  Reviewers can leave comments on any line of the file, and authors can respond back to the comments inline. Keyboard shortcuts (similar to those in Gmail) allow reviewers to quickly navigate through the differences and comments.</p>
<p>Mondrian&#8217;s features address some of the big issues I&#8217;ve encountered with code reviews in the past.  Without having to sit down side by side in real time, it&#8217;s easy to do a good code review and ensure that all comments have been fully responded to. This makes geographically distributed development easier.  </p>
<p>The key ideas behind Mondrian have been released in an open source project called <a href="http://code.google.com/p/rietveld/">Rietveld</a>, which uses AppEngine and Subversion. </p>
<p>Mondrian was written by Guido van Rossum, author of the Python programming language and a Google employee.   Guido has a tech talk that goes into some depth regarding the features of Mondrian.</p>
<p><object width="480" height="385"><br />
<param name="movie" value="http://www.youtube.com/v/IHHAL1pqsPk&#038;hl=en_US&#038;fs=1&#038;"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/IHHAL1pqsPk&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>The right tools enable more efficient engineering and better code quality.  By reducing the friction of code reviews, Google can use them liberally.  It&#8217;s typical to get a code review both from an owner of the package you are modifying and also (if you&#8217;re working in a language you&#8217;re not so familiar with) with someone who is certified in creating readable code in that language. A code review is a chance to both spot errors and to share expertise and ideas with other engineers.</p>
<p><b>Update</b>: Curtis Bartley has an interesting post on <a href="http://curtisb.posterous.com/what-should-mozilla-look-for-in-an-automated">strengths and weakeness of Mondrian</a> and recommendations relative to Mozilla.</p>
<p><b>Update 2</b>:  One of the commenters asked about source control.  Google uses Perforce as the primary source control system but a number of developers (myself included) use Git on their machines.  Several Google developers have implemented a good bridge between the P4 and Git worlds as a 20% project.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2010/06/code-reviews-at-google/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Farewall Beyond411: discontinuing service on June 30th</title>
		<link>http://thebogles.com/blog/2010/05/farewall-beyond411-discontinuing-service-on-june-30th/</link>
		<comments>http://thebogles.com/blog/2010/05/farewall-beyond411-discontinuing-service-on-june-30th/#comments</comments>
		<pubDate>Tue, 04 May 2010 05:54:11 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
	<category>Berry 411</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2010/05/farewall-beyond411-discontinuing-service-on-june-30th/</guid>
		<description><![CDATA[I&#8217;m saying farewell to another old friend: the Beyond411 local search app for the Blackberry will discontinue service as of June 30th.  
I first started working on Beyond411 (then called Berry 411) in July 2004. When I began, the Blackberry was the leading and best smartphone platform, and there were no good local search [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m saying farewell to another old friend: the Beyond411 local search app for the Blackberry will discontinue service as of June 30th.  </p>
<p>I first started working on Beyond411 (then called Berry 411) in <a href="http://thebogles.com/blog/2004/7/">July 2004</a>. When I began, the Blackberry was the leading and best smartphone platform, and there were no good local search applications for it. It was gratifying to help fill that gap and to build an app that both I and my users appreciated.</p>
<p>Many versions and users later, the world is a very different place. There are a number of great search apps for smartphones.  Smartphones have exploded in popularity and diversity, and I no longer even have a Blackberry.  </p>
<p>It&#8217;s been increasingly hard to give Beyond411 the attention it needs. RIM is releasing an ever-increasing number of models and backwards compatibility has suffered; most have issues running Beyond411.  I really enjoyed being an engineer at iLike and now Google but that leaves less spare hacking energy. Lastly, keeping the web service up and running requires a certain amount of ongoing attention.  </p>
<p>Rather than giving users a bad experience, I&#8217;ve decided it&#8217;s best to give users time to find alternatives and then end the service. Thanks to everyone who has contributed your suggestions and support through the years!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2010/05/farewall-beyond411-discontinuing-service-on-june-30th/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Two weeks at Google</title>
		<link>http://thebogles.com/blog/2010/04/two-weeks-at-google/</link>
		<comments>http://thebogles.com/blog/2010/04/two-weeks-at-google/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 01:04:53 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
	<category>Google</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2010/04/two-weeks-at-google/</guid>
		<description><![CDATA[I&#8217;ve just finished my first two weeks at Google as a &#8220;Noogler&#8221; and would like to share of my experiences here for those who are curious about Google&#8217;s approach to scalable engineering.  
(One thing I won&#8217;t include is any description of food.  I have a friend who has threatened to unfollow me if [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished my first two weeks at Google as a &#8220;Noogler&#8221; and would like to share of my experiences here for those who are curious about Google&#8217;s approach to scalable engineering.  </p>
<p>(One thing I won&#8217;t include is any description of food.  I have a friend who has threatened to unfollow me if a yammer on about that topic!)</p>
<p>There is an amazing contrast between my experiences beginning as a new employee at a large Redmond company in 1995 and starting at Google today.  </p>
<p>At that Redmond company, circa 1995, you had a day or so of orientation and then you were sent off to a particular team to begin work and learn the ropes.  Each team had its own hiring bar, culture, coding standards, and ways of bring new employees up to speed. I was lucky enough to find my way eventually to a good team, but experiences certainly varied widely. </p>
<p>The informal, team-specific approach to onboarding new engineers has real problems as a company grows and scales out.  </p>
<p>If they&#8217;re unlucky, new engineers may not get the help they need from their teammates and suffer getting up to speed.  Engineers can&#8217;t easily move from team to team because the code and culture are so different, and teams can&#8217;t be certain that an engineer is qualified with re-interviewing them.  Code reuse and knowledge sharing across teams is rare.  Because of their different cultures and goals, teams sometimes develop an adversarial relationship.</p>
<p>Google has put as much thought into scaling their engineering team as they have scaling their systems; this leads to some unusual features in the way Google hires and rewards engineers.</p>
<p>You don&#8217;t interview for a specific team at Google, you interview to demonstrate that you can to do well anywhere in the company.  This permits engineers to very easily move inside the company and provides for greater freedom.</p>
<p>Google has a formal engineering education program called engEDU. Every starting engineer learns how the most important parts of Google work (Search, Adwords, servers, datacenters, etc.); later there are classes on more advanced topics such as machine learning and distributed systems.  The clases are taught by experienced engineers who really know what they&#8217;re talking about.  There is a comprehensive set of ongoing classes, labs, and fully searchable set of wiki pages, created bottom up.</p>
<p>Transparency and knowledge sharing are prevalant and strongly encouraged by the culture and peer review system. Teams and individuals publish their goals, and quick status updates (called &#8220;snippets&#8221;)  online to allow anyone in the company to read them. Food, social events, and tech talks all encourage serendipitous meetings across teams.</p>
<p>Though Google has many offices, all new engineers spend at least a week in Mountain View for training, to absorb the culture from fellow engineers and senior leadership, and to meet remote members of their team they will be collaborating with.</p>
<p>My experience so far has been that their Google&#8217;s culture and cohesiveness have scaled remarkably well in the face of rapid growth.  I&#8217;d be happy to answer any questions you might have; just drop me an email.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2010/04/two-weeks-at-google/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>What if Steve Jobs had created Windows?</title>
		<link>http://thebogles.com/blog/2010/04/what-if-steve-jobs-had-created-windows/</link>
		<comments>http://thebogles.com/blog/2010/04/what-if-steve-jobs-had-created-windows/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 18:54:01 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2010/04/what-if-steve-jobs-had-created-windows/</guid>
		<description><![CDATA[(The following alternate history imagines what might have happened if Steve Jobs had joined Steve Ballmer in creating Windows.  Any resemblance to reality is purely coincidental.)
Steve Jobs at Microsoft 
Nearly everyone knows the story of how Steve Jobs and Steve Ballmer dropped out of Berkeley to build one of the most loved and feared [...]]]></description>
			<content:encoded><![CDATA[<p>(The following alternate history imagines what might have happened if Steve Jobs had joined Steve Ballmer in creating Windows.  Any resemblance to reality is purely coincidental.)</p>
<h2>Steve Jobs at Microsoft </h2>
<p>Nearly everyone knows the story of how Steve Jobs and Steve Ballmer dropped out of Berkeley to build one of the most loved and feared products in history, Microsoft Windows.  For those who don&#8217;t, we&#8217;ll recap the history of Windows.</p>
<p><img src="http://www.wired.com/images_blogs/photos/uncategorized/jobs1984.jpg"/ width="300"></p>
<p><b>Windows 1.0</b>:  Even at this early stage, Windows combined Ballmer&#8217;s business savvy with Jobs&#8217; passion for design.  Jobs rightly realized that other personal computers hadn&#8217;t caught on because they were too complex and too insecure, mostly because of unauthorized software.</p>
<p>The first version of Windows ran only a fixed set of programs, and didn&#8217;t support multitasking,  But the built-in programs were so beautiful that no one cared too much; they included the mTunes media store, Internet Explorer web browser, and bundled Microsoft Office suite.</p>
<p>Ballmer signed Windows deals with Dell, IBM, and other PC makers, with strict provisions to ensure that Windows ran exactly as Jobs wanted it, and Windows rapidly gained market dominance.</p>
<p><b>Windows 2.0</b> introduced a revolutionary feature, the Windows App Store, allowing user to install approved programs from other software vendors.  Microsoft took only 30% of revenues and gave 70% to the app makers.  </p>
<p>The app store rapidly caught on, even though some software makers complained that Microsoft gave its own software an unfair advantage by using unpublished APIs and by rejecting competing software from the store. </p>
<p>The makers of an obscure Linux browser known as Netscape filed suit against Microsoft for rejecting their app, which Microsoft said was a security and stability risk. The judge rejected the suit, pointing out that no actual users had indicated a desire for any other browser.  Lotus 1-2-3 also made no headway against Excel; their app was rejected for duplicating too much functionality from the built in Office suite.</p>
<p><b>Windows 3.0</b> delighted Windows fans by adding a cut and paste feature. </p>
<p>It also integrated the recently purchased search engine from Alta Vista.  Users loved the convenience of being able to access Windows Web Search right from their Internet Explorer search bar. </p>
<p><b>Windows 4.0</b>  remains the subject of much speculation, given Microsoft&#8217;s passion for secrecy.  The addition of multitasking to Windows seems likely; some of the more outlandish rumors include a Windows ad network and even a Windows phone!</p>
<p>Some might argue that Jobs&#8217; and Ballmer&#8217;s viselike grip over the Windows ecosystem gives them too much power.  But most agree that protecting the purity and security of the beloved Windows user experience makes it all worth it.  </p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2010/04/what-if-steve-jobs-had-created-windows/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Joining Google</title>
		<link>http://thebogles.com/blog/2010/04/joining-google/</link>
		<comments>http://thebogles.com/blog/2010/04/joining-google/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 07:17:50 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
	<category>Google</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2010/04/joining-google/</guid>
		<description><![CDATA[I&#8217;m excited to be joining Google, starting April 5th. I&#8217;ll attend orientation week as a Noogler in Mountain View and work out of the Kirkland office.
Leaving the startup world is bittersweet, of course.  Despite working at several different startups over the past 10 years, I&#8217;ve been lucky to work with a core set of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m excited to be joining Google, starting April 5th. I&#8217;ll attend orientation week as a Noogler in Mountain View and work out of the <a href="http://www.google.com/support/jobs/bin/static.py?page=why-wa.html">Kirkland</a> office.</p>
<p>Leaving the startup world is bittersweet, of course.  Despite working at several different startups over the past 10 years, I&#8217;ve been lucky to work with a core set of trusted friends almost without interruption.  (My high school friends and even my kids tease me about the number of companies I&#8217;ve worked for, but I&#8217;ve had more stability in coworkers than most folks.)</p>
<p>Compared with my big company experience at Microsoft, startups have less politics, less meetings, more opportunities to own a product end-to-end, greater impact on the failure or success of the business, and more exposure to company leaders and mentors.</p>
<p>On the other hand, there are limits to what you can learn working only in startups. Unless you get really lucky and discover that you&#8217;re working at the next Google, there are levels of scale and infrastructure that you won&#8217;t experience in a startup. Also, in the current economic climate, it seems difficult for truly innovative startups to achieve success.</p>
<p>Google is one of a very small set of companies that combine a lot of the things I about like startups with the opportunity to work at the highest level of scale and impact large numbers of people. One of my oldest friends from graduate school spent a lot of time helping to realize that Google cared about more than just IQ and valued the same things I do.</p>
<p>A number of folks have blogged about the <a href="http://www.google.com/search?hl=en&#038;source=hp&#038;q=noogler&#038;aq=f&#038;aqi=g7g-s1g2&#038;aql=&#038;oq=&#038;gs_rfai=">experience of being a new Google employee</a>; if I feel I have anything unique and disclosable to offer I&#8217;ll post it here.  (As always, I am writing here as myself and any opinions expressed are not necessarily those of Google.)</p>
<p>I will immediately address one frequently asked question right away: &#8220;What will you be working on?&#8221;  A certain amount of mystery surrounds that question, even for me.</p>
<p>Most folks at Google begin with a starter project, which gives them a chance to learn the key technologies of Google and investigate over time which team they&#8217;d like to join for the long term. (The starter project is an unusual approach and I first saw it as a negative factor, but as i learned more I came to see it as a good thing.)</p>
<p>My high level goals for a starter project were that I should be working on something that faces end users, that it should help me learn how to take advantage of Google&#8217;s infrastructure, and that it should be important to Google&#8217;s revenue. In advance of starting, I have just enough information to know that my initial project will meet these goals; I&#8217;ll say more as I learn more and am able to.</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2010/04/joining-google/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>soap_helper: easier SOAP4R for Ruby</title>
		<link>http://thebogles.com/blog/2010/03/soap_helper-easier-soap4r-for-ruby/</link>
		<comments>http://thebogles.com/blog/2010/03/soap_helper-easier-soap4r-for-ruby/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 20:46:10 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2010/03/soap_helper-easier-soap4r-for-ruby/</guid>
		<description><![CDATA[If you use a SOAP based API via the soap4r, you might find the added helper methods described in this post to be.. err.. helpful.
Without the helper, Soap objects are frustratingly opaque.  They look like this when you inspect them:  
PLAIN TEXT
RUBY:




&#62;&#62; e.inspect


&#160;&#60;SOAP::Mapping::Object:0x155232bdf8&#62; 






And when you access attributes, you have to use ugly [...]]]></description>
			<content:encoded><![CDATA[<p>If you use a SOAP based API via the <a href="http://dev.ctor.org/soap4r">soap4r</a>, you might find the added helper methods described in this post to be.. err.. helpful.</p>
<p>Without the helper, Soap objects are frustratingly opaque.  They look like this when you inspect them:  </p>
<div class="igBar"><span id="lruby-5"><a href="#" onclick="javascript:showPlainTxt('ruby-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span><br />
<div id="ruby-5">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&gt;&gt; e.<span style="color:#9900CC;">inspect</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&lt;SOAP::Mapping::Object:0x155232bdf8&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
And when you access attributes, you have to use ugly method names, for example <tt>e.xmlattr_venueName</tt>.</p>
<p>After, Soap objects look like this:</p>
<div class="igBar"><span id="lruby-6"><a href="#" onclick="javascript:showPlainTxt('ruby-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span><br />
<div id="ruby-6">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&gt;&gt; e.<span style="color:#9900CC;">inspect</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">"eventID"</span>:<span style="color:#996600;">"8373"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#996600;">"categoryID"</span>:<span style="color:#996600;">"1"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#996600;">"eventTypeID"</span>:<span style="color:#996600;">"1"</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#996600;">"eventName"</span>:<span style="color:#996600;">"Bono: Living a More Involved Life"</span><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Much better!  Plus attributes can accessed without the xmlattr_ prefix, and you can get a hash of all of the attributes.</p>
<div class="igBar"><span id="lruby-7"><a href="#" onclick="javascript:showPlainTxt('ruby-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span><br />
<div id="ruby-7">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&gt;&gt; e.<span style="color:#9900CC;">eventName</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">=&gt; <span style="color:#996600;">"Bono: Living a More Involved Life"</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&gt;&gt; e.<span style="color:#9900CC;">attributes</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">=&gt; <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">"eventID"</span>=&gt;<span style="color:#996600;">"8373"</span>, <span style="color:#996600;">"categoryID"</span>=&gt;<span style="color:#996600;">"1"</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#996600;">"eventTypeID"</span>=&gt;<span style="color:#996600;">"1"</span>, </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#996600;">"eventName"</span>=&gt;<span style="color:#996600;">"Bono: Living a More Involved Life"</span><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>soap_helper.rb is just a couple of dozen lines of Ruby.  If it gets bigger, I'll put it up on Google code, but for now I'll include it inline in this blog post.</p>
<div class="igBar"><span id="lruby-8"><a href="#" onclick="javascript:showPlainTxt('ruby-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span><br />
<div id="ruby-8">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">class</span> SOAP::Mapping::Object&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> method_missing<span style="color:#006600; font-weight:bold;">&#40;</span>sym, *args, &amp;block<span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; xml_sym = <span style="color:#996600;">"xmlattr_#{sym}"</span>.<span style="color:#9900CC;">to_sym</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">respond_to</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>xml_sym<span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>xml_sym<span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">else</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#996600;">"Undefined attribute #{sym}"</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> keys&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">methods</span>.<span style="color:#9900CC;">grep</span><span style="color:#006600; font-weight:bold;">&#40;</span>/^xmlattr_.*<span style="color:#006600; font-weight:bold;">&#91;</span>^=<span style="color:#006600; font-weight:bold;">&#93;</span>$/<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">map</span> <span style="color:#006600; font-weight:bold;">&#123;</span>|m| m.<span style="color:#CC0066; font-weight:bold;">gsub</span><span style="color:#006600; font-weight:bold;">&#40;</span>/^xmlattr_/, ''<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#125;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> attributes&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; h = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">for</span> key <span style="color:#9966CC; font-weight:bold;">in</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">keys</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; h<span style="color:#006600; font-weight:bold;">&#91;</span>key<span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>key.<span style="color:#9900CC;">to_sym</span><span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF; font-weight:bold;">return</span> h&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> inspect&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; attributes.<span style="color:#9900CC;">to_json</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2010/03/soap_helper-easier-soap4r-for-ruby/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Section Headers for Android ListViews</title>
		<link>http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/</link>
		<comments>http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 07:38:48 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/</guid>
		<description><![CDATA[When building the Android version of the iLike Concert app, I wanted to have day headers for the concert list. 
This was easy on the iPhone; sections are built into the oUITableView class.   
Surprisingly, the ListView class in Android doesn't provide any corresponding functionality, as of Android 2.1. 
Jeff Sharkey's SeparatedListAdapter provides one [...]]]></description>
			<content:encoded><![CDATA[<p>When building the Android version of the <a href="http://www.ilike.com/mobile/concerts">iLike Concert app</a>, I wanted to have day headers for the concert list. </p>
<p>This was easy on the iPhone; sections are built into the o<a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableView_Class/Reference/Reference.html">UITableView</a> class.   </p>
<p>Surprisingly, the ListView class in Android doesn't provide any corresponding functionality, as of Android 2.1. </p>
<p>Jeff Sharkey's <a href="http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/">SeparatedListAdapter</a> provides one way to get this functionality; it glues together a number of individual adapters for each section into an overall list.</p>
<p>In my case, I had one SimpleCursorAdapter for the whole list, so I didn't want to break it into individual adapters just to display sections.</p>
<p>Instead, I made the header a part of the list cell layout, and hid the header on the rows where I didn't want to display it.  The headers look as follows:</p>
<p><img src="http://content.screencast.com/users/PhilBo/folders/Jing/media/c7fc8923-7197-45d2-ac6e-3c1a091166e4/00000057.png"/></p>
<p>My layout was like as follows; note the use of the explicit background color and textColorHighlight in the date header to prevent it from appearing as selected.</p>
<div class="igBar"><span id="lxml-11"><a href="#" onclick="javascript:showPlainTxt('xml-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span><br />
<div id="xml-11">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"utf-8"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;LinearLayout</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; xmlns:<span style="color: #000066;">android</span>=<span style="color: #ff0000;">"http://schemas.android.com/apk/res/android"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; android:layout_<span style="color: #000066;">width</span>=<span style="color: #ff0000;">"fill_parent"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; android:layout_<span style="color: #000066;">height</span>=<span style="color: #ff0000;">"wrap_content"</span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; android:<span style="color: #000066;">orientation</span>=<span style="color: #ff0000;">"vertical"</span><span style="font-weight: bold; color: black;">&gt;</span></span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;TextView</span> android:<span style="color: #000066;">id</span>=<span style="color: #ff0000;">"@+id/date_header"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">textSize</span>=<span style="color: #ff0000;">"20px"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">textStyle</span>=<span style="color: #ff0000;">"bold"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">textColor</span>=<span style="color: #ff0000;">"#000"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">textColorHighlight</span>=<span style="color: #ff0000;">"#000"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">background</span>=<span style="color: #ff0000;">"#DDD"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">visibility</span>=<span style="color: #ff0000;">"gone"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_<span style="color: #000066;">width</span>=<span style="color: #ff0000;">"fill_parent"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_<span style="color: #000066;">height</span>=<span style="color: #ff0000;">"wrap_content"</span><span style="font-weight: bold; color: black;">/&gt;</span></span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;LinearLayout</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; xmlns:<span style="color: #000066;">android</span>=<span style="color: #ff0000;">"http://schemas.android.com/apk/res/android"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; android:layout_<span style="color: #000066;">width</span>=<span style="color: #ff0000;">"fill_parent"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; android:layout_<span style="color: #000066;">height</span>=<span style="color: #ff0000;">"77px"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">gravity</span>=<span style="color: #ff0000;">"center_vertical"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">orientation</span>=<span style="color: #ff0000;">"horizontal"</span><span style="font-weight: bold; color: black;">&gt;</span></span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;LinearLayout</span> xmlns:<span style="color: #000066;">android</span>=<span style="color: #ff0000;">"http://schemas.android.com/apk/res/android"</span> android:layout_<span style="color: #000066;">width</span>=<span style="color: #ff0000;">"100px"</span> android:layout_<span style="color: #000066;">height</span>=<span style="color: #ff0000;">"75px"</span> android:<span style="color: #000066;">gravity</span>=<span style="color: #ff0000;">"center_vertical|center_horizontal"</span> android:<span style="color: #000066;">orientation</span>=<span style="color: #ff0000;">"horizontal"</span><span style="font-weight: bold; color: black;">&gt;</span></span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ImageView</span> android:<span style="color: #000066;">id</span>=<span style="color: #ff0000;">"@+id/image"</span> android:layout_<span style="color: #000066;">width</span>=<span style="color: #ff0000;">"75px"</span> android:layout_<span style="color: #000066;">height</span>=<span style="color: #ff0000;">"75px"</span><span style="font-weight: bold; color: black;">/&gt;</span></span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/LinearLayout<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;LinearLayout</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; xmlns:<span style="color: #000066;">android</span>=<span style="color: #ff0000;">"http://schemas.android.com/apk/res/android"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; android:layout_<span style="color: #000066;">width</span>=<span style="color: #ff0000;">"fill_parent"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; android:layout_<span style="color: #000066;">height</span>=<span style="color: #ff0000;">"wrap_content"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">gravity</span>=<span style="color: #ff0000;">"center_vertical"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">orientation</span>=<span style="color: #ff0000;">"vertical"</span><span style="font-weight: bold; color: black;">&gt;</span></span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;TextView</span> android:<span style="color: #000066;">id</span>=<span style="color: #ff0000;">"@+id/title"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">textSize</span>=<span style="color: #ff0000;">"20px"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">textStyle</span>=<span style="color: #ff0000;">"bold"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_<span style="color: #000066;">width</span>=<span style="color: #ff0000;">"fill_parent"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_<span style="color: #000066;">height</span>=<span style="color: #ff0000;">"wrap_content"</span><span style="font-weight: bold; color: black;">/&gt;</span></span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;TextView</span> android:<span style="color: #000066;">id</span>=<span style="color: #ff0000;">"@+id/description"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:<span style="color: #000066;">textSize</span>=<span style="color: #ff0000;">"14px"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_<span style="color: #000066;">width</span>=<span style="color: #ff0000;">"fill_parent"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_<span style="color: #000066;">height</span>=<span style="color: #ff0000;">"wrap_content"</span><span style="font-weight: bold; color: black;">/&gt;</span></span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/LinearLayout<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/LinearLayout<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/LinearLayout<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The view binder assumes a function called isHeaderVisible to decide whether the header should be visible for the current row in the cursor; implement as appropriate for your application.  (For example, our application displays a header whenever the date of the current row is different from the previous row.)</p>
<div class="igBar"><span id="ljava-12"><a href="#" onclick="javascript:showPlainTxt('java-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span><br />
<div id="java-12">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SimpleCursorAdapter listAdapter = <span style="color: #000000; font-weight: bold;">new</span> SimpleCursorAdapter<span style="color: #66cc66;">&#40;</span>mContext,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; R.<span style="color: #006600;">layout</span>.<span style="color: #006600;">list_item</span>, </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mEventsCursor, </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">"artist_75x75_image_url"</span>, <span style="color: #ff0000;">"artist_name"</span>, <span style="color: #ff0000;">"venue_name"</span>, <span style="color: #ff0000;">"event_date_string"</span> <span style="color: #66cc66;">&#125;</span>, </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#123;</span>R.<span style="color: #006600;">id</span>.<span style="color: #006600;">image</span>, R.<span style="color: #006600;">id</span>.<span style="color: #006600;">title</span>, R.<span style="color: #006600;">id</span>.<span style="color: #006600;">description</span>, R.<span style="color: #006600;">id</span>.<span style="color: #006600;">date_header</span> <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #993333;">int</span> nDateIndex = mEventsCursor.<span style="color: #006600;">getColumnIndex</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"event_date_string"</span><span style="color: #66cc66;">&#41;</span>;&nbsp; &nbsp;&nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; listAdapter.<span style="color: #006600;">setViewBinder</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleCursorAdapter.<span style="color: #006600;">ViewBinder</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">boolean</span> setViewValue<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AView+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">View</span></a> view, <a href="http://www.google.com/search?q=allinurl%3ACursor+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Cursor</span></a> cursor, <span style="color: #993333;">int</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">columnIndex<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>columnIndex == nDateIndex<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>isHeaderVisible<span style="color: #66cc66;">&#40;</span>cursor<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; view.<span style="color: #006600;">setVisibility</span><span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AView+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">View</span></a>.<span style="color: #006600;">VISIBLE</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prevDate = dateString;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>TextView<span style="color: #66cc66;">&#41;</span> view<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setText</span><span style="color: #66cc66;">&#40;</span>dateString<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>TextView<span style="color: #66cc66;">&#41;</span> view<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">setText</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; view.<span style="color: #006600;">setVisibility</span><span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AView+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">View</span></a>.<span style="color: #006600;">GONE</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2010/02/section-headers-for-android-listviews/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Beyond 411 for the iPhone is now available in the App store</title>
		<link>http://thebogles.com/blog/2009/12/beyond-411-for-the-iphone-is-now-available-in-the-app-store/</link>
		<comments>http://thebogles.com/blog/2009/12/beyond-411-for-the-iphone-is-now-available-in-the-app-store/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 06:49:37 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2009/12/beyond-411-for-the-iphone-is-now-available-in-the-app-store/</guid>
		<description><![CDATA[The local search app Beyond411 (aka Berry411) is now available as a free download for the iPhone in the app store, just search for the abbreviation "b411".   This is just an initial version and doesn't have all of the features of the Blackberry version.  Be forgiving of it's faults, and please pass [...]]]></description>
			<content:encoded><![CDATA[<p>The local search app Beyond411 (aka Berry411) is now available as a free download for the iPhone in the app store, just search for the abbreviation "b411".   This is just an initial version and doesn't have all of the features of the Blackberry version.  Be forgiving of it's faults, and please pass on your bug reports and suggestions for improvement.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2009/12/beyond-411-for-the-iphone-is-now-available-in-the-app-store/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Stock Prediction, Web Sentiment, and Search Engines: a privacy thought experiment</title>
		<link>http://thebogles.com/blog/2009/12/stock-prediction-web-sentiment-and-search-engines-a-privacy-thought-experiment/</link>
		<comments>http://thebogles.com/blog/2009/12/stock-prediction-web-sentiment-and-search-engines-a-privacy-thought-experiment/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 06:40:54 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2009/12/stock-prediction-web-sentiment-and-search-engines-a-privacy-thought-experiment/</guid>
		<description><![CDATA[If Microsoft or Google found a way to predict and profit in the stock market by mining search logs, would it be a violation of their privacy policy?  
This is not an outlandish scenario. The research paper Stock Prediction using Web Sentiment describes "a novel way to do stock prediction using web sentiment".  [...]]]></description>
			<content:encoded><![CDATA[<p>If Microsoft or Google found a way to predict and profit in the stock market by mining search logs, would it be a violation of their privacy policy?  </p>
<p>This is not an outlandish scenario. The research paper <a href="http://www.scribd.com/doc/8450060/Stock-Prediction">Stock Prediction using Web Sentiment</a> describes "a novel way to do stock prediction using web sentiment".  The authors do textual analysis of financial message boards to extract how people are feeling about different stocks, correlate past sentiments with actual stock performance, and predict future stock values based on current sentiments.  </p>
<p>The authors claim a strong correlation between web sentiment and future stock prices. Suppose for the sake of argument that you could actually predict and profit in the stock market with this strategy.</p>
<p>In principle, it seems that your ability to predict the stock market might be even better if you had access to the web search logs-- users would presumably reveal things in their private searches they wouldn't state publically.  (To venture into even murkier privacy waters, consider also mining private emails.)</p>
<p>Google and Microsoft, of course, do have access to this data via their various web properties, and are growing increasingly sophisticated in their ability to mine this data.  </p>
<p>They already analyze and expose aggregate search trends, for example at this moment <a href="http://www.google.com/trends">Google Trends</a>.  At this instant Google Trends tells us that Copenhagen, Christmas Music, and Tiger Woods updates are on people's minds.   </p>
<p><img src="http://content.screencast.com/users/PhilBo/folders/Jing/media/02c6736a-b96e-489e-acee-0ebe83782578/00000056.png" width="450" border="1"/></p>
<p>Suppose a talented Google engineer decided to create "Google Stock Trends" as a 20% project.  I can't find anything in the <a href="http://www.google.com/privacypolicy.html">Google privacy policy</a> that would prevent that kind of aggregation-- it doesn't reveal any personally identifiable information.  </p>
<p>Stock trend analysis seems to be included in the allowed purposes that Google makes use of personal information, including the vague "development of new services".</p>
<p> At the same time, it seems a violation of trust to think that others might profit from my revealing personal stock knowledge via a search engine query. I might not even know they were doing this mining, if Google Stock Trends was for internal use only.</p>
<p>Presumably a reputable company would actually never create such a tool.  Should their privacy policies be more explicit that this kind of value extraction and data mining isn't allowed from searches that we think are private?</p>
<p><a title="View Stock Prediction on Scribd" href="http://www.scribd.com/doc/8450060/Stock-Prediction" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">Stock Prediction</a> <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="doc_409492890734763" name="doc_409492890734763" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" align="middle"	height="300" width="450" ><br />
<param name="movie"	value="http://d1.scribdassets.com/ScribdViewer.swf?document_id=8450060&#038;access_key=key-26uehvopv8wjjw8ppwtm&#038;page=1&#038;version=1&#038;viewMode=list">
<param name="quality" value="high">
<param name="play" value="true">
<param name="loop" value="true">
<param name="scale" value="showall">
<param name="wmode" value="opaque">
<param name="devicefont" value="false">
<param name="bgcolor" value="#ffffff">
<param name="menu" value="true">
<param name="allowFullScreen" value="true">
<param name="allowScriptAccess" value="always">
<param name="salign" value="">
<param name="mode" value="list">	    		<embed src="http://d1.scribdassets.com/ScribdViewer.swf?document_id=8450060&#038;access_key=key-26uehvopv8wjjw8ppwtm&#038;page=1&#038;version=1&#038;viewMode=list" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="opaque" devicefont="false" bgcolor="#ffffff" name="doc_409492890734763_object" menu="true" allowfullscreen="true" allowscriptaccess="always" salign="" type="application/x-shockwave-flash" align="middle" mode="list" height="300" width="450"></embed>	</object>	</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2009/12/stock-prediction-web-sentiment-and-search-engines-a-privacy-thought-experiment/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Skinny controllers, fat models and Cocoa</title>
		<link>http://thebogles.com/blog/2009/11/skinny-controllers-fat-models-and-cocoa/</link>
		<comments>http://thebogles.com/blog/2009/11/skinny-controllers-fat-models-and-cocoa/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 20:50:03 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2009/11/skinny-controllers-fat-models-and-cocoa/</guid>
		<description><![CDATA[Skinny controller, fat model is a good design principle not just for Rails, but for client apps in MVC frameworks like Cocoa.
I think it's not uncommon, though, for client apps to have fairly anemic models, to the detriment of reusability. For example, I recently worked with an open source module that was in general very [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model">Skinny controller, fat model</a> is a good design principle not just for Rails, but for client apps in MVC frameworks like <a href="http://developer.apple.com/cocoa/">Cocoa</a>.</p>
<p>I think it's not uncommon, though, for client apps to have fairly anemic models, to the detriment of reusability. For example, I recently worked with an open source module that was in general very well written, but which made it challenging to reuse to underlying parsing logic.</p>
<p>Why this tendency for skinny models? In part, this might because client apps are UI-centric and this ends up being reflected in the design of the code.  Even Apple's naming conventions (e.g. DetailViewController) emphasize the controller and view at the expense of the model.  </p>
<p>The lack of a full-fledged read-eval-print loop in Objective C (akin to the Rails console) also makes it inconvenient for developers to exercise fat models.  <a href="http://www.macruby.org/">MacRuby</a> has potential to provide an interactive console for Objective C models, and could perhaps be integrated with Xcode to allow me to bring up a console on any app.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2009/11/skinny-controllers-fat-models-and-cocoa/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Browsing iPhoto from a Blu-Ray player using iPhotoFS</title>
		<link>http://thebogles.com/blog/2009/11/browsing-iphoto-from-a-blu-ray-player-using-iphotofs/</link>
		<comments>http://thebogles.com/blog/2009/11/browsing-iphoto-from-a-blu-ray-player-using-iphotofs/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 20:25:46 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2009/11/browsing-iphoto-from-a-blu-ray-player-using-iphotofs/</guid>
		<description><![CDATA[Below are some (terribly blurry) pictures of me browsing my iPhoto albums on a network Blu-Ray player. 
I just installed and ran the latest version of iPhotoFS, clicked the "Shared folder" checkbox on the Get Info box for the iPhotoFS device, and browsed to the shared folder on the Blu-Ray player.  There are top [...]]]></description>
			<content:encoded><![CDATA[<p>Below are some (terribly blurry) pictures of me browsing my iPhoto albums on a network Blu-Ray player. </p>
<p>I just installed and ran the latest version of <a href="http://code.google.com/p/iphotofs/">iPhotoFS</a>, clicked the "Shared folder" checkbox on the Get Info box for the iPhotoFS device, and browsed to the shared folder on the Blu-Ray player.  There are top level folders to browse by album, roll, or date.</p>
<p><img src="http://thebogles.com/images/iphotofs2.jpg" width="300"/></p>
<p><img src="http://thebogles.com/images/iphotofs1.jpg" width="300"/></p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2009/11/browsing-iphoto-from-a-blu-ray-player-using-iphotofs/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>iPhotoFS alpha on Google Code</title>
		<link>http://thebogles.com/blog/2009/11/iphotofs-alpha-on-google-code/</link>
		<comments>http://thebogles.com/blog/2009/11/iphotofs-alpha-on-google-code/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 08:41:02 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2009/11/iphotofs-alpha-on-google-code/</guid>
		<description><![CDATA[iPhotoFS is a read-only filesystem for iPhoto collections, built on top of MacFUSE. I wrote iPhotoFS to let me easily copy my iPhoto Library to my PC while retaining its structure.  There are subfolders for photos organized by roll, album, or month.
 It allows you to easily interfact with your iPhoto collection using the [...]]]></description>
			<content:encoded><![CDATA[<p>iPhotoFS is a read-only filesystem for iPhoto collections, built on top of <a href="http://code.google.com/p/macfuse/">MacFUSE</a>. I wrote iPhotoFS to let me easily copy my iPhoto Library to my PC while retaining its structure.  There are subfolders for photos organized by roll, album, or month.</p>
<p> It allows you to easily interfact with your iPhoto collection using the Finder and command line utilities like `find` and `rsync`.  You can even browse collections on other machines by viewing the share volume.</p>
<p><a href="http://code.google.com/p/iphotofs/">Download iPhotoFS on Google Code</a>, it's open source under an Apache license.</p>
<p><img src="http://thebogles.com/images/iPhotoFS.png" width="400"/></p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2009/11/iphotofs-alpha-on-google-code/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Berry 411 for the iPhone submitted to the app store</title>
		<link>http://thebogles.com/blog/2009/10/berry-411-for-the-iphone-submitted-to-the-app-store/</link>
		<comments>http://thebogles.com/blog/2009/10/berry-411-for-the-iphone-submitted-to-the-app-store/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 23:00:39 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2009/10/berry-411-for-the-iphone-submitted-to-the-app-store/</guid>
		<description><![CDATA[I've submitted Berry 411 for the iPhone to the App Store and am hoping for quick approval.   It will be free.
(See a screencast here.)
I have many ideas for future improvements but I'm pretty happy with how it turned out.  Being able to get driving directions, reviews, and web pages for a business [...]]]></description>
			<content:encoded><![CDATA[<p>I've submitted Berry 411 for the iPhone to the App Store and am hoping for quick approval.   It will be free.</p>
<p>(See a screencast <a href="http://thebogles.com/blog/2009/09/iphone-411-screencast/">here</a>.)</p>
<p>I have many ideas for future improvements but I'm pretty happy with how it turned out.  Being able to get driving directions, reviews, and web pages for a business without leaving the app is handy indeed.  </p>
<p>I'm looking for a small number of beta testers to try it out while i wait for approval.  Please email your device ID using the  <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=285691333&#038;mt=8">Ad-Hoc Helper</a> if interested.  (Apologies if I don't have time to send beta copies to everyone who replies, but hopefully it will be in the App Store soon in any event.)
</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2009/10/berry-411-for-the-iphone-submitted-to-the-app-store/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>iPhone 411 screencast</title>
		<link>http://thebogles.com/blog/2009/09/iphone-411-screencast/</link>
		<comments>http://thebogles.com/blog/2009/09/iphone-411-screencast/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 07:05:53 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2009/09/iphone-411-screencast/</guid>
		<description><![CDATA[I'm just about done recreating Beyond411 on the iPhone.  I created this brief screencast to get your feedback on the app before I submit it the iTunes stores.
The key features are as follows:
* Find nearby local business information by name or category
  - 20,000 word autocomplete dictionary
  - 500 item directory of [...]]]></description>
			<content:encoded><![CDATA[<p>I'm just about done recreating Beyond411 on the iPhone.  I created this brief screencast to get your feedback on the app before I submit it the iTunes stores.</p>
<p>The key features are as follows:</p>
<p>* Find nearby local business information by name or category<br />
  - 20,000 word autocomplete dictionary<br />
  - 500 item directory of popular businesses<br />
  - Fast list interface</p>
<p>* Everything you need to know without leaving the app<br />
  - Driving directions<br />
  - Reviews, Images, Web Links with inline browser<br />
  - Call Business<br />
  - Show directions in  Google maps</p>
<p>Please let me know what you think and what I can improved!</p>
<p><object width="376" height="742"><br />
<param name="movie" value="http://content.screencast.com/users/PhilBo/folders/Jing/media/521ce3d1-eb7c-4194-969f-7670930e5f07/jingswfplayer.swf"></param>
<param name="quality" value="high"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<param name="flashVars" value="thumb=http://content.screencast.com/users/PhilBo/folders/Jing/media/521ce3d1-eb7c-4194-969f-7670930e5f07/FirstFrame.jpg&#038;containerwidth=376&#038;containerheight=742&#038;loaderstyle=jing&#038;content=http://content.screencast.com/users/PhilBo/folders/Jing/media/521ce3d1-eb7c-4194-969f-7670930e5f07/00000054.swf"></param>
<param name="allowFullScreen" value="true"></param>
<param name="scale" value="showall"></param>
<param name="allowScriptAccess" value="always"></param>
<param name="base" value="http://content.screencast.com/users/PhilBo/folders/Jing/media/521ce3d1-eb7c-4194-969f-7670930e5f07/"></param> <embed src="http://content.screencast.com/users/PhilBo/folders/Jing/media/521ce3d1-eb7c-4194-969f-7670930e5f07/jingswfplayer.swf" quality="high" bgcolor="#FFFFFF" width="376" height="742" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/PhilBo/folders/Jing/media/521ce3d1-eb7c-4194-969f-7670930e5f07/FirstFrame.jpg&#038;containerwidth=376&#038;containerheight=742&#038;loaderstyle=jing&#038;content=http://content.screencast.com/users/PhilBo/folders/Jing/media/521ce3d1-eb7c-4194-969f-7670930e5f07/00000054.swf" allowFullScreen="true" base="http://content.screencast.com/users/PhilBo/folders/Jing/media/521ce3d1-eb7c-4194-969f-7670930e5f07/" scale="showall"></embed> </object>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2009/09/iphone-411-screencast/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>xml_grep cookbook</title>
		<link>http://thebogles.com/blog/2009/08/xml_grep-cookbook/</link>
		<comments>http://thebogles.com/blog/2009/08/xml_grep-cookbook/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 18:44:11 +0000</pubDate>
		<dc:creator>philbo</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://thebogles.com/blog/2009/08/xml_grep-cookbook/</guid>
		<description><![CDATA[iLike frequently receives large XML files from our partners that we need to analyze.
For ad-hoc analysis of XML from command line, xml_grep is a really valuable tool.  Instead of extracting lines that match regular expressions, xml_grep extracts xml nodes that match xpath expressions.
However, it took me a bit of trial and error to figure [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ilike.com">iLike</a> frequently receives large XML files from our partners that we need to analyze.</p>
<p>For ad-hoc analysis of XML from command line, <a href="http://linux.die.net/man/1/xml_grep"><tt>xml_grep</tt></a> is a really valuable tool.  Instead of extracting lines that match regular expressions, xml_grep extracts xml nodes that match xpath expressions.</p>
<p>However, it took me a bit of trial and error to figure out how install and use it successfully.  Here's a quick cookbook of how I did it; I'll update this post with additional useful examples as I encounter them.</p>
<h3> Installation </h3>
<p>In most *nix distributions, you can install by simple typing  </p>
<pre>sudo cpan -i "XML::Twig"</pre>
<p>Answer 'y' when Cpan asks you if you want to install other packages that xml_grep depends on.  </p>
<p>(xml_grep is included as a part of the <a href="http://xmltwig.com/xmltwig/">XML::Twig </a> package in CPAN.   XML::Twig also provides a rich Perl API; however the command line examples here do not require any Perl knowledge.)</p>
<h3> Usage examples </h3>
<p>Suppose you have the following xml:</p>
<div class="igBar"><span id="lxml-14"><a href="#" onclick="javascript:showPlainTxt('xml-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span><br />
<div id="xml-14">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> ?<span style="font-weight: bold; color: black;">&gt;</span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Events<span style="font-weight: bold; color: black;">&gt;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;Event</span> <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">"0E0042D2CF2E9E44"</span><span style="font-weight: bold; color: black;">&gt;</span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ArtistIDs<span style="font-weight: bold; color: black;">&gt;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ArtistID</span> <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">"806533"</span> <span style="color: #000066;">Type</span>=<span style="color: #ff0000;">"Primary"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;ArtistID</span> <span style="color: #000066;">ID</span>=<span style="color: #ff0000;">"1134688"</span> <span style="color: #000066;">Type</span>=<span style="color: #ff0000;">"Secondary"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/ArtistIDs<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;EventDate<span style="font-weight: bold; color: black;">&gt;</span></span></span>2009-07-25<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/EventDate<span style="font-weight: bold; color: black;">&gt;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;PerformanceName<span style="font-weight: bold; color: black;">&gt;</span></span></span>Summer Splash 2009<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/PerformanceName<span style="font-weight: bold; color: black;">&gt;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Event<span style="font-weight: bold; color: black;">&gt;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- etc --&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/Events<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>xml_grep allows you to specify both --root (the node to match and print out) and --cond (an xpath expression relative to root that filters the results.)  If more than one root is provided, the results are combined using OR; likewise with cond.</p>
<p>1. Here's the simplest possible example.  --root is an xpath expression specifying which nodes will be printed. -p causes the results to be pretty printed:</p>
<p><b>Print all events </b>:  <tt>xml_grep -p --root="Event" foo.xml</tt></p>
<p>2. The next example shows how we can use --cond to filter the results based on an attribute of a subnode of the root.</p>
<p><b>Print all events for a given artist</b>:  <tt>xml_grep -p --root="Event" --cond='ArtistID[@ID='806533']' foo.xml </tt></p>
<p>3. Here's how we can match against the text contents of a subelements:</p>
<p><b>Print all events on a given date</b>:  <tt>xml_grep -p --root="Event" --cond='EventDate[string()="2009-07-25"]' foo.xml </tt></p>
<p>Multiple cond flags are combined using OR.  To print nodes matching one of several artists:</p>
<p>4.<b>Print all events for a given artist</b>:  <tt>xml_grep -p --root="Event" --cond='ArtistID[@ID='806533']' --cond='ArtistID[@ID='806532']'  foo.xml </tt></p>
<p>5. The result of xml_grep is itself an XML document and can be piped into another xml_grep to do additional extraction.</p>
<p><b>Extract the time and performance name of events on a given date</b>: <tt>xml_grep -p --root="Event" --cond='EventDate[string()="2009-07-25"]' foo.xml | xml_grep --root='EventTime' --root='PerformanceName'</tt></p>
<p>5. The result of xml_grep is itself an XML document and can be piped into another xml_grep to do additional extraction.</p>
<p>6. <b>Match a regular expression</b>: <tt>xml_grep --root="EventName[string() =~ /Bil.* El.*/]" foo.xml </tt>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://thebogles.com/blog/2009/08/xml_grep-cookbook/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
