<?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>Software Sweden &#187; php</title>
	<atom:link href="http://www.softwaresweden.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.softwaresweden.com</link>
	<description>It&#039;s not just code - Programming is about managing complexities</description>
	<lastBuildDate>Wed, 06 Jul 2011 20:49:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>How to build a web service in 8 hours</title>
		<link>http://www.softwaresweden.com/2010/02/21/how-to-build-a-web-service-in-8-hours/</link>
		<comments>http://www.softwaresweden.com/2010/02/21/how-to-build-a-web-service-in-8-hours/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 10:51:04 +0000</pubDate>
		<dc:creator>Erik Starck</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mashups]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.softwaresweden.com/?p=89</guid>
		<description><![CDATA[I was a big fan of Jaiku (here I am) and didn&#8217;t &#8220;get&#8221; Twitter until about a year ago when a friend showed me Tweetdeck. Aha! So that&#8217;s how you&#8217;re supposed to use it! Not through the web page twitter.com but by using a third party tool. I got so excited that I proclaimed Twitter [...]]]></description>
			<content:encoded><![CDATA[<p>I was a big fan of <a href="http://jaiku.com">Jaiku</a> (<a href="http://erikstarck.jaiku.com/">here</a> I am) and didn&#8217;t &#8220;get&#8221; Twitter until about a year ago when a friend showed me <a href="http://tweetdeck.com">Tweetdeck</a>. Aha! So <em>that&#8217;s</em> how you&#8217;re supposed to use it! Not through the web page twitter.com but by using a third party tool. I got so excited that I proclaimed <a href="http://www.mobilewebtablet.com/2009/02/21/why-twitter-is-the-future-of-search-communication-and-discovery-and-thus-the-web-itself/">Twitter the future of the web</a>. </p>
<p>And I stopped using Jaiku.</p>
<p>One thing I did miss from the Jaiku-days, though, was the long discussion threads under each &#8220;jaik&#8221; (the Jaiku version of a &#8220;tweet&#8221;). Here&#8217;s an <a href="http://jyri.jaiku.com/presence/a1b8f1743c5a4244bc55a3fbcbd8d005">example</a>. This provided Jaiku with <em>depth</em>, something you can hardly accuse Twitter of.</p>
<p>So an idea emerged: what if you could build a web service that made it possible to comment and discuss each tweet just like you did in the Jaiku-days.</p>
<p>Thus, <a href="http://discussatweet.com">Discuss a Tweet</a> was born.</p>
<p>Or, well, at least the domain was registered. I did this April 17 2009. It then ended up in my pile of great-ideas-I-should-one-day-implement and nothing happened.</p>
<p>Until&#8230; last weekend.</p>
<p>I knew that it would be possible to put it all together quite fast. I had used <a href="http://www.disqus.com">Disqus</a> when we built <a href="http://ratemypit.ch">Rate My Pitch</a> during <a href="http://24hbc.com">24 hour business camp</a> &#8211; so I knew that the commenting system, the most difficult part, I would get for &#8220;free&#8221;. I wouldn&#8217;t even need a database. It was all about putting things together in a slightly new way. A classic mashup.</p>
<p>So, I started hacking away. A couple of hours later, the result is a mashup of the following services:</p>
<ul>
<li><a href="http://disqus.com">Disqus</a>, for the commenting system.</li>
<li><a href="http://jquery.org">JQuery</a>, the Javascript framework to do some AJAX magic and UI manipulation.</li>
<li><a href="http://malsup.com/jquery/corner/">JQuery Corner</a> to get the rounded corners.</li>
<li><a href="http://typekit.com">Typekit</a>, better looking web fonts.</li>
<li><a href="http://www.blueprintcss.org/">BluePrint CSS</a>, a CSS framework that simplifies layout.</li>
<li><a href="http://twitter.com">Twitter</a>, of course. I used the <a href="http://classes.verkoyen.eu/twitter/">Twitter PHP class</a> by Tijs Verkoyen to simplify the API.</li>
<li><a href="http://bit.ly">Bit.ly</a> the URL shortener. I used this <a href="http://www.dennismadsen.com/2010/01/bit-ly-api-class-for-php/">Bit.ly PHP class</a> by Dennis Madsen to makes things even easier.</li>
<li><a href="http://simplehtmldom.sourceforge.net/">Simple HTML DOM</a> to parse HTML.</li>
<li><a href="http://google.com/analytics">Google Analytics</a>, let&#8217;s not forget this visitor statistics tool.</li>
</ul>
<p>This is just a tiny little hack but I think it serves as a good example of how modern web development is done. You pick bits and pieces from all over the web, some open source components, some embedded web services. You put things together and something new emerges.</p>
<p>I used PHP and this is also worth noting. People <a href="http://www.google.se/search?hl=sv&#038;source=hp&#038;q=php+sucks&#038;btnG=Google-sökning&#038;meta=&#038;aq=f&#038;oq=">complain about PHP</a> but one of its biggest strengths is its user base and size. When you&#8217;re doing a mashup such as <a href="http://discussatweet.com">Discuss a Tweet</a> you can be sure someone else has done about the same things you need and there is code out there ready to be used. You can&#8217;t say that about <a href="http://www.scala-lang.org/">Scala</a> or <a href="http://ftp.sunet.se/pub/lang/erlang/">Erlang</a> regardless of how powerful and beautiful the languages are. (Things are changing of course as the popularity of the language grows.)</p>
<p>Another thing happened while Discuss-a-Tweet was in my idea-pool: Google Buzz launched. According to Mr Jaiku himself, <a href="http://www.zengestrom.com/blog/2010/02/the-buzz-is-out.html">Jyri Engeström</a>, Buzz is the continuation of Jaiku. And, yes, it allows you to comment and discuss tweets. </p>
<p>Maybe a usage pattern is emerging in how we <a href="http://blog.opportunitycloud.com/2009/08/15/twitter-is-my-living-room-facebook-my-kitchen-how-i-use-different-social-networks/">use different social networks</a>. Twitter for quick news updates and cool links, Facebook for our friends and Buzz for the discussions. Maybe the <a href="http://opportunitycloud.com">Opportunity Cloud</a> for a service such as Discuss-a-Tweet is dispersing. We&#8217;ll see. It was fun building it anyway &#8211; and it only took a few hours after all. <img src='http://www.softwaresweden.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(PS. Follow me on <a href="http://twitter.com/erikstarck">Twitter</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaresweden.com/2010/02/21/how-to-build-a-web-service-in-8-hours/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Copying a VirtualBox VDI file running Ubuntu Server and getting Drupal running</title>
		<link>http://www.softwaresweden.com/2009/01/19/copying-a-virtualbox-vdi-file-running-ubuntu-server-and-getting-drupal-running/</link>
		<comments>http://www.softwaresweden.com/2009/01/19/copying-a-virtualbox-vdi-file-running-ubuntu-server-and-getting-drupal-running/#comments</comments>
		<pubDate>Mon, 19 Jan 2009 14:06:18 +0000</pubDate>
		<dc:creator>Erik Starck</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://www.softwaresweden.com/blog/?p=57</guid>
		<description><![CDATA[Sigh. Things are never as easy as you want them to be. I have two computers on my desk. My MacBook and my Asus EEE B202 running Windows XP. I wanted a development environment for Drupal (a php content management framework), so I tried running PHP on my MacBook. It worked fine, but the first [...]]]></description>
			<content:encoded><![CDATA[<p>Sigh. Things are never as easy as you want them to be. <img src='http://www.softwaresweden.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I have two computers on my desk. My MacBook and my <a href="http://www.softwaresweden.com/blog/index.php/2008/12/28/upgrading-ram-memory-on-asus-eee-b202-eee-box/">Asus EEE B202</a> running Windows XP. I wanted a development environment for <a href="http://www.drupal.org">Drupal</a> (a php content management framework), so I tried running <a href="http://www.softwaresweden.com/blog/index.php/2009/01/18/setting-up-php-and-web-server-on-os-x-105-leopard/">PHP on my MacBook</a>.</p>
<p>It worked fine, but the first problem appeared when I tried to run Drupal. The PHP GD library was missing (used by Drupal for graphics). This is a <a href="http://drupal.org/node/58725">known problem</a> and requires a recompilation of PHP. The problem is, the Apache web server installed on the MacBook is used by OS X and may change in future updates to the OS by Apple. It also seemed a bit cumbersome to get it all to work as it should. So, I figured, why not in stead run a virtual machine with a developer setup in linux and get a clean separation between my day to day OS (OS X) and my developer server.</p>
<p>I decided to use <a href="http://www.virtualbox.org">VirtualBox</a>, a free software provided by Sun, and run it on my XP machine (the B202). I installed <a href="http://www.ubuntu.com">Ubuntu Server 8.10</a> on the virtual machine.</p>
<p>If you haven&#8217;t used a software like VirtualBox or VMWare before, I can only say that it&#8217;s much easier than it sounds like. If you can install an operating system you can use VirtualBox. It&#8217;s a very slick and easy to use program.</p>
<p>But, there are of course a few problems.</p>
<p>The first problem was that Ubuntu Server was also missing PHP GD (not because of VirtualBox of course, but still). This time I only needed to do a:</p>
<p><code>apt-get install php5-gd</code></p>
<p>and voila, Drupal was running.</p>
<p>Now everything should have been fine and dandy if it hadn&#8217;t been for the <strong>bluescreens</strong> that suddenly started to occur on my EEE-box. After running VirtualBox and Ubuntu Server for a couple of minutes, maybe half an hour, XP decides to just crash. This happened over and over again.</p>
<p>Finding the cause of a bluescreen is never fun but it was clearly due to the VirtualBox setup.</p>
<p>But, hey, I&#8217;m in the virtual world here. So, I simply copied the .vdi-file (the file that VirtualBox uses to store the operating system on &#8211; it&#8217;s like a virtual hard drive) to my MacBook and set up a virtual machine with the vdi-file.</p>
<p>Everything worked as it should, except networking (I&#8217;m using hosted networking, making the virutal machine appear just like a third computer on my network &#8211; very neat, when it works).</p>
<p>The problem is that, although the environments are similar, the virtual network adapter gets a new MAC address. So, the Ubuntu OS gets confused and can&#8217;t find the network adapter. This is easily fixed by <a href="http://lastkth-en.blogspot.com/2008/04/virtualbox-clone-virtual-machine-ubuntu.html">simply deleting</a> an autogenerated file:</p>
<p><code>rm /etc/udev/rules.d/70-persistent-net.rules</code></p>
<p>and rebooting.</p>
<p>Now I have Ubuntu Server 8.10 running on my MacBook. I don&#8217;t have any desktop environment set up, making it rather slim (I use 384MB RAM and the full OS only takes about 1,5GB hard drive space). You probably want something like Webmin to make configuration a bit simpler. <a href="http://www.ubuntugeek.com/ubuntu-serverinstall-gui-and-webmin-in-ubuntu-810-intrepid-ibex-guide.html">Here</a> are instructions for setting it up.</p>
<p>Now, let&#8217;s just hope my MacBook doesn&#8217;t bluescreen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaresweden.com/2009/01/19/copying-a-virtualbox-vdi-file-running-ubuntu-server-and-getting-drupal-running/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

