<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Willem Stuursma</title>
	<atom:link href="http://willem.stuursma.name/feed/" rel="self" type="application/rss+xml" />
	<link>http://willem.stuursma.name</link>
	<description>Passionate on product and programming</description>
	<lastBuildDate>Wed, 29 Feb 2012 21:39:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='willem.stuursma.name' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Willem Stuursma</title>
		<link>http://willem.stuursma.name</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://willem.stuursma.name/osd.xml" title="Willem Stuursma" />
	<atom:link rel='hub' href='http://willem.stuursma.name/?pushpress=hub'/>
		<item>
		<title>Special password keyboard on BlackBerry Playbook</title>
		<link>http://willem.stuursma.name/2012/02/22/special-password-keyboard-on-blackberry-playbook/</link>
		<comments>http://willem.stuursma.name/2012/02/22/special-password-keyboard-on-blackberry-playbook/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 11:02:25 +0000</pubDate>
		<dc:creator>stuursma</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[BlackBerry Playbook]]></category>
		<category><![CDATA[keyboard layouts]]></category>
		<category><![CDATA[keyboards]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Playbook OS]]></category>

		<guid isPermaLink="false">http://willem.stuursma.name/?p=435</guid>
		<description><![CDATA[I recently did a post on the different types of keyboards on the iPhone and other iDevices. Supporting the user with the right keyboard when entering data is really, really important. It just makes entering stuff so much easier. That is why I was pleasantly surprised to see the new passwords keyboard in the Playbook [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=435&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently did a post on the <a href="http://willem.stuursma.name/2012/01/30/an-overview-of-different-iphone-keyboards-in-mobile-safari/">different types of keyboards on the iPhone</a> and other iDevices. Supporting the user with the right keyboard when entering data is really, really important. It just makes entering stuff so much easier.</p>
<p>That is why I was pleasantly surprised to see the new passwords keyboard in the Playbook OS 2.0 update:</p>
<p><a href="http://willemst.files.wordpress.com/2012/02/keyboard.jpg"><img class="aligncenter size-medium wp-image-436" title="Playbook OS 2.0 password keyboard" src="http://willemst.files.wordpress.com/2012/02/keyboard.jpg?w=300&#038;h=175" alt="" width="300" height="175" /></a></p>
<p>As you can see, the keyboard contains an extra row compared to the normal keyboard for numbers. Most of my passwords contain numbers, and on iOS switching between the normal and the numeric keyboard for entering passwords is a bit of a pain. Glad to see how RIM solved this and I hope the other smartphone and tablet manufactures follow soon.</p>
<p>The keyboard will automatically be triggered when a password field receives focus.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/willemst.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/willemst.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/willemst.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/willemst.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/willemst.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/willemst.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/willemst.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/willemst.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/willemst.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/willemst.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/willemst.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/willemst.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/willemst.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/willemst.wordpress.com/435/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=435&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://willem.stuursma.name/2012/02/22/special-password-keyboard-on-blackberry-playbook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eeeed33e97bb956677957d0e24700c36?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuursma</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2012/02/keyboard.jpg?w=300" medium="image">
			<media:title type="html">Playbook OS 2.0 password keyboard</media:title>
		</media:content>
	</item>
		<item>
		<title>Attending BlackBerry DevCon Europe 2012</title>
		<link>http://willem.stuursma.name/2012/02/10/attending-blackberry-devcon-europe-2012/</link>
		<comments>http://willem.stuursma.name/2012/02/10/attending-blackberry-devcon-europe-2012/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 14:50:17 +0000</pubDate>
		<dc:creator>stuursma</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[BlackBerry Playbook]]></category>
		<category><![CDATA[devcon]]></category>
		<category><![CDATA[devcon europe]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[hyves]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Research In Motion]]></category>
		<category><![CDATA[rim]]></category>

		<guid isPermaLink="false">http://willem.stuursma.name/?p=425</guid>
		<description><![CDATA[This week I attended BlackBerry DevCon Europe, a two day conference for BlackBerry developers. Although I am do not develop native applications for BlackBerry, the Hyves Mobile web app also supports the BlackBerry platform (most phone devices and the Playbook). Many of the sessions at the conference focused on mobile / HTML5 development, so it did [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=425&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-429" title="Schermafbeelding 2012-02-10 om 15.24.31" src="http://willemst.files.wordpress.com/2012/02/schermafbeelding-2012-02-10-om-15-24-31.png?w=600" alt=""   />This week I attended <a href="http://www.blackberrydevcon.com/europe">BlackBerry DevCon Europe</a>, a two day conference for BlackBerry developers. Although I am do not develop native applications for BlackBerry, the <a href="http://www.hyves.nl/hybrid/">Hyves Mobile web app</a> also supports the BlackBerry platform (most phone devices and the Playbook). Many of the sessions at the conference focused on mobile / HTML5 development, so it did seem like quite interesting for me.</p>
<p>The conference was at the Amsterdam RAI Convention centre and via my employer <a href="http://www.hyves.nl/">Hyves</a> I could easily get a ticket, although I was only able to attend a single day.</p>
<p>In general, I was quite impressed with the event. It was very well organized and the sessions were quite diverse, though they could have been somewhat more in-depth.</p>
<p>It was obvious from the conference that RIM wants to push the BlackBerry Playbook as a device that&#8217;s great to develop for. All presentations and demos were ran from a Playbook and all attending developers were given a Playbook to take home. Several speakers pointed out that the Playbook allows remote web debugging with the web inspector, in a similar fashion as the <a href="http://willem.stuursma.name/2011/12/09/how-to-enable-remove-web-inspector-for-uiwebview/">iPhone simulator allows</a> (although with the Playbook you can debug on an actual device).</p>
<p>I attended sessions mostly on web topics such as <a href="http://phonegap.com/">Phonegap</a> / <a class="zem_slink" title="BlackBerry PlayBook" href="http://us.blackberry.com/playbook-tablet" rel="homepage">BlackBerry Webworks</a>, HTML5 canvas, CSS frameworks for creating transitions and animations and one on the Cloud9 in browser IDE. A non-technical session I attended was &#8220;Working with Bloggers and Media,&#8221; in which a panel of bloggers discussed their motivations for writing an article on an app or not, and what you can do to make this easier for them, and what points in the app life cycle can be used for generating publicity. Contained a wealth of useful advice and case studies.</p>
<p>In particular, the presentation on the <a class="zem_slink" title="Financial Times" href="http://www.ft.com/" rel="homepage">Financial Times</a> web app was very impressive. This apps allows you to browse the Financial Times content on many types of mobile devices and also off line. The app is very similar to the Hyves mobile that I have been working on, except that the FT app has much better support for using it off line. I really liked the trick to convert base64 encoded images to a different encoding that uses all the available space in UTF-16 encoding so that you can cram an image in less characters in the HTML5 localStorage for offline caching and retrieval.</p>
<p>I am not sure if RIM is going to make it with all the iOS and Android competition, but at least the BlackBerry DevCon was really great.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/willemst.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/willemst.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/willemst.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/willemst.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/willemst.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/willemst.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/willemst.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/willemst.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/willemst.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/willemst.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/willemst.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/willemst.wordpress.com/425/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/willemst.wordpress.com/425/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/willemst.wordpress.com/425/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=425&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://willem.stuursma.name/2012/02/10/attending-blackberry-devcon-europe-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eeeed33e97bb956677957d0e24700c36?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuursma</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2012/02/schermafbeelding-2012-02-10-om-15-24-31.png" medium="image">
			<media:title type="html">Schermafbeelding 2012-02-10 om 15.24.31</media:title>
		</media:content>
	</item>
		<item>
		<title>An overview of different iPhone keyboards in Mobile Safari</title>
		<link>http://willem.stuursma.name/2012/01/30/an-overview-of-different-iphone-keyboards-in-mobile-safari/</link>
		<comments>http://willem.stuursma.name/2012/01/30/an-overview-of-different-iphone-keyboards-in-mobile-safari/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 22:42:47 +0000</pubDate>
		<dc:creator>stuursma</dc:creator>
				<category><![CDATA[iOS development]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[data entry]]></category>
		<category><![CDATA[form design]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[input elements]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Keyboard layout]]></category>
		<category><![CDATA[keyboard layouts]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[mobile safari]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[text input fields]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://willem.stuursma.name/?p=413</guid>
		<description><![CDATA[iPhone iOS 5.0 offers different keyboard layouts depending on the task the user has to perform. It is important to use the right keyboard for each input field, because typing on an iPhone is &#8211; compared to a full-fledged laptop &#8211; a pain. I could not find a single overview of all keyboard layouts that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=413&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>iPhone iOS 5.0 offers different keyboard layouts depending on the task the user has to perform. It is important to use the right keyboard for each input field, because typing on an iPhone is &#8211; compared to a full-fledged laptop &#8211; a pain. I could not find a single overview of all keyboard layouts that are supported in Mobile Safari on iOS5 so I made one myself. HTML5 offers all kinds of new &lt;input /&gt; types and iOS has some special keyboards for some of those.</p>
<p>I will start with an overview of all keyboards and conclude with some modifiers that can change the behavior of text input fields.</p>
<h2>Default text keyboards</h2>
<p>These are the default keyboards you will get when you use a plain, vanilla &lt;input type=&#8221;text&#8221; /&gt; field.</p>
<p><a href="http://willemst.files.wordpress.com/2012/01/input-normal.png"><img class="alignnone size-full wp-image-414" title="Normal text input on iPhone" src="http://willemst.files.wordpress.com/2012/01/input-normal.png?w=600" alt=""   /></a><a href="http://willemst.files.wordpress.com/2012/01/input-form.png"><img class="alignnone size-full wp-image-415" title="Input with Go button" src="http://willemst.files.wordpress.com/2012/01/input-form.png?w=600" alt=""   /></a></p>
<p>You can get these keyboards by just adding a normal &lt;input type=&#8221;text&#8221; /&gt; field to your web page. You can get the optional Go button if you put the &lt;input /&gt; element in a &lt;form /&gt; element that has an action attribute (value is not important). When the users presses to Go button, the form will be submitted. You can capture this event by observing the submit event on the form. It is not possible to get the Go button in a &lt;textarea /&gt; element, you will always get the first keyboard with the return button.</p>
<h2>Email, URL and numeric / special characters keyboard</h2>
<p>You can trigger these keyboards with the &lt;input type=&#8221;email&#8221; /&gt;, &lt;input type=&#8221;url&#8221; /&gt; and &lt;input type=&#8221;number&#8221; /&gt; input elements.</p>
<p><a href="http://willemst.files.wordpress.com/2012/01/input-email.png"><img class="alignnone size-full wp-image-416" title="Email keyboard" src="http://willemst.files.wordpress.com/2012/01/input-email.png?w=600" alt=""   /></a><a href="http://willemst.files.wordpress.com/2012/01/input-number.png"><img class="alignnone size-full wp-image-417" title="Special characters keyboards" src="http://willemst.files.wordpress.com/2012/01/input-number.png?w=600" alt=""   /></a></p>
<p>These keyboards are a variation of the regular keyboards (picture of URL keyboard not included). The email keyboard offers easy access to the @-sign and disables autocorrect and autocapitalization for the keyboard, which is pretty useful for a dedicated email field. It can be triggered by using the &lt;input type=&#8221;email&#8221; /&gt; tag.</p>
<p>The URL keyboard (picture not included) has an additional button for inserting &#8220;.com&#8221;. It is the same keyboard that <em>you </em>use in Mobile Safari for entering URLs. If you want to use this keyboard, use an &lt;input type=&#8221;url&#8221; /&gt; tag.</p>
<p>The special characters keyboard can triggered by using an &lt;input type=&#8221;number&#8221; /&gt; tag. Even though you cannot enter non-decimal character in most desktop browsers with this type of input, on iPhone you can enter any character (you can switch back to normal keyboard layout by using the ABC button).</p>
<p>For all three keyboard layouts goes that you can add a Go button if you wrap the &lt;input /&gt; element in a &lt;form /&gt; element with an action attribute.</p>
<h2>Numeric keyboards</h2>
<p>iOS 5 offers two numeric keyboards on iPhone: one for entering phone numbers and one for entering digits only.</p>
<p><a href="http://willemst.files.wordpress.com/2012/01/input-tel.png"><img class="alignnone size-full wp-image-418" title="Telephone number keyboard" src="http://willemst.files.wordpress.com/2012/01/input-tel.png?w=600" alt=""   /></a><a href="http://willemst.files.wordpress.com/2012/01/input-pattern.png"><img class="alignnone size-full wp-image-419" title="Decimals only keyboard on iPhone" src="http://willemst.files.wordpress.com/2012/01/input-pattern.png?w=600" alt=""   /></a></p>
<p>These two variants of the same keyboard serve specialized functions. This first keyboard kan be used to enter phone numbers: it has dedicated buttons for each digit and offers a button for special phone characters such as +, * and #. An iPhone user cannot switch back to a different keyboard layout if you use this one. It is triggered by creating an &lt;input type=&#8221;tel&#8221; /&gt; element.</p>
<p>The second variant is the same but lacks the button for entering non-digit characters. You can trigger this keyboard layout by using the HTML5 pattern=&#8221;[0-9]*&#8221; attribute. pattern is an attribute that can be used on elements to specify a <a class="zem_slink" title="Regular expression" href="http://en.wikipedia.org/wiki/Regular_expression" rel="wikipedia">regular expression</a> that the input value has to match. This particular regular expression means &#8220;a character between 0 and 9, repeated 0 or more times&#8221;. The type of input can be both &#8220;text&#8221;, &#8220;number&#8221; or &#8220;tel&#8221;. Full example: .</p>
<p>You cannot have  a &#8220;Go&#8221; button with these two layouts.</p>
<h2>Bonus: the search keyboard</h2>
<p>iOS offers a dedicated keyboard for searches as it is a common task:</p>
<p><a href="http://willemst.files.wordpress.com/2012/01/input-search.png"><img class="alignnone size-full wp-image-420" title="Search keyboard" src="http://willemst.files.wordpress.com/2012/01/input-search.png?w=600" alt=""   /></a></p>
<p>It is the same as the normal text keyboard layout but here the &#8220;Go&#8221; button has been replaced with a &#8220;Search&#8221; button. Another difference is that the &lt;input /&gt; element is styled differently: it has rounded corners. You can trigger it by creating an &lt;input type=&#8221;search&#8221; /&gt; element in a &lt;form /&gt; element with an action attribute.</p>
<h2>Auto correction and auto capitalization</h2>
<p>Autocorrection (the little balloons that pop up when you mistype a word) can also be controlled per &lt;input /&gt; element. There are few reasons to disable it, but it is useful to turn it of for fields where the user has to enter a username, since these are often words not in a dictionary. You can control it by setting the autocorrect attribute to &#8220;on&#8221; or &#8220;off&#8221;.</p>
<p>The same goes for auto capitalization. If you have a field that for some reason should not start with a capital letter (other than an email or url field) you can control this feature with the autocapitalization attribute.</p>
<p>Apple has some pretty interesting documentation on <a href="http://developer.apple.com/library/IOs/#documentation/AppleApplications/Reference/SafariWebContent/DesigningForms/DesigningForms.html">how to design a form in Mobile Safari</a>.</p>
<h2>Auto focus</h2>
<p>You can control the focus of an &lt;input /&gt; element by using the autofocus=&#8221;on&#8221; attribute. The element will then receive focus. This means that the keyboard will show up and the user can immediately start typing. Unfortunately it is not possible to have a web app or web page open with the focus already on a field (you cannot set focus from the onload or ondomready events). This is because many web sites use this technique and it would be really annoying to surf the web with this feature enabled.</p>
<h2>Conclusion</h2>
<p>Using the correct keyboard will lower the effort the user has to put into filling out your form. It will make your web app feel more like a native app. It is really useful and almost free, so there are few reasons not to use it. Older browsers will ignore the special attributes and type values so these advanced types are backwards compatible too.</p>
<p>If you have any questions or feel like I missed a keyboard layout, please leave a comment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/willemst.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/willemst.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/willemst.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/willemst.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/willemst.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/willemst.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/willemst.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/willemst.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/willemst.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/willemst.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/willemst.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/willemst.wordpress.com/413/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/willemst.wordpress.com/413/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/willemst.wordpress.com/413/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=413&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://willem.stuursma.name/2012/01/30/an-overview-of-different-iphone-keyboards-in-mobile-safari/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eeeed33e97bb956677957d0e24700c36?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuursma</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2012/01/input-normal.png" medium="image">
			<media:title type="html">Normal text input on iPhone</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2012/01/input-form.png" medium="image">
			<media:title type="html">Input with Go button</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2012/01/input-email.png" medium="image">
			<media:title type="html">Email keyboard</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2012/01/input-number.png" medium="image">
			<media:title type="html">Special characters keyboards</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2012/01/input-tel.png" medium="image">
			<media:title type="html">Telephone number keyboard</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2012/01/input-pattern.png" medium="image">
			<media:title type="html">Decimals only keyboard on iPhone</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2012/01/input-search.png" medium="image">
			<media:title type="html">Search keyboard</media:title>
		</media:content>
	</item>
		<item>
		<title>HipHop for PHP at Hyves</title>
		<link>http://willem.stuursma.name/2011/12/12/hiphop-for-php-at-hyves/</link>
		<comments>http://willem.stuursma.name/2011/12/12/hiphop-for-php-at-hyves/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 17:27:06 +0000</pubDate>
		<dc:creator>stuursma</dc:creator>
				<category><![CDATA[Hiphop for PHP]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[hiphop]]></category>
		<category><![CDATA[HipHop for PHP]]></category>
		<category><![CDATA[hphp]]></category>
		<category><![CDATA[hyves]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://willem.stuursma.name/?p=386</guid>
		<description><![CDATA[This is a cross-post from the Hyves Product Development blog. HipHop is Facebook’s open source C++ compiler for PHP. HipHop (also known as HPHP) will compile your PHP code to highly optimized C++ code, which you can then compile (with g++) into a big binary that will run your web site (it includes a web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=386&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>This is <a href="http://hyvesblogonproductdevelopment.blogspot.com/2011/10/hiphop-for-php-at-hyves.html">a cross-post from the Hyves Product Development blog</a>.</em></p>
<p><strong>HipHop</strong> is <a class="zem_slink" title="Facebook" href="http://facebook.com" rel="homepage">Facebook</a>’s open source C++ compiler for PHP. HipHop (also known as <a class="zem_slink" title="HipHop for PHP" href="http://wiki.github.com/facebook/hiphop-php/" rel="homepage">HPHP</a>) will compile your PHP code to highly optimized C++ code, which you can then compile (with g++) into a big binary that will run your web site (it includes a web server). If you want to know more about Hiphop and how it was created, you can check out the Facebook Engineering Blog article or the Github project.</p>
<p>After its introduction many bloggers have written background articles regarding Hiphop but few seem to have actually used it in a production environment. At Hyves, we use HipHop to run our web servers and our daemons, which are also written in in PHP. In this blog, I will detail some of our experiences and results.</p>
<h2>Compiler and interpreter</h2>
<p>Hiphop includes both and interpreter and a compiler. This is something that is not frequently mentioned in blog posts on Hiphop. The interpreter (called HPHPi) can be used for developing, thus saving you the hassle and the delays associated with compiling every time you change a single file. In general is has the same behavior as the compiled version of Hiphop. It is a bit slower than using PHP with an opcode cache, but it is not that bad and with a fast laptop it is still workable.</p>
<p>The compiler can be used to create an optimized binary for your code base. The Hyves code base is in the order of 3.5M LOC in PHP. The conversion from PHP to C++ has to be done by a single server, but we use a dedicated cluster of sixteen servers for compiling the C++ source code to an executable binary. This takes about seven minutes including the building (e.g. minimizing style sheets and javascript).</p>
<p>The resulting binary is approximately 500MB size. This cannot be deployed to our web servers in a serial fashion, as copying it would take too long. To deploy this to our web servers, we use a <a href="http://assets.en.oreilly.com/1/event/74/Deploying%20Large%20Payloads%20At%20Scale%20Presentation.pdf">bittorent based p2p deploy system</a>. In case of an emergency, we can roll out a fix in approximately ten minutes to our 300 web servers.</p>
<p><strong>Update: Facebook just released a <a href="http://www.facebook.com/note.php?note_id=10150415177928920">JIT compiling VM for Hiphop</a>.</strong></p>
<h2>Behavioral differences</h2>
<p>The HPHP interpreter, the compiled version and the official PHP binary all have slightly different behavior. HipHop is about 99% compatible with pure PHP. 99% times 3.5M LOC is a lot of problems. If you want to run HipHop, make sure that your unit tests are ran against all three versions automatically or you will drive yourself and your team members insane, especially in a mixed PHP / HPHP environment.</p>
<p>Some <a class="zem_slink" title="PHP" href="http://www.php.net/" rel="homepage">PHP 5.3</a> stuff is still not completely supported in Hiphop, such as namespaces, of which at the moment nearly every feature is broken. Extensions such as PHP’s SOAP extension have been ported but some behavior differences exist between the different runtimes.</p>
<p>Converting the Hyves code base to run on HipHop took a big effort, several of our software engineers worked on this projects for months.</p>
<p>Hiphop has some really cool features. There is a <a href="http://willem.stuursma.name/2011/09/08/parallel-array_map-with-hiphop/">call_user_func_async()</a> function (it does exactly what it says), and you can have two versions of you web site running at the same time, so that you can deploy a new version without downtime. Also, you can catch fatal (E_FATAL) errors with their stack traces with HPHP, a feature sorely lacking from PHP.</p>
<p>There is only sparse online documentation of these specific features so you will have to figure a lot of it our by reading the source code.</p>
<h2>Performance</h2>
<p>Performance of our Hiphop enabled web site has been very good. In particular our API has strongly benefited, with API calls being twice times as fast and requiring only a quarter of the cpu power compared to plain PHP. This has resulted in much faster mobile clients and better performance of the parts of our web site that use internal API calls.</p>
<p><a href="http://willemst.files.wordpress.com/2011/10/responsetimes.png"><img class="size-medium wp-image-388 alignnone" title="responsetimes" src="http://willemst.files.wordpress.com/2011/10/responsetimes.png?w=300&#038;h=138" alt="" width="300" height="138" /></a></p>
<p>In the top graph you can see our web servers 95% and 99% response times. We enabled HipHop for all our web servers in March 2011. The higher response times just before the switch are due to internal network congestions because of some issues with the first versions p2p deploy system we used.</p>
<p><a href="http://willemst.files.wordpress.com/2011/10/cpu.png"><img class="alignnone size-medium wp-image-387" title="cpu" src="http://willemst.files.wordpress.com/2011/10/cpu.png?w=300&#038;h=163" alt="" width="300" height="163" /></a></p>
<p>The bottom graph shows the CPU load of our web servers, which has dropped by a factor of four after the switch to HipHop. This will enable us deprecate a big portion of our web servers in the future, resulting in high savings on hosting and power.</p>
<h2>Open source</h2>
<p>HipHop is an <a href="https://github.com/facebook/hiphop-php">open source project</a>, available on Github. If you file a bug, Facebook’s maintainers can be pretty responsive, well reported bugs can be fixed in a matter of days. Of course you can always fix it yourself on Github and try to get the fix pulled into the project.</p>
<p>Al though Facebook has reported that WordPress and Mediawiki are experimenting with HipHop, not many people actually seem to be using Hiphop in production. For now, the community is pretty small outside of Facebook.</p>
<p>Also Hyves contributed to the HipHop project, we contributed (among other things) bug reports, a number of bugfixes and the ability to use distcc so you can compile your web site on multiple machines.</p>
<h2>Conclusion</h2>
<p>All in all the switch to HipHop has been a big success for Hyves. Al though switching comes with a steep cost in terms of implementation and tooling, for a big web site such as Hyves it is definitely worth the effort. If you do not have at least a few dozen web servers, you should strongly consider buying more hardware in favor of spending a lot of effort on making Hiphop work for you.</p>
<h3>Update</h3>
<p>The original version of this article at the Hyves Product Development Blog made it to the <a href="http://news.ycombinator.com/item?id=3381093">front page of Hacker News</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/willemst.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/willemst.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/willemst.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/willemst.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/willemst.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/willemst.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/willemst.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/willemst.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/willemst.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/willemst.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/willemst.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/willemst.wordpress.com/386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/willemst.wordpress.com/386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/willemst.wordpress.com/386/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=386&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://willem.stuursma.name/2011/12/12/hiphop-for-php-at-hyves/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eeeed33e97bb956677957d0e24700c36?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuursma</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2011/10/responsetimes.png?w=300" medium="image">
			<media:title type="html">responsetimes</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2011/10/cpu.png?w=300" medium="image">
			<media:title type="html">cpu</media:title>
		</media:content>
	</item>
		<item>
		<title>How to enable remote web inspector for UIWebView</title>
		<link>http://willem.stuursma.name/2011/12/09/how-to-enable-remove-web-inspector-for-uiwebview/</link>
		<comments>http://willem.stuursma.name/2011/12/09/how-to-enable-remove-web-inspector-for-uiwebview/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 10:12:27 +0000</pubDate>
		<dc:creator>stuursma</dc:creator>
				<category><![CDATA[iOS development]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[WebKit]]></category>
		<category><![CDATA[WebView]]></category>

		<guid isPermaLink="false">http://willem.stuursma.name/?p=391</guid>
		<description><![CDATA[For a little while people have figured out how to enable the remove inspector in iOS applications. With this trick, you can get a Webkit inspector (Opt+Cmd+I) for a UIWebView running in an app on the iPhone simulator. This will give you Weinre like abilities but it works much more reliably. Then, it didn&#8217;t take long before [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=391&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_401" class="wp-caption alignright" style="width: 310px"><a href="http://willemst.files.wordpress.com/2011/12/schermafbeelding-2011-12-09-om-11-08-05.png"><img class="size-medium wp-image-401 " title="Remote debugging UIWebView" src="http://willemst.files.wordpress.com/2011/12/schermafbeelding-2011-12-09-om-11-08-05.png?w=300&#038;h=217" alt="" width="300" height="217" /></a><p class="wp-caption-text">Remote debugging UIWebView with the iOS simulator</p></div>
<p>For a little while people have <a href="http://atnan.com/blog/2011/11/17/enabling-remote-debugging-via-private-apis-in-mobile-safari/">figured out</a> how to enable the remove inspector in iOS applications. With this trick, you can get a <a class="zem_slink" title="WebKit" href="http://webkit.org/" rel="homepage">Webkit</a> inspector (Opt+Cmd+I) for a UIWebView running in an app on the iPhone simulator. This will give you <a href="http://phonegap.github.com/weinre/">Weinre</a> like abilities but it works much more reliably. Then, it didn&#8217;t take long before someone came up with an <a href="http://www.iwebinspector.com/">app to do all the GDB debugger attaching</a> for you.</p>
<p>However, enabling the Webkit remote inspector is a private API call and if you have it in your application when you submit it to the App Store, your application will be rejected. Also, it only works on the simulator, if it runs on a device you cannot access the remote inspector because of firewall rules.</p>
<p>An easy solution is to include some <a class="zem_slink" title="Preprocessor" href="http://en.wikipedia.org/wiki/Preprocessor" rel="wikipedia">precompiler</a> directives that will only add the private API call when you compiled your app for the iOS simulator:</p>
<pre>#if (TARGET_IPHONE_SIMULATOR)
    [NSClassFromString(@"WebView") _enableRemoteInspector]; // Private API call.
#endif</pre>
<p>You need to import the TargetConditionals.h file too:</p>
<pre>#ifdef __APPLE__
    #include "TargetConditionals.h"
#endif</pre>
<p>You can access the remote inspector by loading your app in the iOS simulator and navigating to http://localhost:9999/.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/willemst.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/willemst.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/willemst.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/willemst.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/willemst.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/willemst.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/willemst.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/willemst.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/willemst.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/willemst.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/willemst.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/willemst.wordpress.com/391/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/willemst.wordpress.com/391/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/willemst.wordpress.com/391/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=391&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://willem.stuursma.name/2011/12/09/how-to-enable-remove-web-inspector-for-uiwebview/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eeeed33e97bb956677957d0e24700c36?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuursma</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2011/12/schermafbeelding-2011-12-09-om-11-08-05.png?w=300" medium="image">
			<media:title type="html">Remote debugging UIWebView</media:title>
		</media:content>
	</item>
		<item>
		<title>I just love this little Google maps detail</title>
		<link>http://willem.stuursma.name/2011/10/26/i-just-love-this-little-google-maps-detail/</link>
		<comments>http://willem.stuursma.name/2011/10/26/i-just-love-this-little-google-maps-detail/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 19:21:20 +0000</pubDate>
		<dc:creator>stuursma</dc:creator>
				<category><![CDATA[Maps]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[google maps]]></category>

		<guid isPermaLink="false">http://willem.stuursma.name/?p=373</guid>
		<description><![CDATA[I just love this little Google maps detail: the preview of the street / satellite view is not just a static image, but shows exactly what you will get when you click it. If you move the map around, the preview of the other view also moves. Unfortunately, this feature is only available in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=373&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just love this little Google maps detail: the preview of the street / satellite view is not just a static image, but shows exactly what you will get when you click it. If you move the map around, the preview of the other view also moves.</p>
<p><a href="http://willemst.files.wordpress.com/2011/10/schermafbeelding-2011-10-14-om-09-08-39.png"><img class="aligncenter size-full wp-image-392" title="Detail of the upper right corner of Google maps" src="http://willemst.files.wordpress.com/2011/10/schermafbeelding-2011-10-14-om-09-08-39.png?w=600" alt=""   /></a></p>
<p>Unfortunately, this feature is only available in the <a class="zem_slink" title="Google Chrome" href="http://www.google.com/chrome" rel="homepage">Google Chrome browser</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/willemst.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/willemst.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/willemst.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/willemst.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/willemst.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/willemst.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/willemst.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/willemst.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/willemst.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/willemst.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/willemst.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/willemst.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/willemst.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/willemst.wordpress.com/373/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=373&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://willem.stuursma.name/2011/10/26/i-just-love-this-little-google-maps-detail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eeeed33e97bb956677957d0e24700c36?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuursma</media:title>
		</media:content>

		<media:content url="http://willemst.files.wordpress.com/2011/10/schermafbeelding-2011-10-14-om-09-08-39.png" medium="image">
			<media:title type="html">Detail of the upper right corner of Google maps</media:title>
		</media:content>
	</item>
		<item>
		<title>Character sets at Hyves</title>
		<link>http://willem.stuursma.name/2011/10/09/character-sets-at-hyves/</link>
		<comments>http://willem.stuursma.name/2011/10/09/character-sets-at-hyves/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 08:33:46 +0000</pubDate>
		<dc:creator>stuursma</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Character encoding]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Windows-1252]]></category>

		<guid isPermaLink="false">http://willem.stuursma.name/?p=379</guid>
		<description><![CDATA[At my work I gave a short tech lunch presentation on character sets at Hyves. At Hyves we unfortunately still use Windows-1252 because of legacy reasons, which causes many issues. Included are a short reminder of what character sets are, how to use them, collation, best practices and common pitfalls. Finally, there are some tips [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=379&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>At my work I gave a short tech lunch presentation on character sets at <a class="zem_slink" title="Hyves" href="http://www.hyves.nl" rel="homepage">Hyves</a>. At Hyves we unfortunately still use <a class="zem_slink" title="Windows-1252" href="http://en.wikipedia.org/wiki/Windows-1252" rel="wikipedia">Windows-1252</a> because of legacy reasons, which causes many issues.</p>
<p>Included are a short reminder of what character sets are, how to use them, collation, best practices and common pitfalls. Finally, there are some tips for debugging issues with character sets.</p>
<iframe src="https://docs.google.com/present/embed?id=dc947tvk_37fn2jp7gv" frameborder="0" width="410" height="342"  marginheight="0" marginwidth="0"></iframe>
<p>If you have any questions after viewing this presentation, please ask.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/willemst.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/willemst.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/willemst.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/willemst.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/willemst.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/willemst.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/willemst.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/willemst.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/willemst.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/willemst.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/willemst.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/willemst.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/willemst.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/willemst.wordpress.com/379/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=379&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://willem.stuursma.name/2011/10/09/character-sets-at-hyves/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eeeed33e97bb956677957d0e24700c36?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuursma</media:title>
		</media:content>
	</item>
		<item>
		<title>How to enable XHP on Hiphop for PHP</title>
		<link>http://willem.stuursma.name/2011/10/09/how-to-enable-xhp-on-hiphop-for-php/</link>
		<comments>http://willem.stuursma.name/2011/10/09/how-to-enable-xhp-on-hiphop-for-php/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 08:26:38 +0000</pubDate>
		<dc:creator>stuursma</dc:creator>
				<category><![CDATA[Hiphop for PHP]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[hiphop]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[xhp]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://willem.stuursma.name/?p=357</guid>
		<description><![CDATA[A quick primer on how to enable XHP on Hiphop for PHP: Set the Eval.EnableXHP to true to that XHP will work on the interpreter if you need that. This will enable the XHP processor which will convert xml syntax to the __xhp classes. Get the XHP PHP extension from https://github.com/facebook/xhp Copy the files in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=357&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A quick primer on how to enable <strong>XHP</strong> on <strong>Hiphop for PHP</strong>:</p>
<ol>
<li>Set the Eval.EnableXHP to true to that XHP will work on the interpreter if you need that. This will enable the XHP processor which will convert xml syntax to the __xhp classes.</li>
<li>Get the XHP PHP extension from https://github.com/facebook/xhp</li>
<li>Copy the files in the php-lib/ folder to your project</li>
<li>Include them in the source files where you want to use XHP.</li>
</ol>
<div>You can now use the XML syntax in PHP.</div>
<div>The authors of XHP added array dereferencing as a bonus to XHP, so you can now also use that.</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/willemst.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/willemst.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/willemst.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/willemst.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/willemst.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/willemst.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/willemst.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/willemst.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/willemst.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/willemst.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/willemst.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/willemst.wordpress.com/357/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/willemst.wordpress.com/357/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/willemst.wordpress.com/357/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=357&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://willem.stuursma.name/2011/10/09/how-to-enable-xhp-on-hiphop-for-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eeeed33e97bb956677957d0e24700c36?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuursma</media:title>
		</media:content>
	</item>
		<item>
		<title>Parallel array_map() with HipHop</title>
		<link>http://willem.stuursma.name/2011/09/08/parallel-array_map-with-hiphop/</link>
		<comments>http://willem.stuursma.name/2011/09/08/parallel-array_map-with-hiphop/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 19:55:16 +0000</pubDate>
		<dc:creator>stuursma</dc:creator>
				<category><![CDATA[Hiphop for PHP]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[hiphop]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Parallel computing]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Threads]]></category>

		<guid isPermaLink="false">http://willem.stuursma.name/?p=346</guid>
		<description><![CDATA[Many computational operations, such as iterating over some big list can be sped up if they are parallelized. Parallelization offers the benefit that multiple items in the iterator can be processed at the same time. This is accomplished by using multiple threads, running the processing on multiple CPU cores at the same time. One condition has [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=346&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many computational operations, such as iterating over some big list can be sped up if they are parallelized. Parallelization offers the benefit that multiple items in the iterator can be processed at the same time. This is accomplished by using multiple threads, running the processing on multiple CPU cores at the same time.</p>
<p>One condition has to be met before it is possible to use multiple threads to process an iterator: each processing operation on an item in the operator must be independent on the other items. The typical PHP function to use in such cases is <a href="http://php.net/array_map">array_map()</a>, which allows you to run a function over each item in an array. array_map() prohibits you to access other items in the iterator while processing an item, so the order of execution is not important.</p>
<p>In the past it has been very hard to effectively use parallelization in PHP. However, with <a href="http://willem.stuursma.name/2011/06/12/some-experiences-using-facebooks-hphp-hiphop/">Facebook&#8217;s Hiphop</a> Facebook engineers have added the option to create threads in PHP using the <a href="https://github.com/facebook/hiphop-php/blob/6fb21c0dcae39301aa2dec45a19291a769aa9ef5/doc/threading">call_user_func_async()</a> function.</p>
<p>Some caveats apply:</p>
<ul>
<li>You can only create two extra threads, next to the main thread that is already running. Creating more threads doesn&#8217;t have any effects.</li>
<li>Creating additional threads is expensive, so you have to carefully consider if it is worthwhile to use them.</li>
<li>Unlike all other functions in PHP that accept functions as arguments, the call_user_func_async() does not accept anonymous functions as arguments. You need to pass in a string or array callback.</li>
<li>The call_user_func_async() function is <a href="https://github.com/facebook/hiphop-php/blob/6c59bb632eb862d7e2657d4d339a84718b52fae4/doc">currently deprecated</a> in HipHop and will issue a warning when called.</li>
</ul>
<p>call_user_func_async() and array_map() can be combined into a parallel version of array_map(). This can be done by splitting the iterator in equal parts and then running the iterator over each part, each part in a separate thread. Finally, you need to put all the pieces back together (synchronize) by calling end_user_func_async() for each thread.</p>
<p>You can find <a href="https://github.com/willemstuursma/hiphop-util/blob/master/functions/function.array_map_parallel.php">my implementation</a> at GitHub.</p>
<p>In practice the use of this function is limited: the maximum number of threads is three and there is quite a high cost for creating threads. However for complex processing or processing that calls external services (such as databases) that block it might be worth the extra effort.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/willemst.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/willemst.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/willemst.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/willemst.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/willemst.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/willemst.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/willemst.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/willemst.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/willemst.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/willemst.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/willemst.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/willemst.wordpress.com/346/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/willemst.wordpress.com/346/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/willemst.wordpress.com/346/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=346&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://willem.stuursma.name/2011/09/08/parallel-array_map-with-hiphop/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eeeed33e97bb956677957d0e24700c36?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuursma</media:title>
		</media:content>
	</item>
		<item>
		<title>Some experiences using Facebook&#8217;s HPHP / Hiphop</title>
		<link>http://willem.stuursma.name/2011/06/12/some-experiences-using-facebooks-hphp-hiphop/</link>
		<comments>http://willem.stuursma.name/2011/06/12/some-experiences-using-facebooks-hphp-hiphop/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 15:42:31 +0000</pubDate>
		<dc:creator>stuursma</dc:creator>
				<category><![CDATA[Hiphop for PHP]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[hiphop]]></category>
		<category><![CDATA[hphp]]></category>
		<category><![CDATA[hyves]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://willem.stuursma.name/?p=335</guid>
		<description><![CDATA[Hiphop is Facebook&#8217;s open source C++ compiler for PHP. Hiphop (also known as HPHP) will compile your PHP code to C++ code, which you can then compile (with g++) into a big binary that will run your web site. The binary includes a web server, which will then behave (almost) exactly the same as your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=335&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Hiphop</strong> is Facebook&#8217;s open source C++ compiler for PHP. Hiphop (also known as <strong>HPHP</strong>) will compile your PHP code to C++ code, which you can then compile (with g++) into a big binary that will run your web site. The binary includes a web server, which will then behave (almost) exactly the same as your Apache + mod_php or Nginx with fastcgi PHP. If you want to know more about Hiphop and how it was created, you can check out the <a href="https://www.facebook.com/note.php?note_id=280583813919">Facebook Engineering Blog article</a> or the <a href="https://github.com/facebook/hiphop-php/">Github project</a>.</p>
<p>After its introduction many bloggers <a href="http://sebastian-bergmann.de/archives/880-My-Take-on-Facebooks-HipHop-for-PHP.html">have</a> <a href="http://www.insidefacebook.com/2010/02/02/facebook-open-sources-hiphop-php-compiler-software/">written</a> background articles regarding Hiphop but few seem to have actually used it in a production environment. I have and here are some of my thoughts on working with Hiphop in such an environment.</p>
<h3>Speed</h3>
<p>Hiphop includes both and interpreter and a compiled version. This is something that is not frequently mentioned in blog posts about Hiphop. The interpreter (called <em>HPHPi</em>) can be used for developing, thus saving you the hassle and the delays associated with compiling every time you change a single file. (Compiling a simple 10 line script takes about one minute. This is probably because the web server has to be compiled too and this component is a few orders of magnitude more complex than my PHP script). In general is has the same behavior as the compiled version of Hiphop. It is a bit slower than using PHP with an opcode cache, but it is not that bad and with a fast laptop it is still workable.</p>
<p>The compiled version is really fast, at least a few times faster than using PHP with fastcgi. Also, Hiphop has become already <a href="https://www.facebook.com/note.php?note_id=10150121348198920">three times as fast</a> since it has been released in Februari 2010. So the speed is really, really good.</p>
<h3>Behavioral differences</h3>
<p>The HPHP interpreter, the compiled version and the official PHP interpreter will all give you ever so slightly different behavior. So make sure that your unit tests are ran against all three versions automatically or you will drive yourself and your team members insane, especially in a mixed PHP / HPHP environment.</p>
<p>Some PHP 5.3 stuff is still not completely supported in Hiphop, such as namespaces, of which at the moment nearly every feature is broken. Support for anonymous functions have only recently been added. Extensions such as PHP&#8217;s SOAP extension have been ported but some behavior varies between the variants. Small stuff mostly. For example, if you get a SoapFault exception somewhere, in PHP the exception will contain the message from the SOAP response, but in HPHP the exception will contain the entire SOAP response.</p>
<p>If you want to write scripts that are PHP and HPHP compatible, you will need to write some if statements here and there. Definitely test all your code against the compiled, interpreted and official PHP binary.</p>
<h3>Features</h3>
<p>Hiphop has some really cool features. There is a call_user_func_async() function (it does exactly what it says), and you can have two versions of you web site running at the same time, so that you can deploy a new version without downtime. Also, you can catch fatal (E_FATAL) errors with their stack traces with HPHP, a feature sorely lacking from PHP. There is only sparse online documentation of these specific features, but you can set up <a href="https://github.com/facebook/hiphop-php/wiki/HipHop-Documentation">your own documentation server</a>.</p>
<p>Among these new features, HPHP introduces some new errors that can occur in your scripts, mostly when you do strange stuff which you are not supposed to some datatypes., but PHP still allows. For example, in PHP this will not throw any errors: $var = null; $var['foo'] = &#8216;bar&#8217;;. In HPHP, this will throw an E_NOTICE. I will leave it as an exercise to the reader to decide which of the two behaviors actually is preferred. In general, HPHP is more strict and less forgiving, so that will probably cause latent bugs in your project to rise to the surface.</p>
<p>You gain some, you loose some: some PHP features such as fastcgi_finish_request() are not available under Hiphop. If you want any of the non included PHP extensions, you will have to port them to C++ yourself. Since they are already in C, it is not hard but you still need to do it.</p>
<h3>Open source</h3>
<p>One of the great things about Hiphop is that is is an open source project. The code for Hiphop is shared on Github. If you file a bug, Facebook&#8217;s maintainers can be pretty responsive. I filed a one (behavior difference from PHP for anonymous functions) and it was fixed four days later. Of course you can always fix it yourself on Github and try to get the fix pulled into the project. Not many people are actually using Hiphop in production, so the community is pretty small outside of Facebook.</p>
<h3>Conclusions</h3>
<p>Facebook&#8217;s Hiphop is really, really fast and offers useful features. However, you can imaging that with the behavioral differences and the changes you will need to your build and deploy process it may or may not be worth it for your web site.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/willemst.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/willemst.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/willemst.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/willemst.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/willemst.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/willemst.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/willemst.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/willemst.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/willemst.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/willemst.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/willemst.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/willemst.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/willemst.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/willemst.wordpress.com/335/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=willem.stuursma.name&amp;blog=6028144&amp;post=335&amp;subd=willemst&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://willem.stuursma.name/2011/06/12/some-experiences-using-facebooks-hphp-hiphop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/eeeed33e97bb956677957d0e24700c36?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuursma</media:title>
		</media:content>
	</item>
	</channel>
</rss>
