<?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>Xster.net</title>
	<atom:link href="http://tech.xster.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.xster.net</link>
	<description>Never relearn twice</description>
	<lastBuildDate>Fri, 20 Jan 2012 21:11:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mac Doesn&#8217;t Go to Sleep</title>
		<link>http://tech.xster.net/tips/mac-doesnt-go-to-sleep/</link>
		<comments>http://tech.xster.net/tips/mac-doesnt-go-to-sleep/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 02:43:22 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[power management]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=388</guid>
		<description><![CDATA[When you make the Mac go to sleep but it just stays on with the screen black, you can use the pmset -g to display you current power management settings and see the entry for sleep that will tell you the problem causing process PID]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>When you make the Mac go to sleep but it just stays on with the screen black, you can use the</p>
<pre lang="&quot;bash">pmset -g</pre>
<p>to display you current power management settings and see the entry for sleep that will tell you the problem causing process PID</p>
<div class="shr-publisher-388"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fmac-doesnt-go-to-sleep%2F' data-shr_title='Mac+Doesn%27t+Go+to+Sleep'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fmac-doesnt-go-to-sleep%2F' data-shr_title='Mac+Doesn%27t+Go+to+Sleep'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/mac-doesnt-go-to-sleep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Login SAP CRM as a Separate User than Single Sign-On</title>
		<link>http://tech.xster.net/tips/login-sap-crm-as-a-separate-user-than-single-sign-on/</link>
		<comments>http://tech.xster.net/tips/login-sap-crm-as-a-separate-user-than-single-sign-on/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 20:56:00 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[CRM]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[NetWeaver]]></category>
		<category><![CDATA[R/3]]></category>
		<category><![CDATA[SAP]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[SSO]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=383</guid>
		<description><![CDATA[If you have SSO enabled on SAP CRM, you can sometimes get stuck with your user on your computer&#8217;s certificate and you can&#8217;t get out of it with logout, delete cookies, no auto-login etc. But what you can do is add ?sap-user=DIFFERENTUSER at the end of your usual sap/bc/bsp/sap/crm_ui_start/default.htm URL and the login dialog will prompt. [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>If you have SSO enabled on SAP CRM, you can sometimes get stuck with your user on your computer&#8217;s certificate and you can&#8217;t get out of it with logout, delete cookies, no auto-login etc. But what you can do is add</p>
<blockquote><p>?sap-user=DIFFERENTUSER</p></blockquote>
<p>at the end of your usual sap/bc/bsp/sap/crm_ui_start/default.htm URL and the login dialog will prompt. Try it in conjunction with &#8216;Clear SSL state&#8217; button in the Content tab of Internet Options</p>
<div class="shr-publisher-383"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Flogin-sap-crm-as-a-separate-user-than-single-sign-on%2F' data-shr_title='Login+SAP+CRM+as+a+Separate+User+than+Single+Sign-On'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Flogin-sap-crm-as-a-separate-user-than-single-sign-on%2F' data-shr_title='Login+SAP+CRM+as+a+Separate+User+than+Single+Sign-On'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/login-sap-crm-as-a-separate-user-than-single-sign-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone rings twice with text message</title>
		<link>http://tech.xster.net/tips/iphone-rings-twice-with-text-message/</link>
		<comments>http://tech.xster.net/tips/iphone-rings-twice-with-text-message/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 13:30:21 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[phone]]></category>

		<guid isPermaLink="false">http://tech.xster.net/tips/iphone-rings-twice-with-text-message/</guid>
		<description><![CDATA[It was kinda off putting with my new iPhone 4S to find out that Apple makes SMS alerts ring twice (once on receive and one reminder) instead of having an LED light for alerts like in Android or Blackberry. Kind of a workaround rather than a real solution to the problem of how to find [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>It was kinda off putting with my new iPhone 4S to find out that Apple makes SMS alerts ring twice (once on receive and one reminder) instead of having an LED light for alerts like in Android or Blackberry. Kind of a workaround rather than a real solution to the problem of how to find out I have alerts pending when I missed the first alert. Apple operates on a push principle and Google/RIM operates on pull.</p>
<p>Anyway, if I have reason to miss the first one, I most likely won&#8217;t notice the second one. It&#8217;s also misleading when it rings twice because you&#8217;d think there&#8217;s 2 messages.</p>
<p>To turn that functionality off, go to Settings->Notifications->Messages->Repeat Alert->Never.</p>
<p><a href="http://tech.xster.net/wp-content/uploads/2011/11/20111101-093215.jpg"><img src="http://tech.xster.net/wp-content/uploads/2011/11/20111101-093215.jpg" alt="20111101-093215.jpg" class="alignnone size-full" /></a></p>
<div class="shr-publisher-380"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fiphone-rings-twice-with-text-message%2F' data-shr_title='iPhone+rings+twice+with+text+message'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fiphone-rings-twice-with-text-message%2F' data-shr_title='iPhone+rings+twice+with+text+message'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/iphone-rings-twice-with-text-message/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Disable Android Exchange Enforced Email Unlock Security</title>
		<link>http://tech.xster.net/tips/disable-android-exchange-enforced-email-unlock-security/</link>
		<comments>http://tech.xster.net/tips/disable-android-exchange-enforced-email-unlock-security/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 03:45:12 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[CyanogenMod]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=375</guid>
		<description><![CDATA[If you tried to load an entreprise email account in the Email.apk app and the Exchange server enforces a minimun password, it could be pretty annoying. To get around it, you can start by getting a modified version of the app from shafty023 onto your rooted phone. Copy the app to your SD card. Then [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>If you tried to load an entreprise email account in the Email.apk app and the Exchange server enforces a minimun password, it could be pretty annoying. To get around it, you can start by getting a modified version of the app from <a href="http://forum.xda-developers.com/showthread.php?t=775007">shafty023</a> onto your rooted phone. Copy the app to your SD card. Then run</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">su</span>
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> remount,rw <span style="color: #660033;">-t</span> yaffs2 <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>block<span style="color: #000000; font-weight: bold;">/</span>mtdblock3 <span style="color: #000000; font-weight: bold;">/</span>system
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>sdcard<span style="color: #000000; font-weight: bold;">/</span>Email.apk <span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>app<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> root <span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>app<span style="color: #000000; font-weight: bold;">/</span>Email.apk
<span style="color: #c20cb9; font-weight: bold;">chgrp</span> root <span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>app<span style="color: #000000; font-weight: bold;">/</span>Email.apk
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">644</span> <span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>app<span style="color: #000000; font-weight: bold;">/</span>Email.apk
reboot</pre></div></div>

<div class="shr-publisher-375"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fdisable-android-exchange-enforced-email-unlock-security%2F' data-shr_title='Disable+Android+Exchange+Enforced+Email+Unlock+Security'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fdisable-android-exchange-enforced-email-unlock-security%2F' data-shr_title='Disable+Android+Exchange+Enforced+Email+Unlock+Security'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/disable-android-exchange-enforced-email-unlock-security/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Django Compress Static Files and Compile CSS</title>
		<link>http://tech.xster.net/tips/django-compress-static-files-and-compile-css/</link>
		<comments>http://tech.xster.net/tips/django-compress-static-files-and-compile-css/#comments</comments>
		<pubDate>Tue, 10 May 2011 01:49:32 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[static]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=373</guid>
		<description><![CDATA[I started off looking for a request time compiler of LESS for Django and initially found django-css which seems to serve the purpose great. Compressing static files on the fly is definitely a nice added bonus as well. It does so by containing a fork of django_compressor. But on further inspections, I jumped ship. The [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I started off looking for a request time compiler of <a href="http://lesscss.org/">LESS</a> for Django and initially found <a href="http://github.com/dziegler/django-css">django-css</a> which seems to serve the purpose great. Compressing static files on the fly is definitely a nice added bonus as well. It does so by containing a fork of <a href="http://github.com/jezdez/django_compressor">django_compressor</a>. But on further inspections, I jumped ship. The original project, django_compressor, sees a more regular update and is now Django 1.3 ready while the &#8216;successor&#8217; isn&#8217;t. Funny thing is django_compressor supports compiling any CSS formats compilable via command line. With a better documentation overall, seems like the original has beat the sequel.</p>
<div class="shr-publisher-373"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fdjango-compress-static-files-and-compile-css%2F' data-shr_title='Django+Compress+Static+Files+and+Compile+CSS'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fdjango-compress-static-files-and-compile-css%2F' data-shr_title='Django+Compress+Static+Files+and+Compile+CSS'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/django-compress-static-files-and-compile-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django Log to File</title>
		<link>http://tech.xster.net/tips/django-log-to-file/</link>
		<comments>http://tech.xster.net/tips/django-log-to-file/#comments</comments>
		<pubDate>Mon, 09 May 2011 03:36:06 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[FileHandler]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=369</guid>
		<description><![CDATA[In the official Django logging docs, it wasn&#8217;t very clear about how to log to files. As you can understand, Django can use any Python logging classes that are all listed here. One of them is FileHandler. To use it, just add this to your settings.py LOGGING = &#123; ... 'handlers': &#123; ... 'file':&#123; 'level': [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>In the official Django <a href="http://docs.djangoproject.com/en/dev/topics/logging/">logging docs</a>, it wasn&#8217;t very clear about how to log to files. As you can understand, Django can use any Python logging classes that are all listed <a href="http://docs.python.org/library/logging.handlers.html">here</a>. One of them is FileHandler. To use it, just add this to your settings.py<span id="more-369"></span></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">LOGGING = <span style="color: black;">&#123;</span>
    ...
    <span style="color: #483d8b;">'handlers'</span>: <span style="color: black;">&#123;</span>
        ...
	<span style="color: #483d8b;">'file'</span>:<span style="color: black;">&#123;</span>
	    <span style="color: #483d8b;">'level'</span>: <span style="color: #483d8b;">'DEBUG'</span>,
	    <span style="color: #483d8b;">'class'</span>: <span style="color: #483d8b;">'logging.FileHandler'</span>,
	<span style="color: black;">&#125;</span>
    <span style="color: black;">&#125;</span>,
    ...
<span style="color: black;">&#125;</span></pre></div></div>

<p>But the FileHandler class constructor needs more parameters. To add them, you have to add the parameter name key with its value into the dictionary.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">LOGGING = <span style="color: black;">&#123;</span>
    ...
    <span style="color: #483d8b;">'handlers'</span>: <span style="color: black;">&#123;</span>
        ...
	<span style="color: #483d8b;">'file'</span>:<span style="color: black;">&#123;</span>
	    <span style="color: #483d8b;">'level'</span>: <span style="color: #483d8b;">'DEBUG'</span>,
	    <span style="color: #483d8b;">'class'</span>: <span style="color: #483d8b;">'logging.FileHandler'</span>,
            <span style="color: #483d8b;">'filename'</span>: <span style="color: #483d8b;">'debug.log'</span>,
	<span style="color: black;">&#125;</span>
    <span style="color: black;">&#125;</span>,
    ...
<span style="color: black;">&#125;</span></pre></div></div>

<div class="shr-publisher-369"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fdjango-log-to-file%2F' data-shr_title='Django+Log+to+File'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fdjango-log-to-file%2F' data-shr_title='Django+Log+to+File'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/django-log-to-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logitech Performance MX Review</title>
		<link>http://tech.xster.net/thoughts/logitech-performance-mx-review/</link>
		<comments>http://tech.xster.net/thoughts/logitech-performance-mx-review/#comments</comments>
		<pubDate>Mon, 25 Apr 2011 03:59:33 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[ergonomics]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[Logitech]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[product]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[shopping]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=364</guid>
		<description><![CDATA[Got a Logitech Performance MX on &#8220;special&#8221; at Best Buy this weekend (80$ for a mouse&#8230; what a slaughter) because I just have a laptop mouse and am tired of not having anything to rest my palm on. At first, it&#8217;s great. Looks like a race car, good performance, nice receiver, rechargeable on the fly [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Got a <a href="http://www.logitech.com/en-us/mice-pointers/mice/devices/5845">Logitech Performance MX</a> on &#8220;special&#8221; at Best Buy this weekend (80$ for a mouse&#8230; what a slaughter) because I just have a laptop mouse and am tired of not having anything to rest my palm on. At first, it&#8217;s great. Looks like a race car, good performance, nice receiver, rechargeable on the fly etc. Then, something feels off&#8230; something uncomfortable. I turn the mouse over and the fatal flaw. The sensor isn&#8217;t placed at the center of the mouse but almost under your thumb&#8230;<span id="more-364"></span></p>
<p>Then I reconfirmed my discomfort. Since the box says that it&#8217;s the best mouse the &#8220;mice experts&#8221; came up with after making a billion mice, I figured I must be able to use it at the zenith of comfort. I closed my eyes and made the most natural horizontal draw (ie, rotate around a point on the wrist which is placed on the table such that the instantaneous motion of the mouse is the tangent of the arc I&#8217;m drawing). I look and the cursor is moving diagonally on the screen.</p>
<p>In order to produce the intended horizontal move, I had to either lift and move my wrist (very uncomfortable) or continuously extend and retract my wrist (very uncomfortable as well). You can also resolve this if you hold the mouse differently. If instead of putting the thumb into the intended groove, you rotate the mouse to compensate for the vertical move, you can also draw horizontal lines at the cost of having a gap under your palm.</p>
<p>Overall, it&#8217;s a sexy sleek black mouse but not necessarily ergonomically superior to the 2$ mouse you can get at any random stores. In other words, if you want to pay 100$ for it, you&#8217;d have to be willing to buy the different look, not rationalise it with ergonomics.</p>
<div class="shr-publisher-364"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Fthoughts%2Flogitech-performance-mx-review%2F' data-shr_title='Logitech+Performance+MX+Review'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Fthoughts%2Flogitech-performance-mx-review%2F' data-shr_title='Logitech+Performance+MX+Review'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/thoughts/logitech-performance-mx-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validate and Format Addresses using Google API</title>
		<link>http://tech.xster.net/tips/validate-and-format-addresses-using-google-api/</link>
		<comments>http://tech.xster.net/tips/validate-and-format-addresses-using-google-api/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 18:54:38 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[Geocoding]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[pygeocoder]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[validate]]></category>
		<category><![CDATA[verify]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=356</guid>
		<description><![CDATA[Suppose you want to make some web app that lets users input addresses. I would be nice to Weed out minor misspelling Standardise format (proper capitalisation, abbreviated province/state or full name etc) Input in freeform but store civic number, street name, city etc separately Verify the address exists of course Some governmental entities provide this [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><div>
<p>Suppose you want to make some web app that lets users input addresses. I would be nice to</p>
<ol>
<li>Weed out minor misspelling</li>
<li>Standardise format (proper capitalisation, abbreviated province/state or full name etc)</li>
<li>Input in freeform but store civic number, street name, city etc separately</li>
<li>Verify the address exists of course</li>
</ol>
<p>Some governmental entities provide this information via public APIs but if you want a uniform service, why not use Google?<span id="more-356"></span></p>
<p>Fortunately, <a href="http://twitter.com/thormitchell">Thor Mitchell</a>, a Google Product Manager, posted an excellent <a href="http://www.thialfi.org/work/api/validate.html">example code</a> that does all of the above using Google Maps JavaScript API. Even better, it&#8217;s with the new V3 so it&#8217;s not obsolete anytime soon. It&#8217;s originally posted <a href="http://www.telnet80.com/2010/09/address-validation-using-google-maps.html?showComment=1285726654178#c2804710605065263449">here</a> in the comments of a blog by <a href="https://profiles.google.com/gabe.sumner/about">Gabe Sumner</a>. It definitely deserves more recognition so here it is again as is:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&amp;lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1.0, user-scalable=no&quot; /&amp;gt;
&amp;lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot;/&amp;gt;
&amp;lt;title&amp;gt;Google Maps JavaScript API v3 Example: Map Simple&amp;lt;/title&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;http://maps.google.com/maps/api/js?sensor=false&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
&nbsp;
  var geocoder, map, marker;
  var defaultLatLng = new google.maps.LatLng(30,0);
&nbsp;
  function initialize() {
    geocoder = new google.maps.Geocoder();
    var mapOptions = {
      zoom: 0,
      center: defaultLatLng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(
      document.getElementById(&quot;map_canvas&quot;),
      mapOptions
    );
    marker = new google.maps.Marker();
  }
&nbsp;
  function validate() {
    clearResults();
    var address = document.getElementById('address').value;
    geocoder.geocode({'address': address }, function(results, status) {
      switch(status) {
        case google.maps.GeocoderStatus.OK:
          document.getElementById('valid').value = 'YES';
          document.getElementById('type').value = results[0].types[0];
          document.getElementById('result').value = results[0].formatted_address;
          mapAddress(results[0]);
          break;
        case google.maps.GeocoderStatus.ZERO_RESULTS:
          document.getElementById('valid').value = 'NO';
          break;
        default:
          alert(&quot;An error occured while validating this address&quot;)
      }
    });
  }
&nbsp;
  function clearResults() {
    document.getElementById('valid').value = '';
    document.getElementById('type').value = '';
    document.getElementById('result').value = '';
    map.setCenter(defaultLatLng);
    map.setZoom(0);
    marker.setMap(null);
  }
&nbsp;
  function mapAddress(result) {
    marker.setPosition(result.geometry.location);
    marker.setMap(map);
    map.fitBounds(result.geometry.viewport);
  }
&amp;lt;/script&amp;gt;
&amp;lt;style&amp;gt;
body {
  font-family: sans-serif;
}
&nbsp;
#address {
  width:300px;
  height:150px;
  float: left;
  margin: 10px;
}
&nbsp;
#map_canvas {
  width:256px;
  height:150px;
  margin: 10px;
}
&nbsp;
#validate {
  clear: both;
}
&nbsp;
#results {
  margin-top: 10px;
}
&amp;lt;/style&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body onload=&quot;initialize()&quot;&amp;gt;
  &amp;lt;div&amp;gt;Address&amp;lt;/div&amp;gt;
  &amp;lt;textarea type=&quot;text&quot; id=&quot;address&quot;&amp;gt;&amp;lt;/textarea&amp;gt;
  &amp;lt;div id=&quot;map_canvas&quot;&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div id=&quot;validate&quot;&amp;gt;&amp;lt;input type=&quot;button&quot; value=&quot;Validate&quot; onClick=&quot;validate()&quot;&amp;gt;&amp;lt;/input&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div id=&quot;results&quot;&amp;gt;
    &amp;lt;table&amp;gt;
      &amp;lt;tr&amp;gt;&amp;lt;td align=&quot;right&quot;&amp;gt;Valid:&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; id=&quot;valid&quot; size=&quot;60&quot;&amp;gt;&amp;lt;/input&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
      &amp;lt;tr&amp;gt;&amp;lt;td align=&quot;right&quot;&amp;gt;Matched:&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; id=&quot;type&quot; size=&quot;60&quot;&amp;gt;&amp;lt;/input&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
      &amp;lt;tr&amp;gt;&amp;lt;td align=&quot;right&quot;&amp;gt;Result:&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; id=&quot;result&quot; size=&quot;60&quot;&amp;gt;&amp;lt;/input&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
    &amp;lt;/table&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;</pre></div></div>

<p>Only 100 lines! It uses Google&#8217;s GeoCoding JavaScript API and you can fancy it up easily with jQuery. In the validate function, the results variable contains of course json formatted responses as described in Google&#8217;s <a href="http://code.google.com/apis/maps/documentation/geocoding/#GeocodingResponses">docs</a>. Looking at &#8216;address_components&#8217; will give you the properly formatted address separated by parts which you can put into database.</p>
<p>For a backend solution, you can use <a href="http://code.xster.net/pygeocoder">pygeocoder</a>, a Python library, to validate addresses.</p>
</div>
<div class="shr-publisher-356"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fvalidate-and-format-addresses-using-google-api%2F' data-shr_title='Validate+and+Format+Addresses+using+Google+API'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fvalidate-and-format-addresses-using-google-api%2F' data-shr_title='Validate+and+Format+Addresses+using+Google+API'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/validate-and-format-addresses-using-google-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Debug with ipdb</title>
		<link>http://tech.xster.net/tips/python-debug-with-ipdb/</link>
		<comments>http://tech.xster.net/tips/python-debug-with-ipdb/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 18:30:47 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[breakpoint]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[ipdb]]></category>
		<category><![CDATA[IPython]]></category>
		<category><![CDATA[pdb]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=352</guid>
		<description><![CDATA[A quickie: import ipdb; ipdb.set_trace&#40;&#41; This puts a breakpoint in the code using ipdb. It has the advantage of having better formatted output, tab completion etc over the vanilla pdb]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>A quickie:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> ipdb<span style="color: #66cc66;">;</span> ipdb.<span style="color: black;">set_trace</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>This puts a breakpoint in the code using ipdb. It has the advantage of having better formatted output, tab completion etc over the vanilla pdb</p>
<div class="shr-publisher-352"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fpython-debug-with-ipdb%2F' data-shr_title='Python+Debug+with+ipdb'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fpython-debug-with-ipdb%2F' data-shr_title='Python+Debug+with+ipdb'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/python-debug-with-ipdb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PIL: Get RGB Value from GIF</title>
		<link>http://tech.xster.net/tips/pil-get-rgb-value-from-gif/</link>
		<comments>http://tech.xster.net/tips/pil-get-rgb-value-from-gif/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 05:16:58 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[GIF]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[PIL]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[RGB]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=331</guid>
		<description><![CDATA[If you load a GIF file with PIL via Image.open(&#8216;giffile.gif&#8217;) and then try to look at its pixels, you would get integers instead of tuples since the GIF pixels refers to one of the 256 colours in the GIF colour palette. The palette would then contain the RGB value of the pixel. To avoid all [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>If you load a GIF file with PIL via Image.open(&#8216;giffile.gif&#8217;) and then try to look at its pixels, you would get integers instead of tuples since the GIF pixels refers to one of the 256 colours in the GIF colour palette. The palette would then contain the RGB value of the pixel.</p>
<p>To avoid all this hassle and just get RGB tuple directly:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">gif = Image.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'giffile.gif'</span><span style="color: black;">&#41;</span>
rgbimage = GIF.<span style="color: black;">convert</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'RGB'</span><span style="color: black;">&#41;</span>
rgbimage.<span style="color: black;">getpixel</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span>,<span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">231</span>, <span style="color: #ff4500;">10</span>, <span style="color: #ff4500;">54</span><span style="color: black;">&#41;</span></pre></div></div>

<div class="shr-publisher-331"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fpil-get-rgb-value-from-gif%2F' data-shr_title='PIL%3A+Get+RGB+Value+from+GIF'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fpil-get-rgb-value-from-gif%2F' data-shr_title='PIL%3A+Get+RGB+Value+from+GIF'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/pil-get-rgb-value-from-gif/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python Challenge Level 14: Italy – Code</title>
		<link>http://tech.xster.net/thoughts/python-challenge-level-14-italy-%e2%80%93-code/</link>
		<comments>http://tech.xster.net/thoughts/python-challenge-level-14-italy-%e2%80%93-code/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 03:35:29 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[challenge]]></category>
		<category><![CDATA[NumPy]]></category>
		<category><![CDATA[PIL]]></category>
		<category><![CDATA[puzzle]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=325</guid>
		<description><![CDATA[Used a NumPy array. Doesn&#8217;t work if the diagonal+1s are white of course. import Image from numpy import array, zeros, uint8 &#160; line = Image.open&#40;'wire.png'&#41; # third dimension is for colours a = zeros&#40;&#40;100, 100, 3&#41;, dtype=uint8&#41; &#160; step = array&#40;&#91;0, 1&#93;&#41; position = array&#40;&#91;0, 0&#93;&#41; count = 0 &#160; # continue until when the [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Used a NumPy array. Doesn&#8217;t work if the diagonal+1s are white of course.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> Image
<span style="color: #ff7700;font-weight:bold;">from</span> numpy <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">array</span>, zeros, uint8
&nbsp;
line = Image.<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'wire.png'</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;"># third dimension is for colours</span>
a = zeros<span style="color: black;">&#40;</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">100</span>, <span style="color: #ff4500;">100</span>, <span style="color: #ff4500;">3</span><span style="color: black;">&#41;</span>, dtype=uint8<span style="color: black;">&#41;</span>
&nbsp;
step = <span style="color: #dc143c;">array</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
position = <span style="color: #dc143c;">array</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span>, <span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
count = <span style="color: #ff4500;">0</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># continue until when the next spot expected to be unfilled is filled</span>
<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">max</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#91;</span><span style="color: #008000;">tuple</span><span style="color: black;">&#40;</span>position<span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>:
	<span style="color: #808080; font-style: italic;"># paint colour</span>
	a<span style="color: black;">&#91;</span><span style="color: #008000;">tuple</span><span style="color: black;">&#40;</span>position<span style="color: black;">&#41;</span><span style="color: black;">&#93;</span> = <span style="color: #dc143c;">array</span><span style="color: black;">&#40;</span>line.<span style="color: black;">getpixel</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>count, <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;"># if reached a wall</span>
	<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">max</span><span style="color: black;">&#40;</span>position + step<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">99</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #008000;">min</span><span style="color: black;">&#40;</span>position + step<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&lt;</span> <span style="color: #ff4500;">0</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #008000;">max</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#91;</span><span style="color: #008000;">tuple</span><span style="color: black;">&#40;</span>position + step<span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>:
		<span style="color: #808080; font-style: italic;"># change direction</span>
		step = <span style="color: black;">&#40;</span><span style="color: #008000;">abs</span><span style="color: black;">&#40;</span>step<span style="color: black;">&#41;</span> ^ <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">*</span> <span style="color: black;">&#40;</span>-step<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> <span style="color: #ff7700;font-weight:bold;">if</span> step<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> <span style="color: #ff7700;font-weight:bold;">else</span> step<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;"># advance</span>
	position += step
	count += <span style="color: #ff4500;">1</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># convert to image</span>
Image.<span style="color: black;">fromarray</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>.<span style="color: black;">save</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'swirl.jpeg'</span><span style="color: black;">&#41;</span></pre></div></div>

</pre>
<div class="shr-publisher-325"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Fthoughts%2Fpython-challenge-level-14-italy-%25e2%2580%2593-code%2F' data-shr_title='Python+Challenge+Level+14%3A+Italy+%E2%80%93+Code'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Fthoughts%2Fpython-challenge-level-14-italy-%25e2%2580%2593-code%2F' data-shr_title='Python+Challenge+Level+14%3A+Italy+%E2%80%93+Code'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/thoughts/python-challenge-level-14-italy-%e2%80%93-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Convert Numpy Array to Tuple</title>
		<link>http://tech.xster.net/tips/how-to-convert-numpy-array-to-tuple/</link>
		<comments>http://tech.xster.net/tips/how-to-convert-numpy-array-to-tuple/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 01:43:00 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[NumPy]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[tuple]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=318</guid>
		<description><![CDATA[a = array&#40;&#40;1, 2, 3&#41;&#41; print a &#62;&#62;&#62; array&#40;&#91;1, 2, 3&#93;&#41; tuple&#40;a&#41; &#62;&#62;&#62; &#40;1, 2, 3&#41; Pretty lame right?]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic -->
<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">a = <span style="color: #dc143c;">array</span><span style="color: black;">&#40;</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">2</span>, <span style="color: #ff4500;">3</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> a
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #dc143c;">array</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">2</span>, <span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
<span style="color: #008000;">tuple</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span>, <span style="color: #ff4500;">2</span>, <span style="color: #ff4500;">3</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Pretty lame right?</p>
<div class="shr-publisher-318"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fhow-to-convert-numpy-array-to-tuple%2F' data-shr_title='How+to+Convert+Numpy+Array+to+Tuple'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fhow-to-convert-numpy-array-to-tuple%2F' data-shr_title='How+to+Convert+Numpy+Array+to+Tuple'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/how-to-convert-numpy-array-to-tuple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ABAP Get REST XML and Parse XML</title>
		<link>http://tech.xster.net/tips/abap-get-rest-xml-and-parse-xml/</link>
		<comments>http://tech.xster.net/tips/abap-get-rest-xml-and-parse-xml/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 21:49:49 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[ABAP]]></category>
		<category><![CDATA[binary]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[SAP]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=307</guid>
		<description><![CDATA[This tutorial will help you use ABAP to connect to any web service and process the resulting output. ABAP has native support for XML so it will be easiest to get your information in XML format rather than JSON and others. For this example, I will use a CBC&#8217;s news feed but it can be [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>This tutorial will help you use ABAP to connect to any web service and process the resulting output. ABAP has native support for XML so it will be easiest to get your information in XML format rather than JSON and others. For this example, I will use a CBC&#8217;s news feed but it can be Digg top stories, Twitter, anything. The XML should look something like the picture below where each news article is enclosed in &lt;ITEM&gt; tags.<span id="more-307"></span></p>
<p><img class="alignright size-full wp-image-308" title="XML" src="http://tech.xster.net/wp-content/uploads/2011/01/XML.jpg" alt="CBC news XML" width="457" height="274" /></p>
<p>First, you need to use cl_http_client to create an instance of if_http_client for your get.</p>

<div class="wp_syntax"><div class="code"><pre class="abap" style="font-family:monospace;"><span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">DATA</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">client</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">TYPE</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">REF TO</span> if_http_client<span style="color: #808080;">.</span>
&nbsp;
<span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">CALL METHOD</span> cl_http_client<span style="color: #800080;">=</span><span style="color: #808080;">&amp;</span>gt;create
  <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">EXPORTING</span>
    host          <span style="color: #800080;">=</span> <span style="color: #4da619;">'rss.cbc.ca'</span>
    service       <span style="color: #800080;">=</span> <span style="color: #4da619;">'80'</span>
    proxy_host    <span style="color: #800080;">=</span> <span style="color: #4da619;">'my.proxy.com'</span>
    proxy_service <span style="color: #800080;">=</span> <span style="color: #4da619;">'8080'</span>
    scheme        <span style="color: #800080;">=</span> <span style="color: #3399ff;">1</span>
  <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">IMPORTING</span>
    <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">client</span>        <span style="color: #800080;">=</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">client</span><span style="color: #808080;">.</span></pre></div></div>

<p>Use proxy_host/proxy_service if you have a proxy server you need to go through. Scheme = 1 indicates HTTP, 2 is HTTPS.  Next, you would set some parameters of the client.</p>

<div class="wp_syntax"><div class="code"><pre class="abap" style="font-family:monospace;">client<span style="color: #808080;">-&gt;</span><span style="color: #202020;">request</span><span style="color: #808080;">-&gt;</span><span style="color: #202020;">set_method</span><span style="color: #808080;">&#40;</span> if_http_request<span style="color: #808080;">=&gt;</span><span style="color: #202020;">co_request_method_get</span> <span style="color: #808080;">&#41;</span><span style="color: #808080;">.</span>
client<span style="color: #808080;">-&gt;</span><span style="color: #202020;">request</span><span style="color: #808080;">-&gt;</span><span style="color: #202020;">set_version</span><span style="color: #808080;">&#40;</span> if_http_request<span style="color: #808080;">=&gt;</span><span style="color: #202020;">co_protocol_version_1_1</span> <span style="color: #808080;">&#41;</span><span style="color: #808080;">.</span>
cl_http_utility<span style="color: #808080;">=&gt;</span><span style="color: #202020;">set_request_uri</span><span style="color: #808080;">&#40;</span> request <span style="color: #800080;">=</span> client<span style="color: #808080;">-&gt;</span><span style="color: #202020;">request</span> uri <span style="color: #800080;">=</span> <span style="color: #4da619;">'/lineup/topstories.xml'</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">.</span></pre></div></div>

<p>which puts your request as a GET method, sets the protocol to use HTTP 1.1 and sets your destination address. Then you perform your actual request and get the response synchronously:</p>

<div class="wp_syntax"><div class="code"><pre class="abap" style="font-family:monospace;">client<span style="color: #808080;">-&gt;</span><span style="color: #202020;">send</span><span style="color: #808080;">&#40;</span> <span style="color: #808080;">&#41;</span><span style="color: #808080;">.</span>
client<span style="color: #808080;">-&gt;</span><span style="color: #202020;">receive</span><span style="color: #808080;">&#40;</span> <span style="color: #808080;">&#41;</span><span style="color: #808080;">.</span>
&nbsp;
<span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">DATA</span> bin <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">TYPE</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">xstring</span><span style="color: #808080;">.</span>
bin <span style="color: #800080;">=</span> client<span style="color: #808080;">-&gt;</span><span style="color: #202020;">response</span><span style="color: #808080;">-&gt;</span><span style="color: #202020;">get_data</span><span style="color: #808080;">&#40;</span> <span style="color: #808080;">&#41;</span><span style="color: #808080;">.</span></pre></div></div>

<p>This gives you a response in binary format. The next steps converts it into string:</p>

<div class="wp_syntax"><div class="code"><pre class="abap" style="font-family:monospace;"><span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">DATA</span> conv <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">TYPE</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">REF TO</span> cl_abap_conv_in_ce<span style="color: #808080;">.</span>
<span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">DATA</span> response <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">TYPE</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">string</span><span style="color: #808080;">.</span>
&nbsp;
conv <span style="color: #800080;">=</span> cl_abap_conv_in_ce<span style="color: #808080;">=&gt;</span><span style="color: #202020;">create</span><span style="color: #808080;">&#40;</span> <span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">input</span> <span style="color: #800080;">=</span> bin <span style="color: #808080;">&#41;</span><span style="color: #808080;">.</span>
conv<span style="color: #808080;">-&gt;</span><span style="color: #202020;">read</span><span style="color: #808080;">&#40;</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">IMPORTING</span> <span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">data</span> <span style="color: #800080;">=</span> response<span style="color: #808080;">&#41;</span><span style="color: #808080;">.</span>
&nbsp;
client<span style="color: #808080;">-&gt;</span><span style="color: #202020;">close</span><span style="color: #808080;">&#40;</span> <span style="color: #808080;">&#41;</span><span style="color: #808080;">.</span></pre></div></div>

<p>Now your XML response is in the response variable. Now to turn the XML into a series of ABAP objects. To do so, we will make use of ABAP&#8217;s CALL TRANSFORMATION keyword. It is well documented in the help documentations and makes use of a XSLT (or XSLT-like depending on the method you choose) template to transform XML into ABAP objects and vice versa. 2 native methods exist. You can either use the XSLT method in which case ABAP makes an identity transformation of ABAP into pseudo-XML which you can then manipulate into XML using your XSLT template. This results in a 2 step operation and is not symmetric. You can also use SAP&#8217;s proprietary Simple Transformation method where you define a XSLT-like template which makes the direct transformation between XML and ABAP objects. For this example, I will use the Simple Transformation method.  Looking at the XML, there are some header tags for the feed, then there are news articles each in a &lt;ITEM&gt; tag with its own properties. My objective will be to get the title and description of each article. For it, I first create a structure in ABAP to match my desired data.</p>

<div class="wp_syntax"><div class="code"><pre class="abap" style="font-family:monospace;"><span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">TYPES</span><span style="color: #808080;">:</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">BEGIN OF</span> news<span style="color: #808080;">,</span>
  <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">title</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">TYPE</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">string</span><span style="color: #808080;">,</span>
  description <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">TYPE</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">string</span><span style="color: #808080;">,</span>
<span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">END OF</span> news<span style="color: #808080;">.</span>
&nbsp;
<span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">DATA</span><span style="color: #808080;">:</span> feed <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">TYPE</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">TABLE OF</span> news<span style="color: #808080;">,</span>
      article <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">TYPE</span> news<span style="color: #808080;">.</span>
&nbsp;
<span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">CALL TRANSFORMATION</span> z_cbcnews
  <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">SOURCE</span> XML response
  <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">RESULT</span> root <span style="color: #800080;">=</span> feed<span style="color: #808080;">.</span></pre></div></div>

<p>after setting up the variables and types for the news, I call CALL TRANSFORMATION. Double clicking z_cbcnews will let me define my Simple Transformation template.</p>

<div class="wp_syntax"><div class="code"><pre class="abap" style="font-family:monospace;"><span style="color: #800080;">&lt;</span>?sap<span style="color: #808080;">.</span>transform <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">simple</span>?<span style="color: #800080;">&gt;</span>
<span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span>transform xmlns<span style="color: #808080;">:</span>tt<span style="color: #800080;">=</span><span style="color: #808080; font-style: italic;">&quot;http://www.sap.com/transformation-templates&quot;&gt;</span>
&nbsp;
  <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span>root <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">name</span><span style="color: #800080;">=</span><span style="color: #808080; font-style: italic;">&quot;ROOT&quot;/&gt;</span>
&nbsp;
  <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span>template<span style="color: #800080;">&gt;</span>
    <span style="color: #800080;">&lt;</span>rss<span style="color: #800080;">&gt;</span>
      <span style="color: #800080;">&lt;</span>channel<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span>title<span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>title<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span>link<span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>link<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span>description<span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>description<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span>language<span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>language<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span>lastBuildDate<span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>lastBuildDate<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span>copyright<span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>copyright<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span>docs<span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>docs<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span>image<span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span>title<span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>title<span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span>url<span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>url<span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span>link<span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
          <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>link<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>image<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #000066; text-transform: uppercase; font-weight: bold; zzz:control;">loop</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">name</span><span style="color: #800080;">=</span><span style="color: #808080; font-style: italic;">&quot;news&quot; ref=&quot;.ROOT&quot;&gt;</span>
          <span style="color: #800080;">&lt;</span>item<span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span>title<span style="color: #800080;">&gt;</span>
              <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">value</span> ref<span style="color: #800080;">=</span><span style="color: #808080; font-style: italic;">&quot;$news.title&quot;/&gt;</span>
            <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>title<span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span>link<span style="color: #800080;">&gt;</span>
              <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>link<span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span>guid<span style="color: #800080;">&gt;</span>
              <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>guid<span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span>pubDate<span style="color: #800080;">&gt;</span>
              <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">skip</span><span style="color: #808080;">/</span><span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>pubDate<span style="color: #800080;">&gt;</span>
            <span style="color: #800080;">&lt;</span>description<span style="color: #800080;">&gt;</span>
&nbsp;
              <span style="color: #800080;">&lt;</span>tt<span style="color: #808080;">:</span><span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">value</span> ref<span style="color: #800080;">=</span><span style="color: #808080; font-style: italic;">&quot;$news.description&quot;/&gt;</span>
            <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>description<span style="color: #800080;">&gt;</span>
&nbsp;
          <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>item<span style="color: #800080;">&gt;</span>
        <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>tt<span style="color: #808080;">:</span>loop<span style="color: #800080;">&gt;</span>
      <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>channel<span style="color: #800080;">&gt;</span>
    <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>rss<span style="color: #800080;">&gt;</span>
  <span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>tt<span style="color: #808080;">:</span>template<span style="color: #800080;">&gt;</span>
<span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>tt<span style="color: #808080;">:</span>transform<span style="color: #800080;">&gt;</span>
<span style="color: #800080;">&lt;</span><span style="color: #808080;">/</span>tt<span style="color: #808080;">:</span>transform<span style="color: #800080;">&gt;</span></pre></div></div>

<p>Following the XML format of the CBC news feed, I first ignored all the header elements. Then I looped into variables of type news in which had a  tag. Then the &lt;ITEM&gt;&#8217;s  and &lt;DESCRIPTION&gt; are matched into attributes of the news structure. Since the CALL TRANSFORMATION is call to output a table of news (feed), I end up with an internal table of news which I can then manipulate with ABAP such as:</p>

<div class="wp_syntax"><div class="code"><pre class="abap" style="font-family:monospace;"><span style="color: #000066; text-transform: uppercase; font-weight: bold; zzz:control;">LOOP AT</span> feed <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">INTO</span> article<span style="color: #808080;">.</span>
  <span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">WRITE</span><span style="color: #808080;">:</span> <span style="color: #808080;">/</span> <span style="color: #4da619;">'=================================================================='</span><span style="color: #808080;">.</span>
  <span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">WRITE</span><span style="color: #808080;">:</span> <span style="color: #808080;">/</span> article<span style="color: #808080;">-</span><span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">title</span><span style="color: #808080;">.</span>
  <span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">WRITE</span><span style="color: #808080;">:</span> <span style="color: #808080;">/</span> <span style="color: #4da619;">'=================================================================='</span><span style="color: #808080;">,</span> <span style="color: #808080;">/.</span>
  <span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">WRITE</span><span style="color: #808080;">:</span> <span style="color: #808080;">/</span> article<span style="color: #808080;">-</span>description<span style="color: #808080;">,</span> <span style="color: #808080;">/,</span> <span style="color: #808080;">/,</span> <span style="color: #808080;">/.</span>
<span style="color: #000066; text-transform: uppercase; font-weight: bold; zzz:control;">ENDLOOP</span><span style="color: #808080;">.</span></pre></div></div>

<p>The end result should look something like this</p>
<p style="text-align: center;"><a href="http://tech.xster.net/wp-content/uploads/2011/01/result.jpg"><img class="size-full wp-image-312 aligncenter" title="Result" src="http://tech.xster.net/wp-content/uploads/2011/01/result.jpg" alt="Output of web service" width="722" height="484" /></a></p>
<div class="shr-publisher-307"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fabap-get-rest-xml-and-parse-xml%2F' data-shr_title='ABAP+Get+REST+XML+and+Parse+XML'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fabap-get-rest-xml-and-parse-xml%2F' data-shr_title='ABAP+Get+REST+XML+and+Parse+XML'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/abap-get-rest-xml-and-parse-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ctrl-Alt Hotkey Conflict with Virtual Machines</title>
		<link>http://tech.xster.net/tips/ctrl-alt-hotkey-conflict-with-virtual-machines/</link>
		<comments>http://tech.xster.net/tips/ctrl-alt-hotkey-conflict-with-virtual-machines/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 17:54:38 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[hotkey]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[tty]]></category>
		<category><![CDATA[virtual machine]]></category>
		<category><![CDATA[virtualisation]]></category>
		<category><![CDATA[vm]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=304</guid>
		<description><![CDATA[On most virtualisation software like VMWare&#8217;s etc, the guest machine&#8217;s hotkeys which requires ctrl-alt (such as ctrl-alt-f1 etc for tty change in Linux) can be blocked because ctrl-alt is used to release mouse/keyboard with the VM software. If you use it only occasionally, you can first temporarily disable the release hotkey by pressing ctrl-alt-space then [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>On most virtualisation software like VMWare&#8217;s etc, the guest machine&#8217;s hotkeys which requires ctrl-alt (such as ctrl-alt-f1 etc for tty change in Linux) can be blocked because ctrl-alt is used to release mouse/keyboard with the VM software. If you use it only occasionally, you can first temporarily disable the release hotkey by pressing ctrl-alt-space then your intended hotkey such as ctrl-alt-f1</p>
<p><a href="http://www.easyvmx.com/cgi-bin/ikonboard/ikonboard.cgi?act=ST;f=3;t=4;&amp;#top">Source</a></p>
<div class="shr-publisher-304"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fctrl-alt-hotkey-conflict-with-virtual-machines%2F' data-shr_title='Ctrl-Alt+Hotkey+Conflict+with+Virtual+Machines'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fctrl-alt-hotkey-conflict-with-virtual-machines%2F' data-shr_title='Ctrl-Alt+Hotkey+Conflict+with+Virtual+Machines'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/ctrl-alt-hotkey-conflict-with-virtual-machines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare Tools vmware-open-vm-tools-kmod Install Issue</title>
		<link>http://tech.xster.net/tips/vmware-tools-vmware-open-vm-tools-kmod-install-issue/</link>
		<comments>http://tech.xster.net/tips/vmware-tools-vmware-open-vm-tools-kmod-install-issue/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 20:40:41 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=302</guid>
		<description><![CDATA[Trying to install VMWare tools from packages.vmware.com/tools repository in Ubuntu but getting a error while installing packages? There seems to be package dependency going back to open-vm-tools-kmod-generic but it doesn&#8217;t exist. When you try to install the next level of package, it would say &#8220;PreDepends: vmware-open-vm-tools-kmod-&#8230; but it is not installable&#8221; Unfortunately the VMWare Installation Guide [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Trying to install VMWare tools from <a href="http://packages.vmware.com/tools ">packages.vmware.com/tools</a> repository in Ubuntu but getting a error while installing packages? There seems to be package dependency going back to open-vm-tools-kmod-generic but it doesn&#8217;t exist. When you try to install the next level of package, it would say</p>
<p>&#8220;PreDepends: vmware-open-vm-tools-kmod-&#8230; but it is not installable&#8221;</p>
<p>Unfortunately the VMWare <a href="http://www.vmware.com/pdf/osp_install_guide.pdf">Installation Guide</a> isn&#8217;t clear on this matter whereas the Ubuntu <a href="https://help.ubuntu.com/community/VMware/Tools">documentation</a> is much better. It shows that you can either use the open source version directly available via apt-get or you can build the kmod (kernel mods) from source using the source files in the VMWare repository.</p>
<div class="shr-publisher-302"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fvmware-tools-vmware-open-vm-tools-kmod-install-issue%2F' data-shr_title='VMWare+Tools+vmware-open-vm-tools-kmod+Install+Issue'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fvmware-tools-vmware-open-vm-tools-kmod-install-issue%2F' data-shr_title='VMWare+Tools+vmware-open-vm-tools-kmod+Install+Issue'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/vmware-tools-vmware-open-vm-tools-kmod-install-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

