<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Xebia Blog &#187; Web 2.0</title>
	<atom:link href="http://blog.xebia.com/category/web-20/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xebia.com</link>
	<description>Software development done right!</description>
	<lastBuildDate>Wed, 01 Feb 2012 00:30:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting started with Node.js, npm, Coffeescript, Express, Jade and Redis</title>
		<link>http://blog.xebia.com/2011/06/24/getting-started-with-node-js-npm-coffeescript-express-jade-and-redis/</link>
		<comments>http://blog.xebia.com/2011/06/24/getting-started-with-node-js-npm-coffeescript-express-jade-and-redis/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 13:40:19 +0000</pubDate>
		<dc:creator>Erwin van der Koogh</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[NoSQL]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Node.js npm coffeescript express java redis]]></category>

	<!-- AutoMeta Start -->
	<category>redis</category>
	<category>redis</category>
	<category>app2</category>
	<category>3000</category>
	<category>express</category>
	<category>express</category>
	<category>1337</category>
	<category>sudo</category>
	<category>redis</category>
	<category>redis</category>
	<category>app2</category>
	<category>3000</category>
	<category>express</category>
	<category>express</category>
	<category>1337</category>
	<category>sudo</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=7001</guid>
		<description><![CDATA[To celebrate my move to the Agile Consulting and Training division of Xebia I thought it would be very appropriate to start playing with some hip new technologies. From their homepages: Node.js: Evented I/O for V8 JavaScript. (A framework for building completely non-blocking servers in Javascript) NPM: A package manager for node. CoffeeScript: A little [...]]]></description>
			<content:encoded><![CDATA[<p>To celebrate my move to the Agile Consulting and Training division of Xebia I thought it would be very appropriate to start playing with some hip new technologies.</p>
<p>From their homepages:</p>
<p><a href="http://nodejs.org/">Node.js</a>: Evented I/O for V8 JavaScript. (A framework for building completely non-blocking servers in Javascript)<br />
<a href="http://npmjs.org/">NPM</a>: A package manager for node.<br />
<a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a>: A little language that compiles into JavaScript<br />
<a href="http://expressjs.com/">Express</a>: High performance, high class web development for Node.js<br />
<a href="http://jade-lang.com/">Jade</a>: Node Template Engine<br />
<a href="http://www.redis.io/">Redis</a>: An open source, advanced key-value store</p>
<p>In this guide I will take very small steps so that you can verify that you are check whether you are still on track.<br />
The result is an extremely performant, scalable and lightweight alternative for web development.</p>
<p><span id="more-7001"></span></p>
<p>So I installed a brand new Ubuntu 11.4 virtual machine and got started. After following some tutorials, googling and some tweaking this is the step-by-step guide I came up with.</p>
<p><strong>Installing Node.js</strong></p>
<p><code>$ sudo apt-get install python-software-properties<br />
$ sudo add-apt-repository ppa:jerome-etienne/neoip<br />
$ sudo apt-get update<br />
$ sudo apt-get install nodejs<br />
</code></p>
<p><strong>Installing npm</strong></p>
<p><code>$ apt-get install curl<br />
$ curl http://npmjs.org/install.sh | sudo sh<br />
</code></p>
<p><strong>Node.js Hello World</strong></p>
<p><code>$ mkdir helloworld<br />
$ cd helloworld<br />
$ vi helloworld.js<br />
</code></p>
<p>insert</p>
<pre class="brush: jscript; title: ; notranslate">
var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337);
console.log('Server running at http://127.0.0.1:1337/');
</pre>
<p><code>$ node helloworld.js</code></p>
<p>check http://127.0.0.1:1337</p>
<p><strong>Add Coffeescript</strong></p>
<p>Writing all that javascript is going to lead to lots and lots of brackets, semi-colons and parantheses. Let&#8217;s use Coffeescript to make our code readable again.</p>
<p><code>$ sudo npm install -g coffee-script<br />
$ cd ..<br />
$ mkdir hellocoffee<br />
$ cd hellocoffee<br />
$ vi hellocoffee.coffee<br />
</code></p>
<p>insert </p>
<pre class="brush: jscript; title: ; notranslate">http = require &quot;http&quot;
http.createServer( (req, res) -&gt;
  res.writeHead 200, {&quot;Content-Type&quot;: &quot;text/plain&quot;}
  res.end &quot;Hello Coffee!!&quot;
).listen 1337

console.log 'Server running at http://127.0.0.1:1337/'
</pre>
<p><code>$ coffee -c hellocoffee.coffee<br />
$ node hellocoffee.js</code></p>
<p>And check http://127.0.0.1:1337 again.</p>
<p><strong>Adding Express</strong></p>
<p>Node.js is a very powerful, but it still requires quite a bit of boilerplating to use it for web development. That&#8217;s where Express comes in. It is build on top of another middleware layer called Connect and gives you much better support in handling requests, rendering, templates and responses.</p>
<p><code>$ cd ..<br />
$ sudo npm install -g mime qs connect express<br />
$ mkdir helloexpress<br />
$ cd helloexpress<br />
$ express<br />
$ npm install -d<br />
$ node app.js<br />
</code></p>
<p>check http://127.0.0.1:3000</p>
<p><code>vi app2.coffee</code></p>
<p>insert:</p>
<pre class="brush: jscript; title: ; notranslate">
express = require('express')app = express.createServer()

# Setup configuration
app.use express.static(__dirname + '/public')
app.set 'view engine', 'jade'

# App Routes
app.get '/', (request, response) -&gt;
  response.render 'index', { title: 'Express with Coffee' }

# Listen
app.listen 3000
console.log &quot;Express server listening on port %d&quot;, app.address().port
</pre>
<p><code>$ coffee -c app2.coffee<br />
$ node app2.js<br />
</code></p>
<p>And check http://127.0.0.1:3000 again.<br />
Now that we have Coffeescript working with Express let&#8217;s add sessions.</p>
<p><strong>Add session support</strong></p>
<p><code>$ vi app2.coffee</code></p>
<p>insert after app.use express.static(__dirname + &#8216;/public&#8217;)</p>
<pre class="brush: jscript; title: ; notranslate">app.use express.cookieParser()
app.use express.session {secret: &quot;Coffeebreak&quot; }
</pre>
<p>insert after app.get &#8216;/&#8217;, (request, response) -></p>
<pre class="brush: jscript; title: ; notranslate">request.session.views++</pre>
<p>replace</p>
<pre class="brush: jscript; title: ; notranslate">response.render 'index', { title: request.session.views + ': Express with Coffee and sessions' }</pre>
<p><code>$ coffee -c app2.coffee<br />
$ node app2.js</code></p>
<p>Check http://127.0.0.1:3000 and refresh a few times. You should see the counter increase.</p>
<p><strong>Install Redis</strong></p>
<p>Open a new terminal.</p>
<p><code>$ wget http://redis.googlecode.com/files/redis-2.2.11.tar.gz<br />
$ tar -zxvf redis-2.2.11.tar.gz<br />
$ cd redis-2.2.11/<br />
$ sudo apt-get install build-essential<br />
$ make<br />
$ ./src/redis-server<br />
</code></p>
<p><strong>Add redis session to node</strong></p>
<p><code>$ npm install -d redis connect-redis<br />
vi app2.coffee</code></p>
<p>insert after express = require &#8216;express&#8217;</p>
<pre class="brush: jscript; title: ; notranslate">RedisStore = require('connect-redis')(express)</pre>
<p>change</p>
<pre class="brush: jscript; title: ; notranslate">app.use express.session {secret: &quot;Coffeebreak&quot;, store: new RedisStore, cookie: { maxAge: 60000 } }</pre>
<p><code>$ coffee -c app2.coffee<br />
$ node app2.js<br />
</code></p>
<p>In the Redis terminal you should now see something like:<br />
<code>[25489] 24 Jun 04:57:11 - DB 0: 1 keys (1 volatile) in 4 slots HT.<br />
[25489] 24 Jun 04:57:11 - 1 clients connected (0 slaves), 799032 bytes in use<br />
</code></p>
<p>Check http://127.0.0.1:3000 and refresh a bunch of times<br />
kill and restart node</p>
<p><code>$ node app2.js</code></p>
<p>Check http://127.0.0.1:3000 again and refresh a few more times<br />
Note that you started where you left off.</p>
<p>And that brings us to the end of this guide. As you can see the stack is very powerful and extremely small, lightweight and clean. With all the session information in the Redis store the availability of the entire systems comes down to the availability of Redis. And with these guys working on a proper clustering solution it will be very interesting to see where all this is going in the near future.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2011/06/24/getting-started-with-node-js-npm-coffeescript-express-jade-and-redis/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2011%2F06%2F24%2Fgetting-started-with-node-js-npm-coffeescript-express-jade-and-redis%2F&amp;title=Getting%20started%20with%20Node.js%2C%20npm%2C%20Coffeescript%2C%20Express%2C%20Jade%20and%20Redis" id="wpa2a_2"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2011/06/24/getting-started-with-node-js-npm-coffeescript-express-jade-and-redis/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Websockets from scratch &#8211; Results from a short techrally</title>
		<link>http://blog.xebia.com/2010/12/15/websockets-from-scratch/</link>
		<comments>http://blog.xebia.com/2010/12/15/websockets-from-scratch/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 08:54:46 +0000</pubDate>
		<dc:creator>Jeroen van Wilgenburg</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jetty]]></category>
		<category><![CDATA[techrally]]></category>
		<category><![CDATA[websockets]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=5589</guid>
		<description><![CDATA[Last friday we had a techrally at Xebia. We could pick our subject: MongoDB or Websockets or Canvas. I teamed up with Albert. There also was another websockets team consisting of Mischa, Ron and Frank. We decided to use Jetty for websockets. No particual reason to pick Jetty, we both heard it did something with [...]]]></description>
			<content:encoded><![CDATA[<p>Last friday we had a techrally at Xebia. We could pick our subject: MongoDB or Websockets or Canvas. I teamed up with Albert. There also was another websockets team consisting of Mischa, Ron and Frank.<br />
We decided to use Jetty for websockets. No particual reason to pick Jetty, we both heard it did something with websockets and in the end it was an easier solution than the other team picked (<a href="http://jwebsocket.org/" target="_blank">jWebSocket</a>).<br />
Since we only had a few hours we were in quite a hurry, but in the end it was so simple we had time to write a blog, listen to Dan North and Albert even redid everthing and more in Python.<span id="more-5589"></span></p>
<h2>Introduction</h2>
<p>I want to skip the introduction because a lot has been written about websockets and you probably want to get started as soon as possible. Check out the sources section for more information. For now you only have to know that it&#8217;s fast, it has almost no overhead, keeps a permanent connection open (so the server can push data to the client, no polling required!) and best of all: it&#8217;s very easy.</p>
<h2>Installation</h2>
<p>When you&#8217;re using maven 2+ you don&#8217;t have to download anything. Just start a maven war project and add the <a href="http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin" target="_blank">jetty-maven-plugin</a> (we used version 7.2.1.v20101111), add a dependency to jetty-websocket (inside the project element) and you&#8217;re ready to get started.<br />
<code>&lt;dependency&gt;<br />
 &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;<br />
 &lt;artifactId&gt;jetty-websocket&lt;/artifactId&gt;<br />
 &lt;version&gt;7.2.1.v20101111&lt;/version&gt;<br />
&lt;/dependency&gt;</code></p>
<h2>Dissecting the WebSocketChatServlet example</h2>
<p>A sample application is included with Jetty. On <a href="http://blogs.webtide.com/gregw/entry/jetty_websocket_server" target="_blank">this blog</a> this sample is explained and in the end we used it to see what was happening and of course see some communication between client and server. After that we stripped everything and started over again to see what was actually happening.</p>
<h2>Creating your own servlet</h2>
<p>Since I used Struts and Spring MVC in the past and always copied the servlet configuration it was a while ago I added my own servlet to web.xml, so here is a litte snippet to help you (this probably was one of the most difficult parts <img src='http://blog.xebia.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ):<br />
<code lang="xml">&lt;servlet&gt;<br />
 &lt;servlet-name&gt;hw&lt;/servlet-name&gt;<br />
 &lt;servlet-class&gt;com.xebia.ws.HelloWorldServlet&lt;/servlet-class&gt;<br />
 &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br />
&lt;/servlet&gt;</p>
<p>&lt;servlet-mapping&gt;<br />
 &lt;servlet-name&gt;hw&lt;/servlet-name&gt;<br />
 &lt;url-pattern&gt;hw.do&lt;/url-pattern&gt;<br />
&lt;/servlet-mapping&gt;</code><br />
The HelloWorldServlet extends WebSocketServlet and you have to implement the doWebSocketConnect method. This method returns a WebSocket. For now it&#8217;s enough to do a new HelloWorldWebSocket.</p>
<p>HelloWorldWebSocket implements WebSocket. The onConnect method receives an <a href="http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/websocket/WebSocket.Outbound.html" target="_blank">Outbound</a> object. With this object it is possible to send data back to the client. The Outbound object is a field on the WebSocket object so we can use it in the onMessage method.</p>
<p>The onMessage method:</p>
<pre lang="java">public void onMessage(byte opcode, String data) {
    outbound.sendMessage("pong");
}</pre>
<p>When we send data in javascript (with send()) the server will respond with &#8220;pong&#8221;.</p>
<h2>The Javascript side</h2>
<p>The Javascript is also very simple. I added the <a href="http://jquery.com/" target="_blank">jQuery</a> plugin to add data to a div with id bla, but your free to do it the old-fashioned way.</p>
<pre lang="javascript">var ws=new WebSocket("ws://10.0.0.230:8080/hw.do");
ws.onmessage = onMessage;
ws.onopen = onOpen;

function onMessage(m) {
    $("#bla").append(m.data + "&lt;br/&gt;");
}

function onOpen() {
    console.log("connection open")
}

function send(){
console.log("sending ping");
    ws.send("ping");
}</pre>
<p>For testing we&#8217;re using Safari, it has a really nice console (available under the menu Develop, Show Error Console). By typing send() in the console we&#8217;re sending a ping which will respond with a pong. The response is logged to the div with id bla.</p>
<p>It&#8217;s even possible to write a simple websocket client with nothing more than the console:</p>
<pre lang="javascript">var m=new WebSocket("ws://10.0.0.230:8080")
m.onmessage=function(m){ console.log(m.data); };</pre>
<p>This piece of code prints the payload of any received message. Sending is done with m.send(&#8220;data to send&#8221;);</p>
<h2>Problems</h2>
<h3>Thinking http is the protocol of websockets</h3>
<p>We used the browser to test whether the WebSocketServlet was working. Of course websockets uses the ws:// or ws:// prefix and we used http://. I made this mistake a couple of times.</p>
<h3>WebSocket is not ready</h3>
<p>We tried to send data over the socket, but got an INVALID_STATE_ERR. It appeared the WebSocket isn&#8217;t ready immediately after creating. After the WebSocket is ready the onopen function is called and then it&#8217;s ready to send and receive. The readyState field on a WebSocket is a useful field to check the status of the socket (0=connecting, 1=open, 2=closing, 3=closed). So don&#8217;t try to do anything with the websocket before onopen is called.</p>
<h3>WebSocket disabled in Firefox 4</h3>
<p>While we were coding away Dan North paid us a visit. In a very cool improvisation style presentation he pointed us to <a href="http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/" target="_blank">an article</a> about some security issues with websockets.</p>
<h2>Conclusion</h2>
<p>Websockets is a very cool technology and I&#8217;m very happy it was a subject of the techrally. Feel free to ask any questions. At least 5 people at Xebia are now websockets experts and even more listened to two presentations about it.</p>
<h2>Sources</h2>
<p><a href="http://blogs.webtide.com/gregw/entry/jetty_websocket_server" target="_blank">http://blogs.webtide.com/gregw/entry/jetty_websocket_server</a><br />
<a href="http://dev.w3.org/html5/websockets/" target="_blank">http://dev.w3.org/html5/websockets/</a><br />
<a href="http://blog.dannorth.net/" target="_blank">http://blog.dannorth.net/</a><br />
<a href="http://www.slideshare.net/spagalloco/introduction-to-websockets" target="_blank">http://www.slideshare.net/spagalloco/introduction-to-websockets</a><br />
<a href="http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin" target="_blank">http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin</a><br />
<a href="http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/" target="_blank">http://hacks.mozilla.org/2010/12/websockets-disabled-in-firefox-4/</a><br />
<a href="http://www.xoriant.com/blog/software-product-development/html5-series-websockets.html" target="_blank">HTML5 Series: Part 6: WebSockets</a></p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2010/12/15/websockets-from-scratch/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2010%2F12%2F15%2Fwebsockets-from-scratch%2F&amp;title=Websockets%20from%20scratch%20%26%238211%3B%20Results%20from%20a%20short%20techrally" id="wpa2a_4"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2010/12/15/websockets-from-scratch/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Developing with Google Wave</title>
		<link>http://blog.xebia.com/2009/06/08/developing-with-google-wave/</link>
		<comments>http://blog.xebia.com/2009/06/08/developing-with-google-wave/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 10:58:02 +0000</pubDate>
		<dc:creator>Sonny Gill</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Google Wave]]></category>

	<!-- AutoMeta Start -->
	<category>robot</category>
	<category>wave</category>
	<category>wavepanel</category>
	<category>gadgets</category>
	<category>robots</category>
	<category>gadget</category>
	<category>embed</category>
	<category>blip</category>
	<category>robot</category>
	<category>wave</category>
	<category>wavepanel</category>
	<category>gadgets</category>
	<category>robots</category>
	<category>gadget</category>
	<category>embed</category>
	<category>blip</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=1949</guid>
		<description><![CDATA[The last blog post, Understanding Google Wave, discussed the architecture and technical underpinnings of Google Wave. In this post, we will look at different ways of developing with Google Wave. There are three ways you can extend or use Google Wave in your applications. Embedding Wave You can embed a Wave into a web page [...]]]></description>
			<content:encoded><![CDATA[<p>The last blog post, <a href="http://blog.xebia.com/2009/06/08/understanding-google-wave/">Understanding Google Wave</a>, discussed the architecture and technical underpinnings of <strong>Google Wave</strong>. In this post, we will look at different ways of developing with Google Wave.<br />
<span id="more-1949"></span><br />
There are three ways you can extend or use Google Wave in your applications.</p>
<p><strong>Embedding Wave</strong></p>
<p>You can embed a Wave into a web page by adding some simple JavaScript code.<br />
The Wave Embed API provides the <a href="http://code.google.com/apis/wave/embed/guide.html#WavePanel">WavePanel</a> object which can hold a wave. You ask the WavePanel to use an HTML element on your web page to show a wave. The conversations on the wave will be visible in the WaveClient.</p>
<p>The steps to embed a wave on a web page are -</p>
<ol>
<li>
Load the Embed API JavaScript -</p>
<pre lang="JavaScript">
<script src="http://wave-api.appspot.com/public/embed.js" type="text/javascript"></script>
</pre>
</li>
<li>
Create an HTML element that will contain the embedded wave -</p>
<pre lang="html">
<div id="waveframe" style="width: 500px; height: 100%"></div>
</pre>
</li>
<li>
Initialize the WavePanel object -</p>
<pre lang="JavaScript">
	function initialize() {
	       var wavePanel = new WavePanel('http://wave.google.com/a/wavesandbox.com/');
	      	wavePanel.loadWave('wavesandbox.com!w' + waveID);
      		wavePanel.init(document.getElementById('waveframe'));
    	}
	...
	  <body onload="initialize()">
	...
</pre>
</li>
</ol>
<p>The wave is embedded in an iframe created inside the supplied HTML element.<br />
The argument passed to the WavePanel is the <em>Wave server instance</em>. This value is used to set up the URLs used in the iframe created. For the early developer access, it must be http://wave.google.com/a/wavesandbox.com/ (including the trailing slash).</p>
<p><strong>Extending Wave &#8211; Robots</strong></p>
<p>Robots are server side programs that can act as participants in a Wave. They can edit content, add users, extract content and post it to an external service thus acting as gateways between a Wave and an external service such as Twitter.<br />
A robot can respond to wave events such as wavelet_blip_created or wavelet_participants_changed. You can also specify a Cron schedule to ask the Wave to contact the robot at regular intervals.</p>
<p>You use a capabilities.xml file to specify what events a robot is interested in. An example from one of the samples is -</p>
<pre lang="xml">
<?xml version="1.0"?>
<w:robot xmlns:w="http://wave.google.com/extensions/robots/1.0">
     <w:capabilities>
          <w:capability name="wavelet_participants_changed"/>
      </w:capabilities>  
     <w:crons>
          <w:cron path="/_wave/robot/fetchupdate" timerinseconds="10" />
     </w:crons>
     <w:profile name="stocky" imageurl="/images/dj.jpg" profileurl="/_wave/profile.xml" />
</w:robot>
</pre>
<p>There are Python and Java libraries to help you write Robots. </p>
<p>In Java, you can extend <a href="http://wave-robot-java-client.googlecode.com/svn/trunk/doc/com/google/wave/api/AbstractRobotServlet.html">AbstractRobotServlet</a> class and implement <a href="http://wave-robot-java-client.googlecode.com/svn/trunk/doc/com/google/wave/api/AbstractRobotServlet.html#processEvents(com.google.wave.api.RobotMessageBundle)">processEvents(RobotMessageBundle events)</a> to create a wave robot. This class translates the incoming Wave events in the form of HTTP requests into Java method calls, and communicates the changes made back to the wave.</p>
<p>You interact with the wave by using objects provided by the <a href="http://wave-robot-java-client.googlecode.com/svn/trunk/doc/index.html">Wave Robot API</a>.<br />
The following lines of code add a new &#8220;blip&#8221; to a wave -</p>
<pre lang="Java">
		Wavelet wavelet = events.getWavelet();
            	Blip blip = wavelet.appendBlip();
            	TextView textView = blip.getDocument();
            	textView.append("Hello World!");
</pre>
<p>It seems that the only way to deploy a robot at the moment is to deploy it to Google App Engine. Then you can add the robot to a wave using its Wave ID, which is its App Engine application ID followed by @appspot.com. This should change in near future and allow you to deploy the robot to any URL.</p>
<p>See the <a href="http://code.google.com/apis/wave/extensions/robots/guide.html">Robots Tutorial</a> for a step by step guide.</p>
<p><strong>Extending Wave &#8211; Gadgets</strong></p>
<p>Gadgets are small programs that add functionality to the Google Wave client. They are written in JavaScript and HTML.<br />
Gadgets use the wave object defined in <a href="http://wave-api.appspot.com/public/wave.js">http://wave-api.appspot.com/public/wave.js</a> file to interact with the wave they are part of. Each gadget has a state object, which is a a map of key-value pairs. You can implement callbacks that are called by the wave whenever the gadget state or the list of participant changes.<br />
The HTML and JavaScript making up the gadget are packaged as an XML file, and can be hosted anywhere on the internet.<br />
See the Wave <a href="http://code.google.com/apis/wave/extensions/gadgets/guide.html">Gadgets tutorial</a> for example code for a gadget that allows you to run an auction in a wave.</p>
<p>
<strong>Resources</strong> -</p>
<p><a href="http://code.google.com/apis/wave/extensions/robots/guide.html">Google Wave Robots: Creating a Robot</a><br />
<a href="http://code.google.com/apis/wave/samples/index.html">Google Wave API samples</a><br />
<a href="http://code.google.com/apis/wave/extensions/gadgets/guide.html">Wave Gadgets Tutorial</a><br />
<a href="http://wave-robot-java-client.googlecode.com/svn/trunk/doc/index.html">Wave Robot API</a><br />
<a href="http://groups.google.com/group/google-wave-api">Google Wave API forum</a></p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/06/08/developing-with-google-wave/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F06%2F08%2Fdeveloping-with-google-wave%2F&amp;title=Developing%20with%20Google%20Wave" id="wpa2a_6"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/06/08/developing-with-google-wave/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Understanding Google Wave</title>
		<link>http://blog.xebia.com/2009/06/08/understanding-google-wave/</link>
		<comments>http://blog.xebia.com/2009/06/08/understanding-google-wave/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 09:51:42 +0000</pubDate>
		<dc:creator>Sonny Gill</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Concurrency Control]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Wave]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=1898</guid>
		<description><![CDATA[(This blog post gives an overview of the architecture and technical concepts in Google Wave. If you are interested in how to use Google Wave in your applications, see Developing with Google Wave) At Google I/O 2009, Google unveiled Wave. Wave is a new way of thinking about online conversations. Consider the following situations - You [...]]]></description>
			<content:encoded><![CDATA[<p>(This blog post gives an overview of the architecture and technical concepts in Google Wave. If you are interested in how to use <strong>Google Wave</strong> in your applications, see <a href="http://blog.xebia.com/2009/06/08/understanding-google-wave">Developing with Google Wave</a>)</p>
<p>At Google I/O 2009, Google unveiled Wave. Wave is a new way of thinking about online conversations.</p>
<p>Consider the following situations -</p>
<ol>
<li>
You write a blog post. Somebody comes around and posts a really insightful comment. Now, you or the comment author want to convert that comment into an independent blog post.
</li>
<li>
You have been having a long email discussion with a colleague. Now you would like to invite another colleague to the same. She will need to know the context of the discussion and how it evolved.
</li>
<li>
You email a few colleagues a draft of an article for review. They all email their comments back to you. A lot of them are suggesting the same changes without realizing that they have already been addressed.
</li>
</ol>
<p>With the tools we are using today such as email, blogs, IM etc., all of the above will require some kind of tedious copy &#8211; paste, and manual tracking of the changes being made.</p>
<p>Is there a better way?</p>
<p>The <strong>Google Wave</strong> model tries to provide a better way <span id="more-1898"></span> by doing away with the distinction between email, IM and other forms of online conversations. In this model, an email conversation, a blog post with its comments or an auction with its bids, are just online conversations with multiple participants. At the data model level, all you have is a wave, and you can look at it in many different ways.</p>
<p>Multiple participants can edit a Wave at the same time, and the wave client can show the changes in real time. The changes made to a Wave are stored as a series of operations. You can play the changes back, or revert the Wave to an earlier version. At the data model level, constituents of the Wave form a tree structure. You can take a particular node and spin it into an independent Wave.</p>
<p>Wave providers (servers) give out Wave accounts, and are responsible for sharing Waves with the clients, as well as with other Wave servers. Wave servers communicate with each other using <strong>Google Wave Federation Protocol</strong>, which is an extension of XMPP protocol. Wave servers use cryptographic signatures and certificates, in addition to transport level encryption provided by XMPP, to authenticate among themselves.</p>
<p><strong>Google Wave Operational Transformation</strong></p>
<p>A key concept at the center of Google Wave is <strong>Operational Transformation</strong> (OT). </p>
<div>
<div style="border: 2px; float:right; text-align:center; padding-left:20px;padding-bottom:20px">
<img class="size-full wp-image-1900" title="Operational Transformation" src="http://blog.xebia.com/wp-content/uploads/2009/06/basic_ot.png" alt="Operational Transformation" width="384" height="200"  style="float:right"/></p>
<hr/>
<small><br />
Credit: <a href="http://en.wikipedia.org/wiki/File:Basicot.png" title="Wikipedia" target="_blank">Wikipedia</a></small>
</div>
<p>Many participants can edit a Wave at the same time, and they can see each other&#8217;s changes as they are made. These attributes, concurrent modification and low latency updates, are implemented based on OT.<br />
OT is a framework for concurrency control. The document being edited is replicated at all sites. All editing actions are stored as operations that are propagated across all clients, local and remote. Concurrent edits are transformed by the server before being applied and the transformed operations are communicated to all clients. This is very similar to how version control systems like CVS manage merging of simultaneous edits of a document.
</p></div>
<p style="clear:both;">
From the <strong>Google Wave Operational Transformation</strong> whitepaper -</p>
<blockquote><p>
Wave OT modifies the basic theory of OT by requiring the client to wait for acknowledgment from the server before sending more operations. When a server acknowledges a client&#8217;s operation, it means the server has transformed the client&#8217;s operation, applied it to the server&#8217;s copy of the Wavelet and broadcasted the transformed operation to all other connected clients. Whilst the client is waiting for the acknowledgment, it caches operations produced locally and sends them in bulk later.</p></blockquote>
<p>For more technical details on these topics, see <a href="http://en.wikipedia.org/wiki/Operational_transformation">Operational transformation</a>, and <a href="http://www.waveprotocol.org/whitepapers/operational-transform">Google Wave Operational Transformation</a>.</p>
<p><strong>Google Wave Data Model</strong></p>
<p>A Wave is made up of Wavelets. Each wavelet has a unique id within its wave. The Wavelet contains a list of participants and a set of documents. A document in a wavelet has a unique id within its wavelet. It is composed of an XML document, and a set of annotations. Some of these annotations specify the styling of the text content of the document.<br />
Concurrency control and operational transformation are applied at the level of Wavelets. A particular wave user may only have access to a subset of the wavelets in that wave.</p>
<p>The state of a wavelet is defined entirely by an ordered sequence of operations that have been applied to it. Wave clients send these operations to the server to communicate changes to the underlying document, and the server propagates these operations (after a transformation, if required) to other clients and other servers participating in the wave.</p>
<p><strong>Resources &#8211; </strong><br />
<a href="http://www.waveprotocol.org/whitepapers/internal-client-server-protocol">Google Wave Data Model and Client-Server protocol</a><br />
<a href="http://www.waveprotocol.org/whitepapers/google-wave-architecture">Google Wave Federation Architecture</a><br />
<a href="http://en.wikipedia.org/wiki/Operational_transformation">Operational transformation</a><br />
<a href="http://groups.google.com/group/wave-protocol/">Wave Protocol forum</a><br />
<a href="http://googlewavedev.blogspot.com/">Google Wave Developer Blog</a></p>
<p>In the next blog post on this subject, we will look at different ways of <a href="http://blog.xebia.com/2009/06/08/developing-with-google-wave">developing with Google Wave</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/06/08/understanding-google-wave/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F06%2F08%2Funderstanding-google-wave%2F&amp;title=Understanding%20Google%20Wave" id="wpa2a_8"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/06/08/understanding-google-wave/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web 2.0 Expo 2009 San Francisco</title>
		<link>http://blog.xebia.com/2009/04/07/web-20-expo-2009-san-francisco/</link>
		<comments>http://blog.xebia.com/2009/04/07/web-20-expo-2009-san-francisco/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 02:49:50 +0000</pubDate>
		<dc:creator>Anurag Shrivastava</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/blog.xebia.com/www/wp-content/plugins/autometa/autometa.php</b> on line <b>303</b><br />
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Scrum]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[JavaOne]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://blog.xebia.com/?p=1024</guid>
		<description><![CDATA[San Francisco 31 March &#8211; 3 April: Web 2.0 Expo brought together people with diverse professional backgrounds, having interest in Web 2.0, at Mascone Centre in San Francisco. San Francisco Bay Area, also known as Silicon Valley boasts of high concentration of information technology companies of all sizes ranging from biggies like Intel Corporation to [...]]]></description>
			<content:encoded><![CDATA[<p>San Francisco 31 March &#8211; 3 April: <a href="http://www.web2expo.com/webexsf2009">Web 2.0 Expo</a> brought together people with diverse professional backgrounds, having interest in Web 2.0, at Mascone Centre in San Francisco. San Francisco Bay Area, also known as Silicon Valley boasts of high concentration of information technology companies of all sizes ranging from biggies like Intel Corporation to numerous start ups trying to make it big.<br />
<span id="more-1024"></span></p>
<p>At the expo Twitter was hot and so were the social networking or the social effects of web 2.0 to drive economy and business. Power of less was the new phrase in vogue which also reflected the mood of participants hearing the news of US jobs losses real time as this four day long event progressed.</p>
<p>Making web work to search local information could be a new mantra to help people who are seeking local information such as price of a watch in nearby stores. As mobile internet becomes more popular, these searches can influence consumers’ behavior when he is looking for a product in the high street. For example, consider Google search where it figures out a possible local context from a search term and displays the local results on the top. Nokia hinted at making location aware mobile devices integrated with smart camera phones that can take advantage of internet to pull the information about a landmark from Wikipedia that you are trying to shoot.</p>
<p>Probably every participant in the Expo was using Twitter or Facebook. Alex Payne of Twitter explained why they have chosen Scala to solve scalability problem in their backend queuing system. He said because of Scala they have an API test suite that <em>helps them sleep</em>.</p>
<p>User Interaction design grabbed good attention during a demo of Adobe Flex Catalyst in a keynote session that demonstrated how graphic design can be converted in to a Flex application with some cool transition effects using Catalyst. An interesting session was on user experience and software development <em>Can&#8217;t We Just All Get Along? Human-centered Design Meets Agile Development </em>by Maria Giudice who moderated a panel of four other people having software development and user experience design background. The panel covered the challenges in combining the short iterative nature of Agile projects with creative user experience design activity that creates conflict.</p>
<p>As the funding for new ventures dries up there is a remarkable increased in Agile awareness and adoption in the Web 2.0 community. Eric Ries, who is a popular author and speaker and publishes a blog titled Start up <a href="http://startuplessonslearned.blogspot.com/">Lessons Learned</a>, delivered a talk titled Lean Startup. In a jam packed hall, he suggested that a lean startup company should quickly iterate from <a href="http://bit.ly/245Wfj">ideas to code to data collection</a>. Eric Ries ideas encapsulate various Agile practices in an iterative cycle and provide an overall big picture that many popular Agile methodologies seem to be lacking.</p>
<p>Some of the key take aways from this events are as follows:<br />
1. Agile is at the point of becoming mainstream way of software development<br />
2. Mobile Internet and Geo Location APIs will drive application development in coming years<br />
3. User experience and new ways of Human Computer Interaction will drive application development as demonstrated by Wii and iPhone<br />
4. Value of social network grows geometrically as number of users increase<br />
5. Web 2.0 technologies are making their inroads behind Enterprise firewall<br />
6. Public API makes integrating content easier which amplifies the network effect of a social platform</p>
<p>Adobe Systems, IBM, Salesforce.com, Nokia and Microsoft were the major vendors who participated in this event as exhibitors.</p>
<p>Keynote presentations including very inspiring lectures from <a href="http://blip.tv/file/1947371">Tim O&#8217;Reilly</a> and <a href="http://blip.tv/file/1948583">John Maeda</a> are available on <a href="http://web2expo.blip.tv/">blip.tv</a>.</p>
<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="small" count="1" href="http://blog.xebia.com/2009/04/07/web-20-expo-2009-san-francisco/"></g:plusone></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.xebia.com%2F2009%2F04%2F07%2Fweb-20-expo-2009-san-francisco%2F&amp;title=Web%202.0%20Expo%202009%20San%20Francisco" id="wpa2a_10"><img src="http://blog.xebia.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.xebia.com/2009/04/07/web-20-expo-2009-san-francisco/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.xebia.com/category/web-20/feed/ ) in 0.65813 seconds, on Feb 9th, 2012 at 4:14 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 9th, 2012 at 5:14 pm UTC -->
