<?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.joa-ebert.com - Blog of Joa Ebert &#187; c++ and others</title>
	<atom:link href="http://blog.joa-ebert.com/category/c-and-others/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.joa-ebert.com</link>
	<description>Actionscript3, Flash, Scala, Java, C#, C++, Algorithms &#38; Imageprocessing</description>
	<lastBuildDate>Fri, 11 Nov 2011 11:13:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Go channels with Scala</title>
		<link>http://blog.joa-ebert.com/2011/06/01/go-channels-with-scala/</link>
		<comments>http://blog.joa-ebert.com/2011/06/01/go-channels-with-scala/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 11:21:10 +0000</pubDate>
		<dc:creator>joa</dc:creator>
				<category><![CDATA[c++ and others]]></category>
		<category><![CDATA[channel]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[multithreading]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://blog.joa-ebert.com/?p=786</guid>
		<description><![CDATA[Since I had to spend 10h in a train this weekend I was looking at some food for thought. For a long time I had a couple of slides about the Go language on my machine and so I started reading. Go comes with a different concepts for synchronization. Channels are a construct baked into [...]]]></description>
			<content:encoded><![CDATA[<p>Since I had to spend 10h in a train this weekend I was looking at some food for thought. For a long time I had a couple of slides about the <a href="http://golang.org/" target="_blank" rel="nofollow">Go language</a> on my machine and so I started reading.</p>
<p>Go comes with a different concepts for synchronization. Channels are a construct baked into the language. They allow you to communicate between different go-routines etc. Basically I stopped reading after I came across the Channels section.</p>
<p>A channel allows you to send and receive data from it. Much like a Scala actor. By default a channel is performing blocking send and receive operations. Sounds pretty much like a blocking queue to me. The syntax is something like the following.</p>
<pre class="brush: plain; title: ; notranslate">
// Create a channel of int
var channel = make(chan int) 

func send() {
  // Send 1 to the channel.
  // This operation blocks ...
  channel &lt;- 1
}

func receive() {
  // Receive from channel
  // This operation also blocks!
  message := &lt;- channel
  fmt.Println(message) //1
}

go send()
go receive()
</pre>
<p>So ultimately I thought it should be quite easy to achieve something similar using Scala. I think this is an excellent example of the <em>scalable</em> part when it comes to Scala.<br />
Go channels are diveded into reciver and sender channels, with a bidirectional channel type. The same can be achieved using Scala traits very easily. I could also add a couple of nice syntactic sugar like adding a foreach method to a channel which allows you to use it with Scala for comprehensions.</p>
<p>Have a look at this <a href="https://gist.github.com/1002125" target="_blank" rel="nofollow">Gist</a> for the complete source code. First of all one part is a little bit unfortunate. You are not able to define <code>&lt;-</code> or <code>&lt;~</code> as a unary operator in Scala. So I thought I stick with the <code>!</code> operator which you already know from actors and it is the analog to Go&#8217;s <code>&lt;-</code>.</p>
<p>At the end of the file you will find a re-implementation of the Go <a href="https://sites.google.com/site/gopatterns/concurrency/producer-consumer" target="_blank">Producer-Consumer example</a>.</p>
<p>Something really cool is the fact that you can use Scala&#8217;s for-comprehensions which automatically exit once a channel is being closed. I think Go allows you do the same by specifying <code>range</code> when iterating over a channel. However I am not sure since I only had a brief look.</p>
<p>So is this useful? I do not know since I would probably stick with Scala actors for most of my multi-threading needs but it is still a great example of Scala&#8217;s flexibility as a language.</p>
<div class="none"><div class="g-plusone" data-href="http://blog.joa-ebert.com/2011/06/01/go-channels-with-scala/" size="standard" count="true"></div></div> <p><a href="http://blog.joa-ebert.com/?flattrss_redirect&amp;id=786&amp;md5=069de6d1fee689c0758db9ae3c40f94b" title="Flattr" target="_blank"><img src="http://blog.joa-ebert.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.joa-ebert.com/2011/06/01/go-channels-with-scala/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<atom:link rel="payment" href="http://blog.joa-ebert.com/?flattrss_redirect&amp;id=786&amp;md5=069de6d1fee689c0758db9ae3c40f94b" type="text/html" />
	</item>
		<item>
		<title>AS3C &#8212; take a look inside</title>
		<link>http://blog.joa-ebert.com/2008/08/11/as3c-take-a-look-inside/</link>
		<comments>http://blog.joa-ebert.com/2008/08/11/as3c-take-a-look-inside/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 09:09:35 +0000</pubDate>
		<dc:creator>joa</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[c++ and others]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[as3c]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://blog.joa-ebert.com/?p=209</guid>
		<description><![CDATA[I have started working on AS3C at the end of last year. After a quick prototype the development stagnated and I added just several fixes and tests to the code. Basically I started AS3C as a complete C# newcommer and because of that the code is very ugly. Due to the fact that I do [...]]]></description>
			<content:encoded><![CDATA[<p>I have started working on <a href="http://as3c.googlecode.com/" target="_blank">AS3C</a> at the end of last year. After a quick prototype the development stagnated and I added just several fixes and tests to the code. Basically I started AS3C as a complete C# newcommer and because of that the code is very ugly.</p>
<p>Due to the fact that I do not have much free time to continue developing AS3C I think it is the right time to release the source-code on the one hand and to let people experiment with it on the other hand.</p>
<p>You can either download the sources and build AS3C manually (you will need <a href="http://www.componentace.com/zlib_.NET.htm" target="_blank">zlib.net</a>) or download a binary from <code>trunk/bin/</code>.</p>
<p>When using AS3C you will need the ActionScript from the SVN. Remember that you write real ActionScript code which gets translated by AS3C. There is also one undocumented and very experimental feature existing. If you run <code>as3c.exe -optimize main.swf</code> you could get some speed improvements if you have heavy loops using the Math class. But it could also destroy the SWF so do not forget to make a backup :o)</p>
<ul>
<li><a href="http://as3c.googlecode.com/" target="_blank">AS3C on GoogleCode</a></li>
</ul>
<div class="none"><div class="g-plusone" data-href="http://blog.joa-ebert.com/2008/08/11/as3c-take-a-look-inside/" size="standard" count="true"></div></div> <p><a href="http://blog.joa-ebert.com/?flattrss_redirect&amp;id=209&amp;md5=4076e62b3121449f1ab304680979310a" title="Flattr" target="_blank"><img src="http://blog.joa-ebert.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.joa-ebert.com/2008/08/11/as3c-take-a-look-inside/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<atom:link rel="payment" href="http://blog.joa-ebert.com/?flattrss_redirect&amp;id=209&amp;md5=4076e62b3121449f1ab304680979310a" type="text/html" />
	</item>
		<item>
		<title>FlashHunter Deluxe</title>
		<link>http://blog.joa-ebert.com/2008/06/17/flashhunter-deluxe/</link>
		<comments>http://blog.joa-ebert.com/2008/06/17/flashhunter-deluxe/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 13:46:42 +0000</pubDate>
		<dc:creator>joa</dc:creator>
				<category><![CDATA[c++ and others]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[flashhunter]]></category>
		<category><![CDATA[michael baczynski]]></category>

		<guid isPermaLink="false">http://blog.je2050.de/?p=191</guid>
		<description><![CDATA[FlashHunter has been used by actually one person: Michael Baczynski. He asked me at the FFK08 in Germany if I could modify the plugin to give him a global keyboard hook which will kill all instances of the Flash Player including the debugger. So here it is: The FlashHunter Deluxe. Just for you Michael :) [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.je2050.de/2008/03/07/flashhunter/" target="_blank">FlashHunter</a> has been used by actually one person: <a href="http://lab.polygonal.de/" target="_blank">Michael Baczynski</a>. He asked me at the <a href="http://ffk08.flashforum.de/" target="_blank">FFK08</a> in Germany if I could modify the plugin to give him a global keyboard hook which will kill all instances of the Flash Player including the debugger.</p>
<p>So here it is: The FlashHunter <i>Deluxe</i>. Just for you Michael :)</p>
<ul>
<li><a href="http://je2050.de/flash.hunter.deluxe.zip" target="_blank">Download</a></li>
</ul>
<div class="none"><div class="g-plusone" data-href="http://blog.joa-ebert.com/2008/06/17/flashhunter-deluxe/" size="standard" count="true"></div></div> <p><a href="http://blog.joa-ebert.com/?flattrss_redirect&amp;id=191&amp;md5=5a897d87f7beb2e7cdc852bec735d10d" title="Flattr" target="_blank"><img src="http://blog.joa-ebert.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.joa-ebert.com/2008/06/17/flashhunter-deluxe/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" href="http://blog.joa-ebert.com/?flattrss_redirect&amp;id=191&amp;md5=5a897d87f7beb2e7cdc852bec735d10d" type="text/html" />
	</item>
		<item>
		<title>FlashHunter</title>
		<link>http://blog.joa-ebert.com/2008/03/07/flashhunter/</link>
		<comments>http://blog.joa-ebert.com/2008/03/07/flashhunter/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 12:31:09 +0000</pubDate>
		<dc:creator>joa</dc:creator>
				<category><![CDATA[c++ and others]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[flashhunter]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jni]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://blog.je2050.de/2008/03/07/flashhunter/</guid>
		<description><![CDATA[FlashHunter is a neat Eclipse plug-in I wrote that allows you to kill all running Flash player instances with a single click. Two days ago I was implementing the fast Fourier transformation in Flash and I had a stupid error that caused an endless loop. Since I am testing with the standalone player the only [...]]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://je2050.de/FlashHunter.zip"><img src="http://blog.je2050.de/wp-content/images/hunterSnapshot.png" alt="FlashHunter" border="0" width="480" height="81"/></a></div>
<p>FlashHunter is a neat Eclipse plug-in I wrote that allows you to kill all running Flash player instances with a single click. Two days ago I was implementing the fast Fourier transformation in Flash and I had a stupid error that caused an endless loop. Since I am testing with the standalone player the only way to get rid of it was Ctrl+Alt+Del and killing it. This is not really a nice workflow so I wrote the plug-in.</p>
<p>I am not a Java developer and definitly not an Eclpise platform developer so the plugin itself is very basic. I experimented a little bit with JNI and wrote most of the plugin in C++ because it still is my language of choice.</p>
<p>The plugin is Windows only. I think you could also do something like that as an external tool for OS X (&#8220;killall Flash\ Player&#8221;).</p>
<ul>
<li><a href="http://je2050.de/FlashHunter.zip">Download FlashHunter</a></li>
</ul>
<div class="none"><div class="g-plusone" data-href="http://blog.joa-ebert.com/2008/03/07/flashhunter/" size="standard" count="true"></div></div> <p><a href="http://blog.joa-ebert.com/?flattrss_redirect&amp;id=169&amp;md5=c31e53a565f560c0ae890be852aa7c4c" title="Flattr" target="_blank"><img src="http://blog.joa-ebert.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.joa-ebert.com/2008/03/07/flashhunter/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		<atom:link rel="payment" href="http://blog.joa-ebert.com/?flattrss_redirect&amp;id=169&amp;md5=c31e53a565f560c0ae890be852aa7c4c" type="text/html" />
	</item>
		<item>
		<title>FlashMate</title>
		<link>http://blog.joa-ebert.com/2007/10/15/flashmate/</link>
		<comments>http://blog.joa-ebert.com/2007/10/15/flashmate/#comments</comments>
		<pubDate>Mon, 15 Oct 2007 17:28:20 +0000</pubDate>
		<dc:creator>joa</dc:creator>
				<category><![CDATA[c++ and others]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[flashmate]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://blog.je2050.de/2007/10/15/flashmate/</guid>
		<description><![CDATA[&#8230;or my WinApi weekend. Someone at the office asked why the Flash player does not remember size and position. My answer was FDT would do it for you. But since we are not using it (arrg!) I asked the C++ gurus here what keywords I have to google for to do it on my own. [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;or my WinApi weekend. Someone at the office asked why the Flash player does not remember size and position. My answer was FDT would do it for you. But since we are not using it (arrg!) I asked the C++ gurus here what keywords I have to google for to do it on my own.</p>
<p>The result is <a href="http://je2050.de/FlashMate.zip">FlashMate</a>. Just download, unzip and start it. It will be completly silent (perfect for startup) and while FlashMate is running your player will remember size and position for SWF files individually. You can also disable FlashMate for certain files. Just right click on the titlebar and uncheck it.</p>
<p>Hope this nifty little thing will make your daily life a little bit easier. Ugly source code is included &#8212; I am not a good C/C++ coder at all but digging a little bit in the WinApi was fun. Now back to managed memory :)</p>
<p>Improvements and bug reports are more than welcome.</p>
<div class="none"><div class="g-plusone" data-href="http://blog.joa-ebert.com/2007/10/15/flashmate/" size="standard" count="true"></div></div> <p><a href="http://blog.joa-ebert.com/?flattrss_redirect&amp;id=151&amp;md5=cc7bf4e39c280e536a490a3ae259850d" title="Flattr" target="_blank"><img src="http://blog.joa-ebert.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.joa-ebert.com/2007/10/15/flashmate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<atom:link rel="payment" href="http://blog.joa-ebert.com/?flattrss_redirect&amp;id=151&amp;md5=cc7bf4e39c280e536a490a3ae259850d" type="text/html" />
	</item>
	</channel>
</rss>

