<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Food for thought</title>
    <link>http://blog.mkolodziej.net/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>a blog by &lt;a href="/pages/about"&gt;Maciek Kolodziej&lt;/a&gt;</description>
    <item>
      <title>How to vertically align an image within a div. Again.</title>
      <description>&lt;p&gt;Yeah, so the topic is old, all right. One can find hundreds of articles on the web. Nevertheless, I spent a few hours yesterday looking for an elegant and simple solution to this problem.&lt;/p&gt;

&lt;p&gt;I wanted to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;center an image of an unknown size (but of known maximum size) within a div element&lt;/li&gt;
&lt;li&gt;simple implementation in pure CSS, no tables&lt;/li&gt;
&lt;li&gt;cross-browser compatibility on all major browsers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I found one solution on &lt;a href="http://www.webmasterworld.com/forum83/7910.htm"&gt;Webmaster World forum&lt;/a&gt;. It worked on IE, but not in Firefox. After some more research I added a hack &lt;a href="http://www.ibloomstudios.com/articles/applied_css_vertical-align/"&gt;proposed by Nicholas Gagne&lt;/a&gt; and now it seems to work on both browsers:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;style type="text/css"&amp;gt;
    div {line-height:150px; text-align: center; width: 150px; 
         font-size: 150px;}
    img {vertical-align:middle;}
    *&amp;gt;div{font-size:12px;}
    &amp;lt;/style&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;div style="border:1px solid gray;"&amp;gt;
      &amp;lt;img src="/images/examples/test.jpg"&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Pay attention to the DOCTYPE declaration: it has to be &lt;strong&gt;strict&lt;/strong&gt; XHTML. It doesn&amp;#8217;t work with &lt;em&gt;transitional&lt;/em&gt; in Firefox. You can replace the line-height, width and font-size of course, just keep the &amp;#8220;vertical&amp;#8221; pixel sizes the same - width can be different.&lt;/p&gt;

&lt;p&gt;I tested it in IE6 and Firefox 2.0.0.11&lt;/p&gt;</description>
      <pubDate>Fri, 25 Jan 2008 03:44:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:59c09aa2-5e35-4e0c-ae93-879edf51df5f</guid>
      <author>Maciej Kołodziej</author>
      <link>http://blog.mkolodziej.net/articles/2008/01/25/how-to-vertically-align-an-image-within-a-div-again</link>
      <category>css</category>
      <category>html</category>
      <category>webdesign</category>
      <trackback:ping>http://blog.mkolodziej.net/articles/trackback/18664</trackback:ping>
    </item>
    <item>
      <title>Using IMAP to migrate email messages to GMail</title>
      <description>&lt;p&gt;Many people on internet forums are asking how to migrate their mailboxes from desktop email clients to &lt;em&gt;GMail&lt;/em&gt;. I tried to do it myself today and it seems that the easiest solution is very hard to find on the web.&lt;/p&gt;

&lt;p&gt;It appears that with the current &lt;em&gt;GMail&lt;/em&gt; version supporting &lt;em&gt;IMAP&lt;/em&gt;, you no longer need external tools like gExodus or &lt;a href="http://www.marklyon.org/gmail/default.htm"&gt;Google GMail Loader&lt;/a&gt;. All you need is your desktop email client supporting &lt;em&gt;IMAP&lt;/em&gt;. &lt;em&gt;Thunderbird&lt;/em&gt; for example does support it, so to migrate all your messages you need to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enable &lt;em&gt;IMAP&lt;/em&gt; in your &lt;em&gt;GMail&lt;/em&gt; settings&lt;/li&gt;
&lt;li&gt;[optional] Create label(s) in &lt;em&gt;GMail&lt;/em&gt; for your imported messages&lt;/li&gt;
&lt;li&gt;Configure Thunderbird to access &lt;em&gt;GMail&lt;/em&gt; account using &lt;em&gt;IMAP&lt;/em&gt; - any of previously created labels will appear as folders in &lt;em&gt;Thunderbird&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Move or copy your messages to &lt;em&gt;All Mail&lt;/em&gt; folder or any of the label folders&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That&amp;#8217;s it! All the information in your messages will be preserved (including dates) and if you copy/move them to the labeled folders they&amp;#8217;ll be automatically labeled in &lt;em&gt;GMail&lt;/em&gt;.&lt;/p&gt;</description>
      <pubDate>Mon, 21 Jan 2008 06:51:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:cb42d269-043c-4ac7-a3c4-383f541ab72b</guid>
      <author>Maciej Kołodziej</author>
      <link>http://blog.mkolodziej.net/articles/2008/01/21/using-imap-to-migrate-email-messages-to-gmail</link>
      <category>gmail</category>
      <trackback:ping>http://blog.mkolodziej.net/articles/trackback/17952</trackback:ping>
    </item>
    <item>
      <title>Useful URLs for RoR 2.0</title>
      <description>&lt;p&gt;I spent last evening coding a new web app in RoR 2.0 till 2 a.m. This is fantastic how smooth and enjoyable the experience is. Although I had previously coded a few other apps in RoR and I loved it too, this time it was even better. &lt;/p&gt;

