<?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>gnapse.com</title>
	<atom:link href="http://gnapse.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://gnapse.com/blog</link>
	<description>whatever comes to my mind</description>
	<lastBuildDate>Wed, 18 May 2011 13:45:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Skip Lists (a.k.a. Balanced Trees are overrated)</title>
		<link>http://gnapse.com/blog/2011/05/18/skip-lists/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=skip-lists</link>
		<comments>http://gnapse.com/blog/2011/05/18/skip-lists/#comments</comments>
		<pubDate>Wed, 18 May 2011 13:37:38 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Whatever]]></category>
		<category><![CDATA[balanced trees]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[skip lists]]></category>
		<category><![CDATA[sorting]]></category>
		<category><![CDATA[time complexity]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=299</guid>
		<description><![CDATA[Programming computers is fascinating. A couple of days ago I was introduced to a new data structure I did not know before. It’s called a skip list. It’s a sorted linked list, where the nodes are linked at different levels, forming increasingly sparse chains, each of which skips more nodes, and therefore is faster to [...]]]></description>
			<content:encoded><![CDATA[<p>Programming computers is fascinating.</p>
<p>A couple of days ago I was introduced to a new data structure I did not know before. It’s called a <a class="print-href" href="http://en.wikipedia.org/wiki/Skip_list" target="_blank">skip list</a>. It’s a sorted linked list, where the nodes are linked at different levels, forming increasingly sparse chains, each of which <em>skips</em> more nodes, and therefore is faster to traverse, allowing search algorithms to hop over parts of the list when searching. That’s why they’re called <em>skip lists</em>.</p>
<p>The concept was shown to me during a job interview. They briefly introduced me to the concept of skip lists using an image. It is said that an image is worth a thousand words, and in this case the assertion holds:</p>
<div><a href="http://en.wikipedia.org/wiki/Skip_list"><img class="aligncenter" style="margin-top: 15px; margin-bottom: 20px;" title="A skip list" src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Skip_list.svg/470px-Skip_list.svg.png" alt="" width="470" height="110" /></a><span id="more-299"></span></div>
<p>After I finished the interview I went on to <a class="print-href" href="http://www.google.com/search?q=skip+list" target="_blank">find out more about skip lists</a>, and I was amazed on how I did not stumbled upon them before. Immediately my instinct was to try out the algorithm I came up with during my interview, and when I saw it worked, I ended up writing a whole new <code>SortedMap</code> subclass in Java, implemented with skip lists.</p>
<p>It is surprisingly amazing how easy it is to write the routines for all the basic operations on skip lists, like adding, updating, removing and querying on them, specially when you see it described as a probabilistic data structure, which you have to admit that looks scary at first glance.</p>
<h2>Performance</h2>
<table style="border-width: 1px; border-style: solid; border-collapse: collapse; margin-left: 10px; margin-bottom: 10px;" border="1" cellspacing="0" cellpadding="5" align="right">
<caption></caption>
<tbody>
<tr>
<th>Operation</th>
<th>Expected time complexity</th>
</tr>
<tr>
<td>Insert</td>
<td><em>O(log n)</em></td>
</tr>
<tr>
<td>Delete</td>
<td><em>O(log n)</em></td>
</tr>
<tr>
<td>Search</td>
<td><em>O(log n)</em></td>
</tr>
<tr>
<td>Item at index</td>
<td><em>O(log n)</em> with <a title="Indexable Skip Lists" href="http://en.wikipedia.org/wiki/Skip_list#Indexable_skiplist" target="_blank">some tweaking</a></td>
</tr>
<tr>
<td>Enumerate</td>
<td><em>O(n)</em></td>
</tr>
</tbody>
</table>
<div>
<p>Performance-wise they can behave similar to, or perhaps even better than, balanced binary trees, according to the assertions made by the inventor of this concept in his <a href="ftp://ftp.cs.umd.edu/pub/skipLists/skiplists.pdf" target="_blank">original paper</a> about them. They&#8217;re also easier to implement and comprehend, and the algorithms have a very little constant factor compared to the often recursive and complex algorithms on red-black, 2-3 trees, and other types of balanced trees.</p>
<h2>Indexing</h2>
<p>But the true killer feature of skip lists lie in its indexing capabilities. It&#8217;s possible, with some minor <a title="Indexable Skip Lists" href="http://en.wikipedia.org/wiki/Skip_list#Indexable_skiplist">tweaks</a>, to find the i<sup>th</sup> element in the list with an expected time complexity of <em>O(log n)</em>. With this you can have a data structure that can act as a sorted dictionary, but as an array or vector at the same time. That&#8217;s not something you can do with self-balanced search trees, at least not that I&#8217;m aware of. I&#8217;m not quite sure right now in what type of application could this be useful, but it is certainly quite amazing, and worth having in mind if one ever finds such a situation.</p>
<p><strong>Were you familiar with skip lists already? Do you know about any other cool and useful data structure that you would like to share?</strong></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2011/05/18/skip-lists/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Steve, we have a problem!</title>
		<link>http://gnapse.com/blog/2011/02/02/steve-we-have-a-problem/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=steve-we-have-a-problem</link>
		<comments>http://gnapse.com/blog/2011/02/02/steve-we-have-a-problem/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 20:03:40 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Whatever]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[space travel]]></category>
		<category><![CDATA[zero-g]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=292</guid>
		<description><![CDATA[One of the coolest features of Apple&#8217;s iDevices, specially the iPad, is the ability to recognize the orientation of the device and adjust the rotation of image on screen accordingly. But what happens if we take the iPad to the International Space Station? Well some guys did something very similar. They took an iPad for [...]]]></description>
			<content:encoded><![CDATA[<p>One of the coolest features of Apple&#8217;s iDevices, specially the iPad, is the ability to recognize the orientation of the device and adjust the rotation of image on screen accordingly. But what happens if we take the iPad to the International Space Station?</p>
<p>Well some guys did something very similar. They took an iPad for a ride in a <a title="Reduced weight in aircraft" href="http://en.wikipedia.org/wiki/Weightlessness#Reduced_weight_in_aircraft" target="_blank">Zero-G parabolic flight</a>, similar to the well-known NASA&#8217;s <a class="print-href" href="http://en.wikipedia.org/wiki/Vomit_Comet" target="_blank">Vomit Comet</a>. Can you guess what happened to the iPad? Surprise!</p>
<p><object style="display: inline-block !important;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="590" height="354" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/syWwpCxJcfk&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed style="display: inline-block !important;" type="application/x-shockwave-flash" width="590" height="354" src="http://www.youtube.com/v/syWwpCxJcfk&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Maybe not as serious as the problem that Jim Lovell and his crewmates had on <a class="print-href" href="http://en.wikipedia.org/wiki/Apollo_13">Apollo 13</a>, but a problem indeed. I was really not surprised at all, since I expected no more, but it&#8217;s nice to see that someone actually gave it a try.</p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2011/02/02/steve-we-have-a-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opera 11 brings tab stacks and some improvements</title>
		<link>http://gnapse.com/blog/2010/12/03/opera-11-brings-tab-stacks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=opera-11-brings-tab-stacks</link>
		<comments>http://gnapse.com/blog/2010/12/03/opera-11-brings-tab-stacks/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 16:27:05 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[tabbed browsing]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=276</guid>
		<description><![CDATA[Opera invented tabs and many other innovations that other most successful browsers have adopted over the years. In fact Opera is the browser that has lead more innovative features than any other browser. And yet somehow this browser –my favorite one till Google Chrome appeared– has never been considered a major one except in some [...]]]></description>
			<content:encoded><![CDATA[<p>Opera invented tabs and many other innovations that other most successful browsers have adopted over the years. In fact Opera is the browser that has lead more <a class="print-href" href="http://operawiki.info/operainnovations" target="_blank">innovative features</a> than any other browser. And yet somehow this browser –my favorite one till Google Chrome appeared– has never been considered a major one except in some niche markets.</p>
<p>Personally I always considered it the best browser ever, although with great grief I had to hand over that title to Chrome, which has everything really worth taking from Opera, plus several improvements that were hard to ignore. It was the first browser able to claim being nearly as fast as the Norwegian big O, plus <a href="http://www.chromium.org/developers/design-documents/sandbox" target="_blank">sandboxing</a>, well-achieved <a class="print-href" href="https://chrome.google.com/extensions/" target="_blank">extensions</a> framework, uncluttered interface and a great attention to detail from its designers.</p>
<p>But I didn&#8217;t throw away Opera for this. Today I took a glimpse of what&#8217;s expected for their upcoming <a href="http://www.opera.com/browser/next/" target="_blank">11th edition</a>, and I have to say I was impressed but not surprised at all: I expected no less from the best browser vendor in the world.</p>
<p>Opera 11 beta brings up several improvements over past versions. Keeping up with the competition is the least they could, and they seem to be doing really well in terms of features: better HTML5 support, smaller installer, better performance, safer browsing, secure and informative address field, private navigation mode, and a great new overdue addition which I haven&#8217;t yet explored in its entirety: <a class="print-href" href="https://addons.labs.opera.com/" target="_blank">extensions</a>.<span id="more-276"></span></p>
<h2>Something really new</h2>
<p>But all these only puts it on par with competitors, feature-wise. What&#8217;s really hard these days is to come up with new stuff; unprecedented functionality on an era where everything seems to be already invented. That&#8217;s what&#8217;s truly amazing of a new version of any software, particularly web browsers. And Opera has always been one of the bests at this.</p>
<p>This 11th version takes tabs to a next level: <a href="http://www.youtube.com/watch?v=5hqSGGk1YTI" target="_blank">tab groups or stacks</a>. Users can manually group tasks on stacks that can be expanded or collapsed at will, cleaning up space and clutter on the tab bar. For heavy-weight Internet users like me this is a great idea. Watch <a class="print-href" href="http://www.youtube.com/watch?v=5hqSGGk1YTI" target="_blank">the video at youtube</a> to see how it works, or <a class="print-href" href="http://www.opera.com/browser/next/" target="_blank">download the browser</a> and try it yourself.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/5hqSGGk1YTI?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="550" height="385" src="http://www.youtube.com/v/5hqSGGk1YTI?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h2>Managing stacks from thumbnails preview</h2>
<p>This feature gets even better when combined with floating thumbnail previews. When you hover the mouse pointer over a collapsed stack, a large floating view appears with a grid of small thumbnail views of each tab in the stack. You can click on the thumbnails in the floating view to switch tabs without having to expand the stack. Watch it working in the following video.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/i0B-euI5uI4?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="550" height="385" src="http://www.youtube.com/v/i0B-euI5uI4?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>What I really miss and I hope it&#8217;ll be included in the final non-beta version, is the ability to specify in the preferences that when middle-clicking links to open in new tabs, these new tabs get automatically stacked with the tab that spawned them. This should of course be optional and not enabled by default, or even made available only with some modifier key while middle-clicking.</p>
<h2>The verdict</h2>
<p>This is still a beta release with some rough edges, specially a little prone to instability and crashing. But it&#8217;s good to know Opera is still heading in a good direction. They lost too much time with stuff like BitTorrent support and <a class="print-href" href="http://www.opera.com/unite/" target="_blank">Opera Unite</a>, instead of focusing in the browsing experience. Hopefully this browser will someday get the attention it deserves.</p>
<p><strong>What do you think about Opera 11 and tab stacks? Do you think this feature will make its way to other browsers in the future? </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2010/12/03/opera-11-brings-tab-stacks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Taking notes the simple way</title>
		<link>http://gnapse.com/blog/2010/10/20/taking-notes-the-simple-way/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=taking-notes-the-simple-way</link>
		<comments>http://gnapse.com/blog/2010/10/20/taking-notes-the-simple-way/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 15:57:09 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[note-taking]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=248</guid>
		<description><![CDATA[Recently I&#8217;ve been playing around with a few note-taking applications, specially with support for mobile devices such as my iPhone and a simple way to keep notes in sync with my laptop or desktop computers. I was most recently getting along with PlainText, a note-taking iPhone app that stores your notes in a folder in [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been playing around with a few note-taking applications, specially with support for mobile devices such as <a href="http://gnapse.com/blog/2010/02/03/my-new-ipad-nano-aka-iphone/">my iPhone</a> and a simple way to keep notes in sync with my laptop or desktop computers.</p>
<p>I was most recently getting along with <a title="PlainText for iPhone" href="http://itunes.apple.com/us/app/plaintext-dropbox-text-editing/id391254385?mt=8" target="_blank">PlainText</a>, a note-taking iPhone app that stores your notes in a folder in your Dropbox account. It&#8217;s a very simple yet powerful concept, specially for those of us who already use Dropbox. Instead of having yet another syncing environment for notes, they already take advantage of the Dropbox user base out there.</p>
<p>The interface is simple and visually appealing, yet out of the ordinary. The notes are always in sync between the iPhone and the computers thanks to Dropbox, and I can get to organize my notes into folders. No more nasty notes from the default iPhone notes app getting into my mail (whoever thought that notes were related to mail is insane).<span id="more-248"></span></p>
<h2>But then the simple got even simpler&#8230;</h2>
<p><a href="http://gnapse.com/blog/wp-content/uploads/2010/10/simplenote.png"><img class="alignright size-medium wp-image-260" title="SimpleNote" src="http://gnapse.com/blog/wp-content/uploads/2010/10/simplenote-200x300.png" alt="" width="200" height="300" /></a>Today I stumbled on a simpler and better alternative: <a class="print-href" href="http://simplenoteapp.com/" target="_blank">SimpleNote</a>. It&#8217;s an online web service with <a href="http://simplenoteapp.com/downloads/itunes.html" target="_blank">an iPhone app</a>, an <abbr title="Application Programming Interface"><a href="http://simplenoteapp.com/api/">API</a></abbr>, and a set of <a href="http://simplenoteapp.com/downloads/" target="_blank">third-party supporting apps and tools</a> that complete the picture.</p>
<h3>Great features</h3>
<p>The killer <a title="SimpleNotes features" href="http://simplenoteapp.com/features/" target="_blank">features</a> over PlainText are tagging, versioning and sharing. Yes, you read it right.</p>
<p>With SimpleNote you organize your notes with <strong>tags</strong>, instead of placing them on folders. You can associate any number of tags to a single note, and you can also list all notes regardless of tagging. It&#8217;s of course a bit unfair to make this comparison against PlainText, since its Dropbox storage paradigm would not allow for anything else than folders.</p>
<p>You can also <strong>share</strong> notes with other people. I did not found a way to do this on the web app, although there should be. In the iPhone app you can activate sharing, and it&#8217;ll give you a URL, plus the possibility to send an email with an invitation to the share note. I haven&#8217;t tested this though because I still have no one on SimpleNote to share with.</p>
<p>Also worth mentioning are its <strong>versioning</strong> capabilities. You can check past versions of your notes, up to a limit of 10 versions in the past. There&#8217;s a premium non-free plan for a mere $12 a year (that&#8217;s $1 per month) which extends this limit to 30, plus extra features such as no ads, better support, creating notes by email <a class="print-href" title="SimpleNote premium plan" href="http://simplenoteapp.com/premium/" target="_blank">and more</a>.</p>
<h3>On the desktop side of the equation</h3>
<p>On the desktop side there&#8217;s no &#8220;official&#8221; app for SimpleNote, but on the <a class="print-href" title="SimpleNote downloads" href="http://simplenoteapp.com/downloads/" target="_blank">downloads page</a> I found a couple of third-party client applications for Windows and Mac that I am really liking. On the Mac side we have <a class="print-href" href="http://selfcoded.com/justnotes/" target="_blank">JustNotes</a>, which syncs with the online service and supports tagging and searching. On the Windows side I was not expecting much, but it turns out that <a class="print-href" href="http://www.resoph.com/" target="_blank">ResophNotes</a> is a pretty good client with email, printing and <a href="http://daringfireball.net/projects/markdown/" target="_blank">Markdown</a> support. <span style="text-decoration: line-through;">The downside is that it does not support tagging</span>. It did not support tagging until recently, so be sure to have the latest version.</p>
<p>There are some other options for both platforms, specially for the Mac, and there are options for Android as well. There&#8217;s even an Emacs package and extensions for Firefox and Chrome!</p>
<p><strong>What other alternative services do you use for note-taking on the iPhone with desktop-sync support?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2010/10/20/taking-notes-the-simple-way/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The most hilarious moment on The Big Bang Theory</title>
		<link>http://gnapse.com/blog/2010/10/19/the-most-hilarious-moment-on-the-big-bang-theory/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-most-hilarious-moment-on-the-big-bang-theory</link>
		<comments>http://gnapse.com/blog/2010/10/19/the-most-hilarious-moment-on-the-big-bang-theory/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 19:30:34 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Whatever]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[The Big Bang Theory]]></category>
		<category><![CDATA[TV Shows]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[Youtube]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=250</guid>
		<description><![CDATA[You gotta love Jim Parsons on this scene. For me it&#8217;s the funniest scene on the whole series so far. It makes me laugh every time I see it. I hope you enjoy it too. Update: Unfortunately the Youtube video above is not embeddable, so it cannot be played within this site Simply click on [...]]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/dyQz8jWAl7s?fs=1&amp;hl=en_US" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/dyQz8jWAl7s?fs=1&amp;hl=en_US" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>You gotta love Jim Parsons on this scene. For me it&#8217;s the funniest scene on the whole series so far. It makes me laugh every time I see it. I hope you enjoy it too.</p>
<p><strong>Update:</strong> Unfortunately the Youtube video above is <a title="Embedding disabled by request" href="http://www.google.com/support/forum/p/youtube/thread?tid=42147850298e1f43&amp;hl=en" target="_blank">not embeddable</a>, so it cannot be played within this site <img src='http://gnapse.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  Simply click on it to be given the option to open it on Youtube instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2010/10/19/the-most-hilarious-moment-on-the-big-bang-theory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A new way to manage your passwords</title>
		<link>http://gnapse.com/blog/2010/10/13/a-new-way-to-manage-your-passwords/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-new-way-to-manage-your-passwords</link>
		<comments>http://gnapse.com/blog/2010/10/13/a-new-way-to-manage-your-passwords/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 15:53:52 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Whatever]]></category>
		<category><![CDATA[password manager]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=229</guid>
		<description><![CDATA[In this ever increasing digital world with lots of useful services on the Internet, keeping track of your passwords is a daunting task. Many people end up using one or two passwords for everything, or are otherwise constantly resetting their passwords via email. Luckily there are lots of different choices of password managers, softwares that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gnapse.com/blog/wp-content/uploads/2010/10/300_password0.jpg"><img class="size-full wp-image-242 alignright" title="password_forgotten" src="http://gnapse.com/blog/wp-content/uploads/2010/10/300_password0.jpg" alt="" width="210" height="227" /></a>In this ever increasing digital world with lots of useful services on the Internet, <a class="print-href" title="How do you manage your passwords?" href="http://itickr.com/?p=162" target="_blank">keeping track of your passwords</a> is a daunting task. Many people end up using one or two passwords for everything, or are otherwise constantly resetting their passwords via email.</p>
<p>Luckily there are lots of different choices of <a title="Search for Password Managers at Google" href="http://www.google.com/search?q=password+managers" target="_blank">password managers</a>, softwares that will help you keep a secure database of all this information, sometimes even in a way that they help you collect your passwords as you use them in your browser, autofill login forms, and even generate new random passwords for you.</p>
<p>This is all great, but <strong>I am not convinced</strong>. Random passwords generated and filled into forms, all done by a software tool? I end up not really knowing my passwords. What if the tool ever fails, or its database gets corrupted? What if my hard drive melts and after the fix I get a clean install with no passwords database? I also do not like the idea of passwords being stored digitally, not even encrypted.</p>
<p>So I ended up with a small password managing system that I designed myself. With it <strong>you can still use a conventional password manager</strong>, but in a slightly different way.<span id="more-229"></span></p>
<h2>Grab some passwords&#8230;</h2>
<p>I have a small set of around nine or ten different passwords that I use for all the services and accounts I have access to. These passwords <strong>range across all the spectrum of difficulty and strength</strong>.</p>
<p>Then I <strong>distribute this set of passwords more or less evenly</strong> across the whole spectrum of services and accounts that I have access to. I use strong passwords for the most precious and important services; the dumb passwords for unimportant stuff, like all the garbage sites that require membership for even the dumbest thing; and I leave the medium-range passwords for most of the average-but-important services that most people, including me, use these days.</p>
<h2>&#8230;but store keywords instead</h2>
<p>For this password system to work you really ought to <strong>remember the actual passwords yourself</strong>. The password managing system is mostly just to remember what passwords are used for what access, not to remember the actual passwords. You can keep these associations between user accounts and passwords stored in several different ways, so it&#8217;s pretty easy to use, not needing any specific software. You can use an actual password manager, or you can use an Excel spreadsheet or a simple text file, just as I do. The medium is really up to you.</p>
<p>There are a couple of rules when setting up this associations list</p>
<ol>
<li><strong>Do not store the actual passwords in the associations</strong>, just small bits of text that loosely resemble, reminds you, or have any obscure-for-anybody-else relation to the password. It can be a small bit of the password itself, perhaps a bit tweaked, reversed, or with some phonetical changes. Or it can be something textually unrelated to the password, but having some association with it that only you can devise.</li>
<li><strong>Each password should have at least two different keywords</strong> that you&#8217;ll associate with it, and not just one. This ensures that if somebody ever gets access to this associations, it won&#8217;t be easy to determine what services use the same password.</li>
</ol>
<h2>An example</h2>
<p>I&#8217;ll give you an example with my own passwords and keywords (not really). We&#8217;ll work with a set of six passwords with various levels of strength. Notice in the stronger cases the use of <a class="print-href" title="Leet Speak" href="http://en.wikipedia.org/wiki/Leet" target="_blank">L33T 5PEAK</a> and <a class="print-href" title="Dvorak encoding" href="http://en.wikipedia.org/wiki/Dvorak_encoding" target="_blank">other tweaks</a>.</p>
<table style="border-collapse: collapse; margin-bottom: 10px;" border="1" cellspacing="0" cellpadding="3">
<tbody>
<tr>
<th>Password</th>
<th>Explanation</th>
<th>Sample keywords</th>
</tr>
<tr>
<td><code>ReaLY-5tr0n6-p4swrd</code></td>
<td>&#8220;Really strong password&#8221;, tweaked with <a class="print-href" title="Leet Converter" href="http://ermarian.net/services/converters/leet" target="_blank">Leet</a></td>
<td>strong, weak</td>
</tr>
<tr>
<td><code>3krpatYpal</code></td>
<td>&#8220;DvorakTrap&#8221; <a class="print-href" title="Qwerty to Dvorak conterter" href="http://wbic16.xedoloh.com/dvorak.html" target="_blank">converted to Dvorak</a> and slightly tweaked with Leet.</td>
<td>trap, paypal</td>
</tr>
<tr>
<td><code>dst00pid1</code></td>
<td>The stupid one</td>
<td>dummy, foolish</td>
</tr>
<tr>
<td><code>L1ber1an61rL</code></td>
<td><a class="print-href" href="http://en.wikipedia.org/wiki/Liberian_Girl" target="_blank">Liberian Girl</a></td>
<td>africa, thriller, michael, jackson</td>
</tr>
<tr>
<td><code>Manhattan7D1</code></td>
<td><a class="print-href" title="September 11 attacks" href="http://en.wikipedia.org/wiki/September_11_attacks" target="_blank">Manhattan 2001</a>, with the number in <a class="print-href" href="http://en.wikipedia.org/wiki/Hexadecimal" target="_blank">hex notation</a></td>
<td>911, ny, big-apple, wtc</td>
</tr>
<tr>
<td><code>Ernesto117</code></td>
<td>My name and year of birth in <a class="print-href" href="http://en.wikipedia.org/wiki/Octal" target="_blank">octal notation</a></td>
<td>self, me, this, i, yo, moi, je</td>
</tr>
</tbody>
</table>
<p>As you can see, most keywords by itself do not reveal the password, not even remotely. And even if someone ever guesses the relation, the password itself is usually more than the part that links to the keyword, with the further complication of tweaks in the spelling, the use leetspeak and similar encodings, etc.</p>
<p>But remember that <strong>you do not really write down the table above</strong>. What you really do is write down a list of services and accounts, and the keyword that associates a password with it, instead of the actual password. <strong>During the creation of this list below is when you really think about keywords associated to your passwords</strong>.</p>
<table style="border-collapse: collapse; margin-bottom: 10px;" border="1" cellspacing="0" cellpadding="3">
<tbody>
<tr>
<th>Service</th>
<th>User name</th>
<th>Password</th>
</tr>
<tr>
<td>WordPress Blog</td>
<td>john23</td>
<td>africa</td>
</tr>
<tr>
<td>Facebook</td>
<td>john23@gmail.com</td>
<td>dummy</td>
</tr>
<tr>
<td>Gmail</td>
<td>john23</td>
<td>weak</td>
</tr>
<tr>
<td>Yahoo</td>
<td>johnnyola</td>
<td>paypal</td>
</tr>
<tr>
<td>Twitter</td>
<td>johnny23</td>
<td>thriller</td>
</tr>
<tr>
<td>MacBook</td>
<td>john</td>
<td>moi</td>
</tr>
<tr>
<td>iphone root</td>
<td>root</td>
<td>911</td>
</tr>
<tr>
<td>iphone ssh</td>
<td>mobile</td>
<td>foolish</td>
</tr>
<tr>
<td>Office Webmail</td>
<td>john.ola</td>
<td>wtc</td>
</tr>
<tr>
<td>Instapaper</td>
<td>johnny23</td>
<td>trap</td>
</tr>
</tbody>
</table>
<p>You can now store this table in whatever format you prefer, and take whatever measures to not loose it. You should also store it in a secure location, but in a way that you can access it whenever you need to lookup for something, or to modify it. <a class="print-href" href="http://www.dropbox.com" target="_blank">Dropbox</a> and <a class="print-href" href="http://www.evernote.com" target="_blank">Evernote</a> are good choices. In Dropbox you can store it in a password protected file as well, if you think you can use some extra security.</p>
<h2>But&#8230;</h2>
<p>Sure this system has some drawbacks. For instance, some people might argue that some password managers also fill out login forms for you when integrated to the web browser. So even if you do use one of these password managers to store just the keywords and not the actual passwords, then the autofill-login-form feature becomes useless. But hey, <a class="print-href" title="The Web is dead. Long live the Internet." href="http://www.wired.com/magazine/2010/08/ff_webrip/all/1" target="_blank">who access content on the Internet via web browsers anymore</a>?</p>
<p><strong>What tools or systems do you use to manage your ever-increasing list of passwords and user accounts?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2010/10/13/a-new-way-to-manage-your-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Five reasons to love Objective-C</title>
		<link>http://gnapse.com/blog/2010/10/06/five-reasons-to-love-objective-c/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=five-reasons-to-love-objective-c</link>
		<comments>http://gnapse.com/blog/2010/10/06/five-reasons-to-love-objective-c/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 20:35:04 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming languages]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=218</guid>
		<description><![CDATA[Objective-C was always a distant name for me, a blur memory from lists of languages read somewhere. I recall having a very subtle curiosity for the name. It&#8217;s like saying two things in one. First, it&#8217;s like adding objectivity to C, but also the objective word gives a hint that objects and Object-Oriented Programming are somehow [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Objective-C</strong> was always a distant name for me, a blur memory from lists of languages read somewhere. I recall having a very subtle curiosity for the name. It&#8217;s like saying two things in one. First, it&#8217;s like adding objectivity to <a class="print-href" title="The C language at Wikipedia" href="http://en.wikipedia.org/wiki/C_programming_language" target="_blank">C</a>, but also the <em>objective </em>word gives a hint that objects and Object-Oriented Programming are somehow involved. It&#8217;s a nice and insightful word play with the pun intended.</p>
<p><a class="print-href" title="Objective-C at Wikipedia" href="http://en.wikipedia.org/wiki/Objective-C" target="_blank">Objective-C</a> provides most of the benefits of <a class="print-href" title="C++ at Wikipedia" href="http://en.wikipedia.org/wiki/C%2B%2B" target="_blank">C++</a>, plus some more benefits that C++ does not provide at all. And I am not talking only about <a class="print-href" title="Simula at Wikipedia" href="http://en.wikipedia.org/wiki/Simula" target="_blank">Simula</a> vs. <a class="print-href" title="Smalltalk at Wikipedia" href="http://en.wikipedia.org/wiki/Smalltalk" target="_blank">Smalltalk</a> philosophical differences here, but about stuff that C++ could have actually had without breaking its Simula-like philosophy. Some of the features/reasons I will enumerate below fall under this category.<span id="more-218"></span></p>
<h2>Declared properties</h2>
<p>Objective-C provides a simple way to <a title="Declared Properties at the Objective-C Language Reference" href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html" target="_blank">declare properties</a> that define and describe the state of an object, as well as to implement the way we access these properties.</p>
<p>Properties ensure that we adhere to the principle of encapsulation, by which an object controls the way that other objects have access to query its own state. In Objective-C all instance variables are private to an object, and its values can only be accessed via properties defined in the object&#8217;s class.</p>
<p>Properties also play a big role in some of the core features of the runtime library, such as <a title="Key-Value Coding" href="http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/KeyValueCoding/KeyValueCoding.html" target="_blank">KVC</a>, <a title="Key-Value Observing" href="http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html" target="_blank">KVO</a>, <a href="http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/ModelObjects/Introduction.html" target="_blank">Model Objects</a>, etc. I wish C++ would have had this one.</p>
<h2>Protocols</h2>
<p><a title="Protocols in the Objective-C Programming Language" href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProtocols.html" target="_blank">Protocols</a> are similar to <a title="Java Interface at Wikipedia" href="http://en.wikipedia.org/wiki/Interface_(Java)" target="_blank">interfaces in Java</a>. When I started learning Java over twelve years ago, no one made a reference to Objective-C protocols as a similar feature of an existing language, even though protocols were introduced to Objective-C several years before Java appeared.</p>
<p>A protocol defines an abstract interface that classes can adhere to. This interface consists of a set of method definitions that implementing classes should provide.</p>
<p>As a plus, compared to Java interfaces, protocols can define some or all of its methods to be optional, so that implementing classes can opt to provide implementations for the optional methods or not. In this case when sending a message to invoke an optional method on an object that conforms to the protocol, the caller should ensure first, via reflection, that the object is able to respond to the message.</p>
<p><span style="font-weight: normal;">Compared to C++, protocols provide a way to circumvent the lack of multiple inheritance, although their use in the standard Cocoa library is mostly not related to this.</span></p>
<h2>Categories</h2>
<p><a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocCategories.html" target="_blank">Categories</a> allow you to add methods to an existing class, but without subclassing. You can do this even with classes from the runtime library or classes to which you do not have the source. This is my favorite language feature. Ever since I became addicted to Ruby I believe I cannot stand a language that does not allow me to do this.</p>
<p>When you first think about it, it makes no sense. Subclassing should be fine. But what if you need to add a new functionality to an existing hierarchy of classes? The best example comes not from Objective-C itself, but from Ruby and the Ruby on Rails framework: Rails would not have been possible without Ruby having this feature. Another good example within the Objective-C realm is <a class="print-href" href="http://three20.info" target="_blank">the Three20 iPhone programming library</a>, that would have been harder to implement and maybe not too feature-wide if it were not for the language having this feature.</p>
<p>A more mundane but valid use for categories is to split the implementation of a class into separate source files, be it for organizational purposes, or because the class interface and implementation is too extensive and splitting it up makes it easier to understand and maintain, etc.</p>
<p>This is one of the features I believe that C++ could have had without breaking its philosophy, and it would have been great.</p>
<h2>Compatibility with C (and C++)</h2>
<p>Unlike C++, Objective-C is a proper superset of C, meaning that any C program or file is also Objective-C code. There&#8217;s no guideline of what to do and what not to do when using C code in Objective-C. The most evident advantage is that Objective-C programs can use any existing C library without the need for wrappers. Some notable examples of libraries that are used in iPhone programming are sqlite and OpenGL.</p>
<p>It should also be mentioned at this point as a side note, that Objective-C can be combined with C++ as well, although they are still different languages. In this case there&#8217;s a list of requirements or restrictions to observe. For more information refer to <a title="Using C++ with Objective-C" href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocCPlusPlus.html" target="_blank">the official documentation about this feature</a>.</p>
<h2>Simpler, more flexible, and easier to master</h2>
<p>This one is a subjective reason, but I stand by it.</p>
<p>I have mastered more of Objective-C in six months than of C++ in years. I have also been more confortable learning it. I remember learning C++ as a necessary evil, and by contrast, I am happy that iPhone programming led me to this wonderful programming language.</p>
<p>The language is far from perfect, and there are certainly a few features from other languages that I miss a little bit. My perception of it has changed over time though. When you first start to use it, it appears to be cumbersome and bizarre. But sooner rather than later you start to love it (unless you are a C++ fanboy, of course).</p>
<p><strong>So what do you think about Objective-C? Are there any other features that you love or hate about it? Feel free to share you opinion without starting a war.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2010/10/06/five-reasons-to-love-objective-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import your iPhone address book into the iPhone simulator</title>
		<link>http://gnapse.com/blog/2010/09/13/import-your-iphone-address-book-into-the-iphone-simulator/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=import-your-iphone-address-book-into-the-iphone-simulator</link>
		<comments>http://gnapse.com/blog/2010/09/13/import-your-iphone-address-book-into-the-iphone-simulator/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 18:11:00 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[address book]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphone simulator]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=214</guid>
		<description><![CDATA[When you are developing an iPhone application that works with the system-wide address book, it&#8217;s sometimes useful to have already some entries to play with when testing the app. Suppose then that you are testing in the simulator, which comes with no contacts at all. You cannot sync your simulator with iTunes, and the simulator [...]]]></description>
			<content:encoded><![CDATA[<p>When you are developing an iPhone application that works with the system-wide address book, it&#8217;s sometimes useful to have already some entries to play with when testing the app. Suppose then that you are testing in the simulator, which comes with no contacts at all. You cannot sync your simulator with iTunes, and the simulator is not integrated into your Mac Address Book, so you have to start creating some contacts manually.</p>
<p>Well, not exactly. If you have a real device (and you should anyway, if you are developing for the platform) and this device has lots of contacts in it, then you can copy the internal address book files into the simulator&#8217;s file system in your Mac. I actually got the tip from <a title="Using your own address book in the iPhone Simulator" href="http://0xced.blogspot.com/2009/01/using-your-own-address-book-in-iphone.html" target="_blank">this blog post</a> after searching on Google a little bit, but it did not worked for me exactly that way. I&#8217;ll let you know why.<span id="more-214"></span></p>
<p>First you have to extract the device&#8217;s address book sqlite files. There are two files actually, and according to their names, one is for the actual contacts, and the other one stores the contact images. Both files are located in <code>/var/mobile/Library/AddressBook/</code> inyour iPhone, so if you have a jailbroken device, then it is as simple as copying through ssh&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">scp</span> mobile<span style="color: #000000; font-weight: bold;">@</span>iphone:Library<span style="color: #000000; font-weight: bold;">/</span>AddressBook<span style="color: #000000; font-weight: bold;">/*</span>  ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Application\ Support<span style="color: #000000; font-weight: bold;">/</span>iPhone\ Simulator<span style="color: #000000; font-weight: bold;">/</span>User<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>AddressBook</pre></div></div>

<p>If your device is not jailbroken then it is a bit more complicated. The solution involves extracting the sqlite files from the backups of your device created by iTunes in your Mac whenever you sync. The blog post linked above has a nice script for doing this, although I have not tested it.</p>
<p>But this did not work for me right away. I copied the files into the specified directory and started the simulation just to see the same empty list. So I wandered a bit through the vicinities of that location and I realized that along with the <code>User</code> directory inside <code>~/Library/Application Support/iPhone Simulator</code>, there are a few more directories whose names correspond to the versions of the <abbr title="Software Development Kit">SDK</abbr> installed in the simulator. Since I am running the simulator on iOS 4.0.2, then I copied the files into this directory structure instead, like below</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">scp</span> mobile<span style="color: #000000; font-weight: bold;">@</span>iphone:Library<span style="color: #000000; font-weight: bold;">/</span>AddressBook<span style="color: #000000; font-weight: bold;">/*</span>  ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Application\ Support<span style="color: #000000; font-weight: bold;">/</span>iPhone\ Simulator<span style="color: #000000; font-weight: bold;">/</span>4.0.2<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>AddressBook</pre></div></div>

<p>So if the <code>User</code> directory don&#8217;t work for you either, then try looking for the one corresponding to the SDK version that you are running in the simulator.</p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2010/09/13/import-your-iphone-address-book-into-the-iphone-simulator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selectively print link URLs in your wordpress blog</title>
		<link>http://gnapse.com/blog/2010/09/08/selectively-print-link-urls-in-your-wordpress-blog/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=selectively-print-link-urls-in-your-wordpress-blog</link>
		<comments>http://gnapse.com/blog/2010/09/08/selectively-print-link-urls-in-your-wordpress-blog/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 17:52:18 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web programming]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=202</guid>
		<description><![CDATA[Today I was trying to improve the print-view styles of this blog. This is useful not only to actually print on paper, but also when you print to PDF to keep a digital copy of the content. So besides the obvious hiding of sections not relevant on a printed media, like the sidebar, comments form, [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was trying to improve the print-view styles of this blog. This is useful not only to actually print on paper, but also when you print to PDF to keep a digital copy of the content.</p>
<p>So besides the obvious hiding of sections not relevant on a printed media, like the sidebar, comments form, etc., I started to look at what other improvements could be made for a printed version of a web page. I readily searched for and turned to an article I recall having read some time ago in <em>A List Apart</em> about exactly this matter: <a class="print-href" href="http://www.alistapart.com/articles/goingtoprint/" target="_blank">Going to Print</a>.</p>
<p>Following the article&#8217;s suggestions I started customizing margins, backgrounds, font type and size, etc. Then I stumbled upon a very tricky issue they mention: what to do with links? They are clearly of no direct use in printed media since users can&#8217;t click on a paper, but on the other hand it&#8217;s a pity that the extra information conveyed in a link (namely the referenced <abbr title="Uniform Resource Locator">URL</abbr>) gets lost.<span id="more-202"></span></p>
<h3>CSS selectors to the rescue</h3>
<p>The article suggests using an advanced <abbr title="Cascading Style Sheet">CSS2</abbr> technique. Using special selectors we can append after every link, the URL it refers to enclosed in parentheses. This will only be visible using modern and fully CSS2-compliant browsers (Yes, I am staring at you, Internet Explorer).</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#content</span> <span style="color: #6666ff;">.post</span> a<span style="color: #3333ff;">:after </span><span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot; (&quot;</span> attr<span style="color: #00AA00;">&#40;</span>href<span style="color: #00AA00;">&#41;</span> <span style="color: #ff0000;">&quot;) &quot;</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">90%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The above rule states that <strong>after</strong> any anchor tag within the post, the href attribute value should be added in parenthesis. It also additionally puts the link in a slightly smaller font so that the link text gets more attention.</p>
<p>However, when I actually tried this I didn&#8217;t like it. The resulting printed view is too cluttered, specially if you have a sizable amount of links in your post, or if some of them reference URLs that are too long and hard to read. It would be really nice if one could selectively apply this printed styling to certain links only.</p>
<p>An apparent solution would be to apply a certain CSS class to the links we want to have this behavior, and then specify in our style sheet that the rule above should only apply to links with this CSS class.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#content</span> <span style="color: #6666ff;">.post</span> a<span style="color: #6666ff;">.print-href</span><span style="color: #3333ff;">:after </span><span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot; (&quot;</span> attr<span style="color: #00AA00;">&#40;</span>href<span style="color: #00AA00;">&#41;</span> <span style="color: #ff0000;">&quot;) &quot;</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">90%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Note the <code>.print-href</code> class in the CSS selector. We now have to apply this class to all the links in a post that we want to be printed along with the referenced URL.</p>
<p>The problem is that there&#8217;s no straightforward way of doing this in WordPress&#8217; post editor. The link popup allows you to specify a style class to be selected from a predefined set of wordpress-specific classes, but not your own.</p>
<h3>Plugins to save the day</h3>
<p>The short story about how to solve this, involves installing the <a href="http://wordpress.org/extend/plugins/tinymce-advanced/" target="_blank">TinyMCE Advanced plugin</a> in WordPress, which enhances the post editor in several ways. One of the several enhancements is that the link popup is larger and has more options, even a few separate tabs grouping lots of different options. The last tab, the one labeled <em>Advanced</em>, allows you to arbitrarily specify the value for several possible attributes of the anchor tag, including the <code>class</code> attribute.</p>
<p><a href="http://gnapse.com/blog/wp-content/uploads/2010/09/wordpress-advanced-links.png"><img class="aligncenter size-full wp-image-204" title="Advanced links popup for WordPress" src="http://gnapse.com/blog/wp-content/uploads/2010/09/wordpress-advanced-links.png" alt="" width="486" height="423" /></a></p>
<p>Notice the classes text field in the picture above, where it is already filled with the class name. The actual class name doesn&#8217;t matter, as long as you use the same class name in both your links and the CSS rule in your stylesheet.</p>
<p>So now, if you <a href="javascript:window.print();">print this post</a>, you&#8217;ll notice how some links in it get printed along with the referenced web page, and others don&#8217;t. I hope this hint may helpful to anybody out there.</p>
<p><strong>Do you know any other helpful hints about making web pages and blog posts more printer-friendly?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2010/09/08/selectively-print-link-urls-in-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily arrange your windows with ShiftIt</title>
		<link>http://gnapse.com/blog/2010/08/25/easily-arrange-your-windows-with-shiftit/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=easily-arrange-your-windows-with-shiftit</link>
		<comments>http://gnapse.com/blog/2010/08/25/easily-arrange-your-windows-with-shiftit/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 21:26:04 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[divvy]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[shiftit]]></category>
		<category><![CDATA[window management]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=194</guid>
		<description><![CDATA[Yesterday I learned via TheAppleBlog about a nifty little software called Divvy, which allows you to quickly arrange and position windows in your Mac desktop with a menu and configurable shortcuts. The application sits away in the menu bar and you can click on it or invoke via a global shortcut key. You can then [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I learned via <a title="Divvy up your screen" href="http://theappleblog.com/2010/08/24/divvy-up-your-screen/" target="_blank">TheAppleBlog</a> about a nifty little software called <a class="print-href" href="http://www.mizage.com/divvy/" target="_blank">Divvy</a>, which allows you to quickly arrange and position windows in your Mac desktop with a menu and configurable shortcuts. The application sits away in the menu bar and you can click on it or invoke via a global shortcut key. You can then tell it to re-position the frontmost window according to what you specify in a grid-like representation of the screen.</p>
<p>Since I don&#8217;t have $14 to spare on this app, and I also do not really think it&#8217;s worth it, I went on to <a class="print-href" title="AlternativeTo" href="http://alternativeto.net/" target="_blank">find some alternative softwares</a> for this. This wonderful website alternativeto.net allows you to look for software applications on certain platforms and find out about some other softwares that could serve as alternatives or equivalents, either in the same platform but free, or perhaps because you are looking for an alternative to switch or use in another platform.</p>
<p>In this case I wanted to find an <a href="http://alternativeto.net/software/divvy/?sort=likes&amp;platform=mac&amp;license=free" target="_blank">alternative to Divvy</a> also for the Mac, but <a class="print-href" title="Gratis vs. Libre" href="http://en.wikipedia.org/wiki/Gratis_versus_Libre" target="_blank">free as in beer</a>. I didn&#8217;t really care that much if it was open source, although it would be a plus. Thankfully I found <a class="print-href" href="http://code.google.com/p/shiftit/" target="_blank">ShiftIt</a>, wich is not only free and open source, but also even better than Divvy in my opinion.<span id="more-194"></span></p>
<p><a href="http://gnapse.com/blog/wp-content/uploads/2010/08/shiftit-menu.png"><img class="alignright size-full wp-image-195" title="ShiftIt menu" src="http://gnapse.com/blog/wp-content/uploads/2010/08/shiftit-menu.png" alt="ShiftIt menu" width="230" height="332" /></a>ShiftIt, just as Divvy, sits unobtrusively in the menu bar. It would be nicer if it had an icon instead of text, but that&#8217;s a minor complain. What makes it great is that it already comes with sensible default shortcuts for positioning windows in logical default locations, such as covering the left or right halves of the screen, or top, or bottom. Plus covering the four screen areas formed by dividing it in four parts: top left, top right, bottom left and bottom right. And of course, two more options for full screen and center a window respectively.</p>
<p>When I saw this I immediately uninstalled Divvy. I found in ShiftIt preconfigured what I was manually configuring in Divvy just a few minutes ago. Exactly those very options, perhaps with some similar shortcuts I invented. Somebody would say that ShiftIt should allow you to customize the shortcuts and/or allow you to add some other configurations, but I guess they just want to keep it simple, and as simple as it is, it is still useful and able to replace Divvy 90% of the time.</p>
<p>I also found out about <a title="Alternatives to Divvy" href="http://alternativeto.net/software/divvy/?sort=likes&amp;platform=mac" target="_blank">other similar alternatives</a>, like SizeUp, Cinch, etc. But I only really tried the free one, as this was my goal. But maybe you want to try them all and stick with what you think is the best. And don&#8217;t be shy about making any suggestions here, either free software or not.</p>
<p><strong>Do you know about any alternatives to Divvy and ShiftIt, be it for the Mac or not? Maybe with better or different features?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2010/08/25/easily-arrange-your-windows-with-shiftit/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

