<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>HD1s Personal weblog</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/" />
    <link rel="self" type="application/atom+xml" href="http://hasandiwan.info/atom.xml" />
    <id>tag:hasandiwan.info,2009-11-04://1</id>
    <updated>2010-07-30T07:54:07Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.32-en</generator>

<entry>
    <title>How can Amazon Spread the Kindle Further</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/07/how-can-amazon-spread-the-kindle-further.html" />
    <id>tag:hasandiwan.info,2010://1.278</id>

    <published>2010-07-30T07:50:59Z</published>
    <updated>2010-07-30T07:54:07Z</updated>

    <summary>Readers know I&apos;m a rather big fan of Amazon Kindle, as I have it on every single one of my various devices and love it on all of them. Amazon seems to be aiming to merely control the DRM, not...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="amazon" label="amazon" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="business" label="business" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="kindle" label="kindle" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="software" label="software" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>Readers know I'm a rather big fan of <a href="http://kindle.amazon.com">Amazon Kindle</a>, as I have it on every single one of my various devices and love it on all of them. <a href="http://amazon.com">Amazon</a> seems to be aiming to merely control the DRM, not where/how you use it, so they should open the source of the Kindle up and let others design devices using the Kindle's DRM for free. It would be a great boost, though given <a href="http://arstechnica.com/gadgets/news/2010/07/kindle-sales-outpace-amazons-hardcover-book-sales.ars">current trends</a>, it isn't likely to be on their radar at present.</p>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/07/how-can-amazon-spread-the-kindle-further.html">here</a>
    </content>
</entry>

<entry>
    <title>Afghanistan Casualty Dataset</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/07/afghanistan-casualty-dataset.html" />
    <id>tag:hasandiwan.info,2010://1.277</id>

    <published>2010-07-26T15:56:47Z</published>
    <updated>2010-07-26T16:05:14Z</updated>

    <summary>The Guardian has obtained the entire casualty data and an explanation thereof. I&apos;m sure a lot of visualisations are forthcoming; this is just a note apprising me of their existence....</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="afghanistan" label="afghanistan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="data" label="data" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="guardian" label="guardian" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wikileaks" label="wikileaks" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>The <a href="http://www.guardian.co.uk">Guardian</a> has obtained the <a href="http://www.guardian.co.uk/world/datablog/2010/jul/25/wikileaks-afghanistan-data">entire casualty data and an explanation thereof</a>. I'm sure a lot of visualisations are forthcoming; this is just a note apprising me of their existence.</p>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/07/afghanistan-casualty-dataset.html">here</a>
    </content>
</entry>

<entry>
    <title>Should have been England&apos;s World Cup Song</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/07/should-have-been-englands-world-cup-song.html" />
    <id>tag:hasandiwan.info,2010://1.276</id>

    <published>2010-07-10T21:36:02Z</published>
    <updated>2010-07-10T21:37:03Z</updated>

    <summary></summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="comedy" label="Comedy" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="england" label="England" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="humour" label="humour" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mitchbenn" label="Mitch Benn" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sports" label="Sports" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<center><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/9Hq9BLFYQ9Y&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9Hq9BLFYQ9Y&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></center>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/07/should-have-been-englands-world-cup-song.html">here</a>
    </content>
</entry>

