<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>cakebaker</title>
	
	<link>http://cakebaker.42dh.com</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Sun, 17 Jan 2010 09:46:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Cakebaker" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="cakebaker" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><image><link>http://cakebaker.42dh.com</link><url>http://cakebaker.42dh.com/wp-content/uploads/2007/12/cakebaker_logo_small.png</url><title>cakebaker logo</title></image><item>
		<title>Rails 3 and Passenger</title>
		<link>http://cakebaker.42dh.com/2010/01/17/rails-3-and-passenger/</link>
		<comments>http://cakebaker.42dh.com/2010/01/17/rails-3-and-passenger/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 09:46:06 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[configuration]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1333</guid>
		<description><![CDATA[This weekend the RailsBridge people have organized a bugmash with the motto &#8220;Do One Thing for Rails 3&#8243;, and so I took the opportunity to experiment a bit with the coming Rails 3.
After following the instructions for creating a new Rails 3 app (using the &#8211;database=mysql parameter for the &#8220;rails&#8221; command) I noticed that the [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend the <a href="http://railsbridge.org">RailsBridge</a> people have organized a <a href="http://bugmash.com">bugmash</a> with the motto &#8220;Do One Thing for Rails 3&#8243;, and so I took the opportunity to experiment a bit with the coming Rails 3.</p>
<p>After following the instructions for <a href="http://yehudakatz.com/2009/12/31/spinning-up-a-new-rails-app/">creating a new Rails 3 app</a> (using the &#8211;database=mysql parameter for the &#8220;rails&#8221; command) I noticed that the application tried to access the (not existing) production database. That was a bit strange, because I expected it to access the development database as I set the <a href="http://www.modrails.com/documentation/Users guide.html#rails_env">RailsEnv</a> option of <a href="http://www.modrails.com">Passenger</a> accordingly:</p>
<pre>
<code># for example in /etc/httpd/conf/httpd.conf
RailsEnv development</code>
</pre>
<p>The reason this doesn&#8217;t work is because the generated application contains a &#8220;config.ru&#8221; file. In this case, Passenger treats the application as a <a href="http://rack.rubyforge.org/">Rack</a> application and not as a Rails application. And so the RailsEnv setting is ignored as it is Rails-specific&#8230;</p>
<p>There are two ways to run the application in development mode: you can either remove the &#8220;config.ru&#8221; file (and keep the RailsEnv setting) or you can set the <a href="http://www.modrails.com/documentation/Users guide.html#rack_env">RackEnv</a> option:</p>
<pre>
<code># for example in /etc/httpd/conf/httpd.conf
RackEnv development</code>
</pre>
<p>Have fun with Rails 3 :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2010/01/17/rails-3-and-passenger/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Accepting the Google OpenID with PHP OpenID</title>
		<link>http://cakebaker.42dh.com/2009/12/31/accepting-the-google-openid-with-php-openid/</link>
		<comments>http://cakebaker.42dh.com/2009/12/31/accepting-the-google-openid-with-php-openid/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 16:45:04 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[openid]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1322</guid>
		<description><![CDATA[If you are using the PHP OpenID library (which is also used by my OpenID component for CakePHP), it is possible that you get an &#8220;Invalid OpenID&#8221; error when you try to login with the Google OpenID (https://www.google.com/accounts/o8/id), or any other OpenID that uses &#8220;https&#8221;.
In this case, the following steps might help to fix this [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using the <a href="http://openidenabled.com/php-openid/">PHP OpenID library</a> (which is also used by my <a href="http://code.42dh.com/openid/">OpenID component</a> for CakePHP), it is possible that you get an &#8220;Invalid OpenID&#8221; error when you try to login with the Google OpenID (https://www.google.com/accounts/o8/id), or any other OpenID that uses &#8220;https&#8221;.</p>
<p>In this case, the following steps might help to fix this issue:</p>
<ul>
<li>Ensure you have Curl and OpenSSL installed</li>
<li>Enable the Curl and OpenSSL extensions in your php.ini (on Archlinux this file is found in /etc/php/):
<pre>
<code>extension=curl.so
extension=openssl.so</code>
</pre>
</li>
<li>Restart your web server</li>
</ul>
<p>Now the error message should disappear and you should be able to log in with the Google OpenID. </p>
<p>&#8212;-</p>
<p>That&#8217;s it for 2009. It was a rather lazy year on this blog from my side (I didn&#8217;t even manage to do a redesign&#8230;), and so I hope I will be a bit less lazy with writing on this blog in 2010.</p>
<p>Anyway, thank you for reading this blog, and for all your comments and emails. A Happy New Year everyone &#038; cu in 2010 :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/12/31/accepting-the-google-openid-with-php-openid/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Attribute Exchange support for the OpenID component</title>
		<link>http://cakebaker.42dh.com/2009/12/12/attribute-exchange-support-for-the-openid-component/</link>
		<comments>http://cakebaker.42dh.com/2009/12/12/attribute-exchange-support-for-the-openid-component/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 17:30:11 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[openid]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1314</guid>
		<description><![CDATA[The OpenID Attribute Exchange specification (or AX for short) has been around for quite a while, though I ignored it so far because at the time it was introduced (almost) no OpenID provider supported it. However, after Yahoo! announced they support Attribute Exchange, and someone recently mentioned it in a mail, it was time for [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://openid.net/specs/openid-attribute-exchange-1_0.html">OpenID Attribute Exchange specification</a> (or AX for short) has been around for quite a while, though I ignored it so far because at the time it was introduced (almost) no OpenID provider supported it. However, after Yahoo! <a href="http://developer.yahoo.net/blog/archives/2009/12/yahoo_openid_now_with_attribute_exchange.html">announced</a> they support Attribute Exchange, and someone recently mentioned it in a mail, it was time for me to have a look at it.</p>
<p>AX is in principle the &#8220;big brother&#8221; of the <a href="http://openid.net/specs/openid-simple-registration-extension-1_0.html">Simple Registration Extension</a> (or SReg for short). Whereas SReg only allows you to retrieve nine commonly requested pieces of information, AX allows you to retrieve any identity information. And theoretically it also allows you to store/update your identity information at your OpenID provider. But it seems like no OpenID provider supports this feature&#8230;</p>
<p>Let&#8217;s have a look at an example.</p>
<p>First the login method:</p>
<pre>
<code>// app/controllers/users_controller.php
class UsersController extends AppController {
    public $components = array('Openid', 'RequestHandler');

    public function login() {
        $realm = 'http://'.$_SERVER['SERVER_NAME'];
        $returnTo = $realm . '/users/login';

        if ($this-&gt;RequestHandler-&gt;isPost()) {
            $this-&gt;makeOpenIDRequest($this-&gt;data['User']['openid_identifier'], $returnTo, $realm);
        } elseif ($this-&gt;Openid-&gt;isOpenIDResponse()) {
            $this-&gt;handleOpenIDResponse($returnTo);
        }
    }
}</code>
</pre>
<p>The next step is to implement the makeOpenIDRequest() method. For each attribute we want to retrieve, we have to create an Auth_OpenID_AX_AttrInfo object with the respective attribute type. A list of possible types is available on <a href="http://www.axschema.org/types/">http://www.axschema.org/types/</a>. Though there are many types defined, OpenID providers usually only support a small subset of those types.</p>
<p>The &#8220;1&#8243; we pass to the make() method specifies the number of values we want for this type. In this example it doesn&#8217;t make much sense to specify a value other than &#8220;1&#8243;, but for other types it is theoretically possible to have multiple values (for example you could have defined multiple email addresses). It is an optional parameter and by default it is &#8220;1&#8243;.</p>
<p>The last parameter specifies whether the value of the attribute is required for our application. This is simply a hint for the OpenID provider so it could display this attribute differently, but it doesn&#8217;t guarantee a value is returned. By default this parameter is &#8220;false&#8221;.</p>
<pre>
<code>private function makeOpenIDRequest($openid, $returnTo, $realm) {
    $attributes[] = Auth_OpenID_AX_AttrInfo::make('http://axschema.org/namePerson', 1, true);
    $this-&gt;Openid-&gt;authenticate($openid, $returnTo, $realm, array('ax' =&gt; $attributes));
}</code>
</pre>
<p>Finally, we have to implement the handleOpenIDResponse() method. As we expect only one value for the attribute we specified, we can use either get() or getSingle() to retrieve its value. getSingle() returns the value whereas get() returns an array. </p>
<pre>
<code>private function handleOpenIDResponse($returnTo) {
    $response = $this-&gt;Openid-&gt;getResponse($returnTo);

    if ($response-&gt;status == Auth_OpenID_SUCCESS) {
        $axResponse = Auth_OpenID_AX_FetchResponse::fromSuccessResponse($response);

        if ($axResponse) {
            debug($axResponse-&gt;get('http://axschema.org/namePerson'));
            debug($axResponse-&gt;getSingle('http://axschema.org/namePerson'));
        }
    }
}</code>
</pre>
<p>That&#8217;s it. </p>
<p>You can get the new version of the OpenID component from <a href="http://github.com/cakebaker/openid-component">GitHub</a>. If you use SReg in your code and you want to update to this version, please make sure to adapt your code in the following way:</p>
<pre>
<code>// old
$this-&gt;Openid-&gt;authenticate($openid, $returnTo, $realm, array('email'), array('nickname'));

// new
$this-&gt;Openid-&gt;authenticate($openid, $returnTo, $realm, array('sreg_required' =&gt; array('email'), 'sreg_optional' =&gt; array('nickname')));</code>
</pre>
<p>Feedback is welcome :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/12/12/attribute-exchange-support-for-the-openid-component/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Render partial from an atom builder view</title>
		<link>http://cakebaker.42dh.com/2009/11/27/render-partial-from-an-atom-builder-view/</link>
		<comments>http://cakebaker.42dh.com/2009/11/27/render-partial-from-an-atom-builder-view/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 16:15:52 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1302</guid>
		<description><![CDATA[Thanks to the built-in AtomFeedHelper it is quite easy to generate an atom feed with Rails. 
Here an example from the API:

# app/views/posts/index.atom.builder
atom_feed do &#124;feed&#124;
  feed.title("My great blog!")
  feed.updated(@posts.first.created_at)

  @posts.each do &#124;post&#124;
    feed.entry(post) do &#124;entry&#124;
      entry.title(post.title)
      entry.content(post.body, :type =&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to the built-in <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/AtomFeedHelper.html">AtomFeedHelper</a> it is quite easy to generate an atom feed with Rails. </p>
<p>Here an example from the API:</p>
<pre>
<code># app/views/posts/index.atom.builder
atom_feed do |feed|
  feed.title("My great blog!")
  feed.updated(@posts.first.created_at)

  @posts.each do |post|
    feed.entry(post) do |entry|
      entry.title(post.title)
      entry.content(post.body, :type =&gt; 'html')

      entry.author do |author|
        author.name("DHH")
      end
    end
  end
end</code>
</pre>
<p>The code should be self-explanatory (if not, please leave a comment). </p>
<p>Recently, I had two such views which were almost identical, the only difference was the feed title. And that&#8217;s of course not really <a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">DRY</a>. </p>
<p>One possible approach to fix this &#8220;issue&#8221; is to set an instance variable with the feed title in the controller and render the same view in both cases. As I don&#8217;t like to set view titles (resp. feed titles in this case) in the controller, I decided to use a partial. </p>
<p>And so I put the code from above into a partial (plus changing the instance variable &#8220;@posts&#8221; to a local variable &#8220;posts&#8221; and introducing a new local variable &#8220;feed_title&#8221;), and tried to use this partial (app/views/shared/_feed.atom.builder) in the following way:</p>
<pre>
<code># app/views/posts/index.atom.builder
render :partial =&gt; 'shared/feed', :locals =&gt; {:feed_title =&gt; "My Posts", :posts =&gt; @posts}</code>
</pre>
<p>Well, it didn&#8217;t work. No output was generated. </p>
<p>After experimenting a bit I found the following solution by moving the outer-most block definition from the partial to the views:</p>
<pre>
<code># app/views/posts/index.atom.builder
atom_feed do |feed|
  render :partial =&gt; 'shared/feed', :locals =&gt; {:feed =&gt; feed, :feed_title =&gt; "My Posts", :posts =&gt; @posts}
end</code>
</pre>
<p>I don&#8217;t know whether this is the best solution (probably not), but it is definitely better than what I had previously ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/11/27/render-partial-from-an-atom-builder-view/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Link-like buttons</title>
		<link>http://cakebaker.42dh.com/2009/11/20/link-like-buttons/</link>
		<comments>http://cakebaker.42dh.com/2009/11/20/link-like-buttons/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 08:05:37 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1293</guid>
		<description><![CDATA[Sometimes you want to make a button look like a link. For example, in an admin interface you might want to have &#8220;links&#8221; to edit and delete articles. The &#8220;edit&#8221; link will be a normal link. But for the &#8220;delete&#8221; link you &#8220;cannot&#8221; use a normal link, because a delete action changes the state on [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to make a button look like a link. For example, in an admin interface you might want to have &#8220;links&#8221; to edit and delete articles. The &#8220;edit&#8221; link will be a normal link. But for the &#8220;delete&#8221; link you &#8220;cannot&#8221; use a normal link, because a delete action changes the state on the server and hence it should be performed using POST. Therefore the need for a button.</p>
<p>Thanks to CSS it should be easy to make a button look like a link, that&#8217;s what I thought when I started. But as usual when I work with CSS, what seems to be easy is not that easy&#8230; Anyway, here is the solution:</p>
<p>First the HTML code. Nothing special here, the only thing to note is that I had to use a &#8220;button&#8221; instead of an &#8220;input&#8221; element due to some CSS issues with <a href="http://www.konqueror.org/">Konqueror</a>. </p>
<pre>
<code>&lt;form action="/article/1" method="post"&gt;
  &lt;p&gt;
    &lt;button type="submit" class="link"&gt;&lt;span&gt;Delete&lt;/span&gt;&lt;/button&gt;
  &lt;/p&gt;
&lt;/form&gt;</code>
</pre>
<p>And here the CSS (thanks to Natalie Downe for her article <a href="http://natbat.net/2009/Jun/10/styling-buttons-as-links/">Styling buttons to look like links</a>, from where I got some of the settings below): </p>
<pre>
<code>button.link {
  -moz-user-select: text;
  background: none;
  border: none;
  cursor: pointer;
  color: blue;
  font-size: 1em;
  margin: 0;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  overflow: visible;
  width: auto;
}</code>
</pre>
<p>This worked fine in Konqueror, but in Firefox there was always a padding of 2px. And of course I had no clue why. As you can see in the CSS snippet above, the padding was already set to 0&#8230; Fortunately, I found the solution in a <a href="http://natbat.net/2009/Jun/10/styling-buttons-as-links/#c5551">comment</a> of the aformentioned article:</p>
<pre>
<code>button::-moz-focus-inner {
  padding: 0;
  border: none;
}</code>
</pre>
<p>To use such link-like buttons in your own application you have to adapt the CSS to your own needs.</p>
<p>Have fun :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/11/20/link-like-buttons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don’t apologize for being a newbie</title>
		<link>http://cakebaker.42dh.com/2009/11/12/dont-apologize-for-being-a-newbie/</link>
		<comments>http://cakebaker.42dh.com/2009/11/12/dont-apologize-for-being-a-newbie/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 16:16:37 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[communication]]></category>
		<category><![CDATA[learning]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1252</guid>
		<description><![CDATA[On mailing lists or in private mails I sometimes read statements like &#8220;I am sorry, but I am a newbie&#8221; or &#8220;Sorry for this newbie question&#8221;. And I always wonder why do those people apologize for not being proficient?
It is ok to be new and inexperienced with a framework/programming language/whatever. Everyone of us is from [...]]]></description>
			<content:encoded><![CDATA[<p>On mailing lists or in private mails I sometimes read statements like &#8220;I am sorry, but I am a newbie&#8221; or &#8220;Sorry for this newbie question&#8221;. And I always wonder why do those people apologize for not being proficient?</p>
<p>It is ok to be new and inexperienced with a framework/programming language/whatever. Everyone of us is from time to time in such a &#8220;newbie phase&#8221;. And this means you will ask &#8220;stupid&#8221; questions (of course after you have done your &#8220;homework&#8221;, i.e. searching on the internet, reading the documentation). It&#8217;s part of the learning process. And it&#8217;s nothing you have to apologize for.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/11/12/dont-apologize-for-being-a-newbie/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The end of CakePHP?</title>
		<link>http://cakebaker.42dh.com/2009/10/23/the-end-of-cakephp/</link>
		<comments>http://cakebaker.42dh.com/2009/10/23/the-end-of-cakephp/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 14:49:33 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1279</guid>
		<description><![CDATA[Today, Nate Abele, lead developer of CakePHP, announced in a cryptic tweet that he leaves the project. This comes shortly after Gwoo, the project manager, left the project, too. It seems like they started to work on a fork of Cake3 called &#8220;Lithium&#8221;. On Twitter people are a bit puzzled about those events, some even [...]]]></description>
			<content:encoded><![CDATA[<p>Today, Nate Abele, lead developer of CakePHP, announced in a cryptic <a href="http://twitter.com/nateabele/status/5087443139">tweet</a> that he leaves the project. This comes shortly after Gwoo, the project manager, left the project, too. It seems like they started to work on a fork of Cake3 called <a href="http://irc.cakephp.org/logs/link/1110092#message1110102">&#8220;Lithium&#8221;</a>. On Twitter people are a bit puzzled about those events, some even think it is the end of CakePHP&#8230;</p>
<p>I don&#8217;t know whether this will be the case, it is too early to say. But I doubt it. The project is still backed by the <a href="http://cakedc.com">Cake Development Company</a>, which employs some of the core <a href="http://code.cakephp.org/wiki/about/contributors">contributors</a> (Larry Masters aka PhpNut, Mark Story). That&#8217;s some guarantee that the show will go on. And of course there is a large community. </p>
<p>On the other hand I don&#8217;t know how many of the other contributors will remain. And the lack of (official) communication is also not that good for the confidence into the project. What happened? What will be the next steps? Who will take over those vacant roles? See also Matt Curry&#8217;s <a href="http://www.pseudocoder.com/archives/2009/10/23/cakephp-digest-21-–-whose-left/">post</a> on this matter.</p>
<p>Anyway, probably the best thing to do now is to drink tea and to wait until the dust settles&#8230;</p>
<p>Update (2009-10-23): an <a href="http://bakery.cakephp.org/articles/view/the-cake-is-still-rising">official statement</a> has been published in the meantime.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/10/23/the-end-of-cakephp/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>My tool box</title>
		<link>http://cakebaker.42dh.com/2009/10/16/my-tool-box/</link>
		<comments>http://cakebaker.42dh.com/2009/10/16/my-tool-box/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 15:54:18 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1263</guid>
		<description><![CDATA[In the last few days several people in the Rails world wrote about their &#8220;tools of the trade&#8221;. And as I have never written about the tools I use, I think it is a good time to do it now.
There isn&#8217;t much to say about the hardware I use: my only machine is a Dual-Core [...]]]></description>
			<content:encoded><![CDATA[<p>In the last few days <a href="http://afreshcup.com/2009/10/11/my-tools-of-the-trade-2009/">several</a> <a href="http://afreshcup.com/2009/10/14/double-shot-561/">people</a> in the Rails world wrote about their &#8220;tools of the trade&#8221;. And as I have never written about the tools I use, I think it is a good time to do it now.</p>
<p>There isn&#8217;t much to say about the hardware I use: my only machine is a Dual-Core Toshiba Notebook with 4GB RAM and a <a href="http://en.wikipedia.org/wiki/Pointing_stick">trackpoint</a> (the most important feature to me, as it allows me to keep my hands on the keyboard all the time). </p>
<p>And here my (probably incomplete) list of software I often use:</p>
<ul>
<li><strong>OS</strong> &#8211; <a href="http://archlinux.org">Arch Linux</a> with <a href="http://kde.org/">KDE</a> as window manager</li>
<li><strong>Browsers</strong> &#8211; My preferred browser is <a href="http://www.konqueror.org/">Konqueror</a>, it is light-weight and, thanks to the good KDE integration, it is a Swiss Army knife. However, it doesn&#8217;t work properly with some websites&#8230; The other browser I use is <a href="http://www.mozilla.com/en-US/">Firefox</a> with the <a href="http://adblockplus.org/en/">Adblock Plus</a> plugin (additionally I have <a href="http://getfirebug.com/">Firebug</a> installed, though it is usually deactivated).</li>
<li><strong>Chat</strong> &#8211; To chat I use either <a href="http://kopete.kde.org/">Kopete</a> or <a href="http://www.skype.com/">Skype</a></li>
<li><strong>Mail</strong> &#8211; <a href="http://www.mozillamessaging.com/en-US/thunderbird/">Thunderbird</a></li>
<li><strong>IRC</strong> &#8211; <a href="http://konversation.kde.org/">Konversation</a></li>
<li><strong>Database Tools</strong> &#8211; <a href="http://dev.mysql.com/downloads/gui-tools/5.0.html">MySQL Query Browser</a></li>
<li><strong>Coding</strong> &#8211; <a href="http://eclipse.org/">Eclipse</a> with <a href="http://eclipse.org/pdt/">PDT</a> has been for a long time my primary development environment. However, as it seems like it becomes worse with each release, I use more and more the <a href="http://www.vim.org/">Vim</a> editor.</li>
<li><strong>Source Control</strong> &#8211; For the few remaining Subversion repositories I use the <a href="http://www.eclipse.org/subversive/">Subversive</a> Eclipse plugin, and for everything else I simply use <a href="http://git-scm.com/">Git</a></li>
<li><strong>Graphics</strong> &#8211; <a href="http://inkscape.org">Inkscape</a></li>
<li><strong>Debugging</strong> &#8211; To see what&#8217;s going on when working with OpenID or some APIs I like the <a href="http://www.wireshark.org/">Wireshark</a> network protocol analyzer</li>
</ul>
<p>And last, but not least, my favorite tools: paper and pen. I use them primarily to manage my todos and most of my passwords, to draw UML diagrams, and to sketch UIs.</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/10/16/my-tool-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails 2.3.4 and Ruby 1.9.1</title>
		<link>http://cakebaker.42dh.com/2009/09/14/rails-2-3-4-and-ruby-1-9-1/</link>
		<comments>http://cakebaker.42dh.com/2009/09/14/rails-2-3-4-and-ruby-1-9-1/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 09:43:55 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[problem]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1255</guid>
		<description><![CDATA[This morning, the Ruby package for Arch Linux was upgraded from version 1.8.7 to 1.9.1. Unfortunately, after the upgrade all Rails applications (using Rails 2.3.4) stopped to work and showed an error like:

undefined method `^' for "b":String (NoMethodError)

Fortunately, I am not the first one who encountered this issue, and so it is already fixed in [...]]]></description>
			<content:encoded><![CDATA[<p>This morning, the Ruby package for <a href="http://www.archlinux.org">Arch Linux</a> was upgraded from version 1.8.7 to 1.9.1. Unfortunately, after the upgrade all Rails applications (using Rails 2.3.4) stopped to work and showed an error like:</p>
<pre>
<code>undefined method `^' for "b":String (NoMethodError)</code>
</pre>
<p>Fortunately, I am not the first one who encountered <a href="https://rails.lighthouseapp.com/projects/8994/tickets/3144-undefined-method-for-string-ror-234">this issue</a>, and so it is already fixed in the <a href="http://github.com/rails/rails">Rails git repository</a>. To fix it on my local installation, I simply had to replace /&lt;path_to_ruby_gems&gt;/activesupport-2.3.4/lib/active_support/message_verifier.rb with the corresponding file from the git repository. And with that, my applications started to work again :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/09/14/rails-2-3-4-and-ruby-1-9-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Extending CakePHP’s core components</title>
		<link>http://cakebaker.42dh.com/2009/09/08/extending-cakephps-core-components/</link>
		<comments>http://cakebaker.42dh.com/2009/09/08/extending-cakephps-core-components/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 06:12:52 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[component]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=1248</guid>
		<description><![CDATA[In a recent comment David Cournoyer shared a tip about extending CakePHP&#8217;s core components and I think it could also be useful for others. 
Let&#8217;s say we want to add a method to the request handler component. And so we create a new class which inherits from the request handler component:

// app/controllers/components/my_request_handler.php
App::import('Component', 'RequestHandler');
class MyRequestHandlerComponent extends [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://cakebaker.42dh.com/2008/11/07/an-idea-for-hacking-core-helpers/#comment-135701">recent comment</a> <a href="http://www.quatral.com/">David Cournoyer</a> shared a tip about extending CakePHP&#8217;s core components and I think it could also be useful for others. </p>
<p>Let&#8217;s say we want to add a method to the request handler component. And so we create a new class which inherits from the request handler component:</p>
<pre>
<code>// app/controllers/components/my_request_handler.php
App::import('Component', 'RequestHandler');
class MyRequestHandlerComponent extends RequestHandlerComponent {
    public function example() {
        // do something
    }
}</code>
</pre>
<p>To use this component, we have to add it to the $components array of our controller:</p>
<pre>
<code>// app/app_controller.php
class AppController extends Controller {
    public $components = array('MyRequestHandler');	
}</code>
</pre>
<p>Nothing new so far. However, a disadvantage of this approach is that you have to use the component in the following way:</p>
<pre>
<code>$this-&gt;MyRequestHandler-&gt;isAjax();
$this-&gt;MyRequestHandler-&gt;example();</code>
</pre>
<p>Wouldn&#8217;t it be nice if we could use it in the usual way?</p>
<pre>
<code>$this-&gt;RequestHandler-&gt;isAjax();
$this-&gt;RequestHandler-&gt;example();</code>
</pre>
<p>And yes, it is possible. For this purpose we have to override Controller::constructClasses():</p>
<pre>
<code>// app/app_controller.php
class AppController extends Controller {
    public $components = array('MyRequestHandler');
	
    public function constructClasses() {
        parent::constructClasses();
        $this-&gt;RequestHandler = $this-&gt;MyRequestHandler;
    }
}</code>
</pre>
<p>Happy baking!</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2009/09/08/extending-cakephps-core-components/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