&lt;p&gt;I feel it&amp;#8217;s mainly because I found a ton of great tutorials and documentation I didn&amp;#8217;t have previously. And although I own the 2nd edition of the &lt;a href="http://pragprog.com/titles/rails2/"&gt;Rails book&lt;/a&gt; it doesn&amp;#8217;t cover the RESTful features deeply enough and this is the killer feature in 2.0.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;re some URLs that I think are worth sharing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://railscasts.com/"&gt;Railscasts&lt;/a&gt; - a fantastic collection of free RoR screencasts by Ryan Bates&lt;/li&gt;
&lt;li&gt;&lt;a href="http://svn.techno-weenie.net/projects/plugins/attachment_fu/"&gt;attachment_fu&lt;/a&gt; plugin by &lt;a href="http://techno-weenie.net/"&gt;Rick Olson&lt;/a&gt; and &lt;a href="http://clarkware.com/cgi/blosxom/2007/02/24"&gt;a great tutorial&lt;/a&gt; by Mike Clark&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.juixe.com/techknow/index.php/2006/06/18/acts-as-commentable-plugin/"&gt;acts_as_commentable&lt;/a&gt; plugin&lt;/li&gt;
&lt;li&gt;&lt;a href="http://code.google.com/p/rolerequirement/"&gt;role_requirement&lt;/a&gt; and &lt;a href="http://agilewebdevelopment.com/plugins/restful_authentication"&gt;restful_authentication&lt;/a&gt; plugins&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope it&amp;#8217;s useful!&lt;/p&gt;</description>
      <pubDate>Tue, 18 Dec 2007 03:17:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:684e0751-15c0-4bac-9d8f-e6fcc7431b55</guid>
      <author>Maciej Kołodziej</author>
      <link>http://blog.mkolodziej.net/articles/2007/12/18/useful-urls-for-ror-2-0</link>
      <category>ruby</category>
      <category>rails</category>
      <trackback:ping>http://blog.mkolodziej.net/articles/trackback/15541</trackback:ping>
    </item>
    <item>
      <title>Eric Sink on Eclipse</title>
      <description>&lt;p&gt;Eric Sink, a die hard &amp;#8220;Microsoftie&amp;#8221;, is writing &lt;a href="http://www.ericsink.com/entries/java_eclipse_3.html"&gt;a series of articles&lt;/a&gt; on his experiences with Eclipse. Boy, it feels like a teacher prising my kid :). I didn&amp;#8217;t think I&amp;#8217;m one of those who feel so attached to their tools of choice :)&lt;/p&gt;</description>
      <pubDate>Wed, 28 Nov 2007 08:50:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:6ddbebe3-4f3f-4745-a024-e6f17d1e7201</guid>
      <author>Maciej Kołodziej</author>
      <link>http://blog.mkolodziej.net/articles/2007/11/28/eric-sink-on-eclipse</link>
      <trackback:ping>http://blog.mkolodziej.net/articles/trackback/2342</trackback:ping>
    </item>
    <item>
      <title>Tungsten T3 and Motorola V3</title>
      <description>&lt;p&gt;My collection of gadgets isn&amp;#8217;t as impressive as &lt;a href="http://www.hanselman.com/blog/TheGreatGeekGadgetGiveawayGrabBagErAuction.aspx"&gt;Scott Hanselman&amp;#8217;s is&lt;/a&gt;, but I&amp;#8217;m constantly working on it, so last week I bought a Palm Tungsten T3. Yes, I know it&amp;#8217;s not the latest and greatest, but it&amp;#8217;s perfectly fine for me. It has a good calendar obviously, but also Bluetooth on board, which means email and web browsing work seamlessly (well, almost). It also has a 400 MHz CPU so it can play good quality MP4 videos  on its wide screen. And I bought it for around $180 with a complete set of accessories that come in the original box.&lt;/p&gt;

&lt;p&gt;I wrote &amp;#8220;almost&amp;#8221; about the connectivity part though, because of one little hiccup, which you probably won&amp;#8217;t notice, unless you own a Motorola V3 (RAZR). Configuring a GPRS Internet connection over Bluetooth with this phone was a &lt;em&gt;nightmare&lt;/em&gt;. Even though I had the &lt;a href="http://kb.palm.com/SRVS/CGI-BIN/WEBCGI.EXE?New,Kb=EUPalmSupport,ts=PALMEU_UK,Case=Obj(7039),Question=obj(5356):obj(7139)"&gt;latest drivers from Palm&lt;/a&gt;. They worked fine for the SMS/dialer part, but not for the GPRS modem part.&lt;/p&gt;

