<?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>Snippets of life</title>
	<atom:link href="http://blog.tomribbens.be/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tomribbens.be</link>
	<description>We have done the impossible, and that makes us mighty.</description>
	<lastBuildDate>Thu, 19 Jan 2012 16:23:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.8</generator>
	<item>
		<title>Moving all directories containing music files</title>
		<link>http://blog.tomribbens.be/2012/moving-all-directories-containing-music-files/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=moving-all-directories-containing-music-files</link>
		<comments>http://blog.tomribbens.be/2012/moving-all-directories-containing-music-files/#respond</comments>
		<pubDate>Thu, 19 Jan 2012 16:23:03 +0000</pubDate>
		<dc:creator><![CDATA[tom]]></dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.tomribbens.be/?p=18</guid>
		<description><![CDATA[Recently, I wanted to move all subdirectories containing FLAC files to a separate directory. However, in that particular directory were about 250 such directories, and a lot of other with unrelated data, which I did not want to move. I was in no way interested in selecting which directories manually. With a combination of find, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Recently, I wanted to move all subdirectories containing <a href="http://www.google.be/url?sa=t&amp;rct=j&amp;q=flac&amp;source=web&amp;cd=1&amp;ved=0CDUQFjAA&amp;url=http%3A%2F%2Fflac.sourceforge.net%2F&amp;ei=rDYYT_6xDY3ssgbx3YzlDQ&amp;usg=AFQjCNE-b3ffrmbNURafVWx8vqd_iARi1A&amp;sig2=xCIS958-7coLFjki5n011A" target="_blank">FLAC </a>files to a separate directory. However, in that particular directory were about 250 such directories, and a lot of other with unrelated data, which I did not want to move. I was in no way interested in selecting which directories manually.</p>
<p>With a combination of find, sed, xargs I tried to solve the problem myself first. This, however, turned out to be rather difficult. Filenames were not escaped properly, and since many contained single quotes, it always failed. After a while, I went online, to the #bash IRC channel on Freenode. I asked my question there, and was helped quite quickly with this set of commands:</p>
<blockquote><p>shopt -s globstar nullglob; for dir in */; do f=("$dir"/**/*.flac); if ((${#f[@]})); then mv "$dir" /destination/path/; fi; done</p></blockquote>
<p>Let's properly indent that, so it's easier to parse:</p>
<blockquote><p>shopt -s globstar nullglob<br />
for dir in */<br />
do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;f=("$dir"/**/*.flac)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ((${#f[@]}))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mv "$dir" /destination/path/<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi<br />
done</p></blockquote>
<p>This still contained some magic for me. I wanted to know how and why this works. The helpful people on IRC already set me on my way, by giving these explanations:</p>
<blockquote><p>nullglob: a shell option (shopt) which causes unmatched globs to expand to nothing, rather than themselves. Example: shopt -s nullglob; files=(*); echo "There are ${#files[@]} files."</p></blockquote>
<p>and</p>
<blockquote><p>In bash 4, when the globstar shell option is enabled ( shopt -s globstar ), the glob ** expands to all files and directories found recursively under the current directory, and **/ to all directories. As of 4.0.28, combinations like foo/**/*.txt work, but **.txt and foo** do not.</p></blockquote>
<p>They also pointed me towards their FAQ entry on <a href="http://mywiki.wooledge.org/BashFAQ/005" target="_blank">arrays in Bash</a>.</p>
<p>Putting this all together, it's not that hard to understand anymore:</p>
<p>We loop through all subdirectories of the current one with the for statement. Using the globstar option, an array is created which contains all .flac files in any subdirectory in there. Because of the nullglob option, when no .flac file exist in the directory, it is expanded to nothing. The ${#f[@]} command simply returns how many array members the array f includes. If no .flac files were found, the array would be empty, and that statement would return zero results, failing the if statement. If it does contain any .flac files, the statement would return a positive integer, which passes the if test, in which we can move the directory to wherever we want.</p>
<p>All in all this is not so difficult, but the sparse syntax on how to handle arrays make it look more complicated than it really is. One also has to know about the various shell options that are available. A list of options can be found <a href="http://www.gnu.org/software/bash/manual/bashref.html#The-Shopt-Builtin" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomribbens.be/2012/moving-all-directories-containing-music-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Typing Dvorak</title>
		<link>http://blog.tomribbens.be/2012/typing-dvorak/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=typing-dvorak</link>
		<comments>http://blog.tomribbens.be/2012/typing-dvorak/#respond</comments>
		<pubDate>Fri, 13 Jan 2012 16:51:39 +0000</pubDate>
		<dc:creator><![CDATA[tom]]></dc:creator>
				<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://blog.tomribbens.be/?p=19</guid>
		<description><![CDATA[I am Tom, and I am using an alternative keyboard layout. I have been for approximately three and a half years now. I am typing on the Dvorak Simplified Keyboard. I had known about the Dvorak layout for some time, and had even tried to switch to it before but hadn't succeeded. What is Dvorak? [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I am Tom, and I am using an alternative keyboard layout. I have been for <a href="https://www.facebook.com/tom.ribbens/timeline/story?ut=35&amp;wstart=1212303600&amp;wend=1214895599&amp;hash=7034899563926667921" target="_blank">approximately three and a half years</a> now. I am typing on the <a href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard" target="_blank">Dvorak Simplified Keyboard</a>. I had known about the Dvorak layout for some time, and had even tried to switch to it before but hadn't succeeded.</p>
<h1>What is Dvorak?</h1>
<p>The Dvorak keyboard layout was designed by Dr August Dvorak as an alternative to QWERTY. It was designed with the ease of use for the end user in mind, unlike it's counterpart, which was designed to minimize machine malfunction. The theory behind Dvorak is twofold: less finger movement while typing is better and alternating between hands while typing various letters is better. The result of this is that all vowels are on the home row on the left side, and most important consonants are on the home row of the right hand. More information can be found on the Wikipedia entry mentioned above.</p>
<h1>Why switch?</h1>
<p>I switched mainly because of the increase in speed promised. The idea that less RSI injuries would occur were also positive, but secondary to me. Also, I like trying out new things like this.</p>
<h1>How did I switch?</h1>
<p>One day, I simply decided I was going to learn Dvorak, and changed my computer's settings so that my keyboard layout effectively changed. I took a schematic of the layout, and put it on my screen, marked it to be always on top, put my hands on the home row of my keyboard and started typing whatever it was I had to type. I relied on that image to know where any letters would be for about 3 days. At that point, I could type without needing the image, but it was very slow. I just stuck to it, and after about a month, I was back at my original typing speed.</p>
<h1>Side-effects?</h1>
<p>While I tried to stick to Dvorak as much as possible while learning, at one point I had to type using a AZERTY or QWERTY keyboard. I couldn't anymore. It simply didn't work, I could not remember where any letters were. This was at least a few days in, when I was already typing blind on Dvorak. Once I was typing fluently on Dvorak, my ability to type on the other keyboard layouts returned. Now I am able to switch between the three keyboard layouts fairly easy. I am more likely to confuse AZERTY and QWERTY with each other than to confuse Dvorak with any of the other two.</p>
<p>After the first month, the only problems that arise, are more of a social nature. Because I use a standard QWERTY keybeard, and without any stickers, the keyboard does not match what is typed. This is annoying when co-workers and friends want or need to use my computer. Also, for work related purposes I often need to connect to remote computers using various systems, and they all respond a little different to the alternate keyboard layout.</p>
<h1>Improvements?</h1>
<p>My initial goal was to type faster. Unfortunately, I failed at that. My current typing speed is about 65 wpm, which is roughly the same as before. However, I do feel more relaxed while typing on a Dvorak keyboard compared to the more traditional choices. I would not readily switch back, even though it would not be that difficult, since I am still able to type on a QWERTY layout.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomribbens.be/2012/typing-dvorak/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Year&#8217;s Resolutions</title>
		<link>http://blog.tomribbens.be/2012/new-years-resolutions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-years-resolutions</link>
		<comments>http://blog.tomribbens.be/2012/new-years-resolutions/#respond</comments>
		<pubDate>Sat, 07 Jan 2012 15:11:57 +0000</pubDate>
		<dc:creator><![CDATA[tom]]></dc:creator>
				<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://blog.tomribbens.be/?p=16</guid>
		<description><![CDATA[While it might be a bit late to make New Year's resolutions, I'm still going to do it. I know it's unlikely I'm going to keep up with all of them, but at least, I will not fail January 2nd, since I start them later than that. First one on the list, is to write [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>While it might be a bit late to make New Year's resolutions, I'm still going to do it. I know it's unlikely I'm going to keep up with all of them, but at least, I will not fail January 2nd, since I start them later than that.</p>
<p>First one on the list, is to write a blog. I have been wanting to start a blog for some time now. Somewhere in June 2011, I set up WordPress and spent some time in finding a theme, modifying it a bit and such. And after that, no content whatsoever was put on the blog. It's a shame that I spent all that work, and have not put any content on it. So I will start to do that. Now the difficult part is: what topics will I cover on my blog? As with most people, I have multiple interests, and even more opinions on very diverse topics. I will put a mix of all that on this blog. I will try to categorize everything correctly where possible, so potential readers could filter more efficiently. I will write in English, since I want to cover  some tech-topics, which will be relevant to people who don't speak Dutch. I also hope to improve my English writing skills, because I notice I am making weird sentences.</p>
<p>Second, I need to do more sports. I've been saying that for some time, and have actually done some sports for stretches of 3 months in the last year, but basically I had stopped again. I envision myself doing three things: swimming, badminton and walking:</p>
<ul>
<li>Swimming is great for me, since I can do it alone. Due to my irregular work schedule, this is something I really need. I want to swim approximately three to four times per week. Half a year ago, I followed the <em>Start to Swim</em> training program for 1km, but when changing jobs in October, I stopped. I should get back to swimming that distance. In a couple months I'll review if I need to swim more, and have the time for it.</li>
<li>I have a group of friends who play badminton each week. I try to join them as much as possible, but due to my irregular work schedule, that is often difficult. I will continue to try though.</li>
<li>When watching a movie or a series, I should get on the treadmill I have at home, and walk. Just walking for the complete duration of the movie I'm watching, nothing more.</li>
</ul>
<p>Third, I want to clean up and redecorate the house. There's a lot of stuff lying around at my place. A lot of it is old stuff I don't need anymore. I'm in the process of cleaning everything up, throwing a lot of stuff out, putting some other stuff on the attic, and giving the rest an organised place. I have two rooms which used to be my sister's and my bedroom. I'm starting with those, because I want to make a desk and tech lab environment from them. In one, I want to have a lot of desk space. The other room will the comms room, where all noisy machines go.</p>
<p>I want that lab environment, because I also want to get myself on the right track for <a href="http://www.cisco.com/web/learning/le3/le2/le37/le65/learning_certification_type_home.html" target="_blank">CCNP Voice</a> certification this year. I will need to become <a href="http://www.cisco.com/web/learning/le3/le2/le0/le3/learning_certification_type_home.html" target="_blank">CCNA Voice</a> first, still needing to pass the <a href="https://learningnetwork.cisco.com/community/certifications/voice_ccna/icomm" target="_blank">640-461 ICOMM</a> exam. I might not get to all exams this year, but I should be on my way at least. I hope that working at <a href="http://www.computacenter.com" target="_blank">Computacenter</a> I will learn a lot during working hours as well, so it won't be as big a challenge as it would otherwise be.</p>
<p>If I don't give abandon my first resolution too quickly, expect to read about the others here.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tomribbens.be/2012/new-years-resolutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
