<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="http://www.andreasrydberg.se/blog/2009/01/03/add-language-and-import-translations-through-profile-drupal-6" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Blog posts</title>
    <link>http://www.andreasrydberg.se/blog/2009/01/03/add-language-and-import-translations-through-profile-drupal-6</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Appland launched</title>
    <link>http://www.andreasrydberg.se/blog/2011/12/16/appland-launched</link>
    <description>&lt;p&gt;The swedish company Appland has launched (14th of December) their complementary app market to Android Market. Appland features swedish apps, pay with with phone bill instead of credit card and quality assurance of apps.&lt;/p&gt;
&lt;p&gt;I&#039;m so proud to be working with so talented people!&lt;/p&gt;
</description>
     <comments>http://www.andreasrydberg.se/blog/2011/12/16/appland-launched#comments</comments>
 <category domain="http://www.andreasrydberg.se/category/operating-system/linux/android">Android</category>
 <pubDate>Fri, 16 Dec 2011 09:50:42 +0000</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">19 at http://www.andreasrydberg.se</guid>
  </item>
  <item>
    <title>Learning Java, again - part 1</title>
    <link>http://www.andreasrydberg.se/blog/2011/12/09/learning-java-again-part-1</link>
    <description>&lt;p&gt;I&#039;ve been working for my new company &lt;a href=&quot;http://www.appland.se&quot;&gt;Appland&lt;/a&gt; as web developer. Professionally I&#039;ve mostly worked with PHP and Javascript, not counting HTML or CSS as programming, so I thought that would start to learn Java, again, since we are developing an Android app.&lt;/p&gt;

&lt;p&gt;Coming from PHP, I guess I&#039;m bit spoiled, but I was prepered to get make hands dirty. Since I&#039;m somewhat to dedicated to learn Java and make Android apps, I think this post will be the first part of a series of posts.&lt;/p&gt;

&lt;p&gt;&lt;!--break--&gt;&lt;!--break--&gt;&lt;/p&gt;

&lt;h2&gt;Splitting strings&lt;/h2&gt;