&lt;p&gt;After two days of searching the Internet (I did the mistake of looking for a general solution, not the V3 specific one) it finally works, thanks to &lt;a href="http://forums.palm.com/palm/board/message?board.id=wireless_providers&amp;amp;message.id=2558#M2558"&gt;a post on Palm forum&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;So, in short, here&amp;#8217;s what you need to do. The settings I used are for polish provider Era GSM, so where I typed &lt;em&gt;erainternet&lt;/em&gt;, you should put something specific to your provider; same for the DNS.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Create a new connection on the Palm: go to &lt;em&gt;Prefs -&gt; Connection -&gt; New&lt;/em&gt; and configure as follows: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Name: LAN V3 (or whatever)
Connect to: Local Network
Via: Bluetooth 
Device: (tap to find, select your phone, follow the guidelines)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Go to &lt;em&gt;Prefs -&gt; Network -&gt; New&lt;/em&gt; and type&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Service: Dialup Connection (or whatever) 
User name: erainternet 
Password: erainternet 
Connection: LAN V3 (the one you created above)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Select &lt;em&gt;Details&lt;/em&gt; and and set it to: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Connection type: PPP 
Idle timeout: Never 
Query DNS: (unchecked and put 213.158.194.1) 
IP Address: (checked) Automatic
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Select Script and enter the following: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Send: at+cgdcont=1,"IP","erainternet" 
Send CR: 
Send: ATD*99# 
Send CR: 
End:
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You&amp;#8217;re done.&lt;/p&gt;

&lt;p&gt;If you want to use your Palm to send SMSs or use &lt;em&gt;Dialer&lt;/em&gt;, add another connection, this time configuring it as &lt;em&gt;Phone&lt;/em&gt; and using &lt;em&gt;Universal Phone Driver&lt;/em&gt;.&lt;/p&gt;</description>
      <pubDate>Thu, 23 Aug 2007 00:22:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:50b07ffc-7d64-42e2-83c7-f66cb970df77</guid>
      <author>Maciej Kołodziej</author>
      <link>http://blog.mkolodziej.net/articles/2007/08/23/tungsten-t3-and-motorola-v3</link>
      <trackback:ping>http://blog.mkolodziej.net/articles/trackback/6</trackback:ping>
    </item>
    <item>
      <title>Rails: Two Models in One Form</title>
      <description>&lt;p&gt;Note to self: On Rails Forum RyanB gives a good example on how to handle two models in one form when &lt;a href="http://railsforum.com/viewtopic.php?pid=3713"&gt;creating&lt;/a&gt; or &lt;a href="http://railsforum.com/viewtopic.php?pid=3714"&gt;editing&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Tue, 24 Apr 2007 00:31:00 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:cdc54d47-da9e-4f19-93b8-aa956737771a</guid>
      <author>Maciej Kołodziej</author>
      <link>http://blog.mkolodziej.net/articles/2007/04/24/rails-creating-two-models-in-one-form</link>
      <category>rails</category>
      <trackback:ping>http://blog.mkolodziej.net/articles/trackback/5</trackback:ping>
    </item>
    <item>
      <title>Book recommendations</title>
      <description>&lt;p&gt;I plan to add a separate page with book recommendations but for now I&amp;#8217;ve created the sidebar with titles I&amp;#8217;m currently reading.&lt;/p&gt;

&lt;p&gt;Just added &lt;a href="http://www.amazon.com/o/ASIN/1590592395"&gt;Practical Common Lisp&lt;/a&gt; (I came back to this book after a short brake - you can use &lt;a href="http://common-lisp.net/project/lispbox/"&gt;Lisp in a Box&lt;/a&gt; with it) and &lt;a href="http://www.amazon.com/o/ASIN/0201558025"&gt;Concrete Mathematics&lt;/a&gt;. The latter is part of my quest to refresh my math knowlege - I&amp;#8217;ll be writing more about that soon.&lt;/p&gt;</description>
      <pubDate>Tue, 31 Oct 2006 07:02:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:2a0dc8ed-417b-4543-84c8-ac0b77cbd6ed</guid>
      <author>Maciej Kołodziej</author>
      <link>http://blog.mkolodziej.net/articles/2006/10/31/book-recommendations</link>
      <trackback:ping>http://blog.mkolodziej.net/articles/trackback/4</trackback:ping>
    </item>
    <item>
      <title>Dynamic Drive CSS Layouts</title>
      <description>&lt;p&gt;Check out those &lt;a href="http://www.dynamicdrive.com/style/layouts/"&gt;pure CSS page templates&lt;/a&gt; from Dynamic Drive.&lt;/p&gt;

&lt;p&gt;Pick your fixed/fluid version and column layout and download! &lt;/p&gt;

&lt;p&gt;&lt;img src="/files/dd_csslayouts.png" alt="CSS page templates"/&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 31 Oct 2006 02:30:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:2bd150f8-6666-4dcb-ad4b-16834eab94d2</guid>
      <author>Maciej Kołodziej</author>
      <link>http://blog.mkolodziej.net/articles/2006/10/31/dynamic-drive-css-layouts</link>
      <trackback:ping>http://blog.mkolodziej.net/articles/trackback/2</trackback:ping>
    </item>
  </channel>
</rss>