<entry>
    <title>Some Never Learn, do They?</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/07/some-never-learn-do-they.html" />
    <id>tag:hasandiwan.info,2010://1.275</id>

    <published>2010-07-08T05:04:41Z</published>
    <updated>2010-07-08T05:15:00Z</updated>

    <summary>At May 27 of this year, I was politely asked to leave the UC Berkeley International House by an RA. Tonight, the very same RA told me that a recent change in policy -- from the top, mind you --...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="berkeley" label="Berkeley" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="coffeehour" label="Coffee Hour" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="internationalhouse" label="International House" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>At May 27 of this year, I was politely asked to <a href="http://hasandiwan.info/2010/05/booted-from-i-house.html">leave</a> the <a href="http://ihouse.berkeley.edu">UC Berkeley International House</a> by an RA. Tonight, the very same RA told me that a recent change in policy -- from the top, mind you -- has lead to the exclusion of alumni from <a href="http://ihouse.berkeley.edu/p/ongoing.html">the coffee hour</a>. So, I demanded this in writing, as I am going to ring his supervisor for clarification tomorrow. He refused. So, coming from my newfound <a href="http://hasandiwan.info/2010/06/california-cops-resorting-to-twitter-saved-by-gps.html">confidence</a> which I'm holding <a href="http://twitter.com/jkassourri">Kassourri</a> personally responsible, I called his bluff, repeating my demand for his name, his position, a written copy of the policy, his supervisor's name, and the supervisor's number. When he lifted the phone to call 911, another RA walked in and was more reasonable about my demands. After handing me a piece of paper with the required information, I left the place, after warning the original RA that this was no way to treat an alumni and a contributor. As this is the second time this has happened, if it happens again, I will cease my yearly contribution to the alumni fund.</p>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/07/some-never-learn-do-they.html">here</a>
    </content>
</entry>

<entry>
    <title>Kindle Comes to (some) Airports!</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/07/kindle-comes-to-some-airports.html" />
    <id>tag:hasandiwan.info,2010://1.274</id>

    <published>2010-07-03T10:31:05Z</published>
    <updated>2010-07-03T10:32:31Z</updated>

    <summary>They finally caught on and HMSHost will sell the Kindle at airports in the States. No word yet, if they will preload the bestsellers on the devices and disable the wireless to keep with regulations....</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="amazon" label="Amazon" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="amazonkindle" label="Amazon Kindle" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="books" label="books" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flying" label="flying" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="futuredirections" label="future directions" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="kindle" label="Kindle" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="unitedstates" label="United States" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>They <a href="http://blogkindle.com/2010/06/kindle-in-the-airports">finally caught on</a> and <a href="http://www.hmshost.com">HMSHost</a> will sell the <a href="http://amazon.com/kindle">Kindle</a> at airports in the States. No word yet, if they will preload <a href="http://www.nytimes.com/pages/books/bestseller/">the bestsellers</a> on the devices and disable the wireless to keep with regulations.</p>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/07/kindle-comes-to-some-airports.html">here</a>
    </content>
</entry>

<entry>
    <title>On Judicial Activism</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/07/on-judicial-activism.html" />
    <id>tag:hasandiwan.info,2010://1.273</id>

    <published>2010-07-03T09:47:33Z</published>
    <updated>2010-07-03T09:48:57Z</updated>

    <summary>Every time there&apos;s an opening for a new US Supreme Court justice, the Republicans whinge about an odd notion. This notion is odd, precisely because it is the role given for the courts in the US Constitution, namely:The judicial Power...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="activism" label="activism" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="constitution" label="Constitution" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="law" label="law" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="legal" label="legal" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="supremecourt" label="Supreme Court" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="unitedstates" label="United States" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>Every time there's an opening for a new <a href="http://www.supremecourt.gov/">US Supreme Court</a> justice, the <a href="http://www.rnc.org">Republicans</a> whinge about an odd notion. This notion is odd, precisely because it is the role given for the courts in the <a href="http://www.usconstitution.net/const.html">US Constitution</a>, namely:<br/><blockquote>The judicial Power shall extend to all Cases, in Law and Equity, arising under this Constitution, the Laws of the United States, and Treaties made, or which shall be made, under their Authority; to all Cases affecting Ambassadors, other public Ministers and Consuls; to all Cases of admiralty and maritime Jurisdiction; to Controversies to which the United States shall be a Party; to Controversies between two or more States; between a State and Citizens of another State; between Citizens of different States; between Citizens of the same State claiming Lands under Grants of different States, and between a State, or the Citizens thereof, and foreign States, Citizens or Subjects.</blockquote>To me, this reads as though the founders did intend the courts to be chock-full of activist judges and function just as the <A href="http://www.justice.gov/olc/signing.htm">presidential signing statements</a> were used by George W. Bush. Any other thoughts?</p>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/07/on-judicial-activism.html">here</a>
    </content>
</entry>

