<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Samat Jain's personal home page</title>
  <link rel="alternate" type="text/html" href="http://samat.org"/>
  <link rel="self" type="application/atom+xml" href="http://samat.org/atom.xml"/>
  <id>http://samat.org/atom.xml</id>
  <updated>2008-10-13T00:19:42-06:00</updated>
  <entry>
    <title>New Mexico, slowest Internet in the union</title>
    <link rel="alternate" type="text/html" href="http://samat.org/weblog/20081202-new-mexico-slowest-internet-in-the-union.html" />
    <id>http://samat.org/weblog/20081202-new-mexico-slowest-internet-in-the-union.html</id>
    <published>2008-12-02T21:28:20-07:00</published>
    <updated>2008-12-02T21:28:20-07:00</updated>
    <author>
      <name>Samat Jain</name>
    </author>
    <category term="Politics" />
    <category term="Reflection" />
    <summary type="html"><![CDATA[<p>PCMag has <a href="http://www.pcmag.com/article2/0,2817,2335749,00.asp">ranked states according to average Internet speeds</a> (via <a href="http://gigaom.com/2008/12/02/pcmagcom-rankings-shame-nations-isps/">GigaOM</a>). <a href="http://www.pcmag.com/article2/0,2817,2335754,00.asp">New Mexico came in last</a>. I can attest to this... my Internet connection in Las Cruces is a crazy fast 144 Kbps IDSL connection, which costs over $120/month. And it's been the best land-line Internet access I could get for the past 3 years.</p>

<p>Is there a correlation with <a href="http://www.people.vcu.edu/~mamcdani/Publications/McDaniel%20(2006)%20Estimating%20state%20IQ.pdf">New Mexico being one of the dumbest states</a> (at 95.7, rank 46 of 50) with regards to IQ? One has to think about these things...</p>
    ]]></summary>
  </entry>
  <entry>
    <title>Adobe releases pre-release Flash 10 for 64-bit Linux</title>
    <link rel="alternate" type="text/html" href="http://samat.org/weblog/20081117-adobe-releases-pre-release-flash-10-64-bit-linux.html" />
    <id>http://samat.org/weblog/20081117-adobe-releases-pre-release-flash-10-64-bit-linux.html</id>
    <published>2008-11-17T05:23:44-07:00</published>
    <updated>2008-11-26T14:42:29-07:00</updated>
    <author>
      <name>Samat Jain</name>
    </author>
    <category term="Corporations" />
    <category term="Linux" />
    <category term="Web link" />
    <summary type="html"><![CDATA[<p>Today, <a href="http://blogs.adobe.com/penguin.swf/2008/11/now_supporting_16_exabytes.html">Adobe released 64-bit Flash for Linux</a>. Finally, I can waste time watching ugly, pixelated Internet video on my 64-bit Linux desktop and laptop, just like all of my 32-bit-confined brothers and sisters on the Internet! (Yes, I know about npviewer---let's not go there.)</p>

<p>What's really interesting is that this is Adobe's first 64-bit release of Flash. That is, Linux users got it first, before users of Windows Vista x64 and and MacOS X. It probably does not mean anything, especially since Adobe has mentioned <a href="http://labs.adobe.com/technologies/flashplayer10/faq.html#flashplayer10FAQ_64-bit03">64-bit flash will be released at the same time across platforms</a>, but you can't help but feel good inside.</p>

<p>Go <a href="http://labs.adobe.com/downloads/flashplayer10.html">download it now</a> and remember to <a href="https://bugs.adobe.com/flashplayer/">report good bugs</a>.</p>

<p><strong>Update:</strong> Some quick notes...</p>

<ul>
<li>The tarball provided on the labs website is not the conventional Adobe Flash installer--it just contains the plugin. To use the plugin, drop the .so file into your ~/.mozilla/plugins/ directory.</li>
<li>Make sure to uninstall your npviewer-powered 32-bit Flash completely (disabling the plugin within Firefox is not enough). I personally uninstalled it from my system to prevent any conflict.</li>
</ul>
    ]]></summary>
  </entry>
  <entry>
    <title>Creating your own personal aspell dictionary</title>
    <link rel="alternate" type="text/html" href="http://samat.org/weblog/20081102-creating-your-own-personal-aspell-dictionary.html" />
    <id>http://samat.org/weblog/20081102-creating-your-own-personal-aspell-dictionary.html</id>
    <published>2008-11-02T16:23:44-07:00</published>
    <updated>2008-11-03T04:41:35-07:00</updated>
    <author>
      <name>Samat Jain</name>
    </author>
    <category term="Article" />
    <category term="Linux" />
    <category term="Software" />
    <summary type="html"><![CDATA[<p>Something that has bothered me forever is that applications that use <a href="http://aspell.net/">GNU aspell</a> for spell checking kept marking my name as a misspelling (I'm looking at you, KMail). Most front-end applications don't provide a way for you to add your own custom words.</p>

<p>Apparently, <a href="http://aspell.net/man-html/Format-of-the-Personal-and-Replacement-Dictionaries.html#Format-of-the-Personal-and-Replacement-Dictionaries">creating your own personal dictionary is ridiculous easy with aspell</a>.</p>

<p>If your language is English, create a file in your home directory called ".aspell.en.pws":</p>

<div class="codeblock"><code>personal_ws-1.1 en 0&lt;br /&gt;Samat&lt;br /&gt;quasirhombicosidodecahedron</code></div>

<p>The first line is a required header. Every subsequent line is a word you want to add to your dictionary. I can't believe I've let this sit for so long. Because it's a nice text file, syncing this file between machines to take your dictionary with you is trivially easy.</p>
    ]]></summary>
  </entry>
  <entry>
    <title>Taking Drupal sites offline via mysql and the command line</title>
    <link rel="alternate" type="text/html" href="http://samat.org/weblog/20081031-taking-drupal-site-offline-mysql-and-command-line.html" />
    <id>http://samat.org/weblog/20081031-taking-drupal-site-offline-mysql-and-command-line.html</id>
    <published>2008-10-31T23:42:10-06:00</published>
    <updated>2008-11-26T14:43:41-07:00</updated>
    <author>
      <name>Samat Jain</name>
    </author>
    <category term="Article" />
    <category term="Bash Shell" />
    <category term="Drupal" />
    <category term="Linux" />
    <summary type="html"><![CDATA[<p>Drupal-powered websites can be put into an "offline mode." This is much better than most alternatives (such as taking the web server offline), especially for search engines, as the message and HTTP status codes given to users and robots alike will tell them to patiently come back later.</p>

<p>I've found that putting the site into offline mode makes database backups go much faster on heavily trafficked sites (which is obvious). However, for a particular site I was working with, this needed to be done in an automated manner, and on a dedicated database server that did not have access to the Drupal installation.</p>

<p>Most people take their Drupal sites offline through Drupal's web-based administration interface. They can also be put offline through the <a href="http://drupal.org/project/drush">Drupal Shell</a>. Neither were suitable for me: the former cannot be automated easily, and the latter requires access to the Drupal installation. Fortunately, Drupal sites can easily be taken offline by setting things in the database, which can easily be done via bash scripts and the command-line MySQL client.</p>

<p>Given your database user is <i>my_db_user</i>, password <i>my_password</i>, and database <i>my_drupal_db</i>, the backup script would look something similar to:</p>

<div class="codeblock"><code>#!/bin/bash&lt;br /&gt;&lt;br /&gt;# Take site offline&lt;br /&gt;mysql --user my_db_user --password=my_password my_drupal_db &amp;lt;&amp;lt; EOF&lt;br /&gt;UPDATE variable SET value=&amp;#039;s:1:&amp;quot;1&amp;quot;;&amp;#039; WHERE name = &amp;#039;site_offline&amp;#039;;&lt;br /&gt;DELETE FROM cache WHERE CID = &amp;#039;variables&amp;#039;;&lt;br /&gt;EOF&lt;br /&gt;&lt;br /&gt;# Do stuff here while the site is offline (e.g. backup)&lt;br /&gt;&lt;br /&gt;# Bring site online&lt;br /&gt;mysql --user my_db_user --password=my_password my_drupal_db &amp;lt;&amp;lt; EOF&lt;br /&gt;UPDATE variable SET value=&amp;#039;s:1:&amp;quot;0&amp;quot;;&amp;#039; WHERE name = &amp;#039;site_offline&amp;#039;;&lt;br /&gt;DELETE FROM cache WHERE CID = &amp;#039;variables&amp;#039;;&lt;br /&gt;EOF</code></div>

<p><strong>Update:</strong> The original version of this article had some problems on some setups with the variables table being cached. I added another SQL statement to make sure this cache is flushed so the site actually reflects its configuration.</p>

<p><strong>Update:</strong> This method really doesn't work that well, and the more I think about it, there isn't a way to get around writing something that interacts with Drupal. I'm working on a script that will be more fool-proof.</p>
    ]]></summary>
  </entry>
  <entry>
    <title>Python-like tuple unpacking for PHP</title>
    <link rel="alternate" type="text/html" href="http://samat.org/weblog/20081029-python-tuple-unpacking-php.html" />
    <id>http://samat.org/weblog/20081029-python-tuple-unpacking-php.html</id>
    <published>2008-10-29T15:55:47-06:00</published>
    <updated>2008-11-01T02:30:56-06:00</updated>
    <author>
      <name>Samat Jain</name>
    </author>
    <category term="Article" />
    <category term="PHP" />
    <category term="Programming" />
    <category term="Python" />
    <summary type="html"><![CDATA[<p>Python provides a neat way for functions to return multiple arguments via "tuple unpacking". For example:</p>

<div class="codeblock"><code>def blah:&lt;br /&gt;&amp;nbsp; return (&amp;#039;one&amp;#039;, &amp;#039;two&amp;#039;)&lt;br /&gt;&lt;br /&gt;rval_1, rval_2 = blah()</code></div>

<p>The same can be done in PHP relatively easily via the <a href="http://php.net/list">list construct</a>:</p>

<div class="codeblock"><code>function blah()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; return array(&amp;#039;one&amp;#039;, &amp;#039;two&amp;#039;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;list($rval_1, $rval_2) = blah();</code></div>
    ]]></summary>
  </entry>
  <entry>
    <title>Starbucks Gold Card</title>
    <link rel="alternate" type="text/html" href="http://samat.org/weblog/20081014-starbucks-gold-card.html" />
    <id>http://samat.org/weblog/20081014-starbucks-gold-card.html</id>
    <published>2008-10-14T23:15:04-06:00</published>
    <updated>2008-11-26T14:47:03-07:00</updated>
    <author>
      <name>Samat Jain</name>
    </author>
    <category term="Announcement" />
    <category term="Corporations" />
    <category term="Food" />
    <summary type="html"><![CDATA[<div style="float: right; padding: 0 0 0.5em 0.5em"><a href="http://www.flickr.com/photos/tamasrepus/2943019511" title="Starbucks Gold Card"><img src="http://farm4.static.flickr.com/3024/2943019511_a4a26aa515_m.jpg" alt="Starbucks Gold Card" title="Starbucks Gold Card"  class=" flickr-photo-img" height="180" width="240" /></a></div>

<p>This summer I fell in love with Starbuck's Vivanno, their high-protein, high-fiber smoothie beverage. My signature drink: a banana-chocolate Vivanno, one espresso shot, with non-fat milk. Because I was going there so often, and because the new Starbucks and AT&amp;T partnership gave 2 hours free WiFi a day, I started buying things through a free Starbucks Card (essentially a prepaid, reloadable gift card).</p>

<p>Apparently, I went to Starbucks more than I thought. A few weeks ago, Starbucks invited me to be part of their <a href="http://www.starbucks.com/Gold/">Starbucks Gold program</a>. The program provides a special card, which is quite pretty: the back is standard glossy card fare, but the front is a black matte with gold embossed logo.</p>

<p>Starbucks started this program earlier this summer, and they've been tweaking the benefits. The benefits my card comes with (as says the flyer that came with it):</p>

<ul>
<li>10% off most purchases</li>
<li>Coffeehouse rewards, including special discounts on family and friend days</li>
<li>Surprise indulgences, like treats on my birthday</li>
<li>Members-only website and insider promotions</li>
</ul>

<p>Unfortunately, this comes at a price. <del>It has a membership fee of $25/yr</del>--only the hardcore Starbucks coffee drinkers (which isn't me) need apply. Also, supposedly, the card does not provide any of the Starbucks Card Rewards, <del>such as the free WiFi</del>, or free milk and syrup options. So far, I'm going to pass on the program, and continue using my old Starbucks Card. But I will keep the pretty-looking card.</p>

<p><strong>Correction:</strong> My beta invite entitles me to the Starbucks Gold membership for free. Funny this not indicated anywhere. Also, even though the fine print says Starbucks Card Rewards do not apply, the Starbucks Gold program portal implies that WiFi is an included reward, and it does appear to work...</p>

<p><strong>Update:</strong> Now that the Starbucks Gold membership has officially launched for the general public, you can get a description of the benefits in-store. With the Starbucks Gold card, you do not get all the Starbucks Card Rewards--that is, no free syrups, milk or whipped cream, refills on drip coffee, or free tall drink with purchase of whole bean coffee. However, as I mentioned, you do get WiFi.</p>
    ]]></summary>
  </entry>
  <entry>
    <title>Amarok 2 uses MySQL embedded as a metadata store</title>
    <link rel="alternate" type="text/html" href="http://samat.org/weblog/20081013-amarok-2-uses-mysql-embedded-metadata-store.html" />
    <id>http://samat.org/weblog/20081013-amarok-2-uses-mysql-embedded-metadata-store.html</id>
    <published>2008-10-13T00:16:25-06:00</published>
    <updated>2008-10-13T00:19:42-06:00</updated>
    <author>
      <name>Samat Jain</name>
    </author>
    <category term="KDE" />
    <category term="Linux" />
    <category term="Opinion" />
    <category term="Software" />
    <summary type="html"><![CDATA[<p>There's been a bit of turmoil in the Amarok and KDE communities the past week with Amarok's decision to only support MySQL Embedded in Amarok 2. Jeff Mitchell has written about the <a href="http://amarok.kde.org/blog/archives/812-MySQL-in-Amarok-2-The-Reality.html#extended">Amarok design decisions made</a>.</p>

<p>I'm a little bothered by this, as it forgeos all the "semantic desktop" work that has gone into KDE 4, namely what's provided by the <a href="http://strigi.sourceforge.net/">Strigi</a> and <a href="http://nepomuk.semanticdesktop.org/">Nepomuk</a> libraries. One thing the whole semantic desktop concept entails is that other applications will be able use data another application stored, but without care to what that other application was or how it was stored. For example, I should be able to share the list of all tracks in my music library, how many times I've played tracks, what tracks I think are my favorite, etc across music players. This kind of abstraction is, obviously, good for users, but bad for developers of proprietary software. They don't want you to easily switch between applications that they do not control. Amarok switching to it's own database store is a stab at this kind of desktop interoperability. I've my own thoughts to add, though, that support what the developers are doing...</p>

<p><a href="http://amarok.kde.org/">Amarok</a> is an awesome application. Dare I say, it's a <em>killer</em> application on Linux---on several occasions this past year I've recommended people install Linux just so that they could play with Amarok and see how much better it is compared to what they were using (yes, I'm looking at you, iTunes).</p>

<p>Before Amarok, I used <a href="http://musicpd.org/">Music Player Daemon (mpd)</a>. I stopped using it after a while: the playlist management wasn't very good; it would eat those playlists that I spent a lot of effort to make; the GUIs available at the time were lacking; and it was very slow when working with tens of thousands of songs. Some of this may have changed but I've not been motivated to look back.</p>

<p>Enter Amarok: I switched because the playlist management was so much better. I setup a MySQL server on my workstation to store metadata, as SQLite was much too slow. Amarok backed with MySQL is very fast---I dare others to find a library-based music manager that is faster with the number of songs I've thrown at it.</p>

<p>Balancing desktop interoperability with performance is a delicate balancing act. Interoperability is the hot thing these days---look at how Apple's line of integrated software and hardware continue to sip market share from the Microsoft-powered desktop. But when it comes down to it, performance and other more perceived benefits are going to win out over desktop interoperability. The Amarok developers' decision to go with MySQL embedded is a good one that will hopefully keep people moving to Amarok over proprietary alternatives.</p>
    ]]></summary>
  </entry>
</feed>
