<?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>Braindump &#187; programmierung</title>
	<atom:link href="http://www.braindump.ch/tag/programmierung/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.braindump.ch</link>
	<description>(engl.; deutsch: Hirnauszug, „Gedächtnisprotokoll“, „das was hängengeblieben ist“)</description>
	<lastBuildDate>Mon, 02 Jan 2012 10:54:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Geschlossenheit von Integerlisten grafisch darstellen</title>
		<link>http://www.braindump.ch/2011/07/11/geschlossenheit-von-integerlisten-grafisch-darstellen/</link>
		<comments>http://www.braindump.ch/2011/07/11/geschlossenheit-von-integerlisten-grafisch-darstellen/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 16:12:10 +0000</pubDate>
		<dc:creator>Markus Graf</dc:creator>
				<category><![CDATA[R]]></category>
		<category><![CDATA[programmierung]]></category>
		<category><![CDATA[r-project]]></category>

		<guid isPermaLink="false">http://www.braindump.ch/?p=962</guid>
		<description><![CDATA[Hintergrund der folgenden in R geschriebenen Funktion war es  darzustellen wie Kohärent der index von Datenbanktabellen ist. Fehlende Datensätze sollen farblich hervorgehoben werden.  tableCoherence &#60;- function(x,main=&#8221;", xlab=&#8221;ID&#8221;){   total &#60;- length(min(x):max(x)) # Total amount of expected entries   tmp &#60;- rep(1,100) # Temporary table with 100 parts   # Loop through each number from the lowest to the highest   [...]]]></description>
			<content:encoded><![CDATA[<p>Hintergrund der folgenden in R geschriebenen Funktion war es  darzustellen wie Kohärent der index von Datenbanktabellen ist. Fehlende Datensätze sollen farblich hervorgehoben werden. </p>
<p>tableCoherence &lt;- function(x,main=&#8221;", xlab=&#8221;ID&#8221;){<br />
  total &lt;- length(min(x):max(x)) # Total amount of expected entries<br />
  tmp &lt;- rep(1,100) # Temporary table with 100 parts<br />
  # Loop through each number from the lowest to the highest<br />
  for(i in min(x):max(x)) {<br />
    # Mark the i-th percent of this 100 parts as red (0)<br />
    # if it doesn&#8217;t exist in the input integer vecotor<br />
    if (!(i %in% x)) {<br />
     tmp[round((i - min(x))/total * 100)]  = 0<br />
    }<br />
  }<br />
 <br />
  # Create a new plot<br />
  plot.new()<br />
  plot.window(xlim=c(0,100), ylim=c(0,100))<br />
  # Set title and xlab<br />
  title(main=main)<br />
  title(xlab=xlab)<br />
  # Loop trough the 100 parts and mark<br />
  # 1 with green and 0 with red<br />
  for(i in 1:100) {<br />
    if (tmp[i] == 1){<br />
      segments(i, 0, i, 80, col= &#8216;green&#8217;,lwd=2)<br />
    }else{<br />
      segments(i, 0, i, 100, col= &#8216;red&#8217;,lwd=2)<br />
    }<br />
  }<br />
  # Label the x-axis<br />
  axis(1, at=1:100, lab=round(seq(min(x), max(x), length.out= 100)))<br />
}</p>
<p>Nehmen wir an, wir hätten eine Tabelle &#8220;SampleTable&#8221; die einige Fehlende Daten hat (11,15-29,34-39). So kann dies mit der obigen Funktion dargestellt werden. <strong>Beachtet werden muss jedoch, dass diese Funktion momentan nur mit Integerlisten funktioniert, die mehr als 100 Einträge aufweisen.</strong></p>
<pre>tableCoherence(c(1:10,12:14,30:33,40:102),"Coherence of table 'SampleTable'")</pre>
<pre><a href="http://www.braindump.ch/wp-content/uploads/2011/07/Coherence.png"><img class="alignnone size-full wp-image-964" title="Coherence" src="http://www.braindump.ch/wp-content/uploads/2011/07/Coherence.png" alt="" width="550" height="450" /></a></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.braindump.ch/2011/07/11/geschlossenheit-von-integerlisten-grafisch-darstellen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tadaaaa! Sound abspielen in Cocoa/Objective-C</title>
		<link>http://www.braindump.ch/2008/07/12/tadaaaa-sound-abspielen-in-cocoaobjective-c/</link>
		<comments>http://www.braindump.ch/2008/07/12/tadaaaa-sound-abspielen-in-cocoaobjective-c/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 16:24:41 +0000</pubDate>
		<dc:creator>Markus Graf</dc:creator>
				<category><![CDATA[Apple Software]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[programmierung]]></category>

		<guid isPermaLink="false">http://blog.markusgraf.ch/?p=172</guid>
		<description><![CDATA[Hier eine Beispiel-Implementation einer Methode, die eine Sound-Datei abspielen soll. Der Typ der Datei ist dabei relativ egal, sie muss von Apple einfach unterstützt werden. - (void) playAlertSound:(id)soundFile{ NSSound *sound = [[NSSound alloc] initWithContentsOfFile:soundFile byReference: YES]; [sound play]; } Nun können wir die Methode überall relativ simpel aufrufen: [self playAlertSound:[NSString stringWithFormat:@"%@/authoriz.mp3", [[NSBundle mainBundle] resourcePath]]]; [[NSBundle [...]]]></description>
			<content:encoded><![CDATA[<p>Hier eine Beispiel-Implementation einer Methode, die eine Sound-Datei abspielen soll. Der Typ der Datei ist dabei relativ egal, sie muss von Apple einfach unterstützt werden.</p>
<pre>
- (void) playAlertSound:(id)soundFile{
   NSSound *sound = [[NSSound alloc]
                      initWithContentsOfFile:soundFile
                      byReference: YES];
    [sound play];
}
</pre>
<p>Nun können wir die Methode überall relativ simpel aufrufen:</p>
<pre>
[self playAlertSound:[NSString stringWithFormat:@"%@/authoriz.mp3",
[[NSBundle mainBundle] resourcePath]]];
</pre>
<p>[[NSBundle mainBundle] resourcePath]] bezeichnet hierbei den Pfad zum Resourcen-Ordner der Applikation. Der Aufruf kann aber auch mit irgend einer externen Datei gemacht werden:</p>
<pre>
[self playAlertSound:@"/Users/Christoph_Blocher/MyMusic/NationalHymne.mp3"];
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.braindump.ch/2008/07/12/tadaaaa-sound-abspielen-in-cocoaobjective-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