<entry>
    <title>Ribbing from the Finns</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/06/ribbing-from-the-finns.html" />
    <id>tag:hasandiwan.info,2010://1.272</id>

    <published>2010-06-28T20:39:32Z</published>
    <updated>2010-06-28T20:40:40Z</updated>

    <summary></summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="culture" label="culture" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iphone" label="iPhone" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mobileadverts" label="mobile adverts" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="nokia" label="Nokia" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ribbing" label="ribbing" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<center><a href="http://9to5mac.com/node/18671"><img src="http://9to5mac.com/files/u312/Nokia.png"/></a></center>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/06/ribbing-from-the-finns.html">here</a>
    </content>
</entry>

<entry>
    <title>California Cops Resorting to Twitter? (Saved by GPS)</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/06/california-cops-resorting-to-twitter-saved-by-gps.html" />
    <id>tag:hasandiwan.info,2010://1.271</id>

    <published>2010-06-25T22:41:06Z</published>
    <updated>2010-06-25T23:00:05Z</updated>

    <summary>So, I&apos;m driving up 101 from lunch at AOL in Mountain View when I see police sirens go off in my rear view mirror. I pulled over, rolled down the window. The cop said his dispatch had said a Twitter...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="chp" label="CHP" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="lunch20" label="lunch 2.0" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mountainview" label="mountain view" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="police" label="Police" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="search" label="search" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="twitter" label="Twitter" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>So, I'm driving up 101 from lunch at <a href="http://aol.com">AOL</a> in Mountain View when I see police sirens go off in my rear view mirror. I pulled over, rolled down the window. The cop said his dispatch had said a <a href="http://search.twitter.com">Twitter alert</a> showed that there were a car matching the description of mine (black Civic, <b>real</b> precise, I know) driving erratically -- weaving in and out of lanes, speeding, etc. Before that, he demanded to know why I didn't pull over on the motorway (oh, and he didn't understand "motorway" either, which lead me to ask him what language he thought I was speaking, leading me to make a <a href="http://twitter.com/jkassourri">Kassourri</a>-esque remark about how he didn't understand English). I showed him my <a href="http://my.dash.net">satnav</a> as he'd said I'd been speeding. He asked me if I'd anything to drink. He then took me license and insurance away for a minute and brought it back, wishing me a good afternoon.</p><p>Thirty minutes later, I got home and checked <a href="http://twitter.com">Twitter</a> for <a href="http://search.twitter.com/search?q=5USV623">my license plate number</a>, which he said his dispatch had found. I was let go without any trouble -- guess they figured out by my demeanor that I'm not to be messed with.</p><p>Calling this whole episode <a href="http://news.bbc.co.uk/2/hi/uk_news/politics/4010293.stm">an inverted pyramid of piffle</a> is putting things mildly, but I did make it to <a href="http://sselabs.wordpress.com/2010/06/21/sse-labs-aol-in-mountain-view-ca">lunch</a>. All in all, it turned out to be a fine afternoon.</p>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/06/california-cops-resorting-to-twitter-saved-by-gps.html">here</a>
    </content>
</entry>

<entry>
    <title>Stupid Yanks, Pt. 261</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/06/stupid-yanks-pt-261.html" />
    <id>tag:hasandiwan.info,2010://1.270</id>

    <published>2010-06-21T22:50:57Z</published>
    <updated>2010-06-21T23:08:54Z</updated>

    <summary>I was at pizza orgasmica watching the Spain/Honduras game. And I got up to get a drink, when this group of (clearly American) women walk in, take my plate and move it to another table. I returned to find my...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="america" label="america" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rants" label="rants" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rudeness" label="rudeness" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sanfrancisco" label="San Francisco" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="stupidity" label="stupidity" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>I was at <a href="http://pizzaorgasmica.com">pizza orgasmica</a> watching the <a href="http://www.google.com/url?q=http://www.fifa.com/worldcup/matches/round%3D249722/match%3D300061494/index.html%3Fcid%3Dgoogle_onebox&sa=X&ei=S-4fTMugA5KlnQeoyfHmAw&ved=0CBwQ5AEoCzAA&usg=AFQjCNEhS4sC_CyqkMAzMFlsMYdXOEYpJA">Spain/Honduras game</a>. And I got up to get a drink, when this group of (clearly American) women walk in, take my plate and move it to another table. I returned to find my plate wasn't there, so I told one of the ladies seated that I had left my plate there, pointing to a spot. She <b>denied</b> it. No, not apologised, but just you-must-be-mistaken. She then pointed to another table sitting empty. I told her I saw her move my plate to the other table and asked her where she'd learned her manners, and she returned the question. I then informed her that "were this England, I'll have you know that you'd be dead by now, just enjoy your meal knowing full well you lied to get the table, even when confronted with it". Why the hell doesn't this country have common decency?</p><p>For all the readers who feel I'm slagging off this country, I'm not. There are some really nice/polite/cultured people here. The ones that aren't, really get at my goat.</p>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/06/stupid-yanks-pt-261.html">here</a>
    </content>
