<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Java Thinking</title>
	
	<link>http://www.javathinking.com</link>
	<description>Java and software development related thoughts</description>
	<pubDate>Sun, 24 Jan 2010 02:56:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/JavaThinking" /><feedburner:info uri="javathinking" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>My first linux contribution is a disaster</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/ETwfa2jIXY0/</link>
		<comments>http://www.javathinking.com/2010/01/my-first-linux-contribution-is-a-disaster/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 02:56:35 +0000</pubDate>
		<dc:creator>paul</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[networkmanager]]></category>

		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=437</guid>
		<description><![CDATA[My first attempt to contribute to Linux turns out to be a disaster, with the problem already having been addressed. But why does the source code in Trunk not reflect any changes? I have much to learn about Linux packages and source organisation.]]></description>
			<content:encoded><![CDATA[<p></p><p>So I recently submitted a patch to the NetworkManager component: https://bugzilla.gnome.org/show_bug.cgi?id=607731  - but it turns out to be a duplicate because this problem was addressed in https://bugzilla.gnome.org/show_bug.cgi?id=600779 - by default Bugzilla doesn&#8217;t seem to include &#8216;resolved&#8217; defects in the search results. You have to go to <a href="https://bugzilla.gnome.org/buglist.cgi?type0-0-4=substring&amp;short_desc=virginbroadband&amp;field0-0-0=product&amp;type0-0-1=substring&amp;field0-0-1=component&amp;field0-0-4=longdesc&amp;value0-0-2=virginbroadband&amp;query_format=advanced&amp;type0-0-3=substring&amp;value0-0-3=virginbroadband&amp;field0-0-3=status_whiteboard&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=NEEDINFO&amp;bug_status=RESOLVED&amp;bug_status=VERIFIED&amp;value0-0-4=virginbroadband&amp;short_desc_type=allwordssubstr&amp;field0-0-2=short_desc&amp;value0-0-1=virginbroadband&amp;type0-0-0=substring&amp;value0-0-0=virginbroadband&amp;type0-0-2=substring">advanced search and select all statuses</a>.</p>
<p>So, if my patch wasn&#8217;t needed, and this issue has been resolved, then why doesn&#8217;t the <a href="http://bazaar.launchpad.net/~network-manager/mobile-broadband-provider-info/trunk/annotate/head%3A/serviceproviders.xml">source code in trunk</a> have this change? Bug 600779 mentions that service providers is deprecated, but by what? Ubuntu 9.10 still uses it, because when I edited /usr/share/mobile-broadband-provider-info/serviceproviders.xml it worked fine for me.</p>
<p>If service providers is deprecated, then why isn&#8217;t there something on the homepage? Bugzilla doesn&#8217;t seem to report which source files were changed in a bug - something I quite like in JIRA. See <a href="https://bugzilla.gnome.org/show_bug.cgi?id=600779#c1">comment #1</a>:</p>
<blockquote>
<pre id="comment_text_1" class="bz_comment_text">VirginInternet would still be used for tethering a phone, but I've added
VirginBroadband.  Thanks!</pre>
</blockquote>
<p>But what got changed? That would give me a clue.</p>
<p>Checking the version I&#8217;m running:</p>
<blockquote><p>paul@paul-laptop:~$ dpkg -s mobile-broadband-provider-info<br />
Package: mobile-broadband-provider-info<br />
Status: install ok installed<br />
Priority: extra<br />
Section: admin<br />
Installed-Size: 180<br />
Maintainer: Ubuntu MOTU Developers &lt;ubuntu-motu@lists.ubuntu.com&gt;<br />
Architecture: all<br />
Version: 20091009-0ubuntu1<br />
Breaks: libmbca0<br />
Description: database of mobile broadband service providers<br />
Contains service provider specific settings of mobile broadband providers in<br />
different countries.<br />
Homepage: http://live.gnome.org/NetworkManager/MobileBroadband/ServiceProviders<br />
Original-Maintainer: Antti Kaijanmäki (Wellark) &lt;antti@kaijanmaki.net&gt;</p></blockquote>
<p>So if Ubuntu are still using it then why wouldn&#8217;t there be patches and maintenance releases?</p>
<p>Now, searching for Ubuntu specific information turns up <a href="https://wiki.ubuntu.com/NetworkManager/Hardware/3G#Provider%20info">NetworkManager provider information</a> which doesn&#8217;t have the Virgin APN I need. So how do I fix this? Well, it says:</p>
<blockquote><p>If you discover you need provider information from here or elsewhere, please file a bug against the mobile-broadband-provider-info package so we can improve the experience for all users to a level where all providers Just Work out of the box. <a class="https" href="https://bugs.launchpad.net/ubuntu/+source/mobile-broadband-provider-info">https://bugs.launchpad.net/ubuntu/+source/mobile-broadband-provider-info</a></p>
<p>As today (16/01/09) bug #317860 at Launchpad cover a lot of Service Providers missing. (<a class="https" href="https://bugs.edge.launchpad.net/ubuntu/+source/mobile-broadband-provider-info/+bug/317860">https://bugs.edge.launchpad.net/ubuntu/+source/mobile-broadband-provider-info/+bug/317860</a>)</p></blockquote>
<p>I&#8217;m was stunned to find out that this type of generic information was window manager specific (GNOME) now it looks like it is distribution specific (Ubuntu). If anyone can tell me the reasoning behind this, I&#8217;d love to know. Because right now, it looks crazy to me. Especially from a point of view that I just want to contribute something. It&#8217;s kind of weird that it&#8217;s even Operating System specific really, it really just should be a web service available to anyone and everyone, and the Operating Systems just update from it. Anyway&#8230; continuing the saga&#8230;</p>
<p>This bug report makes interesting reading. Apparently everything was fixed last year: https://bugs.launchpad.net/ubuntu/+source/mobile-broadband-provider-info/+bug/280490</p>
<p>It also says that the Virgin website documents the APN being VirginBroadband. But that page doesn&#8217;t exist any more. I can only find one reference to APN on their site, and thats the wrong one.</p>
<p>So, I&#8217;ve updated the <a href="https://wiki.ubuntu.com/NetworkManager/Hardware/3G">Ubuntu wiki</a> to add the Virgin APN to the list of providers. I wasn&#8217;t sure whether to update the Mobile Broadband Cards section with the Huawei e160e, since they&#8217;ve already got the 160 and 160g. But I can&#8217;t find any source code - I got as far as finding this: http://packages.ubuntu.com/source/lucid/mobile-broadband-provider-info - but the trail ends there.</p>
<p>Anyway, I&#8217;ve spent way too long on this. What started out as a simple patch has only shown me how little I know about the Linux environment, packages, and how the source is maintained. Maybe over time I&#8217;ll get more familiar with it all.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/TGnPkwqNl61aHMTUcj0cmrfHov8/0/da"><img src="http://feedads.g.doubleclick.net/~a/TGnPkwqNl61aHMTUcj0cmrfHov8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/TGnPkwqNl61aHMTUcj0cmrfHov8/1/da"><img src="http://feedads.g.doubleclick.net/~a/TGnPkwqNl61aHMTUcj0cmrfHov8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/ETwfa2jIXY0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2010/01/my-first-linux-contribution-is-a-disaster/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.javathinking.com/2010/01/my-first-linux-contribution-is-a-disaster/</feedburner:origLink></item>
		<item>
		<title>Week in Review - 2010-03</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/ZcIoFW7eIgI/</link>
		<comments>http://www.javathinking.com/2010/01/week-in-review-2010-03/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 07:22:00 +0000</pubDate>
		<dc:creator>paul</dc:creator>
		
		<category><![CDATA[Week in Review]]></category>

		<category><![CDATA[irc]]></category>

		<category><![CDATA[joomla]]></category>

		<category><![CDATA[mobile]]></category>

		<category><![CDATA[virgin]]></category>

		<category><![CDATA[vlc]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=429</guid>
		<description><![CDATA[Getting my Virgin Mobile Broadband working, vlc media player rocks, playing with Wordpress, and reading up on Joomla.]]></description>
			<content:encoded><![CDATA[<p></p><p>Its been a good week. I got my <a href="http://www.virginmobile.com.au/broadband/pre-paid-mobile-broadband/">Virgin Mobile Broadband Prepaid</a> 3G modem working, and learnt a lot in the process, and actually contributed to the GNOME project: https://bugzilla.gnome.org/show_bug.cgi?id=607731</p>
<p>As part of this, I installed Pidgin so I could join the IRC channel and talk to developers, but I haven&#8217;t yet figured out how to view the history for a channel - so I can see what happened while I was offline&#8230;</p>
<p>It does surprise me though, that the database for mobile broadband providers is specific to the window manager (GNOME) instead of being a system level thing. I&#8217;m sure there are good reasons, and it probably doesn&#8217;t matter, but what do the KDE (and others) users do? Define it all over again?</p>
<p>Worse than that though is that Virgin don&#8217;t seem to make the APN easily available. I found it by searching the web, and finding it in forums, but why isn&#8217;t it in the FAQ on a Virgin site?</p>
<p>I didn&#8217;t anticipate how much I&#8217;d enjoy having access to the internet while training it back and forth from work (1hr train ride) but I&#8217;m loving it. I&#8217;m pretty sure the documentation that came with the modem says to keep it at least 15cm away from the body, so its attached via the provided usb cable, and sits in my bag on the floor a good distance away.</p>
<p>I&#8217;ve taken to using <a href="http://www.videolan.org/vlc/index.html">VLC Media Player</a> as my favourite media player - it lets me use a minimal interface (video only, no controls displayed) to minimise real estate and has an &#8216;always on top&#8217; option. This means I can put the video in a corner of the screen and program away - it works well.</p>
<p>I&#8217;ve also been playing with Wordpress:</p>
<ul>
<li> customising the  <a href="http://diythemes.com/">Thesis</a> theme,</li>
<li>using a static page for the home page,</li>
<li>learning that I can turn commenting off for individual pages/posts</li>
<li>specifying excerpts so the teasers are better</li>
</ul>
<p>Also, I&#8217;ve read up a bit on <a href="http://www.joomla.org/">Joomla</a>. I haven&#8217;t installed it yet, but I&#8217;ve been meaning to look into CMS alternatives to <a href="http://wordpress.org/">Wordpress</a> for a while. It was frustrating understanding exactly what it could do until a friend pointed me to this resource : <a href="http://www.cmsmatrix.org/matrix/cms-matrix/joomla">http://www.cmsmatrix.org/matrix/cms-matrix/joomla</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/GjDbfwgNNNXxcWMGXALYvhw83Lc/0/da"><img src="http://feedads.g.doubleclick.net/~a/GjDbfwgNNNXxcWMGXALYvhw83Lc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/GjDbfwgNNNXxcWMGXALYvhw83Lc/1/da"><img src="http://feedads.g.doubleclick.net/~a/GjDbfwgNNNXxcWMGXALYvhw83Lc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/ZcIoFW7eIgI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2010/01/week-in-review-2010-03/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.javathinking.com/2010/01/week-in-review-2010-03/</feedburner:origLink></item>
		<item>
		<title>Ubuntu, Virgin Mobile Internet Pre-paid (in Sydney), and the Huawei e160e</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/_kKgM9StGLU/</link>
		<comments>http://www.javathinking.com/2010/01/ubuntu-virgin-mobile-internet-pre-paid-and-the-huawei-e160e/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 21:12:34 +0000</pubDate>
		<dc:creator>paul</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=420</guid>
		<description><![CDATA[How I got my Huawei e160e USB 3G modem working with Virgin Mobile Internet, and Ubuntu 9.10 in Australia (Sydney).]]></description>
			<content:encoded><![CDATA[<p></p><p>I recently bought a Virgin Mobile Broadband (Australia) PrePaid USB modem - a Huawei e160e. I activated it over the phone, and when I plugged it in to my Dell Inspiron 1525 running Ubuntu 9.10, I could see that it was connected to the network (this modem flashes a blue light every 3 seconds when connected to the mobile network). But, try as I might, I couldn&#8217;t get it connected. Every time I tried, it would just disconnect.</p>
<p>Looking in the system logs, I&#8217;d see:</p>
<blockquote><p>Jan  6 12:42:57 paul-laptop pppd[2846]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded.<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: pppd 2.4.5 started by root, uid 0<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: Using interface ppp0<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: Connect: ppp0 &lt;&#8211;&gt; /dev/ttyUSB0<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: CHAP authentication succeeded<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: CHAP authentication succeeded<br />
Jan  6 12:43:06 paul-laptop pppd[2846]: Modem hangup<br />
Jan  6 12:43:06 paul-laptop pppd[2846]: Connection terminated.<br />
Jan  6 12:43:07 paul-laptop pppd[2846]: Exit.</p></blockquote>
<p>I tried out using usb_modeswitch, but I never really figured out how that is supposed to be used - and it looked to me like the system knew it was a 3G modem anyway.</p>
<p>Using another machine connected to the internet, I googled around and found <a href="http://ubuntuforums.org/showpost.php?p=8612641&amp;postcount=14">an answer that worked</a>.</p>
<p>A couple of notes from my experience:</p>
<ul>
<li>This modem was not automatically detected - I had to manually start the &#8216;Network Connections&#8217; to add the connection.</li>
<li>When selecting Australia and Virgin in the Network Connections wizard, it incorrectly set the APN to &#8216;VirginInternet&#8217; - maybe this is for post-paid accounts, but I have a pre-pay, and the APN I use is &#8216;VirginBroadband&#8217; - This is probably because for Virgin, there is only one plan to select (default) - how do we get more plans defined (i.e. post-paid and pre-paid)?</li>
<li>In the PPP settings, I needed to disable CHAP - doing this in Network Connections was enough, I didn&#8217;t have to edit /etc/ppp/options</li>
<li>The username and password don&#8217;t seem to matter</li>
</ul>
<p>lsusb shows the device - interesting that it doesn&#8217;t label it e160e, but E220 / E270 ???:</p>
<blockquote><p>paul@paul-laptop:~$ lsusb<br />
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 002 Device 002: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem<br />
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 001 Device 002: ID 05a9:2640 OmniVision Technologies, Inc. OV2640 Webcam<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</p></blockquote>
<p>Now that I have it working, this is the system log from insertion of the USB device to connecting to the network:</p>
<blockquote><p>Jan 21 07:37:54 paul-laptop kernel: [ 1281.336164] usb 2-2: new high speed USB device using ehci_hcd and address 2<br />
Jan 21 07:37:54 paul-laptop kernel: [ 1281.479581] usb 2-2: configuration #1 chosen from 1 choice<br />
Jan 21 07:37:55 paul-laptop kernel: [ 1281.581686] Initializing USB Mass Storage driver&#8230;<br />
Jan 21 07:37:55 paul-laptop kernel: [ 1281.583023] scsi5 : SCSI emulation for USB Mass Storage devices<br />
Jan 21 07:37:55 paul-laptop kernel: [ 1281.583231] usb 2-2: USB disconnect, address 2<br />
Jan 21 07:37:55 paul-laptop kernel: [ 1281.583324] usbcore: registered new interface driver usb-storage<br />
Jan 21 07:37:55 paul-laptop kernel: [ 1281.583331] USB Mass Storage support registered.<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.144163] usb 2-2: new high speed USB device using ehci_hcd and address 3<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.287791] usb 2-2: configuration #1 chosen from 1 choice<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.305526] scsi8 : SCSI emulation for USB Mass Storage devices<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.320440] scsi9 : SCSI emulation for USB Mass Storage devices<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.392549] usbcore: registered new interface driver usbserial<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.392579] USB Serial support registered for generic<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.392646] usbcore: registered new interface driver usbserial_generic<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.392650] usbserial: USB Serial Driver core<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.406201] USB Serial support registered for GSM modem (1-port)<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.406282] option 2-2:1.0: GSM modem (1-port) converter detected<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.406451] usb 2-2: GSM modem (1-port) converter now attached to ttyUSB0<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.406471] option 2-2:1.1: GSM modem (1-port) converter detected<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.406561] usb 2-2: GSM modem (1-port) converter now attached to ttyUSB1<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.406600] usbcore: registered new interface driver option<br />
Jan 21 07:38:01 paul-laptop kernel: [ 1288.406604] option: v0.7.2:USB Driver for GSM modems<br />
Jan 21 07:38:06 paul-laptop kernel: [ 1293.315709] scsi 8:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2<br />
Jan 21 07:38:06 paul-laptop kernel: [ 1293.325975] scsi 9:0:0:0: Direct-Access     HUAWEI   MMC Storage      2.31 PQ: 0 ANSI: 2<br />
Jan 21 07:38:06 paul-laptop kernel: [ 1293.338298] sr1: scsi-1 drive<br />
Jan 21 07:38:06 paul-laptop kernel: [ 1293.338641] sr 8:0:0:0: Attached scsi generic sg2 type 5<br />
Jan 21 07:38:06 paul-laptop kernel: [ 1293.338970] sd 9:0:0:0: Attached scsi generic sg3 type 0<br />
Jan 21 07:38:06 paul-laptop kernel: [ 1293.353699] sd 9:0:0:0: [sdb] Attached SCSI removable disk<br />
Jan 21 07:38:17 paul-laptop pppd[2933]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded.<br />
Jan 21 07:38:17 paul-laptop pppd[2933]: pppd 2.4.5 started by root, uid 0<br />
Jan 21 07:38:17 paul-laptop pppd[2933]: Using interface ppp0<br />
Jan 21 07:38:17 paul-laptop pppd[2933]: Connect: ppp0 &lt;&#8211;&gt; /dev/ttyUSB0<br />
Jan 21 07:38:17 paul-laptop pppd[2933]: PAP authentication succeeded<br />
Jan 21 07:38:17 paul-laptop kernel: [ 1304.425235] PPP BSD Compression module registered<br />
Jan 21 07:38:17 paul-laptop kernel: [ 1304.431699] PPP Deflate Compression module registered<br />
Jan 21 07:38:24 paul-laptop pppd[2933]: Could not determine remote IP address: defaulting to 10.64.64.64<br />
&#8230;</p></blockquote>
<p>When the system wasn&#8217;t working (using CHAP and the wrong APN), you can clearly see the failure:</p>
<blockquote><p>Jan  6 12:42:27 paul-laptop kernel: [  332.937183] usb 2-4: new high speed USB device using ehci_hcd and address 3<br />
Jan  6 12:42:27 paul-laptop kernel: [  333.080647] usb 2-4: configuration #1 chosen from 1 choice<br />
Jan  6 12:42:27 paul-laptop kernel: [  333.176235] Initializing USB Mass Storage driver&#8230;<br />
Jan  6 12:42:27 paul-laptop kernel: [  333.179119] scsi5 : SCSI emulation for USB Mass Storage devices<br />
Jan  6 12:42:27 paul-laptop kernel: [  333.179385] usbcore: registered new interface driver usb-storage<br />
Jan  6 12:42:27 paul-laptop kernel: [  333.179392] USB Mass Storage support registered.<br />
Jan  6 12:42:27 paul-laptop kernel: [  333.180499] usb 2-4: USB disconnect, address 3<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.752070] usb 2-4: new high speed USB device using ehci_hcd and address 4<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.905181] usb 2-4: configuration #1 chosen from 1 choice<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.921561] scsi8 : SCSI emulation for USB Mass Storage devices<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.922840] scsi9 : SCSI emulation for USB Mass Storage devices<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.948581] usbcore: registered new interface driver usbserial<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.948610] USB Serial support registered for generic<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.948706] usbcore: registered new interface driver usbserial_generic<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.948710] usbserial: USB Serial Driver core<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.970568] USB Serial support registered for GSM modem (1-port)<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.970692] option 2-4:1.0: GSM modem (1-port) converter detected<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.970862] usb 2-4: GSM modem (1-port) converter now attached to ttyUSB0<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.970881] option 2-4:1.1: GSM modem (1-port) converter detected<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.970976] usb 2-4: GSM modem (1-port) converter now attached to ttyUSB1<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.971016] usbcore: registered new interface driver option<br />
Jan  6 12:42:34 paul-laptop kernel: [  339.971020] option: v0.7.2:USB Driver for GSM modems<br />
Jan  6 12:42:38 paul-laptop pppd[2789]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded.<br />
Jan  6 12:42:38 paul-laptop pppd[2789]: pppd 2.4.5 started by root, uid 0<br />
Jan  6 12:42:38 paul-laptop pppd[2789]: Using interface ppp0<br />
Jan  6 12:42:38 paul-laptop pppd[2789]: Connect: ppp0 &lt;&#8211;&gt; /dev/ttyUSB0<br />
Jan  6 12:42:38 paul-laptop pppd[2789]: CHAP authentication succeeded<br />
Jan  6 12:42:38 paul-laptop pppd[2789]: CHAP authentication succeeded<br />
Jan  6 12:42:38 paul-laptop kernel: [  343.964939] PPP BSD Compression module registered<br />
Jan  6 12:42:38 paul-laptop kernel: [  344.026662] PPP Deflate Compression module registered<br />
Jan  6 12:42:39 paul-laptop kernel: [  344.925236] scsi 9:0:0:0: Direct-Access     HUAWEI   MMC Storage      2.31 PQ: 0 ANSI: 2<br />
Jan  6 12:42:39 paul-laptop kernel: [  344.925960] sd 9:0:0:0: Attached scsi generic sg2 type 0<br />
Jan  6 12:42:39 paul-laptop kernel: [  344.930619] scsi 8:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2<br />
Jan  6 12:42:39 paul-laptop kernel: [  344.942337] sd 9:0:0:0: [sdb] Attached SCSI removable disk<br />
Jan  6 12:42:39 paul-laptop kernel: [  344.957198] sr1: scsi-1 drive<br />
Jan  6 12:42:39 paul-laptop kernel: [  344.957525] sr 8:0:0:0: Attached scsi generic sg3 type 5<br />
Jan  6 12:42:47 paul-laptop pppd[2789]: Modem hangup<br />
Jan  6 12:42:47 paul-laptop pppd[2789]: Connection terminated.<br />
Jan  6 12:42:48 paul-laptop pppd[2789]: Exit.<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: Plugin /usr/lib/pppd/2.4.4/nm-pppd-plugin.so loaded.<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: pppd 2.4.5 started by root, uid 0<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: Using interface ppp0<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: Connect: ppp0 &lt;&#8211;&gt; /dev/ttyUSB0<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: CHAP authentication succeeded<br />
Jan  6 12:42:57 paul-laptop pppd[2846]: CHAP authentication succeeded<br />
Jan  6 12:43:06 paul-laptop pppd[2846]: Modem hangup<br />
Jan  6 12:43:06 paul-laptop pppd[2846]: Connection terminated.<br />
Jan  6 12:43:07 paul-laptop pppd[2846]: Exit.</p></blockquote>
<p>When I tried out usb_modeswitch, I didn&#8217;t really know what I was doing. I guessed that the parameters (-v and -p) would be those identified in lsusb.  But as for how to know what mode it was in or how to switch it, I don&#8217;t know.</p>
<blockquote><p>paul@paul-laptop:~$ usb_modeswitch -v 12d1 -p 1003 -H -i 1</p>
<p>* usb_modeswitch: tool for controlling &#8220;flip flop&#8221; mode USB devices<br />
* Version 1.0.2 (C) Josua Dietze 2009<br />
* Works with libusb 0.1.12 and probably other versions</p>
<p>Looking for default devices &#8230;<br />
Found default devices (1)<br />
Accessing device 000 on bus 002 &#8230;<br />
Using endpoints 0&#215;01 (out) and 0&#215;82 (in)<br />
Not a storage device, skipping SCSI inquiry</p>
<p>Device description data (identification)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Error: could not get description string &#8220;manufacturer&#8221;<br />
Manufacturer:<br />
Error: could not get description string &#8220;product&#8221;<br />
Product:<br />
Serial No.: not provided<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Sending Huawei control message &#8230;<br />
Error: sending Huawei control message failed (error -1). Aborting.</p>
<p>paul@paul-laptop:~$</p></blockquote>
<p><strong>UPDATE:</strong></p>
<p>I&#8217;ve been wondering how I get another &#8216;plan&#8217; into the Network Connection wizard. If my assumption about the APN is correct (that &#8216;VirginInternet&#8217; applies to post paid, and &#8216;VirginBroadband&#8217; applies to pre paid) then I&#8217;d want to add a plan called &#8216;Prepaid&#8217; with the APN &#8216;VirginBroadband&#8217; and if possible without CHAP.</p>
<p>Searching around, I found <a href="https://launchpad.net/ubuntu/karmic/+source/mobile-broadband-provider-info">mobile-broadband-provider-info</a> which, if you browse the source you&#8217;ll find there is a <a href="http://bazaar.launchpad.net/~network-manager/mobile-broadband-provider-info/trunk/annotate/head%3A/serviceproviders.xml">serviceproviders.xml</a> file which contains all of the definitions.</p>
<p>Using</p>
<blockquote><p>find / -name serviceproviders.xml</p></blockquote>
<p>I see the file exists at</p>
<blockquote><p>/usr/share/mobile-broadband-provider-info/serviceproviders.xml</p></blockquote>
<p>Editing this file, I can add the following under the Virgin provider, in the Australia region (just search for Virgin):</p>
<blockquote><p>&lt;apn value=&#8221;VirginBroadband&#8221;&gt;<br />
&lt;!&#8211; username and password can be anything, but password cannot be empty &#8211;&gt;<br />
&lt;username&gt;guest&lt;/username&gt;<br />
&lt;password&gt;guest&lt;/password&gt;<br />
&lt;name&gt;Prepaid&lt;/name&gt;<br />
&lt;/apn&gt;</p></blockquote>
<p>Now, I can open Network Connections and add a connection, selecting my new pre paid plan, and all I have to do is remember to disable CHAP as an option.</p>
<p>I love how open this all is and how easily I could find all this out. It took only a couple of minutes, while on the train traveling home from work. Awesome.</p>
<p>Looking at the <a href="http://bazaar.launchpad.net/~network-manager/mobile-broadband-provider-info/trunk/annotate/head%3A/README">README</a> file in the source lead me to the information about <a href="http://live.gnome.org/NetworkManager/MobileBroadband/ServiceProviders">ServiceProviders</a> which includes how to contribute.</p>
<p>Now I just need to email this info to the code maintainers so that others have an easier time connecting to Virgin. And, I still have to investigate if there is any way to disable CHAP via the config.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/QUWFLaXoaY3ZJicnXt0jSRe13EM/0/da"><img src="http://feedads.g.doubleclick.net/~a/QUWFLaXoaY3ZJicnXt0jSRe13EM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/QUWFLaXoaY3ZJicnXt0jSRe13EM/1/da"><img src="http://feedads.g.doubleclick.net/~a/QUWFLaXoaY3ZJicnXt0jSRe13EM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/_kKgM9StGLU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2010/01/ubuntu-virgin-mobile-internet-pre-paid-and-the-huawei-e160e/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.javathinking.com/2010/01/ubuntu-virgin-mobile-internet-pre-paid-and-the-huawei-e160e/</feedburner:origLink></item>
		<item>
		<title>A bit of xmas admin support</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/bj7WoKNbd3k/</link>
		<comments>http://www.javathinking.com/2009/12/a-bit-of-xmas-admin-support/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 13:03:43 +0000</pubDate>
		<dc:creator>paul</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=417</guid>
		<description><![CDATA[A simple request to install Photoshop Elements on Vista leads to much frustration and time wasting. How can the non-technical users deal with this complexity?]]></description>
			<content:encoded><![CDATA[<p></p><p>It started off simple enough: &#8220;Can you install Photoshop Elements please?&#8221; - A friend got <a href="http://www.adobe.com/products/photoshopelwin/">Photoshop Elements</a> for xmas, since it was plugged as an easy, effective way to manage and share photos. (Toshiba laptop, running Vista)</p>
<p>Installing it was easy enough, but when coming to share photos via email it got a bit scary because, he uses <a href="http://www.yahoo.com/">Yahoo</a> mail, not a fat email client. When I started looking at it I though okay, I just need to set up <a href="http://office.microsoft.com/en-us/outlook/default.aspx">Outlook</a> with the mail server settings. Going into the help menu in Yahoo mail gave some pretty clear instructions on how to set Outlook up - but it didn&#8217;t work. It kept asking for the username and password, which never worked. Searching around the web showed people talking about POP access to Yahoo mail, some suggesting it was a paid feature. But the Yahoo documentation didn&#8217;t make any mention of needing a paid account.</p>
<p>After wasting too much time on this, I just set up <a href="http://gmail.com/">gmail</a> - I knew I could easily access POP and SMTP here. So after creating a gmail account I set the reply to email in Outlook to be the Yahoo account and told gmail to forward any mail to Yahoo. Thus the gmail involvement would be pretty much invisible. I&#8217;ve sent a test email to the gmail account and I&#8217;m still waiting for it to arrive at yahoo&#8230;</p>
<p>So now I can share photos via email okay. Great. Not particularly easy for the novice user, and how come I can&#8217;t just tell PSE to use a web mail provider? AND, it looks like PSE maintains its OWN list of contacts. Not related to the Yahoo or Outlook contact lists. Jeeezz.</p>
<p>Next, to upgrade AVG virus checker. I was stunned to find AVG Free wouldn&#8217;t let me switch the Firefox search box provider to Google. Apparently it switches your default to yahoo, and denies you when you try to change it. I think its all configurable, but thats a crazy thing to deny you by default. Crazy.</p>
<p>So, I download the 1MB installer. Which then proceeds to download who knows how many MBs - but it takes a LONG time over a mobile internet connection (Three). Then the install starts, and promptly stops telling me to uninstall <a href="http://onecare.live.com/standard/en-us/default.htm">Microsoft Live OneCare</a> - which I do, which means a reboot, and then when I restart the installer, it downloads everything again. This time, I did not install the link checker hoping to avoid the &#8220;cripple my computer&#8221; feature.</p>
<p>The last thing to do - disable the touch pad when the usb mouse is plugged in - was easy (via the control panel mouse settings).</p>
<p>3 Hours later I&#8217;m done. But we&#8217;ve got a long way to go baby! This was way too hard. I hope I&#8217;m totally wrong - Perhaps there are easier ways, but they weren&#8217;t obvious and I don&#8217;t have another 8 hours to figure it out. If I was a billionaire, I know what I&#8217;d be doing - sorting this sh*t out!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/ISg8fK61UPJJCYgjNVE39lYVo4Q/0/da"><img src="http://feedads.g.doubleclick.net/~a/ISg8fK61UPJJCYgjNVE39lYVo4Q/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ISg8fK61UPJJCYgjNVE39lYVo4Q/1/da"><img src="http://feedads.g.doubleclick.net/~a/ISg8fK61UPJJCYgjNVE39lYVo4Q/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/bj7WoKNbd3k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2009/12/a-bit-of-xmas-admin-support/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.javathinking.com/2009/12/a-bit-of-xmas-admin-support/</feedburner:origLink></item>
		<item>
		<title>A simple task queue</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/hbn_7RhvKYI/</link>
		<comments>http://www.javathinking.com/2009/11/a-simple-task-queue/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 11:15:13 +0000</pubDate>
		<dc:creator>paul</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[queue]]></category>

		<category><![CDATA[task]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=413</guid>
		<description><![CDATA[I&#8217;m working on a little sample framework - really only to keep my sanity and practice my chosen craft - that allows you to string together tasks in a pipeline for processing. To exercise that framework - to flush out the pros and cons of the implementation - I&#8217;m writing a sample application.
The basic idea [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;m working on a little sample framework - really only to keep my sanity and practice my chosen craft - that allows you to string together tasks in a pipeline for processing. To exercise that framework - to flush out the pros and cons of the implementation - I&#8217;m writing a sample application.</p>
<p>The basic idea is that each task is interested in an event. That event could be the arrival of a file, or the completion of another task etc. To string tasks together, I&#8217;ve created a simple database queue system - as a task completes, it writes to the queue and then other tasks which are interested will see that event and then begin. Tasks complete either successfully (by returning no errors) or unsuccessfully (by returning more than one error).</p>
<p>An important concept is to be able to add (or remove) tasks from the pipeline programmatically and without changing the database schema. So, quite simply, when a task completes, that event is written to the queue - but how do we find which events another task is interested in? And how do we do this in a way that won&#8217;t take longer over time?</p>
<p>So, lets assume Job2 is interested in the successful completion of Job1. We need to find all successful Job1 events which haven&#8217;t already been processed by Job2 (successfully or otherwise):</p>
<pre name="code" class="sql">

SELECT * FROM QUEUE where job=&#039;job1&#039; and result=&#039;SUCCEEDED&#039; and task not in (SELECT task FROM QUEUE where job=&#039;job2&#039; and result is not null)
</pre>
<p>I&#8217;m no SQL ninja, so this is my first simple solution. It works, but it doesn&#8217;t scale. With a thousand rows, it completes pretty quickly, but with tens of thousands of rows it takes way too long (nearly 8 minutes with 40000 rows running on my Dell Inspiron laptop).</p>
<p>Pragmatically, we can restrict the query based on time - we don&#8217;t need to search the whole table, just the more recent events:</p>
<pre name="code" class="sql">

SELECT * FROM QUEUE where tstamp &gt;= ? and job=&#039;job1&#039; and result=&#039;SUCCEEDED&#039; and task not in (SELECT task FROM QUEUE where tstamp &gt;= ? and  job=&#039;job2&#039; and result is not null)
</pre>
<p>You could easily just look over the events in the last hour if your tasks are short running and you get less than a thousand events an hour - it&#8217;d probably perform okay. To give an indication of performance I&#8217;ve written a little <a href="http://groovy.codehaus.org/">groovy</a> script to show some basic trends - included below.<br />
<code><br />
paul@paul-laptop:~$ groovy sqltest<br />
2005 rows took: 4<br />
4005 rows took: 5<br />
6005 rows took: 3<br />
8005 rows took: 3<br />
10005 rows took: 2<br />
12005 rows took: 3<br />
14005 rows took: 3<br />
16005 rows took: 4<br />
18005 rows took: 5<br />
20005 rows took: 3<br />
</code></p>
<p>Notice though, that this is a great example of where indexes really help - without the index times get larger as the rowcount gets larger:<br />
<code><br />
paul@paul-laptop:~$ groovy sqltest<br />
2005 rows took: 13<br />
4005 rows took: 34<br />
6005 rows took: 123<br />
8005 rows took: 134<br />
10005 rows took: 229<br />
12005 rows took: 237<br />
14005 rows took: 330<br />
16005 rows took: 342<br />
18005 rows took: 428<br />
20005 rows took: 442<br />
</code></p>
<p>Its a pity I have to worry about the time restriction, but it does make the solution workable and at least in my intended application, appropriate. I was hoping to use the <a href="http://www.techonthenet.com/sql/minus.php">SQL MINUS</a> function, but it appears <a href="http://dev.mysql.com/">MYSQL</a> doesn&#8217;t support it.</p>
<p>Here&#8217;s the groovy script I used to generate the results. The difference between using the time restriction and the index is so dramatic and obvious, it is a great example.</p>
<pre name="code" class="java">

import groovy.sql.Sql
import groovy.grape.Grape

Grape.grab(group:&#039;mysql&#039;, module:&#039;mysql-connector-java&#039;, version:&#039;5.1.10&#039;, classLoader: this.class.classLoader.rootLoader)

enum STATUS { SUCCEEDED, FAILED }

def go() {
	def sql = Sql.newInstance(&quot;jdbc:mysql://localhost:3306/spike&quot;, &quot;spike&quot;,&quot;password&quot;, &quot;com.mysql.jdbc.Driver&quot;)
	try {
	   sql.execute(&quot;drop table QUEUE&quot;)
	} catch(Exception e){}

	sql.execute(&quot;CREATE TABLE QUEUE (id INTEGER  NOT NULL,job varchar (20) NOT NULL,task varchar (20) NOT NULL,result VARCHAR (20) NOT NULL, tstamp timestamp, PRIMARY KEY (id)) ENGINE = MyISAM&quot;)
	sql.execute(&quot;create index idx1 on QUEUE(tstamp, job, result)&quot;)

	(1..10).each() {
		def d = createHistory(sql,1000*it)
		findJobsToProcess(sql, d)
	}
}

def findJobsToProcess(sql, d) {
	def rowcount = 0
	sql.eachRow(&quot;select count(*) from QUEUE&quot;) { row -&gt;
		rowcount = row[0]
	}

	long start, end

	start = System.currentTimeMillis()
	// now find the &#039;job1&#039; items that haven&#039;t been processed by &#039;job2&#039;
	sql.eachRow(&quot;SELECT * FROM QUEUE where tstamp &gt;= ? and job=&#039;job1&#039; and result=? and task not in (SELECT task FROM QUEUE where tstamp &gt;= ? and  job=&#039;job2&#039; and result is not null) order by tstamp asc&quot;, [d,STATUS.SUCCEEDED.name(),d]) {
//	    println &quot;${it.id} ${it.job} ${it.task} ${it.result} ${it.tstamp}&quot;
	}
	end = System.currentTimeMillis()
	println &quot;${rowcount} rows took: ${end-start}&quot;

}

def createHistory(sql, count) {
	sql.execute(&quot;truncate table QUEUE&quot;)
	int id = 1
	int task = 1
	// create a &quot;history&quot; of previous jobs
	STATUS.each() { status -&gt;
		(1..count/2).each() {
			sql.execute(&quot;insert into QUEUE (id,job,task,result,tstamp) values (?,?,?,?,?)&quot;, [id++,&#039;job1&#039;,task.toString(),status.name(), new Date()])
			sql.execute(&quot;insert into QUEUE (id,job,task,result,tstamp) values (?,?,?,?,?)&quot;, [id++,&#039;job2&#039;,task.toString(),status.name(), new Date()])
			task++
		}
	}
	sleep(1000)
	def d = new Date()
	// insert some successful &#039;job1&#039; items which &#039;job2&#039; hasn&#039;t processed
	(1..5).each() {
		sql.execute(&quot;insert into QUEUE (id,job,task,result,tstamp) values (?,?,?,?,?)&quot;, [id++,&#039;job1&#039;,task.toString(),STATUS.SUCCEEDED.name(), new Date()])
		task++
	}
	return  d
}

go()
</pre>
<p>In running this test, I used:</p>
<ul>
<li>Dell Inspiron 1525, Intel(R) Core(TM)2 Duo Processor T5550, 1.83 GHz, 2MB Cache, 667 MHz FSB, 2GB (2 X 1024MB) 667MHz Dual Channel DDR2 SDRAM, 160GB 7200RPM Performance Hard Drive</li>
<li>Ubuntu 9.10 32 bit desktop edition</li>
<li>Groovy Version: 1.6.5</li>
<li>JVM: 1.6.0_03</li>
<li>mysql  Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (i486)</li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/mWrK0TL_KQc3qAJrsJpVCVonr4U/0/da"><img src="http://feedads.g.doubleclick.net/~a/mWrK0TL_KQc3qAJrsJpVCVonr4U/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/mWrK0TL_KQc3qAJrsJpVCVonr4U/1/da"><img src="http://feedads.g.doubleclick.net/~a/mWrK0TL_KQc3qAJrsJpVCVonr4U/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/hbn_7RhvKYI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2009/11/a-simple-task-queue/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.javathinking.com/2009/11/a-simple-task-queue/</feedburner:origLink></item>
		<item>
		<title>Rapache on Ubuntu 9.10</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/qMj5ISu9iXE/</link>
		<comments>http://www.javathinking.com/2009/11/rapache-on-ubuntu-910/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 05:02:24 +0000</pubDate>
		<dc:creator>paul</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[apache]]></category>

		<category><![CDATA[rapache]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=408</guid>
		<description><![CDATA[I&#8217;ve just now stumbled across Rapache, a useful GUI tool that makes configuring apache easy. I found it by accident in the Ubuntu Software Center, but unfortunately it would freeze while trying to add a new domain. I searched the web for answers, and found a bug report.
This didn&#8217;t specifically reference Ubuntu 9.10 (rather, 9.04) [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve just now stumbled across <a href="https://launchpad.net/rapache">Rapache</a>, a useful GUI tool that makes configuring apache easy. I found it by accident in the Ubuntu Software Center, but unfortunately it would freeze while trying to add a new domain. I searched the web for answers, and found a <a href="https://bugs.launchpad.net/rapache/+bug/346788">bug report</a>.</p>
<p>This didn&#8217;t specifically reference Ubuntu 9.10 (rather, 9.04) and the file that needed to be patched didn&#8217;t exist in the given location.</p>
<p>I found it easily enough:</p>
<pre>
paul@paul-laptop:~$ sudo find / -name RapacheGui.py[sudo] password for paul:
/usr/lib/pymodules/python2.5/RapacheGtk/RapacheGui.py
/usr/lib/pymodules/python2.6/RapacheGtk/RapacheGui.py
/usr/share/pyshared/RapacheGtk/RapacheGui.py
paul@paul-laptop:~$
</pre>
<p>I edited the last one (/usr/share/pyshared/RapacheGtk/RapacheGui.py) as documented in <a href="https://bugs.launchpad.net/rapache/+bug/346788/comments/23">comment 23</a> to add the following at line 79:</p>
<pre>
        if not Shell.command.ask_password(): sys.exit(1)
</pre>
<p>Note, this line MUST be preceeded by 8 spaces - indentation is important in Python.</p>
<p>Now, rapache would prompt for the system password and then close! </p>
<p>I&#8217;ve got it working now, by starting it with sudo:</p>
<pre>
sudo rapache
</pre>
<p>Everything seems to work. I&#8217;ve added a domain, turned on the <a href="http://httpd.apache.org/docs/2.2/mod/mod_include.html">include module</a>, and added &#8220;AddOutputFilter INCLUDES .html&#8221; to the virtual host definition - all very quickly using rapache. </p>
<p>So, server side includes now work on my new virtual host - which is what I started out wanting to do before going off on this tangent.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/Z19IHWXeD9rfUQ6RuDmuy8917Rs/0/da"><img src="http://feedads.g.doubleclick.net/~a/Z19IHWXeD9rfUQ6RuDmuy8917Rs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Z19IHWXeD9rfUQ6RuDmuy8917Rs/1/da"><img src="http://feedads.g.doubleclick.net/~a/Z19IHWXeD9rfUQ6RuDmuy8917Rs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/qMj5ISu9iXE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2009/11/rapache-on-ubuntu-910/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.javathinking.com/2009/11/rapache-on-ubuntu-910/</feedburner:origLink></item>
		<item>
		<title>Tagging with Appengine DataStore</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/8Nm_LYVp9E8/</link>
		<comments>http://www.javathinking.com/2009/11/tagging-with-appengine-datastore/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 11:54:21 +0000</pubDate>
		<dc:creator>paul</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[appengine]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=401</guid>
		<description><![CDATA[I&#8217;ve been looking into how to implement a tagging mechanism with Appengine (Python). By using a StringListProperty, you can associate a list of tags with an entity. The model would look something like this:

from google.appengine.ext import db

class Sample(db.Model):
  name = db.StringProperty(required=True)
  tags = db.StringListProperty()

Now, assuming we want to find the entities tagged with [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve been looking into how to implement a tagging mechanism with Appengine (Python). By using a StringListProperty, you can associate a list of tags with an entity. The model would look something like this:</p>
<pre>
from google.appengine.ext import db

class Sample(db.Model):
  name = db.StringProperty(required=True)
  tags = db.StringListProperty()
</pre>
<p>Now, assuming we want to find the entities tagged with a given word, we can use a query like this:</p>
<blockquote><p>
q = db.GqlQuery(&#8221;SELECT * FROM Sample where tags = :1&#8243;,&#8217;z')
</p></blockquote>
<p>If we want to find all entities that have ANY of these tags (OR) we can query with GqlQuery or filter: </p>
<blockquote><p>
q = db.GqlQuery(&#8221;SELECT * FROM Sample where tags in :1&#8243;,['a','z'])</p>
<p>q = domain.Sample.all()<br />
q.filter(&#8221;tags in &#8220;, ['b','d'])
</p></blockquote>
<p>When we want to find entities with ALL of the given tags:</p>
<blockquote><p>
q = db.GqlQuery(&#8221;SELECT * FROM Sample where tags = :1 and tags = :2&#8243;,&#8217;b',&#8217;c')<br />
q = domain.Sample.all()<br />
q.filter(&#8221;tags = &#8220;, &#8216;b&#8217;)<br />
q.filter(&#8221;tags = &#8220;, &#8216;c&#8217;)
</p></blockquote>
<p>Too easy!</p>
<p>If you have an appengine project, you can try this code out by adding the entity (Sample - listed above) to your domain model and run the following in your development console (http://localhost:8080/_ah/admin/interactive):</p>
<pre>
import domain

domain.Sample(name='t1',tags=['a','b','c']).put()
domain.Sample(name='t2',tags=['b','c','d']).put()
domain.Sample(name='t3',tags=['c','d','e']).put()
domain.Sample(name='t3',tags=['x','Y','z']).put()

def display(r):
 for r in results:
  print r.name +" tags = "+' '.join(r.tags)

print "FIND WITH THIS TAG"
q = db.GqlQuery("SELECT * FROM Sample where tags = :1",'z')
results = q.fetch(5)
display(results)

print "FIND WITH ANY OF THESE TAGS (OR)"
q = db.GqlQuery("SELECT * FROM Sample where tags in :1",['a','z'])
results = q.fetch(5)
display(results)

print "FIND WITH ANY OF THESE TAGS (OR)"
q = domain.Sample.all()
q.filter("tags in ", ['a','z'])
results = q.fetch(5)
display(results)

print "FIND WITH ANY OF THESE TAGS (AND)"
q = db.GqlQuery("SELECT * FROM Sample where tags = :1 and tags = :2",'b','c')
results = q.fetch(5)
display(results)

print "FIND WITH ALL OF THESE TAGS (AND)"
q = domain.Sample.all()
q.filter("tags = ", 'b')
q.filter("tags = ", 'c')

results = q.fetch(5)
display(results)
</pre>
<p>This should produce the following result:</p>
<blockquote><p>
FIND WITH THIS TAG<br />
t3 tags = x Y z<br />
FIND WITH ANY OF THESE TAGS (OR)<br />
t1 tags = a b c<br />
t3 tags = x Y z<br />
FIND WITH ANY OF THESE TAGS (OR)<br />
t1 tags = a b c<br />
t3 tags = x Y z<br />
FIND WITH ANY OF THESE TAGS (AND)<br />
t1 tags = a b c<br />
t2 tags = b c d<br />
FIND WITH ALL OF THESE TAGS (AND)<br />
t1 tags = a b c<br />
t2 tags = b c d
</p></blockquote>
<p>So, it&#8217;s easier than I thought. But I&#8217;m not experienced with DataStore yet, and I don&#8217;t know if there are inherit limitations with this approach - remember, there are <a href="http://code.google.com/appengine/docs/python/datastore/overview.html#Quotas_and_Limits">limits</a> on the way you retrieve data.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/JBCyByMIDpuIv-QvXPaZHWV0uvw/0/da"><img src="http://feedads.g.doubleclick.net/~a/JBCyByMIDpuIv-QvXPaZHWV0uvw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/JBCyByMIDpuIv-QvXPaZHWV0uvw/1/da"><img src="http://feedads.g.doubleclick.net/~a/JBCyByMIDpuIv-QvXPaZHWV0uvw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/8Nm_LYVp9E8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2009/11/tagging-with-appengine-datastore/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.javathinking.com/2009/11/tagging-with-appengine-datastore/</feedburner:origLink></item>
		<item>
		<title>No module named _multiprocessing</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/TCxFt2yFUXg/</link>
		<comments>http://www.javathinking.com/2009/10/no-module-named-_multiprocessing/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 10:13:03 +0000</pubDate>
		<dc:creator>paul</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[appengine]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=395</guid>
		<description><![CDATA[I&#8217;m getting back into appengine at the moment, and I came across this error:
No module named _multiprocessing 
A google search turned up this error report:
http://code.google.com/p/googleappengine/issues/detail?id=1504
which lead to this post:
http://code.google.com/p/soc/wiki/GettingStarted

The problem was of-course, that I was using Python 2.6 instead of 2.5.
I love Linux, the solution is trivial:
The workaround for this is to install Python 2.5 [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;m getting back into appengine at the moment, and I came across this error:</p>
<blockquote><p>No module named _multiprocessing </p></blockquote>
<p>A google search turned up this error report:</p>
<blockquote><p><a href="http://code.google.com/p/googleappengine/issues/detail?id=1504">http://code.google.com/p/googleappengine/issues/detail?id=1504</a></p></blockquote>
<p>which lead to this post:</p>
<blockquote><p><a href="http://code.google.com/p/soc/wiki/GettingStarted">http://code.google.com/p/soc/wiki/GettingStarted</a>
</p></blockquote>
<p>The problem was of-course, that I was using Python 2.6 instead of 2.5.</p>
<p>I love Linux, the solution is trivial:</p>
<blockquote><p>The workaround for this is to install Python 2.5 on your machine. It will be then be accessible by using python2.5 on the command line. Then open thirdparty/google_appengine/dev_appserver.py in your favorite text editor and replace the first line,</p>
<p>#!/usr/bin/env python</p>
<p>with</p>
<p>#!/usr/bin/env python2.5</p></blockquote>
<p>Note, I already had Python 2.5 installed via:</p>
<blockquote><p>sudo apt-get install python2.5</p></blockquote>
<p>Now, I&#8217;ll promptly get back to figuring out how best to use DataStore to implement my solution!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/nV0KORqAmmNWUjQcUvIHfRM1GD4/0/da"><img src="http://feedads.g.doubleclick.net/~a/nV0KORqAmmNWUjQcUvIHfRM1GD4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/nV0KORqAmmNWUjQcUvIHfRM1GD4/1/da"><img src="http://feedads.g.doubleclick.net/~a/nV0KORqAmmNWUjQcUvIHfRM1GD4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/TCxFt2yFUXg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2009/10/no-module-named-_multiprocessing/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.javathinking.com/2009/10/no-module-named-_multiprocessing/</feedburner:origLink></item>
		<item>
		<title>Amazon web services via Grails</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/L6lbdSj0Rs8/</link>
		<comments>http://www.javathinking.com/2009/10/amazon-web-services-via-grails/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 04:15:21 +0000</pubDate>
		<dc:creator>paul</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[amazon]]></category>

		<category><![CDATA[aws]]></category>

		<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=388</guid>
		<description><![CDATA[I just recently noticed that Amazon have changed the way you invoke their Product Advertising API - you now need to sign requests as described in the Example REST Requests.
I obviously haven&#8217;t been reading my emails, since the first clue came when I saw:
&#60;Error&#62;&#60;Code&#62;MissingParameter&#60;/Code&#62;&#60;Message&#62;The request must contain the parameter Signature.&#60;/Message&#62;&#60;/Error&#62;
Luckily, they have a java example [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I just recently noticed that Amazon <a href="http://developer.amazonwebservices.com/connect/ann.jspa?annID=476">have changed the way you invoke their Product Advertising API</a> - you now need to sign requests as described in the <a href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?rest-signature.html">Example REST Requests</a>.</p>
<p>I obviously haven&#8217;t been reading my emails, since the first clue came when I saw:</p>
<p><code>&lt;Error&gt;&lt;Code&gt;MissingParameter&lt;/Code&gt;&lt;Message&gt;The request must contain the parameter Signature.&lt;/Message&gt;&lt;/Error&gt;</code></p>
<p>Luckily, they have a <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=2478&amp;categoryID=14">java example</a> demonstrating how to make an API request.</p>
<p>If you extract the source from this sample into your &lt;GRAILS_APP&gt;/src/java directory, then you can invoke the amazon api with code like:</p>
<pre name="code" class="java">

import org.codehaus.groovy.grails.commons.ConfigurationHolder
import com.amazon.advertising.api.sample.*

class AmazonService {
  private static final String ENDPOINT = &quot;ecs.amazonaws.com&quot;;
  private static final String AWS_SECRET_KEY = &quot;put your secret key here&quot;;
  private static final String AWS_ACCESS_KEY_ID = &quot;put your access key here&quot;;

  boolean transactional = false

  /**
   * Call amazon lookup api.
   * Returns xml document.
   */
  def getData(String asin) {
    SignedRequestsHelper helper = SignedRequestsHelper.getInstance(ENDPOINT, AWS_ACCESS_KEY_ID, AWS_SECRET_KEY);

    String requestUrl = null;
    String title = null;

    Map params = new HashMap();
    params.put(&quot;Service&quot;, &quot;AWSECommerceService&quot;);
    params.put(&quot;Version&quot;, &quot;2009-03-31&quot;);
    params.put(&quot;Operation&quot;, &quot;ItemLookup&quot;);
    params.put(&quot;ItemId&quot;, asin);
    params.put(&quot;ResponseGroup&quot;, &quot;Small,Medium&quot;);

    requestUrl = helper.sign(params);

    def xml = new URL(requestUrl).text
    return new XmlSlurper().parseText(xml)
  }
}
</pre>
<p>You could, of-course, define your access keys in the Config.groovy class if you prefer.</p>
<p>(To find your identifiers, see http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?ViewingCredentials.html)</p>

<p><a href="http://feedads.g.doubleclick.net/~a/VN2Ft7LFjExcKgOSrtUHw_4u5YY/0/da"><img src="http://feedads.g.doubleclick.net/~a/VN2Ft7LFjExcKgOSrtUHw_4u5YY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/VN2Ft7LFjExcKgOSrtUHw_4u5YY/1/da"><img src="http://feedads.g.doubleclick.net/~a/VN2Ft7LFjExcKgOSrtUHw_4u5YY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/L6lbdSj0Rs8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2009/10/amazon-web-services-via-grails/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.javathinking.com/2009/10/amazon-web-services-via-grails/</feedburner:origLink></item>
		<item>
		<title>Locked subversion working copy</title>
		<link>http://feedproxy.google.com/~r/JavaThinking/~3/Nyg_WH0Sg5A/</link>
		<comments>http://www.javathinking.com/2009/10/locked-subversion-working-copy/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 02:06:22 +0000</pubDate>
		<dc:creator>paul</dc:creator>
		
		<category><![CDATA[Corporate Development]]></category>

		<category><![CDATA[subversion]]></category>

		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.javathinking.com/?p=384</guid>
		<description><![CDATA[I don&#8217;t know how it happened, but my local working copy got locked. This meant that every time I tried to commit, I got a &#8216;working copy is locked&#8217; error.
The solution was easy, after I found a reference in the FAQ:
svn cleanup &#60;directory&#62;
]]></description>
			<content:encoded><![CDATA[<p></p><p>I don&#8217;t know how it happened, but my local working copy got locked. This meant that every time I tried to commit, I got a &#8216;working copy is locked&#8217; error.</p>
<p>The solution was easy, after I found a reference in the <a href="http://subversion.tigris.org/faq.html#wedged-wc">FAQ</a>:</p>
<blockquote><p>svn cleanup &lt;directory&gt;</p></blockquote>

<p><a href="http://feedads.g.doubleclick.net/~a/_u2aCfSpVsccMKLOQ70F8gAVJyk/0/da"><img src="http://feedads.g.doubleclick.net/~a/_u2aCfSpVsccMKLOQ70F8gAVJyk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/_u2aCfSpVsccMKLOQ70F8gAVJyk/1/da"><img src="http://feedads.g.doubleclick.net/~a/_u2aCfSpVsccMKLOQ70F8gAVJyk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/JavaThinking/~4/Nyg_WH0Sg5A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.javathinking.com/2009/10/locked-subversion-working-copy/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.javathinking.com/2009/10/locked-subversion-working-copy/</feedburner:origLink></item>
	</channel>
</rss>
