<?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>RedBrain @ $HOME : ~ $ &#187; Linux Outlaws</title>
	<atom:link href="http://redbrain.co.uk/index.php/tag/linux-outlaws/feed/" rel="self" type="application/rss+xml" />
	<link>http://redbrain.co.uk</link>
	<description>Frustrated Software Developer</description>
	<lastBuildDate>Sat, 19 May 2012 00:58:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WordPress syntax highlighting &#8211; String matching</title>
		<link>http://redbrain.co.uk/index.php/about-me/wordpress-syntax-highlighting-string-matching/</link>
		<comments>http://redbrain.co.uk/index.php/about-me/wordpress-syntax-highlighting-string-matching/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 00:28:48 +0000</pubDate>
		<dc:creator>redbrain</dc:creator>
				<category><![CDATA[About Me]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Update!]]></category>
		<category><![CDATA[c/c++]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Linux Outlaws]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://redbrain.co.uk/?p=321</guid>
		<description><![CDATA[<p>So yeah i wanted to do this for ages! Proper code posting that works i played a lot with almost all plug-ins i am sure and like none of them worked for me and i just know it was probably something stupid but i really don&#8217;t know much about web-development if it isn&#8217;t talking about [...]]]></description>
			<content:encoded><![CDATA[<p>So yeah i wanted to do this for ages! Proper code posting that works i played a lot with almost all plug-ins i am sure and like none of them worked for me and i just know it was probably something stupid but i really don&#8217;t know much about web-development if it isn&#8217;t talking about pointers to memory and command line interfaces it doesn&#8217;t interest me rofl&#8230;</p>
<p>People laugh at me using mplayer at work for my music player in a tty but i just prefer it at the moment i like applications like songbird etc but no music application except <a href="http://www.atunes.org/">aTunes</a> has had good music database refreshing. What i mean is generally most music applications like you add your music to them thats dead on but if you manually manipulate that directory and move rename or delete the previous entries are still there! And there is never a refresh button to go through the folders and clean the database!</p>
<p>Anyways so i want to re-post my string matching algorithm because i love it <img src='http://redbrain.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  saves me a lot of time in some programs because in c there doesn&#8217;t seem to be that many nice string functions other than strcmp strcat and the relevant strncmp strncat for buffer-overflow and stack smashing  error handling..</p>
<p>So here it is:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="coMULTI">/**</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; * @param str -&gt; string you want to search through</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; * @param comap -&gt; the string you want to search for in the str*</span></div>
</li>
<li class="li2">
<div class="de2"><span class="coMULTI">&nbsp; * @returns the the postion the comparison is in the string else -1</span></div>
</li>
<li class="li1">
<div class="de1"><span class="coMULTI">&nbsp; */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw2">extern</span> size_t str_getPlace<span class="br0">&#40;</span> <span class="kw4">char</span>* str, <span class="kw4">char</span>* comp<span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; size_t i, counter, complen=strlen<span class="br0">&#40;</span>comp<span class="br0">&#41;</span>, skip_counter=<span class="nu0">0</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; i=complen<span class="nu0">-1</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span>;;<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//printf(&quot;no: %i &#8211; orig: %c &#8211; %c\n&quot;,i,str[i],comp[complen-1]);</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span> comp<span class="br0">&#91;</span>complen<span class="nu0">-1</span><span class="br0">&#93;</span> == str<span class="br0">&#91;</span>i<span class="br0">&#93;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; <span class="co1">//reset counter = 1 as we found one char already <img src='http://redbrain.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; counter=<span class="nu0">1</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>complen &gt; <span class="nu0">1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw4">int</span> j;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">for</span><span class="br0">&#40;</span>j=complen<span class="nu0">-2</span>; j&gt;<span class="nu0">-1</span>; &#8211;j<span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &#8211;i;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span> comp<span class="br0">&#91;</span>j<span class="br0">&#93;</span> == str<span class="br0">&#91;</span>i<span class="br0">&#93;</span> <span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; counter++;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">else</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="co1">//skipping length + the counter of already checked</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; i+=complen+counter;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw2">break</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; <span class="co1">//printf(&quot;Counters: comp length: %i -counter %i\n&quot;,strlen(comp),counter);</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span> counter == strlen<span class="br0">&#40;</span>comp<span class="br0">&#41;</span> <span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">return</span> i;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="co1">//if i is bigger than length of string or the remaining length is less than the length of the search</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>i &gt;= strlen<span class="br0">&#40;</span>str<span class="br0">&#41;</span> || <span class="br0">&#40;</span>strlen<span class="br0">&#40;</span>str<span class="br0">&#41;</span> -i<span class="br0">&#41;</span> &lt;= complen <span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; skip_counter++;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="co1">//if skipped more than the length of the search as there is no match!</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">if</span><span class="br0">&#40;</span> skip_counter &gt;= complen <span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">break</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; <span class="kw1">else</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; i=complen+skip_counter<span class="nu0">-1</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; i+=complen;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="kw1">return</span> <span class="nu0">-1</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>I really shouldn&#8217;t be returning -1 when the function returns type size_t but that can be changed quickly!  So lets see how this looks<br />
So recently i have been getting interested in lots of work!  I am concentrating on certain things and in my previous post i moved my main work over to launchpad. But i guess my main projects are:</p>
<p>silix-kernel, silix-compiler (just to be basic front-end compiler with gmp possibly)<br />
I am trying to decide to make either a nice working compiler using proper libraries or a simple compiler for me to bootstrap gcc when i get my kernel a little further!</p>
<p>The one thing in OS development i see at the minute is that there is like GCC for a compiler and that is pretty much it, and the problem i see with gcc is that say if you make a simple new kernel for a project you still cant bootstrap this onto your computer you have to make yourself a basic iso standard compiler. And even with GCC you depend bison GMP big num library and a few other bits a bobs. So porting this is a simple OS is like like not an easy task! Oh and yeah you need auto tools. So yeah when you get gcc onto your os then your sorted but you need a simple compiler before that to get bash setup etc. But i am by no means even close to getting that far!</p>
<p>To get to that stage i need memory mangement to free deallocated memory! I keep crashing atm. And i need a binary format hopefully something like a.out cant be that bad i think an elf binary could be pretty complicated for me to begin with but even before that i need file-system support! Haha</p>
<p>You can see the amount of work there is into a OS but i love it. I just want more time to work on it. I got that book the Minix book on OS its is really good. Probably one of the best to be very implementation specific.</p>
<p>Anyways moving on! This post is getting quite long and i have work tomorrow, though Rambo 2 has just come on to the tv!</p>
<p>Anyways the main part of this post i want you guys to check out Dan Lynch&#8217;s Blog he put up and awesome post on Linux there recently: <a href="http://danlynch.org/blog/2009/03/critical/">http://danlynch.org/blog/2009/03/critical/</a></p>
<p>It was really heart-warming and apparently his web-server died due to the digg-effect <img src='http://redbrain.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Dan and Fab from Linux outlaws have always been such a great inspiration to me for Linux and free-software. Mainly Linux because shows you normal people apricate what hackers are doing for the community and community tools. Imagine no Firefox or no open-office I&#8217;d be buggered! <img src='http://redbrain.co.uk/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Anyways i spent my st patricks day watching Star-wars and playing quake for a little this morning. But the main part i started playing with drizzle -yacc and twisted python networking framework its insane how powerful it is! It could have so many uses! Check it out over at: <a href="http://twistedmatrix.com/trac/">http://twistedmatrix.com/trac/</a></p>
<p>Its really easy to work with and makes sending data around networks really simple and no need for working with sockets <img src='http://redbrain.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' />  Even though i secretly love working with Socket Programming because in the end is just the simplest way it all works. Because i really Hate things like CIM and WBEM whats the point of saturating your network with XML everywhere just to send 32bit number over the network the odd time. And the worst part its so sparse and CIM and Wbem all talk about being cross-platform etc, all you do is draw up schema&#8217;s etc, but the problem is CIM and wbem i think has been designed from Client side application designers so in the end you end up with something that works nicely for Client side applications that make it all really abstracted but its a messy system side design.</p>
<div class="wp-caption alignleft" style="width: 344px"><a href="http://icanhascheezburger.files.wordpress.com/2009/02/funny-pictures-strange-cat-wants-you-to-feed-him.jpg"><img title="Keep your attention" src="http://icanhascheezburger.files.wordpress.com/2009/02/funny-pictures-strange-cat-wants-you-to-feed-him.jpg" alt="Keep-your-attention" width="334" height="223" /></a><p class="wp-caption-text">Keep-your-attention</p></div>
<p>Anyways this is why i think Twisted should be a good framework,. i have noticed a lot of people are getting into using xmpp for the same kind of thing my problem with xmpp is its great to program with but you rely on a jabber server like openfire, and each component you write has to have its own login and password to xmpp because essentially you are handling everything like you opened a chat-window to your code, which is kind of funny but really whats the need for a whole seprate server you just want your landscape each with a program from which you have a local client app to connect to each of these.</p>
<p>One more thing i have been keeping an up dated Belfast LUG webpage recently over at: <a href="http://www.belfastlinux.org/wiki/Main_Page">http://www.belfastlinux.org/wiki/Main_Page</a></p>
<p>There is also Planet Belfast Linux which is an aggregation of all our blogs from the Belfast LUG <a href="http://planet.belfastlinux.org/">http://planet.belfastlinux.org/</a></p>
<p>Anyways i might quickly post up a new page on java-ant basics because it should be pretty sort, anyways:</p>
<p>Peace &lt;3 Linux- funny cats <img src='http://redbrain.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> : <a href="http://www.youtube.com/watch?v=SUNmLuNdiL8"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://redbrain.co.uk/index.php/about-me/wordpress-syntax-highlighting-string-matching/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hat&#039;s off to them!</title>
		<link>http://redbrain.co.uk/index.php/random/hats-off-to-them/</link>
		<comments>http://redbrain.co.uk/index.php/random/hats-off-to-them/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 13:48:11 +0000</pubDate>
		<dc:creator>redbrain</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Linux Outlaws]]></category>
		<category><![CDATA[Lug Raidio]]></category>

		<guid isPermaLink="false">http://redbrain.co.uk/?p=58</guid>
		<description><![CDATA[<p>I just have just listened to the lug radio live 2008 episode and you have to check it out its really awesome goes to show how good lug radio has been to the community using community tools bring the community togeher in the words of the Bacon that is jono&#8230; anyways check it out:</p>
<p>http://lugradio.org/</p>
<p>Anyways i [...]]]></description>
			<content:encoded><![CDATA[<p>I just have just listened to the lug radio live 2008 episode and you have to check it out its really awesome goes to show how good lug radio has been to the community using community tools bring the community togeher in the words of the Bacon that is jono&#8230; anyways check it out:</p>
<p><a href="http://lugradio.org/">http://lugradio.org/</a></p>
<p>Anyways i just want to say how good <a href="http://linuxoutlaws.com/">Linux outlaws</a> is getting at the moment, for a while i was getting a little bored when Fabsh was away without internet and i forgot how good linux outlaws was <strong>and </strong>is getting, its really touching on all the points and issues i really want to hear and i personally find intereasting. Sometimes it would be nice for someone to do what lugradio did an argue over big issues in the FOSS world. But it wouldnt be the same if a podcast tried to redo this.</p>
<p>Lugradio was probably one of the biggest reasons i go intereasted with linux and open source, but linux outlaws was the one thing that always made me feel good and happy in what i was doign was right and generally made me stick with hacking at my c/c++ code and finally understanding whats going on. I have been using linux for like i don&#8217;t know since i was in high school but only as my main and only os for the last 3 years and i think alot of this had to be attributed to Lugradio and Linux outlaws.</p>
<p>But the one thing i want to say is how amazing Dan and fab are doing at filling the shoes of Jono and Aq from lugradio. I have to say Dan&#8217;s blog on open source is really intereasting:</p>
<p><a href="http://adventuresinopensource.blogspot.com/">http://adventuresinopensource.blogspot.com/</a></p>
<p>And Fabs job and the web site and setting up the micro blogging site on linux outlaws is a big win, it feels like your going onto a website with intereast. Rather than the <a href="http://tllts.org/">http://tllts.org/ </a></p>
<p>The linux link tech show its an ok podcast but i really find it hard to listen to but i think the main thing is their website just looks awful, i dont mean to crap all over everything they have done for FOSS since they are on of the longest running podcasts in the Linux world, but i just find it hard to see why they have such a bad website! <img src='http://redbrain.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyways, the other podcast i really enjoy is the Linux void, and they are really starting to get goog they really need to keep going at their Pacakge and tips of the week becasuse the ario and mpd one was really nice.</p>
<p>Anyways yeah i hope dan and fab read this! <img src='http://redbrain.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  And realise they are doing an amazing job for open source and keeping us g33k&#8217;s up to date with all the happenings in the open souce world and posting usefull tutorials and links to nice programs to check out! <img src='http://redbrain.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Hats off to you guys you deserve it! <img src='http://redbrain.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://redbrain.co.uk/index.php/random/hats-off-to-them/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