</entry>

<entry>
    <title>How to test XPath</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/06/how-to-test-xpath.html" />
    <id>tag:hasandiwan.info,2010://1.269</id>

    <published>2010-06-21T02:04:15Z</published>
    <updated>2010-06-21T02:11:19Z</updated>

    <summary>While GArrow, on Lily may describe xPath as &quot;semi-casual&quot;, I think it is the most straightforward way to locate a node in XML. After the flip, I give code allowing one to test Xpath expressions out on XML documents. It...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="code" label="code" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="debugging" label="debugging" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="java" label="java" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="lily" label="lily" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="programming" label="Programming" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="testing" label="testing" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xml" label="xml" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xpath" label="xpath" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>While GArrow, on <a href="http://lily.org">Lily</a> may describe <a href="http://www.w3.org/TR/xpath/">xPath</a> as "semi-casual", I think it is the most straightforward way to locate a node in XML. After the flip, I give code allowing one to test Xpath expressions out on XML documents. It needs nothing beyond the <a href="http://java.sun.com/javase/6">JDK</a>, it will probably work with JDK 5, though I develop using JDK 6. You do need <a href="http://www.ibm.com/developerworks/library/x-javaxpathapi.html">Java's XPath support</a>.</p>]]>
        <![CDATA[<pre><code>
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
public class XPathTest {
  String vRate = null;
  public XPathTest() {
    HttpURLConnection urlConnection = null;
    try {
      urlConnection = (HttpURLConnection)new URL(System.getProperty("Location")).openConnection();
    } catch (java.net.MalformedURLException e) {
      System.err.println("URL incorrect!");
    } catch (java.io.IOException e) {
      System.err.println("IOException!");
    }    
    InputStream is = null;
    try {
      is = urlConnection.getInputStream();
    } catch (java.io.IOException e) {
      System.err.println("IOException!");
    }
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    DocumentBuilder builder = null;
    try {
      builder = dbf.newDocumentBuilder();
    } catch (javax.xml.parsers.ParserConfigurationException e) {
      System.err.println("parser misconfigured!");
    }
    Document  document = null;
    try {
      document = builder.parse(is);
    } catch (org.xml.sax.SAXException e) {
      System.err.println(e.getMessage());
    } catch (java.io.IOException e) {
      System.err.println("IOException when building document");
    } 
      XPathFactory xpathFactory = XPathFactory.newInstance();
      XPath xPath = xpathFactory.newXPath();
      XPathExpression xpathExpr = null;
      try {
	xpathExpr = xPath.compile(System.getProperty("Expression"));
      } catch (javax.xml.xpath.XPathExpressionException e) {
	System.err.println("compilation error!");
      }
      NodeList list = null;
      try {
	list = (NodeList)xpathExpr.evaluate(document,XPathConstants.NODESET);
      } catch (javax.xml.xpath.XPathExpressionException e) {
	System.err.println(e.getMessage());
	e.printStackTrace(System.err);
      }
      vRate = "{";
      for (int i = 0; i != list.getLength(); i++) {
	vRate += ","+list.item(i).getTextContent();
      }
      vRate +="}";
  }
  public String toString() {
    return vRate;
  }
  public static void main (String[] args) {

      if (System.getProperty("Location") == null) 
	System.setProperty("Location", args[0]);
      if (System.getProperty("Expression") == null)
	System.setProperty("Expression", args[1]);

    XPathTest x = new XPathTest();
    System.err.println(x);
  } 
}</code></pre>]]>
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/06/how-to-test-xpath.html">here</a>
    </content>
