<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" gd:etag="W/&quot;C0MFQH49cCp7ImA9WhRRFEk.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348</id><updated>2011-11-28T01:50:11.068+01:00</updated><category term="Personal" /><category term="Mobile" /><category term="Social" /><category term="CSS" /><category term="HowTo" /><category term="Graphical Design" /><category term=".Net" /><category term="Actions" /><category term="AJAX" /><category term="ASP" /><category term="Tips" /><category term="WebKit" /><category term="Kinetic" /><category term="C#" /><category term="Browsers" /><category term="DOM" /><category term="Google Chrome" /><category term="RegExp" /><category term="Bindows" /><category term="IRL" /><category term="Bindows 4" /><category term="IE8" /><category term="Safari" /><category term="HTML" /><category term="Open Graph" /><category term="Rant" /><category term="iOS" /><category term="JavaScript" /><category term="JSON" /><category term="Android" /><category term="Facebook" /><title>n3g - Niclas Norgren's WebLog</title><subtitle type="html">-=&amp;lt; Observations at the center of the Universe &amp;gt;=-</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://niclas.n3g.net/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/niclasnorgren" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="niclasnorgren" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DkYMQHg4fip7ImA9WhRTF00.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-2375372328284533336</id><published>2011-11-07T22:45:00.001+01:00</published><updated>2011-11-07T23:16:21.636+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-07T23:16:21.636+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mobile" /><category scheme="http://www.blogger.com/atom/ns#" term="Rant" /><category scheme="http://www.blogger.com/atom/ns#" term="Social" /><title>Is Spotify evil?</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I was using Spotify for a while, the premium version, to get the mobile goodies and I rather liked it...&lt;br /&gt;
&lt;br /&gt;
A while back I saw that they did some joined (joint?..) thing with Facebook and it didn't look really interesting to me as an end user but it did look as a major move in the industry and as a professional, it did catch my attention, at least for a little while.&lt;br /&gt;
&lt;br /&gt;
The other day I got some upgrade and suddenly I couldn't log in. Being used to playing around with Facebook integration of things, I accepted my faith and assumed I just (as always) forgot to read what i agreed to when accepting some licence agreement or whatever. Being a good sport, I clicked what they asked me to do and got into my account, seemingly unharmed by the speed bump some programmer put in my way.&lt;br /&gt;
&lt;br /&gt;
Another few days passed, including some speed bumps and requirement to log in after being idle for a day or two. &amp;nbsp;Then, suddenly, I got into my account, but my playlists were gone along with favorites etc.&lt;br /&gt;
Again, being a good sport and fellow programmer, I just assumed they used the same QA team Skype used last year and tried to find if I did something wrong, or just different for that matter.&lt;br /&gt;
&lt;br /&gt;
After some playing around, sometimes being successful, I finally isolated it..&lt;br /&gt;
&lt;br /&gt;
When I use the same username but with different passwords, I get into my Facebook connected account, or my initial (paid) account. The Facebook one being the empty one and the paid one being the one holding my playlists etc that I actually spent some time setting up.&lt;br /&gt;
&lt;br /&gt;
Obviously, my inconvenience is not the major point here. The fact that Spotify store and use my data in a manner that allows my password to control whether I get into one account or the other, just because they have the same user name is *major understatement ahead* outrageous.&lt;br /&gt;
&lt;br /&gt;
I'm left with one thought: are they evil? or just vastly incompetent?&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-2375372328284533336?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/2375372328284533336/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=2375372328284533336" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/2375372328284533336?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/2375372328284533336?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2011/11/is-spotify-evil.html" title="Is Spotify evil?" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEQBR3w6eSp7ImA9WhdUE04.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-5908941798839822636</id><published>2011-09-29T23:39:00.000+02:00</published><updated>2011-09-29T23:39:16.211+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-29T23:39:16.211+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="HowTo" /><category scheme="http://www.blogger.com/atom/ns#" term="Facebook" /><category scheme="http://www.blogger.com/atom/ns#" term="Tips" /><category scheme="http://www.blogger.com/atom/ns#" term="Open Graph" /><title>How to make sure FB.init is properly finished</title><content type="html">&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
When working with the Facebook api, there likely comes a time when you will need to know that FB.init has finished successfully and you can run your scripts to create a wonderful user experience.&lt;br /&gt;
&lt;br /&gt;
Looking into this, it turns out that parts of FB.init runs asynchronously even when using the sync version suggested in the &lt;a href="https://developers.facebook.com/docs/reference/javascript/"&gt;API&lt;/a&gt;. This obviously means that you simply cannot trust that your script will work just because you called it after the init call. &lt;br /&gt;
&lt;br /&gt;
To work around this until the Facebook people fix the issue or provide a reliable event or callback, many have suggested various solutions based on timers. A more solid approach can be built around the FB api itself:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;

