Skip to content

Instantly share code, notes, and snippets.

Rehearsal ------------------------------------------------------------
DataMapper create 1.750000 0.990000 2.740000 ( 2.938983)
DataMapper single-thread 0.940000 0.050000 0.990000 ( 1.032815)
DataMapper threaded 1.070000 0.050000 1.120000 ( 1.172269)
--------------------------------------------------- total: 4.850000sec
user system total real
DataMapper create 2.660000 1.160000 3.820000 ( 4.045616)
DataMapper single-thread 2.020000 0.060000 2.080000 ( 2.144937)
# Profiling result of inserting 10000 objects into MySQL, SQLITE, Tokyo Cabinet, and Tokyo Cabinet adapter disabling connection to TC iteself.
# Each object is consist of 5 attributes.
# For MySQL and SQLITE, index is set on each attribute.
# For Tokyo Cabinet, Datafile for each attribute is created with reverse ID lookup to a datafile which has id&marshalled object as key&value pair.
# TC disabled
Thread ID: 218880
Total: 67.673687
ActiveRecord::StatementInvalid in SourcesController#refresh
SQLite3::SQLException: PRIMARY KEY must be unique: update object_values set update_type='query',id=pending_id where (update_type='pending' or update_type is null) and source_id=11
RAILS_ROOT: /Users/makoto/work/personal/rhomobile/rhosync
Application Trace | Framework Trace | Full Trace
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in `log'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/sqlite_adapter.rb:132:in `execute'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/sqlite_adapter.rb:372:in `catch_schema_changes'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/sqlite_adapter.rb:132:in `execute'
require 'json'
class GeoTimeline < SourceAdapter
include RestAPIHelpers
def initialize(source, credential = nil)
super(source)
end
"url"
"/search.json?geocode=37.331689%2C-122.030731%2C25km"
"data class Array"
[#<ObjectValue id: nil, source_id: 13, attrib: "data_length", object: "37.331689,-122.030731", value: "15", update_type: nil, created_at: nil, updated_at: nil, pending_id: nil, user_id: nil>, #<ObjectValue id: nil, source_id: 13, attrib: "data", object: "37.331689,-122.030731", value: [{"text"=>"@eifion excellent service to the rails community! Thank you!", "from_user"=>"gluecode", "to_user"=>"eifion", "to_user_id"=>1717944, "id"=>1251426381, "iso_language_code"=>"en", "from_user_id"=>1058368, "source"=>"&lt;a href=&quot;http://www.atebits.com/software/tweetie/&quot;&gt;Tweetie&lt;/a&gt;", "created_at"=>"Wed, 25 Feb 2009 23:35:51 +0000", "profile_image_url"=>"http://s3.amazonaws.com/twitter_production/profile_images/82311413/avatar_normal.jpg", "location"=>"San Jose, CA (37.405417,-121.9"}, {"text"=>"@clarakim awesomest smell in my entire life..in my garage behind where we make our clothes smell good. :(", "from_user"=>"jacdo",
Parsing new request (context 0x4F21F10 (32 - 0x4f22310))
Headers len = 586
Request method GET = 0
URI = [/Twitter/GeoTimeLine]
parsing headers (len 551): [X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko)
Referer: http://localhost:8080/Twitter/index_erb.iseq
Accept: */*
Parsing new request (context 0x47CD330 (32 - 0x47cd730))
Headers len = 419
Request method GET = 0
URI = [/System/Image/edit]
parsing headers (len 386): [User-Agent: Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko)
Referer: http://localhost:8080/System/Image
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us
Sending data to the view
Parsing new request (context 0x4F0F360 (32 - 0x4f0f760))
Headers len = 586
Request method GET = 0
URI = [/Twitter/GeoTimeLine]
parsing headers (len 551): [X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko)
Referer: http://localhost:8080/Twitter/index_erb.iseq
require 'rho/rhocontroller'
class GeoTimeLineController < Rho::RhoController
#GET /GeoTimeLine
def index
latitude = GeoLocation.latitude.to_s
longitude = GeoLocation.longitude.to_s
range = "25km"
makoto-inoues-macbook:londonandroid makoto$ git pull
remote: Total 0 (delta 0), reused 0 (delta 0)
remote: aborting due to possible repository corruption on the remote side.
error: waitpid (async) failed
fatal: error in sideband demultiplexer
makoto-inoues-macbook:londonandroid makoto$ pwd
/Users/makoto/work/os/londonandroid
makoto-inoues-macbook:londonandroid makoto$ cd ..
makoto-inoues-macbook:os makoto$ rm -rf londonandroid/
makoto-inoues-macbook:os makoto$ git clone git://github.com/charroch/londonandroid.git