<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <id>tag:jamil.fluidsoul.net,2008:/posts</id>
  <link type="text/html" href="http://jamil.fluidsoul.net/" rel="alternate"/>
  <link type="application/atom+xml" href="http://jamil.fluidsoul.net/.atom" rel="self"/>
  <title>jamil.tao</title>
  <updated>2011-07-08T10:20:29Z</updated>
  <generator uri="jamil.fluidsoul.net">jamil.tao</generator>
  <author>
    <name>Jamil Antonino</name>
    <email>jamil@fluidsoul.net</email>
  </author>
  <entry>
    <id>tag:jamil.fluidsoul.net,2008:Post/5</id>
    <published>2011-07-09T07:20:00Z</published>
    <updated>2011-07-08T10:20:29Z</updated>
    <link type="text/html" href="http://jamil.fluidsoul.net/2011/07/09/eat-n-split-v1-0-for-android-released" rel="alternate"/>
    <title>Eat N Split v1.0 For Android released!</title>
    <content type="html">&lt;p&gt;Eat N Split v1.0 is now available on the Android Market. &lt;strong&gt;Eat N Split is a bill splitting application, that takes a different approach than most other bill splitters out there.&lt;/strong&gt;
&lt;cut&gt;&lt;/p&gt;

&lt;p&gt;It allows you to add items with different quantities, choose which people will split each item, add taxes, tip, or other percentages, then spits out the results per person. Other Bill Splitters usually add the taxes as a separate item, which isn't always fair when people are spending for different items. Since their portions of the taxes are different, Eat N Split computes for taxes based on the amount that each person spends on items.&lt;/p&gt;

&lt;p&gt;Eat N Split can be used anywhere since you can enter any percent for taxes. For example, here in the Philippines, bills usually have a 10% service charge and a 12% Value Added Tax. Other places may have a 5% Sales Tax, or none at all. Eat N Split will work for you in any of these situations!&lt;/p&gt;

&lt;p&gt;Split your bills in style! Available at the &lt;a href=&quot;https://market.android.com/details?id=com.fluidsoul.eatnsplit&amp;amp;feature=search_result&quot;&gt;Android Market&lt;/a&gt;&lt;/p&gt;

&lt;center&gt;
&lt;img src=&quot; http://i55.tinypic.com/ogzy50.png&quot; alt=&quot;Eat N Split Logo&quot;/&gt;
&lt;/center&gt;


</content>
  </entry>
  <entry>
    <id>tag:jamil.fluidsoul.net,2008:Post/4</id>
    <published>2011-06-28T21:30:59Z</published>
    <updated>2011-06-28T21:30:59Z</updated>
    <link type="text/html" href="http://jamil.fluidsoul.net/2011/06/28/getting-hbase-and-thrift-running-on-a-mac" rel="alternate"/>
    <title>Getting Hbase and Thrift Running on a Mac</title>
    <content type="html">&lt;p&gt;I've been working on a startup called &lt;a href=&quot;http://www.contactjam.com&quot;&gt;ContactJam&lt;/a&gt;, and a few months ago, we switched from MySQL to Hbase. Since the switch, a big frustration of mine has been connecting to a remote instance of Hbase for development. &lt;strong&gt;I recently discovered a homebrew recipe to get Hbase running locally on my Mac.&lt;/strong&gt; This recipe makes setting up Hbase and Thrift locally super easy, and will get you up and running in no time.
&lt;cut&gt;&lt;/p&gt;

