<?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>coding &#187; blog</title>
	<atom:link href="http://www.coding.com.br/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coding.com.br</link>
	<description>have you coded today?</description>
	<lastBuildDate>Thu, 18 Aug 2011 17:29:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Facebook &#8220;Like&#8221; button to any site</title>
		<link>http://www.coding.com.br/blog/facebook-like-button-to-any-site/</link>
		<comments>http://www.coding.com.br/blog/facebook-like-button-to-any-site/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 04:00:26 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1637</guid>
		<description><![CDATA[My dirty code to quickly add functionality of Facebook  button to websites that I visit.
javascript:void(location.href=&#8217;http://www.facebook.com/plugins/like.php?href=&#8217;+encodeURIComponent(location.href))
To use just move the link below to your bookmarks bar.
I like

I don’t know if it’s the correct way… just opted for that because I want share some content that aren’t integrated with Facebook API.
]]></description>
			<content:encoded><![CDATA[<p>My <em>dirty</em> code to quickly add functionality of Facebook <a href="http://www.coding.com.br/wp-content/uploads/2011/03/fb_like.png"><img class="alignnone size-full wp-image-1640" title="Facebook Like Button" src="http://www.coding.com.br/wp-content/uploads/2011/03/fb_like.png" alt="" width="55" height="27" /></a> button to websites that I visit.</p>
<p>javascript:void(location.href=&#8217;http://www.facebook.com/plugins/like.php?href=&#8217;+encodeURIComponent(location.href))</p>
<p style="text-align: center;">To use just <strong>move</strong> the link below to your bookmarks bar.</p>
<p style="text-align: center;"><strong><a href="javascript:void(location.href='http://www.facebook.com/plugins/like.php?href='+encodeURIComponent(location.href))">I like</a></strong></p>
<p><center><iframe src="http://www.screenr.com/embed/sWo" width="650" height="396" frameborder="0"></iframe></center></p>
<p>I don’t know if it’s the correct way… just opted for that because I want share some content that aren’t integrated with Facebook API.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/facebook-like-button-to-any-site/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>tablets</title>
		<link>http://www.coding.com.br/blog/tablets/</link>
		<comments>http://www.coding.com.br/blog/tablets/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 00:43:46 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1484</guid>
		<description><![CDATA[Today I was curious about one tablet commercialized at Walgreens. Probably if you are looking for a really cheap tablet running Android you&#8217;ll check DealExtreme, FocalPrice, etc (see this, this and also this)  but when the largest drugstore chain in the EUA starts selling low cost tablets you just confirm the thesis that China is [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Today I was curious about one <a href="http://www.walgreens.com/search/results.jsp?Ntt=tablet&amp;y=0&amp;N=110018&amp;x=0" target="_blank">tablet</a> commercialized at <a href="http://www.walgreens.com/" target="_blank">Walgreens</a>. Probably if you are looking for a <em>really</em> cheap tablet running <a href="http://en.wikipedia.org/wiki/Android_%28operating_system%29" target="_blank">Android</a> you&#8217;ll <a href="http://www.dealextreme.com/search.dx/search.tablet%20android#317" target="_blank">check</a> DealExtreme, FocalPrice, etc (see <a href="http://www.dealextreme.com/details.dx/sku.44080" target="_blank">this</a>, <a href="http://www.focalprice.com/CE009W/Portable_2GB_Max_32GB_Android_7_TFT_LCD_Touch_Screen_MID_Tablet_Pad_Netbook__White.html" target="_blank">this</a> and also <a href="http://www.dealextreme.com/details.dx/sku.39169" target="_blank">this</a>)  but when the largest drugstore chain in the EUA starts selling low cost tablets you just confirm the thesis that China is flooding world&#8217;s market with prices that make a lot of people re-think values. Even with low-quality China brands are gain market share. The uninitiated user don&#8217;t have the distinction about technical differences and mostly are taken by the price. If you search for Walgreen&#8217;s tablet <a href="http://www.maylonggroup.com/M-150_MID.htm" target="_blank">specs</a> you can note that instead following the trends in usability opting for a <a href="http://en.wikipedia.org/wiki/Capacitive_sensing" target="_blank">capacitive</a> touchscreen they used a <a href="http://en.wikipedia.org/wiki/Resistive_touchscreen" target="_blank">resistive</a> one. The processor is a Via VM8505+ based on ARM9 core, this chip comes without multimidia capabilities like Texas Instruments OMAP355x or Freescales IMx51 series. Poor processing means that applications will not run smoothly and 256MB of RAM restricts the number of apps running simultaneously. If you are interested about Via processor check this <a href="http://groups.google.com/group/vt8500-wm8505-linux-kernel/browse_thread/thread/50ade80cfa9aecc4/1b45a277b6acd252?show_docid=1b45a277b6acd252&amp;pli=1" target="_blank">link</a>. Keep in mind that today everything is software, in Android case choose the most recent version is always recommended but the company is commited with updates? Is it <a href="http://market.android.com" target="_blank">Market</a> available?</p>
<p style="text-align: justify;">I&#8217;m not in favor of disposable objects, even for not short-term durability like mostly gadgets today.  Indeed every two or three years the technologies change forcing us to adapt. If you bought low quality designs you are accelerating this process not to mention that the true usability goes away. Watch your needs before buy, not always the most hardware capable is the best option, but poors designs always affect in some way&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/tablets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TTMMHTW: web, qt, foss, openocd, freertos</title>
		<link>http://www.coding.com.br/blog/ttmmhtw/ttmmhtw-web-qt-foss-openocd-freertos/</link>
		<comments>http://www.coding.com.br/blog/ttmmhtw/ttmmhtw-web-qt-foss-openocd-freertos/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 23:11:03 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[ttmmhtw]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1405</guid>
		<description><![CDATA[Some things that made me happy this week.

One approach to interoperability on mobile operating systems is creating your apps with  jQuery. It runs on Symbian, MeeGo, Android, iOS, Bada, Blackberry, Windows Mobile and Palm WebOS. 
Following this trend an post on embedding Qt Widget into QtWebkit.
An Analog Device white-paper discussing Free and Open-Source Software—An Analog Devices [...]]]></description>
			<content:encoded><![CDATA[<p>Some things that made me happy this week.</p>
<ul>
<li>One approach to interoperability on mobile operating systems is creating your apps with  <strong><a href="http://jquerymobile.com/" target="_blank">jQuery</a>. </strong>It runs on <em>Symbian, MeeGo, Android, iOS, Bada, Blackberry, Windows Mobile and Palm WebOS. </em></li>
<li>Following this trend an <em>post</em> on <a href="http://daniel-albuschat.blogspot.com/2008/12/embedding-qt-widgets-into-qtwebkit.html"><strong>embedding Qt Widget into QtWebkit</strong></a>.</li>
<li>An Analog Device white-paper discussing <a href="http://www.analog.com/library/analogdialogue/archives/44-03/foss.html" target="_blank"><strong>Free and Open-Source Software—An Analog Devices Perspective</strong></a> (<a href="http://www.analog.com/library/analogdialogue/archives/44-03/foss.pdf" target="_blank">pdf</a>).</li>
<li>Software/Hardware Integration Lab (<a href="http://www.lisha.ufsc.br" target="_blank">LISHA</a>) opens the project <a href="http://epos.lisha.ufsc.br/" target="_blank"><strong>Embedded Parallel Operating System</strong></a> (EPOS) to community.</li>
<li>I started making some tests with <a href="http://www.impactlinux.com/aboriginal/" target="_blank">Aboriginal Linux</a> on a <a href="http://www.flickr.com/photos/maluta/4904596101/sizes/l/in/photostream/" target="_blank">multicore</a> machine.</li>
<li><a href="http://www.freertos.org/Documentation/FreeRTOS-documentation-and-book.html#FreeRTOS-Book-LPC17xx" target="_blank"><strong>Bought</strong></a><strong> </strong>the book  &#8221;<em>Using the FreeRTOS Real Time Kernel</em>&#8221; NXP LCP17xx Edition by Richard Barry (<a href="http://ics.nxp.com/literature/books/microcontrollers/pdf/using.freertos.lpc17xx.summary.pdf" target="_blank">preview</a>)</li>
<li>The <a href="http://bit.ly/d8VJvG" target="_blank">OpenOCD</a> worked with my LPC17xx board using <a href="http://en.wikipedia.org/wiki/Wiggler_(JTAG)" target="_blank">parallel port</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/ttmmhtw/ttmmhtw-web-qt-foss-openocd-freertos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TTMMHTW: multitouch, rtos, productivity, qml, &#8230;</title>
		<link>http://www.coding.com.br/blog/ttmmhtw-multitouch-rtos-productivity-qml/</link>
		<comments>http://www.coding.com.br/blog/ttmmhtw-multitouch-rtos-productivity-qml/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 03:48:10 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[ttmmhtw]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1332</guid>
		<description><![CDATA[Some things that made me happy this week.

Emulator for Traktor Pro, running on Töken multitouch device (video).
Microkernel Construction &#8211; this lecture focuses on current developments in the area of 2nd generation microkernels.
Recent posts from Marcelo Barros blog discussing his works on RTOS: part V part VI a finally part VII (also all parts).
Productivity hints, tips, [...]]]></description>
			<content:encoded><![CDATA[<p>Some things that made me happy this week.</p>
<ul>
<li><a rel="nofollow" href="http://www.pablomartin.com/emulator/" target="_blank">Emulator</a> for Traktor Pro, running on Töken multitouch device (<a rel="nofollow" href="http://www.youtube.com/watch?v=OVD_Lvv4UOI" target="_blank"><strong>video</strong></a>).</li>
<li>Microkernel Construction &#8211; this <a rel="nofollow" href="http://www.inf.tu-dresden.de/index.php?node_id=1317" target="_blank"><strong>lecture</strong></a> focuses on current developments in the area of 2nd generation microkernels.</li>
<li>Recent posts from Marcelo Barros blog discussing his works on RTOS: part <strong><a href="http://jedizone.wordpress.com/2010/08/07/sistema-operacional-de-tempo-real-faco-voce-mesmo-v/" target="_blank">V</a></strong> part <strong><a href="http://jedizone.wordpress.com/2010/08/07/sistema-operacional-de-tempo-real-faco-voce-mesmo-vi/" target="_blank">VI</a></strong> a <em>finally</em> part <strong><a href="http://jedizone.wordpress.com/2010/08/07/sistema-operacional-de-tempo-real-faco-voce-mesmo-vii/" target="_blank">VII</a></strong> (also <a href="http://jedizone.wordpress.com/2010/08/11/ajude-a-divulgar-a-serie/" target="_blank">all parts</a>).</li>
<li><strong><a rel="nofollow" href="http://matt.might.net/articles/productivity-tips-hints-hacks-tricks-for-grad-students-academics/">Productivity</a></strong> hints, tips, hacks and tricks for graduate students and professors.</li>
<li>External HDD that<strong> <a rel="nofollow" href="http://www.mintpass.com/select/select_detail.asp?Idx=29" target="_blank">looks like</a></strong> a &#8220;Hard&#8221;.</li>
<li>The <strong><a href="http://www3.open.ac.uk/about/" target="_blank">Open University</a></strong> <a rel="nofollow" href="http://en.wikipedia.org/wiki/The_Open_University">concept</a>.</li>
<li><strong><a rel="nofollow" href="http://swtch.com/libtask/">Libtask</a></strong>: a Coroutine Library for C and Unix.</li>
<li><a rel="nofollow" href="http://www.twitter.com/bagder">Daniel Stenberg</a> attempt to document the <a href="http://daniel.haxx.se/docs/ftp-vs-http.html">primary differences</a> between FTP and  HTTP.</li>
<li>The <a rel="nofollow" href="http://matt.might.net/articles/phd-school-in-pictures/">illustrated guide</a> to a Ph.D.</li>
<li>Qt blog <a href="http://labs.trolltech.com/blogs/2010/08/10/qml3d-demo/" target="_blank">showing</a> an QML tutorial (<strong><a href="http://www.youtube.com/watch?v=OXcxFZbKUNI" target="_blank">video</a></strong>).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/ttmmhtw-multitouch-rtos-productivity-qml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TTMMHTW: meego, rtos, android, qemu, python, dojo</title>
		<link>http://www.coding.com.br/blog/ttmmhtw/ttmmhtw-meego-rtos-android-qemu-python-dojo/</link>
		<comments>http://www.coding.com.br/blog/ttmmhtw/ttmmhtw-meego-rtos-android-qemu-python-dojo/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 08:42:58 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[ttmmhtw]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1207</guid>
		<description><![CDATA[Some things that made me happy this week.


Video MeeGo on BeagleBoard and How-to from scratch.
NuttX RTOS that is ANSI/POSIX compliant.
ShowMeDo &#8211; screencasts to learn with the open source community.
BRTOS  &#8211; My friend Marcelo Barros published his works on Real-time Operating System for MSP430 [code repository ] and explanations (portuguese) sub-divided in part II part [...]]]></description>
			<content:encoded><![CDATA[<div>Some things that made me happy this week.</div>
<div>
<ul>
<li><strong><a href="http://youtu.be/LdKcNOrC5e4" target="_blank">Video</a></strong> MeeGo on BeagleBoard and <strong><a href="http://wiki.meego.com/ARM/Meego_on_Beagleboard_from_scratch" target="_blank">How-to</a></strong> from scratch.</li>
<li><strong><a href="http://nuttx.sourceforge.net/" target="_blank">NuttX</a></strong> RTOS that is ANSI/POSIX compliant.</li>
<li><strong><a href="http://showmedo.com/" target="_blank">ShowMeDo</a></strong> &#8211; <em>screencasts</em> to learn with the open source community.</li>
<li>BRTOS  &#8211; My friend <a href="http://www.twitter.com/marcelobarros" target="_blank">Marcelo Barros</a> <strong><a href="http://jedizone.wordpress.com/2010/08/02/sistema-operacional-de-tempo-real-faco-voce-mesmo-i/" target="_blank">published</a></strong> his works on Real-time Operating System for <a href="http://en.wikipedia.org/wiki/MSP430" target="_blank">MSP430</a> [<strong><a href="http://code.google.com/p/basicrtos/" target="_blank">code repository</a></strong> ] and explanations (<em>portuguese</em>) sub-divided in part <a href="http://jedizone.wordpress.com/2010/08/03/sistema-operacional-de-tempo-real-faco-voce-mesmo-ii">II</a> part <a href="http://jedizone.wordpress.com/2010/08/04/sistema-operacional-de-tempo-real-faco-voce-mesmo-iii/" target="_blank">III</a> and part <a href="http://jedizone.wordpress.com/2010/08/06/sistema-operacional-de-tempo-real-faco-voce-mesmo-iv/" target="_blank">IV</a>.</li>
<li><a href="http://hackaday.com" target="_blank">Hack a Day</a> series on Android  Development 101 <strong><a href="http://hackaday.com/2010/07/15/android-dev-101-%E2%80%93-part-1hello-world/" target="_blank">Part 1</a></strong> (<em>Hello World</em>)   <strong><a href="http://hackaday.com/2010/07/19/android-development-101-part-2improved-hello-world/" target="_blank">Part 2</a> </strong> (<em>Hello World improved</em>)  <strong><a href="http://hackaday.com/2010/07/21/android-development-101-part-3introduction-to-databases/" target="_blank">Part 3</a></strong> (<em>Introduction to Databases</em>)  <a href="http://hackaday.com/2010/08/02/android-development-101-part-4advanced-databasegui-code-and-ddms/" target="_blank"><strong>Part 4</strong></a> (<em>Advanced Database/GUI Code and DDMS</em>) <strong><a href="http://hackaday.com/2010/08/05/android-development-101-part-5droiddraw-information-tracker-completed/" target="_blank">Part 5</a></strong> (<em>DroidDraw &amp; Information Tracker Completed</em>)</li>
<li>Writing kernels that boot with Qemu and Grub &#8211; a <strong><a href="http://www.cs.vu.nl/~herbertb/misc/writingkernels.txt " target="_blank">tutorial</a></strong> (also <a href="http://www.osdever.net/bkerndev/index.php" target="_blank">this</a>)</li>
<li>Release of PySide <a href="http://www.pyside.org/2010/08/pyside-v0-4-0-%E2%80%99alisson%E2%80%99-is-now-available/" target="_blank"><strong>0.4.0</strong></a> including Qt Mobility and Mac OS X support.</li>
<li>5 min. <strong><a href="http://www.youtube.com/watch?v=gav9fLVkZQc" target="_blank">video</a></strong> explaining <a href="http://www.codingdojo.org/" target="_blank">Coding Dojo</a> basics.</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/ttmmhtw/ttmmhtw-meego-rtos-android-qemu-python-dojo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TTMMHTW: math, research, network, syscalls and linux</title>
		<link>http://www.coding.com.br/blog/ttmmhtw/ttmmhtw-math-research-network-syscalls-and-linux/</link>
		<comments>http://www.coding.com.br/blog/ttmmhtw/ttmmhtw-math-research-network-syscalls-and-linux/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 02:44:32 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[ttmmhtw]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1196</guid>
		<description><![CDATA[Some things that made me happy this week.

Sage combines the power of many existing open-source packages into a common Python-based interface. http://www.sagemath.org
Useful things to know about Phd thesis research http://www.cs.caltech.edu/~weixl/research/experience/phd-thesis.txt
Just another free touch typing tutor program http://klavaro.sourceforge.net/en/
poll vs select vs event-based http://daniel.haxx.se/docs/poll-vs-select.html
Free Electrons presentation at 11th Libre Software Meeting about Linux Kernel: devices and drivers [...]]]></description>
			<content:encoded><![CDATA[<p>Some things that made me happy this week.</p>
<ul>
<li>Sage combines the power of many existing open-source packages into a common Python-based interface. <a href="http://www.sagemath.org" target="_blank">http://www.sagemath.org</a></li>
<li>Useful things to know about Phd thesis research <a href="http://www.cs.caltech.edu/~weixl/research/experience/phd-thesis.txt" target="_blank">http://www.cs.caltech.edu/~weixl/research/experience/phd-thesis.txt</a></li>
<li>Just another free touch typing tutor program <a href="http://klavaro.sourceforge.net/en/" target="_blank">http://klavaro.sourceforge.net/en/</a></li>
<li>poll vs select vs event-based <a href="http://daniel.haxx.se/docs/poll-vs-select.html" target="_blank">http://daniel.haxx.se/docs/poll-vs-select.html</a></li>
<li>Free Electrons presentation at 11th Libre Software Meeting about <em>Linux Kernel: devices and drivers architecture</em> <a href="http://2010.rmll.info/Linux-kernel-architecture-and-device-driver-model.html" target="_blank">http://2010.rmll.info/Linux-kernel-architecture-and-device-driver-model.html<br />
</a></li>
<li>Command Interface to System Calls -  <a href="http://sourceforge.net/projects/clint-sc/" target="_blank">http://sourceforge.net/projects/clint-sc/</a></li>
<li><strong> </strong>Bloatwatch &#8211; powerful tool for watching kernel size trends <a href="http://www.selenic.com/bloatwatch" target="_blank">http://www.selenic.com/bloatwatch/</a></li>
<li>Get to know Ksplice <a href="http://www.ibm.com/developerworks/aix/library/au-spunix_ksplice/index.html" target="_blank">http://www.ibm.com/developerworks/aix/library/au-spunix_ksplice/index.html</a></li>
</ul>
<h4><a rel="nofollow" href="http://sourceforge.net/projects/clint-sc/"><br />
</a></h4>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/ttmmhtw/ttmmhtw-math-research-network-syscalls-and-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shortening URL</title>
		<link>http://www.coding.com.br/blog/shortening-url/</link>
		<comments>http://www.coding.com.br/blog/shortening-url/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 16:44:40 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[python web]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1177</guid>
		<description><![CDATA[There are many URL shortening services. I just picked one (u.nu) to use from command line interface and chose something really quick and simple. Here&#8217;s the code:
# -*- coding: utf-8 -*-
from urllib import urlencode
import httplib
import sys

api_url="u.nu"
var = urlencode({'url':sys.argv[1]})
args = "/unu-api-simple?%s" % (var)
conn = httplib.HTTPConnection(api_url)
conn.request("GET",args)
ret = conn.getresponse()
print ret.read()
Download the script here.
Just run passing the URL, for example:
$ [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">There are <a title="List of URL shortening services" href="http://mashable.com/2008/01/08/url-shortening-services/" target="_blank">many</a> URL shortening services. I just picked one (<a href="http://u.nu" target="_blank">u.nu</a>) to use from <em>command line interface </em>and chose something really quick and simple. Here&#8217;s the code:</p>
<pre><span style="color: #444444;"># -*- coding: utf-8 -*-</span>
<strong>from</strong> <span style="color: #2040a0;">urllib</span> <strong>import</strong> <span style="color: #2040a0;">urlencode</span>
<strong>import</strong> <span style="color: #2040a0;">httplib</span>
<strong>import</strong> <span style="color: #2040a0;">sys</span>

<span style="color: #2040a0;">api_url</span><span style="color: #4444ff;">=</span><span style="color: #008000;">"u.nu"</span>
<span style="color: #2040a0;">var</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">urlencode</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;"><strong>{</strong></span><span style="color: #008000;">'url'</span><span style="color: #4444ff;">:</span><span style="color: #2040a0;">sys</span>.<span style="color: #2040a0;">argv</span><span style="color: #4444ff;">[</span><span style="color: #ff0000;">1</span><span style="color: #4444ff;">]</span><span style="color: #4444ff;"><strong>}</strong></span><span style="color: #4444ff;">)</span>
<span style="color: #2040a0;">args</span> <span style="color: #4444ff;">=</span> <span style="color: #008000;">"/unu-api-simple?%s"</span> <span style="color: #4444ff;">%</span> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">var</span><span style="color: #4444ff;">)</span>
<span style="color: #2040a0;">conn</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">httplib</span>.<span style="color: #2040a0;">HTTPConnection</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">api_url</span><span style="color: #4444ff;">)</span>
<span style="color: #2040a0;">conn</span>.<span style="color: #2040a0;">request</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"GET"</span>,<span style="color: #2040a0;">args</span><span style="color: #4444ff;">)</span>
<span style="color: #2040a0;">ret</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">conn</span>.<span style="color: #2040a0;">getresponse</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span>
<strong>print</strong> <span style="color: #2040a0;">ret</span>.<span style="color: #2040a0;">read</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span></pre>
<h5 style="text-align: center;">Download the script <a href="http://gist.github.com/486190" target="_blank">here</a>.</h5>
<p>Just run passing the URL, for example:</p>
<p style="padding-left: 30px;">$ python u.py www.coding.com.br</p>
<p style="padding-left: 30px;">http://u.nu/72mpd</p>
<p style="text-align: justify;">Easy your life by putting the script on your $PATH and execution (+x) file mode. Worth check the API from other services:</p>
<ul>
<li><a title="Documentation of bit.ly API" href="http://code.google.com/p/bitly-api/wiki/ApiDocumentation" target="_blank">bit.ly</a></li>
<li><a title="Documentation of migre.me API" href="http://migre.me/api-migreme/" target="_blank">migre.me</a> (brazilian company)</li>
<li><a title="Documentation of is.gd API" href="http://is.gd/api_info.php" target="_blank">is.gd</a></li>
<li><a href="http://tiny.cc/api-docs" target="_blank">tiny.cc</a></li>
<li><a href="http://www.scripting.com/stories/2007/06/27/tinyurlHasAnApi.html" target="_blank">tinyurl</a></li>
</ul>
<p style="padding-left: 30px;">
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/shortening-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A brief on &#8220;designated initializers&#8221;</title>
		<link>http://www.coding.com.br/blog/a-brief-on-designated-initializers/</link>
		<comments>http://www.coding.com.br/blog/a-brief-on-designated-initializers/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 06:01:27 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1155</guid>
		<description><![CDATA[The GNU Compiler Collection (GCC) for C language doesn&#8217;t initialize variables zeroed. For simple variables types like int or float is just equal to 0 or 0.0 respectively. Now, suppose that you have a &#8220;large&#8221; struct and doesn&#8217;t want to set each member  individually&#8230; you could just type &#8220;={0}&#8221; which means that the first member [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">The GNU Compiler Collection (GCC) for C language doesn&#8217;t initialize variables <em>zeroed.</em> For simple variables types like <em>int</em> or <em>float</em> is just equal to 0 or 0.0 respectively. Now, suppose that you have a &#8220;large&#8221; <em>struct</em> and doesn&#8217;t want to set each member  individually&#8230; you could just type &#8220;={0}&#8221; which means that the first member is explicitly initialized to zero and  the remaining members are implicitly initialized, also zero. Let&#8217;s see an example:</p>
<p><strong>typedef</strong> <strong>struct</strong><br />
<span style="color: #4444ff;"><strong>{</strong></span><br />
<strong> int</strong> <span style="color: #2040a0;">a</span><span style="color: #4444ff;">;</span><br />
<strong> char</strong> <span style="color: #2040a0;">c</span><span style="color: #4444ff;">;</span><br />
<strong> char</strong> <span style="color: #2040a0;">s</span><span style="color: #4444ff;">[</span><span style="color: #ff0000;">10</span><span style="color: #4444ff;">]</span><span style="color: #4444ff;">;</span><br />
<strong> int</strong> <span style="color: #4444ff;">*</span><span style="color: #2040a0;">ptr</span><span style="color: #4444ff;">;</span><br />
<span style="color: #4444ff;"><strong>}</strong></span> <span style="color: #2040a0;">data</span><span style="color: #4444ff;">;</span></p>
<p>When you initialize with:</p>
<p><span style="color: #2040a0;">data</span> <span style="color: #2040a0;">d</span><span style="color: #4444ff;"><strong></strong></span><span style="color: #4444ff;"><strong></strong></span><span style="color: #4444ff;">;</span></p>
<p>You got some random value like:</p>
<p>{a = -1208298748, c = -12 &#8216;\364&#8242;, s = &#8220;\317\372\267\230\353\377\277\351\203\004&#8243;, ptr = 0xb7e94cc5}</p>
<p>When you type:</p>
<p><span style="color: #2040a0;">data</span> <span style="color: #2040a0;">d</span> <span style="color: #4444ff;">=</span> <span style="color: #4444ff;"><strong>{</strong></span><span style="color: #ff0000;">0</span><span style="color: #4444ff;"><strong>}</strong></span><span style="color: #4444ff;">;</span></p>
<p>You&#8217;ll have each struct member initialized to <em>zero</em>.</p>
<p>{a = 0, c = 0 &#8216;\000&#8242;, s = &#8220;\000\000\000\000\000\000\000\000\000&#8243;, ptr = 0&#215;0}</p>
<p>You can learn much more about <a href="http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html" target="_blank">designated inits</a> [section 6.26] on GCC docs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/a-brief-on-designated-initializers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx rewrite for Wikka Wiki</title>
		<link>http://www.coding.com.br/blog/nginx-rewrite-for-wikka-wiki/</link>
		<comments>http://www.coding.com.br/blog/nginx-rewrite-for-wikka-wiki/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 17:24:37 +0000</pubDate>
		<dc:creator>Celso Fernandes</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1104</guid>
		<description><![CDATA[I&#8217;m posting it here, because I started a few weeks ago working with Nginx (if you don&#8217;t know that, you really should), a very powerful and fast webserver (lets leave it for another post), but I faced a problem with redirects for Wikka Wiki, I&#8217;m not a beginner on regular expressions or mod_rewrite, but sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m posting it here, because I started a few weeks ago working with <a title="Nginx" href="http://nginx.org/" target="_blank">Nginx</a> (if you don&#8217;t know that, you really should), a very powerful and <strong>fast</strong> webserver (lets leave it for another post), but I faced a problem with redirects for Wikka Wiki, I&#8217;m not a beginner on regular expressions or mod_rewrite, but sometimes we get in trouble working on something new.</p>
<p>I haven&#8217;t found the solution for my problem (for wordpress, drupal and joomla there are so many) so I resolved it and now I&#8217;m posting if somebody can&#8217;t do it or just wanna some copy/paste <img src='http://www.coding.com.br/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"> location ~ <span style="color: #339933;">^/</span>wiki <span style="color: #009900;">&#123;</span>
 	root <span style="color: #339933;">/</span>path<span style="color: #339933;">/</span>to<span style="color: #339933;">/</span>wiki<span style="color: #339933;">;</span>
 	index wikka.<span style="color: #202020;">php</span><span style="color: #339933;">;</span>
&nbsp;
 	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!-</span>e $request_filename<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 		rewrite <span style="color: #339933;">^/</span>wiki<span style="color: #339933;">/</span>images<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>images<span style="color: #339933;">/</span>$<span style="color: #0000dd;">1</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
		rewrite <span style="color: #339933;">^/</span>wiki<span style="color: #339933;">/</span>templates<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>templates<span style="color: #339933;">/</span>$<span style="color: #0000dd;">1</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
 		rewrite <span style="color: #339933;">^/</span>wiki<span style="color: #339933;">/</span>3rdparty<span style="color: #339933;">/</span>plugins<span style="color: #339933;">/</span>freemind<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>3rdparty<span style="color: #339933;">/</span>plugins<span style="color: #339933;">/</span>freemind<span style="color: #339933;">/</span>$<span style="color: #0000dd;">1</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
 		rewrite <span style="color: #339933;">^/</span>wiki<span style="color: #339933;">/</span>3rdparty<span style="color: #339933;">/</span>plugins<span style="color: #339933;">/</span>wikkaedit<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>3rdparty<span style="color: #339933;">/</span>plugins<span style="color: #339933;">/</span>wikkaedit<span style="color: #339933;">/</span>$<span style="color: #0000dd;">1</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
 		rewrite <span style="color: #339933;">^/</span>wiki<span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>.<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>$ <span style="color: #339933;">/</span>wiki<span style="color: #339933;">/</span>wikka.<span style="color: #202020;">php</span><span style="color: #339933;">?</span>wakka<span style="color: #339933;">=</span>$<span style="color: #0000dd;">1</span> <span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
 		<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
 	<span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>A brief explanation:</p>
<p>on line 1 we setup where our wiki is located, on our case /wiki, so in line 2 we give full path to where the wiki&#8217;s file are located on the filesystem and line 3 we says our index will be wikka.php once Wikka Wiki just redirect index.php to wikka.php (ok I don&#8217;t mind why they don&#8217;t put the contents of wikka.php on index.php and its over <img src='http://www.coding.com.br/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ).</p>
<p>line 5-12 we configure the rewrite rules, on line 5 is the condition what to do when there is no file or symbolic link when a URL is acessed, if its matched the following rules are processed:<br />
line 6-10: rules to ensure that static content like css, js and images won&#8217;t be redirected to wikka.php.<br />
line 11: the main rule, that will redirect all URLs to wikka.php so it process and show the output for each wiki page.</p>
<p>I don&#8217;t why (I&#8217;m new to Nginx) even using the condition <strong>if(!-e $request_filename)</strong> I need to put the rules to ensure that static content will be reached, if I discover, I update this post, but these rules are working for me under Nginx 0.7.67 and Wikka 1.2-p1 </p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/nginx-rewrite-for-wikka-wiki/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>latex + abntex</title>
		<link>http://www.coding.com.br/blog/latex-abntex/</link>
		<comments>http://www.coding.com.br/blog/latex-abntex/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 11:40:26 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=970</guid>
		<description><![CDATA[Estou fazendo uma série de experimentos com um conceito novo para apresentações, já refiz uma palestra apresentada no Calourada Livre e agora um teste em forma de tutorial. Penso que boa parte do sucesso deste tipo de abordagem é a busca contemporânea por informação rápida. Note, tudo que fiz está disponível na documentação. Entretanto, a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Estou fazendo uma série de experimentos com um conceito novo para apresentações, já <a href="http://twitter.com/maluta/status/12789908440" target="_blank">refiz</a> uma palestra apresentada no Calourada Livre e agora um teste em forma de <em>tutorial</em>. Penso que boa parte do sucesso deste tipo de abordagem é a busca contemporânea por informação rápida. Note, tudo que fiz está disponível na documentação. Entretanto, a estética como é apresentado facilita a compreensão. Esta apresentação mostra uma maneira independente de instalar o pacote abntex utilizado para contruir documentos em conformidade com o padrão definido pela ABNT.</p>
<p style="text-align: center;"><a href="http://prezi.com/aum-fzbgnkyl/latex-abntex/" target="_blank">http://prezi.com/aum-fzbgnkyl/latex-abntex/</a></p>
<p style="text-align: center;">
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/blog/latex-abntex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