</entry>

<entry>
    <title>How to Outsource Your Memory</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/06/how-to-outsource-your-memory.html" />
    <id>tag:hasandiwan.info,2010://1.268</id>

    <published>2010-06-14T18:41:23Z</published>
    <updated>2010-06-14T18:57:38Z</updated>

    <summary>I was talking to Saad the other day, berating him for not making detailed checklists for everything like I do. I also told him that I&apos;d put up my package for doing so on my weblog. So, without further ado...I...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="checklist" label="checklist" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jython" label="Jython" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="productivity" label="Productivity" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="saaddada" label="saad dada" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="taskmanagement" label="Task Management" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>I was talking to <a href="http://knightrocker.blogspot.com">Saad</a> the other day, berating him for not making <a href="http://prolificprogrammer.com/~hdiwan/checklist.py">detailed checklists for everything</a> like I do. I also told him that I'd put up my package for doing so on my weblog. So, without further ado...</p><p>I await your next excuse, Saad. ;)</p>]]>
        <![CDATA[<code><pre>
from java.awt.event import ActionListener
class Example(ActionListener):
    def __init__(self):
        from javax.swing import JFrame, JTable, JScrollPane, JPanel, WindowConstants
        from javax.swing.table import DefaultTableModel
        from java.awt import BorderLayout, Dimension
        frame = JFrame("Checklist")
        frame.setLayout(BorderLayout())
        try:
            import pickle
            self.tableData = pickle.load(open('checklst.dat', 'r'))
        except:
            self.tableData = [[False, '']]
        colNames = ('Completed?','Task (Click "+" to add, "-" to mark completed (and remove from the task list)')
        from javax.swing.table import DefaultTableModel
        dataModel = DefaultTableModel(self.tableData, colNames)
        self.table = JTable(dataModel)
        from javax.swing import JButton
        addbtn=JButton('+')
        addbtn.addActionListener(self)

        rmbtn= JButton('Complete')
        rmbtn.addActionListener(self)
        
        scrollPane = JScrollPane()
        scrollPane.getViewport().setView((self.table))

        panel = JPanel()
        panel.add(scrollPane)

        btnPanel = JPanel()
        from javax.swing import BoxLayout
        btnPanel.setLayout(BoxLayout(btnPanel, BoxLayout.X_AXIS))
        btnPanel.add(addbtn)
        btnPanel.add(rmbtn)
        frame.add(panel, BorderLayout.CENTER)
        frame.add(btnPanel, BorderLayout.SOUTH)
        frame.pack()
        frame.defaultCloseOperation=WindowConstants.EXIT_ON_CLOSE
        frame.setVisible(True)
        self.frame = frame

    def actionPerformed(self, evt):
        if evt.source.text == '+':
            self.table.model.addRow((False, ''))
            from java.io import FileOutputStream,ObjectOutputStream
            oos = ObjectOutputStream(FileOutputStream('checklst.dat'))
            oos.writeObject(self.tableData)
        elif evt.source.text == 'Complete' and self.table.selectedRow != -1:
            self.table.model.removeRow(self.table.selectedRow)

if __name__ == '__main__':
        Example()
</pre></code>]]>
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/06/how-to-outsource-your-memory.html">here</a>
    </content>
</entry>

