<?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>blog.sketchit.de</title>
	<atom:link href="http://blog.sketchit.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sketchit.de</link>
	<description>Glaubt mir ich hab den Weihnachtsmann mit eigenen Augen gesehen...</description>
	<lastBuildDate>Mon, 31 Oct 2011 10:21:21 +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>LiveLoops in Pure Data</title>
		<link>http://blog.sketchit.de/2010/02/liveloops-in-pure-data/</link>
		<comments>http://blog.sketchit.de/2010/02/liveloops-in-pure-data/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 16:49:39 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[FH Salzburg]]></category>
		<category><![CDATA[Multimedia Technology]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=222</guid>
		<description><![CDATA[Here is a little loop-generator in pure data. Supports 4 tracks. Click "rec" to record a sound from your build-in microphone. If a certain level of loudness is reached, recording starts. Usefull for live dj performances. Click to download: LiveLoops]]></description>
			<content:encoded><![CDATA[<p>Here is a little loop-generator in pure data. Supports 4 tracks.</p>
<p><a href="http://blog.sketchit.de/wp-content/uploads/2010/02/liveloops.jpg"><img class="aligncenter size-full wp-image-224" title="liveloops" src="http://blog.sketchit.de/wp-content/uploads/2010/02/liveloops.jpg" alt="" width="380" height="102" /></a></p>
<p>Click "rec" to record a sound from your build-in microphone. If a certain level of loudness is reached, recording starts. Usefull for live dj performances.</p>
<p><a href="http://blog.sketchit.de/wp-content/uploads/2010/02/LiveLoops.zip">Click to download: LiveLoops</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2010/02/liveloops-in-pure-data/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>ToneMatrix &#8211; Webcam Object Tracking</title>
		<link>http://blog.sketchit.de/2009/12/tonematrix-webcam-object-tracking/</link>
		<comments>http://blog.sketchit.de/2009/12/tonematrix-webcam-object-tracking/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 11:45:31 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[AS3 & Flash]]></category>
		<category><![CDATA[Multimedia Technology]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[tracking]]></category>
		<category><![CDATA[webcam]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=205</guid>
		<description><![CDATA[During our subject Interface Culture we (Matthias Schmidt, Bettina Steger and my humble self) were working on a project that uses hand-drawn objects on a white paper for making music. Note: You have to allow the webcam! Hold a white paper with black (or dark) objects that you painted on it in front of the [...]]]></description>
			<content:encoded><![CDATA[<p>During our subject Interface Culture we (Matthias Schmidt, Bettina Steger and my humble self) were working on a project that uses hand-drawn objects on a white paper for making music.</p>
<p><em><strong>Note: You have to allow the webcam!</strong></em></p>
<p><strong>Hold a white paper with black (or dark) objects that you painted on it in front of the camera. The red rectangle indicates the tracked area, the green rectangles indicates the tracked objects. Then hit the space-bar (Note: be sure that the flash movie gets the focus)</strong></p>
<p><a title="ToneMatrix Demo" href="http://blog.sketchit.de/wp-content/uploads/2009/12/ToneMatrixApp.swf" target="_blank">Check it out!</a></p>
<p>The flash-app uses the webcam for accessing three different videos. The normal video that we convert into two other videos: A threshold video and a palette video.</p>
<p><a href="http://blog.sketchit.de/wp-content/uploads/2009/12/Screen-shot-2009-12-29-at-12.24.45-PM.png"><img class="aligncenter size-full wp-image-206" title="Screen shot 2009-12-29 at 12.24.45 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/12/Screen-shot-2009-12-29-at-12.24.45-PM.png" alt="" width="478" height="358" /></a></p>
<p><a href="http://blog.sketchit.de/wp-content/uploads/2009/12/Screen-shot-2009-12-29-at-12.25.15-PM.png"><img class="aligncenter size-full wp-image-207" title="Screen shot 2009-12-29 at 12.25.15 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/12/Screen-shot-2009-12-29-at-12.25.15-PM.png" alt="" width="471" height="342" /></a></p>
<p>The palette video is used for tracking the brightest area in the video and reducing the tracking-area to this area (e.g. the white paper is usual the brightest color in the video, so objects that are in the background aren't tracked any longer). The threshold video is used for tracking the darkest objects within the brightest area.</p>
<p>How does this work? In the treshold video it is supposed that the red pixels are the objects, and coherent pixels belongs to one object. I've implemented a flood fill algorithm that counts the pixel of each object and returns the x,y position and width and height of an object. With this information we can nearly perfectly track the object and use for example the pixelamount for the volume of the sound and the x,y/width,height information for the timeline.</p>
<p>When all objects are tracked and you press <strong>the Space-Bar</strong> the tracked area is converted into a matrix of 16x16 fields. Each field represents a sound, fields that are lower plays a lower sound, fields that are higher a higher one. The timeline goes from left to right.</p>
<p><a href="http://blog.sketchit.de/wp-content/uploads/2009/12/Screen-shot-2009-12-29-at-12.36.08-PM.png"><img class="aligncenter size-full wp-image-208" title="Screen shot 2009-12-29 at 12.36.08 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/12/Screen-shot-2009-12-29-at-12.36.08-PM.png" alt="" width="476" height="359" /></a></p>
<p><a href="http://blog.sketchit.de/wp-content/uploads/2009/12/Screen-shot-2009-12-29-at-12.36.51-PM.png"><img class="aligncenter size-full wp-image-209" title="Screen shot 2009-12-29 at 12.36.51 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/12/Screen-shot-2009-12-29-at-12.36.51-PM.png" alt="" width="479" height="359" /></a></p>
<p>The source code is available here: <a href="http://blog.sketchit.de/wp-content/uploads/2009/12/ToneMatrixSource.zip">ToneMatrixSource</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2009/12/tonematrix-webcam-object-tracking/feed/</wfw:commentRss>
		<slash:comments>111</slash:comments>
		</item>
		<item>
		<title>QuadTrees Actionscript 3</title>
		<link>http://blog.sketchit.de/2009/12/quadtrees-actionscript-3/</link>
		<comments>http://blog.sketchit.de/2009/12/quadtrees-actionscript-3/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 10:56:25 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[AS3 & Flash]]></category>
		<category><![CDATA[Multimedia Technology]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Computergraphik]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[QuadTree]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=190</guid>
		<description><![CDATA[Note: Hence, I write my articles in english (and I'm glad if you notice any mistake and send it to me). In our course Computergraphics I've developed an implementation of QuadTrees for Actionscript 3. A QuadTree is a datastructure for increasing the efficiency of collisiondetection or nearest neighbour appointment. Wiki You can enable the collisiondetection [...]]]></description>
			<content:encoded><![CDATA[<p>Note: Hence, I write my articles in english (and I'm glad if you notice any mistake and send it to me).</p>
<p>In our course Computergraphics I've developed an implementation of QuadTrees for Actionscript 3. A QuadTree is a datastructure for increasing the efficiency of collisiondetection or nearest neighbour appointment.</p>
<p><a href="http://en.wikipedia.org/wiki/Quadtree" target="_blank">Wiki</a></p>
<p>You can enable the collisiondetection by hitting a "C" and switch between QuadTree and Bruteforce by hitting Space. The amount of objects can be changed by typing it in the field labeled with 50.<br />
SourceCode: <a href="http://blog.sketchit.de/wp-content/uploads/2009/12/QuadTreeSource.zip">QuadTreeSource</a></p>
<p>
<object width="512" height="597">
<param name="movie" value="http://blog.sketchit.de/wp-content/uploads/2009/12/Main.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<param name="allowScriptAccess" value="always"></param>
<embed type="application/x-shockwave-flash" width="512" height="597" src="http://blog.sketchit.de/wp-content/uploads/2009/12/Main.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2009/12/quadtrees-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>263</slash:comments>
		</item>
		<item>
		<title>Flex mit Ruby on Rails + authlogic authenitifizieren</title>
		<link>http://blog.sketchit.de/2009/12/flex-mit-ruby-on-rails-authlogic-authenitifizieren/</link>
		<comments>http://blog.sketchit.de/2009/12/flex-mit-ruby-on-rails-authlogic-authenitifizieren/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 14:10:04 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[authlogic]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=181</guid>
		<description><![CDATA[Bei meinem aktuellen Rails Projekt loggen sich die Benutzer per authlogic auf der Seite ein, alles über Rails. Da jedoch ein Teil der Seite mit einer Flex App realisiert wird, musste ich das Zusammenspiel zwischen Rails und Flex ein wenig erforschen. Mein erster Blick fiel auf WebORB mit dem passenden Flex Plugin indem man sehr [...]]]></description>
			<content:encoded><![CDATA[<p>Bei meinem aktuellen Rails Projekt loggen sich die Benutzer per authlogic auf der Seite ein, alles über Rails. Da jedoch ein Teil der Seite mit einer Flex App realisiert wird, musste ich das Zusammenspiel zwischen Rails und Flex ein wenig erforschen.</p>
<p>Mein erster Blick fiel auf WebORB mit dem passenden Flex Plugin indem man sehr einfach die einzelnen Modells und somit die Datenbank ansprechen kann. (<a href="http://sujitreddyg.wordpress.com/2009/10/13/ruby-on-rails-extension-for-flash-builder-4/" target="_self">http://sujitreddyg.wordpress.com/2009/10/13/ruby-on-rails-extension-for-flash-builder-4/</a>)</p>
<p>Hier habe ich zwar Zugriff auf das UserSession-Modell von authlogic, jedoch nicht auf die aktuelle Session und somit die eingeloggten User. Die Cookies und Sessions werden erst im UserSessionsController festgelegt.</p>
<p>Um nun in der Flex Anwendung zu wissen "Ist der User eingeloggt" und wenn ja "Welcher User bist du denn?" erweitert man den UserSessions Controller um folgende Methode:</p>
<pre name="code" class="ruby">
def checkLogin
if logged_in?
xml = "
&lt;usersessions&gt;
&lt;login&gt;true&lt;/login&gt;
&lt;currentid&gt;#{current_user_session.user.id}&lt;/currentid&gt;
&lt;/usersessions&gt;"
else
xml = "
&lt;usersessions&gt;
&lt;login&gt;false&lt;/login&gt;
&lt;currentid&gt;false&lt;/currentid&gt;
&lt;/usersessions&gt;"
end
respond_to do |format|
format.xml { render : xml => xml }
end
end
</pre>
<p>Hiermit stellen wir eine Methode bereit die uns ein XML File rendert das sagt, bin ich eingeloggt, oder nicht (über das Format der XML ließe sich streiten).</p>
<p>In der Flex App kreiert man nun einen HTTP-Service, der auf die URL der Methode verweist, und bei erfolgreichem Result das ganze als XML ausgibt.</p>
<pre name="code" class="actionscript">
&lt;fx:Script&gt;
&lt;![CDATA[
import mx.rpc.events.ResultEvent;
public function switchStates(event:ResultEvent):void {
var xml:XML = event.result as XML;
var loggedInP:Boolean = xml.login as Boolean;
var currentID:int = xml.currentid;
trace(currentID);
}
]]&gt;
&lt;/fx:Script&gt;

&lt;fx:Declarations&gt;
&lt;s:HTTPService resultFormat="e4x" id="login" url="http://localhost:3000/user_sessions/checkLogin" result="switchStates(event)" fault="trace('fault');"/&gt;
&lt;/fx:Declarations&gt;
</pre>
<p>Natürlich muss im Application tag noch</p>
<pre name="code" class="actionscript">
creationComplete="login.send()
</pre>
<p>gesetzt werden. Und schon hat man zwei Variablen, die den User authentifizieren.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2009/12/flex-mit-ruby-on-rails-authlogic-authenitifizieren/feed/</wfw:commentRss>
		<slash:comments>130</slash:comments>
		</item>
		<item>
		<title>Visiual Programming with Structograms (VIPS)</title>
		<link>http://blog.sketchit.de/2009/11/visiual-programming-with-structograms/</link>
		<comments>http://blog.sketchit.de/2009/11/visiual-programming-with-structograms/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 17:01:02 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[Multimedia Technology]]></category>
		<category><![CDATA[Struktugramme]]></category>
		<category><![CDATA[VISP]]></category>
		<category><![CDATA[visual programming]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=147</guid>
		<description><![CDATA[Die visuelle Programmiersprache VIPS dient dazu Programmabläufe in Form von Struktugrammen zu erstellen (es werden alle Kontrollstrukturen von Java unterstützt) und diese dann laufen zu lassen. Das Programm ist Plattformunabhängig, da in Java geschrieben, entspricht der DIN 66261 und komplett erscheint komplett auf deutsch. 2005 hat VIPS den ersten Platz bei der JavaStars (Sun Microsystems [...]]]></description>
			<content:encoded><![CDATA[<p>Die visuelle Programmiersprache VIPS dient dazu Programmabläufe in Form von Struktugrammen zu erstellen (es werden alle Kontrollstrukturen von Java unterstützt) und diese dann laufen zu lassen. Das Programm ist Plattformunabhängig, da in Java geschrieben, entspricht der DIN 66261 und komplett erscheint komplett auf deutsch. 2005 hat VIPS den ersten Platz bei der <a href="http://www.javastars.de/" target="_blank">JavaStars (Sun Microsystems Award)</a> belegt. Das Programm wurde für die Darstellung von Programmabläufen in der Informatik konzipiert oder auch für den Unterricht um beispielsweise Intervallschachtelung oder Wurzelberechnung graphisch darzustellen. Da jedoch neben den bekannten Kontrollstrukturen wie Schleifen oder Verzweigungen auch "professionelle" Features zur Verfügung stehen ist es auch möglich ganze Programme zu schreiben. Die wichtigsten hierbei wären wohl:</p>
<ul>
<li>lokale und globale Variablen und Konstanten</li>
<li>Möglichkeit eigene Objekte zu erstellen</li>
<li>Rekursion</li>
<li>5 Datentypen (Wahrheitswert, Zeichen, Zeichenkette, Ganzzahl, Gleitkommazahl)</li>
<li>Listen (Arrays)</li>
<li>Debugging</li>
<li>Export des Struktugramms als Grafik</li>
<li>eine große Bibliothek für mathematische Funktionen, Stringverarbeitung, Listen-Handling, einfach Grafikobjekte (Turtle-Grafik) und Ein- und Ausgabe</li>
</ul>
<p style="text-align: left;">Um ein Programm mit VIPS zu erstellen, wählt man in der Navigationsleiste "Neues Projekt". Man kann innerhalb eines Projekts mehrere Struktugramme verwalten, die als Art Objekte dienen und von anderen Struktugrammen aufgerufen werden können. Auch kann jedes Struktugramm Paramter und Rückgabe Werte enthalten. Das Hauptprogramm ist immer als "main" betitelt. Um sein Programm nun zu strukturieren hat man neun verschiedene Möglichkeiten, die auch alle in Java als Schleifen, Verzweigungen oder ähnlichem enthalten sind:    <a href="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-4.52.51-PM.png"><br />
<img class="size-full wp-image-148 aligncenter" title="Screen shot 2009-11-09 at 4.52.51 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-4.52.51-PM.png" alt="Screen shot 2009-11-09 at 4.52.51 PM" width="691" height="53" /></a></p>
<p><span id="more-147"></span></p>
<p>Das Einfügen einer neuen Verzweigung läuft nach einem einfachen Klick-Prinzip ab: Zuerst wird das zu erstellende Element ausgewählt und danach an die Stelle geklickt, an der es eingefügt werden soll.</p>
<p style="text-align: center;"><a href="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-4.56.19-PM.png"><img class="size-full wp-image-149 aligncenter" title="Screen shot 2009-11-09 at 4.56.19 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-4.56.19-PM.png" alt="Screen shot 2009-11-09 at 4.56.19 PM" width="464" height="615" /></a></p>
<p style="text-align: center;"><a href="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-4.56.30-PM.png"><img class="size-full wp-image-150 aligncenter" title="Screen shot 2009-11-09 at 4.56.30 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-4.56.30-PM.png" alt="Screen shot 2009-11-09 at 4.56.30 PM" width="487" height="632" /></a></p>
<p>Das Ganze ist relativ logisch aufgebaut, könnte jedoch aufgrund der mangelnden farblichen Gestaltung schnell unübersichtlich werden. Um nun zum Beispiel vom Benutzer Eingaben entgegen zu nehmen, fügt man einen Aufruf ein, und wählt nach dem Doppelklick auf den leeren Aufruf (der mit unbekannt betitelt ist) die Funktion "Input" aus, die wiederrum zwei Paramter erhält: MSG und INITTEXT (MSG = Die Meldung an den Benutzer; INITTEXT = Default-Text der im Eingabefeld angezeigt werden soll). Als Rückgabe Wert wird eine Variable vom Typ Zeichenkette benötigt:</p>
<p style="text-align: center;"><a href="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.57.32-PM.png"><img class="size-full wp-image-165 aligncenter" title="Screen shot 2009-11-09 at 5.57.32 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.57.32-PM.png" alt="Screen shot 2009-11-09 at 5.57.32 PM" width="336" height="328" /></a></p>
<p>Im Struktugramm erscheint der Aufruf der Input Funktion folgendermaßen:</p>
<p style="text-align: center;"><a href="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.57.00-PM.png"><img class="size-full wp-image-164 aligncenter" title="Screen shot 2009-11-09 at 5.57.00 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.57.00-PM.png" alt="Screen shot 2009-11-09 at 5.57.00 PM" width="571" height="26" /></a></p>
<p>Um jetzt auch andere Objekte aus der Bibliothek nutzen zu können, wird wieder das Objekt "Aufruf" verwendet. Dieses führt Funktionen aus der Bibliothek aus, übergibt ihnen Parameter oder liefert deren Wert zurück. Die Struktur dabei ist relativ simple: Die Funktion "SL_Set" zum Beispiel setzt einen bestimmten Wert an einen gegebenen Index in einer Liste. Jedoch muss man keine Klammern oder ähnliches schreiben, dies passiert in einem Eingabefenster:</p>
<p style="text-align: center;"><a href="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.18.57-PM.png"><img class="size-full wp-image-157 aligncenter" title="Screen shot 2009-11-09 at 5.18.57 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.18.57-PM.png" alt="Screen shot 2009-11-09 at 5.18.57 PM" width="336" height="328" /></a></p>
<ul>
<li>Operation: Hier erhält man eine Liste mit verfügbaren Funktionen</li>
<li>Rückgabevariable: Falls die Funktion einen Wert zurückliefert, wird die Variable in der dieser Wert gespeichert werden soll hier eingetragen (praktisch das, was links vorm = Zeichen steht)</li>
<li>Argumente: Eine Liste von Argumenten, die die Funktion erhält</li>
</ul>
<p>Wie oben schon zu sehen ist, bekommt eine unbekannte oder falsch aufgerufene Funktion sofort nach dem Erstellen oder Ändern ein kleines rotes Kreuz verpasst. Beim darüber fahren mit dem Mauszeiger wird unten in der Statusleiste ein recht verständlicher Error ausgegeben (natürlich in deutsch) der auch anfänglich ungemeint bei der Fehlersuche oder beim Verständnis des ganzen Programms hilft.</p>
<p>Beim Testen der Anwendung bin ich darauf gekommen, dass man mit komplexeren Kontrollstrukturen jedoch schnell an seine Grenzen stößt. So ist es zum Beispiel nicht möglich mit der gewohnten [ ]-Syntax auf ein Element einer Liste zuzgreifen. Hier muss der Wert zuerst per SL_Get in einer Temp-Variable zwischengespeichert werden, um anschließend verwendet werden zu können. Ebenfalls sind keine Mehrfachabfragen möglich, wenn man zum Beispiel in einer If-Anweisungen zwei Bedingungen prüfen will (oder auch in einer while-Schleife). Auch ist die Verwendung der einzelnen Funktionen umständlicher als in anderen (nicht-visuellen) Programmiersprachen.</p>
<p>Im Paket mit enthalten sind einige Demoprogramme, die z.B. verschiedene Sortieralgorithmen oder ein Überprüfungen für Primzahlen implementieren:</p>
<p>BubbleSort:</p>
<p style="text-align: center;"><a href="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.41.53-PM.png"><img class="size-full wp-image-160 aligncenter" title="Screen shot 2009-11-09 at 5.41.53 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.41.53-PM.png" alt="Screen shot 2009-11-09 at 5.41.53 PM" width="579" height="384" /></a></p>
<p>Primzahl Überprüfung:</p>
<p style="text-align: center;"><a href="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.42.23-PM.png"><img class="size-full wp-image-161 aligncenter" title="Screen shot 2009-11-09 at 5.42.23 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.42.23-PM.png" alt="Screen shot 2009-11-09 at 5.42.23 PM" width="317" height="302" /></a></p>
<p>Nachdem ich mir die Struktur ein wenig angeschaut habe, habe ich den InsertionSort implementiert:</p>
<p style="text-align: center;"><a href="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.44.39-PM.png"><img class="size-full wp-image-162 aligncenter" title="Screen shot 2009-11-09 at 5.44.39 PM" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-09-at-5.44.39-PM.png" alt="Screen shot 2009-11-09 at 5.44.39 PM" width="452" height="551" /></a></p>
<p>Dieses Objekt wird vom Hauptprogramm aufgerufen in dem eine Liste von Zahlen generiert wird und dem InsertionSort Objekt übergeben wird. Mehr zur Verfahrensweise von InsertionSort hier: http://de.wikipedia.org/wiki/Insertionsort</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2009/11/visiual-programming-with-structograms/feed/</wfw:commentRss>
		<slash:comments>592</slash:comments>
		</item>
		<item>
		<title>Gravata für Ruby on Rails</title>
		<link>http://blog.sketchit.de/2009/11/gravata-fur-ruby-on-rails/</link>
		<comments>http://blog.sketchit.de/2009/11/gravata-fur-ruby-on-rails/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 15:32:23 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[Multimedia Technology]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Gravatar]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=134</guid>
		<description><![CDATA[Hier gefunden: http://overhrd.com/?p=28 Um Gravatar für Ruby on Rails zu verwenden, ist lediglich eine kleine Methode im Application Helper nötig und deren Aufruf in der View. application_helper.rb require 'digest/md5' def gravatar_url_for(email, options = {}) url_for({ :gravatar_id =&#62; Digest::MD5.hexdigest(email), :host =&#62; 'www.gravatar.com', :protocol =&#62; 'http://', nly_path =&#62; false, :controller =&#62; 'avatar.php'}.merge(options)) end View (z. B. index.html.erb) [...]]]></description>
			<content:encoded><![CDATA[<p>Hier gefunden: <a href="http://overhrd.com/?p=28" target="_blank">http://overhrd.com/?p=28</a></p>
<p>Um Gravatar für Ruby on Rails zu verwenden, ist lediglich eine kleine Methode im Application Helper nötig und deren Aufruf in der View.</p>
<p>application_helper.rb</p>
<pre name="code" class="ruby">require 'digest/md5'

  def gravatar_url_for(email, options = {})
    url_for({ :gravatar_id =&gt; Digest::MD5.hexdigest(email),
      :host =&gt; 'www.gravatar.com',
      :protocol =&gt; 'http://',
      <img src='http://blog.sketchit.de/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> nly_path =&gt; false,
      :controller =&gt; 'avatar.php'}.merge(options))
  end</pre>
<p>View (z. B. index.html.erb)</p>
<pre name="code" class="ruby"># plain old gravatar url

&lt;%= gravatar_url_for 'info@sketchit.de' %&gt;

# gravatar url with a rating threshold

&lt;%= gravatar_url_for 'info@sketchit.de', { :rating =&gt; 'R' } %&gt;

# show the avatar

&lt;%= image_tag(gravatar_url_for 'info@sketchit.de') %&gt;

# show the avatar with size specified, in case it's served slowly

&lt;%= image_tag(gravatar_url_for('info@sketchit.de'), { :width =&gt; 80, :height =&gt; 80 }) %&gt;

# link the avatar to some/url

&lt;%= link_to(image_tag(gravatar_url_for 'info@sketchit.de'), 'some/url')%&gt;</pre>
<p>Die oben definierte Methode nimmt die übergebene E-Mail Adresse, wandelt es in einen MD5 Hash um, baut daraus die URL von Gravatar zusammen (http://www.gravatar.com/avatar.php?gravatar_id=HASH_WERT) und liefert den Avatar zurück.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2009/11/gravata-fur-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Rock-Paper-Scissor: erstes iPhone Game</title>
		<link>http://blog.sketchit.de/2009/11/rock-paper-scissor-erstes-iphone-game/</link>
		<comments>http://blog.sketchit.de/2009/11/rock-paper-scissor-erstes-iphone-game/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 07:30:59 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Multimedia Technology]]></category>
		<category><![CDATA[Mobile Applications]]></category>
		<category><![CDATA[Objectiv-C]]></category>
		<category><![CDATA[Rock-Scissor-Paper]]></category>
		<category><![CDATA[Schere-Stein-Papier]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=124</guid>
		<description><![CDATA[Für unser Fach Mobile Applications hab ich gestern unser erstes kleines Projekt fertig gestellt, dass klassische "Schere-Stein-Papier", oder wie die Amys sagen würden "Rock-Paper-Scissor" (warum sind die Begriffe eigentlich verdreht? Die Syntax von Objectiv-C ist bisschen gewöhnungsbedürftig, aber im großen und ganzen schon zu handeln. Hier mal ein paar Screenshots: Und hier noch das gezippte [...]]]></description>
			<content:encoded><![CDATA[<p>Für unser Fach Mobile Applications hab ich gestern unser erstes kleines Projekt fertig gestellt, dass klassische "Schere-Stein-Papier", oder wie die Amys sagen würden "Rock-Paper-Scissor" (warum sind die Begriffe eigentlich verdreht? <img src='http://blog.sketchit.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
Die Syntax von Objectiv-C ist bisschen gewöhnungsbedürftig, aber im großen und ganzen schon zu handeln.<br />
Hier mal ein paar Screenshots:</p>

<a href='http://blog.sketchit.de/2009/11/rock-paper-scissor-erstes-iphone-game/screen-shot-2009-11-03-at-8-26-39-am/' title='iPhone Rock-Scissor-Paper 1'><img width="150" height="150" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-03-at-8.26.39-AM-150x150.png" class="attachment-thumbnail" alt="iPhone Rock-Scissor-Paper 1" title="iPhone Rock-Scissor-Paper 1" /></a>
<a href='http://blog.sketchit.de/2009/11/rock-paper-scissor-erstes-iphone-game/screen-shot-2009-11-03-at-8-26-48-am/' title='iPhone Rock-Scissor-Paper 2'><img width="150" height="150" src="http://blog.sketchit.de/wp-content/uploads/2009/11/Screen-shot-2009-11-03-at-8.26.48-AM-150x150.png" class="attachment-thumbnail" alt="iPhone Rock-Scissor-Paper 2" title="iPhone Rock-Scissor-Paper 2" /></a>

<p>Und hier noch das gezippte XCode Project:</p>
<p><a href="http://blog.sketchit.de/wp-content/uploads/2009/11/SchereSteinPapier.zip">SchereSteinPapier iPhone XCode Project</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2009/11/rock-paper-scissor-erstes-iphone-game/feed/</wfw:commentRss>
		<slash:comments>129</slash:comments>
		</item>
		<item>
		<title>QuadTrees Implementierung für AS3, v0.1</title>
		<link>http://blog.sketchit.de/2009/10/quadtrees-implementierung-fur-as3-v0-1/</link>
		<comments>http://blog.sketchit.de/2009/10/quadtrees-implementierung-fur-as3-v0-1/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 11:43:01 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[AS3 & Flash]]></category>
		<category><![CDATA[Multimedia Technology]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Collision Detection]]></category>
		<category><![CDATA[Datenstruktur]]></category>
		<category><![CDATA[Nearest Neighbour]]></category>
		<category><![CDATA[QuadTree]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=116</guid>
		<description><![CDATA[Die erste Version der QuadTrees für AS3 läuft soweit. Objekte werden schon mal eingefügt, und der Tree selbst graphisch dargestellt. Beim Klick auf ein Quad werden alle zugehörigen Objekte markiert. Grundlage für die nächste Version, Nearest Neighbour und Collision Detection. QuadTrees v0.1]]></description>
			<content:encoded><![CDATA[<p>Die erste Version der QuadTrees für AS3 läuft soweit. Objekte werden schon mal eingefügt, und der Tree selbst graphisch dargestellt. Beim Klick auf ein Quad werden alle zugehörigen Objekte markiert.<br />
Grundlage für die nächste Version, Nearest Neighbour und Collision Detection.</p>
<p><a href="http://blog.sketchit.de/wp-content/uploads/2009/10/QuadTrees.swf">QuadTrees v0.1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2009/10/quadtrees-implementierung-fur-as3-v0-1/feed/</wfw:commentRss>
		<slash:comments>78</slash:comments>
		</item>
		<item>
		<title>Kleiner Chat in C (Socketprogrammierung mit UDP)</title>
		<link>http://blog.sketchit.de/2009/10/kleiner-chat-in-c-socketprogrammierung-mit-udp/</link>
		<comments>http://blog.sketchit.de/2009/10/kleiner-chat-in-c-socketprogrammierung-mit-udp/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 14:34:48 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[C / C++]]></category>
		<category><![CDATA[Multimedia Technology]]></category>
		<category><![CDATA[Netzwerk]]></category>
		<category><![CDATA[Socket]]></category>
		<category><![CDATA[Socketprogrammierung]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=111</guid>
		<description><![CDATA[Hier mal ein kleines Beispiel, wie man per select() und dem UDP Protokoll sehr einfach einen Chat unter C erstellen kann. Das Programm schaut zuerst, ob auf dem Port 5000 schon jemand lauscht, wenn nicht, wird der 5000er zum senden und der 5001 zum empfangen verwendet. Ist schon ein Chat aktiv, werden die Ports einfach [...]]]></description>
			<content:encoded><![CDATA[<p>Hier mal ein kleines Beispiel, wie man per select() und dem UDP Protokoll sehr einfach einen Chat unter C erstellen kann.<br />
Das Programm schaut zuerst, ob auf dem Port 5000 schon jemand lauscht, wenn nicht, wird der 5000er zum senden und der 5001 zum empfangen verwendet. Ist schon ein Chat aktiv, werden die Ports einfach umgedreht.</p>
<p>Der Rest ist normalerweise selbstklärend. Den Chat einfach im Terminal (unter OS X) starten, dann noch ein Terminal Fenster auf machen, auch hier den Chat starten, und schon funktionierts!<br />
Hint:<br />
- kompilieren per "g++ -o test main.c"<br />
- aufruf per "./chat"<br />
- (natürlich ohne die " " )</p>
<pre class="c++">
#include &lt;sys/types.h&gt;
#include &lt;sys/socket.h&gt;
#include &lt;netinet/in.h&gt;
#include &lt;arpa/inet.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;unistd.h&gt;
#include &lt;errno.h&gt;
#include &lt;string.h&gt;
#include &lt;netdb.h&gt;

#include &lt;sys/unistd.h&gt;
#include &lt;sys/fcntl.h&gt;

#include &lt;iostream&gt;

using namespace std;

void reportError(string str) {
	cout &lt;&lt; endl &lt;&lt; str &lt;&lt; errno &lt;&lt; endl;
}

int main(int argc, char* argv[])
{
	// set the variables
	int sock, bytes_recieved, bytes_send;
	int port1 = atoi("5000");
	int port2 = atoi("5001");
	char send_data [1024] , recv_data[1024];       

	struct sockaddr_in myAddr;
	struct sockaddr_in clientAddr;
	socklen_t sin_size;

	fd_set rfds;

	// create the tcp socket
	if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
		reportError("Cannot create send socket ....");
		exit(1);
	}

	myAddr.sin_family = AF_INET;
	myAddr.sin_port = htons(port1);
	myAddr.sin_addr.s_addr = inet_addr("127.0.0.1");

	if (bind(sock, (struct sockaddr *)&amp;myAddr, sizeof(struct sockaddr))== -1) {
		myAddr.sin_family = AF_INET;
		myAddr.sin_port = htons(port2);
		myAddr.sin_addr.s_addr = inet_addr("127.0.0.1");

		clientAddr.sin_family = AF_INET;
		clientAddr.sin_port = htons(port1);
		clientAddr.sin_addr.s_addr = inet_addr("127.0.0.1");

		if(bind(sock, (struct sockaddr *)&amp;myAddr, sizeof(struct sockaddr))== -1) {
			reportError("Unable to bind socket.");
			exit(1);
		}
	}
	else
	{
		clientAddr.sin_family = AF_INET;
		clientAddr.sin_port = htons(port2);
		clientAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
	}

	cout &lt;&lt; "Wait for data, or type something!" &lt;&lt; endl;

	// process incoming connections (forever) ....
	while(1){
		sin_size = sizeof(struct sockaddr_in);

		FD_ZERO(&amp;rfds);
		FD_SET(sock, &amp;rfds);
		FD_SET(0, &amp;rfds);

		select(sock + 1, &amp;rfds, NULL, NULL, NULL);

		if(FD_ISSET(sock, &amp;rfds))
		{
			// receive the reply from the client
			bytes_recieved = recvfrom(sock, recv_data, 1024,0, (struct sockaddr*)&amp;myAddr, &amp;sin_size);

			// client wants the leave, so do we
			if (strcmp(recv_data , "q") == 0 || strcmp(recv_data , "Q") == 0) {
				close(sock);
				break;
			}
			else if(bytes_recieved == -1)
			{
				reportError("recvfrom failed.");
				exit(1);
			} else {
				recv_data[bytes_recieved] = '\0';
				cout &lt;&lt; "&lt;Received&gt; " &lt;&lt; recv_data &lt;&lt; endl;
			}
		}
		else if(FD_ISSET(0, &amp;rfds))
		{
			gets(send_data);

			if (strcmp(send_data , "q") != 0 &amp;&amp; strcmp(send_data , "Q") != 0) {
				bytes_send = sendto(sock, send_data, 1024, 0, (struct sockaddr*)&amp;clientAddr, sizeof(struct sockaddr));

				if(bytes_send == -1)
				{
					reportError("Error sending data.");
					exit(1);
				}
			}
			else
			{
				close(sock);
				break;
			}
		}
	}

	close(sock);

	return 0;
}</pre>
<p>Hoffe jemanden bringts was!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2009/10/kleiner-chat-in-c-socketprogrammierung-mit-udp/feed/</wfw:commentRss>
		<slash:comments>625</slash:comments>
		</item>
		<item>
		<title>AppleScript: MP3&#8242;s automatisch einsortieren</title>
		<link>http://blog.sketchit.de/2009/10/applescript-mp3s-automatisch-einsortieren/</link>
		<comments>http://blog.sketchit.de/2009/10/applescript-mp3s-automatisch-einsortieren/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 15:42:02 +0000</pubDate>
		<dc:creator>Hubert Hölzl</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[AS]]></category>
		<category><![CDATA[automatisch]]></category>
		<category><![CDATA[MP3]]></category>
		<category><![CDATA[sortieren]]></category>

		<guid isPermaLink="false">http://blog.sketchit.de/?p=92</guid>
		<description><![CDATA[Ich habe nun endlich den Anfang gemacht meine doch schon recht große Sammlung an MP3's zu sortieren (schwierig und langwieriges Unterfangen, fehlende ID3 Tags, keine Alben oder ähnliches...). Bei der Suche nach einem passenden Programm bin ich schnell darauf gekommen, dass zumindest die von mir gewünschte Grundstruktur kein einziges Programm zufriedenstellend bewerkstelligen kann (Interpret - [...]]]></description>
			<content:encoded><![CDATA[<p>Ich habe nun endlich den Anfang gemacht meine doch schon recht große Sammlung an MP3's zu sortieren (schwierig und langwieriges Unterfangen, fehlende ID3 Tags, keine Alben oder ähnliches...).</p>
<p>Bei der Suche nach einem passenden Programm bin ich schnell darauf gekommen, dass zumindest die von mir gewünschte Grundstruktur kein einziges Programm zufriedenstellend bewerkstelligen kann (Interpret - Interpret/Album - Titel). Darum hab ich mich entschlossen, das Ganze im Finder per Hand zu sortieren. Und da sind wir auch schon bei der Problematik:</p>
<p>Um zumindest einmal grob zu sortieren, wollte ich automatisch alle MP3's eines Interpreters in dessen Ordner schieben. Die Ordner von Hand anzulegen, sehr langwierig. Darum hab ich mich hingesetzt und ein kleines aber feines AppleScript geschrieben.</p>
<p>Das Skript nimmt die gerade im Finder selektierten Dateien, prüft ob ein "-" (Bindestrich) als Trennung zwischen Interpret und Titel vorhanden ist (wenn nicht, kann man einen eigenen definieren) und filtert darauf hin den Interpreten Namen heraus, der wiederrum als Ordnername dient.</p>
<pre name="code" class="php">
tell application "Finder"

set fileList to selection
set currentDir to the folder of item 1 of fileList as text
set targetDirTMP to the name of item 1 of fileList

set endCount to offset of "-" in targetDirTMP

if endCount = 0 then
display dialog "No delemiter found, specify a custom one, or click Cancel." default answer "" with icon 2
set delimiter to text returned of result
if delimiter is "" then error
set endCount to offset of delimiter in targetDirTMP
end if

set checkSpace to characters (endCount - 1) thru (endCount - 1) of targetDirTMP

if " " is in checkSpace then
set removeRight to 2
else
set removeRight to 1
end if

set targetDir to (text items 1 thru (endCount - removeRight) of targetDirTMP) as text

if not (exists folder (currentDir &amp; targetDir)) then
make new folder at currentDir with properties {name:targetDir}
move fileList to (currentDir &amp; targetDir)
else
display dialog "The folder already exists. Would you like to merge the data?" buttons {"Cancel", "Yes"}
if button returned of result = "Yes" then
move fileList to (currentDir &amp; targetDir)
end if
end if

end tell
</pre>
<p>Zur Installation einfach Code in den AppleScript Editor ziehen, eine APP daraus speichern, und per Drag&amp;Drop in die obere Leiste des Finders ziehen.</p>
<p>Oder ihr ladet euch meine <a href="http://blog.sketchit.de/wp-content/uploads/2009/10/MP3Move.app.zip">hier</a> runter</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sketchit.de/2009/10/applescript-mp3s-automatisch-einsortieren/feed/</wfw:commentRss>
		<slash:comments>276</slash:comments>
		</item>
	</channel>
</rss>