&lt;p&gt;In PHP I would do something like this&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$input &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;key=value&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$output &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;explode&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;=&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$input&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$output&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// prints &quot;key&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$output&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// prints &quot;value&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;But if the value was missing I would expect this:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$input &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;key=&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$output &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;explode&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;=&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$input&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$output&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// prints &quot;key&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$output&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// prints &quot;&quot; (an empty string)&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;I assumed that above behaviour would be similar in Java, or possibly that &lt;code&gt;output&lt;/code&gt; would be &lt;code&gt;null&lt;/code&gt; instead of empty string. Consider this Java code:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;String input = &amp;quot;key=value&amp;quot;;&lt;br /&gt;String[] output = input.split(&amp;quot;=&amp;quot;);&lt;br /&gt;Log.d(&amp;quot;length&amp;quot;, output.length + &amp;quot;&amp;quot;); // prints &amp;quot;2&amp;quot; to log&lt;br /&gt;Log.d(&amp;quot;debug&amp;quot;, output[0]); // prints &amp;quot;key&amp;quot; to log&lt;br /&gt;Log.d(&amp;quot;debug&amp;quot;, output[1]); // prints &amp;quot;value&amp;quot; to log&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Above example works like the first PHP example. &lt;code&gt;output.length&lt;/code&gt; returns the integer 2. Then consider this java code:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;String input = &amp;quot;key=&amp;quot;;&lt;br /&gt;String[] output = input.split(&amp;quot;=&amp;quot;);&lt;br /&gt;Log.d(&amp;quot;length&amp;quot;, output.length + &amp;quot;&amp;quot;); // prints &amp;quot;1&amp;quot; to log&lt;br /&gt;Log.d(&amp;quot;debug&amp;quot;, output[0]); // prints &amp;quot;key&amp;quot; to log&lt;br /&gt;Log.d(&amp;quot;debug&amp;quot;, output[1]); // throws IndexOutOfBoundsException.&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Since Java only return an array with only one item in it. &lt;code&gt;output[1]&lt;/code&gt; is therefore out of bounds. To get similar result as PHP, with exception handling, like this:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;String input = &amp;quot;key=&amp;quot;;&lt;br /&gt;String[] output = input.split(&amp;quot;=&amp;quot;);&lt;br /&gt;Log.d(&amp;quot;length&amp;quot;, output.length + &amp;quot;&amp;quot;); // prints &amp;quot;1&amp;quot; to log&lt;br /&gt;Log.d(&amp;quot;debug&amp;quot;, output[0]); // prints &amp;quot;key&amp;quot; to log&lt;br /&gt;try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.d(&amp;quot;value&amp;quot;, output[1]);&lt;br /&gt;}&lt;br /&gt;catch (IndexOutOfBoundsException e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.d(&amp;quot;value&amp;quot;, &amp;quot;(empty)&amp;quot;); // Since Lod.d() doesn&amp;#039;t print empty strings like &amp;quot;&amp;quot; I had to do this.&lt;br /&gt;}&lt;br /&gt;catch (Exception e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // capture other exceptions.&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Or you could just use the general capture:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;String input = &amp;quot;key=&amp;quot;;&lt;br /&gt;String[] output = input.split(&amp;quot;=&amp;quot;);&lt;br /&gt;Log.d(&amp;quot;length&amp;quot;, output.length + &amp;quot;&amp;quot;); // prints &amp;quot;1&amp;quot; to log&lt;br /&gt;Log.d(&amp;quot;debug&amp;quot;, output[0]); // prints &amp;quot;key&amp;quot; to log&lt;br /&gt;try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.d(&amp;quot;value&amp;quot;, output[1]);&lt;br /&gt;}&lt;br /&gt;catch (Exception e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Log.d(&amp;quot;value&amp;quot;, &amp;quot;(empty)&amp;quot;); // Since Lod.d() doesn&amp;#039;t print empty strings like &amp;quot;&amp;quot; I had to do this.&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Have fun!&lt;/p&gt;
</description>
     <comments>http://www.andreasrydberg.se/blog/2011/12/09/learning-java-again-part-1#comments</comments>
 <category domain="http://www.andreasrydberg.se/category/development/java">Java</category>
 <pubDate>Fri, 09 Dec 2011 20:43:18 +0000</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">18 at http://www.andreasrydberg.se</guid>
  </item>
  <item>
    <title>Installing Lighttpd on Ubuntu 11.10</title>
    <link>http://www.andreasrydberg.se/blog/2011/11/20/installing-lighttpd-on-ubuntu-1110</link>
    <description>&lt;p&gt;When installing Lighttpd on Ubuntu 11.10 remember to enable &quot;fastcgi-php&quot; as well. After an hour of googling I still couldn&#039;t get PHP to work. I created an empty &lt;code&gt;index.php&lt;/code&gt; in the webroot (/var/www) and got &quot;403 - Forbidden&quot;.&lt;/p&gt;
&lt;p&gt;Until I found the file &lt;code&gt;/etc/lighttpd/conf-available/15-fastcgi-php.conf&lt;/code&gt;. Apparently you need to enable &quot;fastcgi&quot; as well as &quot;fastcgi-php&quot;. Like this in bash: &lt;code&gt;sudo lighty-enable-mod fastcgi-php&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;This is how you install Lighttpd with PHP 5:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
sudo aptitude install lighttpd php5-cgi&lt;br /&gt;
sudo lighttpd-enable-mod fastcgi fastcgi-php&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I couldn&#039;t find any information about this using Google, so I hope this helps someone.&lt;/p&gt;
</description>
     <comments>http://www.andreasrydberg.se/blog/2011/11/20/installing-lighttpd-on-ubuntu-1110#comments</comments>
 <category domain="http://www.andreasrydberg.se/category/development/php">PHP</category>
 <category domain="http://www.andreasrydberg.se/category/operating-system/linux/ubuntu">Ubuntu</category>
 <pubDate>Sat, 19 Nov 2011 23:07:12 +0000</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">17 at http://www.andreasrydberg.se</guid>
  </item>
  <item>
    <title>New job and Aegir</title>
    <link>http://www.andreasrydberg.se/blog/2011/03/15/new-job-and-aegir</link>
    <description>&lt;p&gt;This week is my fourth week on the new job as a webmaster. I actually haven&#039;t heard that title since late -90 or maybe early -00. However, my job is to operate, maintain and develop our Drupal sites.&lt;/p&gt;