<entry>
    <title>How to Monitor a Database Query</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/06/how-to-monitor-a-database-query.html" />
    <id>tag:hasandiwan.info,2010://1.267</id>

    <published>2010-06-06T23:46:45Z</published>
    <updated>2010-06-07T02:26:18Z</updated>

    <summary>Recently, I was testing some code tha took a bloody long time to execute and return. I like to be updated as it runs to make sure that my JVM hasn&apos;t frozen. I knew about AppKit&apos;s NSProgressIndicator and a lot...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="database" label="Database" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="databasemanagementsystem" label="Database management system" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="developmenttools" label="Development Tools" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gmail" label="Gmail" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="javasoftwareplatform" label="Java (software platform)" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="javadevelopmentkit" label="Java Development Kit" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="javavirtualmachine" label="Java Virtual Machine" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jdbc" label="jdbc" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jprogessbar" label="JProgessBar" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jquery" label="JQuery" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="languages" label="Languages" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="next" label="NeXT" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="opensource" label="Open source" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="oracledatabase" label="Oracle Database" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="postgresql" label="postgresql" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="programming" label="Programming" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="progress" label="Progress" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="relationaldatabase" label="Relational database" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sql" label="SQL" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>Recently, I was testing some code tha took a <i>bloody long time</i> to execute and return. I like to be updated as it runs to make sure that my JVM hasn't frozen. I knew about AppKit's NSProgressIndicator and a lot of the team from NeXT went over to Sun, after the former went under, so I looked down the humongous <a href="http://java.sun.com/javase/6/docs/api/allclasses-frame.html">list of classes in the JDK</a>, to find <a href="http://java.sun.com/javase/6/docs/api/javax/swing/JProgressBar.html">JProgressBar</a>. Another couple of hours of hacking and I came up with the code after the flip.</p>


<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/b7fa9008-ecba-4b72-92d7-7b724c22f7ab/" title="Reblog this post [with Zemanta]"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=b7fa9008-ecba-4b72-92d7-7b724c22f7ab" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>]]>
        <![CDATA[<code></code><pre>	public void showProgress(ResultSet databaseTags) throws SQLException {
		if (databaseTags.getType() == ResultSet.TYPE_FORWARD_ONLY) {
			throw new TypeException(
					"resultSet not scrollable, only scrollable resultsets may show progress");
		}
		JFrame progressFrame = new JFrame(databaseTags.getStatement()
				.toString());
		progressFrame.setAlwaysOnTop(true);
		progress = null;
		databaseTags.last();
		System.setProperty("progressbar.maxvalue",
				new Integer(databaseTags.getRow()).toString());
		progress = new JProgressBar(0, databaseTags.getRow());
		progress.setStringPainted(true);
		databaseTags.first();
		progressFrame.pack();
		progressFrame.setVisible(true);
	}
</pre>

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/b7fa9008-ecba-4b72-92d7-7b724c22f7ab/" title="Reblog this post [with Zemanta]"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=b7fa9008-ecba-4b72-92d7-7b724c22f7ab" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>]]>
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/06/how-to-monitor-a-database-query.html">here</a>
    </content>
</entry>