&lt;p&gt;First of, the brew command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;brew install hbase
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This installs downloads and installs Hbase in your Homebrew directory (default is &lt;code&gt;/usr/local/Cellar/hbase&lt;/code&gt;). The next thing you need to do is update your &lt;code&gt;hbase-site.xml&lt;/code&gt; file found in &lt;code&gt;/usr/local/Cellar/hbase/conf&lt;/code&gt;. The reason for this is by default, hbase stores the database in &lt;code&gt;/tmp&lt;/code&gt;, which means that if that directory is emptied, your data will be gone. Mine looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;
&amp;lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;configuration.xsl&quot;?&amp;gt;
&amp;lt;!--
/**
 * Copyright 2010 The Apache Software Foundation
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * &quot;License&quot;); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
--&amp;gt;
&amp;lt;configuration&amp;gt;
  &amp;lt;property&amp;gt;
    &amp;lt;name&amp;gt;hbase.rootdir&amp;lt;/name&amp;gt;
    &amp;lt;value&amp;gt;file:///usr/local/Cellar/hbase/databases/hbase-${user.name}/hbase&amp;lt;/value&amp;gt;
    &amp;lt;description&amp;gt;The directory shared by region servers and into
    which HBase persists.  The URL should be 'fully-qualified'
    to include the filesystem scheme.  For example, to specify the
    HDFS directory '/hbase' where the HDFS instance's namenode is
    running at namenode.example.org on port 9000, set this value to:
    hdfs://namenode.example.org:9000/hbase.  By default HBase writes
    into /tmp.  Change this configuration else all data will be lost
    on machine restart.
    &amp;lt;/description&amp;gt;
  &amp;lt;/property&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As you can see, I moved the database path to:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/usr/local/Cellar/hbase/databases/hbase-${user.name}/hbase
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The last thing we need to do is start up Hbase and Thrift. I created an shell script that will start them both, which looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#!/bin/sh

start-hbase.sh
hbase thrift -b 127.0.0.1 start
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I put this file in my &lt;code&gt;/usr/bin&lt;/code&gt; directory so it is included in my path.&lt;/p&gt;

&lt;p&gt;That's it! You can confirm that hbase is up and running using &lt;code&gt;hbase shell&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ruby-1.8.7-p334 :007 &amp;gt; create 'table', 'column'
0 row(s) in 1.2090 seconds

ruby-1.8.7-p334 :008 &amp;gt; put 'table', 'key', 'column', 'value'
0 row(s) in 0.0660 seconds

ruby-1.8.7-p334 :009 &amp;gt; scan 'table'
ROW                                              COLUMN+CELL                                                                                                                                  
 key                                             column=column:, timestamp=1309296392773, value=value                                                                                         
1 row(s) in 0.0650 seconds

ruby-1.8.7-p334 :012 &amp;gt; get 'table', 'key'                   
COLUMN                                           CELL                                                                                                                                         
 column:                                         timestamp=1309296458684, value=value                                                                                                         
1 row(s) in 0.0350 seconds
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Sources/References&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://hbase.apache.org/book/quickstart.html&quot;&gt;http://hbase.apache.org/book/quickstart.html&lt;/a&gt;
&lt;a href=&quot;http://blog.skalar.no/massiverecord-how-to-get-started&quot;&gt;MassiveRecord - How to get started&lt;/a&gt;&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>tag:jamil.fluidsoul.net,2008:Post/3</id>
    <published>2011-06-28T20:36:10Z</published>
    <updated>2011-06-28T20:36:09Z</updated>
    <link type="text/html" href="http://jamil.fluidsoul.net/2011/06/28/using-date-select-with-massiverecord" rel="alternate"/>
    <title>Using date_select with MassiveRecord</title>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://github.com/companybook/massive_record&quot;&gt;MassiveRecord&lt;/a&gt; is a ruby ORM for Hbase. It works well, although it is still a pretty young project. &lt;strong&gt;One issue I came across was that &lt;code&gt;date_select&lt;/code&gt; didn't parse into a Date object.&lt;/strong&gt; The problem is, since date_select splits the date parameters (Month, Day, and Year) into 3 separate objects.
&lt;cut&gt;
The fix is simple enough. Before you can &lt;code&gt;update_attributes&lt;/code&gt; on your object, you need to parse the date, add it to the params hash, and remove the 3 elements generated by &lt;code&gt;date_select&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In my project, I was saving the &lt;code&gt;birthday&lt;/code&gt; attribute, which was in a sub-form in the profile object.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; date = Date.parse( params[:profile][&quot;birthday(1i)&quot;] + &quot;-&quot; + params[:profile][&quot;birthday(2i)&quot;] + &quot;-&quot; + params[:profile][&quot;birthday(3i)&quot;] )

  params[:profile][:birthday] = date.to_s
  params[:profile].delete(&quot;birthday(1i)&quot;)
  params[:profile].delete(&quot;birthday(2i)&quot;)
  params[:profile].delete(&quot;birthday(3i)&quot;)     
&lt;/code&gt;&lt;/pre&gt;</content>
  </entry>
  <entry>
    <id>tag:jamil.fluidsoul.net,2008:Post/2</id>
    <published>2011-03-19T06:59:25Z</published>
    <updated>2011-03-19T06:59:24Z</updated>
    <link type="text/html" href="http://jamil.fluidsoul.net/2011/03/19/watch-star-wars-on-telnet" rel="alternate"/>
    <title>Watch Star Wars on Telnet!</title>
    <content type="html">&lt;p&gt;I came across this a long time ago, and randomly came across it again recently.
&lt;cut&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;telnet towel.blinkenlights.nl
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Enter this command in any command prompt, and enjoy the show!&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>tag:jamil.fluidsoul.net,2008:Post/1</id>
    <published>2011-03-06T05:55:00Z</published>
    <updated>2011-03-06T05:55:14Z</updated>
    <link type="text/html" href="http://jamil.fluidsoul.net/2011/03/06/creating-android-applications-for-multiple-screen-sizes" rel="alternate"/>
    <title>Creating Android Applications for Multiple Screen Sizes</title>
    <content type="html">&lt;p&gt;A lot of Android applications I've used don't provide interfaces for multiple screen sizes. &lt;strong&gt;Using applications that don't scale properly can be extremely annoying, and if your app doesn't scale properly, it can really decreases the value of your app to users.&lt;/strong&gt; In this post, I will explain how to create the different layouts for the different screen sizes.
&lt;cut&gt;&lt;/p&gt;

&lt;br /&gt;


&lt;h2&gt;Screen Types&lt;/h2&gt;

&lt;p&gt;Reading the &lt;a href=&quot;http://developer.android.com/guide/practices/screens_support.html---&quot;&gt;Android Developer Documentation&lt;/a&gt; on the topic give us a good base to understand how Android can scale to multiple screen sizes, but doesn't fully explain how to achieve it. Let's start at the beginning. Android provides for 4 screen sizes and 4 pixel densities. The screen sizes are the physical sizes of the screen, while the pixel densities are the resolution.&lt;/p&gt;

&lt;table&gt;
    &lt;tbody style=&quot;display: table-row-group;&quot;&gt;
    &lt;tr&gt;
      &lt;td style=&quot;border:none&quot;&gt;&lt;/td&gt;
      &lt;td style=&quot;background-color:#f3f3f3;border: 1px solid #CCC;&quot;&gt;
        Low density (120), &lt;em&gt;ldpi&lt;/em&gt;
      &lt;/td&gt;
      &lt;td style=&quot;background-color:#f3f3f3;border: 1px solid #CCC;&quot;&gt;
        Medium density (160), &lt;em&gt;mdpi&lt;/em&gt;
      &lt;/td&gt;
      &lt;td style=&quot;background-color:#f3f3f3;border: 1px solid #CCC;&quot;&gt;
        High density (240), &lt;em&gt;hdpi&lt;/em&gt;
      &lt;/td&gt;
      &lt;td style=&quot;background-color:#f3f3f3;border: 1px solid #CCC;&quot;&gt;
        &lt;nobr&gt;Extra high density&lt;/nobr&gt; (320), &lt;em&gt;xhdpi&lt;/em&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;background-color:#f3f3f3;border: 1px solid #CCC;&quot;&gt;
        &lt;em&gt;Small&lt;/em&gt; screen
      &lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;QVGA (240x320)&lt;/td&gt;
      
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;&lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;&lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;background-color:#f3f3f3;border: 1px solid #CCC;&quot;&gt;
        &lt;em&gt;Normal&lt;/em&gt; screen
      &lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;WQVGA400 (240x400)&lt;br&gt;WQVGA432 (240x432)&lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;HVGA (320x480)&lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;WVGA800 (480x800)&lt;br&gt;WVGA854 (480x854)&lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;background-color:#f3f3f3;border: 1px solid #CCC;&quot;&gt;
        &lt;em&gt;Large&lt;/em&gt; screen
      &lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;WVGA800* (480x800)&lt;br&gt;WVGA854* (480x854)&lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt; &lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;background-color:#f3f3f3;border: 1px solid #CCC;&quot;&gt;
        &lt;em&gt;Extra Large&lt;/em&gt; screen
      &lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;&lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;&lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;&lt;/td&gt;
      &lt;td style=&quot;font-size:.9em;border: 1px solid #CCC;&quot;&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td colspan=&quot;4&quot;&gt;Source: http://developer.android.com/guide/practices/screens_support.html
    &lt;/tr&gt;

&lt;/tbody&gt;&lt;/table&gt;


&lt;p&gt;The table above shows the different screen sizes with the supported pixel density. This is important to know, because this will govern the folder names that will contain elements for each screen type.&lt;/p&gt;

&lt;br /&gt;


&lt;h2&gt;Create the Folders&lt;/h2&gt;

&lt;p&gt;When you create an android project, in the res folder, you will find the drawable and layout folders. The drawable folder holds images, while the layouts folder contains your layout XML files. You can create multiple such folders, with different names, to hold the elements for different screen types.&lt;/p&gt;

&lt;p&gt;For drawable folders, the name should follow this format:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;drawable-(pixel density)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So for mdpi (for example), your folder would be named:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;drawable-mdpi
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You should take note that you can have separate folders for landscape images. For mdpi, the folder for landscape images would be names&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;drawable-land-mdpi
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For layout folders, your folders should follow the following format:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;layout-(screen size)-(pixel density)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Why, you might ask, is pixel density included? If you look at the the table above, you'll notice that under a screen size, you can have multiple pixel densities. For example, under the normal screen size, you can have mdpi and hdpi screens. This becomes a problem, because your layout won't render properly if they use the same layout files. For this example, your layout folder names would be:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;layout-normal-mdpi
layout-normal-hdpi
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This separates your layout files, allowing you to provide the correct layout files for each screen type.&lt;/p&gt;

&lt;p&gt;You should also take note that you can still provide a different set for landscape mode. It would be in this format:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;layout-normal-land-mdpi
layout-normal-land-hdpi
&lt;/code&gt;&lt;/pre&gt;

&lt;br&gt;


&lt;h2&gt;Create the Images and Layout Files&lt;/h2&gt;

&lt;p&gt;Now that you have the folders, you need to provide the images and layout files. The first thing you need is your images. You need to resize your existing images to match the pixel density and screen sizes you need. You need to do this, because mdpi images won't look sharp on a hdpi screen. Once you have all the images, put them in the appropriate folders.&lt;/p&gt;

&lt;p&gt;The next thing you need to do is copy all your layout files into each of the different layout folders. Once there, you should fire up the emulator, and start adjusting the layout to display properly. Most of the time, there are minimal tweaks, but depending on your layout, it may be a lot of work.&lt;/p&gt;

&lt;br /&gt;


&lt;h2&gt;All done!&lt;/h2&gt;

&lt;p&gt;Once you have tweaked all your layout files, your app should be ready to scale to any screen size. It's a lot of work, necessary for your app to display properly.&lt;/p&gt;</content>
  </entry>
</feed>
