<?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>WS-Blog</title>
	<atom:link href="http://www.websector.de/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.websector.de/blog</link>
	<description>// Flex - AIR - Flash - JavaScript</description>
	<lastBuildDate>Wed, 18 Jan 2012 12:17:16 +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>Fun with AngularJS + Rails + CoffeeScript + Sass: Another Cafe Townsend example</title>
		<link>http://www.websector.de/blog/2012/01/17/fun-with-angularjs-rails-coffeescript-sass-another-cafe-townsend-example/</link>
		<comments>http://www.websector.de/blog/2012/01/17/fun-with-angularjs-rails-coffeescript-sass-another-cafe-townsend-example/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 13:57:05 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/?p=755</guid>
		<description><![CDATA[Here is an another demo of a Cafe Townsend app using AngularJS and Rails. All JavaScript code is written in CoffeeScript, the CSS code using Sass. That&#8217;s just fun-fun-fun! Screen shots Live demo Run the demo at http://cafetownsend-angular-rails.herokuapp.com using a modern browser. Source code All source code is available at GitHub. Random notes Here are [...]]]></description>
			<content:encoded><![CDATA[<p>Here is an another demo of a Cafe Townsend app using <a href="http://angularjs.org">AngularJS</a> and <a href="http://rubyonrails.org/">Rails</a>. All JavaScript code is written in <a href="http://coffeescript.org/">CoffeeScript</a>, the CSS code using <a href="http://sass-lang.com/">Sass</a>. That&#8217;s just fun-fun-fun!</p>
<p><span id="more-755"></span></p>
<h2>Screen shots</h2>
<p><a href="http://cafetownsend-angular-rails.herokuapp.com" class="img"><img src="https://github.com/sectore/CafeTownsend-Angular-Rails/raw/master/wiki/cafetownsend-angular-rails-login.png" alt="Login" /></a><br />
<a href="http://cafetownsend-angular-rails.herokuapp.com" class="img"><img src="https://github.com/sectore/CafeTownsend-Angular-Rails/raw/master/wiki/cafetownsend-angular-rails-overview.png" alt="Overview" /></a><br />
<a href="http://cafetownsend-angular-rails.herokuapp.com" class="img"><img src="https://github.com/sectore/CafeTownsend-Angular-Rails/raw/master/wiki/cafetownsend-angular-rails-edit.png" alt="Editing" /></a></p>
<h2>Live demo</h2>
<p>Run the demo at <a href="http://cafetownsend-angular-rails.herokuapp.com">http://cafetownsend-angular-rails.herokuapp.com</a> using <a href="https://www.google.com/chrome">a modern browser</a>.</p>
<h2>Source code</h2>
<p><a href="https://github.com/sectore/CafeTownsend-Angular-Rails">All source code</a> is available at <a href="https://github.com/sectore/CafeTownsend-Angular-Rails">GitHub</a>.</p>
<h2>Random notes</h2>
<p>Here are some notes and tips based on issues I ran into:</p>
<h3>Rails and AngularJS</h3>
<ul>
<li>The best way to communicate between Angular and Rails is using JSON. To ensure this your Rails controllers have to declare <code>respond_to :json</code>. Within your AngularJS controllers you have to declare <code>this.$xhr.defaults.headers.post['Content-Type'] = 'application/json';</code> and <code>this.$xhr.defaults.headers.put['Content-Type'] = 'application/json';</code> for any XHR requests. The library &#8220;<a href="https://github.com/ludicast/angle-up">angle-up</a>&#8221; will help you to simplify this.</li>
<li>Angular services provide a <a href="http://docs.angularjs.org/#!/api/angular.service.$resource">angular.service.$resource</a> object for using RESTful APIs. It includes almost all CRUD operations <code>(create, read, delete)</code> by default with the exception of <code>update</code>. To call an update operation your service has to define this action based on a PUT method call.</li>
<li>You can use *.erb files for your client-side html templates. That can be very handy, especially if you want to use ruby code within HTML. For example to refer to the asset path just write <code><%= asset_path("my-template.html") %></code></li>
<li>It seems that there are some issues to compress AngularJS while pre-compiling on Rails. The only way to avoid it seems to be disabling compression of JavaScript <code>config.assets.compress = false</code> in <code>config/environments/production.rb</code>. Please let me know if you have another solution.</li>
</ul>
<h3>Heroku</h3>
<ul>
<li>Deploying your rails app to Heroku is pretty easy. The only thing you should have in mind is that Heroku does not support SQLite. It provides PostgreSQL database only. Just replace within your Gemfile <code>gem 'sqlite3'</code> with <code>gem 'pg'</code>.</li>
<li><a href="http://devcenter.heroku.com/articles/rails3#webserver">Heroku recommands</a> using a more robust webserver, e.g. Thin. In this case just add to your Gemfile <code>gem 'thin'</code> for using Thin (and not Webrick).</li>
</ul>
<h2>Acknowledge</h2>
<ul>
<li>Vimeo: <a href="http://vimeo.com/30328747">Angular.js + Rails: Part 1</a> by Daniel Nelson </li>
<li>Vimeo: <a href="http://vimeo.com/30329977">Angular.js + Rails: Part 2</a> by Daniel Nelson </li>
<li><a href="https://github.com/centresource/angularjs_rails_demo">AngularJS Rails demo</a> by Daniel Nelson</li>
<li>RailsCasts: <a href="http://railscasts.com/episodes/270-authentication-in-rails-3-1">Authentication in Rails 3.1</a></li>
<li>Heroku: <a href="http://devcenter.heroku.com/articles/rails3">Getting Started with Rails 3.0 on Heroku/Cedar</a></li>
<li><a href="http://railsapps.github.com/rails-heroku-tutorial.html">Rails 3.1 on Heroku</a> by Daniel Kehoe</li>
</ul>
<p>Have fun!</p>
<p>-Jens</p>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2012/01/17/fun-with-angularjs-rails-coffeescript-sass-another-cafe-townsend-example/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Spine.js &#8211; Cafe Townsend example</title>
		<link>http://www.websector.de/blog/2011/12/31/spine-js-cafe-townsend-example/</link>
		<comments>http://www.websector.de/blog/2011/12/31/spine-js-cafe-townsend-example/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 13:25:57 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/?p=746</guid>
		<description><![CDATA[For a better understanding of Spine.js I have build a port of the Cafe Townsend app, which is a standard for demonstrating ActionScript based MVC frameworks (e.g. Swiz or Mate). The JavaScript port is written in CoffeeScript using Spine.js and Hem. It uses Eco for templating HTML and Stylus for less CSS. Screen shots Live [...]]]></description>
			<content:encoded><![CDATA[<p>For a better understanding of <a href="http://spinejs.com/">Spine.js</a> I have build a port of the Cafe Townsend app, which is a standard for demonstrating ActionScript based MVC frameworks (e.g. <a href="http://www.websector.de/blog/2010/04/25/swiz-cafe-townsend-example-incl-flexunit-tests/">Swiz</a> or <a href="http://www.websector.de/blog/2010/03/12/mate-cafe-townsend-example-updated-for-using-flex-4/">Mate</a>). </p>
<p>The JavaScript port is written in <a href="http://coffeescript.org/">CoffeeScript</a> using <a href="http://spinejs.com">Spine.js</a> and <a href="https://github.com/maccman/hem">Hem</a>. It uses <a href="https://github.com/sstephenson/eco">Eco</a> for templating HTML and <a href="http://learnboost.github.com/stylus/">Stylus</a> for less CSS. </p>
<p><span id="more-746"></span></p>
<h2>Screen shots</h2>
<p><a href="http://cafetownsend-spine.herokuapp.com" class="img"><img src="https://github.com/sectore/CafeTownsend-Spine/raw/master/wiki/cafetownsend-spine-login.png" alt="Login" /></a><br />
<a href="http://cafetownsend-spine.herokuapp.com" class="img"><img src="https://github.com/sectore/CafeTownsend-Spine/raw/master/wiki/cafetownsend-spine-overview.png" alt="Overview" /></a><br />
<a href="http://cafetownsend-spine.herokuapp.com" class="img"><img src="https://github.com/sectore/CafeTownsend-Spine/raw/master/wiki/cafetownsend-spine-edit.png" alt="Overview" /></a></p>
<h2>Live demo</h2>
<p>Run the demo at <a href="http://cafetownsend-spine.herokuapp.com">http://cafetownsend-spine.herokuapp.com</a> using <a href="https://www.google.com/chrome">Chrome</a>.</p>
<h2>Source code</h2>
<p><a href="https://github.com/sectore/CafeTownsend-Spine">All source code</a> is available at <a href="https://github.com/sectore/CafeTownsend-Spine">GitHub</a>.</p>
<p>Have fun!</p>
<p>-Jens</p>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2011/12/31/spine-js-cafe-townsend-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pushing (binary) image data using Node.js and Socket.IO</title>
		<link>http://www.websector.de/blog/2011/12/22/pushing-binary-image-data-using-node-js-and-socket-io/</link>
		<comments>http://www.websector.de/blog/2011/12/22/pushing-binary-image-data-using-node-js-and-socket-io/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 20:24:25 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Node]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/?p=712</guid>
		<description><![CDATA[These days I&#8217;m playing around with Node.js and Socket.IO. One of my goal was to push (binary) image data to clients (browser) in real time using WebSockets. Demo (Video on Vimeo) Behind the scenes The simple demo runs with Node.js (Express) and Socket.IO. It generates its HTML code using Jade templates and Stylus (CSS). The [...]]]></description>
			<content:encoded><![CDATA[<p>These days I&#8217;m playing around with <a href="http://nodejs.org">Node.js</a> and <a href="http://socket.io">Socket.IO</a>. One of my goal was to push (binary) image data to clients (browser) in real time using WebSockets.</p>
<p><span id="more-712"></span></p>
<h2>Demo (Video on Vimeo)</h2>
<p><iframe src="http://player.vimeo.com/video/34076718" width="500" height="313" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<h2>Behind the scenes</h2>
<p>The simple demo runs with <a href="http://nodejs.org">Node.js</a> (<a href="http://expressjs.com/">Express</a>) and <a href="http://expressjs.com/">Socket.IO</a>. It generates its HTML code using <a href="https://github.com/visionmedia/jade">Jade</a> templates and <a href="http://learnboost.github.com/stylus/">Stylus</a> (CSS). The code is written in <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a>.</p>
<h2>Limitation of pushing binary data</h2>
<p>At the time of writing this post sending and receiving binary data using WebSockets <a href="http://en.wikipedia.org/wiki/Comparison_of_WebSocket_implementations">are very limited by current browser</a>.</p>
<p>To avoid lack of supporting binary messages by browser all image data have to be encoded in base64 before emitting the message. To do that just draw the image within a Canvas and send the data using Canvas&#8217; <a href="http://www.w3.org/TR/html5/the-canvas-element.html#dom-canvas-todataurl ">toDataURL()</a> over the wire.</p>
<p>Here is a simple roundtrip on client-side (You will find all code of this demo here: <a href="https://github.com/sectore/node-socket.io-push-image-demo">https://github.com/sectore/node-socket.io-push-image-demo</a>):</p>
<div class="gistem"><div id="gist-1511618" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'><br/></div><div class='line' id='LC2'><span class="cm">###</span></div><div class='line' id='LC3'><br/></div><div class='line' id='LC4'><span class="cm">1 SENDING DATA</span></div><div class='line' id='LC5'><br/></div><div class='line' id='LC6'><span class="cm">1.1 get original image data clicking on it</span></div><div class='line' id='LC7'><span class="cm">1.2 get its base64-encoded data</span></div><div class='line' id='LC8'><span class="cm">1.3 emit the data by Socket.IO to server (Node.js)</span></div><div class='line' id='LC9'><br/></div><div class='line' id='LC10'><span class="cm">###</span></div><div class='line' id='LC11'><span class="nx">$</span><span class="p">(</span><span class="s">&quot;.my-image&quot;</span><span class="p">).</span><span class="nx">click</span> <span class="p">(</span><span class="nx">event</span><span class="p">)</span> <span class="o">=&gt;</span></div><div class='line' id='LC12'>	<span class="c1"># get image which was clicked</span></div><div class='line' id='LC13'>	<span class="nv">img = </span><span class="nx">event</span><span class="p">.</span><span class="nx">target</span></div><div class='line' id='LC14'>	<span class="c1"># create base64 encoded image</span></div><div class='line' id='LC15'>	<span class="nv">imgdata = </span><span class="nx">@getBase64Image</span><span class="p">(</span><span class="nx">img</span><span class="p">)</span></div><div class='line' id='LC16'>	<span class="c1"># emit data to clients</span></div><div class='line' id='LC17'>	<span class="nx">@socket</span><span class="p">.</span><span class="nx">emit</span> <span class="s">&#39;onimgdata&#39;</span><span class="p">,</span> <span class="p">{</span>  <span class="nv">width: </span><span class="nx">img</span><span class="p">.</span><span class="nx">width</span><span class="p">,</span> <span class="nv">height: </span><span class="nx">img</span><span class="p">.</span><span class="nx">height</span><span class="p">,</span> <span class="nx">source</span><span class="o">:</span><span class="nx">imgdata</span> <span class="p">}</span></div><div class='line' id='LC18'><br/></div><div class='line' id='LC19'><br/></div><div class='line' id='LC20'><span class="cm">###</span></div><div class='line' id='LC21'><span class="cm">Helper method to get a base64 encoded image data</span></div><div class='line' id='LC22'><span class="cm">Based on http://stackoverflow.com/questions/934012/get-image-data-in-javascript</span></div><div class='line' id='LC23'><span class="cm">###</span></div><div class='line' id='LC24'><span class="nx">getBase64Image</span><span class="o">:</span><span class="nf">(img) -&gt;</span></div><div class='line' id='LC25'>	<span class="c1"># create canvas</span></div><div class='line' id='LC26'>	<span class="nv">canvas = </span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span> <span class="s">&quot;canvas&quot;</span></div><div class='line' id='LC27'>	<span class="nv">canvas.width = </span><span class="nx">img</span><span class="p">.</span><span class="nx">width</span></div><div class='line' id='LC28'>	<span class="nv">canvas.height = </span><span class="nx">img</span><span class="p">.</span><span class="nx">height</span></div><div class='line' id='LC29'>	<span class="nv">context = </span><span class="nx">canvas</span><span class="p">.</span><span class="nx">getContext</span> <span class="s">&quot;2d&quot;</span></div><div class='line' id='LC30'>	<span class="c1"># draw image into canvas</span></div><div class='line' id='LC31'>	<span class="nx">context</span><span class="p">.</span><span class="nx">drawImage</span>   <span class="nx">img</span><span class="p">,</span></div><div class='line' id='LC32'>		<span class="mi">0</span><span class="p">,</span></div><div class='line' id='LC33'>		<span class="mi">0</span></div><div class='line' id='LC34'><br/></div><div class='line' id='LC35'>	<span class="cm">###</span></div><div class='line' id='LC36'><span class="cm">	Get the data-URL formatted image</span></div><div class='line' id='LC37'><span class="cm">	using jpeg format as the type of the image to be returned</span></div><div class='line' id='LC38'><span class="cm">	@see: http://www.w3.org/TR/html5/the-canvas-element.html</span></div><div class='line' id='LC39'><span class="cm">	###</span></div><div class='line' id='LC40'>	<span class="nv">data = </span><span class="nx">canvas</span><span class="p">.</span><span class="nx">toDataURL</span> <span class="s">&quot;image/jpeg&quot;</span></div><div class='line' id='LC41'><br/></div><div class='line' id='LC42'>	<span class="c1">#return data</span></div><div class='line' id='LC43'>	<span class="nx">data</span></div><div class='line' id='LC44'><br/></div><div class='line' id='LC45'><span class="cm">###</span></div><div class='line' id='LC46'><br/></div><div class='line' id='LC47'><span class="cm">2 RECEIVING DATA + DISPLAY IMAGE</span></div><div class='line' id='LC48'><span class="cm">2.1 listen to &quot;showimgdata&quot; event sent from server (Node.js)</span></div><div class='line' id='LC49'><span class="cm">2.2 push data to HTML image</span></div><div class='line' id='LC50'><br/></div><div class='line' id='LC51'><span class="cm">###</span></div><div class='line' id='LC52'><br/></div><div class='line' id='LC53'><span class="nx">@socket</span><span class="p">.</span><span class="kc">on</span> <span class="s">&#39;showimgdata&#39;</span><span class="p">,</span> <span class="nf">(data) -&gt;</span></div><div class='line' id='LC54'>	<span class="c1">#get image</span></div><div class='line' id='LC55'>	<span class="nv">img = </span><span class="nx">$</span><span class="p">(</span><span class="s">&#39;#show-img&#39;</span><span class="p">).</span><span class="nx">get</span> <span class="mi">0</span></div><div class='line' id='LC56'>	<span class="nx">message</span></div><div class='line' id='LC57'>	<span class="k">try</span></div><div class='line' id='LC58'>		<span class="c1"># set data for image</span></div><div class='line' id='LC59'>		<span class="nv">img.width = </span><span class="nx">data</span><span class="p">.</span><span class="nx">width</span><span class="p">;</span></div><div class='line' id='LC60'>		<span class="nv">img.height = </span><span class="nx">data</span><span class="p">.</span><span class="nx">height</span><span class="p">;</span></div><div class='line' id='LC61'>		<span class="nv">img.src = </span><span class="nx">data</span><span class="p">.</span><span class="nx">source</span><span class="p">;</span></div><div class='line' id='LC62'><br/></div><div class='line' id='LC63'>		<span class="nv">message = </span><span class="s">&#39;&#39;</span></div><div class='line' id='LC64'><br/></div><div class='line' id='LC65'>	<span class="k">catch</span> <span class="nx">error</span></div><div class='line' id='LC66'>		<span class="nx">console</span><span class="p">.</span><span class="nx">log</span> <span class="nx">error</span></div><div class='line' id='LC67'>		<span class="nv">message = </span><span class="s">&#39;error receiving image data...&#39;</span></div><div class='line' id='LC68'><br/></div><div class='line' id='LC69'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1511618/c17014cf946ef02d903dc1c7990ce70b0e4ff22e/sending-receiving-base64encodeImage.coffee" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1511618#file_sending_receiving_base64encode_image.coffee" style="float:right;margin-right:10px;color:#666">sending-receiving-base64encodeImage.coffee</a>
            <a href="https://gist.github.com/1511618">This Gist</a> is brought to you using <a href="http://en.bainternet.info/2011/simple-gist-embed"><small>Simple Gist Embed</small></a>.
          </div>
        </div>
</div>
</div><style type="text/css">@import "http://gist.github.com/stylesheets/gist/embed.css"; .gistem .highlight {background: inherit; !important;}</style>
<p>The disadvantage of this solution is that &#8220;<i><a href="http://www.html5rocks.com/en/mobile/mobifying.html#toc-optimizations-requests">Base64 encoding adds ~30%+ of size to the image</a></i>&#8221; (Quote by Eric Bidelman / Developer Relations, Google: <a href="http://www.html5rocks.com/en/mobile/mobifying.html">&#8220;Mobifying&#8221; Your HTML5 Site</a>).</p>
<h2>Source code</h2>
<p><a href="https://github.com/sectore/node-socket.io-push-image-demo">All source code</a> and its installation instruction available at <a href="https://github.com/sectore/node-socket.io-push-image-demo">GitHub</a>.</p>
<p>Have fun!</p>
<p>-Jens</p>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2011/12/22/pushing-binary-image-data-using-node-js-and-socket-io/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple Login Example built with Node.js (Express), Eco and CoffeeScript</title>
		<link>http://www.websector.de/blog/2011/12/15/simple-login-example-built-with-node-js-express-eco-and-coffeescript/</link>
		<comments>http://www.websector.de/blog/2011/12/15/simple-login-example-built-with-node-js-express-eco-and-coffeescript/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 13:56:40 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Node]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/?p=683</guid>
		<description><![CDATA[After deciding to port an ActionScript Cafe Townsend example into JavaScript the first step was to build a simple login example. It is built with Node.js (Express) on server-side and it uses Eco templates to render views on client-side. Most of code is written in CoffeeScript. Screen shot Random notes Here are some notes or [...]]]></description>
			<content:encoded><![CDATA[<p>After <a href="https://plus.google.com/111160856985577256573/posts/St3JmmXfcaT">deciding to port an ActionScript Cafe Townsend example into JavaScript</a> the first step was to build <a href="http://nodejs-coffeescript-login.herokuapp.com/">a simple login example</a>. </p>
<p>It is built with <a href="http://nodejs.org/">Node.js</a> (<a href="http://expressjs.com/">Express</a>) on server-side and it uses <a href="https://github.com/sstephenson/eco">Eco</a> templates to render views on client-side. <a href="https://github.com/sectore/nodejs-coffeescript-login">Most of code</a> is written in <a href="http://http//jashkenas.github.com/coffee-script/">CoffeeScript</a>.</p>
<p><span id="more-683"></span></p>
<h2>Screen shot</2></p>
<p><a href="http://nodejs-coffeescript-login.herokuapp.com/" class="img"><img src="https://github.com/sectore/nodejs-coffeescript-login/raw/master/wiki/screenshot-nodejs-coffeescript-login.png" alt="Screen shot of simple login example" /></a></p>
<h2>Random notes</h2>
<p>Here are some notes or tips based on issues I ran into writing this app:</p>
<h3>CoffeeScript + Express</h3>
<ul>
<li>Use <a href="https://github.com/twilson63/cupcake">cupcake</a> to build a skeleton of your CoffeeScript / Express app as easy as possible</li>
</ul>
<h3>Eco templates</h3>
<ul>
<li>Don&#8217;t forget to declare any value sent from server using a &#8220;<code>@</code>&#8221; within the Eco template, e.g <code><%- @user.name %></code> It took me some time to find and fix such a typo.</li>
</ul>
<h3>Deploying to Heroku</h3>
<ul>
<li>To run an app written in CoffeeScript on Heroku you have to point the <code>app.coffee</code> and not <code>app.js</code> as a command to the <a href="http://devcenter.heroku.com/articles/procfile">Procfile</a> as follow: <code>web: coffee app.coffee</code></li>
<li>Run <code>heroku ps</code> to check if the app has been crashed or not.</li>
<li>In case of crashing check <code>heroku logs</code> for very helpful detailes</li>
<li>Heroku may not run the version of Node.js you have installed on your local machine. At the moment of writing this post Heroku is running v.0.4.7., not the latest version of Node.js v.0.6.5. If you have to downgrade your local version you will find <a href="http://www.websector.de/blog/2011/12/15/quick-tip-node-how-to-downgrade-node-js-on-os-x/">here a short instruction</a>.</li>
<li>To rename your subdomain using by Heroku you have to rename the app itself as follow: <code>heroku rename newname --app oldname</code>. After that you may have to repoint your git repository as well: <code>git remote rm heroku</code> and <code>git remote add heroku git@heroku.com:newname.git</code></li>
<li>Instead of using an hardcoded value for a port check the PORT environment variable in your app.coffee as well <code>port = process.env.PORT or 9294</code> Because Heroku tells the app which port is listen to. </li>
<li>Last but not least: Heroku has published an excellent article: &#8220;<a href="http://devcenter.heroku.com/articles/node-js">Getting Started with Node.js on Heroku/Cedar</a>&#8220;</li>
</ul>
<h2>Source code</h2>
<p>You will find all <a href="https://github.com/sectore/nodejs-coffeescript-login">source code</a> and its build instruction at <a href="https://github.com/sectore/nodejs-coffeescript-login">GitHub</a></p>
<p>Have fun!</p>
<p>-Jens</p>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2011/12/15/simple-login-example-built-with-node-js-express-eco-and-coffeescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip (Node): How to downgrade Node.js on OS X</title>
		<link>http://www.websector.de/blog/2011/12/15/quick-tip-node-how-to-downgrade-node-js-on-os-x/</link>
		<comments>http://www.websector.de/blog/2011/12/15/quick-tip-node-how-to-downgrade-node-js-on-os-x/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 11:19:35 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Node]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/?p=663</guid>
		<description><![CDATA[It&#8217;s a good idea to run Node.js using the latest (stable) version. However, there might be some reasons to downgrade Node.js to a previous version. In my case I needed an older version to test and deploy a simple web app to Heroku (where Node.js v.0.4.7 is running, not the latest v.0.6.5). How-to The best [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a good idea to run <a href="http://nodejs.org/">Node.js</a> using the latest (stable) version. However, there might be some reasons to downgrade Node.js to a previous version. In my case I needed an older version to test and deploy <a href="http://nodejs-coffeescript-login.herokuapp.com/">a simple web app</a> to <a href="http://heroku.com">Heroku</a> (where Node.js v.0.4.7 is running, not the latest v.0.6.5).</p>
<p><span id="more-663"></span></p>
<h2>How-to</h2>
<p>The best way to downgrade any Node.js version is using the make file which is delivered by any Node release. In case you have Node installed by an installer (e.g. Macintosh Installer) you have to re-build your current version &#8220;by hand&#8221; (steps #3-#5). It seems that is not possible to run the make file targeting to a Node version, which has been installed by an installer.  </p>
<ol>
<li>Open Terminal</li>
<li>Check version you are running on your machine: <code>node --version</code>
<li>Download the version you are using at the moment from <a href="http://nodejs.org/dist/">Node.js release files list</a></li>
<li>Extract downloaded file: <code>tar -zxf node-v{your-current-version-number}.tar.gz</code></li>
<li>If you already build Node without an installer you can skip this step:<br />
Build and install this version<br />
<code>cd node-v{your-current-version-number}<br />
./configure<br />
make<br />
sudo make install</code></li>
<li>Uninstall current version: <code>sudo make uninstall</code></li>
<li>Download the version you want to upgrade from <a href="http://nodejs.org/dist/">Node.js release files list</a></li>
<li>Extract downloaded file: <code>tar -zxf node-v{downgrade-version-number}.tar.gz</code></li>
<li>Build and install this version:<br />
<code>cd node-v{downgrade-version-number}<br />
./configure<br />
make<br />
sudo make install</code></li>
<li>Check if the downgraded version is installed now: <code>node --version</code>
</ol>
<p>That&#8217;s all <img src='http://www.websector.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>Acknowledge</h2>
<ul>
<li><a href="https://github.com/joyent/node/wiki/Installation">Building and Installing Node.js</a></li>
</ul>
<p>-Jens</p>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2011/12/15/quick-tip-node-how-to-downgrade-node-js-on-os-x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quick tip (AIR): Signing an ANE (ActionScript Native Extension)</title>
		<link>http://www.websector.de/blog/2011/10/20/quick-tip-air-signing-an-ane-actionscript-native-extension/</link>
		<comments>http://www.websector.de/blog/2011/10/20/quick-tip-air-signing-an-ane-actionscript-native-extension/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 18:13:28 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/?p=633</guid>
		<description><![CDATA[If you package an Native Extensions for latest Adobe AIR 3.0 you will have an option for signing it with a certificate as well. The packaging process of creating ANE (ActionScript Native Extension) files is already well documented (check &#8220;Packaging a native extension&#8221; at Adobes AIR documentation). However, it&#8217;s not easy to find a detailed [...]]]></description>
			<content:encoded><![CDATA[<p>If you package an <a href="http://www.adobe.com/devnet/air/native-extensions-for-air.html">Native Extensions</a> for latest <a href="http://www.adobe.com/products/air.html">Adobe AIR 3.0</a> you will have an option for signing it with a certificate as well. </p>
<p>The packaging process of creating ANE (ActionScript Native Extension) files is already well documented (check &#8220;<a href="http://help.adobe.com/en_US/air/extensions/WSf00ab63af761f170-168f6f2a129378b935d-8000.html">Packaging a native extension</a>&#8221; at Adobes AIR documentation). However, it&#8217;s not easy to find a detailed instruction for signing an ANE file. Maybe because it is optionally&#8230; Here are few tips:</p>
<p><span id="more-633"></span></p>
<h2>Tips</h2>
<ol>
<li>Signing an *.ane file is almost the same thing as signing an *.air file. So you can use an <a href="http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7f74.html">own self-signed certificate</a> or <a href="http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff0.html#WS5b3ccc516d4fbf351e63e3d118666ade46-7c65">an obtained certificate</a><br/><br/></li>
<li>Because the current Flash Builder (v.4.5) does not support packaging and signing ANE files, you have to use the command line tool ADT. <br/><br/>Here is an example of packaging an ANE for using it on the iPhone (without signing):<br/><code>adt -package -target ane MyExtension.ane extension-descriptor.xml -swc MyExtension.swc -platform iPhone-ARM library.swf MyExtension.a -platform default library.swf</code>. <br /><br/>More information about all command line options you will find here: &#8220;<a href="http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2482335412ffea65006-8000.html#WSf268776665d7970d-6be13ace1308aaebeca-8000">ADT example for packaging an extension</a>&#8220;.<br/><br/></li>
<li>To sign an ANE file just add the needed <em>signing options</em> to the command line options after <em>-package</em> and before <em>-target</em>. You will find all available signing options <a href="http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7f72.html">here</a>. <br/><br/>An example of packaging and signing an ANE for using it on the iPhone looks like: <br/><code>adt -package -storetype pkcs12 -keystore my_certificate.p12 -keypass my_password -target ane MyExtension.ane extension-descriptor.xml -swc MyExtension.swc -platform iPhone-ARM library.swf MyExtension.a -platform default library.swf</code><br/><br/></li>
</ol>
<h2>Acknowledge:</h2>
<ul>
<li>
Adobe AIR documentation: &#8220;<a href="http://help.adobe.com/en_US/air/extensions/index.html">Developing Native Extensions for Adobe AIR</a>&#8220;</li>
<li>
Adobe AIR documentation: &#8220;<a href="http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-19aa73f128cc9f05e8-8000.html">Signing AIR applications</a>&#8220;</li>
<li>
Adobe ADC &#8211; Daniel Koestler: &#8220;<a href="http://www.adobe.com/devnet/air/articles/developing-native-extensions-air.html">Developing native extensions for Adobe AIR</a>&#8221; -> Chapter &#8220;Packaging a native extension&#8221;</li>
<li>
Adobe: &#8220;<a href="http://www.adobe.com/content/dam/Adobe/en/devnet/devices/pdfs/DevelopingActionScriptExtensionsForAdobeAIR.pdf">Developing ACTIONSCRIPT® Extensions for ADOBE® AIR®</a>&#8221; (PDF) -> Chapter &#8220;Packaging a native extension for AIR for TV devices&#8221;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2011/10/20/quick-tip-air-signing-an-ane-actionscript-native-extension/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Quick tip (Flex Mobile): Run BlackBerry&#8217;s Tablet OS SDK for AIR using Flash Builder Burrito plug-in version (not standalone)</title>
		<link>http://www.websector.de/blog/2010/12/07/quick-tip-flex-mobile-run-blackberrys-tablet-os-sdk-for-air-using-flash-builder-burrito-plug-in-version-not-standalone/</link>
		<comments>http://www.websector.de/blog/2010/12/07/quick-tip-flex-mobile-run-blackberrys-tablet-os-sdk-for-air-using-flash-builder-burrito-plug-in-version-not-standalone/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 10:47:42 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/?p=611</guid>
		<description><![CDATA[Renaun Erickson did a great job to describe the usage of the Flash Builder Burrito plugin for BlackBerry Tablet OS SDK for Adobe AIR. However, if you have already used Burrito as a plug-in version for Eclipse (and not as a standalone version), it will not find the new installed PlayBook SDK by default. Therefore [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://renaun.com/blog/">Renaun Erickson</a> did a great job to <a href="http://renaun.com/blog/2010/12/update-to-playbook-sdk-provides-flash-builder-burrito-plugin/">describe the usage</a> of the Flash Builder Burrito plugin for BlackBerry Tablet OS SDK for Adobe AIR. However, if you have already used Burrito as a plug-in version for Eclipse (and not as a standalone version), it will not find the new installed PlayBook SDK by default. Therefore you have to do a further step &#8220;by hand&#8221;.</p>
<p><span id="more-611"></span></p>
<p>First of all: If you have not already installed Flash Builder Burrito as a plug-in for Eclipse (and again &#8211; not as a standalone version <img src='http://www.websector.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) follow the simple and great description by Jason here: <a href="http://blogs.adobe.com/jasonsj/2010/11/burrito-feature-plug-in-installer.html">&#8220;Burrito Feature: Plug-in Installer&#8221;</a>. To get more details of installing the PlayBook SDK and its Flash Builder 4 plug-in check the post <a href="http://docs.blackberry.com/en/developers/deliverables/21878/Installing_the_SDK_1347128_11.jsp">&#8220;Install the BlackBerry Tablet OS SDK for Adobe AIR&#8221;</a> at the BlackBarry Documentation as well.</p>
<p>After that just copy <code>blackberry-tablet-sdk.link</code> located in folder named &#8220;dropins&#8221; of Burritos standalone version to the folder &#8220;dropins&#8221; of your eclipse installation folder. That&#8217;s all <img src='http://www.websector.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><img src="http://www.websector.de/blog/wp-content/uploads/2010/12/07/screenshot_dropin_folder.png" with="500" height="414" alt="Screen shot" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2010/12/07/quick-tip-flex-mobile-run-blackberrys-tablet-os-sdk-for-air-using-flash-builder-burrito-plug-in-version-not-standalone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Swiz: Cafe Townsend example (incl. FlexUnit tests)</title>
		<link>http://www.websector.de/blog/2010/04/25/swiz-cafe-townsend-example-incl-flexunit-tests/</link>
		<comments>http://www.websector.de/blog/2010/04/25/swiz-cafe-townsend-example-incl-flexunit-tests/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 10:56:14 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/?p=591</guid>
		<description><![CDATA[UPDATE [10/31/10]: Example and its full source has been updated using latest commit of Swiz 1.0 RC2. Cafe Townsend is a well known application to demonstrate any MVC framework for using Flex or ActionScript. There are already ports of Cairngorm, Mate, PureMVC, Spring ActionScript, RobotLegs and now Swiz. In cooperation with &#8220;my partner in crime&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p style="background-color: #f6f6f6"><strong>UPDATE [10/31/10]: </strong>Example and its <a href="http://github.com/swiz/swiz-examples/tree/master/CafeTownsend-Flex4/">full source</a> has been updated using latest <a href="http://github.com/swiz/swiz-framework/commit/1b7f62017d250834d6671a97aed42ac853ad59ef/">commit of Swiz 1.0 RC2</a>.</p>
<p>Cafe Townsend is a well known application to demonstrate any MVC framework for using Flex or ActionScript. There are already ports of <a href="http://cairngormdocs.org/blog/?p=19">Cairngorm</a>, <a href="http://www.websector.de/blog/2010/03/12/mate-cafe-townsend-example-updated-for-using-flex-4/">Mate</a>, <a href="http://trac.puremvc.org/Demo_AS3_Flex_CafeTownsend">PureMVC</a>, <a href="http://www.herrodius.com/blog/307">Spring ActionScript</a>, <a href="http://github.com/darscan/robotlegs-demos-Bundle/tree/master/CafeTownsend/">RobotLegs</a> and now <a href="http://github.com/swiz/swiz-examples/tree/master/CafeTownsend-Flex4/">Swiz</a>.</p>
<p>In cooperation with &#8220;my partner in crime&#8221; <a href="http://soenkerohde.com/">Sönke Rohde</a> we have built a Swiz port including unit tests. Check out the following example and its source.</p>
<p><span id="more-591"></span></p>
<h2>Live Example</h2>
<p>(To view source code just a right mouse click on it)<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_CafeTownsend_447155565"
			class="flashmovie"
			width="500"
			height="530">
	<param name="movie" value="http://www.websector.de/blog/wp-content/uploads/2010/04/25/CafeTownsend.swf" />
	<param name="menu" value="true" />
	<param name="bgcolor" value="#FFFFFF" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.websector.de/blog/wp-content/uploads/2010/04/25/CafeTownsend.swf"
			name="fm_CafeTownsend_447155565"
			width="500"
			height="530">
		<param name="menu" value="true" />
		<param name="bgcolor" value="#FFFFFF" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<h2>Source code</h2>
<p>You will find the <a href="http://github.com/swiz/swiz-examples/tree/master/CafeTownsend-Flex4/">full source</a> of Swiz&#8217; Cafe Townsend example <a href="http://github.com/swiz/swiz-examples/tree/master/CafeTownsend-Flex4/">at GitHub</a>.</p>
<h2>Thanks!</h2>
<p>Thanks again to Sönke for his great cooperation including all helpful tips! Also big thanks to Swiz team for development such a simple to use framework &#8211; keep on rocking <img src='http://www.websector.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>-Jens</p>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2010/04/25/swiz-cafe-townsend-example-incl-flexunit-tests/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Slides und Source vom flexughh-Meeting: &#8220;Wait A Frame! Das Flex 4 Komponenten Model und seinen Life Cycle verstehen&#8221;</title>
		<link>http://www.websector.de/blog/2010/04/06/slides-und-source-vom-flexughh-meeting-wait-a-frame-das-flex-4-komponenten-model-und-seinen-life-cycle-verstehen/</link>
		<comments>http://www.websector.de/blog/2010/04/06/slides-und-source-vom-flexughh-meeting-wait-a-frame-das-flex-4-komponenten-model-und-seinen-life-cycle-verstehen/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 20:55:50 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[Talk]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/?p=574</guid>
		<description><![CDATA[Nochmals vielen Dank, dass Ihr beim heutigen flexughh-Meeting &#8220;Wait A Frame! Das Flex 4 Komponenten Model und seinen Life Cycle verstehen.&#8221; so zahlreich erschienen seid und auch tapfer bis zum Ende des Vortrages durchgehalten habt Es hat großen Spass gemacht! Hier die versprochenen Slides inkl. Source Code. Folien &#160; &#8220;Spark Component Model&#8221; Beispiel 
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_FxughhSpark_1289542713"
			class="flashmovie"
			width="400"
			height="300">
	<param name="movie" value="http://www.websector.de/blog/wp-content/uploads/2010/04/06/FxughhSpark.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.websector.de/blog/wp-content/uploads/2010/04/06/FxughhSpark.swf"
			name="fm_FxughhSpark_1289542713"
			width="400"
			height="300">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flexughh.de/2010/03/23/flexughh-meeting-06-04-2010-jens-krause-wait-a-frame-das-neue-flex-4-komponenten-model-und-seinen-lifecycle-verstehen/" class="img"><img src="http://www.websector.de/blog/wp-content/uploads/2010/04/06/flexughh_meeting_400_60.png" alt="flexughh-meeting" /></a></p>
<p>Nochmals vielen Dank, dass Ihr beim heutigen <a href="http://www.flexughh.de/">flexughh</a>-Meeting <a href="http://www.flexughh.de/2010/03/23/flexughh-meeting-06-04-2010-jens-krause-wait-a-frame-das-neue-flex-4-komponenten-model-und-seinen-lifecycle-verstehen/">&#8220;Wait A Frame! Das Flex 4 Komponenten Model und seinen Life Cycle verstehen.&#8221;</a> so zahlreich erschienen seid und auch tapfer bis zum Ende des Vortrages durchgehalten habt <img src='http://www.websector.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Es hat großen Spass gemacht! </p>
<p>Hier die versprochenen Slides inkl. Source Code.</p>
<p><span id="more-574"></span></p>
<h2>Folien</h2>
<div style="width:500px, height:420px" id="__ss_3630390"> <strong style="display:block;margin:12px 0 4px"><iframe src="http://www.slideshare.net/slideshow/embed_code/3630390" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></div>
<p>&nbsp;</p>
<h2>&#8220;Spark Component Model&#8221;  Beispiel</h2>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_FxughhSpark_1927111464"
			class="flashmovie"
			width="500"
			height="370">
	<param name="movie" value="http://www.websector.de/blog/wp-content/uploads/2010/04/06/FxughhSpark.swf" />
	<param name="menu" value="true" />
	<param name="bgcolor" value="#FFFFFF" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.websector.de/blog/wp-content/uploads/2010/04/06/FxughhSpark.swf"
			name="fm_FxughhSpark_1927111464"
			width="500"
			height="370">
		<param name="menu" value="true" />
		<param name="bgcolor" value="#FFFFFF" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>&nbsp;</p>
<h2>Source</h2>
<p>Den <a href="http://code.google.com/p/flexughh/source/browse/#svn/trunk/meetings/spark_060410/src">Source-Code der Beispiele</a> findet Ihr <a href="http://code.google.com/p/flexughh/source/browse/#svn/trunk/meetings/spark_060410/src">hier</a> beim flexughh Projekt bei Google Code.</p>
<p>-Jens</p>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2010/04/06/slides-und-source-vom-flexughh-meeting-wait-a-frame-das-flex-4-komponenten-model-und-seinen-life-cycle-verstehen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mate: Cafe Townsend example updated for using Flex 4</title>
		<link>http://www.websector.de/blog/2010/03/12/mate-cafe-townsend-example-updated-for-using-flex-4/</link>
		<comments>http://www.websector.de/blog/2010/03/12/mate-cafe-townsend-example-updated-for-using-flex-4/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 19:51:53 +0000</pubDate>
		<dc:creator>sectore</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.websector.de/blog/?p=552</guid>
		<description><![CDATA[For an upcoming Flex 4 training I do need a good example for using Mate framework. At the moment you will find a lot of examples on Mate&#8217;s official website or at the project called &#8220;mate-examples&#8221; at Google Code. But it seems that there is not any Flex 4 example available. Anyway, I just ported [...]]]></description>
			<content:encoded><![CDATA[<p>For an upcoming Flex 4 training I do need a good example for using <a href="http://mate.asfusion.com">Mate framework</a>. At the moment you will find <a href="http://mate.asfusion.com/page/examples">a lot of examples on Mate&#8217;s official website</a> or at the project called &#8220;<a href="http://code.google.com/p/mate-examples/">mate-examples</a>&#8221; at  Google Code. But it seems that there is not any Flex 4 example available. </p>
<p>Anyway, I just ported the <a href="http://mate.asfusion.com/page/examples/cafe-townsend">current Cafe Townsend example (Flex 3)</a> created by <a href="http://www.asfusion.com">Laura Arguello</a> to Flex 4. </p>
<p><span id="more-552"></span></p>
<p>It was not a big deal, because Mate supports already Flex 4. Only few changes was necessary for using new Spark components.</p>
<p>Also I did some little modifications in <code><a href="http://code.google.com/p/mate-examples/source/browse/trunk/examples/cafeTownsendFlex4/src/com/cafetownsend/maps/MainEventMap.mxml">MainEventMap.mxml</a></code> to start all Inject properties for any views as soon as possible listening to <code>FlexEvent.PREINITIALIZE</code>. Furthermore all presentation models now are not created before its view will be added. But that is what we called &#8220;cosmetic&#8221; <img src='http://www.websector.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  , because Laura has already done an awesome job building the Flex 3 example of Cafe Townsend!</p>
<h2>Live example</h2>
<p><strong>[Update 03/15/2010]</strong> For a better use case of Flex 4 I have refactored the original code of the app. Now it based on a new layout and uses some effects. Last but not least the code implement a LocalEventMap to encapsulate the handling of employes, which is important if you want to use a modular app with Flex-Modules<strong>[/Update]</strong></p>
<p>(To view source code just a right mouse click on the app) </p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_CafeTownsend_334034103"
			class="flashmovie"
			width="500"
			height="530">
	<param name="movie" value="http://www.websector.de/blog/wp-content/uploads/2010/03/12/CafeTownsend.swf" />
	<param name="menu" value="true" />
	<param name="bgcolor" value="#FFFFFF" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.websector.de/blog/wp-content/uploads/2010/03/12/CafeTownsend.swf"
			name="fm_CafeTownsend_334034103"
			width="500"
			height="530">
		<param name="menu" value="true" />
		<param name="bgcolor" value="#FFFFFF" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<h2>Source code available</h2>
<p>You will find the full source of Mate&#8217;s Cafe Townsend Flex 4 example <a href="http://code.google.com/p/mate-examples/source/browse/trunk/examples/cafeTownsendFlex4/src/">at the project called &#8216;mate-examples&#8217;</a> on Google Code.</p>
<p>Have fun!</p>
<p>-Jens</p>
]]></content:encoded>
			<wfw:commentRss>http://www.websector.de/blog/2010/03/12/mate-cafe-townsend-example-updated-for-using-flex-4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