<entry>
    <title>How to understand TLAs in the Financial World</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/06/how-to-understand-tlas-in-the-financial-world.html" />
    <id>tag:hasandiwan.info,2010://1.266</id>

    <published>2010-06-06T17:00:29Z</published>
    <updated>2010-06-06T17:16:59Z</updated>

    <summary>There are many TLA (Three Letter Acronyms) in the world of high finance. This post will attempt to explain a few of them. First off, if the acronym isn&apos;t listed here and the context suggests the piece is dealing with...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="business" label="Business" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="california" label="California" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="creditdefaultswap" label="Credit default swap" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="financialservices" label="Financial services" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="investing" label="Investing" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="newyorkstockexchange" label="New York Stock Exchange" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="stock" label="Stock" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tickersymbol" label="Ticker symbol" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>There are many <a class="zem_slink" href="http://en.wikipedia.org/wiki/Three-letter_acronym" title="Three-letter acronym" rel="wikipedia">TLA</a> (Three Letter Acronyms) in the world of high <a class="zem_slink" href="http://en.wikipedia.org/wiki/Finance" title="Finance" rel="wikipedia">finance</a>. This post will attempt to explain a few of them. First off, if the <a class="zem_slink" href="http://en.wikipedia.org/wiki/Acronym_and_initialism" title="Acronym and initialism" rel="wikipedia">acronym</a> isn't listed here and the context suggests the piece is dealing with <a class="zem_slink" href="http://en.wikipedia.org/wiki/Stock" title="Stock" rel="wikipedia">equities</a>, it's safe to assume that you're dealing with a <a class="zem_slink" href="http://en.wikipedia.org/wiki/Ticker_symbol" title="Ticker symbol" rel="wikipedia">stock symbol</a> (some of which don't make any sense, like <a href="http://www.google.com/url?q=/finance%3Fclient%3Dob%26q%3DNASDAQ:GOOD&amp;sa=X&amp;ei=0dQLTKOqJYKUMeDgtbYE&amp;ved=0CBwQ1wEoAA&amp;usg=AFQjCNGWdVx6tS5OE787lBlGm7DD3OaMRw">GOOD</a>, which corresponds to the <a href="http://www.gladstonecommercial.com/">Gladstone Commercial Investment Company</a>). Also, note that these <a href="http://ask.yahoo.com/20040721.html">symbols are self-selected</a>, making things even weirder. Unless indicated otherwise, 3 letter symbols are traded on the <a class="zem_slink" href="http://maps.google.com/maps?ll=40.7068333333,-74.0110277778&amp;spn=0.01,0.01&amp;q=40.7068333333,-74.0110277778%20%28New%20York%20Stock%20Exchange%29&amp;t=h" title="New York Stock Exchange" rel="geolocation">NYSE</a>, 4 or more are on <a class="zem_slink" href="http://en.wikipedia.org/wiki/Secondary_market" title="Secondary market" rel="wikipedia">secondary markets</a>.</p><p>Other important abbreviations you're likely to run across include the <a href="http://www.concurringopinions.com/archives/2010/01/a-new-year%E2%80%99s-regulation.html">now infamous credit default swap</a> (CDS), which, in summary, is purchasing insurance against a bond defaulting, as happened <a href="http://www.ci.vallejo.ca.us/GovSite/default.asp?serviceID1=712&amp;Frame=L1">to Vallejo, California</a>. For a more detailed explanation, refer to <a href="http://law.shu.edu/Faculty/display-profile.cfm?customel_datapageid_4018=21114">Dr. Johnson</a>s more <a href="http://www.concurringopinions.com/archives/2010/01/a-new-year%E2%80%99s-regulation.html">detailed explanation</a> on <a href="http://www.concurringopinions.com/">Concurring Opinions</a>. There are other financial abbreviations that I don't yet understand and some I don't have at the tips of my fingers, so if you encounter one, please leave it in the comments, I will see if I can dig up some more about it and email you with the response along with posting it here.</p>

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/3530917d-7b91-496b-b483-dd2865f59d22/" title="Reblog this post [with Zemanta]"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=3530917d-7b91-496b-b483-dd2865f59d22" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/06/how-to-understand-tlas-in-the-financial-world.html">here</a>
    </content>
</entry>

<entry>
    <title>Reminder Now Logs to File</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/06/reminder-now-logs-to-file.html" />
    <id>tag:hasandiwan.info,2010://1.265</id>

    <published>2010-06-01T23:24:59Z</published>
    <updated>2010-06-01T23:50:54Z</updated>

    <summary>This morning, my laptop crashed, with no less than 30 Reminder threads (a thread being one window with one message) open. Had I not recorded them elsewhere, I&apos;d have been lost. So I added a message logger to it and...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="commandprompt" label="Command Prompt" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="distributedreminder" label="Distributed Reminder" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="faqshelpandtutorials" label="FAQs Help and Tutorials" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="homedirectory" label="Home directory" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="java" label="Java" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="languages" label="Languages" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="messagepassing" label="message passing" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="reminder" label="Reminder" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="usercomputing" label="User (computing)" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<p>This morning, my laptop crashed, with no less than <b>30</b> <a href="http://prolificprogrammer.com/%7Ehdiwan/Reminder.jar">Reminder</a> threads (a thread being one window with one message) open. Had I not recorded them elsewhere, I'd have been lost. So I added a message logger to it and put forth a new iteration. The file it logs to is "msgs.out" in the user's <a class="zem_slink" href="http://en.wikipedia.org/wiki/Home_directory" title="Home directory" rel="wikipedia">home directory</a> (corresponding to the "user.dir" <a href="http://java.sun.com/javase/6/docs/api/java/lang/System.html">System</a> property, available on all platforms).</p>

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/43fca8b6-fce5-4bb9-a0f1-035ee155e79e/" title="Reblog this post [with Zemanta]"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=43fca8b6-fce5-4bb9-a0f1-035ee155e79e" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/06/reminder-now-logs-to-file.html">here</a>
    </content>
