<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1034435163415394624</id><updated>2025-11-06T11:22:36.188+01:00</updated><category term="javascript"/><category term="mysql"/><category term="art"/><category term="bash"/><category term="canvas"/><category term="firebug"/><category term="javascript. css"/><category term="jquery"/><category term="php"/><category term="wall decal"/><category term="wall tattoo"/><category term="zend"/><title type='text'>Orangevolt</title><subtitle type='html'>a developer notebook</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>65</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-6688908128382055170</id><published>2015-07-02T11:55:00.001+02:00</published><updated>2015-07-02T11:55:51.114+02:00</updated><title type='text'>Slides for my enterJS 2015 talk &quot;Polymer 1.0 &amp; ES6 in action&quot;</title><content type='html'>I gave a second &lt;a href=&quot;http://www.enterjs.de/abstracts#polymer&quot; target=&quot;_blank&quot;&gt;talk about Polymer 1.0 and EcmaScript 6 at enterJS conference called &quot;Polymer 1.0 &amp;amp; ES6 in action&quot;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You can view the&amp;nbsp;&lt;a href=&quot;http://lgersman.github.io/enterjs2015-polymer_es6/&quot; target=&quot;_blank&quot;&gt;slides for this talk online here&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The sources for this talk and the demo project are hostet at Github :&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://github.com/lgersman/enterjs2015-polymer_es6&quot; target=&quot;_blank&quot;&gt;https://github.com/lgersman/enterjs2015-polymer_es6&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://github.com/lgersman/enterjs2015-polymer_es6_demo&quot; target=&quot;_blank&quot;&gt;https://github.com/lgersman/enterjs2015-polymer_es6_demo&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Have fun,&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Lars&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/6688908128382055170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2015/07/slides-for-my-enterjs-2015-talk_2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/6688908128382055170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/6688908128382055170'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2015/07/slides-for-my-enterjs-2015-talk_2.html' title='Slides for my enterJS 2015 talk &quot;Polymer 1.0 &amp; ES6 in action&quot;'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-8035506356860013562</id><published>2015-07-02T11:50:00.005+02:00</published><updated>2015-07-02T11:50:45.500+02:00</updated><title type='text'>Slides for my enterJS 2015 talk &quot;Pragmatic Gulp&quot;</title><content type='html'>I gave a &lt;a href=&quot;http://www.enterjs.de/abstracts#pragmatic-gulp&quot; target=&quot;_blank&quot;&gt;talk about Gulp at enterJS conference called &quot;Pragmatic Gulp&quot;&lt;/a&gt;&amp;nbsp;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
You can view the &lt;a href=&quot;http://lgersman.github.io/enterjs2015-pragmatic_gulp/&quot; target=&quot;_blank&quot;&gt;slides for this talk online here&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The sources for this talk and the demo project are hostet at Github :&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://github.com/lgersman/enterjs2015-pragmatic_gulp&quot;&gt;https://github.com/lgersman/enterjs2015-pragmatic_gulp&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://github.com/lgersman/enterjs2015-pragmatic_gulp_demo&quot;&gt;https://github.com/lgersman/enterjs2015-pragmatic_gulp_demo&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Have fun,&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Lars&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/8035506356860013562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2015/07/slides-for-my-enterjs-2015-talk.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/8035506356860013562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/8035506356860013562'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2015/07/slides-for-my-enterjs-2015-talk.html' title='Slides for my enterJS 2015 talk &quot;Pragmatic Gulp&quot;'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-1840073169913221012</id><published>2014-11-14T08:48:00.003+01:00</published><updated>2014-11-14T08:48:57.098+01:00</updated><title type='text'>A few software gems for web development</title><content type='html'>I&#39;ll make it short for today :&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://xip.io/&quot; target=&quot;_blank&quot;&gt;wildcard DNS for everyone&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.vanheusden.com/multitail/screenshots.php&quot; target=&quot;_blank&quot;&gt;multitail - show/track many (wildcards alllowed) log files at once&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://nicolargo.github.io/glances/&quot; target=&quot;_blank&quot;&gt;Glances an Eye on your system&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div&gt;
Happy coding !!&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/1840073169913221012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2014/11/a-few-software-gems-for-web-development.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1840073169913221012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1840073169913221012'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2014/11/a-few-software-gems-for-web-development.html' title='A few software gems for web development'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-7858821639815179627</id><published>2014-09-24T14:10:00.004+02:00</published><updated>2014-09-24T14:21:40.475+02:00</updated><title type='text'>angular-pragmatic - a 24 loc AngularJS module for using ANY jquery plugin and consume ANY native/custom event in AngularJS</title><content type='html'>I&#39;ve just released&amp;nbsp;&lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;- a micro&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt; module (only 24 lines of code!) for using &lt;b&gt;ANY&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt; plugin within&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Additionally, using &lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;you can consume&amp;nbsp;&lt;b&gt;ANY&lt;/b&gt;&amp;nbsp;event (either native or custom event) in &lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Why should you use it ?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Have you ever noticed that many many developers think they need to wrap almost everything outside the&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;world into a&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;module ?&lt;br /&gt;
&lt;br /&gt;
You will find for almost any&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;plugin an&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;module. But what is the benefit of using these modules ?&lt;br /&gt;
&lt;br /&gt;
Beside a few exceptions&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;-modules-wrapping-&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;plugins basically consist of boilerplate code *doing nothing* but blowing up your web app size.&lt;br /&gt;
&lt;br /&gt;
Same for events not natively supported by&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;- why should you use a special directive for those events when they are bascially all the same - just plain events ?&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;What makes&amp;nbsp;&lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;so different ?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;follows the &lt;a href=&quot;https://en.wikipedia.org/wiki/KISS_principle&quot; target=&quot;_blank&quot;&gt;KISS&lt;/a&gt;&amp;nbsp;design principle which means basically&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span style=&quot;background-color: white; color: #252525; font-family: sans-serif; line-height: 22.3999996185303px;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Keep it simple, stupid.&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;doesnt know about the&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;plugin you want to use - and that&#39;s actually not needed. Every&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;plugin is registered by&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;at &lt;a href=&quot;http://stackoverflow.com/questions/4083351/what-does-jquery-fn-mean&quot; target=&quot;_blank&quot;&gt;jQuery.fn&lt;/a&gt;. So&amp;nbsp;&lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;can instatiate them at DOM elements.&lt;br /&gt;
&lt;br /&gt;
Thats the only thing that &lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;directive &lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;ng-jquery-plugin&lt;/span&gt; does - it takes a configuration object which tells the directive which plugin (and options) to attach to the DOM element.&lt;br /&gt;
&lt;br /&gt;
Same for events.&lt;br /&gt;
&lt;br /&gt;
Do you use a WebComponent or&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;plugin triggering custom events ?&lt;br /&gt;
&lt;br /&gt;
Take &lt;a href=&quot;http://getbootstrap.com/&quot; target=&quot;_blank&quot;&gt;Twitter Bootstrap&lt;/a&gt;&amp;nbsp;for example. This library contains a bunch of&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;plugins. All of them trigger custom events (namespaced events to be exact) which cannot be catched in&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;by default.&lt;br /&gt;
&lt;br /&gt;
Using the &lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;ng-on&lt;/span&gt; directive of&amp;nbsp;&lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;you can consume all those events by simply providing a configuration object to &lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;ng-on&lt;/span&gt; telling it which events should be consumed by what event handler (and there&#39;s more, see&amp;nbsp;&lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;for more details). &lt;br /&gt;
&lt;br /&gt;
So the only thing to know is your used&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;plugins and the 2 dead simple directives of&amp;nbsp;&lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;. Less code, less bugs, better productivity.&lt;br /&gt;
&lt;br /&gt;
Simple, is&#39;nt it ?&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Enough of that - Examples, please !&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
The &lt;a href=&quot;http://jsfiddle.net/lgersman/swkdLrjq/&quot; target=&quot;_blank&quot;&gt;pragmatic-angular module example utilizing jQuery UI sortable&lt;/a&gt; example uses&amp;nbsp;&lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;directive&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ng-jquery-plugin&amp;nbsp;&lt;/span&gt;to configure an UL element ot sortable and listens to its custom events using directive&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ng-on&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot; height=&quot;300&quot; src=&quot;http://jsfiddle.net/lgersman/swkdLrjq/embedded/&quot; width=&quot;100%&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://jsfiddle.net/lgersman/p8ag7pLn/&quot; target=&quot;_blank&quot;&gt;pragmatic-angular module example utilizing Bootstrap Modal and Popover&lt;/a&gt;&amp;nbsp;demonstrates how to use &lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;directive&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ng-jquery-plugin&amp;nbsp;&lt;/span&gt;to configure a&amp;nbsp;&lt;a href=&quot;http://getbootstrap.com/&quot; target=&quot;_blank&quot;&gt;Twitter Bootstrap&lt;/a&gt;&amp;nbsp; Modal dialog and a&amp;nbsp;&lt;a href=&quot;http://getbootstrap.com/&quot; target=&quot;_blank&quot;&gt;Twitter Bootstrap&lt;/a&gt;&amp;nbsp;popover. It demoes also the consume of custom events of these&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;plugins.&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot; height=&quot;400&quot; src=&quot;http://jsfiddle.net/lgersman/p8ag7pLn/embedded/&quot; width=&quot;100%&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
See&amp;nbsp;&lt;a href=&quot;https://github.com/lgersman/pragmatic-angular&quot; target=&quot;_blank&quot;&gt;pragmatic-angular&lt;/a&gt;&amp;nbsp;for more details.</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/7858821639815179627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2014/09/angular-pragmatic-24-loc-angularjs.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/7858821639815179627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/7858821639815179627'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2014/09/angular-pragmatic-24-loc-angularjs.html' title='angular-pragmatic - a 24 loc AngularJS module for using ANY jquery plugin and consume ANY native/custom event in AngularJS'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-1957072950983242465</id><published>2014-07-01T22:18:00.000+02:00</published><updated>2014-07-01T22:18:03.348+02:00</updated><title type='text'>Ecmascipt 6 slides of enterJS 2014 conference</title><content type='html'>If you are tracking progress of the next Javascript version (Ecmascript 6) then you should consider reading the slides of the talk I gave at the &lt;a href=&quot;htp://enterjs.de&quot; target=&quot;_blank&quot;&gt;enterJS 2014 conference&lt;/a&gt;&amp;nbsp;:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://speakerdeck.com/lgersman/enterjs-2014-ecmascript-6-the-future-is-now&quot; target=&quot;_blank&quot;&gt;Ecmascript 6 &amp;nbsp;- the future is know&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
There exists also an alternative version collecting almost everything new in Ecmascript 6 : &lt;a href=&quot;https://speakerdeck.com/lgersman/enterjs-2014-ecmascript-6-the-whole-thruth&quot; target=&quot;_blank&quot;&gt;Ecmascript 6 &amp;nbsp;- the whole truth&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Have fun reading !</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/1957072950983242465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2014/07/ecmascipt-6-slides-of-enterjs-2014.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1957072950983242465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1957072950983242465'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2014/07/ecmascipt-6-slides-of-enterjs-2014.html' title='Ecmascipt 6 slides of enterJS 2014 conference'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-5715016215101825206</id><published>2014-06-03T14:25:00.002+02:00</published><updated>2014-06-03T15:49:27.898+02:00</updated><title type='text'>ES6 : Super minimalistic example how to execute async calls like ajax sequential using generator / yield </title><content type='html'>While working on the slides for my ES6 presentation (Ecmascript 6, the next Javascript standard) at the upcoming&amp;nbsp;&lt;a href=&quot;http://www.enterjs.de/&quot; target=&quot;_blank&quot;&gt;enterJS 2014&lt;/a&gt;&amp;nbsp;conference in June 2014 I wrote a super minimalistic example showing how to execute asynchronous tasks as a synchronous sequence using &lt;a href=&quot;http://wiki.ecmascript.org/doku.php?id=harmony:generators&quot; target=&quot;_blank&quot;&gt;ES6 generators and yield&lt;/a&gt;&amp;nbsp;(puhhh, what a really long german flavored sentence:-)&amp;nbsp;:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;function run( gen) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; var iter = gen( msg =&amp;gt; iter.next( msg));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; iter.next();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;run(function* (resume) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; console.log(&quot;before&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; console.log(yield setTimeout(() =&amp;gt; resume( &quot;hello&quot;), 1000));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; console.log(yield setTimeout(() =&amp;gt; resume( &quot;world&quot;), 1000));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; console.log(&quot;after&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;});&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
If you are not familiar with ES6 you can read more at &lt;a href=&quot;https://developer.mozilla.org/en/docs/Web/JavaScript/ECMAScript_6_support_in_Mozilla&quot; target=&quot;_blank&quot;&gt;Mozilla Developer Network&lt;/a&gt;&amp;nbsp;or even at &lt;a href=&quot;https://github.com/google/traceur-compiler/wiki/LanguageFeatures&quot; target=&quot;_blank&quot;&gt;Traceur Language Features&lt;/a&gt;.&amp;nbsp;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
The important thing on ES6 is that - despite of todays &lt;a href=&quot;http://kangax.github.io/compat-table/es6/&quot; target=&quot;_blank&quot;&gt;missing browser compatiblity with ES6&lt;/a&gt; - you can use it already using&amp;nbsp;&lt;a href=&quot;https://github.com/google/traceur-compiler/wiki/LanguageFeatures&quot; target=&quot;_blank&quot;&gt;Google Traceur&lt;/a&gt;.&amp;nbsp;&lt;a href=&quot;https://github.com/google/traceur-compiler/wiki/LanguageFeatures&quot; target=&quot;_blank&quot;&gt;Traceur&lt;/a&gt;&amp;nbsp;transpiles ES6 down to ES5 which is already implemented by almost any important browser.&lt;/blockquote&gt;
&lt;div&gt;
What does the snippet in detail ? At first there are 2 asynchronous calls to &lt;a href=&quot;https://developer.mozilla.org/en/docs/Web/API/window.setTimeout&quot; target=&quot;_blank&quot;&gt;window.setTimeout &lt;/a&gt;triggering a timeout which executes a callback function after 1 second. You can even use Ajax calls in place of the timeouts - I took timeouts to keep the example as simple as possible.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
When you execute the example the output will be&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; color: #666666; font-family: monospace; padding: 2px 0px;&quot;&gt;
before&lt;/div&gt;
&lt;div style=&quot;border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; color: #666666; font-family: monospace; padding: 2px 0px;&quot;&gt;
hello&lt;/div&gt;
&lt;div style=&quot;border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; color: #666666; font-family: monospace; padding: 2px 0px;&quot;&gt;
world&lt;/div&gt;
&lt;div style=&quot;border-bottom-color: rgb(238, 238, 238); border-bottom-style: solid; border-bottom-width: 1px; color: #666666; font-family: monospace; padding: 2px 0px;&quot;&gt;
after&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
no matter how you change the timeout delay. And that&#39;s exactly what we want ! &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So how does it work ?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In function&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;run()&lt;/span&gt;&amp;nbsp;we create an &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol&quot; target=&quot;_blank&quot;&gt;ES6 Iterator&lt;/a&gt;&amp;nbsp;and call its&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;next()&lt;/span&gt;&amp;nbsp;function the first time. This enforces the Iterator to be started intially.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
At this point, our code is executed until the first&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;yield&lt;/span&gt;&amp;nbsp;statement. Because&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;run&lt;/span&gt;&#39;s argument&amp;nbsp;is an ES6 generator function (marked by the asterisk&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;*&lt;/span&gt;&amp;nbsp;after the&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;function&lt;/span&gt;&amp;nbsp;keyword) the execution of the function execution is paused here until the next value of the Generator Iterator is available. The Iterator gets a new value when the&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;resume&amp;nbsp;&lt;/span&gt;callback was called (by applying&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;iter.next( msg)&lt;/span&gt;).&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If the Iterator was resumed the JS engine will continue until the next&amp;nbsp;&lt;span style=&quot;color: #3d85c6; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;yield&lt;/span&gt; statement. Next yield statement follows the same procedure as before.&lt;br /&gt;
&lt;br /&gt;
The pattern used here can be easily adapted to enforce sequential execution of asynchronous functions in any js code (if ES6 is not the limit :-).&lt;br /&gt;
&lt;br /&gt;
You can try out the example by simply copy&#39;n paste it to &lt;a href=&quot;http://www.es6fiddle.net/&quot; target=&quot;_blank&quot;&gt;es6fiddle&lt;/a&gt;&amp;nbsp;and hit &quot;Run&quot;.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/5715016215101825206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2014/06/es6-super-minimalistic-example-how-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/5715016215101825206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/5715016215101825206'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2014/06/es6-super-minimalistic-example-how-to.html' title='ES6 : Super minimalistic example how to execute async calls like ajax sequential using generator / yield '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-3397527559458479484</id><published>2014-03-11T08:21:00.000+01:00</published><updated>2014-03-11T08:23:15.424+01:00</updated><title type='text'>Dev Links for 2014-03-11</title><content type='html'>&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://blog.ponyfoo.com/2014/02/19/angle-brackets-synergistic-directives&quot; target=&quot;_blank&quot;&gt;http://blog.ponyfoo.com/2014/02/19/angle-brackets-synergistic-directives&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;One of the best AngularJS articles i&#39;ve ever read. (Remark : Blog is sometimes not reacheable because of bandwith limits).&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;https://www.blogger.com/goog_1208723796&quot;&gt;
&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;http://complexitymaze.com/2014/03/03/javascript-promises-a-comparison-of-libraries/&quot; target=&quot;_blank&quot;&gt;http://complexitymaze.com/2014/03/03/javascript-promises-a-comparison-of-libraries/&lt;/a&gt;&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
A comparison of available Promise implementations in speed, size and functionality. If you are unsure which one to choose for your next project - this might be the source to know !&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/zynga/style&quot; target=&quot;_blank&quot;&gt;https://github.com/zynga/style&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A nice micro library for creating inline styles programmatically by providing the style as JSON object.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;https://www.blogger.com/goog_1208723806&quot;&gt;
&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;http://davidwalsh.name/&quot; target=&quot;_blank&quot;&gt;http://davidwalsh.name/&lt;/a&gt;&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
I always enjoy reading David&#39;s Blog. He discusses various thing from CSS3 to Javascript techniques. Very entertaining.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://git-scm.com/book/en/Git-Internals-Git-Objects&quot; target=&quot;_blank&quot;&gt;http://git-scm.com/book/en/Git-Internals-Git-Objects&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
If you are consider using &lt;a href=&quot;http://git-scm.com/&quot;&gt;GIT&lt;/a&gt; as a datastore for your application data (like me :-), this link might be useful for you.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/danielstjules/pattern-emitter/&quot; target=&quot;_blank&quot;&gt;https://github.com/danielstjules/pattern-emitter/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
Event emitters with support for regular expressions. Nice.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://caspervonb.github.io/2014/03/05/ecmascript6-features-and-tools.html&quot; target=&quot;_blank&quot;&gt;http://caspervonb.github.io/2014/03/05/ecmascript6-features-and-tools.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;a href=&quot;http://caspervonb.github.io/&quot;&gt;Casper Beyer&lt;/a&gt; explains many Ecmascript 6 in this article. What I really not knew was the difference between the current usage options : &lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;What we can do however is &lt;a href=&quot;http://en.wikipedia.org/wiki/Source-to-source_compiler&quot;&gt;transpile&lt;/a&gt; our source code to run in ES5 compatible browsers. Google has a project called &lt;a href=&quot;https://github.com/google/traceur-compiler&quot;&gt;Traceur&lt;/a&gt; which has been around since 2011, in the early days it was experimentation with possible future syntax, now that future syntax is here and going forward it looks like they are focusing on getting together an ES6 compatible transpiler.&lt;br /&gt;&lt;br /&gt;There is also &lt;a href=&quot;https://github.com/termi/es6-transpiler&quot;&gt;es6-transpiler&lt;/a&gt; which tries to have cleaner output than Traceur, primarily Traceur has a runtime library, es6-transpiler does not.&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;https://www.blogger.com/goog_1208723826&quot;&gt;
&lt;/a&gt;
&lt;li&gt;&lt;a href=&quot;http://lorenzoplanas.com/blog/20140302-headless-javascript-testing-with-jasmine-20&quot; target=&quot;_blank&quot;&gt;http://lorenzoplanas.com/blog/20140302-headless-javascript-testing-with-jasmine-20&lt;/a&gt;&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;As a AngularJS user I always use Jasmine for testing. If you plan to move to Jasmine  2.0  (which should be on your todo list, especially because Jasmine 2.0 hast async test support builtin :-) - this is worth reading.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 25.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Verdana, sans-serif; font-size: 15px; line-height: 25.5px;&quot;&gt;Happy coding !&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/3397527559458479484/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2014/03/dev-links-for-2014-03-11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/3397527559458479484'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/3397527559458479484'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2014/03/dev-links-for-2014-03-11.html' title='Dev Links for 2014-03-11'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-1612958816365629586</id><published>2014-03-07T09:44:00.000+01:00</published><updated>2014-03-11T07:11:05.792+01:00</updated><title type='text'>Dev Links for 2014-03-06</title><content type='html'>&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://daneden.github.io/animate.css/&quot; target=&quot;_blank&quot;&gt;http://daneden.github.io/animate.css/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A cross-browser library of CSS animations. As easy to use as an easy thing. Additionally&amp;nbsp;&lt;a href=&quot;http://odetocode.com/blogs/scott/archive/2014/02/25/easy-animations-for-angularjs-with-animate-css.aspx&quot; target=&quot;_blank&quot;&gt;Easy Animations For AngularJS With Animate.css&lt;/a&gt;&amp;nbsp;might be interesting for the &lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;Angularians&lt;/a&gt; of us.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://demo.agektmr.com/flexbox/&quot; target=&quot;_blank&quot;&gt;http://demo.agektmr.com/flexbox/&lt;/a&gt;&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
CSS Flexbox Please! is a time saving CSS3 flexbox playground.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://denisonluz.com/blog/index.php/2013/10/13/angularjs-understanding-watchcollection/&quot; target=&quot;_blank&quot;&gt;http://denisonluz.com/blog/index.php/2013/10/13/angularjs-understanding-watchcollection/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;AngularJS: How to use $watchCollection&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://nathanleclaire.com/blog/2013/12/13/how-to-unit-test-controllers-in-angularjs-without-setting-your-hair-on-fire/&quot; target=&quot;_blank&quot;&gt;http://nathanleclaire.com/blog/2013/12/13/how-to-unit-test-controllers-in-angularjs-without-setting-your-hair-on-fire/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;How to Unit Test Controllers In AngularJS Without Setting Your Hair On Fire&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://www.regexper.com/&quot; target=&quot;_blank&quot;&gt;http://www.regexper.com/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;A really handy tool to visualize Javascript regular expressions&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.cssreflex.com/css-generators/box-shadow/&quot; style=&quot;font-family: Verdana, sans-serif;&quot; target=&quot;_blank&quot;&gt;CSS3 Box Shadow Generator&lt;/a&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.cssreflex.com/css-generators/text-shadow/&quot; style=&quot;font-family: Verdana, sans-serif;&quot; target=&quot;_blank&quot;&gt;CSS3 Text Shadow Generator&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;2 helpful CSS3 generators&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://browsersync.io/&quot; target=&quot;_blank&quot;&gt;http://browsersync.io/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Time-saving synchronised browser testing. If you are in the need of cross browser testing this is the tool of your choice.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Wait, there is more - todays TOP PICKS &amp;nbsp;!&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;https://github.com/sindresorhus/multiline&quot; target=&quot;_blank&quot;&gt;https://github.com/sindresorhus/multiline&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Multiline strings in JavaScript - a neat impressive trick !!&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/&quot; target=&quot;_blank&quot;&gt;http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Vertical align anything with just 3 lines of CSS. Many of us know that technically but most of us probably don&#39;t use it for real.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Happy coding, guys !!&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/1612958816365629586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2014/03/dev-links-for-2014-02-06.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1612958816365629586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1612958816365629586'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2014/03/dev-links-for-2014-02-06.html' title='Dev Links for 2014-03-06'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-6110341499118337249</id><published>2014-03-05T15:23:00.001+01:00</published><updated>2014-03-05T15:23:12.121+01:00</updated><title type='text'>Download Github Atom editor without invitation</title><content type='html'>As read &lt;a href=&quot;https://news.ycombinator.com/item?id=7328592&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt; you can download the &lt;a href=&quot;https://atom.io/&quot; target=&quot;_blank&quot;&gt;Github Atom editor&lt;/a&gt; using&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;curl -L https://www.atom.io/api/updates/download -A &quot;Atom/0.1 CFNetwork/1.5&quot; &amp;gt; Atom.zip&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Unfortunately it seems the beta is only made for OS X ...&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;open Atom.zip&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;mv Atom.app /Applications/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Courier New, Courier, monospace;&quot;&gt;rm -rf Atom.zip&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
That&#39;s it !</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/6110341499118337249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2014/03/download-github-atom-editor-without.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/6110341499118337249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/6110341499118337249'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2014/03/download-github-atom-editor-without.html' title='Download Github Atom editor without invitation'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-8824622961969080092</id><published>2014-02-06T15:36:00.000+01:00</published><updated>2014-02-06T15:39:21.596+01:00</updated><title type='text'>Amperator - a graphical editor preview for Orangevolt Ampere</title><content type='html'>&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;I&#39;ve just uploaded an ampere update containing the first technical 
preview of the graphical ampere editor. the preview is based on &lt;a href=&quot;http://d3js.org/&quot; target=&quot;_blank&quot;&gt;d3js&lt;/a&gt; and
&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt; AngularJS&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Although it&#39;s not-yet-ready, you can have a look at :&lt;br /&gt;&lt;a class=&quot;ot-anchor aaTEdf&quot; href=&quot;http://ampere.eu01.aws.af.cm/public/examples/d3/selection12.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://ampere.eu01.aws.af.cm/public/examples/d3/selection12.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I will complete the editor when starting with official Ampere 2.0 development.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOiksB4ztCG3aUHaVZy43-jIc9_EgFcONT1sBRLWkDTuN955qNm6zFMPmyWGJUjfEWIuKegW9lRI4Y2aPhGsrcfikZioNlGTA0qvIrhbNhCdqwN4EhrFXd446UxKNATpr04n3bCKl911s/s1600/Screenshot+from+2014-02-06+08:50:09.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOiksB4ztCG3aUHaVZy43-jIc9_EgFcONT1sBRLWkDTuN955qNm6zFMPmyWGJUjfEWIuKegW9lRI4Y2aPhGsrcfikZioNlGTA0qvIrhbNhCdqwN4EhrFXd446UxKNATpr04n3bCKl911s/s1600/Screenshot+from+2014-02-06+08:50:09.png&quot; height=&quot;353&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;OUCH! - did I say that before ???&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;Ampere
 2.0 is feature complete (in terms of planning) and ready for 
implementation. A few parts are already coded but there is a lot more to
 do.&lt;br /&gt;&lt;br /&gt;Major Ampere 2.0 &amp;nbsp;features:&lt;br /&gt;&lt;br /&gt;* ES5 is the minimum Javascript standard your browser must support (at least using a shim :-)&lt;br /&gt;* we try to use ES6 as much as we can (using shims for ES6 Promise and so on)&lt;br /&gt;&lt;br /&gt;* based on&lt;br /&gt;** AngularJS 1.2,&lt;br /&gt;** Bootstrap 3.* + Font Awesome&lt;br /&gt;** a lot css3 theming sugar based on &lt;a class=&quot;ot-anchor aaTEdf&quot; href=&quot;http://tympanus.net/codrops/category/playground/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://tympanus.net/codrops/category/playground/&lt;/a&gt;&lt;br /&gt;** orangevolt-docp for website generation (&lt;a class=&quot;ot-anchor aaTEdf&quot; href=&quot;https://github.com/lgersman/orangevolt-docp&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;https://github.com/lgersman/orangevolt-docp&lt;/a&gt; ... code is not yet uploaded)&lt;br /&gt;** Jasmine 2.* for tests&lt;br /&gt;** as less dependencies to jQuery as we can &amp;nbsp;(&lt;a class=&quot;ot-anchor aaTEdf&quot; href=&quot;http://orangevolt.blogspot.de/2013/12/superspeed-your-javascript-apps.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://orangevolt.blogspot.de/2013/12/superspeed-your-javascript-apps.html&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;* a graphical editor&lt;br /&gt;* we will provide &lt;b&gt;a lot more&lt;/b&gt; documentation&lt;br /&gt;&lt;br /&gt;Happy coding !!&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Link to original article :&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;a href=&quot;https://plus.google.com/u/0/b/115194500003117065773/115194500003117065773/posts/5t4UwV4dpBR&quot; target=&quot;_blank&quot;&gt;https://plus.google.com/u/0/b/115194500003117065773/115194500003117065773/posts/5t4UwV4dpBR&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/8824622961969080092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2014/02/ive-just-uploaded-ampere-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/8824622961969080092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/8824622961969080092'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2014/02/ive-just-uploaded-ampere-update.html' title='Amperator - a graphical editor preview for Orangevolt Ampere'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOiksB4ztCG3aUHaVZy43-jIc9_EgFcONT1sBRLWkDTuN955qNm6zFMPmyWGJUjfEWIuKegW9lRI4Y2aPhGsrcfikZioNlGTA0qvIrhbNhCdqwN4EhrFXd446UxKNATpr04n3bCKl911s/s72-c/Screenshot+from+2014-02-06+08:50:09.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-5210216549132009740</id><published>2013-12-15T19:24:00.001+01:00</published><updated>2013-12-15T19:38:09.846+01:00</updated><title type='text'>Superspeed your javascript apps</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;After the success of my&amp;nbsp;&lt;a href=&quot;http://orangevolt.blogspot.com/2013/08/superspeed-your-angularjs-apps.html&quot;&gt;Superspeed your angularjs apps&lt;/a&gt;&amp;nbsp;article it&#39;s time to write a follow up to a more general issue : Javascript page speed.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Many developers know about the &lt;i&gt;min &lt;/i&gt;and &lt;i&gt;debug&lt;/i&gt; versions of their favorite javascript libraries and when to use which one.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;But let&#39;s get a step further :&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;When finished reading this article you might realize that you don&#39;t even need&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;anymore.&lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
Bum&amp;nbsp;- I&#39;m sure you completely disagree ... right know. Read on and your opinion might probably switch ...&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;While developing&amp;nbsp;&lt;a href=&quot;http://lgersman.github.io/jquery.orangevolt-ampere/&quot; target=&quot;_blank&quot;&gt;Orangevolt Ampere&lt;/a&gt;&amp;nbsp;I realized that I use&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;ALMOST EVERYWHERE AND FOR ALMOST EVERYTHING.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If your web application is not required to work in REALLY OLD browsers like IE6/7/8 then you probably skip using&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;&amp;nbsp;and should consider using what&#39;s already built in&amp;nbsp;most modern browsers:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Have a look at the&amp;nbsp;&lt;a href=&quot;http://kangax.github.io/es5-compat-table/&quot; target=&quot;_blank&quot;&gt;ECMAScript 5 compatibility table&lt;/a&gt;&amp;nbsp;if your browser requirement is matching. If so you can dive into a whole world of Javascript API&#39;s provided by your browser. You will never use&amp;nbsp;&lt;a href=&quot;http://api.jquery.com/jQuery.grep/&quot; target=&quot;_blank&quot;&gt;jQuery.grep&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href=&quot;http://api.jquery.com/jQuery.each/&quot; target=&quot;_blank&quot;&gt;jQuery.each&lt;/a&gt;&amp;nbsp;because your browser can do that natively ! Same for&amp;nbsp;&lt;a href=&quot;http://api.jquery.com/jQuery.trim/&quot; target=&quot;_blank&quot;&gt;jQuery.trim&lt;/a&gt;. All the &lt;a href=&quot;http://kangax.github.io/es5-compat-table/&quot; target=&quot;_blank&quot;&gt;ES5&lt;/a&gt; Array methods will make your life easier (see&amp;nbsp;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/what-they-didnt-tell-you-about-es5s-array-extras/&quot; target=&quot;_blank&quot;&gt;What They Didn’t Tell You About ES5′s Array Extras&lt;/a&gt;&amp;nbsp;for additional stuff). If your browser doesn&#39;t support&amp;nbsp;&lt;a href=&quot;http://kangax.github.io/es5-compat-table/&quot; target=&quot;_blank&quot;&gt;ECMAScript 5&lt;/a&gt;&amp;nbsp;at all - no problem : You can make&#39;em&amp;nbsp;&lt;a href=&quot;http://kangax.github.io/es5-compat-table/&quot; target=&quot;_blank&quot;&gt;ES 5&lt;/a&gt;&amp;nbsp;compatible using the&amp;nbsp;&lt;a href=&quot;http://es5-shim/&quot; target=&quot;_blank&quot;&gt;es5-shim&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;use &lt;a href=&quot;http://slides.html5rocks.com/&quot; target=&quot;_blank&quot;&gt;HTML5 features&lt;/a&gt;&amp;nbsp;(placeholder attribute, Validation API, Drag&#39;n Drop !!) instead of&amp;nbsp;&lt;a href=&quot;http://jqueryui.com/&quot; target=&quot;_blank&quot;&gt;jQuery UI&lt;/a&gt;&amp;nbsp;and dozens of&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;plugins. You won&#39;t believe what your browser supports natively.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;One of the best parts of&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;- it&#39;s excellent &lt;a href=&quot;http://sizzlejs.com/&quot; target=&quot;_blank&quot;&gt;CSS selector engine&lt;/a&gt; - is also 99% not needed : because most browsers have &lt;a href=&quot;http://www.javascriptkit.com/dhtmltutors/css_selectors_api.shtml&quot; target=&quot;_blank&quot;&gt;css selector support for Javascript built in&lt;/a&gt;&amp;nbsp;!&amp;nbsp;By the way : CSS&amp;nbsp;selectors are not always the fastest solution. Optimize access by using&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;&lt;ul&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/document.activeElement&quot; target=&quot;_blank&quot;&gt;document.activeElement&lt;/a&gt; for current focused element (see &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/document.activeElement?redirectlocale=en-US&amp;amp;redirectslug=DOM%2Fdocument.activeElement#Browser_compatibility&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;MDN docs for&amp;nbsp;&lt;/span&gt;document.activeElement&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/document.getElementById&quot; target=&quot;_blank&quot;&gt;document.getElementById&lt;/a&gt; for element by ID is always faster than&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;(&#39;#id&#39;) and even&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/document.querySelector&quot; target=&quot;_blank&quot;&gt; document.querySelector( &#39;id&#39;)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;access forms directly using document.forms (elem1 =&amp;nbsp;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/document.forms&quot; target=&quot;_blank&quot;&gt;document.forms&lt;/a&gt;[0]; or&amp;nbsp;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/document.forms&quot; target=&quot;_blank&quot;&gt;document.forms&lt;/a&gt;&amp;nbsp;&quot;myForm&quot;];). similarly you can access form elements using &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement.elements&quot; target=&quot;_blank&quot;&gt;form.elements&lt;/a&gt;[0] or&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement.elements&quot; target=&quot;_blank&quot;&gt;form.elements&lt;/a&gt;.myelement &lt;i&gt;(this is interesting : myelement can be either id or name attribute !&lt;/i&gt;)&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Next thing are the amazing&amp;nbsp;&lt;a href=&quot;http://api.jquery.com/category/deferred-object/&quot; target=&quot;_blank&quot;&gt;jQuery.Deferred API&lt;/a&gt;&amp;nbsp;: If you can&#39;t live without that -&lt;a href=&quot;http://microjs.com/&quot; target=&quot;_blank&quot;&gt; consider using a micro library&lt;/a&gt; for your special *&lt;b&gt;can&#39;t-live-without-that*&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;feature.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;
If you can&#39;t live without &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; - please review your code. I often see things like jQuery( &#39;DIV.myclass&#39;) and 3 lines below again the code (see &lt;a href=&quot;http://stackoverflow.com/questions/4700097/jquery-improving-performance-code&quot;&gt;http://stackoverflow.com/questions/4700097/jquery-improving-performance-code&lt;/a&gt;).&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Everytime you do this a new &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt; object gets created keeping the matching elements. That cost memory and may result in memory leaks if you reference the collection over the whole lifetime of the page.&lt;/div&gt;
&lt;/span&gt;&lt;div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;li&gt;Don&#39;t do &lt;a href=&quot;http://softwareas.com/cross-domain-communication-with-iframes&quot; target=&quot;_blank&quot;&gt;cross frame communication using IFRAME tunneling&lt;/a&gt; anymore - &lt;a href=&quot;http://caniuse.com/#feat=x-doc-messaging&quot; target=&quot;_blank&quot;&gt;window.postMessage&lt;/a&gt; will help you out.&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;li&gt;If you use &lt;a href=&quot;http://www.ajaxline.com/node/2088&quot; target=&quot;_blank&quot;&gt;one of the dozens of File Upload widgets&lt;/a&gt; out there - consider using &lt;a href=&quot;http://css.dzone.com/articles/working-html5s-multiple-file&quot; target=&quot;_blank&quot;&gt;HTML5 multiple file upload&lt;/a&gt;. Even &lt;a href=&quot;http://stackoverflow.com/questions/2320069/jquery-ajax-file-upload/12461652#12461652&quot; target=&quot;_blank&quot;&gt;upload progress notification&lt;/a&gt;&amp;nbsp;is built into your browser (see &lt;a href=&quot;http://www.w3.org/TR/XMLHttpRequest2/#event-handlers&quot; target=&quot;_blank&quot;&gt;W3C Spec&lt;/a&gt;&amp;nbsp;and &lt;a href=&quot;http://stackoverflow.com/questions/2320069/jquery-ajax-file-upload/12461652#12461652&quot; target=&quot;_blank&quot;&gt;usage via jQuery&lt;/a&gt;)&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;li&gt;If your javascript app is heavily based on javascript model search/manipulation, consider using &lt;a href=&quot;http://lodash.com/&quot; target=&quot;_blank&quot;&gt;lodash&lt;/a&gt; (or even &lt;a href=&quot;http://underscorejs.org/&quot; target=&quot;_blank&quot;&gt;underscore&lt;/a&gt;) - it saves you from writing the same model manipulation code again and again. Furthermore&amp;nbsp;&lt;a href=&quot;http://lodash.com/&quot; target=&quot;_blank&quot;&gt;lodash&lt;/a&gt;&amp;nbsp;can be downloaded in compiled versions optimized for different environments (for older browsers, modern browsers or even mobile browsers)&lt;/li&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;ul style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;li&gt;Especially for &lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt; users (like me :-) : You don&#39;t even need&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;for&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;- it has a small builtin library doing most of the stuff more or less equal to&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;li&gt;If you depend on tracking&amp;nbsp;&lt;a href=&quot;http://www.w3schools.com/css/css3_animations.asp&quot; target=&quot;_blank&quot;&gt;CSS3 animations&lt;/a&gt;&amp;nbsp;you can do that &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_animations&quot; target=&quot;_blank&quot;&gt;without any library using CSS animation events&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;It&#39;s a nice and heavy used feature of&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://jquery.com/&quot; style=&quot;font-family: Verdana, sans-serif;&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;to attach javascipt data to DOM elements - that&#39;s&amp;nbsp;also possible using plain Javascript and HTML ! &amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.dataset&quot; style=&quot;font-family: Verdana, sans-serif;&quot; target=&quot;_blank&quot;&gt;DOM Element dataset&lt;/a&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;feaure lets your declare data via data-* attributes and you can acces them using the&amp;nbsp;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.dataset&quot; target=&quot;_blank&quot;&gt;DOM Element dataset&lt;/a&gt;&amp;nbsp;API. To be fair,&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;can do a lot more using it&#39;s&amp;nbsp;&lt;a href=&quot;http://api.jquery.com/jQuery.data/&quot; target=&quot;_blank&quot;&gt;jQuery.data API&lt;/a&gt;&amp;nbsp;- but it has its cost :-)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;CSS class / style manipulation is probably one of the most used part&#39;s of&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;, but both&lt;a href=&quot;http://www.leebrimelow.com/native-methods-jquery/&quot; target=&quot;_blank&quot;&gt;&amp;nbsp;can be easily done without jQuery&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
After reviewing your code you &lt;i&gt;may&lt;/i&gt; realize that you can remove&amp;nbsp;&lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;from the list of requirements of your page. Not only that the built-in browser functions are mostly faster - &lt;a href=&quot;http://jquery.com/&quot; target=&quot;_blank&quot;&gt;jQuery&lt;/a&gt;&amp;nbsp;is also never needed to be load and so your page speed will improve again.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h1 class=&quot;title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #333333; display: table-cell; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 20px; font-weight: normal; margin: 0px; padding: 0px 40px 0px 0px; position: relative; text-align: center; vertical-align: middle; width: 709px;&quot;&gt;
&lt;/h1&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/5210216549132009740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/12/superspeed-your-javascript-apps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/5210216549132009740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/5210216549132009740'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/12/superspeed-your-javascript-apps.html' title='Superspeed your javascript apps'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-8871743297639807877</id><published>2013-08-20T18:33:00.003+02:00</published><updated>2013-08-21T06:38:58.156+02:00</updated><title type='text'>Superspeed your angularjs apps</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;renders HTML incredibly fast.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;But when rendering large DOM trees like containing tables with sort able columns, filtering and stuff ... it might get slower than you want ...&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;While working on&amp;nbsp;&lt;a href=&quot;http://lgersman.github.io/jquery.orangevolt-ampere/&quot; target=&quot;_blank&quot;&gt;Orangevolt Ampere&lt;/a&gt;&amp;nbsp;(which is heavily based on&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://angularjs.org/&quot; style=&quot;font-family: Verdana, sans-serif;&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;) I realized a few&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;remarkable&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;performance tricks.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The hints detailed in this article can &lt;b&gt;improve &lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;pages rendering up to 1000% and more&lt;/b&gt; - no kidding !&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Performance is actually not a&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;p&lt;/a&gt;roblem&amp;nbsp;- it&#39;s YOUR code. Let me explain you why:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If you read the excellent answer over at &lt;a href=&quot;http://stackoverflow.com/questions/9682092/databinding-in-angularjs&quot; target=&quot;_blank&quot;&gt;Stackoverflow: Databinding in angularjs&lt;/a&gt;&amp;nbsp;then you might noticed that&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;compares the last rendered data with the current datamodel whenever &lt;a href=&quot;http://docs.angularjs.org/api/ng.$rootScope.Scope&quot; target=&quot;_blank&quot;&gt;$apply&lt;/a&gt; was called to evaluate which parts of the DOM must be updated.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;That&#39;s - simply said - the whole magic behind&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;With that knowledge you may guess the answers to the following questions:&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;What happens when a INPUT element with attached &lt;a href=&quot;http://docs.angularjs.org/api/ng.directive:input&quot; target=&quot;_blank&quot;&gt;ng-model&lt;/a&gt; changes its values during user input ?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Is a &lt;a href=&quot;http://docs.angularjs.org/api/ng.directive:ngRepeat&quot; target=&quot;_blank&quot;&gt;ng-repeat&lt;/a&gt; directive and any other directive querying your model/controller data executed when the INPUT&amp;nbsp;with attached&amp;nbsp;&lt;a href=&quot;http://docs.angularjs.org/api/ng.directive:input&quot; target=&quot;_blank&quot;&gt;ng-model&lt;/a&gt;&amp;nbsp;changes its value ?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;And yes, you are right : &lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;needs to reevaluate the rendered data with the current data to evaluate whats changed and to be updated.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The example below is a very simple angular page using some common features of&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;like&amp;nbsp;&lt;a href=&quot;http://docs.angularjs.org/api/ng.directive:input&quot; target=&quot;_blank&quot;&gt;ng-model&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://docs.angularjs.org/api/ng.directive:ngRepeat&quot; target=&quot;_blank&quot;&gt;ng-repeat&lt;/a&gt;&amp;nbsp;and so on.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;iframe allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot; height=&quot;300&quot; src=&quot;http://jsfiddle.net/lgersman/ccPGM/embedded/&quot; width=&quot;100%&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The example renders a list of items and provides a form to add new items. the items gets rendered by ordering them by label or value. Nothing spectacular but common to what people do with&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;.&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Where are the bottlenecks ?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If you open the &lt;a href=&quot;http://jsfiddle.net/lgersman/ccPGM/&quot; target=&quot;_blank&quot;&gt;jsFiddle example&lt;/a&gt;&amp;nbsp;in a new browser window with opened Javascript console you will see that function getEntries() will be called 2 times. But ist just a single reference to getEntries in the template, correct ? The reason is that&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;renders the page and then checks if the rendered data was changed while rendering (Remember, your data model may change while rendering : see &lt;a href=&quot;http://docs.angularjs.org/api/ng.directive:ngInit&quot; target=&quot;_blank&quot;&gt;ng-init&lt;/a&gt;).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Whenever you type in some data in the label/value INPUT fields &lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;will again check if the rendered data was changed.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If you change the item order,&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;will again check if the rendered data was changed.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Suppose you have not just 4 items rendered but a table with - let&#39;s say, 40 rows and 4 columns - huuh, that will slow down your &amp;nbsp;web page performance ... everytime you enter something in the form the getEntries() function will called and the returned array will be sorted depending on the sort order ...&lt;/span&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The solution&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Cool down, thats no problem : We can improve&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;performance massively by using a few handy improvements.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The single point slowing down performance is the repeated call to getEntries() and the &lt;a href=&quot;http://docs.angularjs.org/api/ng.filter:orderBy&quot; target=&quot;_blank&quot;&gt;orderBy&lt;/a&gt; filter.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The solution to our problem is simple : We can cache the ordered entries !&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To not reinvent the wheel we take the exceptional excellent&amp;nbsp;&lt;a href=&quot;http://lodash.com/&quot; target=&quot;_blank&quot;&gt;lodash&lt;/a&gt;&amp;nbsp;library to help us implement caching.&amp;nbsp;&lt;a href=&quot;http://lodash.com/&quot; target=&quot;_blank&quot;&gt;lodash&lt;/a&gt;&amp;nbsp;is used to&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;order items using &lt;a href=&quot;http://lodash.com/docs#sortBy&quot;&gt;_.sortBy&lt;/a&gt; instead of the&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://docs.angularjs.org/api/ng.filter:orderBy&quot; target=&quot;_blank&quot;&gt;orderBy&lt;/a&gt;&amp;nbsp;filter&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;cache the resulting sorted item list using &lt;a href=&quot;http://lodash.com/docs#memoize&quot;&gt;_.memoize&lt;/a&gt;.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;a href=&quot;http://lodash.com/docs#memoize&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;_.memoize&lt;/a&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;returns a function calling our closure function only once (per cache key, read below about cache key) and will return the cached result of the closure call for all further calls.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The first argument of&amp;nbsp;&lt;a href=&quot;http://lodash.com/docs#memoize&quot;&gt;_.memoize&lt;/a&gt;&amp;nbsp;is our improved getEntry function. The second argument is used to tell&amp;nbsp;&lt;a href=&quot;http://lodash.com/docs#memoize&quot;&gt;_.memoize&lt;/a&gt;&amp;nbsp;the cache key to use.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So&amp;nbsp;&lt;a href=&quot;http://lodash.com/docs#memoize&quot;&gt;_.memoize&lt;/a&gt;&amp;nbsp;can be used to cache multiple results depending on the given cache key. We provide the sort order as cache key so that both items-ordered-by-label and items-ordered-by-value are cached.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;But what happens when our item list changes ? We need to clear the cached results to enforce calling our closure again.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Fortunately&amp;nbsp;&lt;a href=&quot;http://lodash.com/docs#memoize&quot;&gt;_.memoize&lt;/a&gt;&amp;nbsp;supports accessing the cached result using property &lt;i style=&quot;font-weight: bold;&quot;&gt;cache &lt;/i&gt;(see&amp;nbsp;&lt;a href=&quot;https://github.com/bestiejs/lodash/issues/330#issuecomment-22875052&quot;&gt;https://github.com/bestiejs/lodash/issues/330#issuecomment-22875052&lt;/a&gt;)&lt;i style=&quot;font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/i&gt;at the function returned by&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://lodash.com/docs#memoize&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;_.memoize&lt;/a&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;By applying a empty object to the cache property of our getEntry function (see function add)&amp;nbsp;we simply cleaned up the cache.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;iframe allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot; height=&quot;300&quot; src=&quot;http://jsfiddle.net/lgersman/FMBCS/embedded/&quot; width=&quot;100%&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://jsfiddle.net/lgersman/FMBCS/&quot; target=&quot;_blank&quot;&gt;Now open the optimized example in jsFiddle&lt;/a&gt; and have a look at the Javascript console. Our closure function is only called initially and when the entries list changed : Goal reached.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;With that simple hints in mind you can speedup almost any &lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;app !&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Last performance hint : If you use&amp;nbsp;&lt;a href=&quot;http://angularjs.org/&quot; target=&quot;_blank&quot;&gt;AngularJS&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://docs.angularjs.org/api/ng.filter:filter&quot; target=&quot;_blank&quot;&gt;filter&lt;/a&gt;&amp;nbsp;for filtering item lists using an INPUT element edited by the user, then&amp;nbsp;&lt;a href=&quot;http://orangevolt.blogspot.de/2013/08/debounced-throttled-model-updates-for.html&quot; target=&quot;_blank&quot;&gt;Debounce/Throttle AngularJS model updates&lt;/a&gt;&amp;nbsp;will make your day !&amp;nbsp;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/8871743297639807877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/08/superspeed-your-angularjs-apps.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/8871743297639807877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/8871743297639807877'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/08/superspeed-your-angularjs-apps.html' title='Superspeed your angularjs apps'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-1777232464989878137</id><published>2013-08-15T17:21:00.000+02:00</published><updated>2013-08-15T17:21:12.153+02:00</updated><title type='text'>Debounced / throttled model updates for angularjs</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;After googling around for a throttle/debounce solution of updating an angular model i hacked together a very easy solution seamlessy integrating into angularjs.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;iframe allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot; height=&quot;300&quot; src=&quot;http://jsfiddle.net/lgersman/vPsGb/3/embedded/&quot; width=&quot;100%&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Its basically a small piece of code consisting of a single angular directive named &quot;ng-ampere-debounce&quot; utilizing &lt;a href=&quot;http://benalman.com/projects/jquery-throttle-debounce-plugin/&quot;&gt;http://benalman.com/projects/jquery-throttle-debounce-plugin/&lt;/a&gt; which can be attached to any dom element. The directive reorders the attached event handlers so that it can control when to throttle events.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can use it for throttling/debouncing&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;* model angular updates &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;* angular event handler ng-[event]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;* jquery event handlers&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Have a look :&amp;nbsp;&lt;a href=&quot;http://jsfiddle.net/lgersman/vPsGb/3/&quot; target=&quot;_blank&quot;&gt;http://jsfiddle.net/lgersman/vPsGb/3/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The directive will be part of the Orangevolt Ampere framework (&lt;a href=&quot;https://github.com/lgersman/jquery.orangevolt-ampere&quot;&gt;https://github.com/lgersman/jquery.orangevolt-ampere&lt;/a&gt;). &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/1777232464989878137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/08/debounced-throttled-model-updates-for.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1777232464989878137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1777232464989878137'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/08/debounced-throttled-model-updates-for.html' title='Debounced / throttled model updates for angularjs'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-2760455280739353736</id><published>2013-06-14T14:24:00.002+02:00</published><updated>2013-06-14T14:24:45.361+02:00</updated><title type='text'>SQL : Managing items with a custom order column</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The day will come when you need to manage your relational database items with an custom order.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
Suppose you have a table with bookmarks and want to ge them reordered.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
The UI part can be managed by a web application using drag&#39;n drop. But the database part can be tricky.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
Our database schema looks liks this :&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;CREATE TABLE bookmarks (
  id serial primary key, 
  url varchar(255), 
  title varchar(255),
  position int default 0
);
&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now we add a a few test data :&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;INSERT INTO bookmarks (url, title) VALUES
  ( &#39;https://github.com/lgersman&#39;, &#39;Github page of Lars Gersmann&#39;),
  ( &#39;http://orangevol.t.blogspot.com&#39;, &#39;Orangevolt developer notebook&#39;),
  ( &#39;https://github.com/lgersman/jquery.orangevolt-ampere&#39;, &#39;Orangevolt Ampere&#39;),
  ( &#39;http://www.orangevolt.com&#39;, &#39;Orangevolt&#39;)
;&lt;/span&gt;
&lt;/pre&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If we select the data it will be returned in a database dependent order (most likely the insert order) because or position column has everywhere the same value 0 :&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;SELECT * FROM bookmarks ORDER BY position ASC;&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;ID	...     TITLE	                        POSITION
1	        Github page of Lars Gersmann	0
2	        Orangevolt developer notebook	0
3	        Orangevolt Ampere	        0
4	        Orangevolt	                0&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
If you want to force that an insert just inserted will appear as first item you insert it like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;background-color: white; color: #3d85c6;&quot;&gt;INSERT INTO bookmarks (url, title, position) VALUES
  ( &#39;http://www.github.com&#39;, &#39;Github&#39;, (SELECT MIN( position)-1 from bookmarks))
;
&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now the tricky part : How do we achieve reordering ?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;At first we need to ensure that every item has a unique position. Because we never know if new items where added in the mean time it may happen that some items may have position 0.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;We can achieve this by normalizing the position column of every item using the following sub select returning the items plus a column with a unique new position (column rn) :&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;SELECT id, -(row_number() OVER (ORDER BY POSITION DESC)) AS rn FROM bookmarks;
&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now we use this statement in the update clause to apply the new computed position column to our data :&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;UPDATE bookmarks
  SET POSITION=t.rn 
    FROM 
      (SELECT 
       id, -(row_number() OVER (ORDER BY POSITION DESC))*2 AS rn 
       FROM bookmarks
      ) t 
WHERE bookmarks.id=t.id;&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If we repeat our select query again we will see our items have the same order as before but a unique normalized position column value :&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;ID	...     TITLE	                        POSITION
1	        Github page of Lars Gersmann	-8
2	        Orangevolt developer notebook	-6
3	        Orangevolt Ampere	        -4
4	        Orangevolt	                -2&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You may ask why the hell the numbers are incremented by 2 ?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;- The answer is simple : we need space before and after every item to be able to move the dragged item to.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now we want to move item #4 to the beginning (i.e. position of item #1) :&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;UPDATE bookmarks 
  SET position = 
    (SELECT DISTINCT position from bookmarks where id=4) + (t.to-t.from)/abs(t.to-t.from) FROM 
      (SELECT 
        (SELECT DISTINCT position FROM bookmarks WHERE id=1) AS from, 
        (SELECT DISTINCT position FROM bookmarks WHERE id=4) AS to 
      ) t 
  WHERE id=1;&lt;/span&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If we do again our select to retrieve the items ordered we get&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;ID	...     TITLE	                        POSITION
&lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;4	        Orangevolt	                -9&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;1	        Github page of Lars Gersmann	-8&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;2	        Orangevolt developer notebook	-6
3	        Orangevolt Ampere	        -4
&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can move items up or down in any direction you want by just combining both normalization &amp;nbsp;statement and update statement.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Have fun,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Lars&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/2760455280739353736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/06/sql-managing-items-with-custom-order.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/2760455280739353736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/2760455280739353736'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/06/sql-managing-items-with-custom-order.html' title='SQL : Managing items with a custom order column'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-1132758712531604701</id><published>2013-04-29T15:54:00.000+02:00</published><updated>2013-04-29T15:54:15.107+02:00</updated><title type='text'>D3.js - How to create a state machine editor using b spline connectors</title><content type='html'>&lt;br /&gt;
This is the follow up to&amp;nbsp;&lt;a href=&quot;http://orangevolt.blogspot.de/2013/04/d3js-how-to-create-simple-state-machine.html&quot; target=&quot;_blank&quot;&gt;D3.js - How to create a simple state machine editor&lt;/a&gt;&amp;nbsp;where we&#39;ve learned how to select nodes within a &lt;a href=&quot;http://d3js.org/&quot; target=&quot;_blank&quot;&gt;d3.js&lt;/a&gt; context.&lt;br /&gt;
&lt;h1 class=&quot;title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #333333; display: table-cell; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 20px; font-weight: normal; margin: 0px; padding: 0px 40px 0px 0px; position: relative; text-align: center; vertical-align: middle; width: 709px;&quot;&gt;
&lt;/h1&gt;
&lt;h2 style=&quot;-webkit-font-smoothing: antialiased; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 24px; margin: 20px 0px 10px; padding: 0px; position: relative; text-rendering: optimizelegibility;&quot;&gt;
nodes&lt;/h2&gt;
&lt;ul style=&quot;font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; font-weight: normal; line-height: 22px; margin: 15px 0px; padding: 0px 0px 0px 30px;&quot;&gt;
&lt;li&gt;double click on a node to remove it&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 style=&quot;-webkit-font-smoothing: antialiased; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 24px; margin: 20px 0px 10px; padding: 0px; position: relative; text-rendering: optimizelegibility;&quot;&gt;
&lt;a class=&quot;anchor&quot; href=&quot;https://gist.github.com/lgersman/5370827#connection-lines-are-splines-&quot; name=&quot;connection-lines-are-splines-&quot; style=&quot;bottom: 0px; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; position: absolute; text-decoration: none; top: 0px;&quot;&gt;&lt;/a&gt;connection lines are splines !!&lt;/h2&gt;
&lt;ul style=&quot;font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; font-weight: normal; line-height: 22px; margin: 15px 0px; padding: 0px 0px 0px 30px;&quot;&gt;
&lt;li&gt;drawn as cardinal splines (&lt;a href=&quot;https://github.com/mbostock/d3/wiki/SVG-Shapes&quot; style=&quot;color: #4183c4; margin-top: 0px; text-decoration: none;&quot;&gt;https://github.com/mbostock/d3/wiki/SVG-Shapes&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;can be selected by single click it&lt;/li&gt;
&lt;li&gt;will be highlighted while hovering&lt;/li&gt;
&lt;li&gt;can be made curvy by adding connection points :&lt;ul style=&quot;margin: 0px; padding: 0px 0px 0px 30px;&quot;&gt;
&lt;li&gt;connection points can be added by pressing CTRL + double click somewhere on a connection line&lt;/li&gt;
&lt;li&gt;remove a connection point by pressing CTRL + double click on a existing connection point&lt;/li&gt;
&lt;li&gt;move a connection point by dragging the connection point&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;remove a connection be double click on it&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 style=&quot;-webkit-font-smoothing: antialiased; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-bottom-width: 1px; cursor: text; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 24px; margin: 20px 0px 10px; padding: 0px; position: relative; text-rendering: optimizelegibility;&quot;&gt;
&lt;a class=&quot;anchor&quot; href=&quot;https://gist.github.com/lgersman/5370827#drag-selection&quot; name=&quot;drag-selection&quot; style=&quot;bottom: 0px; color: #4183c4; cursor: pointer; display: block; left: 0px; margin-left: -30px; padding-left: 30px; position: absolute; text-decoration: none; top: 0px;&quot;&gt;&lt;/a&gt;drag selection&lt;/h2&gt;
&lt;ul style=&quot;font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; font-weight: normal; line-height: 22px; margin: 15px 0px; padding: 0px 0px 0px 30px;&quot;&gt;
&lt;li&gt;if both end nodes of a connection selected, the connection including its connection points will also be dragged&lt;/li&gt;
&lt;/ul&gt;
Please note that this examples are for illustration purposes only.&lt;br /&gt;
&lt;br /&gt;
See it live here :&amp;nbsp;&lt;a href=&quot;http://bl.ocks.org/lgersman/5370827&quot; target=&quot;_blank&quot;&gt;http://bl.ocks.org/lgersman/5370827&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
GIST :&amp;nbsp;&lt;a href=&quot;https://gist.github.com/lgersman/5370827&quot; target=&quot;_blank&quot;&gt;https://gist.github.com/lgersman/5370827&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Here is the code :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;gistLoad&quot; data-id=&quot;5370827&quot; id=&quot;gist-5370827&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Loading ....&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/1132758712531604701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/04/d3js-how-to-create-state-machine-editor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1132758712531604701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1132758712531604701'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/04/d3js-how-to-create-state-machine-editor.html' title='D3.js - How to create a state machine editor using b spline connectors'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-855161576026067488</id><published>2013-04-12T10:56:00.001+02:00</published><updated>2013-04-12T10:56:13.953+02:00</updated><title type='text'>D3.js - How to create a simple state machine editor</title><content type='html'>&lt;br /&gt;
This is the follow up to&amp;nbsp;&lt;a href=&quot;http://orangevolt.blogspot.de/2013/04/d3js-how-to-selectdrag-using-selection.html&quot; target=&quot;_blank&quot;&gt;D3.js - How to select/drag nodes using an selection frame&lt;/a&gt;&amp;nbsp;where we&#39;ve learned how to select nodes within a &lt;a href=&quot;http://d3js.org/&quot; target=&quot;_blank&quot;&gt;d3.js&lt;/a&gt; context.&lt;br /&gt;
&lt;h1 class=&quot;title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #333333; display: table-cell; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 20px; font-weight: normal; margin: 0px; padding: 0px 40px 0px 0px; position: relative; text-align: center; vertical-align: middle; width: 709px;&quot;&gt;&lt;br /&gt;
&lt;/h1&gt;This version of the continued example features the following changes:&lt;br /&gt;
&lt;ul&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;ul style=&quot;font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; line-height: 22px; margin: 15px 0px; padding: 0px 0px 0px 30px;&quot;&gt;&lt;li&gt;Double click somewhere in the&amp;nbsp;&lt;a href=&quot;http://d3js.org/&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: medium; line-height: normal;&quot; target=&quot;_blank&quot;&gt;d3.js&lt;/a&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: small; line-height: normal;&quot;&gt;&amp;nbsp;context&lt;/span&gt;&amp;nbsp;creates a new state&lt;/li&gt;
&lt;li&gt;Connect nodes. Click on the outer border of a state and drag the mouse into another state will create a connection line&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Please note that this examples are for illustration purposes only.&lt;br /&gt;
&lt;br /&gt;
See it live here :&amp;nbsp;&lt;a href=&quot;http://bl.ocks.org/lgersman/5311202&quot; target=&quot;_blank&quot;&gt;http://bl.ocks.org/lgersman/5311202&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
GIST :&amp;nbsp;&lt;a href=&quot;https://gist.github.com/lgersman/5311202&quot; target=&quot;_blank&quot;&gt;https://gist.github.com/lgersman/5311202&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Here is the code :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;gistLoad&quot; data-id=&quot;5311202&quot; id=&quot;gist-5311202&quot;&gt;&lt;/div&gt;&lt;br /&gt;
Loading ....&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/855161576026067488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/04/d3js-how-to-create-simple-state-machine.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/855161576026067488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/855161576026067488'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/04/d3js-how-to-create-simple-state-machine.html' title='D3.js - How to create a simple state machine editor'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-7264753744073832924</id><published>2013-04-08T17:07:00.000+02:00</published><updated>2013-04-08T17:08:32.350+02:00</updated><title type='text'>update d3.js data using enter/exit with complex data objects</title><content type='html'>If you use &lt;a href=&quot;http://d3js.org/&quot; target=&quot;_blank&quot;&gt;d3.js&lt;/a&gt;&amp;nbsp;and work with it&#39;s fascinating data binding using &lt;a href=&quot;https://github.com/mbostock/d3/wiki/Selections#wiki-enter&quot; target=&quot;_blank&quot;&gt;enter()/exit()&lt;/a&gt;&amp;nbsp;you may once at the stage where I was :&lt;br /&gt;
&lt;br /&gt;
When I removed items from the data array and set them new via&amp;nbsp;&lt;a href=&quot;http://d3js.org/&quot; target=&quot;_blank&quot;&gt;d3.js&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;https://github.com/mbostock/d3/wiki/Selections#wiki-data&quot; target=&quot;_blank&quot;&gt;data()&lt;/a&gt; function the wrong item was removed from the svg canvas !!&lt;br /&gt;
&lt;br /&gt;
The solution for this issue is to know the&amp;nbsp;&lt;a href=&quot;https://github.com/mbostock/d3/wiki/Selections#wiki-data&quot; target=&quot;_blank&quot;&gt;data()&lt;/a&gt;&amp;nbsp;function in detail. If you read the examples (which work all fine !) they use atomar js objects (string/integer etc) as data items.&lt;br /&gt;
&lt;br /&gt;
If you use complex js objects ({}) you should provide the &lt;a href=&quot;https://github.com/mbostock/d3/wiki/Selections#wiki-data&quot; target=&quot;_blank&quot;&gt;identity function&lt;/a&gt; as second argument.&lt;br /&gt;
&lt;br /&gt;
If not the default will be used which is index based. So if you remove an data item somewhere in your data array it will do the wrong. To fix this you simply provide this function :&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #073763;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #6aa84f; font-family: Courier New, Courier, monospace;&quot;&gt;selection.data( data, function( d) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #6aa84f; font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp;return data.indexOf( d);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #6aa84f; font-family: Courier New, Courier, monospace;&quot;&gt;});&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
and everything will be fine !!!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/7264753744073832924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/04/update-d3js-data-using-enterexit-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/7264753744073832924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/7264753744073832924'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/04/update-d3js-data-using-enterexit-with.html' title='update d3.js data using enter/exit with complex data objects'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-4002712913283222201</id><published>2013-04-08T16:42:00.000+02:00</published><updated>2013-04-08T16:43:52.463+02:00</updated><title type='text'>D3.js - How to select/drag nodes using an selection frame</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
As announced in &lt;a href=&quot;http://orangevolt.blogspot.de/2013/04/3djs-how-to-build-editor-selection-frame.html&quot;&gt;my previous post&lt;/a&gt; I will extend the &lt;a href=&quot;http://bl.ocks.org/lgersman/5310854&quot;&gt;selection frame example&lt;/a&gt; to a state machine editor.&lt;br /&gt;
&lt;br /&gt;
Here is part 2.&lt;br /&gt;
&lt;br /&gt;
The following features are added:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;circles are draggable&lt;/li&gt;
&lt;li&gt;circles can be selected (multiple selections possible by pressing CTRL while clicking a circle)&lt;/li&gt;
&lt;li&gt;the selection frame selects all circles within the frame (by pressing CTRL the selected circles will be appended to current selection)&lt;/li&gt;
&lt;li&gt;multiple selected circles will be dragged simultaneous&lt;/li&gt;
&lt;/ul&gt;Please note that this examples are for illustration purposes only.&lt;br /&gt;
&lt;br /&gt;
See it live here :&amp;nbsp;&lt;a href=&quot;http://bl.ocks.org/lgersman/5311083&quot; target=&quot;_blank&quot;&gt;http://bl.ocks.org/lgersman/5311083&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
GIST :&amp;nbsp;&lt;a href=&quot;https://gist.github.com/lgersman/5311083&quot; target=&quot;_blank&quot;&gt;https://gist.github.com/lgersman/5311083&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Here is the code :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;gistLoad&quot; data-id=&quot;5311083&quot; id=&quot;gist-5311083&quot;&gt;Loading ....&lt;/div&gt;&lt;br /&gt;
&lt;script src=&quot;https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/4002712913283222201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/04/d3js-how-to-selectdrag-using-selection.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/4002712913283222201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/4002712913283222201'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/04/d3js-how-to-selectdrag-using-selection.html' title='D3.js - How to select/drag nodes using an selection frame'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-8860915204522146780</id><published>2013-04-04T17:50:00.003+02:00</published><updated>2013-04-05T08:25:27.479+02:00</updated><title type='text'>D3.js - How to build a editor selection frame  </title><content type='html'>&amp;nbsp;Last time I am playing around with&amp;nbsp;&lt;a href=&quot;http://d3js.org/&quot;&gt;D3.js&lt;/a&gt;&amp;nbsp;for creating a state diagram editor. This will be the first issue of my lessons learned while using&amp;nbsp;&lt;a href=&quot;http://d3js.org/&quot;&gt;D3.js&lt;/a&gt;.&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-size: large;&quot;&gt;About&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://d3js.org/&quot; style=&quot;font-size: x-large;&quot;&gt;D3.js&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;http://d3js.org/&quot;&gt;D3.js&lt;/a&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Helvetica, sans-serif; line-height: 24px;&quot;&gt;&amp;nbsp;is a JavaScript library for manipulating documents based on data.&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://d3js.org/&quot;&gt;D3.js&lt;/a&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Helvetica, sans-serif; line-height: 24px;&quot;&gt;&amp;nbsp;helps you bring data to life using HTML, SVG and CSS.&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://d3js.org/&quot;&gt;D3&lt;/a&gt;&#39;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Helvetica, sans-serif; line-height: 24px;&quot;&gt;s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;How to build a editor selection frame &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
One thing i never found on the web was how to create a&amp;nbsp;wire frame&amp;nbsp;selection&amp;nbsp;rectangle to select objects.&lt;br /&gt;
&lt;br /&gt;
See it live here :&amp;nbsp;&lt;a href=&quot;http://bl.ocks.org/lgersman/5310854&quot; target=&quot;_blank&quot;&gt;http://bl.ocks.org/lgersman/5310854&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
GIST :&amp;nbsp;&lt;a href=&quot;https://gist.github.com/lgersman/5310854&quot; target=&quot;_blank&quot;&gt;https://gist.github.com/lgersman/5310854&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Here is the code :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;gistLoad&quot; data-id=&quot;5310854&quot; id=&quot;gist-5310854&quot;&gt;
Loading ....&lt;/div&gt;
&lt;br /&gt;
&lt;script src=&quot;https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/8860915204522146780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/04/3djs-how-to-build-editor-selection-frame.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/8860915204522146780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/8860915204522146780'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/04/3djs-how-to-build-editor-selection-frame.html' title='D3.js - How to build a editor selection frame  '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-5901243173315439125</id><published>2013-02-15T08:14:00.001+01:00</published><updated>2013-02-15T08:15:17.008+01:00</updated><title type='text'>Node.js/Express/Connect : How to catch &quot;Address in use&quot; exception </title><content type='html'>When you want to track programmatically if your Node.js Express http server was not started because the port is already in use you can do it the following way :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;var express = require(&#39;express&#39;), http = require(&#39;http&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;// configure your Expreess app&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;// ...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;http.createServer( app).listen( PORT, function(){&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; console.log(&quot;server listening on port &quot; + PORT);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;})&lt;br /&gt;.on( &#39;error&#39;, function (e) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; if (e.code == &#39;EADDRINUSE&#39;) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; console.log(&#39;Address in use&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; }&lt;br /&gt;});&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/5901243173315439125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/02/nodejsexpressconnect-how-to-catch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/5901243173315439125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/5901243173315439125'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/02/nodejsexpressconnect-how-to-catch.html' title='Node.js/Express/Connect : How to catch &quot;Address in use&quot; exception '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-1077920818086715247</id><published>2013-01-04T15:37:00.003+01:00</published><updated>2013-01-04T15:46:31.596+01:00</updated><title type='text'>Checkinstall : Build debian packages in seconds</title><content type='html'>While looking for an easy way to build a debian package for &lt;a href=&quot;http://node.js/&quot;&gt;node.js&lt;/a&gt;&amp;nbsp;I just stumbled across &lt;a href=&quot;http://asic-linux.com.mx/~izto/checkinstall/&quot; target=&quot;_blank&quot;&gt;Checkinstall&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://asic-linux.com.mx/~izto/checkinstall/&quot; target=&quot;_blank&quot;&gt;Checkinstall&lt;/a&gt;&amp;nbsp;makes building a Debian package out of TGZ archive a breeze !&lt;br /&gt;
And not only that - it supports several other target package formats like RPM too.&lt;br /&gt;
&lt;br /&gt;
Here is the receipt for&amp;nbsp;&lt;a href=&quot;http://node.js/&quot;&gt;node.js&lt;/a&gt;&amp;nbsp;as an example :&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Install build prerequisites if not yet installed&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;aptitude install git-core curl build-essential openssl libssl-dev python pkg-config checkinstall&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Fetch the latest&amp;nbsp;&lt;a href=&quot;http://node.js/&quot;&gt;node.js&lt;/a&gt;&amp;nbsp;source archive&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;wget -N http://nodejs.org/dist/node-latest.tar.gz&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Extract the archive&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;tar -xzf node-latest.tar.gz -C .&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;In order to get&amp;nbsp;&lt;a href=&quot;http://asic-linux.com.mx/~izto/checkinstall/&quot; target=&quot;_blank&quot;&gt;Checkinstall&lt;/a&gt;&amp;nbsp;working fine you need to rename the untarred&amp;nbsp;&lt;a href=&quot;http://node.js/&quot;&gt;node.js&lt;/a&gt;&amp;nbsp;to be [name]-[version] (depending of the node version you&#39;ve downloaded this line may differ) and go into the directory&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;mv node-v0.8.16/ node-0.8.16/ &amp;amp;&amp;amp; cd&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;node-0.8.16/&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;And now the bummer : All you have to do to get a Debian package built for&amp;nbsp;&lt;a href=&quot;http://node.js/&quot;&gt;node.js&lt;/a&gt;&amp;nbsp;is to execute&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; sudo checkinstall&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;--install=no&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;i&gt;(--install=no tells&amp;nbsp;&lt;a href=&quot;http://asic-linux.com.mx/~izto/checkinstall/&quot; target=&quot;_blank&quot;&gt;Checkinstall&lt;/a&gt;&amp;nbsp;to just create the debian archive without installing it. Without this option the created debian package will be immediately installed)&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://asic-linux.com.mx/~izto/checkinstall/&quot; target=&quot;_blank&quot;&gt;Checkinstall&lt;/a&gt;&amp;nbsp;will ask you a few questions about package maintainer and stuff and after all you will get a debian package&amp;nbsp;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;node_0.8.16-1_i386.deb&lt;/b&gt;&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
The only thing left is to install the package by executing :&lt;br /&gt;
&lt;br /&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;dpkg -i node_0.8.16-1_i386.deb&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Was that easy ??&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;OH Y.E.S. !&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
PS: You should use this mechanism for packages of your development system but never for production systems because the package was never fully tested for this configuration ... Anyway, for fast forward development it&#39;s a perfect tool !!&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/1077920818086715247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/01/checkinstall-build-debian-packages-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1077920818086715247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/1077920818086715247'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/01/checkinstall-build-debian-packages-in.html' title='Checkinstall : Build debian packages in seconds'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-2598182353812005592</id><published>2013-01-04T10:46:00.002+01:00</published><updated>2013-01-04T10:46:23.054+01:00</updated><title type='text'>How to access the app instance from the request in a Nodes.js / Express module</title><content type='html'>When I started with &lt;a href=&quot;https://github.com/visionmedia/express&quot; target=&quot;_blank&quot;&gt;Express&lt;/a&gt; development I had often the problem that I need to access the &lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;app&lt;/span&gt; instance for getting configuration data.&lt;br /&gt;
&lt;br /&gt;
Today I found the simple solution I missed the last weeks : the&amp;nbsp;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;app&lt;/span&gt;&amp;nbsp;instance is always available as a property on the request object in &lt;a href=&quot;https://github.com/visionmedia/express&quot; target=&quot;_blank&quot;&gt;Express&lt;/a&gt;&amp;nbsp;!&lt;br /&gt;
&lt;br /&gt;
So you can easily access it like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;exports.list = function( req, res) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; var user_basedir = path.join( req.app.get( &#39;var&#39;), &#39;preferences/users&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; ...&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Every day serves new knowledge.</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/2598182353812005592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2013/01/how-to-access-app-instance-from-request.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/2598182353812005592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/2598182353812005592'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2013/01/how-to-access-app-instance-from-request.html' title='How to access the app instance from the request in a Nodes.js / Express module'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-3549839367557215740</id><published>2012-12-06T09:43:00.001+01:00</published><updated>2012-12-06T10:15:52.180+01:00</updated><title type='text'>8 ways to query json structures</title><content type='html'>Do you get bored by complex JSON structure traversing to find just a bunch of matching entries ?&lt;br /&gt;
&lt;br /&gt;
Here are 8 different ways to do it :&lt;br /&gt;
&lt;h2&gt;
JsonSQL&lt;/h2&gt;
JsonSQL implements SQL select statements over json structures.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;span style=&quot;background-color: #f8f8f8; font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #f8f8f8; font-family: monospace;&quot;&gt;jsonsql.query(&quot;select * from json.channel.items order by title desc&quot;,json);&lt;/span&gt;&lt;span style=&quot;background-color: #f8f8f8; font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Homepage:&amp;nbsp;&lt;a href=&quot;http://www.trentrichardson.com/jsonsql/&quot;&gt;http://www.trentrichardson.com/jsonsql/&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
JSONPath&lt;/h2&gt;
JSONPath is like XPath for JSON structures.&lt;br /&gt;
&lt;br /&gt;
Example :&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #dddddd; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 16px;&quot;&gt;jsonPath( books, &#39;$..book[(@.length-1)]&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Homepage:&amp;nbsp;&lt;a href=&quot;http://goessner.net/articles/JsonPath/&quot;&gt;http://goessner.net/articles/JsonPath/&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
jfunk&lt;/h2&gt;
jFunk will allow you to retrieve (and soon, manipulate) objects within complex JSON or Javascript objects. The design of the jFunk API will closely parallel the jQuery API, replicating it exactly except where the differences between DOM and Javascript make replication nonsensical&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; font-family: Monaco, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Lucida Console&#39;, monospace; font-size: 12px; max-width: 70em; overflow: auto; padding: 0.5em;&quot;&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Jf&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;color: #008800;&quot;&gt;&quot;&amp;gt; vegetables &amp;gt; *[color=Orange]&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;color: #660066;&quot;&gt;Food&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;();&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Homepage:&amp;nbsp;&lt;a href=&quot;http://code.google.com/p/jfunk/&quot;&gt;http://code.google.com/p/jfunk/&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
TaffyDB&lt;/h2&gt;
How you ever noticed how JavaScript object literals look a lot like records? And that if you wrap a group of them up in an array you have something that looks a lot like a database table? TaffyDB is a libary to bring powerful database funtionality to that concept and rapidly improve the way you work with data inside of JavaScript.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: js&quot; style=&quot;background-color: whitesmoke; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Menlo, Monaco, Consolas, &#39;Courier New&#39;, monospace; font-size: 12.025px; line-height: 18px; margin-bottom: 9px; padding: 8.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;var kelly = friends({id:2}).first();&lt;/pre&gt;
&lt;br /&gt;
Homepage:&amp;nbsp;&lt;a href=&quot;http://www.taffydb.com/&quot;&gt;http://www.taffydb.com/&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
linq.js&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;color: #253340; font-family: &#39;Segoe UI&#39;, Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.016666412353516px;&quot;&gt;linq.js - LINQ for JavaScript&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #253340; font-family: &#39;Segoe UI&#39;, Tahoma, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.016666412353516px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background-color: rgb(236, 236, 236) !important; border: 0.1em dashed rgb(62, 98, 166) !important; font-family: Consolas, &#39;Courier New&#39;, Courier, monospace !important; font-size: 13px; height: auto; line-height: 19.016666412353516px; margin-bottom: 20px; outline: 0px; overflow: hidden; padding: 0.5em 0.5em 1.5em; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;background-color: transparent; border: 0px; color: blue; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;var&lt;/span&gt; queryResult2 = Enumerable.From(jsonArray)
    .Where(&lt;span style=&quot;background-color: transparent; border: 0px; color: #a31515; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;$.user.id &amp;lt; 200&quot;&lt;/span&gt;)
    .OrderBy(&lt;span style=&quot;background-color: transparent; border: 0px; color: #a31515; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;$.user.screen_name&quot;&lt;/span&gt;)
    .Select(&lt;span style=&quot;background-color: transparent; border: 0px; color: #a31515; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;$.user.screen_name + &#39;:&#39; + $.text&quot;&lt;/span&gt;)
    .ToArray();&lt;/pre&gt;
&lt;/div&gt;
Homepage:&amp;nbsp;&lt;a href=&quot;http://linqjs.codeplex.com/&quot;&gt;http://linqjs.codeplex.com/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Homepage:&amp;nbsp;&lt;a href=&quot;http://neue.cc/reference.htm&quot;&gt;http://neue.cc/reference.htm&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
objeq&lt;/h2&gt;
objeq is a simple library that allows POJSO&#39;s (Plain-Old JavaScript Objects) to be queried in real-time.&lt;br /&gt;
&lt;pre style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(204, 204, 204); color: #333333; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 13px; line-height: 19px; margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px;&quot;&gt;&lt;code style=&quot;background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;&quot;&gt;var res = $objeq(data, &quot;age &amp;gt; 40 &amp;amp;&amp;amp; gender == &#39;female&#39; -&amp;gt; name&quot;);
// --&amp;gt; Returns [&#39;Jessica&#39;]&lt;/code&gt;&lt;/pre&gt;
Homepage:&amp;nbsp;&lt;a href=&quot;https://github.com/agilosoftware/objeq&quot;&gt;https://github.com/agilosoftware/objeq&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
json:select()&lt;/h2&gt;
CSS-like selectors for JSON.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0b5394; font-family: Courier New, Courier, monospace;&quot;&gt;.lang:val(&quot;Bulgarian&quot;) ~ .level&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Homepage:&amp;nbsp;&lt;a href=&quot;http://jsonselect.org/#tryit&quot;&gt;http://jsonselect.org/#tryit&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
Javascript Array Filtering from &lt;a href=&quot;http://www.paulfree.com/28/javascript-array-filtering/#more-28&quot;&gt;Paul&#39;s Programming Pearls&lt;/a&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; a = [1,2,3,4,5,6,7,8,9,10];&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// return everything&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.where( &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;( ) =&amp;gt; true&quot;&lt;/span&gt; ) ;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; --&amp;gt; [1,2,3,4,5,6,7,8,9,10]&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// return even numbers&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.where( &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;( n, i ) =&amp;gt; n % 2 == 0&quot;&lt;/span&gt; ) ;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; --&amp;gt; [2,4,6,8,10]&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// query first 6 products whose category begins with &#39;con&#39; using extra param and regular expression&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; products.where( &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;( el, i, res, param ) =&amp;gt; res.length &amp;lt;= 6 &amp;amp;&amp;amp; param.test( el.cat )&quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;^con/i&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;// using customer table data from SQL Server&#39;s northwind database...&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; customers.where( &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;( el, i, res, param ) =&amp;gt; el.country == param&quot;&lt;/span&gt;, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;USA&quot;&lt;/span&gt; );&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;Homepage:&amp;nbsp;&lt;a href=&quot;http://www.paulfree.com/28/javascript-array-filtering/#more-28&quot;&gt;http://www.paulfree.com/28/javascript-array-filtering/#more-28&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; Javascript Array Filtering from &lt;a href=&quot;http://www.paulfree.com/28/javascript-array-filtering/#more-28&quot;&gt;Paul&#39;s Programming Pearls&lt;/a&gt; is currently my favorite - its extremely small footprint and blazing fast result speak for itself.&lt;br /&gt;&lt;br /&gt;The idea behind is similar to &lt;a href=&quot;http://ejohn.org/blog/javascript-micro-templating/&quot;&gt;John Resig&#39;s JavaScript Micro-Templating&lt;/a&gt; effort - a very simple piece of code transforming a string into a Javascript function utilizing Regexp power.&lt;br /&gt;&lt;br /&gt; Yes, sure - there are more powerful solutions in the list. &lt;a href=&quot;http://www.paulfree.com/28/javascript-array-filtering/#more-28&quot;&gt;Paul&#39;s implementation prototype&lt;/a&gt; lacks syntax checking of the filter expression but I am sure you can handle javascript syntax checking by yourself.&lt;br /&gt;&lt;br /&gt; At the end you must decide which one is best for your project.&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;!--180--&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/3549839367557215740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2012/12/8-ways-to-query-json-structures.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/3549839367557215740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/3549839367557215740'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2012/12/8-ways-to-query-json-structures.html' title='8 ways to query json structures'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-5129821243408669053</id><published>2012-10-11T10:19:00.001+02:00</published><updated>2012-10-11T10:20:20.898+02:00</updated><title type='text'>GruntJS Tips &amp; Tricks</title><content type='html'>Today I will share a few tips &amp;amp; tricks when starting with &lt;a href=&quot;http://gruntjs.com/&quot; target=&quot;_blank&quot;&gt;GruntJS&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Due to my personal history I used to use &lt;a href=&quot;http://ant.apache.org/&quot; target=&quot;_blank&quot;&gt;ANT&lt;/a&gt;&amp;nbsp;as my favorite build tool.&lt;br /&gt;
&lt;br /&gt;
In the last years my development target moved more and more to web applications - so my build needs expanded to minimize/compact CSS/LessCss and Javascript/Coffeescript sources. &lt;br /&gt;
&lt;br /&gt;
Using&amp;nbsp;&lt;a href=&quot;http://ant.apache.org/&quot; target=&quot;_blank&quot;&gt;ANT&lt;/a&gt;&amp;nbsp;you need to wrap the required tools in a ustom&amp;nbsp;&lt;a href=&quot;http://ant.apache.org/&quot; target=&quot;_blank&quot;&gt;ANT&lt;/a&gt;&amp;nbsp;task to be written in Java. Therefore I wrote my own&amp;nbsp;&lt;a href=&quot;http://ant.apache.org/&quot; target=&quot;_blank&quot;&gt;ANT&lt;/a&gt;&amp;nbsp;tasks&amp;nbsp;for&amp;nbsp;&lt;a href=&quot;http://lesscss.org/&quot;&gt;LessCss&lt;/a&gt;, &lt;a href=&quot;http://coffeescript.org/&quot;&gt;Coffeescript&lt;/a&gt;&amp;nbsp;and the&amp;nbsp;&lt;a href=&quot;https://developers.google.com/closure/compiler/&quot;&gt;Google Closure Compiler&lt;/a&gt;. Doing that requires you to utilize&amp;nbsp;&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Rhino&quot;&gt;Rhino&lt;/a&gt;&amp;nbsp;because most of these tools are written in Javascript.&lt;br /&gt;
&lt;br /&gt;
So I thought there must be an easier way to o such things - and found&amp;nbsp;&lt;a href=&quot;http://gruntjs.com/&quot; target=&quot;_blank&quot;&gt;GruntJS&lt;/a&gt;&amp;nbsp;!&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://gruntjs.com/&quot; target=&quot;_blank&quot;&gt;GruntJS&lt;/a&gt;&amp;nbsp;is a build tool based on&amp;nbsp;&lt;a href=&quot;http://nodejs.org/&quot;&gt;NodeJs&lt;/a&gt;&amp;nbsp;providing a very light interface for doing builds. For everything not available by&amp;nbsp;&lt;a href=&quot;http://gruntjs.com/&quot; target=&quot;_blank&quot;&gt;GruntJS&lt;/a&gt;&amp;nbsp;itself you can create your own tasks.&lt;br /&gt;
&lt;br /&gt;
My personal resume of working with&amp;nbsp;&lt;a href=&quot;http://gruntjs.com/&quot; target=&quot;_blank&quot;&gt;GruntJS&lt;/a&gt;&amp;nbsp;:&lt;br /&gt;
&lt;br /&gt;
Its blazing fast (thanks to&amp;nbsp;&lt;a href=&quot;http://nodejs.org/&quot;&gt;NodeJs&lt;/a&gt;), extensible and thanks to the&amp;nbsp;&lt;a href=&quot;http://gruntjs.com/&quot; target=&quot;_blank&quot;&gt;GruntJS&lt;/a&gt;&amp;nbsp;community you will find any kind of task you need. If you need a build system for anything web related (javascript/css/html) -&amp;nbsp;&lt;a href=&quot;http://gruntjs.com/&quot; target=&quot;_blank&quot;&gt;GruntJS&lt;/a&gt;&amp;nbsp;is the tool to choose !&lt;br /&gt;
&lt;br /&gt;
So here is finally my list of tips &amp;amp; tricks:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Use&amp;nbsp;&lt;a href=&quot;http://gruntjs.com/&quot; target=&quot;_blank&quot;&gt;GruntJS&lt;/a&gt;&amp;nbsp;in combination with g&lt;a href=&quot;https://github.com/gruntjs/grunt-contrib&quot;&gt;runt-contrib&lt;/a&gt;. This node module provides the missing pieces (tasks like copy, clean, compress, coffee and less) when coding build files&lt;/li&gt;
&lt;li&gt;Don&#39;t hesitate to &quot;code&quot; your tasks inside your projects grunt.js file - it&#39;s ok ! My main problem when coming from&amp;nbsp;&lt;a href=&quot;http://ant.apache.org/&quot; target=&quot;_blank&quot;&gt;ANT&lt;/a&gt;&amp;nbsp;was that I thought I &quot;should&quot; just use tasks and writing custom tasks inside the grunt.js file is &quot;evil&quot; - it&#39;s not !&lt;/li&gt;
&lt;li&gt;Inspect grunt.js files from other projects to learn how to use it !&lt;/li&gt;
&lt;li&gt;Code quality : read the &lt;a href=&quot;http://www.jshint.com/&quot;&gt;JSHint&lt;/a&gt;&amp;nbsp;page to learn the huge amount of options. I&#39;m sure you need to adjust the &lt;a href=&quot;http://www.jshint.com/&quot;&gt;JSHint&lt;/a&gt;&amp;nbsp;task options of your &lt;a href=&quot;http://gruntjs.com/&quot; target=&quot;_blank&quot;&gt;GruntJS&lt;/a&gt;&amp;nbsp;project file individuallly for your project.&lt;/li&gt;
&lt;li&gt;Know your code : When using the&amp;nbsp;&lt;a href=&quot;http://gruntjs.com/&quot; target=&quot;_blank&quot;&gt;GruntJS&lt;/a&gt;&amp;nbsp;concat&amp;nbsp;task you should be aware of the fact the&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://github.com/mishoo/UglifyJS&quot;&gt;UglifyJS&lt;/a&gt;&amp;nbsp;is used to compress your javascript sources. That means you need to tell&amp;nbsp;&lt;a href=&quot;https://github.com/mishoo/UglifyJS&quot;&gt;UglifyJS&lt;/a&gt;&amp;nbsp;what Javascript function/variable names should be kept.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Take a look at the &lt;a href=&quot;https://github.com/lgersman/jquery.orangevolt-ampere/blob/master/grunt.js&quot; target=&quot;_blank&quot;&gt;Orangevolt Ampere grunt.js&amp;nbsp;file&lt;/a&gt; to start learning !&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/5129821243408669053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2012/10/gruntjs-tips-tricks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/5129821243408669053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/5129821243408669053'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2012/10/gruntjs-tips-tricks.html' title='GruntJS Tips &amp; Tricks'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1034435163415394624.post-4691814221512752642</id><published>2012-10-11T09:47:00.000+02:00</published><updated>2012-10-11T09:48:00.188+02:00</updated><title type='text'>Solution : How to use gist / github hosted files in jsfiddle </title><content type='html'>Remember Github hosts source files - GitHub is not a CDN, DON&#39;T include files directly from them.&lt;br /&gt;
&lt;br /&gt;
There are 2 workarounds:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;copy the required files into the gh-pages branch - files hosted in this branch will be delivered with the correct mimetype.&lt;/li&gt;
&lt;li&gt;tell jsfiddle that these files come from github. in this case jsfiddle will take care of the correct mimetype translation (read your &lt;a href=&quot;http://doc.jsfiddle.net/use/gist_read.html&quot;&gt;http://doc.jsfiddle.net/use/gist_read.html&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/jsfiddle/jsfiddle-docs-alpha/issues/95#issuecomment-9331320&quot;&gt;https://github.com/jsfiddle/jsfiddle-docs-alpha/issues/95#issuecomment-9331320&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://orangevolt.blogspot.com/feeds/4691814221512752642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orangevolt.blogspot.com/2012/10/solution-how-to-use-gist-github-hosted.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/4691814221512752642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1034435163415394624/posts/default/4691814221512752642'/><link rel='alternate' type='text/html' href='http://orangevolt.blogspot.com/2012/10/solution-how-to-use-gist-github-hosted.html' title='Solution : How to use gist / github hosted files in jsfiddle '/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>