<?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>Writing for (y)EU &#187; geek</title>
	<atom:link href="http://www.writingforyeu.eu/tag/geek/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.writingforyeu.eu</link>
	<description>A blog for a team.</description>
	<lastBuildDate>Fri, 03 Feb 2012 07:21:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Love your geeks, love me</title>
		<link>http://www.writingforyeu.eu/2011/05/love-your-geek-love-me/</link>
		<comments>http://www.writingforyeu.eu/2011/05/love-your-geek-love-me/#comments</comments>
		<pubDate>Wed, 18 May 2011 13:51:57 +0000</pubDate>
		<dc:creator>Matthieu</dc:creator>
				<category><![CDATA[At work]]></category>
		<category><![CDATA[Did you know?]]></category>
		<category><![CDATA[Guest blogger]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[programing]]></category>
		<category><![CDATA[Whatever]]></category>

		<guid isPermaLink="false">http://www.writingforyeu.eu/?p=6579</guid>
		<description><![CDATA["Love your geeks!" So we have been told. We could not do what we do without them. We could not progress without them. It is they, not us, who come up with the ideas which take the internet forwards. But should this love for our geeks extend to letting them loose on the blog? Read on, if you dare.]]></description>
			<content:encoded><![CDATA[<p><em>We&#8217;ve always been told to <a href="http://www.ep-webeditors.eu/2009/11/post-match-analysis-personal-democracy-forum-in-barcelona/" target="_blank">love our geeks</a> &#8211; because they are the ones allowing us to publish whatever random thoughts we may have, any editorial content or strong analysis of the European Parliament. Poor editorial guys (like me) don&#8217;t go far with a pen and a paper, those days. So, here comes Mathieu&#8217;s first contribution to this blog. He&#8217;s our Facebook developer and he will now explain you how he developed our world acclaimed Facebook Chat application. Once you&#8217;ve read this post, you&#8217;ll understand why I always, always, always specify I am an editorial guy and NOT a technical one. </em></p>
<p><span id="more-6579"></span></p>
<p>I was suggested to write a blog post about my experience here at the European Parliament, inside the WebComm unit and especially about the development of the<a href="http://www.facebook.com/europeanparliament?sk=app_188929731130869" target="_blank"> Facebook Chat Application </a>we just finished.</p>
<p>I don&#8217;t feel terribly confident about writing non-scientific content, especially with all those talented editors around me, but I like challenges and I thought it might be an interesting experiment.</p>
<p>So where to start? First of all let&#8217;s break some myths here. The European institutions and especially the European Parliament are not only composed of old-lazy-boring-suit-wearing guys. I mean I only discovered a small part of the European Parliament, which is the WebComm unit, part of the DG Comm. and all I could see where young, motivated, dynamic people. This is quite the opposite of my preconceived ideas and I really like to be surprised. Of course we have to face a little bit of administrative slowness for some things but in general I&#8217;m able to do my job in a smart, agile and constructive way. So that&#8217;s done.</p>
<p>About the Facebook chat application. I can say it has been quite a challenge for mostly 3 reasons :</p>
<ol>
<li>Real-time web application</li>
<li>Scalability</li>
<li>Agility needed</li>
</ol>
<p><strong>1) Real-time web application</strong></p>
<blockquote><p>Maybe it&#8217;s time to do a short (and incomplete) history of web development</p></blockquote>
<p>Traditional web applications are not designed to be &#8220;real-time&#8221;. By &#8220;real-time&#8221; I mean that all the users connected to the application must be signaled all the changes as soon as they are made (in real-time) and not only when they refresh the page. Maybe it&#8217;s time to do a short (and incomplete) history of web development :</p>
<p>1) Static pages: at first they were static html pages. A guy would write HTML* code in some text files, save those in some directory. Other people could then connect to www.someserver.com, their browser would then start from the index.html file located at the root of the web directory, parse it and display it. The user would typically click a link and would then load another html file eg. contacts.html and see the contacts page of the site.</p>
<p>This had many disadvantages :</p>
<p>1) HTML is not easy to write for anybody, so you need specialists for any page produced</p>
<p>2) You had to write html for each and every thing, if you wanted a gallery with 200 items, you would have 200 html files or 1 gigantic one.</p>
<p>3) Content was really static, meaning static text, borders and pictures**</p>
<p>Trying to ameliorate, server (scripting) technologies were developed. In fact you don&#8217;t have to write every line of html of what the user sees. You can write code that generates HTML files. Let say you have a e-shop, you don&#8217;t have to create an HTML page for every article, you create an article template, an administration site where men can enter information about the products, you then associate urls to different products like www.eshop.com/products/1 www.eshop.com/products/2 would return an HTML file generated &#8220;on the fly&#8221; by the server using the template and filing in data from the administration site.</p>
<p style="text-align: center;">&nbsp;</p>
<div id="attachment_6592" class="wp-caption aligncenter" style="width: 665px"><a href="http://www.ep-webeditors.eu/wp-content/uploads/2011/05/comethttp.jpg"><img class="size-large wp-image-6592" title="comethttp" src="http://www.ep-webeditors.eu/wp-content/uploads/2011/05/comethttp-1024x553.jpg" alt="" width="655" height="354" /></a><p class="wp-caption-text">This illustrates Mathieu&#39;s point (or so we are told)</p></div>
<p>But server technologies couldn&#8217;t solve entirely the third point (really static content), Content could be generated by the server and customized for the user, it wouldn&#8217;t make the user&#8217;s experience much richer as the user was still seeing a static HTML file and clicking to the next static text/image page. So &#8220;they&#8221; came up with javascript which was a way to modify what the user see with scripts. It changed web programming forever because you could now write logic that would execute on users actions to the page.</p>
<p>For example you could have a button that would become red when the mouse was over it, or a panel that would open when clicked. Well I&#8217;m digressing a little bit, let&#8217;s hurry up. After that they invented &#8220;ajax&#8221;*** so that the browser could contact the server using javascript and fetch new content to refresh your page, so you didn&#8217;t have to &#8220;navigate&#8221; to another page on every action that required interaction with the server (like viewing other items or submitting a form).</p>
<p>Nevertheless all these evolutions lead to the webpages you see now, well that&#8217;s not entirely true, because javascript could make the pages more dynamic but it couldn&#8217;t make them more &#8220;multimedia&#8221;, and the users wanted videos and sounds, that&#8217;s were macromedia jumped in and came up with flash, that was later bought by adobe and that we still use to watch videos and sounds on internet, recently this changed because we see a trend to come back to pure html/javascript with the coming of html5 and it&#8217;s video and audio tags as well as css3 for the animations.</p>
<p><strong>2°) Scability</strong></p>
<p>To explain my point, all these evolutions didn&#8217;t solve my problem, because as I said, a Chat must be a &#8220;realtime&#8221; application and all this javascript and servers stuff cannot do real time applications, why would you ask me ? Because in this standard model content is send to the clients/users only when the user click somewhere or do something, at this precise moment a connection is made to the server, which responds with required content. But in a multiuser chat, when somebody sends a message, all the other users of the chat must receive this message ASAP.</p>
<p>A solution could be to have each client connect the server every second or so to ask if there is a new message. The problem with this and that&#8217;s where we get to the second difficulty, is that &#8220;it doesn&#8217;t scale&#8221;! First let&#8217;s explain the term : &#8220;It doesn&#8217;t scale&#8221; is a shortcut for something like : it works for 5 users but it doesn&#8217;t scale up to 10000 users.</p>
<p>Why this method of having each client ping the server every second doesn&#8217;t scale ? Because if you have 10000 clients connected, that makes you 10000 connections by second to the server just for the &#8220;realtime&#8221; features, meaning that it doesn&#8217;t event include the users loading the page, interacting, liking and sending message and you get those 10000 connections per second even if nothing happen during this time.</p>
<blockquote><p>After a lot of experimentation and researching I chose the following setup: nginx + uwsgi + python/django + APE =)</p></blockquote>
<p>The solution needs to be able to send messages to the clients as soon as (and only when) a new message arrives. That&#8217;s were &#8220;server push&#8221; arrived, it&#8217;s actually an umbrella term to describe the possibility of sending data from the server to the client when new data arrives and not when the user refresh. Real push is called &#8220;http streaming&#8221; and is not supported by older browsers aka IE. So tweakers came up with a solution called &#8220;long-polling&#8221; the browser opens a connection to the server, the server wait to answer, the connections is kept open, when fresh data arrives, the server answer like he should have directly when the browser receives data, it handle it and then reopen a &#8220;long-polling&#8221; connection to the server. You can visualize all this in the Figure 1.</p>
<p>After a lot of experimentation and researching I chose the following setup:</p>
<p>nginx + uwsgi + python/django + APE =)</p>
<p>What are all these geeky terms ?</p>
<p>Nginx is a next gen webserver that&#8217;s capable of handling a ridiculous huge amount of connection on ridiculously small hardware. It is in my opinion a huge concurrent to the fat apache out there.</p>
<p>Uwsgi is a &#8220;fast, self-healing and developer/sysadmin-friendly application container server coded in pure C&#8221; and it executes python code that runs the django framework.</p>
<p>Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. What this all means is that you can be a lot more productive with python than with other low-level compiled languages (because high level means you don&#8217;t care about the low level stupid stuff, and interpreted means that you don&#8217;t have to recompile the program after every change, it just runs directly)</p>
<p>Django is &#8220;The web framework for perfectionists with deadlines&#8221; or a high-level Python Web framework that encourages rapid development and clean, pragmatic design.</p>
<p>APE is Ajax Push Engine, one of the more mature libraries out there for doing server push, it can be configured to user different transport and is also written in C (read : it&#8217;s really fast)</p>
<p>So all the business logic and serverside was developed in django.</p>
<p>Real-times updates are sent from django to APE which send them to all connected users and then there is a lot of HTML/CSS/Javascript/Jquery to hold it together in the browser :)</p>
<p>So now we have enough &#8220;nerderies&#8221; I think. Feel free to contact me if you have some technical questions.</p>
<p><strong>3°- Agility</strong></p>
<p>That&#8217;s were I get to my last point : Agile development. We didn&#8217;t want to come up with the &#8220;wonderfullest chat on paper&#8221; that would turn unusable in practice. So we progressively developed features and tested it among us to feel and touch the thing, changing it multiple times. And that&#8217;s what agile is all about : small, realistic iterations that are validated, or in other words : if you do a lot of small steps you can only do some small steps in the wrong direction, but if you try to do a huge step, you can end-up doing a huge step in the wrong direction and lose a lot of time and money.</p>
<p>Agile thus equals programmers not programming wrong, but also not getting crazy during long periods alone in their desks. And small iterations, means frequent tests and meetings, and that&#8217;s where we get to the interesting part of all:</p>
<p>Humans working together to share with other humans their dream: democracy and freedom!</p>
<p>As a bonus, here is a video showing the coding process of our facebook&#8217;s chat application.</p>
<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=23906910&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=23906910&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/23906910">Visualization of the EP-FB chat source code evolution.</a> from <a href="http://vimeo.com/mathvdh">Mathieu VDH</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>&nbsp;</p>
<p>Cheers,</p>
<p>Your fellow Facebook developer.</p>
<p>* imagine HTML as language to layout text, images and frames on any screen</p>
<p>** picture were introducted in 1994</p>
<p>*** Asynchronous Javascript And XML</p>
]]></content:encoded>
			<wfw:commentRss>http://www.writingforyeu.eu/2011/05/love-your-geek-love-me/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>To tweet or not to tweet?</title>
		<link>http://www.writingforyeu.eu/2010/02/to-tweet-or-not-to-tweet/</link>
		<comments>http://www.writingforyeu.eu/2010/02/to-tweet-or-not-to-tweet/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 16:26:51 +0000</pubDate>
		<dc:creator>Nadina</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[techonology]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.writingforyeu.eu/?p=3378</guid>
		<description><![CDATA[Here is the reverse side of the coin for Twitter? Or  perhaps just a better explanation? Watch a teenager speaking about the point of twitter and about the world according to Twitter in his series, specially dedicated for &#8220;tech geeks&#8221;, as he says, or, why not, everybody interested&#8230;]]></description>
			<content:encoded><![CDATA[<p>Here is the reverse side of the coin for Twitter? Or  perhaps just a better explanation? <a href="http://www.youtube.com/watch?v=TNY50BwpYwk ">Watch</a> a teenager speaking about the point of twitter and about the <a href="http://www.davidpogue.com/bio_photos/twitter.html">world according to Twitter </a>in his series, specially dedicated for &#8220;tech geeks&#8221;, as he says, or, why not, everybody interested&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.writingforyeu.eu/2010/02/to-tweet-or-not-to-tweet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Live streaming &#8211; sorry, PC only.</title>
		<link>http://www.writingforyeu.eu/2010/01/live-streaming-sorry-pc-only/</link>
		<comments>http://www.writingforyeu.eu/2010/01/live-streaming-sorry-pc-only/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 16:05:37 +0000</pubDate>
		<dc:creator>Tayebot</dc:creator>
				<category><![CDATA[At work]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[Hearings]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[streamings]]></category>
		<category><![CDATA[ultra-geek]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.writingforyeu.eu/?p=3085</guid>
		<description><![CDATA[In this post, we address a situation we're not happy with: our live video streams are only accessible to users with a PC (or with Windows OS). Warning: this is a geeky post and half of it may be unnacurate.  ]]></description>
			<content:encoded><![CDATA[<p>I am an editorial kind of guy. Nobody would ever ask me to fix their computer &#8211; and this is a wise attitude. But as an editorial coordinator, I prefer our users to be happy with the content we provide. Since yesterday, when the Hearings of Commissionners&#8217; process started, we have received complaints from Mac users. They can&#8217;t watch the hearings&#8217; video streams. We cherish Mac Users, not only because <a href="http://www.ep-webeditors.eu/2009/11/being-a-mac-being-a-pc/">they choose better colour for their kitchen wall </a>and not only because a significant number of them belong to our team, but because they are users and they deserve the same service quality as everyone else with a grey PC box. Oh, perhaps the high representation of Mac users in the Press corp may also explain that. Yesterday, 5% of <a href="http://www.europarl.europa.eu/hearings/default.htm?language=en" target="_blank">our Hearings website</a>&#8216;s visitors were using Mac OS or Linux (mainly Macs). That&#8217;s potentially a lot of disgruntled people, actually&#8230;</p>
<p>I&#8217;ve known for a long time that our video streams don&#8217;t comply with Macs. It&#8217;s a subject we discuss about almost every two months since I started working here. But today, I wanted to understand why. So, like Magnum P.I., I investigated. In order to explain the situation, I&#8217;ll have to enter the technical world, hence the caveats below.</p>
<p>CAVEAT: I don&#8217;t understand half of what I am writing below. I am NOT an IT guy. Please, please, please don&#8217;t write me to bash me on mistakes: better propose a correction in the comments area, that&#8217;d be nice.</p>
<p>CAVEAT #02 : The following has been proofread and corrected by one of the genius geek downstairs who prefers to remain anonymous to avoid spam from the other geeks around him (they live in a kind of tribe or something). Still, if something sounds wrong, blame me, not him.</p>
<p>I&#8217;ll use the <a href="http://en.wikipedia.org/wiki/5_Whys" target="_blank">Toyota Five Why method</a>, it sounds cool.</p>
<p><strong>1°- Why Mac users can&#8217;t play the hearings&#8217; video streams properly?</strong></p>
<p>Well, they can but they&#8217;ll get all audio streams at once. It sounds like the Tower of Babel after its fall. The reason is our video streams are encoded in Windows Media Video format (.wmv) while Macs better work with MPEG4 format. In order to correctly select the video with their language of choice, all users (including PC users) need the latest version of Explorer or Firefox and the latest version of Windows Media Player.</p>
<p>That&#8217;s right: to play a video on Internet, you need two things. A browser (Safari, Explorer etc.) and a player (Quicktime, Flash player, Windows Media&#8230;). Macs can play .wmv files all right (which is why Macs users can still benefit from our <a href="http://www.europarl.europa.eu/wps-europarl-internet/frd/vod/search-other-events?language=en" target="_blank">Hearings Video on demands</a>) but they are less efficient in coping with .wmv live streams which include multiple audio files.</p>
<div id="attachment_3094" class="wp-caption aligncenter" style="width: 755px"><a href="http://www.ep-webeditors.eu/wp-content/uploads/2010/01/proof.jpg"><img class="size-full wp-image-3094  " title="proof" src="http://www.ep-webeditors.eu/wp-content/uploads/2010/01/proof.jpg" alt="" width="745" height="368" /></a><p class="wp-caption-text">I am telling you it works on my PC</p></div>
<p><strong>2°- Why don&#8217;t we encode in MPEG4?</strong></p>
<p>In order to turn an event into a digital movie, you need hell of a lot of stuff (cameras, micros, robotic cameras etc.). To produce the actual file you want to stream, you need video encoding cards. All our audiovisual gear encode live streams in .wmv. We encode the <a href="http://www.europarl.europa.eu/wps-europarl-internet/frd/vod/research-by-date?language=en">Video on Demand files of the Plenary session </a>in both: in .wmv and in .mpeg4. We don&#8217;t have the technical capacity to encode the live streams in both formats at the same time because we don&#8217;t have enough encoding video cards. The choice has been made to encode live streams in .wmv.</p>
<p><strong>3°- Why did we chose to encode in .wmv in the first place ?</strong></p>
<p>When we started to broadcast the Plenary session live in video, the .wmv format was the only format that allowed multilanguage url. Multilanguage url allows you to associate one video stream with different audio streams. You don&#8217;t have to duplicate the video file, you associate it with a selected audio stream from many available. MPEG4, I am told, was not good at that but it became better lately. At that time, PC users were the vast majority. They still are. Except for all those creative people and journalists who insist on following the Hearings, dammit ;-)</p>
<blockquote><p>Linux people are extremely good at finding things out by themselves. They know how to play any kind of video streams. They&#8217;re super-geeks, you know</p></blockquote>
<p><strong>4°-</strong> <strong>Why don&#8217;t you use a Flash player like YouTube and all p0rn websites?</strong></p>
<p>This is a good one. Flash video player have become extremely popular on Internet lately and they can work with all video streams source (.wmv or .mpeg4). Users just need the latest version of Flash on their computers and everyone is happy. Flash players are used by <a href="http://www.europarltv.eu" target="_blank">europarltv</a> (except for the live streaming).</p>
<p>But. In order to stream a video, you need a transport protocol. We use the protocol rtsp. This protocol doesnt go well in Flash player, mind you, since Adobe (the owner of Flash technology) prefers one uses the rtmp protocol, which belongs to them. If we would move to rtmp protocol, we&#8217;d have to buy a lot of licenses. The solution is currently scrutinized. Also, we would use a closed transport protocol, &#8220;closed&#8221; opposing here the &#8220;open source&#8221; philosophy.</p>
<p><strong>5- Why don&#8217;t you adress Linux users?</strong></p>
<p>My internal IT experts said: &#8220;Linux people are extremely good at finding things out by themselves. They know how to play any kind of video streams. They&#8217;re super-geeks, you know&#8221;. But, to be fair, he also said: &#8220;Non-geek Linux users would be lost if we were to chose complicated to set up players, codex, plud-ins and so on.&#8221; Hence his taste for a Flash+MPEG4 solution.</p>
<p><strong>Bonus question: will you adress this problem before the next century?</strong></p>
<p>Yes, we will. So far, four solutions are possible.</p>
<p>- We invest in more machines and encoding video cards so we can simultaneously encode our live events in as many video formats as possible, or abandon the .wmv. In all cases, we should be able to propose MPEG4 for live streamings and video on demand. MPEG4 is a pre-condition for almost all possible solutions. Of course, the best amongst you will suggest we use SilverLight (Flash à la Microsoft) which can use a .wmv stream in a SilverLight player. But few have tried. It would cost a lot in research and analysis. And it would be also a proprietary format.</p>
<p>- We buy enough rtmp licenses and we develop Flash players embedded on our website ;</p>
<p>- We develop Flash players embedded on our website able to read directly our MPEG-4 stream via rtsp protocol ;</p>
<p>- We all move to html 5 wich proposes a new &#8220;player video&#8221; tag which transfers the video playing&#8217;s responsibility to the the user browser and not to the video player anymore.</p>
<p>I hope the last sentence is correct because you lost me somewhere around the protocol of transport thing.</p>
<p>The different EP IT teams are working on it. And we will certainly impose easy live streaming for all as a pre-condition of <a href="http://www.ep-webeditors.eu/2010/01/help-its-a-blank-sheet-moment/" target="_blank">our future new website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.writingforyeu.eu/2010/01/live-streaming-sorry-pc-only/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

