<?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>mcBachmann.de TechBlog &#187; coding</title>
	<atom:link href="http://blog.mcbachmann.de/tag/coding/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.mcbachmann.de</link>
	<description>Der Blog zur Website ;-)</description>
	<lastBuildDate>Thu, 22 Jul 2010 08:55:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Semaphoren-Beispiel</title>
		<link>http://blog.mcbachmann.de/linux/semaphoren-beispiel</link>
		<comments>http://blog.mcbachmann.de/linux/semaphoren-beispiel#comments</comments>
		<pubDate>Tue, 24 Mar 2009 15:51:29 +0000</pubDate>
		<dc:creator>Sven Bachmann</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[semaphore]]></category>

		<guid isPermaLink="false">http://blog.mcbachmann.de/?p=259</guid>
		<description><![CDATA[Um 2007 rum habe ich mal ein Beispielprogramm geschrieben das zeigt wie man benamte Semaphoren unter Linux nutzt. Dies habe ich nun wiedergefunden, den Code ein wenig überflogen, die GPLv2 Lizenz hinzugefügt und online gestellt: Benamte Semaphoren unter Linux. 
Kurze Erklärung zu Semaphoren: Semaphoren sind eine Möglichkeit parallele Zugriffe auf eine Resource (bzw. mehrere, aber [...]]]></description>
			<content:encoded><![CDATA[<p>Um 2007 rum habe ich mal ein Beispielprogramm geschrieben das zeigt wie man benamte Semaphoren unter Linux nutzt. Dies habe ich nun wiedergefunden, den Code ein wenig überflogen, die GPLv2 Lizenz hinzugefügt und online gestellt: <a href="http://mcbachmann.de/semaphore.html">Benamte Semaphoren unter Linux</a>. <span id="more-259"></span></p>
<p>Kurze Erklärung zu Semaphoren: Semaphoren sind eine Möglichkeit parallele Zugriffe auf eine Resource (bzw. mehrere, aber begrenzte Resourcen ähnlichen Typs) zu regeln. Zum Beispiel wenn man sicherstellen will, dass bei 2 parallelen Zuggleisen und 2 wartendenen Zügen nur ein Zug zur gleichen Zeit die Weiche benutzen darf.</p>
<p>Anderes Beispiel: Eine Firma hat 5 Drucker und 10 Leute drucken um 2min versetzt jeweils ein Dokument mit 250 Seiten. Die ersten 5 Leute bekommen jeweils ihren &#8220;eigenen&#8221; Drucker zugewiesen und die anderen 5 müssen eben warten &#8211; ohne eine Semaphoren-Technik würde es dazu führen das die Blätter von Nutzer 1 mit denen von Nutzer 6 gemischt aus dem Drucker kämen &#8211; ein Chaos <img src='http://blog.mcbachmann.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Semaphoren stellen also eine Art der Zugriffsregelung dar, und zwar immer dann wenn Vorgänge parallel auftreten können ohne das man vorher eine Möglichkeit hat sich abzustimmen.</p>
<p>Weitere Informationen hält <a href="http://de.wikipedia.org/wiki/Semaphor_(Informatik)">Wikipedia</a> bereit.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mcbachmann.de/linux/semaphoren-beispiel/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding C: Warning: [...] is COMMON symbol</title>
		<link>http://blog.mcbachmann.de/linux/coding-c-warning-is-common-symbol</link>
		<comments>http://blog.mcbachmann.de/linux/coding-c-warning-is-common-symbol#comments</comments>
		<pubDate>Thu, 20 Nov 2008 14:06:53 +0000</pubDate>
		<dc:creator>Sven Bachmann</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.mcbachmann.de/?p=84</guid>
		<description><![CDATA[Hi,
if you&#8217;re writing a kernel module and get the following error:
*** Warning: &#8220;symbol_name&#8221; [/path/to/module] is COMMON symbol
Than its possible that you simply forgot to mark it as static. Thanks for this fix goes to Brad Aisa from the website KernelTrap.
Bye,
  Sven
]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>if you&#8217;re writing a kernel module and get the following error:</p>
<blockquote><p>*** Warning: &#8220;symbol_name&#8221; [/path/to/module] is COMMON symbol</p></blockquote>
<p>Than its possible that you simply forgot to mark it as <strong>static</strong>. Thanks for this fix goes to Brad Aisa from the website <a href="https://kerneltrap.org/node/2081">KernelTrap</a>.</p>
<p>Bye,<br />
  Sven</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mcbachmann.de/linux/coding-c-warning-is-common-symbol/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding C: initialize structs in definition</title>
		<link>http://blog.mcbachmann.de/linux/programming/coding-c-initialize-structs-in-definition</link>
		<comments>http://blog.mcbachmann.de/linux/programming/coding-c-initialize-structs-in-definition#comments</comments>
		<pubDate>Tue, 11 Nov 2008 11:38:40 +0000</pubDate>
		<dc:creator>Sven Bachmann</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.mcbachmann.de/?p=67</guid>
		<description><![CDATA[Hi,

Task
We have a included struct called counter and we don&#8217;t want to assign the initial values in the main function.

Solution
source.c

#include &#60;counters.h&#62;

struct counter_t counter = {
&#160;&#160;&#160;&#160;.max_value = 1234,
};

int main(void)
{
&#160;&#160;&#160;&#160;return(0);
}


Bye,
  Sven
]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p><strong><br />
Task</strong></p>
<p>We have a included struct called <em>counter</em> and we don&#8217;t want to assign the initial values in the main function.</p>
<p><strong><br />
Solution</strong></p>
<p><em>source.c</em></p>
<blockquote><p>
<code>#include &lt;counters.h&gt;<br />
<br />
struct counter_t counter = {<br />
&nbsp;&nbsp;&nbsp;&nbsp;.max_value = 1234,<br />
};<br />
<br />
int main(void)<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;return(0);<br />
}<br />
</code>
</p></blockquote>
<p>Bye,<br />
  Sven</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mcbachmann.de/linux/programming/coding-c-initialize-structs-in-definition/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coding C: put timestamp into your project</title>
		<link>http://blog.mcbachmann.de/linux/programming/coding-c-put-timestamp-into-your-project</link>
		<comments>http://blog.mcbachmann.de/linux/programming/coding-c-put-timestamp-into-your-project#comments</comments>
		<pubDate>Thu, 06 Nov 2008 09:26:42 +0000</pubDate>
		<dc:creator>Sven Bachmann</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.mcbachmann.de/?p=49</guid>
		<description><![CDATA[Hi there,

Task
We have a Makefile, we have a C file, now we want update a timestamp whenever the C file is compiled.

Solution
Makefile

CFLAGS += -D__TIMESTAMP__=\""$(shell date +%Y/%m/%d\ %H:%M:%S)"\"

source.c

#include &#60;stdio.h&#62;

#ifndef __TIMESTAMP__
#define __TIMESTAMP__   "NO TIMESTAMP DEFINED"
#endif /* __TIMESTAMP__ */

int main(void)
{
&#160;&#160;&#160;&#160;printf("my tool (TS: %s)\n", __TIMESTAMP__);
&#160;&#160;&#160;&#160;return(0);
}


Output

~$ ./source
my tool (TS: 2008/11/06 09:55:22)

Bye,
  Sven
]]></description>
			<content:encoded><![CDATA[<p>Hi there,</p>
<p><strong><br />
Task</strong></p>
<p>We have a Makefile, we have a C file, now we want update a timestamp whenever the C file is compiled.</p>
<p><strong><br />
Solution</strong></p>
<p><em>Makefile</em></p>
<blockquote><p>
<code>CFLAGS += -D__TIMESTAMP__=\""$(shell date +%Y/%m/%d\ %H:%M:%S)"\"</code>
</p></blockquote>
<p><em>source.c</em></p>
<blockquote><p>
<code>#include &lt;stdio.h&gt;<br />
<br />
#ifndef __TIMESTAMP__<br />
#define __TIMESTAMP__   "NO TIMESTAMP DEFINED"<br />
#endif /* __TIMESTAMP__ */<br />
<br />
int main(void)<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;printf("my tool (TS: %s)\n", __TIMESTAMP__);<br />
&nbsp;&nbsp;&nbsp;&nbsp;return(0);<br />
}</code>
</p></blockquote>
<p><strong><br />
Output</strong></p>
<blockquote><p>
<code>~$ ./source<br />
my tool (TS: 2008/11/06 09:55:22)</code>
</p></blockquote>
<p>Bye,<br />
  Sven</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mcbachmann.de/linux/programming/coding-c-put-timestamp-into-your-project/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