</entry>

<entry>
    <title>More Hypocricy from the Über Patriots</title>
    <link rel="alternate" type="text/html" href="http://hasandiwan.info/2010/05/more-hypocricy-from-the-uber-patriots.html" />
    <id>tag:hasandiwan.info,2010://1.264</id>

    <published>2010-05-30T03:15:23Z</published>
    <updated>2010-05-30T03:59:59Z</updated>

    <summary>Plot of coalition deaths vis a vis hometownThere&apos;s a well-known study that finds that people often vote against their self-interests: the most liberal state in the United States is California, which contributes that most to the Treasury, the most conservative...</summary>
    <author>
        <name>Hasan Diwan</name>
        
    </author>
    
    <category term="california" label="California" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="conservatism" label="Conservatism" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="government" label="Government" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="militaryservice" label="Military service" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="parties" label="Parties" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="politics" label="Politics" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="republican" label="Republican" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sarahpalin" label="Sarah Palin" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="unitedstates" label="United States" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="utah" label="Utah" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://hasandiwan.info/">
        <![CDATA[<center><table><caption>Plot of coalition deaths vis a vis hometown</caption><tbody><tr><td><img src="http://flowingdata.com/wp-content/uploads/yapb_cache/casualities.1jok9lqjbt40g48s0ks8k4gcw.hcjovh1zwfksw0kw4skcow8g.th.png"></td></tr></tbody></table></center><p>There's a well-known study that finds that people often vote against their self-interests: the most liberal state in the United States is California, which contributes that most to the <a href="http://www.treasury.gov">Treasury</a>, the most <a class="zem_slink" href="http://en.wikipedia.org/wiki/Conservatism" title="Conservatism" rel="wikipedia">conservative</a> is <a class="zem_slink" href="http://maps.google.com/maps?ll=39.5,-111.5&amp;spn=3.0,3.0&amp;q=39.5,-111.5%20%28Utah%29&amp;t=h" title="Utah" rel="geolocation">Utah</a>, which receives a great deal more money from the <a class="zem_slink" href="http://en.wikipedia.org/wiki/Government" title="Government" rel="wikipedia">government</a> than it sends. <a class="zem_slink" href="http://en.wikipedia.org/wiki/Divorce" title="Divorce" rel="wikipedia">Divorce</a> and rates are higher in those states whose representatives whinge about <a class="zem_slink" href="http://en.wikipedia.org/wiki/Family_values" title="Family values" rel="wikipedia">family values</a>. This applies equally to those who prattle on about <a class="zem_slink" href="http://en.wikipedia.org/wiki/Military_service" title="Military service" rel="wikipedia">military service</a>. Which brings me to the map above, the blank space in the left-centre part of the map contains Utah. Note, there are no deaths there. A bit further to the left is coastal <a class="zem_slink" href="http://maps.google.com/maps?ll=37.0,-120.0&amp;spn=10.0,10.0&amp;q=37.0,-120.0%20%28California%29&amp;t=h" title="California" rel="geolocation">California</a>, notice there are more circles there.</p><p>So, hypocrites of the <a class="zem_slink" href="http://maps.google.com/maps?ll=38.8833333333,-77.0166666667&amp;spn=10.0,10.0&amp;q=38.8833333333,-77.0166666667%20%28United%20States%29&amp;t=h" title="United States" rel="geolocation">United States</a>, unite and vote for <a class="zem_slink" href="http://www.sarahpac.com/" title="Sarah Palin" rel="homepage">Sarah Palin</a>, your TEA party, and against your own best interest, hopefully there are enough rational people to see through your hypocricy.</p>

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/b348261f-4329-478c-a685-b429149bef5c/" title="Reblog this post [with Zemanta]"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=b348261f-4329-478c-a685-b429149bef5c" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>]]>
        
<br/>Kindly leave a comment <a href="http://hasandiwan.info/2010/05/more-hypocricy-from-the-uber-patriots.html">here</a>
    </content>
</entry>

</feed>