Loading FB API asynchronously: &lt;/h3&gt;
&lt;br /&gt;
&lt;code style="font-family: sans-serif; font-size: 12px; line-height: 12px; word-wrap: normal;"&gt; 

&amp;nbsp;&amp;lt;script type="text/javascript"&amp;gt; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;window.fbAsyncInit = function() { &lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/** &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * Workaround for FB.init not being synchronous nor providing a callback method. &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; */ &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FB.init({ &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;appId : 'YOUR_APP_ID_HERE', &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cookie : true, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status : true, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xfbml : true, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;oauth : true &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}); &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FB.getLoginStatus(function(oResponse) { &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (oResponse.status === 'connected') { &lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// the session is complete, and fully initiated, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// go ahead and call your scripts here &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else { &lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// There was a problem, probably because the user was not logged in, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// so put a login sequence or your error handling of choice here &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}); &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;(function() { &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var e = document.createElement('script'); &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.async = true; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;document.getElementsByTagName('head')[0].appendChild(e); &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}()); &lt;br /&gt;
&amp;nbsp;&amp;lt;/script&amp;gt; &lt;br /&gt;
&lt;/code&gt;

&lt;br /&gt;
&lt;h3&gt;

Loading FB API synchronously: &lt;/h3&gt;
&lt;br /&gt;
&lt;code style="font-family: sans-serif; font-size: 12px; line-height: 12px; word-wrap: normal;"&gt; 

&amp;nbsp;&amp;lt;script src="http://connect.facebook.net/en_US/all.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt; &lt;br /&gt;
&amp;nbsp;&amp;lt;script type="text/javascript"&amp;gt; &lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0b5394;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;/** &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; * Workaround for FB.init not being synchronous nor providing a callback method. &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; */ &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;FB.init({ &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;appId : 'YOUR_APP_ID_HERE', &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cookie : true, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status : true, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xfbml : true, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;oauth : true &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}); &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;FB.getLoginStatus(function(oResponse) { &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (oResponse.status === 'connected') { &lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// the session is complete, and fully initiated, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// go ahead and call your scripts here &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else { &lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// There was a problem, probably because the user was not logged in, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// so put a login sequence or your error handling of choice here &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}); &lt;br /&gt;
&amp;nbsp;&amp;lt;/script&amp;gt; &amp;nbsp;&lt;/code&gt;&lt;code style="color: black; font-family: serif; font-size: 12px; line-height: 11px; word-wrap: normal;"&gt;&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-5908941798839822636?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/5908941798839822636/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=5908941798839822636" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/5908941798839822636?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/5908941798839822636?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2011/09/how-to-make-sure-fbinit-is-properly.html" title="How to make sure FB.init is properly finished" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CkMFQH44cSp7ImA9WhZTEk8.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-7091541611744821544</id><published>2011-03-14T23:01:00.034+01:00</published><updated>2011-03-15T21:20:11.039+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-15T21:20:11.039+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="HowTo" /><category scheme="http://www.blogger.com/atom/ns#" term="WebKit" /><category scheme="http://www.blogger.com/atom/ns#" term="Kinetic" /><category scheme="http://www.blogger.com/atom/ns#" term="Safari" /><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><category scheme="http://www.blogger.com/atom/ns#" term="iOS" /><category scheme="http://www.blogger.com/atom/ns#" term="Google Chrome" /><title>Kinetic scrolling for WebKit on touch devices</title><content type="html">When creating a web app for a touch device, one thing that can cause some headache is trying to get the right "App-feeling" with a nice header that stays in place, and maybe even a footer. Since &lt;span style="font-style:italic;"&gt;position:fixed&lt;/span&gt; is not supported (at least on iPhone Safari) and scrolling inline content is done using the little known 2-finger scroll (which is also without any nice feel to it whatsoever) there is basically 2 options; to implement a header and footer that moves into place when scrolling (like those annoying ads), or to implement scrolling of the "mid-part".&lt;br /&gt;&lt;br /&gt;I spent some time on trying to find a good, free sample on how to do the later without success(but I'm sure they are out there). This weekend I got some time to play around so I thought I'd try to implement that sweet scrolling that you get inside an app on the iPhone(or the Android for that matter). A bunch of hours and quite a few curses later I came up with something that works pretty well :)&lt;br /&gt;&lt;br /&gt;You can try it out here:&lt;br /&gt; &lt;a href="http://webkitjs.org/ScrollElement/" target="_new"&gt;http://webkitjs.org/ScrollElement/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And here's the source code:&lt;br /&gt;&lt;script src="https://gist.github.com/871154.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Although this is only tested on a Galaxy S running Froyo, it &lt;span style="font-style:italic;"&gt;should&lt;/span&gt; work well on Safari on iOS (iPad, iPod, iPhone) and most Android touch phones running a fairly recent version. Oh, I tested it on Chrome and Safari on PC and Mac with decent results as well.&lt;br /&gt;&lt;br /&gt;Feel free to use and abuse it as you please. Speaking of which, I'm not sure whether to bother putting some really open licensing in there just to clarify. Input on this would be much appreciated ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-7091541611744821544?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/7091541611744821544/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=7091541611744821544" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/7091541611744821544?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/7091541611744821544?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2011/03/kinetic-scrolling-for-webkit-on-touch.html" title="Kinetic scrolling for WebKit on touch devices" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>4</thr:total></entry><entry gd:etag="W/&quot;CUQDR34_fip7ImA9Wx5VEk8.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-5516451874150695877</id><published>2010-10-04T22:04:00.002+02:00</published><updated>2010-10-04T22:16:16.046+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-04T22:16:16.046+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AJAX" /><category scheme="http://www.blogger.com/atom/ns#" term="Mobile" /><category scheme="http://www.blogger.com/atom/ns#" term="iOS" /><title>How to use WebSockets in the iPhone</title><content type="html">Remy Sharp put together a way to &lt;a href="http://remysharp.com/2010/10/04/websockets-in-phonegap-projects/"&gt;use WebSockets in PhoneGap Projects&lt;/a&gt;. If you're into doing things the web way, &lt;a href="http://remysharp.com/2010/10/04/websockets-in-phonegap-projects/"&gt;check out the recipe here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-5516451874150695877?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/5516451874150695877/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=5516451874150695877" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/5516451874150695877?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/5516451874150695877?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2010/10/how-to-use-websockets-in-iphone.html" title="How to use WebSockets in the iPhone" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEEDQXo4fyp7ImA9Wx5VEk8.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-7024592481331303087</id><published>2010-09-30T07:41:00.028+02:00</published><updated>2010-10-04T22:04:30.437+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-04T22:04:30.437+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="HowTo" /><category scheme="http://www.blogger.com/atom/ns#" term="DOM" /><category scheme="http://www.blogger.com/atom/ns#" term="HTML" /><title>How to write HTML, the JavaScript way.</title><content type="html">Did you ever wish you could write HTML and JavaScript at the same time? Well, I did. The other night I got a bit creative and set out to try to create something neat, and maybe even useful. I'm not sure about the usefullness, but I do think the way it turned out is rather neat :)&lt;br /&gt;&lt;br /&gt;The syntax I wanted to use was kind of a mixture of object notation and HTML structure like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;DIV(&lt;br /&gt;   {&lt;br /&gt;      id: "myDiv",&lt;br /&gt;      onclick: function(){ this.add(DIV("Some text")) }&lt;br /&gt;   },&lt;br /&gt;   P( "Click me!" ),&lt;br /&gt;   HR()&lt;br /&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And, after some playing with it, here is the source code to make that work:&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;script src="http://gist.github.com/604595.js?file=SimpleElement.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can try it out here:  &lt;a href="http://n3g.net/SimpleElement/" target="_new"&gt;http://n3g.net/SimpleElement/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;It should work for most HTML tags and  basic things like style work pretty well actually. Obviously, this is in no way complete and for large projects it is probably a mess.  As a base for creating reusable code for small projects that are basically about putting some HTML mixed with JavaScript and hooking a few things up it might be very handy.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In most cases, one would likely want to add methods to remove or temporarily hide the elements, putting some animation in there and so on but as it would quickly grow out of hands, becoming yet another attempt to handle life, universe and everything, I'll leave it for you to fill in the gaps ;)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-7024592481331303087?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/7024592481331303087/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=7024592481331303087" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/7024592481331303087?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/7024592481331303087?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2010/09/how-to-write-html-javascript-way.html" title="How to write HTML, the JavaScript way." /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>2</thr:total></entry><entry gd:etag="W/&quot;D0MARXo8fip7ImA9WxNVEE8.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-3857609785379556876</id><published>2009-10-20T09:55:00.001+02:00</published><updated>2009-10-20T09:57:24.476+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-20T09:57:24.476+02:00</app:edited><title>Some more on InfiView - Layers Feature Presentation</title><content type="html">Johan created another nice video. This time on the InfiView Layers feature. Check it out at &lt;a href="http://www.youtube.com/watch?v=ep21_JIJP44"&gt;http://www.youtube.com/watch?v=ep21_JIJP44&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-3857609785379556876?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/3857609785379556876/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=3857609785379556876" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/3857609785379556876?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/3857609785379556876?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2009/10/some-more-on-infiview-layers-feature.html" title="Some more on InfiView - Layers Feature Presentation" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CkQCRH0-cCp7ImA9WxNQEkU.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-6996861944651842362</id><published>2009-09-18T15:20:00.003+02:00</published><updated>2009-09-18T15:26:05.358+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-18T15:26:05.358+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="AJAX" /><category scheme="http://www.blogger.com/atom/ns#" term="Tips" /><category scheme="http://www.blogger.com/atom/ns#" term="Bindows" /><title>Time to check out InfiView</title><content type="html">We haven't gone mad, or maybe a bit... InfiView is now free! So now would be a good time to check it out ;)&lt;br /&gt;&lt;br /&gt;Get it at &lt;a href="http://www.infiview.com/download/"&gt;http://www.infiview.com/download/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;oh, and don't forget to check out the nice video Johan put together &lt;a href="http://www.youtube.com/watch?v=W1vjuhkOxko"&gt;on youtube&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-6996861944651842362?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/6996861944651842362/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=6996861944651842362" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/6996861944651842362?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/6996861944651842362?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2009/09/time-to-check-out-infiview.html" title="Time to check out InfiView" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>1</thr:total></entry><entry gd:etag="W/&quot;DU4BQX8_eSp7ImA9WxVUGE8.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-2426054716255055822</id><published>2009-03-23T18:01:00.002+01:00</published><updated>2009-03-23T18:05:50.141+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-23T18:05:50.141+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tips" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="Bindows" /><category scheme="http://www.blogger.com/atom/ns#" term=".Net" /><title>Free Gauges with C#</title><content type="html">Johan just posted a nice article on using Bindows Free Gauges with ASP .NET over at the &lt;a href="http://blog.bindows.net/"&gt;Bindows Blog&lt;/a&gt;. &lt;a href="http://blog.bindows.net/?p=110"&gt;Check it out &amp;raquo;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-2426054716255055822?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/2426054716255055822/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=2426054716255055822" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/2426054716255055822?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/2426054716255055822?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2009/03/free-gauges-with-c.html" title="Free Gauges with C#" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;D0cCSH08fyp7ImA9WxVUFEg.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-7460332188651123412</id><published>2009-03-19T10:26:00.002+01:00</published><updated>2009-03-19T10:31:09.377+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-19T10:31:09.377+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="IE8" /><category scheme="http://www.blogger.com/atom/ns#" term="Tips" /><category scheme="http://www.blogger.com/atom/ns#" term="Browsers" /><title>IE8 release today</title><content type="html">In case someone missed the news, IE8 is scheduled for release this afternoon (CET).&lt;br /&gt;You should be able to download it after 17:00 CET at &lt;a href="http://www.microsoft.com/ie8"&gt;http://www.microsoft.com/ie8&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-7460332188651123412?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/7460332188651123412/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=7460332188651123412" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/7460332188651123412?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/7460332188651123412?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2009/03/ie8-release-today.html" title="IE8 release today" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>2</thr:total></entry><entry gd:etag="W/&quot;DkcERXkzcSp7ImA9WxVUFEg.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-527924007412730228</id><published>2009-03-19T10:07:00.003+01:00</published><updated>2009-03-19T10:13:24.789+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-19T10:13:24.789+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Tips" /><category scheme="http://www.blogger.com/atom/ns#" term="Google Chrome" /><title>Amazing flashbacks from -99</title><content type="html">Some people have been playing around with Chrome, a lot... there are some really awesome samples over at &lt;a href="http://www.chromeexperiments.com/"&gt;http://www.chromeexperiments.com/&lt;/a&gt;. It's fun to see how much, and little, changed since -99 :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-527924007412730228?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/527924007412730228/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=527924007412730228" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/527924007412730228?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/527924007412730228?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2009/03/amazing-flashbacks-from-99.html" title="Amazing flashbacks from -99" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;C0QFRn4zfSp7ImA9WxVUEUQ.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-7101539272874706586</id><published>2009-03-14T07:13:00.009+01:00</published><updated>2009-03-16T09:15:17.085+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-16T09:15:17.085+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="IRL" /><category scheme="http://www.blogger.com/atom/ns#" term="Personal" /><title>Unsyncronized Asynchronous Communication</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_uluORqRvdoo/SbtLJIqQ-RI/AAAAAAAAAAU/wp-RTPyw3Ak/s1600-h/NoA_lillehammer.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_uluORqRvdoo/SbtLJIqQ-RI/AAAAAAAAAAU/wp-RTPyw3Ak/s320/NoA_lillehammer.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5312922805729294610" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A: Can we go now?&lt;br /&gt;N: So, do you think skiing is fun?&lt;br /&gt;A: That looks like a running boy&lt;br /&gt;N: Where?&lt;br /&gt;A: I want to ski more&lt;br /&gt;N: Ahhh, there. Do you see that he's holding a torch?&lt;br /&gt;A: I think we should go NOW&lt;br /&gt;N: Ok, lets go&lt;br /&gt;A: It looks like he's holding a something&lt;br /&gt;N: Who?&lt;br /&gt;A: The boy with the torch&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-7101539272874706586?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/7101539272874706586/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=7101539272874706586" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/7101539272874706586?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/7101539272874706586?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2009/03/unsyncronized-asynchronous.html" title="Unsyncronized Asynchronous Communication" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_uluORqRvdoo/SbtLJIqQ-RI/AAAAAAAAAAU/wp-RTPyw3Ak/s72-c/NoA_lillehammer.jpg" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CUUERH87eip7ImA9WxVWF0k.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-1314788738929748831</id><published>2009-02-26T13:18:00.014+01:00</published><updated>2009-02-27T15:00:05.102+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-27T15:00:05.102+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Bindows 4" /><category scheme="http://www.blogger.com/atom/ns#" term="Bindows" /><category scheme="http://www.blogger.com/atom/ns#" term="Actions" /><title>Bindable properties in Bindows 4</title><content type="html">One nifty thing introduced in Bindows 4.0 is the BiProperty. It enables you to:&lt;br /&gt;&lt;br /&gt;- add a property to an instance which throws a change event when the value changes&lt;br /&gt;- set the location of the property, so you can also wrap any other property with it&lt;br /&gt;- use the new name scopes when naming and setting location pointers.&lt;br /&gt;&lt;br /&gt;Using these together with the Actions (the end result of &lt;a href="http://niclas.n3g.net/2007/11/managed-asynchronous-execution-threads.html"&gt;Managed Asynchronous Execution Threads&lt;/a&gt;), one can in a fairly straightforward way create some simple logic.&lt;br /&gt;&lt;br /&gt;Some samples:&lt;br /&gt;&lt;a href="http://www.bindows.net/bindows/samples/4.0_new_concepts/PropertyTest.html"&gt;Sample 1&lt;/a&gt; - &lt;a href="http://www.bindows.net/bindows/samples/4.0_new_concepts/PropertyTest.xml"&gt;( XML source )&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.bindows.net/bindows/samples/4.0_new_concepts/PropertyTest2.html"&gt;Sample 2&lt;/a&gt; - &lt;a href="http://www.bindows.net/bindows/samples/4.0_new_concepts/PropertyTest2.xml"&gt;( XML source )&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.bindows.net/bindows/samples/4.0_new_concepts/PropertyTest3.html"&gt;Sample 3&lt;/a&gt; - &lt;a href="http://www.bindows.net/bindows/samples/4.0_new_concepts/PropertyTest3.xml"&gt;( XML source )&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-1314788738929748831?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/1314788738929748831/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=1314788738929748831" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/1314788738929748831?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/1314788738929748831?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2009/02/bindable-properties-in-bindows-4.html" title="Bindable properties in Bindows 4" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;C04CQnY9cCp7ImA9WxVWF0k.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-8623956882998207291</id><published>2009-02-26T13:13:00.005+01:00</published><updated>2009-02-27T14:39:23.868+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-27T14:39:23.868+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Bindows 4" /><category scheme="http://www.blogger.com/atom/ns#" term="Graphical Design" /><category scheme="http://www.blogger.com/atom/ns#" term="CSS" /><category scheme="http://www.blogger.com/atom/ns#" term="Bindows" /><title>Just made the world a bit prettier...</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_uluORqRvdoo/SaZ_DmJQNLI/AAAAAAAAAAM/JlgRKA_WhqU/s1600-h/default_theme_top_corner.gif"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 175px; height: 120px;" src="http://3.bp.blogspot.com/_uluORqRvdoo/SaZ_DmJQNLI/AAAAAAAAAAM/JlgRKA_WhqU/s320/default_theme_top_corner.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5307068910658401458" /&gt;&lt;/a&gt;For quite some time now, I’ve been working on improving the looks of Bindows. Check out &lt;a href="http://blog.bindows.net/?p=107"&gt;this post&lt;/a&gt; in the &lt;a href="http://blog.bindows.net/"&gt;Bindows Blog&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-8623956882998207291?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/8623956882998207291/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=8623956882998207291" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/8623956882998207291?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/8623956882998207291?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2009/02/just-made-world-bit-prettier.html" title="Just made the world a bit prettier..." /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_uluORqRvdoo/SaZ_DmJQNLI/AAAAAAAAAAM/JlgRKA_WhqU/s72-c/default_theme_top_corner.gif" height="72" width="72" /><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;CEYNQXc4eip7ImA9WxRWEk0.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-574327868677563561</id><published>2008-10-28T09:34:00.008+01:00</published><updated>2008-10-28T14:56:30.932+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-28T14:56:30.932+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="JSON" /><category scheme="http://www.blogger.com/atom/ns#" term="AJAX" /><category scheme="http://www.blogger.com/atom/ns#" term="Tips" /><title>Good times for JavaScript Object Notation(JSON)</title><content type="html">One hurdle in writing good, well performing AJAX applications is the parsing of data. One way of trying to improve the performance has for a long time been to use JSON in the transport layer. While being pretty efficient, and reasonably well supported in server side implementations, the perfomance of serializing/deserializing large JSON objects in the client side has left much to wish for. &lt;br /&gt;&lt;br /&gt;Luckily, this is about to change :)&lt;br /&gt;&lt;br /&gt;The Mozilla guys have implemented a native JSON parser and will be exposing that to use with JavaScript in coming releases. Furthermore, IE8 beta 2 features a native JSON parser. Now we can just hope that the WebKit guys follow the trend ... Google Chrome with a built in JSON parser would likely rock ;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/ie/archive/2008/09/10/native-json-in-ie8.aspx"&gt;IE8 Blog: Native JSON in IE8&lt;/a&gt;&lt;br&gt;&lt;br /&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=387522"&gt;Moz JSON support&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-574327868677563561?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/574327868677563561/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=574327868677563561" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/574327868677563561?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/574327868677563561?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2008/10/good-times-for-object-notation.html" title="Good times for JavaScript Object Notation(JSON)" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>0</thr:total></entry><entry gd:etag="W/&quot;DEECR346cSp7ImA9WB9bEUs.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-6407094275449090037</id><published>2007-11-30T20:36:00.000+01:00</published><updated>2007-12-20T17:04:26.019+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-12-20T17:04:26.019+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Bindows 4" /><category scheme="http://www.blogger.com/atom/ns#" term="AJAX" /><category scheme="http://www.blogger.com/atom/ns#" term="Bindows" /><title>Managed Asynchronous Execution Threads</title><content type="html">Lately I've been working on a model to describe execution flows in Bindows markup. The simple idea was to remove the need for using JavaScript when defining application logic.&lt;br /&gt;&lt;br /&gt;One of the first problems I faced was the dual nature of executions depending on whether they are synchronous or not.&lt;br /&gt;&lt;br /&gt;Consider the following: &lt;code&gt;A.value = B.value = C.value&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In a synchronous thread, A gets the value of B that gets the value of C.&lt;br /&gt;The requirement here is that A knows about B that knows about C.&lt;br /&gt;&lt;br /&gt;In an asynchronous thread, C sets its value on B that sets its value on A.&lt;br /&gt;The requirement here is that C knows about B that knows about A.&lt;br /&gt;&lt;br /&gt;In both cases the expression is interpreted first from left to right (parsing), then right to left (execution). For asynchronous threads to work, each instance needs to maintain information about what preceded it in the parsing since asynchronous means that the thread breaks after the parsing.&lt;br /&gt;&lt;br /&gt;Looking closer at this, I realized that always satisfying the above described dependencies could give a straightforward, flow based way of describing an action sequence in XML, regardless of asynchronous dependencies. This is when things really started getting interesting…&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;code&gt;A.value = B.value = C.value&lt;/code&gt; could be described as:&lt;br /&gt;&lt;code&gt;&lt;pre style="BORDER-RIGHT: silver 1px dashed; PADDING-RIGHT: 10px; BORDER-TOP: silver 1px dashed; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; BORDER-LEFT: silver 1px dashed; PADDING-TOP: 10px; BORDER-BOTTOM: silver 1px dashed color:#006600;"&gt;&lt;br /&gt;&amp;lt;A&amp;gt;&lt;br /&gt;   &amp;lt;value&amp;gt;&lt;br /&gt;      &amp;lt;B&amp;gt;&lt;br /&gt;         &amp;lt;value&amp;gt;&lt;br /&gt;            &amp;lt;C&amp;gt;&lt;br /&gt;               &amp;lt;value&amp;gt;&lt;br /&gt;                  .. my value ..&lt;br /&gt;               &amp;lt;/value&amp;gt;&lt;br /&gt;            &amp;lt;/C&amp;gt;&lt;br /&gt;         &amp;lt;/value&amp;gt;&lt;br /&gt;      &amp;lt;/B&amp;gt;&lt;br /&gt;   &amp;lt;/value&amp;gt;&lt;br /&gt;&amp;lt;/A&amp;gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;When the above is deserialized, the parent/child relation is the same as the left/right relation earlier described. Applying a parent property to each instance gives enough for successfully being able to traverse the dependencies in either direction.&lt;br /&gt;&lt;br /&gt;Here is a small test where &lt;code&gt;toString&lt;/code&gt; represent the normal case and &lt;code&gt;returnValue&lt;/code&gt; represent the callback of an asynchronous dependency:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="BORDER-RIGHT: silver 1px dashed; PADDING-RIGHT: 10px; BORDER-TOP: silver 1px dashed; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; BORDER-LEFT: silver 1px dashed; PADDING-TOP: 10px; BORDER-BOTTOM: silver 1px dashed"&gt;&lt;br /&gt;Object.prototype.toString = &lt;span style="color:#993399;"&gt;function&lt;/span&gt; ()&lt;span style="color:#993399;"&gt;{&lt;/span&gt;&lt;br /&gt;   &lt;span style="color:#993399;"&gt;return&lt;/span&gt; this._value.toString();&lt;br /&gt;&lt;span style="color:#993399;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Object.prototype.returnValue = &lt;span style="color:#993399;"&gt;function&lt;/span&gt; () &lt;span style="color:#993399;"&gt;{&lt;/span&gt;&lt;br /&gt;   &lt;span style="color:#993399;"&gt;if &lt;/span&gt;( this.to_the_right_of )&lt;br /&gt;      this.to_the_right_of.returnValue()&lt;br /&gt;   &lt;span style="color:#993399;"&gt;else&lt;/span&gt;&lt;br /&gt;      alert( this._value )&lt;br /&gt;&lt;span style="color:#993399;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A = &lt;span style="color:#993399;"&gt;{}&lt;/span&gt;&lt;br /&gt;A.to_the_right_of = &lt;span style="color:#993399;"&gt;null &lt;/span&gt;&lt;span style="color:#3366ff;"&gt;// parent relation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A._value =&lt;br /&gt;B = &lt;span style="color:#993399;"&gt;{}&lt;/span&gt;&lt;br /&gt;B.to_the_right_of = A    &lt;span style="color:#3366ff;"&gt;// parent relation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;B._value =&lt;br /&gt;C = &lt;span style="color:#993399;"&gt;{}&lt;/span&gt;&lt;br /&gt;C.to_the_right_of = B    &lt;span style="color:#3366ff;"&gt;// parent relation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;C._value = ".. my value .."&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;// left to right (sync)&lt;/span&gt;&lt;br /&gt;alert( A )&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;// right to left (async)&lt;/span&gt;&lt;br /&gt;C.returnValue()&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;I'll elaborate more on this later, but today we release the Bindows implementation. Check it out in the &lt;a href="http://www.bindows.net/documentation/40/" target="_new"&gt;Bindows&amp;trade; 4.0 (beta)&lt;/a&gt; or in the &lt;a href="http://blog.bindows.net/?p=65"&gt;Bindows&amp;trade; blog (http://blog.bindows.net/?p=65)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-6407094275449090037?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/6407094275449090037/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=6407094275449090037" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/6407094275449090037?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/6407094275449090037?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2007/11/managed-asynchronous-execution-threads.html" title="Managed Asynchronous Execution Threads" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>3</thr:total></entry><entry gd:etag="W/&quot;CUYCRH89fCp7ImA9WB5bEEU.&quot;"><id>tag:blogger.com,1999:blog-5708081203935256348.post-326429401704413959</id><published>2007-06-19T11:04:00.000+02:00</published><updated>2007-08-26T01:06:05.164+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2007-08-26T01:06:05.164+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Tips" /><category scheme="http://www.blogger.com/atom/ns#" term="RegExp" /><title>Taking charge of replacing in JS</title><content type="html">&lt;p&gt;One of the less documented features of regular expressions in JavaScript is the replacement string in a replace statement and how you can play with it.&lt;/p&gt;&lt;p&gt;Let's say you want to replace "a" and "b" with "c". Typically, you would do something like this:&lt;/p&gt;&lt;code&gt;&lt;span style="color:#cc66cc;"&gt;var s = "a b c";&lt;br /&gt;alert( s.replace( /[ab]/g, "c" ) );&lt;/span&gt; &lt;span style="color:#339999;"&gt;// which would give "c c c"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;p&gt;But what if you want to take some more control of the output? This is where we plunge into the world of the replacement string (the second argument of String.replace()).&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As you probably know, you can use $[n] to reference parenthesized substring matches&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style="color:#cc66cc;"&gt;var s = "a b c";&lt;br /&gt;&lt;br /&gt;alert( s.replace( /([abc])/g, "$1$1" );&lt;/span&gt; &lt;/code&gt;&lt;code&gt;&lt;span style="color:#339999;"&gt;// would give "aa bb cc"&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/code&gt;&lt;p&gt;but if you want to use some more rules, the regexp likely gets a bit hairy. Let's say you want to surround any number(0-9) with parentheses and turn a-z into uppercase, now would be the time to use some function, right? What we can do is to use a function reference as the second argument to &lt;code&gt;.replace&lt;/code&gt; like this:&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;span style="color:#cc66cc;"&gt;&lt;strong&gt;function&lt;/strong&gt; getReplaceString() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#cc66cc;"&gt;&lt;strong&gt;var&lt;/strong&gt; arg = arguments&lt;br /&gt;&lt;strong&gt;return&lt;/strong&gt; arg[1] ? arg[1].toUpperCase() : '(' + arg[2] + ')' ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;var&lt;/strong&gt; s = "a b c 1 2 3";&lt;br /&gt;s = s.replace( /(?:([a-z])([0-9]))/g, getReplaceString );&lt;br /&gt;&lt;br /&gt;alert( s );&lt;/span&gt; &lt;span style="color:#339999;"&gt;// would give "A B C (1) (2) (3)"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Neat, huh?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5708081203935256348-326429401704413959?l=niclas.n3g.net' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://niclas.n3g.net/feeds/326429401704413959/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5708081203935256348&amp;postID=326429401704413959" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/326429401704413959?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5708081203935256348/posts/default/326429401704413959?v=2" /><link rel="alternate" type="text/html" href="http://niclas.n3g.net/2007/06/taking-charge-of-replacing-in-js.html" title="Taking charge of replacing in JS" /><author><name>Niclas Norgren</name><uri>http://www.blogger.com/profile/15835334920532817175</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://1.bp.blogspot.com/_uluORqRvdoo/SxzOhIhqovI/AAAAAAAAABA/IAG2nBb0-uA/S220/NoA.jpg" /></author><thr:total>0</thr:total></entry></feed>

