By Rupert
Uncategorized
LBS: OpenCellID
Nov 30th

Figure 1. CellIDs for Manila taken from opencellID.org
http://mobiforge.com/developing/story/adding-location-a-non-gps-phone-introducing-opencellid
Interesting to see there was an opensource initiative to map cellIDs. Don’t know if Google made the same process for Google Maps MyLocation but I guess its very similar. Would it be possible to integrate such technology for SMS/USSD Development? Meaning when a mobile request to a back end system, the cellID would be included in the header before being passed to the application. I am fully aware this process is possible, however, I’m wondering if it is possible without installing any application (most likely j2me) on the mobile?
Long Time No Trac
Nov 25th
Its been a while I haven’t setup an svn repository for SCM. Anyhow, here are the steps just in case I forget again and again…
1. Add a new trac setting in /etc/apache2/sites-available/default
2. Copy a template
cp -Rf /var/www/trac/trac-template /var/www/localdumplings
3. Restart Apache2
4. Resync the repository
trac-admin localdumpling resync
Rails Note #9: Getting HTTP Headers
Nov 20th
1. I was trying to get the http headers dump from a mobile phone. So I quickly dump it in a log file to see its contents..
headers['Content-Type'] = 'text/xml; charset=utf-8' for header in request.env.select {|k,v| k.match("^HTTP.*")} logger.info(header[0].split('_',2)[1] + ":" + header[1]) end
Reference:
http://tonycode.com/wiki/index.php?title=Dumping_HTTP_Headers
2. However, please note that you can actually see everything from the request as parameters.
Parameters: {“MSAG-ADDRESS-PREFIX”=>”aSTARTa”, “format”=>”xml”, “protocol”=>”ussd”, “user-agent”=>”Jakarta Commons-HttpClient/3.0.1″, “WHOISD-ABONENT”=>”8613520747210″, “action”=>”menu”, “controller”=>”ussd”, “subscriberID”=>”8613520747210″, “WHOISD-USR”=>”-1″, “host”=>”wap.watago.mobi”, “WHOISD-USSD-MESSAGE”=>”", “content-length”=>”0″}
This means we can easily do..
@whoisd_abonent = params['WHOISD-ABONENT'] || nil
Rails Note #8: Testing with session variables
Nov 18th
Taken from http://guides.rails.info/testing_rails_applications.html
The get method kicks off the web request and populates the results into the response. It accepts 4 arguments:
*The action of the controller you are requesting. This can be in the form of a string or a symbol.
*An optional hash of request parameters to pass into the action (eg. query string parameters or post variables).
*An optional hash of session variables to pass along with the request.
*An optional hash of flash values.
Example: Calling the :show action, passing an id of 12 as the params and setting a user_id of 5 in the session:
get(:show, {'id' => "12"}, {'user_id' => 5})
Rails Note #7: NIL in Fixtures
Nov 18th
If you want user_id to be ‘nil’, then omit it from your fixtures. I tried setting user_id: nil before, and it turned out to be ’0′ in the database.
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html <% u = UserLogin.create( :password => 'foo') %> <% u.password=('password') %> user_no_profile: email: noprofile@yahoo.com admin: false user_id: nil salt: <%= u.salt %> salted_password: <%= u.salted_password %>

# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html <% u = UserLogin.create( :password => 'foo') %> <% u.password=('password') %> user_no_profile: email: noprofile@yahoo.com admin: false salt: <%= u.salt %> salted_password: <%= u.salted_password %>

Before pulling your hair out on what went wrong with your functional tests, check the test database if you have the correct values in your records. Remember ’0′ is different from ‘nil’.
Comments