<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ali Shabdar</title>
	<atom:link href="http://www.alishabdar.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alishabdar.com</link>
	<description>on technology, information, and process</description>
	<lastBuildDate>Sun, 12 May 2013 18:37:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Renaming files in bulk with Excel</title>
		<link>http://www.alishabdar.com/2013/02/10/renaming-files-in-bulk-with-excel/</link>
		<comments>http://www.alishabdar.com/2013/02/10/renaming-files-in-bulk-with-excel/#comments</comments>
		<pubDate>Mon, 11 Feb 2013 01:27:13 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[records]]></category>
		<category><![CDATA[vba]]></category>

		<guid isPermaLink="false">http://www.alishabdar.com/?p=894</guid>
		<description><![CDATA[So you have a bunch of files (read thousands) that you need to rename. If you deal with documents/records in the workplace and you don’t have access to fancy EDRMS, EDMS, then you most probably resort to physical files (Word, PDF, etc.) on shared drives and some in-house classification systems. In a real case scenario (where I work as a [...]]]></description>
				<content:encoded><![CDATA[<p>So you have a bunch of files (read thousands) that you need to rename. If you deal with documents/records in the workplace and you don’t have access to fancy <a href="http://en.wikipedia.org/wiki/Electronic_Document_and_Records_Management_System" target="_blank">EDRMS</a>, <a href="http://en.wikipedia.org/wiki/Document_management_system" target="_blank">EDMS</a>, then you most probably resort to physical files (Word, PDF, etc.) on shared drives and some in-house classification systems.</p>
<p>In a real case scenario (where I work as a contractor) the team was implementing a new document naming convention, meaning that we needed to rename all the existing documents. And I don’t take “manually” as an answer.</p>
<p><strong>Solution:</strong></p>
<p><a href="http://office.microsoft.com/en-ca/excel/" target="_blank">Excel</a> is the corporate user’s best friend and in this example we’ll be using it to solve our problem.</p>
<p>1) Similar to this screenshot, in a spreadsheet list the documents you need to rename.</p>
<p><a href="http://www.alishabdar.com/wp-content/uploads/2013/03/excel.png"><img class="aligncenter size-full wp-image-895" alt="excel" src="http://www.alishabdar.com/wp-content/uploads/2013/03/excel.png" width="500" height="87" /></a></p>
<p>&nbsp;</p>
<p>Each row represents an existing document file. First column contains the current filename and the 2nd column is the new filename.</p>
<p>2) In the Macros window (in Excel) insert the following code:</p>
<script src="https://gist.github.com/4582250.js"></script><noscript><pre><code class="language-visual basic visual basic">Sub batch_rename()
    On Error GoTo errHndl
   
    Dim fso As New FileSystemObject
    Dim fld As Folder
    Dim sourcePath As String, destPath As String
    Dim sourceFile As String, destFile As String, sourceExtension As String
    Dim rng As Range, cell As Range, row As Range
   
    sourcePath = &quot;\path to old files\&quot;
    destPath = &quot;\path to new files\&quot;
    sourceFile = &quot;&quot;
    destFile = &quot;&quot;
    Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
    Set rng = ActiveSheet.Range(&quot;A2&quot;, &quot;B10&quot;)
 
    For Each row In rng.Rows
        sourceExtension = Split(Trim(row.Cells(, 2)), &quot;.&quot;)(1)
        sourceFile = sourcePath + Trim(row.Cells(, 2))
        destFile = destPath + Trim(row.Cells(, 1)) + &quot;.&quot; + sourceExtension
        fso.CopyFile sourceFile, destFile, False
    Next row
   
    MsgBox &quot;Yay! Operation was successful.&quot;, vbOKOnly + vbInformation, &quot;Done&quot;
    Exit Sub
 
errHndl:
    MsgBox &quot;Error happened while working on: &quot; + vbCrLf + _
        sourceFile + vbCrLf + vbCrLf + &quot;Error &quot; + _
        Str(Err.Number) + &quot;: &quot; + Err.Description, vbCritical + vbOKOnly, &quot;Error&quot;
 
End Sub</code></pre></noscript>
<p>3.1) Change the paths in lines 10 and 11 to match yours. You can use network addresses like<code>"\\network\path\"</code> too.</p>
<p>3.2) Change the cell range in line 15. The code currently copies and renames 10 files.</p>
<p>3.3) Make sure the source and destination paths in lines 10 and 11 of the code exist. Create them if they don’t.</p>
<p>4) Run the macro. depending on the number of rows included in the range it make take a few minutes for the macro to finish. You may want to remove/move the original files now.</p>
<p><strong>Note:</strong> If Excel crashed or stayed unresponsive for a long time, try smaller ranges.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alishabdar.com/2013/02/10/renaming-files-in-bulk-with-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Surface &#8211; A big name for a small device</title>
		<link>http://www.alishabdar.com/2012/06/18/microsoft-surface-a-big-name-for-a-small-device/</link>
		<comments>http://www.alishabdar.com/2012/06/18/microsoft-surface-a-big-name-for-a-small-device/#comments</comments>
		<pubDate>Tue, 19 Jun 2012 05:18:17 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Opinion]]></category>

		<guid isPermaLink="false">http://www.alishabdar.com/?p=857</guid>
		<description><![CDATA[Back in 2008 when Microsoft revealed Surface in CES, there was much excitement around what this Minority Report age device could bring to the market. Now after 4 years of hopeful waiting, Microsoft comes up with yet another post-PC device, the Surface Tablet. Choosing a second-hand name and renaming the old thing is itself a curious [...]]]></description>
				<content:encoded><![CDATA[<p>Back in 2008 when Microsoft revealed <a href="http://www.ohgizmo.com/2008/01/08/ces-2008-hands-on-with-microsoft-surface/">Surface</a> in CES, there was much excitement around what this <a href="http://www.imdb.com/title/tt0181689/">Minority Report</a> age device could bring to the market. Now after 4 years of hopeful waiting, Microsoft comes up with yet another post-PC device, the <a href="http://gigaom.com/mobile/microsoft-surface-a-new-tablet-and-a-bold-strategy/?utm_source=social&amp;utm_medium=twitter&amp;utm_campaign=gigaom">Surface Tablet</a>. Choosing a second-hand name and <a href="http://www.google.ca/search?q=PixelSense">renaming the old thing</a> is itself a curious matter.</p>
<p>I have to admit there is much to like about it, but it will need impressive <a href="http://en.wikipedia.org/wiki/Windows_8">Metro</a> apps to become actually worth buying is what makes the next year or so quite interesting for Microsoft. Remember Blackberry Playbook?</p>
<p>Thinking positively, there are tribes of superstar .NET developers and Microsoft might be able to take back what Apple stole in the enterprise market with the recent iPad fever among executives. Office, Sharepoint, Dynamics, and other Microsoft flagship business software could really help Surface to get momentum. The enterprise deserves a nice and fully functional tablet that offers more than merely glits.</p>
<p>On the other hand, with the radically new Metro UI and having already both users and developers scared enough, we should just wait and see if this whole new &#8220;Cool Microsoft&#8221; revolution will steal the show or will be another <a href="http://en.wikipedia.org/wiki/Windows_Vista#Criticism">Vista</a> fiasco.</p>
<p>Speaking of fiasco, <a href="http://gigaom.com/mobile/microsoft-surface-a-new-tablet-and-a-bold-strategy/?utm_source=social&amp;utm_medium=twitter&amp;utm_campaign=gigaom">Microsoft competing with other vendors</a>, could become an itchy situation between old friends who were buying the expensive and mostly underwhelming Windows OS for years.</p>
<p>At end of the day, I think the big dinosaur will survive. Microsoft looks at RIM as a cautionary tale (I hope). You can fail from trying too hard as much as you can fail from not trying at all (read RIM). I really hope that Microsoft pulls this one off successfully and get creative in their marketing department, who I suspect were hired from another galaxy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alishabdar.com/2012/06/18/microsoft-surface-a-big-name-for-a-small-device/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How NOT to group your checkboxes</title>
		<link>http://www.alishabdar.com/2012/06/01/bad-ui-how-not-to-group-checkboxes/</link>
		<comments>http://www.alishabdar.com/2012/06/01/bad-ui-how-not-to-group-checkboxes/#comments</comments>
		<pubDate>Fri, 01 Jun 2012 19:40:58 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[UI & UX]]></category>

		<guid isPermaLink="false">http://www.alishabdar.com/?p=860</guid>
		<description><![CDATA[Here is to not making it clear for the user if you&#8217;re hiding an option on purpose or you&#8217;re just being lazy. Based on the title, by checking &#8220;Global Unsubscribe&#8221; I actually want to receive &#8220;Global Unsubscribe&#8221;.]]></description>
				<content:encoded><![CDATA[<div id="attachment_862" class="wp-caption aligncenter" style="width: 416px"><a href="http://www.alishabdar.com/wp-content/uploads/2012/06/kofax1.png"><img class=" wp-image-862 " title="bad UI" src="http://www.alishabdar.com/wp-content/uploads/2012/06/kofax1.png" alt="" width="406" height="363" /></a><p class="wp-caption-text">&#8220;Global Unsubscribe&#8221; shouldn&#8217;t be grouped with the others.</p></div>
<p>Here is to not making it clear for the user if you&#8217;re hiding an option on purpose or you&#8217;re just being lazy.</p>
<p>Based on the title, by checking &#8220;Global Unsubscribe&#8221; I actually want to receive &#8220;Global Unsubscribe&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alishabdar.com/2012/06/01/bad-ui-how-not-to-group-checkboxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TreeMapping</title>
		<link>http://www.alishabdar.com/2011/12/17/treemapping/</link>
		<comments>http://www.alishabdar.com/2011/12/17/treemapping/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 08:33:07 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://alishabdar.com/2011/12/17/treemapping/</guid>
		<description><![CDATA[A recent school project got us excited to explore the idea of mapping the trees of city of Vancouver in a more practical way. My friends and I had a fruitful meeting today with @daeaves who has extensive information and experience in this subject. There is a tree mapping platform, OpenTreeMap, to start with. It [...]]]></description>
				<content:encoded><![CDATA[<p>A recent <a href="http://treetopia.tumblr.com/">school project</a> got us excited to explore the idea of mapping the trees of city of Vancouver in a more practical way. My friends and I had a fruitful meeting today with <a href="http://twitter.com/daeaves">@daeaves</a> who has extensive information and experience in this subject.</p>
<p>There is a tree mapping platform, <a href="https://github.com/azavea/OpenTreeMap">OpenTreeMap</a>, to start with. It seems to be a well maintained code, it&#8217;s on Python and needs Tomcat for the starters.</p>
<p>Now I have see if we can use it as the base or it&#8217;s cheaper to get something started from scratch in-house. We don&#8217;t need anything complicated for the first phase, but as usual we enjoy (very) limited resources including time.</p>
<p>David had good insight and useful suggestions that I need to consider too.</p>
<p>We&#8217;ll see.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alishabdar.com/2011/12/17/treemapping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playing with data structures in Ruby</title>
		<link>http://www.alishabdar.com/2011/11/17/playing-with-array-hash-in-ruby/</link>
		<comments>http://www.alishabdar.com/2011/11/17/playing-with-array-hash-in-ruby/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 00:45:15 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.alishabdar.com/?p=840</guid>
		<description><![CDATA[Sorting I&#8217;ve been trying to sort a mixed array in Ruby the shortest way. Each element of the array by itself is a mixed array of a number and and a hash: a = &#91; &#91;0, &#123;:a=&#62;&#34;31&#34;, :b=&#62;&#34;21&#34;&#125;&#93;, &#91;1, &#123;:a=&#62;&#34;32&#34;, :b=&#62;&#34;11&#34;&#125;&#93;, &#91;1, &#123;:a=&#62;&#34;25&#34;, :b=&#62;&#34;19&#34;&#125;&#93;, &#91;0, &#123;:a=&#62;&#34;12&#34;, :b=&#62;&#34;10&#34;&#125;&#93; &#93; &#160; #sort by first item of each row (number) [...]]]></description>
				<content:encoded><![CDATA[<h2>Sorting</h2>
<p>I&#8217;ve been trying to sort a mixed array in Ruby the shortest way. Each element of the array by itself is a mixed array of a number and and a hash:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">a = <span style="color:#006600; font-weight:bold;">&#91;</span>
  <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>:a<span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;31&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:b</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;21&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
  <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>:a<span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;32&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:b</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;11&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
  <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>:a<span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;25&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:b</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;19&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
  <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>:a<span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;12&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:b</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;10&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
<span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#sort by first item of each row (number)</span>
a.<span style="color:#9900CC;">sort</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x,y<span style="color:#006600; font-weight:bold;">|</span> x<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>  y<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#sort by the first item in the hash</span>
a.<span style="color:#9900CC;">sort</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x,y<span style="color:#006600; font-weight:bold;">|</span> x<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:a</span><span style="color:#006600; font-weight:bold;">&#93;</span>  y<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:a</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>Note: I initially posted this as a question on <a href="http://stackoverflow.com/questions/8160087/how-to-sort-a-mixed-array-by-different-elements-in-ruby" target="_blank">Stackoverflow</a> and got different but correct answers.</p>
<h2>Finding common elements</h2>
<p>To find common elements between a number of arrays, simply add them to a hash and use the <code>&amp;</code> operator, which creates a new array from two existing arrays containing only elements that are common to both arrays, omitting duplication. (See <a href="http://www.techotopia.com/index.php/Advanced_Ruby_Arrays" target="_blank">Techtopia</a>)</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="ruby" style="font-family:monospace;">a1 = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">2</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">3</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
a2 = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">2</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">4</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">3</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
a3 = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">1</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">2</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">3</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">2</span>, <span style="color:#006666;">2</span>, <span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
hash = <span style="color:#006600; font-weight:bold;">&#123;</span>i1: a1, i2: a2, i3: a3<span style="color:#006600; font-weight:bold;">&#125;</span>
common = hash.<span style="color:#9900CC;">values</span>.<span style="color:#9900CC;">inject</span><span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x, y<span style="color:#006600; font-weight:bold;">|</span> x <span style="color:#006600; font-weight:bold;">&amp;</span> y<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>What I can do with Ruby in just one line fascinates me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alishabdar.com/2011/11/17/playing-with-array-hash-in-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>We are launching CasaBonanza.com</title>
		<link>http://www.alishabdar.com/2011/10/16/we-are-launching-casabonanza-com/</link>
		<comments>http://www.alishabdar.com/2011/10/16/we-are-launching-casabonanza-com/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 06:10:47 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[CasaBonanza]]></category>

		<guid isPermaLink="false">http://www.alishabdar.com/?p=837</guid>
		<description><![CDATA[We are (softly) launching CasaBonanza.com tomorrow. After 3 months of work the first phase is finally ready for the Vancouverites. Stay tuned for more details.]]></description>
				<content:encoded><![CDATA[<p>We are (softly) launching CasaBonanza.com tomorrow.<br />
After 3 months of work the first phase is finally ready for the Vancouverites.</p>
<p>Stay tuned for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alishabdar.com/2011/10/16/we-are-launching-casabonanza-com/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Steve Jobs</title>
		<link>http://www.alishabdar.com/2011/10/05/steve-jobs/</link>
		<comments>http://www.alishabdar.com/2011/10/05/steve-jobs/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 15:37:36 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.alishabdar.com/?p=827</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.alishabdar.com/wp-content/uploads/2011/10/stevejobs.png"><img class="aligncenter size-large wp-image-828" title="Steve Jobs" src="http://www.alishabdar.com/wp-content/uploads/2011/10/stevejobs-1024x833.png" alt="" width="620" height="504" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alishabdar.com/2011/10/05/steve-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snow Leopard to Lion; The painless way</title>
		<link>http://www.alishabdar.com/2011/08/31/snow-leopard-to-lion-the-painless-way/</link>
		<comments>http://www.alishabdar.com/2011/08/31/snow-leopard-to-lion-the-painless-way/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 22:04:06 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Lion]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://www.alishabdar.com/?p=809</guid>
		<description><![CDATA[Conclusion first! Let me save you a few minutes (and perhaps hours of suffering on your Mac) and tell you the end of the story in the beginning. Upgrading has been always a tricky way of installing a new operating system. Granted it is smooth enough on a Mac but it comes with its own [...]]]></description>
				<content:encoded><![CDATA[<h3>Conclusion first!</h3>
<p>Let me save you a few minutes (and perhaps hours of suffering on your Mac) and tell you the end of the story in the beginning. Upgrading has been always a tricky way of installing a new operating system. Granted it is smooth enough on a Mac but it comes with its own cons, like wasted disk space and unused files here and there.</p>
<p>So backup your files, which you need to do anyway, and go for a fresh install. Don&#8217;t be lazy, it just needs one more hour of your time.</p>
<p>Here is how you do it:</p>
<p style="padding-left: 30px;">1. Go to Mac <em>App Store</em> (Run the application on your Mac)<br />
2. (Purchase and) download Mac OS X Lion. It&#8217;s a big file (almost 4GB), so refilling your coffee won&#8217;t hurt.<br />
3. Once the download is complete, open the <em>Applications</em> folder on your Mac and find <em>Install Mac OS 10 Lion</em> icon.<br />
4. Right-click on the file and select <em>Show Package Contents</em>.<br />
5. In the folder find <em>Contents/Shared Support/InstallESD.dmg</em>.<br />
6. Right-click on <em>InstallESD.dmg</em> and select <em>Open with &gt; Disk Utility</em>.<br />
7. Insert a blank DVD and click Burn on the toolbar. Another coffee or maybe even dinner will fill the void.<br />
8. Voila! You now have a bootable DVD of Mac OS X Lion.<br />
9. Boot the system with DVD in the drive while holding the Option key (that is, on your keyboard).<br />
10. After a few seconds you&#8217;ll be presented with 2 icons on the display, a hard drive and the Mac OS DVD.<br />
11. Select the DVD (click on the arrow key below it) and follow the instructions. The system will start installing the 12. new operating system</p>
<p><strong style="font-style: italic;">Warning:</strong><em> This process will delete all data that existed on the disk prior to install. Backup your files on an external device first.</em></p>
<h3><span style="font-size: 15px; font-weight: bold;">Now the story</span></h3>
<p>It&#8217;s been more or less a month since Mac OS Lion is out in the wild. As with all new releases of operating systems people react to it very differently. From blind love to pure hate, and well, that&#8217;s not quite informative.</p>
<p>One of the best reviews I read about Lion was from <a href="http://arstechnica.com/apple/reviews/2011/07/mac-os-x-10-7.ars">Ars Technica</a>, written by John Siracusa. I&#8217;d be lying if I say I read it all; it&#8217;s a friggin&#8217; book. But I enjoyed the unbiased view of the author and learned stuff too. You might be wondering why do I just woke up from the rock I was living under and started writing about installing Lion.</p>
<p>First of all, it&#8217;s not that very safe to upgrade to a new OS the moment it is available for download. The irrationale joy and excitement of a hot-from-the-oven product might burn you. The very early adopters usually share invaluable information about their first impressions and sufferings. Then I didn&#8217;t think my old (late 2007 , yes 2007!) MacBook Pro seem to be a bonafide candidate for the job. So I waited until I buy a new laptop, which was 2 days ago. A Core i7 MacBook Pro. It&#8217;s a descent machine and I quite like it.</p>
<p>About upgrading to Lion; the laptop came with Snow Leopard installed on it and a free download code for Lion. Instead of just upgrading to Lion I chose to run a fresh install on it to have the peace of mind that no old file will be left abandoned on the system and no library will conflict with a new one. Time will tell.</p>
<p>Now if you excuse me I have to go finish installing the apps I need on daily basis. You can refer to conclusion (top) for a quick tutorial on fresh-installing Lion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alishabdar.com/2011/08/31/snow-leopard-to-lion-the-painless-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reloading Rails console without exiting</title>
		<link>http://www.alishabdar.com/2011/03/31/reloading-rails-console-without-exiting/</link>
		<comments>http://www.alishabdar.com/2011/03/31/reloading-rails-console-without-exiting/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 00:14:23 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.alishabdar.com/?p=798</guid>
		<description><![CDATA[In my journey to hopefully master Ruby on Rails, I&#8217;m amazed to see that many authors (in blogs or in books) most of whom are pretty expert in the field, choose to exit the Rails console completely (using CTRL+D) when they need to restart the environment (to clear up the objects in the memory, for [...]]]></description>
				<content:encoded><![CDATA[<p>In my journey to hopefully master <a href="http://rubyonrails.org/" target="_blank">Ruby on Rails</a>, I&#8217;m amazed to see that many authors (in blogs or in books) most of whom are pretty expert in the field, choose to exit the Rails console completely (using CTRL+D) when they need to restart the environment (to clear up the objects in the memory, for example).</p>
<p>Instead there is a convenient method:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="rails" style="font-family:monospace;">reload!</pre></td></tr></table></div>

<p>that you can type inside Rails console and it will reload the environment for you. No need to wait extra second to exit and reenter the console.</p>
<p><em>P.S. There might be a wisdom in not choosing <code>realod!</code> which I might not be aware of. In that case please enlighten me in the comments.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alishabdar.com/2011/03/31/reloading-rails-console-without-exiting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Running MySQL 5.5 and Rails 3 on Mac OS X</title>
		<link>http://www.alishabdar.com/2011/03/22/running-mysql-5-5-and-rails-3-on-mac-os-x/</link>
		<comments>http://www.alishabdar.com/2011/03/22/running-mysql-5-5-and-rails-3-on-mac-os-x/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 20:20:33 +0000</pubDate>
		<dc:creator>Ali</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.alishabdar.com/?p=770</guid>
		<description><![CDATA[A recent opportunity made me dust off my development skills and I decided to use Ruby on Rails as the framework of choice. I&#8217;m happy with Ruby 1.8.7 for now (comes with Mac OS X Snow Leopard), but I had to update Rails to version 3, which was a painless process. After installing MySQL 5.5.10 [...]]]></description>
				<content:encoded><![CDATA[<p>A recent opportunity made me dust off my development skills and I decided to use Ruby on Rails as the framework of choice.</p>
<p>I&#8217;m happy with Ruby 1.8.7 for now (comes with Mac OS X Snow Leopard), but I had to update Rails to version 3, which was a painless process. After installing MySQL 5.5.10 (dumping MAMP for now), I installed the ruby gem for MySQL:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql2</pre></td></tr></table></div>

<blockquote><p>You may want to run this too, although the first one should do the trick:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql</pre></td></tr></table></div>

</blockquote>
<p>A quick test got me this piece of error:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">LoadError: dlopen<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Ruby<span style="color: #000000; font-weight: bold;">/</span>Gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>mysql2-0.2.6<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql2<span style="color: #000000; font-weight: bold;">/</span>mysql2.bundle, <span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>: Library not loaded: libmysqlclient.18.dylib
Referenced from: <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Ruby<span style="color: #000000; font-weight: bold;">/</span>Gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>mysql2-0.2.6<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql2<span style="color: #000000; font-weight: bold;">/</span>mysql2.bundle
Reason: image not found – <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Ruby<span style="color: #000000; font-weight: bold;">/</span>Gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>mysql2-0.2.6<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql2<span style="color: #000000; font-weight: bold;">/</span>mysql2.bundle
from <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Ruby<span style="color: #000000; font-weight: bold;">/</span>Gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>mysql2-0.2.6<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql2<span style="color: #000000; font-weight: bold;">/</span>mysql2.bundle
from <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Ruby<span style="color: #000000; font-weight: bold;">/</span>Site<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>rubygems<span style="color: #000000; font-weight: bold;">/</span>custom_require.rb:<span style="color: #000000;">31</span>:in <span style="color: #000000; font-weight: bold;">`</span>require’
from <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Ruby<span style="color: #000000; font-weight: bold;">/</span>Gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>mysql2-0.2.6<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql2.rb:<span style="color: #000000;">7</span>
from <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Ruby<span style="color: #000000; font-weight: bold;">/</span>Site<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>rubygems<span style="color: #000000; font-weight: bold;">/</span>custom_require.rb:<span style="color: #000000;">36</span>:in <span style="color: #000000; font-weight: bold;">`</span>gem_original_require’
from <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Ruby<span style="color: #000000; font-weight: bold;">/</span>Site<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>rubygems<span style="color: #000000; font-weight: bold;">/</span>custom_require.rb:<span style="color: #000000;">36</span>:in <span style="color: #000000; font-weight: bold;">`</span>require’
from <span style="color: #7a0874; font-weight: bold;">&#40;</span>irb<span style="color: #7a0874; font-weight: bold;">&#41;</span>:<span style="color: #000000;">1</span></pre></td></tr></table></div>

<p>You can never have a perfect installation experience. Can you?</p>
<p>A thread on <a href="http://stackoverflow.com/questions/4546698/library-not-loaded-libmysqlclient-16-dylib-error-when-trying-to-run-rails-serve" target="_blank">Stack Overflow</a> guided me to this solution:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">sudo</span> install_name_tool <span style="color: #660033;">-change</span> libmysqlclient.18.dylib <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql-5.5.10-osx10.6-x86_64<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libmysqlclient.18.dylib <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Ruby<span style="color: #000000; font-weight: bold;">/</span>Gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>mysql2-0.2.6<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mysql2<span style="color: #000000; font-weight: bold;">/</span>mysql2.bundle</pre></td></tr></table></div>

<blockquote><p><strong>Note:</strong> As it happened with me, you might have the same problem that MySQL failed to create a link (alias) in the <code>/usr/bin</code> folder. You can fix it with a quick <code>ln</code> command:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql-5.5.10-osx10.6-x86_64<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysql</pre></td></tr></table></div>

</blockquote>
<p><em>PS: This solution is based on the latest versions of the libraries available as of March 2011. You might need to change the versions in the commands or paths according to your machine settings.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alishabdar.com/2011/03/22/running-mysql-5-5-and-rails-3-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
