<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Desi Founder @ Work</title>
	
	<link>http://sharjeel.2scomplement.com</link>
	<description>Journal of a Pakistani Tech Entrepreneur</description>
	<lastBuildDate>Sun, 25 Oct 2009 18:03:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/sharjeel" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="sharjeel" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Startupping Hajj</title>
		<link>http://sharjeel.2scomplement.com/2009/10/25/startupping-hajj/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=startupping-hajj</link>
		<comments>http://sharjeel.2scomplement.com/2009/10/25/startupping-hajj/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 18:03:34 +0000</pubDate>
		<dc:creator>sharjeel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sharjeel.2scomplement.com/?p=84</guid>
		<description><![CDATA[For a Startup Founder getting psyched up for Hajj is simple: There are gonna be extremely hard times, you'll have to do a lot of things yourself, you should stay patient, be calm, don't complain, be very resourceful during the hard times and expect a lifetime reward if you do it well. Wait, you've been [...]]]></description>
			<content:encoded><![CDATA[<p>For a Startup Founder getting psyched up for <a href="http://en.wikipedia.org/wiki/Hajj">Hajj</a> is simple: There are gonna be extremely hard times, you'll have to do a lot of things yourself, you should stay patient, be calm, don't complain, be very resourceful during the hard times and expect a lifetime reward if you do it well. Wait, you've been through this before, haven't you? :)</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsharjeel.2scomplement.com%2F2009%2F10%2F25%2Fstartupping-hajj%2F';
  addthis_title  = 'Startupping+Hajj';
  addthis_pub    = 'sharjeel';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://sharjeel.2scomplement.com/2009/10/25/startupping-hajj/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating from XP to Windows 7</title>
		<link>http://sharjeel.2scomplement.com/2009/10/25/migrating-from-xp-to-windows-7/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=migrating-from-xp-to-windows-7</link>
		<comments>http://sharjeel.2scomplement.com/2009/10/25/migrating-from-xp-to-windows-7/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 17:22:00 +0000</pubDate>
		<dc:creator>sharjeel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[windows 7]]></category>
		<category><![CDATA[windows xp]]></category>

		<guid isPermaLink="false">http://sharjeel.2scomplement.com/?p=65</guid>
		<description><![CDATA[I've been using MS Windows since version 3.1 and ever since Vista is the only OS by Microsoft which I haven't even tried; and I'm glad I didn't. No comments required on this. However I must say the next effort by Microsoft, i.e. Windows 7 is commendable. I tried to switch over to Mac but [...]]]></description>
			<content:encoded><![CDATA[<p>I've been using MS Windows since version 3.1 and ever since Vista is the only OS by Microsoft which I haven't even tried; and I'm glad I didn't. No comments required on this. However I must say the next effort by Microsoft, i.e. Windows 7 is commendable. I tried to switch over to Mac but the non-standard shortcut keys of Mac for a keyboard ninja like me, and a few minutes of usage with Release Candidate new OS successfully proselytized me to Windows 7.</p>
<p>However Windows 7 doesn't have built in support for upgrading from XP. One could follow the painful procedures of upgrading XP to Vista first and then to 7 and struggle with driver issues. Here is a much convenient way.</p>
<p>For me, the most important thing was to retain my profile settings and then my programs as well. Setting up</p>
<p>Windows 7 comes with a utility called Migration Wizard. It lets you backup your settings and restore on a fresh install.</p>
<p>To use it, just boot your Windows XP and insert your Windows 7 installation disc. From the folder \support\migwiz\ run migwiz.exe. It'll let you choose the stuff you want to backup. Keep the file at a safe place (e.g. a USB disc). Now install Windows 7 and run the same tool. This time choose the restoration option and point it to the file in which you saved settings. It'll take some time but it is worth it.</p>
<p>Here is a detailed tutorial: http://www.howtogeek.com/howto/3179/migrate-xp-to-windows-7-with-easy-transfer-and-a-usb-drive/</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 52px; width: 1px; height: 1px;"><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val=" " /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="0" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--><!--[if !mso]><span class="mceItemObject"   classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></span> <mce:style><!  st1\:*{behavior:url(#ieooui) } --> <!--[endif]--><!--  /* Font Definitions */  @font-face 	{font-family:Courier; 	panose-1:2 7 4 9 2 2 5 2 4 4; 	mso-font-alt:"Courier New"; 	mso-font-charset:0; 	mso-generic-font-family:modern; 	mso-font-format:other; 	mso-font-pitch:fixed; 	mso-font-signature:3 0 0 0 1 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 415 0;} @font-face 	{font-family:Verdana; 	panose-1:2 11 6 4 3 5 4 4 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1593833729 1073750107 16 0 415 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	text-align:justify; 	mso-pagination:widow-orphan; 	font-size:9.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:"Verdana","sans-serif"; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-ansi-language:EN-GB;} h1 	{mso-style-priority:9; 	mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-link:"Heading 1 Char"; 	mso-style-next:Normal; 	margin-top:24.0pt; 	margin-right:0in; 	margin-bottom:0in; 	margin-left:0in; 	margin-bottom:.0001pt; 	text-align:justify; 	mso-pagination:widow-orphan lines-together; 	page-break-after:avoid; 	mso-outline-level:1; 	font-size:14.0pt; 	font-family:"Cambria","serif"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:major-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:major-fareast; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:major-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:major-bidi; 	color:#365F91; 	mso-themecolor:accent1; 	mso-themeshade:191; 	mso-font-kerning:0pt; 	mso-ansi-language:EN-GB;} h2 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-link:"Heading 2 Char"; 	mso-style-next:Normal; 	margin-top:6.0pt; 	margin-right:0in; 	margin-bottom:0in; 	margin-left:0in; 	margin-bottom:.0001pt; 	text-align:justify; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:2; 	font-size:9.0pt; 	font-family:"Verdana","sans-serif"; 	mso-bidi-font-family:Arial; 	mso-ansi-language:EN-GB; 	mso-bidi-font-style:italic;} span.Heading2Char 	{mso-style-name:"Heading 2 Char"; 	mso-style-unhide:no; 	mso-style-locked:yes; 	mso-style-link:"Heading 2"; 	mso-ansi-font-size:9.0pt; 	mso-bidi-font-size:9.0pt; 	font-family:"Verdana","sans-serif"; 	mso-ascii-font-family:Verdana; 	mso-hansi-font-family:Verdana; 	mso-bidi-font-family:Arial; 	mso-ansi-language:EN-GB; 	font-weight:bold; 	mso-bidi-font-style:italic;} p.Name, li.Name, div.Name 	{mso-style-name:Name; 	mso-style-unhide:no; 	mso-style-parent:"Heading 1"; 	margin-top:12.0pt; 	margin-right:0in; 	margin-bottom:0in; 	margin-left:0in; 	margin-bottom:.0001pt; 	text-align:justify; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:1; 	border:none; 	mso-border-top-alt:solid windowtext .5pt; 	padding:0in; 	mso-padding-alt:1.0pt 0in 0in 0in; 	font-size:22.0pt; 	mso-bidi-font-size:16.0pt; 	font-family:"Verdana","sans-serif"; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:Arial; 	mso-font-kerning:16.0pt; 	mso-ansi-language:EN-GB; 	mso-bidi-font-weight:bold;} p.Address, li.Address, div.Address 	{mso-style-name:Address; 	mso-style-unhide:no; 	margin:0in; 	margin-bottom:.0001pt; 	text-align:justify; 	mso-pagination:widow-orphan; 	tab-stops:3.0in; 	font-size:10.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:Courier; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-ansi-language:EN-GB;} p.emailAddress, li.emailAddress, div.emailAddress 	{mso-style-name:emailAddress; 	mso-style-unhide:no; 	mso-style-link:"emailAddress Char"; 	margin:0in; 	margin-bottom:.0001pt; 	text-align:justify; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:Courier; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-ansi-language:EN-GB;} p.ObjectiveStatement, li.ObjectiveStatement, div.ObjectiveStatement 	{mso-style-name:ObjectiveStatement; 	mso-style-unhide:no; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:0in; 	margin-left:.25in; 	margin-bottom:.0001pt; 	text-align:justify; 	mso-pagination:widow-orphan; 	font-size:9.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:"Verdana","sans-serif"; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-ansi-language:EN-GB;} span.emailAddressChar 	{mso-style-name:"emailAddress Char"; 	mso-style-unhide:no; 	mso-style-locked:yes; 	mso-style-link:emailAddress; 	mso-bidi-font-size:12.0pt; 	font-family:Courier; 	mso-ascii-font-family:Courier; 	mso-hansi-font-family:Courier; 	mso-ansi-language:EN-GB;} span.Heading1Char 	{mso-style-name:"Heading 1 Char"; 	mso-style-priority:9; 	mso-style-unhide:no; 	mso-style-locked:yes; 	mso-style-link:"Heading 1"; 	mso-ansi-font-size:14.0pt; 	mso-bidi-font-size:14.0pt; 	font-family:"Cambria","serif"; 	mso-ascii-font-family:Cambria; 	mso-ascii-theme-font:major-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:major-fareast; 	mso-hansi-font-family:Cambria; 	mso-hansi-theme-font:major-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:major-bidi; 	color:#365F91; 	mso-themecolor:accent1; 	mso-themeshade:191; 	mso-ansi-language:EN-GB; 	font-weight:bold;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	font-size:10.0pt; 	mso-ansi-font-size:10.0pt; 	mso-bidi-font-size:10.0pt;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]> <mce:style><!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} --> <!--[endif]--></p>
<div style="border-style: solid none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 1pt 0in 0in;">
<p class="Name"><span lang="EN-GB">Sharjeel Ahmed Qureshi</span></p>
</div>
<p class="Address"><span lang="EN-GB">88-E   Allama Iqbal Road</span><span lang="EN-GB">, Garhi Shahu, Lahore, Pakistan</span></p>
<p class="Address"><span lang="EN-GB">(Off): +92-42-6132170<span> </span>(Cell): +92-322-4736374</span></p>
<p class="emailAddress"><span lang="EN-GB">Email: <span style="text-decoration: underline;">sharjeel@2scomplement.com</span><span> </span>URL: <span style="text-decoration: underline;">http://vcard.acm.org/~sharjeel</span></span></p>
<div style="border-style: solid none none; border-color: windowtext -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 1pt 0in 0in;">
<h2 style="border: medium none ; padding: 0in;"><span lang="EN-GB">Objective</span></h2>
</div>
<p class="ObjectiveStatement"><span lang="EN-GB">To create value for people using technology</span></p>
</div>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsharjeel.2scomplement.com%2F2009%2F10%2F25%2Fmigrating-from-xp-to-windows-7%2F';
  addthis_title  = 'Migrating+from+XP+to+Windows+7';
  addthis_pub    = 'sharjeel';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://sharjeel.2scomplement.com/2009/10/25/migrating-from-xp-to-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Future Secondary School English Examination 2.0</title>
		<link>http://sharjeel.2scomplement.com/2009/09/08/future-secondary-school-english-examination-2-0/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=future-secondary-school-english-examination-2-0</link>
		<comments>http://sharjeel.2scomplement.com/2009/09/08/future-secondary-school-english-examination-2-0/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 18:34:24 +0000</pubDate>
		<dc:creator>sharjeel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english 2.0]]></category>

		<guid isPermaLink="false">http://sharjeel.2scomplement.com/?p=70</guid>
		<description><![CDATA[Looking at the way technology is influencing our everyday speaking and writing styles, I think it won't be long before even the most traditional of our schools would get influenced. I remember back in 1997 when I was doing my matriculation studies at Crescent Model School, the teachers did adopt to write letters the way [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Looking at the way technology is influencing our everyday speaking and writing styles, I think it won't be long before even the most traditional of our schools would get influenced. I remember back in 1997 when I was doing my matriculation studies at Crescent Model School, the teachers did adopt to write letters the way email is indented (i.e. double new line between paragraphs and no indentation at the starting line)</p>
<p style="text-align: left;">Based on these thoughts, I think the future exams of English might look something like this:</p>
<p style="text-align: left;">
<p style="text-align: center;">Board of Intermediate &amp; Secondary Education Pakistan<br />
Matriculation Exam - English B<br />
Date: 10th March 2015</p>
<p style="text-align: center;">Total Marks: 100<br />
Time Duration: 1 hour 45 Minutes</p>
<p style="text-align: left;">Q1. Write a blog post entry on one of the following having no more than 2000 characters (20 Marks)</p>
<ul>
<li>Life in a Big City</li>
<li>Ev0lut10n of cont3mp0r4ry scr1pt$</li>
</ul>
<p>Q2. Suggest titles for flickr photos tagged with following keywords</p>
<p>a) thirsty, crow, pitcher, pebbles (5 marks)<br />
b) lol, cheeseburger, computer, router (5 marks)</p>
<p>Q3. Write an SMS to your Uncle thanking him for the gift he sent. You may concatenate two SMS to avail 300 characters limit. (10 marks)</p>
<p>Q4. Write an e-mail application to your headmaster requesting him to allow the use of social networks on the school network (15 marks)</p>
<p>Q5. Write a snail mail letter, having no more than 100 words, to your grandfather inviting him to use GMail (15 marks)</p>
<p>Q6. a) Translate into English: "Hy Dad. Rcvd da cash. Cudnt buy books cuz Friendz wanna party. LoL! GTG. Thx. TC" (10 marks)</p>
<p>b) Translate the following Roman Urdu into English "Zindigi k nashebo faraz mein insan par aisa waqt ata hai jab uss ko har taraf andher nazar ata ha" (10 Marks)</p>
<p>Q7 a) Tweet your friend inviting him to spend coming summer vacations with you (5 Marks)</p>
<p>b) Update your Facebook status telling everyone that you won't be available for the next few days but would still keep in touch via net (5 marks)</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsharjeel.2scomplement.com%2F2009%2F09%2F08%2Ffuture-secondary-school-english-examination-2-0%2F';
  addthis_title  = 'Future+Secondary+School+English+Examination+2.0';
  addthis_pub    = 'sharjeel';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://sharjeel.2scomplement.com/2009/09/08/future-secondary-school-english-examination-2-0/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Filter crappy posted videos from Facebook feed</title>
		<link>http://sharjeel.2scomplement.com/2009/08/20/filter-crappy-posted-videos-from-facebook-feed/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=filter-crappy-posted-videos-from-facebook-feed</link>
		<comments>http://sharjeel.2scomplement.com/2009/08/20/filter-crappy-posted-videos-from-facebook-feed/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 09:39:26 +0000</pubDate>
		<dc:creator>sharjeel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Facebook Greasemonkey]]></category>

		<guid isPermaLink="false">http://sharjeel.2scomplement.com/?p=68</guid>
		<description><![CDATA[Once Facebook's feed used to be very useful informing you about the updates of friends by their status, . I feel my Facebook feed has been hijacked by redundant and time wasting posted videos. So I wrote a small GreaseMonkey script to filter out posted videos. Here it is:
&#160;
&#160;
// ==UserScript==
// @name     [...]]]></description>
			<content:encoded><![CDATA[<p>Once Facebook's feed used to be very useful informing you about the updates of friends by their status, . I feel my Facebook feed has been hijacked by redundant and time wasting posted videos. So I wrote a small GreaseMonkey script to filter out posted videos. Here it is:</p>
<pre class="javascript">&nbsp;
&nbsp;
<span style="color: #009900; font-style: italic;">// ==UserScript==</span>
<span style="color: #009900; font-style: italic;">// @name           Facebook Remove Vids</span>
<span style="color: #009900; font-style: italic;">// @namespace</span>
<span style="color: #009900; font-style: italic;">// @description    Removes videos from your Facebook Feed</span>
<span style="color: #009900; font-style: italic;">// @include        http://www.facebook.com/*home.php*</span>
<span style="color: #009900; font-style: italic;">// @include        http://www.new.facebook.com/*home.php*</span>
<span style="color: #009900; font-style: italic;">// ==/UserScript==</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> cleanUpPage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> stories = document.<span style="color: #006600;">getElementsByClassName</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;UIIntentionalStory&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i = <span style="color: #CC0000;">0</span>; i &lt; stories.<span style="color: #006600;">length</span>; i++ <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> sHTML = stories<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">innerHTML</span>;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span> sHTML.<span style="color: #006600;">match</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;class=<span style="color: #000099; font-weight: bold;">\&quot;</span>UIMediaItem_video&quot;</span><span style="color: #66cc66;">&#41;</span> || sHTML.<span style="color: #006600;">match</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;class=<span style="color: #000099; font-weight: bold;">\&quot;</span>swfvideo&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			stories<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">style</span>.<span style="color: #006600;">display</span> = <span style="color: #3366CC;">&quot;none&quot;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
window.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">&quot;load&quot;</span>,
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		t = setInterval<span style="color: #66cc66;">&#40;</span>cleanUpPage, <span style="color: #CC0000;">1000</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	, <span style="color: #003366; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>I must say that after removing those videos, very little has been left in my feed :)</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsharjeel.2scomplement.com%2F2009%2F08%2F20%2Ffilter-crappy-posted-videos-from-facebook-feed%2F';
  addthis_title  = 'Filter+crappy+posted+videos+from+Facebook+feed';
  addthis_pub    = 'sharjeel';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://sharjeel.2scomplement.com/2009/08/20/filter-crappy-posted-videos-from-facebook-feed/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Attempt Retries decorator in Python</title>
		<link>http://sharjeel.2scomplement.com/2009/07/22/attempt-retries-decorator-in-python/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=attempt-retries-decorator-in-python</link>
		<comments>http://sharjeel.2scomplement.com/2009/07/22/attempt-retries-decorator-in-python/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 07:27:13 +0000</pubDate>
		<dc:creator>sharjeel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://sharjeel.2scomplement.com/?p=62</guid>
		<description><![CDATA[In certain situations particularly when dealing with networks and distributed systems you'd want your program to retry certain a particular operation certain number of times in case it fails before giving up. For instance your program is trying to connect to a mail server which is due to network connectivity temporarily giving socket error.
The simple [...]]]></description>
			<content:encoded><![CDATA[<p>In certain situations particularly when dealing with networks and distributed systems you'd want your program to retry certain a particular operation certain number of times in case it fails before giving up. For instance your program is trying to connect to a mail server which is due to network connectivity temporarily giving socket error.</p>
<p>The simple way is to put a loop, try certain number of times and if the result still fails give up.</p>
<p>I found this pattern normal so I wrote a decorator in Python which can be generically used.</p>
<pre class="python">&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> attempt_retries<span style="color: black;">&#40;</span>func, retries=<span style="color: #ff4500;">3</span>, delay=<span style="color: #ff4500;">3</span>, IgnoreException=<span style="color: #008000;">Exception</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
    Decorator for ignoring certain exception for certain number times and retrying with certain delay
    e.g.   func = @retry(connect_imap, 10, 5, SocketError) # Tries ten times
    e.g.2. retry(connect_imap)(username, password)
    &quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> dec<span style="color: black;">&#40;</span>*args, **kwargs<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">range</span><span style="color: black;">&#40;</span>retries<span style="color: #ff4500;">-1</span><span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">try</span>:
                <span style="color: #ff7700;font-weight:bold;">return</span> func<span style="color: black;">&#40;</span>*args, **kwargs<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">except</span> IgnoreException:
                sleep<span style="color: black;">&#40;</span>delay<span style="color: black;">&#41;</span>
        func<span style="color: black;">&#40;</span>*args, **kwargs<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> dec
&nbsp;</pre>
<p>Usage:</p>
<pre class="python">&nbsp;
attempt_retries<span style="color: black;">&#40;</span> server_connect, <span style="color: #ff4500;">10</span>, <span style="color: #ff4500;">20</span>, SocketError <span style="color: black;">&#41;</span> <span style="color: black;">&#40;</span> host, <span style="color: #dc143c;">user</span>, <span style="color: #ff7700;font-weight:bold;">pass</span><span style="color: black;">&#41;</span>
&nbsp;</pre>
<p>or</p>
<pre class="python">&nbsp;
r_server_connect = attempt_retries<span style="color: black;">&#40;</span> server_connect, <span style="color: #ff4500;">10</span>, <span style="color: #ff4500;">50</span>, SocketError <span style="color: black;">&#41;</span>
r_server_connect<span style="color: black;">&#40;</span> host, <span style="color: #dc143c;">user</span>, <span style="color: #ff7700;font-weight:bold;">pass</span><span style="color: black;">&#41;</span>
&nbsp;</pre>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsharjeel.2scomplement.com%2F2009%2F07%2F22%2Fattempt-retries-decorator-in-python%2F';
  addthis_title  = 'Attempt+Retries+decorator+in+Python';
  addthis_pub    = 'sharjeel';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://sharjeel.2scomplement.com/2009/07/22/attempt-retries-decorator-in-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ins and Outs</title>
		<link>http://sharjeel.2scomplement.com/2009/06/14/ins-and-outs/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ins-and-outs</link>
		<comments>http://sharjeel.2scomplement.com/2009/06/14/ins-and-outs/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 09:18:30 +0000</pubDate>
		<dc:creator>sharjeel</dc:creator>
				<category><![CDATA[carputer]]></category>
		<category><![CDATA[nerds]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://sharjeel.2scomplement.com/?p=55</guid>
		<description><![CDATA[Some recent ins and outs of my daily tech-life:
Windows 7 is in - XP and Mac OS X*  are out
Ubuntu Server is in - Fedora and RedHat are out
Flock &#38; Chrome are in - Firefox &#38; Safari 4 are out
Postbox is in - Thunderbird is out
XChat2 is in - mIRC is out
MSN Messenger stays in [...]]]></description>
			<content:encoded><![CDATA[<p>Some recent ins and outs of my daily tech-life:</p>
<p>Windows 7 is in - XP and Mac OS X*  are out<br />
Ubuntu Server is in - Fedora and RedHat are out</p>
<p>Flock &amp; Chrome are in - Firefox &amp; Safari 4 are out<br />
Postbox is in - Thunderbird is out<br />
XChat2 is in - mIRC is out<br />
MSN Messenger stays in due to locked contacts :(<br />
Google Talk: Always in :)</p>
<p>Google Desktop is in - Yahoo Gadgets and Launchy are out<br />
TrueCrypt is in - Other File encryption tools are out<br />
VLCPlayer &amp; Foobar2000 are in - WMPlayer &amp; KLite are out<br />
GIMP is in - Photoshop is out (I'm a thrifty developer)</p>
<p>Dropbox would so be in - Manual rsync scripts would be out</p>
<p>Console2 is in - Standard Command Prompt is out<br />
IPython is in - Bash is (almost) out<br />
GNUWin32 is in - Cygwin is out</p>
<p>Aptana is in - Standard Eclipse is out<br />
Notepad++ is in - Notepad is out<br />
Emacs is in - Vim is out<br />
PyScripter is in - Other Python only IDEs are out<br />
Putty connection manager is in - PuttyTabs is out</p>
<p>Python, C, C++ are in - Java, PHP are out<br />
NginX is in - Apache2 is out</p>
<p><strong>Mobile:</strong><br />
Windows Mobile 6.1 are in - WM6.0 and 5.x are out<br />
WM 6.5 would soon be in - iPhone, Blackberry &amp; Symbian probably will never make it! Android may come under consideration.<br />
Windows Mobile Device Center is in - ActiveSync is out<br />
HTC Touch Pro would soon be in - TyTN II would be out<br />
TouchFlo 3D is in - Standard Today is out<br />
Opera Mobile is in - Opera Mini is out<br />
Skype &amp; Windows Messenger are in - Fring is out</p>
<p><strong>Desktop Linux box:</strong><br />
Ubuntu 9 is in - 8.04 LTS is out<br />
KDE4.2 is in - GNome &amp; KDE 3.x are out</p>
<p><strong>Carputer:<br />
</strong>Ubuntu is in - XP is out<br />
Gnome is in - KDE is out<br />
Hildon is in - RoadRunner is out<br />
Android Linux apps would soon be in -<br />
Microcontrolled power control is in - Direct switches are out<br />
SAIMA (Sharjeel's Artificially Intelligent Machine for Automation) is in - SMSLib is out</p>
<p>* I tried Mac-OS-X for a while. Loved it for awesome user interface, bundled out of the box applications but at the same time hated it for poor keyboard shortcuts and hardware restrictions. I would have switched but Microsoft did a REALLY good job at Win7.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsharjeel.2scomplement.com%2F2009%2F06%2F14%2Fins-and-outs%2F';
  addthis_title  = 'Ins+and+Outs';
  addthis_pub    = 'sharjeel';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://sharjeel.2scomplement.com/2009/06/14/ins-and-outs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook usernames – another step towards Twitterifying</title>
		<link>http://sharjeel.2scomplement.com/2009/06/09/facebook-usernames-another-step-towards-twitterifying/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=facebook-usernames-another-step-towards-twitterifying</link>
		<comments>http://sharjeel.2scomplement.com/2009/06/09/facebook-usernames-another-step-towards-twitterifying/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 22:06:40 +0000</pubDate>
		<dc:creator>sharjeel</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://sharjeel.2scomplement.com/?p=53</guid>
		<description><![CDATA[Does Facebook really need to be worried about how to become Twitter? I don't think so. Facebook has grown out so successfully and elegantly that it becomes a benchmark itself for others to follow. Facebook serves a certain distinguished sets of audience than that of Twitter and I think by just poking into other spaces [...]]]></description>
			<content:encoded><![CDATA[<p>Does Facebook really need to be worried about how to become Twitter? I don't think so. Facebook has grown out so successfully and elegantly that it becomes a benchmark itself for others to follow. Facebook serves a certain distinguished sets of audience than that of Twitter and I think by just poking into other spaces Facebook would simply loose its stickiness and its loyal userbase.</p>
<p>Facebook has just <a href="http://blog.facebook.com/blog.php?post=90316352130">announced</a> that its users would soon be able to have their own usernames. At the first glance it seems to serve a genuine need. For instance, when we developed the <a href="http://apps.facebook.com/smsfriends/">Facebook SMS application</a>, we had a hard time letting users send SMS to their Facebook friends. Had every user got a unique username, it would have been as simple as "@username &lt;the message&gt;". But it has its own implication as well.</p>
<p>One of the things I love about Facebook is that they've kept the profiles and their related data sanitized. I believe it is one of the major reasons why Facebook succeeded while other Social Networks lagged behind despite initially having a wider audience. For instance one of the things that fended me off Orkut was that every friend of mine had a funny name and I couldn't figure out who was who. I would get notifications like "Kachoo-Kooma-123 wrote in your scrapbook", "G3n.X Guy has written a testimonial" without having any idea who these guys were. Later on I would come to know that these are updated "elite" names of people sitting next to me.</p>
<p>On the other hand Facebook has worked hard to keep the profiles real, accurate and spam-free. This has helped even technology averse people join Facebook who have hard time figuring out how to interpret "RT @sharjeelq #facebook now offrz usernames http://tinyurl/blablabla". With proper checks to disallow funny names and rigorous privacy settings to encourage putting accurate information they've kept the site accessible to ordinary (non-1337) humans.</p>
<p>Clearly there is a distinction between the general users of Facebook and Twitter. While twitter users may be more progressive, it is a fact that Facebook users are fond of Facebook not because everyone is on Facebook but because what Facebook is in its current form. They are going to allow people to choose usernames for themselves and disallowing funny usernames is not possible at all. Usernames are supposed to be globally unique and when people having common names like Muhammad Hassan would not be able to get sane usernames like hassan, muhammadhassan, mhassan etc. they'd come up with creative names like mhs1pk. And when you would see "Sharjeel: Hassan, it's been long since I saw you. Where are you these days?" replaced with the culture of "sharjeelq: @mhs1pk wru?", you wouldn't want to stick much to Facebook if you are not a twitter fan or like 1337 stuff.</p>
<p>Introduction of usernames in Facebook is bound to make a significant change in the current userbase of Facebook. Let's see if they get benefit from the new audience!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsharjeel.2scomplement.com%2F2009%2F06%2F09%2Ffacebook-usernames-another-step-towards-twitterifying%2F';
  addthis_title  = 'Facebook+usernames+%26%238211%3B+another+step+towards+Twitterifying';
  addthis_pub    = 'sharjeel';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://sharjeel.2scomplement.com/2009/06/09/facebook-usernames-another-step-towards-twitterifying/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>OpenLaszlo: First Impression</title>
		<link>http://sharjeel.2scomplement.com/2009/04/23/openlaszlo-first-impression/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=openlaszlo-first-impression</link>
		<comments>http://sharjeel.2scomplement.com/2009/04/23/openlaszlo-first-impression/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 20:39:56 +0000</pubDate>
		<dc:creator>sharjeel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[openlaszlo]]></category>

		<guid isPermaLink="false">http://sharjeel.2scomplement.com/?p=51</guid>
		<description><![CDATA[OpenLaszlo is a framework which, officially, is for creating Rich Internet Applications. It takes a higher level markup language Laszlo and converts it into SWF Flash or DHTML. Like many other tools, you are not bound to create only Internet Apps using OpenLaszlo; go ahead if you wanna create your restaurants digital menu card, interface [...]]]></description>
			<content:encoded><![CDATA[<p>OpenLaszlo is a framework which, officially, is for creating Rich Internet Applications. It takes a higher level markup language Laszlo and converts it into SWF Flash or DHTML. Like many other tools, you are not bound to create only Internet Apps using OpenLaszlo; go ahead if you wanna create your restaurants digital menu card, interface to your car's sensors or for create a skinned menu for your phone.</p>
<p>I just wrote my first piece of code in OpenLaszlo and the experience has turned out be pretty ambivalent. On one hand I feel having lot of power and control to generate a Flash application. On the other hand I feel very restricted due to poor documentation, lack of supporting editors and a language I feel isn't powerful enough and hence inappropriate.</p>
<p>Let me share my experience:</p>
<p>I saw OpenLaszlo couple of years back and thought it to be pretty cool, but kept on my stack of to-learn technologies until yesterday when I encountered a simple problem: My friend had to prepare his PhD proposal defense presentation and he wanted me to create him a three minute count down timer animation for a particular slide. I thought I'd generate an SWF using Flash and embed it in PowerPoint. Then I thought maybe it is a good oppurtunity to learn OpenLaszlo. Alas, this simple problem which I estimated to be a one hour excercise turned out to be 8 hour long nighter marathon; even at the end I couldn't produce something really impressive.</p>
<p>The main reason I took time was lack of good documentation and examples. The basic tutorial is pretty neat but afterwards everything is messed up. I thought maybe I should, just like learning any other language/tool, take a look at examples on net but it turns out that there are few examples as opposed to one would expect. The reference is pretty complex and the guide is not only hard to understand, but seems outdated as well. I couldn't get some things running which were stated in the documentation (I'm pretty sure I was doing what the documentation says).</p>
<p>But that is Ok as with any open source project, documentation and support gets mature over time. However there are other things that deter you from using OpenLaszlo i.e. lack of tools. The running process is horrible for the first time user. There are no editors out there. The best I could do was use Notepad++ was HTML or XML as language. The most annoying this is that there is no debugger. There IS a debug console but not a debugger.</p>
<p>To me, the biggest limitation was the language, the markup language. I felt that I had to hit the keyboard five more times as I would in a scripting language like Python to achieve the same task. For simple UI element level stuff it seems OK but whenever I needed to introduce some logic, I felt as if I were writing code in machine language: so much stuff to do.</p>
<p>For instance, take a look at this piece of code:</p>
<pre>&nbsp;
 &lt;class name=&quot;box&quot; bgcolor=&quot;red&quot;
         height=&quot;100&quot; width=&quot;100&quot; /&gt;
&nbsp;
  &lt;class name=&quot;borderedbox&quot; extends=&quot;box&quot;
         width=&quot;${size}&quot; height=&quot;${size}&quot;
         onmouseover=&quot;this.changeSize(50)&quot;
         onmouseout=&quot;this.changeSize(-50)&quot;&gt;
    &lt;attribute name=&quot;size&quot; value=&quot;100&quot;/&gt;
    &lt;attribute name=&quot;bordersize&quot; value=&quot;3&quot;/&gt;
    &lt;view bgcolor=&quot;yellow&quot;
          x=&quot;${parent.bordersize}&quot;
          y=&quot;${parent.bordersize}&quot;
          width=&quot;${parent.width - parent.bordersize*2}&quot;
          height=&quot;${parent.height - parent.bordersize*2}&quot;/&gt;
&nbsp;
    &lt;method name=&quot;changeSize&quot; args=&quot;pixels&quot;&gt;
      this.animate('size', pixels, 500, true);
    &lt;/method&gt;
  &lt;/class&gt;
&nbsp;</pre>
<p>If instead of a Markup language, had it been modeled in an object oriented script language it would have been much more succinct and readable. Let's see how almost same thing could be modeled in Python:</p>
<pre code="python">
class Box:
	height=100
	width=100
	bgcolor="red"

class BorderedBox(Box):
	bgcolor="yellow"
	size=100
	bordersize=3

    unnamed_view = view(bgcolor="yellow", x=self.bordersize, y=self.bordersize,
	                      width=self.width - self.bordersize * 2,
                          height=self.height - self.bordersize * 2)
	def __init__(self):
	    self.width = self.size
		self.height = self.size
	    onMouseOver=lambda:self.changeSize(50)
        onMouseOut=lambda:self.changeSize(-50)

	def changeSize(self):
	    somehow_embed_js(""" this.animate('size', pixels, 500, true); """);
</pre>
<p>Of course it has its own limitations and cannot achieve all what the markup can, I still think that the trade-off would deter people from using it.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsharjeel.2scomplement.com%2F2009%2F04%2F23%2Fopenlaszlo-first-impression%2F';
  addthis_title  = 'OpenLaszlo%3A+First+Impression';
  addthis_pub    = 'sharjeel';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://sharjeel.2scomplement.com/2009/04/23/openlaszlo-first-impression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple and Effective Uploading with Python Script and PSCP</title>
		<link>http://sharjeel.2scomplement.com/2009/03/09/simple-and-elegant-uploader/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=simple-and-elegant-uploader</link>
		<comments>http://sharjeel.2scomplement.com/2009/03/09/simple-and-elegant-uploader/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 17:31:32 +0000</pubDate>
		<dc:creator>sharjeel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[pscp]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://sharjeel.2scomplement.com/?p=45</guid>
		<description><![CDATA[Sometimes you want your File Transfer tool to map certain folders on your dev machine to remote folders on your different remote machines. Wouldn't it be great if you could choose a particular file in your project, click it and it automatically uploads in appropriate folder on desired server?
For instance I have an XP dev [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want your File Transfer tool to map certain folders on your dev machine to remote folders on your different remote machines. Wouldn't it be great if you could choose a particular file in your project, click it and it automatically uploads in appropriate folder on desired server?</p>
<p>For instance I have an XP dev machine with a project in folder "D:\workspace\saima" and another in "D:\workspace\ismspk". I would like all files in any sub-directory in "saima" to upload on my server "saima" in the appropriate sub-directory in "/home/saima/workspace/". Same goes for rest of my projects and servers. Of course I'd like to do it with a simple click rather than choosing the sessions  and folders in my FTP client every time I make a change in a file.</p>
<p>I tried such an option with FileZilla and WinSCP but couldn't find any such option (maybe there exists one). So I thought about writing my own. Since I'm running XP with RSA keys setup with pageant, <a title="PSCP" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">pscp</a> (Putty SCP Client) was a good choice. Though other command-line utilities such as rsync etc. may do the job pretty as well.</p>
<p>I wrote a small Python script which I linked to my "Send To" menu. To add something in your Send-To menu, goto run, type "sendto" and create a new link here. I created a link to my Python Script and named it "Upload".</p>
<p>UPDATE: For Windows 7, type "shell:sendto" in your explorer bar to make a Send-To shortcut</p>
<p>Here is how it looks like</p>
<p><a href="http://sharjeel.2scomplement.com/wp-content/uploads/2009/03/upload.png"><img class="size-full wp-image-46 alignnone" title="upload" src="http://sharjeel.2scomplement.com/wp-content/uploads/2009/03/upload.png" alt="" width="430" height="554" /></a></p>
<p>Here is the Python script I wrote</p>
<pre class="python"><span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
Author: Sharjeel Ahmed Qureshi
Description: Script for uploading files via pscp
You need to setup putty sessions and your RSA keys first.
Make sure that pageant is running and pscp is in your PATH variable.
Works for windows only
You are free to use this script anyway you like
&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">os</span> <span style="color: #ff7700;font-weight:bold;">import</span> path, popen
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">logging</span>
logger = <span style="color: #dc143c;">logging</span>
logger.<span style="color: black;">basicConfig</span><span style="color: black;">&#40;</span>level=<span style="color: #dc143c;">logging</span>.<span style="color: black;">DEBUG</span><span style="color: black;">&#41;</span>
&nbsp;
FILES_TO_UPLOAD = <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>:<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># PATH_RULES is a config variable which is list of path rules</span>
<span style="color: #808080; font-style: italic;"># Each path rule is a list of three members:</span>
<span style="color: #808080; font-style: italic;">#    ['Local Drive + Directory', 'putty session name', 'remote directory']</span>
<span style="color: #808080; font-style: italic;"># e.g.</span>
<span style="color: #808080; font-style: italic;"># PATH_RULES = [</span>
<span style="color: #808080; font-style: italic;">#    ['d:/workspace/saima/', 'saima', '/home/saima/workspace/'],</span>
<span style="color: #808080; font-style: italic;">#    ['d:/workspace/smsfriends/', 'facebooksms', '/home/fbsms/public_html/www/smsfriends/'], ]</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    PATH_RULES = <span style="color: black;">&#91;</span>
        <span style="color: #808080; font-style: italic;"># ['localdir', 'puttysession', 'remote_dir'],</span>
        <span style="color: black;">&#93;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> PATH_RULES: i<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> = path.<span style="color: black;">abspath</span><span style="color: black;">&#40;</span>i<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>.<span style="color: black;">lower</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> PATH_RULES: <span style="color: #ff7700;font-weight:bold;">raise</span> <span style="color: #008000;">Exception</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;No rules defined!&quot;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">Exception</span>, e:
    <span style="color: #dc143c;">logging</span>.<span style="color: black;">exception</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;There was an loading the config. Check your rules: %s&quot;</span> % e.<span style="color: black;">message</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> err<span style="color: black;">&#40;</span>msg<span style="color: black;">&#41;</span>:
    <span style="color: #dc143c;">logging</span>.<span style="color: black;">error</span><span style="color: black;">&#40;</span>msg<span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">sys</span>.<span style="color: black;">stderr</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span>msg + <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> match_server<span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot; Gets matching server for a given filename including fullpath &quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">global</span> PATH_RULES
    filename = path.<span style="color: black;">abspath</span><span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span>.<span style="color: black;">lower</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> r <span style="color: #ff7700;font-weight:bold;">in</span> PATH_RULES:
        <span style="color: #ff7700;font-weight:bold;">if</span> path.<span style="color: black;">dirname</span><span style="color: black;">&#40;</span> filename <span style="color: black;">&#41;</span>.<span style="color: black;">startswith</span><span style="color: black;">&#40;</span> r<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> <span style="color: black;">&#41;</span>:
            psession = r<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
            r_path = r<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span> + filename.<span style="color: black;">rsplit</span><span style="color: black;">&#40;</span>r<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>,<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\\</span>'</span>, <span style="color: #483d8b;">'/'</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#40;</span>psession, r_path<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">None</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> upload<span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span>:
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> path.<span style="color: black;">isdir</span><span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span>:
        err<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Directory Upload is currently not supported&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
    server = match_server<span style="color: black;">&#40;</span>filename<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> server:
        err<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;No rule available about uploading this file&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span>
    psession, r_path = server
    <span style="color: #dc143c;">cmd</span> = <span style="color: #483d8b;">&quot;pscp %s %s:%s&quot;</span> % <span style="color: black;">&#40;</span>filename, psession, r_path<span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;"># logger.debug(&quot;Executing command %s&quot; % cmd)</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #dc143c;">cmd</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> popen<span style="color: black;">&#40;</span><span style="color: #dc143c;">cmd</span><span style="color: black;">&#41;</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> f <span style="color: #ff7700;font-weight:bold;">in</span> FILES_TO_UPLOAD:
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        upload<span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span>:
        <span style="color: #dc143c;">logging</span>.<span style="color: black;">exception</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Error while uploading %s&quot;</span> % f<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #008000;">raw_input</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Press ENTER to Continue&quot;</span><span style="color: black;">&#41;</span></pre>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsharjeel.2scomplement.com%2F2009%2F03%2F09%2Fsimple-and-elegant-uploader%2F';
  addthis_title  = 'Simple+and+Effective+Uploading+with+Python+Script+and+PSCP';
  addthis_pub    = 'sharjeel';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://sharjeel.2scomplement.com/2009/03/09/simple-and-elegant-uploader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python: Copy to clipboard</title>
		<link>http://sharjeel.2scomplement.com/2009/02/16/python-copy-to-clipboard/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=python-copy-to-clipboard</link>
		<comments>http://sharjeel.2scomplement.com/2009/02/16/python-copy-to-clipboard/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 20:38:44 +0000</pubDate>
		<dc:creator>sharjeel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://sharjeel.2scomplement.com/2009/02/16/python-copy-to-clipboard/</guid>
		<description><![CDATA[I use this small utility function for debugging certain Python scripts, especially those for processing data, e.g. moving some bits of information to Excel.
The idea is pretty simple. Just pass it some information and it'll be available in your clipboard.
&#160;
import sys
import win32clipboard as wc
import win32con
&#160;
def copy_to_clipboard&#40;msg&#41;:
   if sys.platform == 'win32':
    [...]]]></description>
			<content:encoded><![CDATA[<p>I use this small utility function for debugging certain Python scripts, especially those for processing data, e.g. moving some bits of information to Excel.</p>
<p>The idea is pretty simple. Just pass it some information and it'll be available in your clipboard.</p>
<pre class="python">&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> win32clipboard as wc
<span style="color: #ff7700;font-weight:bold;">import</span> win32con
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> copy_to_clipboard<span style="color: black;">&#40;</span>msg<span style="color: black;">&#41;</span>:
   <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">sys</span>.<span style="color: #dc143c;">platform</span> == <span style="color: #483d8b;">'win32'</span>:
      wc.<span style="color: black;">OpenClipboard</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
      wc.<span style="color: black;">EmptyClipboard</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
      wc.<span style="color: black;">SetClipboardData</span><span style="color: black;">&#40;</span>win32con.<span style="color: black;">CF_TEXT</span>, msg<span style="color: black;">&#41;</span>
      wc.<span style="color: black;">CloseClipboard</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre>
<p>It works on Win32 and you need CTypes installed.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fsharjeel.2scomplement.com%2F2009%2F02%2F16%2Fpython-copy-to-clipboard%2F';
  addthis_title  = 'Python%3A+Copy+to+clipboard';
  addthis_pub    = 'sharjeel';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://sharjeel.2scomplement.com/2009/02/16/python-copy-to-clipboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