&lt;p&gt;One of my tasks is to plan and setup our new server structure and through that I discovered &lt;a href=&quot;http://www.aegirproject.org/&quot;&gt;the Aegir project&lt;/a&gt;. Well, it&#039;s a kind of a re-discover because I came on contact with it about 2-3 years ago, if my memory serves me, when I worked for my former employer. Back then I thought Aegir was not worth digging into, but now as it reaches version 1.0 (release candidate 2 at the time of writing) it has grown into something really good.&lt;/p&gt;
&lt;p&gt;Aegir has some really neat features like creating a Drupal site as easy as creating a node, cloning whole sites and migrating between servers. When creating a Site node Aegir creates a database and handles and sets up the directories under the [drupal-root/]sites/ for you. It takes a minute to process and it&#039;s a breeze compared to creating everything by hand.&lt;/p&gt;
&lt;p&gt;One last feature which was the most important thing that made me consider Aegir is the ability to update Drupal core, modules and run update.php via the Aegir interface, thanks to the the &lt;a href=&quot;http://drupal.org/project/drush&quot;&gt;drush&lt;/a&gt; project, which is a one of the components of Aegir. (Drush, or &quot;Drupal shell&quot;, can be used on it&#039;s own in a shell)&lt;/p&gt;
&lt;p&gt;Aegir itself is actually a Drupal site, with a few special modules and components like drush, &lt;a href=&quot;http://drupal.org/project/provision&quot;&gt;provision&lt;/a&gt; and &lt;a href=&quot;http://drupal.org/project/eldir&quot;&gt;the Eldir theme&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Aegir is made to run on UNIX-like systems like Linux, and can apparently be run on MacOS X, but not on Windows. And you need to have you own server, a virtual server or VPS can be used.&lt;/p&gt;
&lt;p&gt;I have just started digging into Aegir, but it can be used to manage you own Drupal hosting service. Judging from the sponsors and contributers to the projects it is meant to be a base for developing such a service. At the time of writing Aegir sports a experimental DNS managing functionality, which is very interesting.&lt;/p&gt;
</description>
     <comments>http://www.andreasrydberg.se/blog/2011/03/15/new-job-and-aegir#comments</comments>
 <category domain="http://www.andreasrydberg.se/category/development/drupal">Drupal</category>
 <category domain="http://www.andreasrydberg.se/category/reviews/software">Software</category>
 <pubDate>Tue, 15 Mar 2011 21:50:26 +0000</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">16 at http://www.andreasrydberg.se</guid>
  </item>
  <item>
    <title>Acquia Drupal stack installer</title>
    <link>http://www.andreasrydberg.se/blog/2010/11/16/acquia-drupal-stack-installer</link>
    <description>&lt;p&gt;I came across Acquia Drupal stack installer which installs Drupal (Acquias own distribution), including Apache, MySQL and PHP, for you. You can start working with your Drupal-site with a few clicks. I haven&#039;t tried it myself yet, but it seem like a cool application.&lt;/p&gt;

&lt;p&gt;&lt;!--break--&gt;&lt;!--break--&gt;&lt;/p&gt;

&lt;p&gt;I wonder there is similar application for regular Drupal, with downloading modules, maybe integration with drush.&lt;/p&gt;

&lt;p&gt;Note that this is Acquia&#039;s distribution of Drupal with mostly regular modules that you can find on &lt;a href=&quot;http://drupal.org/project/modules&quot;&gt;http://drupal.org/project/modules&lt;/a&gt; and another installation profile and theme. There might be some other differences as well.&lt;/p&gt;

&lt;p&gt;You can download it at &lt;a href=&quot;http://acquia.com/downloads&quot;&gt;http://acquia.com/downloads&lt;/a&gt;.&lt;/p&gt;
</description>
     <comments>http://www.andreasrydberg.se/blog/2010/11/16/acquia-drupal-stack-installer#comments</comments>
 <category domain="http://www.andreasrydberg.se/category/development/drupal">Drupal</category>
 <pubDate>Tue, 16 Nov 2010 20:28:37 +0000</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">15 at http://www.andreasrydberg.se</guid>
  </item>
  </channel>
</rss>

