Sunday, March 21, 2021

Find all lines without "]" at the end

cat bookmarks.txt | awk '/[^\]]$/' | less

Sunday, December 13, 2015

nginx local proxy




I wanted just a simple nginx setup to forward to a local app.  Here's the result:


http {
...

    server {
      server_name  52.62.72.255;
      #access_log   /var/log/nginx/histories.log;
      location / {
        proxy_pass      http://127.0.0.1:3000;
      }
    }



For some reason it was hard to find this info!  I had to pull it from one of my other servers.  But one good example is this reference: http://wiki.nginx.org/FullExample


Wednesday, July 15, 2015

Unable to SSH to new AWS servers, until: route table

Symptoms: I've had an AWS account for years, and I went back and created some instances this past week but then I couldn't access them (via SSH: "Operation timed out"). One oddity was that my old instances had no VPC ID, but every new instance had one (and the VPC was created if none existed).

Solution: I found this troubleshooting guide for connecting, and I followed the step on route tables and added a route with a destination of 0.0.0.0/0 and target of igw... (which is auto-filled with my internet gateway ID).

I've never had to do this before.  Hopefully I'll remember!

Tuesday, May 5, 2015

PermanentRedirect when accessing AWS S3 bucket

When running this on the command-line:
aws s3 ls s3://my-bucket/
I kept getting this error:
A client error (PermanentRedirect) occurred when calling the ListObjects operation: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
The problem was that my region wasn't set. I did this to fix it:
export AWS_DEFAULT_REGION=us-west-2
This is a pretty stupid situation: when using the web console, the S3 service says that there's no need to choose a region, and it won't even let you select one. But obviously it's very important for configurations. Dumb.

Thursday, September 4, 2014

Solutions for Vagrant deployment to AWS


Here are a bunch of notes from troubleshooting Vagrant out to AWS:





An active machine was found with a different provider. Vagrant currently allows each machine to be brought up with only a single provider at a time. A future version will remove this limitation. Until then, please destroy the existing machine to up with a new provider. Machine name: default Active provider: virtualbox Requested provider: aws

 ... yep, destroy it



<br /><span style="font-family: Arial, Helvetica, sans-serif;">Here are a bunch of old notes on errors I got while trying to use Vagrant with AWS.</span><br /> The box you're attempting to add doesn't support the provider you requested. Please find an alternate box or use an alternate provider. Double-check your requested provider to verify you didn't simply misspell it. Name: hashicorp/precise64 Address: https://vagrantcloud.com/hashicorp/precise64 Requested provider: [:aws] ... change to the dummy box There was an error talking to AWS. The error message is shown below: UnauthorizedOperation =&gt; You are not authorized to perform this operation. ... IAM... had to make user with that key ID have power access




==&gt; default: Warning! Vagrant might not be able to SSH into the instance. ==&gt; default: Please check your security groups settings. /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/middlewares/expects.rb:6:in `response_call': The image id '[ami-21e6e964]' does not exist (Fog::Compute::AWS::NotFound) from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/middlewares/response_parser.rb:8:in `response_call' from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/connection.rb:363:in `response' from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/connection.rb:233:in `request' from /Users/tlarson/.vagrant.d/gems/gems/fog-1.23.0/lib/fog/xml/sax_parser_connection.rb:35:in `request' ... had to find an AMI, in the right zone ==&gt; default: Warning! Vagrant might not be able to SSH into the instance. ==&gt; default: Please check your security groups settings. /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/middlewares/expects.rb:6:in `response_call': The key pair 'halfpricedgranite-workbook' does not exist (Fog::Compute::AWS::NotFound) from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/middlewares/response_parser.rb:8:in `response_call' from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/connection.rb:363:in `response' from /Users/tlarson/.vagrant.d/gems/gems/excon-0.39.5/lib/excon/connection.rb:233:in `request' from /Users/tlarson/.vagrant.d/gems/gems/fog-1.23.0/lib/fog/xml/sax_parser_connection.rb:35:in `request' ... again, in the right zone ==&gt; default: Waiting for instance to become "ready"... ==&gt; default: Waiting for SSH to become available... ^C ... because networking is restricted: security_groups ... and may want to name it


Saturday, August 16, 2014

Adding tables to Etherpad Lite



So I love the real-time sharing of Google Docs, so I installed our own Etherpad Lite... and then I wanted tables so I installed ep_tables, but it was a bear to try and copy existing tables into there, so I finally exported some tables and found the format and here's what I recommend, in this example of 2 lines:

{"payload":[["This is a sample row on table 1"," "," "]],"tblId":"1","tblClass":"data-tables"}

{"payload":[[" "," "," row 2 column 3"]],"tblId":"1","tblClass":"data-tables"}


... where each row of data is a line of text.  Just paste them in the document and it reformats into a table.
It turns out the plugin doesn't like line breaks (or tabs) in a row, so don't even try... and that's one reason I wouldn't try and put multiple rows inside one payload line like this:
{"payload":[["This is a sample row on table 1","",""],["",""," row 2 column 3"]],"tblId":"1","tblClass":"data-tables"}

Since you can't split each row onto a new line it is pretty unreadable.
Other hints:

  • Only use the 'Table' button at the top to manipulate the table and not the little mouse-overs... they just never did anything reliable for me.
  • I also installed styles and formatting, but I couldn't get them to apply inside the table.
  • I don't see the purpose of the tblId; I put rows with the same tblId in different places and they showed at their location in the document, with line breaks or whatever in between.


Monday, July 7, 2014

The day-of-week for any day this year (and this century)


I came up with this approach to figure out the day-of-week for any day during the current year:

  • Each year, remember the weekday of first day of the year, eg. Wed in 2014  (See below for a formula for this in the 21st century.)
  • Memorize this set of numbers, one for each month: 155274263153 ... which is the date of the first time that day occurs each month

You can probably get it from there... so here's an example: what day is Dec 25 this year?
  • December is month #12, so take the last digit in that set of numbers: 3
  • That means the 3rd is the first time that Wed occurs this December.
  • Add multiples of 7 to get to other Wed that are close: 
    • +7=10
    • +14=17
    • +21 = 24
  • Since Dec 24 is on Wed, Dec 25 must be on Thurs
  • The exception is leap years, and I typically subtract one from the first day in January and February.
This makes it pretty easy, because that first weekday only changes each year and I can remember that day for the whole year.

Now, for the majority of my lifetime (if things don't go as I hope), it's actually pretty easy to find the first day of the year for any year:
  • Take the year without the 2000 part, eg. 14 for 2014
  • Calculate (y + y div 4) mod 7
    • or (y mod 7 + y div 4) mod 7
    • or (y mod 7 + (y div 4) mod 7) mod 7
  • 0=Sun, 1=Mon, etc.
    • except for on leap years (divisible by 4) subtract 1 day for Jan-Feb
Pretty easy to remember for us mathematicians... it starts with Sunday, and then moves one day each year with an extra adjustment on leap years.

The rules get really complicated for previous or future centuries because we don't have leap-years every 100 years but then we do have them every 400 years.  But, like I say, this works for my foreseeable future, in 99.9% of the times I ever need to find a day.

I haven't written this up before because I checked years ago and found people had already written about this algorithm, but I think it's worth mentioning now because it's so easy for the vast majority of cases people use for a while to come.  BTW, if I want a comprehensive algorithm, I'll probably try Conway's Doomsday Algorithm.


Saturday, June 28, 2014

Get on RespectNetwork and get your XRI name.

Just a little motivation for getting involved with RespectNetwork and grabbing one of their "cloud names" (ie. an XRI) at their great one-time price of $25:

For a while there, I was playing with the APIs for "unhosted" and P2P apps quite a bit, just doing things that seemed fun personally.  I played with Kynetx (founded by my BYU professor Phil Windley) and Singly (founded by Jeremie Miller of XMPP fame), both of which are still very worthwhile projects with huge potential (and you can see from my labels that I've posted about them before).  Other related projects are redecentralize.org and projectdanube.com and cozy.io.  Anyway, the Respect Network in particular is a brainchild of Drummond Reed and it's had a few changes of directions, starting with connect.me, though I look on that activity feed and I don't see much happening there; Drummond Reed and Doc Searls and Kaliya Hamlin and Phil Windley (remember?) are big people in the identity space, eg. the internetidentityworkshop.com conferences, and so I still expect to see big things out of this set of initiatives for owning our own data.  Anyway, my hope is to push for these kinds of tools and protocols to help fight the silos and lock-in of Facebook and even Google... on top of the basic infrastructure tools (eg. pack.resetthenet.org).

Saying all that, I realize that it's not very widespread at this point.  I think they're laying out the protocols and doing cool stuff, but it's still at the experimentation point, I'd say.  But some of the concepts are sticking, eg. these XRI names... I got my first one a few years ago... so I think they're worth getting now.

Sunday, June 8, 2014

Building Bitcoin & Litecoin, Mac & Linux


I'm trying to build my own altcoins (because I want to understand altcoin creation).

First of all, Litecoin is the best place to begin because most altcoin tutorials (eg. here and here and here) use it as the basis.  So I started just by downloading Litecoin source and building it.

On Mac:
  • I started with Homebrew but couldn't ever get past problems with boost:

Undefined symbols for architecture x86_64: "boost::program_options::to_internal(std::string const&amp;)", referenced from: boost::program_options::detail::basic_config_file_iterator<char>::getline(std::string&amp;) in util.o "boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set<std::string std::less="" std::string="">, std::allocator<std::string> &gt; const&amp;, bool)", referenced from: boost::program_options::detail::basic_config_file_iterator<char>::basic_config_file_iterator(std::istream&amp;, std::set<std::string std::less="" std::string="">, std::allocator<std::string> &gt; const&amp;, bool) in util.o "Db::verify(char const*, char const*, std::ostream*, unsigned int)", referenced from: CDBEnv::Verify(std::string, bool (*)(CDBEnv&amp;, std::string)) in db.o CDBEnv::Salvage(std::string, bool, std::vector<std::pair char="" std::allocator="" std::vector="" unsigned=""> &gt;, std::vector<unsigned char="" std::allocator="" unsigned=""> &gt; &gt;, std::allocator<std::pair char="" std::allocator="" std::vector="" unsigned=""> &gt;, std::vector<unsigned char="" std::allocator="" unsigned=""> &gt; &gt; &gt; &gt;&amp;) in db.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [litecoind] Error 1</unsigned></std::pair></unsigned></std::pair></std::string></std::string></char></std::string></std::string></char>
  • I tried with Bitcoin with Homebrew and finally got it to build, though "make check" failed.
  • I totally switched to MacPorts and got Bitcoin to build again (including "make check").
  • OK, but I want Litecoin... and again I get problems with boost:

llvm-g++ -c -stdlib=libstdc++ -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_UPNP=1 -DUSE_IPV6=1 -I/Users/tlarson/dev/from-elsewhere/litecoin/src/leveldb/include -I/Users/tlarson/dev/from-elsewhere/litecoin/src/leveldb/helpers -DHAVE_BUILD_INFO -I"/Users/tlarson/dev/from-elsewhere/litecoin/src" -I"/Users/tlarson/dev/from-elsewhere/litecoin/src/obj" -I"/usr/local/include" -I"/usr/local/opt/berkeley-db4/include" -I"/usr/local/opt/openssl/include" -MMD -MF obj/alert.d -o obj/alert.o alert.cpp alert.cpp:6:10: fatal error: 'boost/algorithm/string/classification.hpp' file not found #include <boost algorithm="" classification.hpp="" string=""> ^ 1 error generated. make: *** [obj/alert.o] Error 1 </boost>


On Linux (Ubuntu):

  • Worked, though I had to include all optional items, and also build Berkely DB as instructed in the Bitcoin source and use it here (by setting BDB_INCLUDE_PATH and BDB_LIB_PATH).


I haven't tried Windows yet, since that seems even scarier!


Friday, March 14, 2014

SLC Tech Breakfast on Mar 21


SLC Tech Breakfast on Fri Mar 21 8:00-9:30 AM downtown at Newmont U. Bagels provided.


coursera at princeton (Josh recommends)
dynamic programming (same as memoization, sounds like)
spring roo (rails-like quick start for Java, if I remember right)
linq (for allowing SQL-like data queries in language)jlinq, jpropel
"clock of complexity"
malbolge: unreadable programming language

Friday, February 7, 2014

Today's CTO Breakfast



  • Trent Larson mentioned tool for P2P sharing family histories (familyhistories.info)
  • Sano Inteiligence for a subdermal patch for monitoring the blood stream
  • True Crypt (vs Best Crypt), with hidden volumes
  • BTSync for P2P file distribution
  • "Scrypt" coin using GPUs vs Bitcoin (w/ SHA256)
  • Vivian at Gild & Provo Dojo last night about underappreciated Utah developers
  • SaltStack, which Wade prefers over Puppet
  • Intel Galileo, running Arduino but also Linux, $60 with power on Amazon, including Wifi connector
  • playing music on a dodecahedron, drawn on a ping-pong ball with an egg-bot, then icosahedron, and then she talked about a theramin
  • Espruino, an Arduino-like board using Javascript
  • NodeRed from Google for graphical design of a node program
  • Google's purchase of Nest
  • Scott mentioned using NFC to configure devices, and Kelly Flanagan is doing it
  • power requirements & parasitic power

Thursday, January 16, 2014

Tomorrow's tech breakfast



Tomorrow morning, 8 AM, downtown: above Jason's Deli at the Gateway.

From Garth: There is a parking lot in front of Jason's Deli (you just have to make sure that the parking space says for gateway office) and the doors to the office are to the right of the entrance to Jason's Deli. My office is in suite 230.

Bagels

Here's other background info.

Friday, December 13, 2013

Yet Another SLC Tech Breakfast



Anyone using functional programming?  (Josh has done Scala)

Josh Bloch (Effective Java) & anonymous types vs Neil Gafter & closures

Tom Clancy's game The Division has an impressive new game engine

TED talk: consequences of game on real life

languages: Dart, Go, Underscore.js

Speed dating with google glass


Saturday, May 4, 2013

A command-line testing harness for multiple RESTful HTTP requests


Tasked with the creation of a quick-and-dirty REST service, I wanted an easy way to throw in a bunch of test data and verify it with the correct response data and HTTP response codes.  Most testing tools require some infrastructure and editing through their UI; I wanted to throw data (both input and output) into an easy-to-edit text file.  Here's the result.

First, here's the input test data:
POST /entry/ffff/3456
POST /entry/
POST /entry/12
POST /entry/12/qqqq
GET /entry/ffff
GET /entry/fffe
GET /entry/
POST /entry/zz/zyx
POST /entry/az/zyx
POST /entry/34/zyx
POST /entry/AF/zyx
POST /entry/zez/zyx
GET /list/0
GET /list/1
(I put this in the file named "test-input")

Sidebar 1: eyeballing the results

This was actually given to me as the full telnet command, so every entry had "HTTP/1.1" on the end, for example:
POST /entry/ffff/3456 HTTP/1.1
So first iteration was to start my server separately, then run a script that would echo that line and pipe it through "telnet 127.0.0.1 8080".  For example, here are the first 2 tests, located inside my "entries.in" file:


sleep 2
echo POST /entry/ffff/3456 HTTP/1.1      # should return a 200 OK response
echo
sleep 2
echo POST /entry/ HTTP/1.1       # should return 400 BAD REQUEST
echo 
(Interestingly, those comments at the end of each line are acceptable.)


Then I ran the following command:

.  ./entries.in | telnet 127.0.0.1 8080

(Note the "." at the first of the line, meaning to source that file to run the commands inside.)

That works great for me to run all the tests quickly, but I have to visually check the output.

End Sidebar 1

Here is the output expected; of course, only the GET commands result in output.


3456               # GET /entry/ffff
ffff -> 3456    # GET /entry/
ffff -> 3456    # following 4 are generated by GET /entry/
12 -> qqqq
zz -> zyx
az -> zyx
34 -> zyx       # following 3 are generated by GET /list/1
AF -> zyx
zez -> zyx
(That is in the file I named "test-output.body.good", without the # commentary.)


And here are the HTTP response codes expected:

HTTP/1.1 200 OK
HTTP/1.1 400 BAD REQUEST
HTTP/1.1 400 BAD REQUEST
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 404 NOT FOUND
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
(That is in the file I named "test-output.HTTP-response.good")


Now for the scripting.  Note that this requires Resty, a very convenient wrapper to access RESTful services via curl.

Here are the commands to run those HTTP inputs into my server and check the body of the output.
# run the HTTP server in the background, throwing away any output
python entries.py > /dev/null 2>&1 &
# save the process ID for that server
PID=$!
# wait for the server to fully start
sleep 1
# prepare resty, without verbose output from curl
resty http://127.0.0.1:8080 -s
# use the contents of the test-input file as one command per line
# (via Resty, which has made GET and POST into valid commands)
. ./test-input > test-output.body.out
# check that output against the expected output
diff test-output.body.good test-output.body.out
# stop the HTTP server
kill $PID
# wait for the server to fully stop
sleep 1


And here is how to do the same to check the HTTP response codes of the output.  Note that only the 3 commands after "sleep" are different.

# run the HTTP server in the background, throwing away any output
python entries.py > /dev/null 2>&1 &
# save the process ID for that server
PID=$!
# wait for the server to fully start
sleep 1
# prepare resty, without verbose output and with only the HTTP headers from curl
resty http://127.0.0.1:8080 -s -I
# use the contents of the test-input file as one command per line
# (via Resty, which has made GET and POST into valid commands)
# (Why does it end up in DOS format? Is that curl?!  ... and printing "not found" is dumb.)
. ./test2-input 2>&1 | grep HTTP > test2-output.HTTP-response.out
# check that output against the expected output
# (See the previous command for the reason behind --strip-trailing-cr)
diff --strip-trailing-cr test2-output.HTTP-response.good test2-output.HTTP-response.out 
# stop the HTTP server
kill $PID
# wait for the server to fully stop
sleep 1



That's it!  Now I've got those 3 files (input HTTP commands, output body content, and output HTTP codes) and a script that will run all those inputs and verify the outputs exactly.

Note: as this grows, I've found that I'd prefer to have the input, the output HTTP code, and the output body all next to each other, or maybe on subsequent lines of the same file.  But this fit today's use cases!





Sunday, April 1, 2012

Setting and retrieving LockerProject data in a local install


I've been trying to play with LockerProject from Singly, and I'd like to use data other than the built-in types of contacts, links, photos, and places.  (You can see one project that motivates me at familyhistories.info.)  There are ways to build new connectors and collections that support rich functionality like syncing, but there is also a simple Push API that allows for arbitrary data, so I've started by playing with that.  Following are some changes I had to make to get things working.

We can send and retrieve arbitrary data via curl, and those examples work great.

Set:
curl -H "Content-Type: application/json" \  
--data-binary '{"data":[{"id":42,"question":"my test"}]}' \  
http://localhost:8042/push/foo 
 
ok

Get:
curl http://localhost:8042/push/foo/42
 
{"_id":"4f2752c03f670f3343f7fed0","id":42,"question":"my test"}

Unfortunately, things don't work as smoothly when trying to do it in an app.  Let's start with retrieval.  First of all, we need get data from the local locker instead of the one at singly.com.  The best approach I can think is to tweak the APIClient so that we can specify which host, so instead of "new APIClient()" we can do the following:
new APIClient({baseUrl:'http://localhost:8042'})
Great.

Except now my browser won't retrieve the value via AJAX; Chrome is the most helpful, and it tells me:
Origin null is not allowed by Access-Control-Allow-Origin.
The only way I can figure to get past this is to modify LockerProject.  So I've added the following to the Ops/webservice.js file as the first line in the first function argument to express.createServer:

// "*" works for all domains; null and "X-Requested-With" work for file:// URLs in Firefox but not Chrome
res.header("Access-Control-Allow-Origin", "*");
Cool.  Now I can retrieve values that I've inserted.  This might not be a great solution, and I haven't thought through the security complications so that I can submit it to LockerProject, but I'm just going to live with it on my machine.

Unfortunately, this is where we're stuck.  It's easy enough to add a post to insert data, but there is a problem within the parsing of JSON in the locker server: it takes any values as strings, so even though we send an update/insert like the data above with a numeric ID of 42, it ends up inserting some data with a string ID of "42"... and we can't retrieve that value with the typical GET request (above)... in fact, I cannot find any way to retrieve that data through the API.  You can see it as it gets processed in the web server and you can see it inside your mongo DB.  Most unfortunate.

In summary, to get arbitrary data from your local locker in a browser app:
  • patch the locker server (see Access-Control-Allow-Origin above)
  • use the client customizations (demonstrated here in the singly-api-local.js and the test-new-datatype.html files)
To set arbitrary data in your local locker in a browser app... you're out of luck due to the string problem.

Maybe there's a better way...?


Getting results with Singly's "Build An App!"


The Singly (AKA LockerProject) approach to building an app is pretty simple, but the current instructions didn't work for me locally.  (You can see the instructions after logging in to singly.com and then going to the "Build An App!" page.)  The difficulty may be that I used my index.html incorrectly, but it was the best I could guess: I simply accessed it directly with a "file:///..." URL.  (If anyone knows a better place, I'd love to know; I tried putting it in a separate webserver I've got locally, to no avail.)  I can get this to work, but it requires some tweaking.

The symptom in Firefox was a blank page, and in the Javascript console there was an error: "Operation is not supported" on a line with sessionStorage.  I found that sessionStorage won't work for local ("file") URLs (thanks to this StackOverflow post).

So I changed the references in the api.js to localStorage and things worked for me.  Here is my version: https://github.com/trentlarson/singly-relaxing/blob/5e9cf2c1801b78c130cdc79e84a4cdbf2b3b2deb/singly-api-local.js

It uses a conditional, so I'm hoping it can be used at singly.com as a patch to the default version.

Wednesday, March 28, 2012

Make:SLC



In the East half of Make:SLC is the home of the Computer Graphics Museum. (I believe it was Richard Thomson I met.)  He highly recommended seeing the Exploratorium in San Francisco.


Scott Lemon came to show off his enclosing for Arduino and other electronics.  Other things he mentioned: Patchbase, Thingspeak, X10 for home automation

Friday, January 6, 2012

Details from Cory Doctorow's CCC talk


I watched Cory Doctorow's talk "The Coming War on General Computation," and I recommend it if you want any specific details, arguing points, and even a good reminder of very bad recent policies when it comes to protecting ourselves from corporate (and government) invasion into our privacy and security.
Video  Transcript

The low-level software he mentions for possible abuse by Big Brother is UEFI (Unified Extensible Firmware Interface).

Here are the organizations he mentions near the end (at 29:15) (except the "org" which I cannot find):




BTW, I highly recommend his book "Little Brother".

Wednesday, December 7, 2011

Tips to Avoid Titanium Desktop Errors and Crashes

My P2P-Docs project is a desktop app currently written in Titanium where I can code the UI in HTML and JavaScript and the business logic in Ruby.  Unfortunately, it's very prone to errors and crashes when things get complicated; fortunately, the problems I've seen have been in the interface between JavaScript and Ruby, and I feel like I can keep progressing with this platform if I follow these conventions.
  • Only pass strings between JavaScript and Ruby, encoding in JSON strings if necessary.
    • In JavaScript, call Ruby methods with String arguments.  JavaScript ints become Ruby Floats, so just use Strings to avoid potential confusion; JSON arguments will probably work and become hashes, but then you'll have to beware of the types of all the nested objects... if I need multiple values then I either supply them as more arguments or I call the Ruby method multiple times.
    • In Ruby, check arguments for RubyKObject type.  Sometimes arguments don't have the expected String type, so you'll want to convert them:

      if (term.class.name == "RubyKObject")
        term = term.toString()
      end

    • In Ruby, return String objects; if necessary, encode in JSON.  Here's a simplistic method that works for me:

      # takes an argument which is any nesting of String, Array, Hash (and nil)
      # return a String holding JSON representation of the argument
      def self.strings_arrays_hashes_json(arg)
        if (arg == nil)
          "null"
        elsif (arg.class.name == "String")
          result = arg
          result = result.gsub("\"","\\\"")
          result = result.gsub("\\","\\\\")
          result = result.gsub("\/","\\/")
          result = result.gsub("\b","\\b")
          result = result.gsub("\f","\\f")
          result = result.gsub("\n","\\n")
          result = result.gsub("\r","\\r")
          result = result.gsub("\t","\\t")
          "\"" + result + "\""
        elsif (arg.class.name == "Array")
          recurse = arg.map { |elem| strings_arrays_hashes_json elem }
          "[" + recurse.join(", ") + "]"
        elsif (arg.class.name == "Hash")
          hashes = arg.to_a.map { |key, val|
            "\"#{key}\":#{strings_arrays_hashes_json(val)}" }
          "{" + hashes.join(", ") + "}"
        else
          "#{arg}"
        end
      end
      

  • In JavaScript, call any Ruby methods before playing with the DOM.  I've found that, if I have a lot of DOM manipulation, Ruby calls will work up to some point and then WHAM! after that point you get errors or crashes.

BTW, the direct-to-console debugging is your friend; the Ruby puts calls may not get flushed immediately, but this will:
Titanium.API.print("stuff\n");

When you start working this way, you'll notice that you're really pushed into a paradigm where you do simple visual manipulations in the browser as much as possible, but for any substantive changes to data you do a page-submit to pass the values to the same page, then you run your logic during the page initialization and then you rerender the whole page.  It's unfortunate, but now I never have troubles.  (... at least very few!  Just kidding.  I haven't had any mysterious Ruby errors or app crashes wherever I take these approaches.)

BTW, every time I hit a glitch, I look more closely at other approaches... but since I figure every tool will have its issues, I'm still sticking with the devil I know.  Feel free to ask me later if I'm still sticking to it.

Saturday, November 19, 2011

debugging a Titanium problem


This is my response to Alan's comment here.

What I'm seeing is that my app will completely stop.  Here is a video that shows how it stops.

I'll bet it's tough to get error info from the third-party languages; I'm sure that's where the problem lies, because I put console debug output around lines like this one and I see that it gets up to the Ruby method but no further.  (I realize this example is a method... if it would help, I'll try to retrieve a problem involving a variable reference.)  Even if I wrap it in a try-catch, the app stops, so it never gets to the catch, and I don't get any other info.

You can duplicate this problem in my app; look on that page for the "Test many repos in app" to see duplication steps.  (Note that that is a specific point in time in November; I've worked around the problem, but it's definitely not ideal and the problem still stands.)

Below is a stack from OSX.

It could be interesting to help enhance the interface and error reporting in the Kroll system (I assume that's the third-party language interface); if you have any suggestions for getting started, or for other ways that I can help you, I'm all ears.

Thanks.

____________________________________________
Family History P2P Docs appears to have encountered a fatal error and cannot continue.

The application has collected information about the error in the form
of a detailed error report. If you send the crash report, we will
attempt to resolve this problem.



 
... then I click on the "Send Report" button to see the following:

____________________________________________
Problem Report for Family History P2P Docs

This report will be sent to Apple automatically.

Problem Details and System Configuration

Process:         Family History P2P Docs [71611]
Path:            /Users/tlarson/Documents/dev/p2pdocs/p2pdocs/Family History P2P Docs/dist/osx/Family History P2P Docs.app/Contents/MacOS/Family History P2P Docs
Identifier:      info.familyhistories.p2pdocs
Version:         ??? (7.0)
Code Type:       X86 (Native)
Parent Process:  ??? [1]

Date/Time:       2011-11-18 20:50:29.623 -0700
OS Version:      Mac OS X 10.6.8 (10K549)
Report Version:  6

Interval Since Last Report:          451670 sec
Crashes Since Last Report:           32
Per-App Interval Since Last Report:  31828 sec
Per-App Crashes Since Last Report:   2
Anonymous UUID:                      8EC49F5A-C2D0-4019-9318-8634B3D2552C

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000081be0f79
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Application Specific Information:
objc_msgSend() selector name: localizedDescription


Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                   0x97806f87 objc_msgSend + 23
1   info.familyhistories.p2pdocs      0x000221b5 main + 549
2   info.familyhistories.p2pdocs      0x000032ea start + 54

Thread 1:  Dispatch queue: com.apple.libdispatch-manager
0   libSystem.B.dylib                 0x96675382 kevent + 10
1   libSystem.B.dylib                 0x96675a9c _dispatch_mgr_invoke + 215
2   libSystem.B.dylib                 0x96674f59 _dispatch_queue_invoke + 163
3   libSystem.B.dylib                 0x96674cfe _dispatch_worker_thread2 + 240
4   libSystem.B.dylib                 0x96674781 _pthread_wqthread + 390
5   libSystem.B.dylib                 0x966745c6 start_wqthread + 30

Thread 2:
0   libSystem.B.dylib                 0x96674412 __workq_kernreturn + 10
1   libSystem.B.dylib                 0x966749a8 _pthread_wqthread + 941
2   libSystem.B.dylib                 0x966745c6 start_wqthread + 30

Thread 3:
0   libSystem.B.dylib                 0x96674412 __workq_kernreturn + 10
1   libSystem.B.dylib                 0x966749a8 _pthread_wqthread + 941
2   libSystem.B.dylib                 0x966745c6 start_wqthread + 30

Thread 4:
0   libSystem.B.dylib                 0x96674412 __workq_kernreturn + 10
1   libSystem.B.dylib                 0x966749a8 _pthread_wqthread + 941
2   libSystem.B.dylib                 0x966745c6 start_wqthread + 30

Thread 5:
0   libSystem.B.dylib                 0x9667caa2 __semwait_signal + 10
1   libSystem.B.dylib                 0x966a89c5 nanosleep$UNIX2003 + 188
2   libSystem.B.dylib                 0x966a8903 usleep$UNIX2003 + 61
3   com.apple.AppKit                  0x9910ae2d -[NSUIHeartBeat _heartBeatThread:] + 2039
4   com.apple.Foundation              0x9404a4c4 -[NSThread main] + 45
5   com.apple.Foundation              0x9404a474 __NSThread__main__ + 1499
6   libSystem.B.dylib                 0x9667c259 _pthread_start + 345
7   libSystem.B.dylib                 0x9667c0de thread_start + 34

Thread 6:
0   libSystem.B.dylib                 0x9664eafa mach_msg_trap + 10
1   libSystem.B.dylib                 0x9664f267 mach_msg + 68
2   com.apple.CoreFoundation          0x952612df __CFRunLoopRun + 2079
3   com.apple.CoreFoundation          0x952603c4 CFRunLoopRunSpecific + 452
4   com.apple.CoreFoundation          0x952601f1 CFRunLoopRunInMode + 97
5   com.apple.Foundation              0x94083224 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] + 329
6   com.apple.Foundation              0x9404a4c4 -[NSThread main] + 45
7   com.apple.Foundation              0x9404a474 __NSThread__main__ + 1499
8   libSystem.B.dylib                 0x9667c259 _pthread_start + 345
9   libSystem.B.dylib                 0x9667c0de thread_start + 34

Thread 7:  com.apple.CFSocket.private
0   libSystem.B.dylib                 0x9666dac6 select$DARWIN_EXTSN + 10
1   com.apple.CoreFoundation          0x952a0c53 __CFSocketManager + 1091
2   libSystem.B.dylib                 0x9667c259 _pthread_start + 345
3   libSystem.B.dylib                 0x9667c0de thread_start + 34

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x9780c7e2  ebx: 0x0001f0de  ecx: 0x9977f99e  edx: 0x81be0f59
  edi: 0xbfffec80  esi: 0x00223690  ebp: 0xbfffecb8  esp: 0xbfffec28
   ss: 0x0000001f  efl: 0x00010286  eip: 0x97806f87   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037
  cr2: 0x81be0f79

Binary Images:
    0x1000 -    0x96ff7 +info.familyhistories.p2pdocs ??? (7.0) <4672C033-55EC-71AC-C49D-7CE6190630DC> /Users/tlarson/Documents/dev/p2pdocs/p2pdocs/Family History P2P Docs/dist/osx/Family History P2P Docs.app/Contents/MacOS/Family History P2P Docs
   0xb6000 -   0x16bfe7  libcrypto.0.9.7.dylib 0.9.7 (compatibility 0.9.7) /usr/lib/libcrypto.0.9.7.dylib
  0x7fb000 -   0x7fcff5 +com.vmware.FusionVMDKPlugIn ??? (416484) /Library/Contextual Menu Items/FusionVMDKPlugIn.plugin/Contents/MacOS/FusionVMDKPlugIn
0x8fe00000 - 0x8fe4162b  dyld 132.1 (???) <1C06ECD9-A2D7-BB10-AF50-0F2B598A7DEC> /usr/lib/dyld
0x90003000 - 0x90045ff7  libvDSP.dylib 268.0.1 (compatibility 1.0.0) <8A4721DE-25C4-C8AA-EA90-9DA7812E3EBA> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x900a5000 - 0x900a8fe7  libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) <1622A54F-1A98-2CBE-B6A4-2122981A500E> /usr/lib/system/libmathCommon.A.dylib
0x900a9000 - 0x901e6fe7  com.apple.audio.toolbox.AudioToolbox 1.6.7 (1.6.7) <2D31CC6F-32CC-72FF-34EC-AB40CEE496A7> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
0x901e7000 - 0x902a0fe7  libsqlite3.dylib 9.6.0 (compatibility 9.0.0) <52438E77-55D1-C231-1936-76F1369518E4> /usr/lib/libsqlite3.dylib
0x903cf000 - 0x9040cff7  com.apple.SystemConfiguration 1.10.8 (1.10.2) <50E4D49B-4F61-446F-1C21-1B2BA814713D> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x905af000 - 0x905d5ffb  com.apple.DictionaryServices 1.1.2 (1.1.2) <43E1D565-6E01-3681-F2E5-72AE4C3A097A> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
0x905e4000 - 0x90648ffb  com.apple.htmlrendering 72 (1.1.4) <4D451A35-FAB6-1288-71F6-F24A4B6E2371> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering
0x90649000 - 0x9064eff7  com.apple.OpenDirectory 10.6 (10.6) <0603680A-A002-D294-DE83-0D028C6BE884> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
0x9082e000 - 0x90838ffb  com.apple.speech.recognition.framework 3.11.1 (3.11.1) <7486003F-8FDB-BD6C-CB34-DE45315BD82C> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x90839000 - 0x90843fe7  com.apple.audio.SoundManager 3.9.3 (3.9.3) <5F494955-7290-2D91-DA94-44B590191771> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
0x90844000 - 0x90851ff7  com.apple.NetFS 3.2.2 (3.2.2) /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
0x90982000 - 0x90a4dfef  com.apple.CoreServices.OSServices 359.2 (359.2) <7C16D9C8-6F41-5754-17F7-2659D9DD9579> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x90be4000 - 0x90e49feb  com.apple.security 6.1.2 (55002) <7F00A51B-F22A-0EBC-A321-923472D686BD> /System/Library/Frameworks/Security.framework/Versions/A/Security
0x90ed1000 - 0x90f6efe3  com.apple.LaunchServices 362.3 (362.3) <15B47388-16C8-97DA-EEBB-1709E136169E> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x911b0000 - 0x911c8ff7  com.apple.CFOpenDirectory 10.6 (10.6) /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
0x911c9000 - 0x911eafe7  com.apple.opencl 12.3.6 (12.3.6) /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL
0x9122c000 - 0x9167dfef  com.apple.RawCamera.bundle 3.7.1 (570) /System/Library/CoreServices/RawCamera.bundle/Contents/MacOS/RawCamera
0x91686000 - 0x916d9ff7  com.apple.HIServices 1.8.3 (???) <1D3C4587-6318-C339-BD0F-1988F246BE2E> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x9179a000 - 0x917dbff7  libRIP.A.dylib 545.0.0 (compatibility 64.0.0) <80998F66-0AD7-AD12-B9AF-3E8D2CE6DE05> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib
0x917dc000 - 0x91839ff7  com.apple.framework.IOKit 2.0 (???) <3DABAB9C-4949-F441-B077-0498F8E47A35> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x9183a000 - 0x918e2ffb  com.apple.QD 3.36 (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x91c35000 - 0x91c40ff7  libCSync.A.dylib 545.0.0 (compatibility 64.0.0) <287DECA3-7821-32B6-724D-AE03A9A350F9> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib
0x91c48000 - 0x91c4bff7  libCGXType.A.dylib 545.0.0 (compatibility 64.0.0) <4D766435-EB76-C384-0127-1D20ACD74076> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGXType.A.dylib
0x91c4c000 - 0x91c68fe3  com.apple.openscripting 1.3.1 (???) <2A748037-D1C0-6D47-2C4A-0562AF799AC9> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
0x91c69000 - 0x91ce3fff  com.apple.audio.CoreAudio 3.2.6 (3.2.6) <156A532C-0B60-55B0-EE27-D02B82AA6217> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x91f4d000 - 0x91f5dff7  libsasl2.2.dylib 3.15.0 (compatibility 3.0.0) /usr/lib/libsasl2.2.dylib
0x91fac000 - 0x920dafe7  com.apple.CoreData 102.1 (251) <87FE6861-F2D6-773D-ED45-345272E56463> /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
0x920db000 - 0x920dbff7  com.apple.ApplicationServices 38 (38) <8012B504-3D83-BFBB-DA65-065E061CFE03> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x920dc000 - 0x921defe7  libcrypto.0.9.8.dylib 0.9.8 (compatibility 0.9.8) <015563C4-81E2-8C8A-82AC-31B38D904A42> /usr/lib/libcrypto.0.9.8.dylib
0x921df000 - 0x921e2ff7  libCoreVMClient.dylib ??? (???) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib
0x921e3000 - 0x9227bfe7  edu.mit.Kerberos 6.5.11 (6.5.11) /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
0x9227c000 - 0x922a6ff7  com.apple.shortcut 1.1 (1.1) /System/Library/PrivateFrameworks/Shortcut.framework/Versions/A/Shortcut
0x922f7000 - 0x92379ffb  SecurityFoundation ??? (???) /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
0x9286e000 - 0x92890fef  com.apple.DirectoryService.Framework 3.6 (621.11) /System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryService
0x92891000 - 0x92893ff7  com.apple.securityhi 4.0 (36638) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
0x92894000 - 0x92896ff7  libRadiance.dylib ??? (???) <5920EB69-8D7F-5EFD-70AD-590FCB5C9E6C> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x92897000 - 0x92901fe7  libstdc++.6.dylib 7.9.0 (compatibility 7.0.0) <411D87F4-B7E1-44EB-F201-F8B4F9227213> /usr/lib/libstdc++.6.dylib
0x92902000 - 0x92935ff7  com.apple.AE 496.5 (496.5) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x9293c000 - 0x9297fff7  com.apple.NavigationServices 3.5.4 (182) <8DC6FD4A-6C74-9C23-A4C3-715B44A8D28C> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationServices.framework/Versions/A/NavigationServices
0x92ac7000 - 0x92b0dff7  libauto.dylib ??? (???) <29422A70-87CF-10E2-CE59-FEE1234CFAAE> /usr/lib/libauto.dylib
0x92b47000 - 0x92b6fff7  libxslt.1.dylib 3.24.0 (compatibility 3.0.0) <315D97C2-4E1F-A95F-A759-4A3FA5639E75> /usr/lib/libxslt.1.dylib
0x92b70000 - 0x92bc8fe7  com.apple.datadetectorscore 2.0 (80.7) /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore
0x92bc9000 - 0x92c12fe7  libTIFF.dylib ??? (???) <579DC328-567D-A74C-4BCE-1D1C729E3F6D> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x92c13000 - 0x93402557  com.apple.CoreGraphics 1.545.0 (???) <1D9DC7A5-228B-42CB-7018-66F42C3A9BB3> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x93485000 - 0x938baff7  libLAPACK.dylib 219.0.0 (compatibility 1.0.0) <5E2D2283-57DE-9A49-1DB0-CD027FEFA6C2> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x938bb000 - 0x938cfffb  com.apple.speech.synthesis.framework 3.10.35 (3.10.35) <0DBE17D5-17A2-8A0E-8572-5A78408B41C9> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x93d20000 - 0x93d5bfeb  libFontRegistry.dylib ??? (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib
0x93eb9000 - 0x93ecaff7  com.apple.LangAnalysis 1.6.6 (1.6.6) <3036AD83-4F1D-1028-54EE-54165E562650> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x93ecb000 - 0x93f83feb  libFontParser.dylib ??? (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib
0x93f84000 - 0x93fe5fe7  com.apple.CoreText 151.10 (???) <5C2DEFBE-D54B-4DC7-D456-9ED02880BE98> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
0x93fe6000 - 0x94033feb  com.apple.DirectoryService.PasswordServerFramework 6.1 (6.1) <136BFA48-D456-B677-3B5D-40A6946C3A09> /System/Library/PrivateFrameworks/PasswordServer.framework/Versions/A/PasswordServer
0x94034000 - 0x942a5fef  com.apple.Foundation 6.6.8 (751.63) <69B3441C-B196-F2AD-07F8-D8DD24E4CD8C> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x943b7000 - 0x94463fe7  com.apple.CFNetwork 454.12.4 (454.12.4) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x94560000 - 0x94569ff7  com.apple.DiskArbitration 2.3 (2.3) /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x945d8000 - 0x948f8ff3  com.apple.CoreServices.CarbonCore 861.39 (861.39) <5C59805C-AF39-9010-B8B5-D673C9C38538> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x94975000 - 0x94976ff7  com.apple.TrustEvaluationAgent 1.1 (1) <2D970A9B-77E8-EDC0-BEC6-7580D78B2843> /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent
0x94977000 - 0x94977ff7  com.apple.vecLib 3.6 (vecLib 3.6) /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
0x94978000 - 0x94a34fff  com.apple.ColorSync 4.6.6 (4.6.6) <7CD8B191-039A-02C3-EA5E-4194EC59995B> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x94a35000 - 0x94e4bff7  libBLAS.dylib 219.0.0 (compatibility 1.0.0) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x94e58000 - 0x94e9cfe7  com.apple.Metadata 10.6.3 (507.15) <460BEF23-B89F-6F4C-4940-45556C0671B5> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x94e9d000 - 0x94eafff7  com.apple.MultitouchSupport.framework 207.11 (207.11) <6FF4F2D6-B8CD-AE13-56CB-17437EE5B741> /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport
0x95224000 - 0x9539ffe7  com.apple.CoreFoundation 6.6.6 (550.44) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x953a0000 - 0x953f0ff7  com.apple.framework.familycontrols 2.0.2 (2020) /System/Library/PrivateFrameworks/FamilyControls.framework/Versions/A/FamilyControls
0x953f1000 - 0x953f4ffb  com.apple.help 1.3.2 (41.1) <8AC20B01-4A3B-94BA-D8AF-E39034B97D8C> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
0x953f5000 - 0x953f5ff7  com.apple.CoreServices 44 (44) <51CFA89A-33DB-90ED-26A8-67D461718A4A> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x954a0000 - 0x954a0ff7  liblangid.dylib ??? (???) /usr/lib/liblangid.dylib
0x954d2000 - 0x955d3fe7  libxml2.2.dylib 10.3.0 (compatibility 10.0.0) /usr/lib/libxml2.2.dylib
0x955d4000 - 0x955d8ff7  libGIF.dylib ??? (???) <2123645B-AC89-C4E2-8757-85834CAE3DD2> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x955d9000 - 0x9561dff3  com.apple.coreui 2 (114) <2234855E-3BED-717F-0BFA-D1A289ECDBDA> /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
0x9561e000 - 0x956b0fe7  com.apple.print.framework.PrintCore 6.3 (312.7) <7410D1B2-655D-68DA-D4B9-2C65747B6817> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x956d3000 - 0x956e1fe7  libz.1.dylib 1.2.3 (compatibility 1.0.0) <33C1B260-ED05-945D-FC33-EF56EC791E2E> /usr/lib/libz.1.dylib
0x956e2000 - 0x95715fff  libTrueTypeScaler.dylib ??? (???) <0F04DAC3-829A-FA1B-E9D0-1E9505713C5C> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libTrueTypeScaler.dylib
0x95716000 - 0x957c4ff3  com.apple.ink.framework 1.3.3 (107) <233A981E-A2F9-56FB-8BDE-C2DEC3F20784> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
0x96560000 - 0x96596fff  libtidy.A.dylib ??? (???) <0FD72C68-4803-4C5B-3A63-05D7394BFD71> /usr/lib/libtidy.A.dylib
0x965de000 - 0x9664dff7  libvMisc.dylib 268.0.1 (compatibility 1.0.0) <595A5539-9F54-63E6-7AAC-C04E1574B050> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x9664e000 - 0x967f5ff7  libSystem.B.dylib 125.2.11 (compatibility 1.0.0) <2DCD13E3-1BD1-6F25-119A-3863A3848B90> /usr/lib/libSystem.B.dylib
0x967f6000 - 0x96902ff7  libGLProgrammability.dylib ??? (???) <04D7E5C3-B0C3-054B-DF49-3B333DCDEE22> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib
0x96f98000 - 0x96fc9ff7  libGLImage.dylib ??? (???) <0EE86397-A867-0BBA-E5B1-B800E43FC5CF> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
0x96fca000 - 0x96fcaff7  com.apple.Carbon 150 (152) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x96fcb000 - 0x96febfe7  libresolv.9.dylib 41.0.0 (compatibility 1.0.0) /usr/lib/libresolv.9.dylib
0x96fec000 - 0x96fedff7  com.apple.audio.units.AudioUnit 1.6.7 (1.6.7) <838E1760-F7D9-3239-B3A8-20E25EFD1379> /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
0x96fff000 - 0x9736aff7  com.apple.QuartzCore 1.6.3 (227.37) /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
0x9736d000 - 0x97382fff  com.apple.ImageCapture 6.1 (6.1) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
0x97383000 - 0x9745dfff  com.apple.DesktopServices 1.5.11 (1.5.11) <800F2040-9211-81A7-B438-7712BF51DEE3> /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x97477000 - 0x9747bff7  libGFXShared.dylib ??? (???) <801B2C2C-1692-475A-BAD6-99F85B6E7C25> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib
0x9747c000 - 0x9748aff7  com.apple.opengl 1.6.13 (1.6.13) <025A905D-C1A3-B24A-1585-37C328D77148> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x974ec000 - 0x974f2fe7  com.apple.CommerceCore 1.0 (9.1) <521D067B-3BDA-D04E-E1FA-CFA526C87EB5> /System/Library/PrivateFrameworks/CommerceKit.framework/Versions/A/Frameworks/CommerceCore.framework/Versions/A/CommerceCore
0x97801000 - 0x978aefe7  libobjc.A.dylib 227.0.0 (compatibility 1.0.0) <9F8413A6-736D-37D9-8EB3-7986D4699957> /usr/lib/libobjc.A.dylib
0x978af000 - 0x978c3fe7  libbsm.0.dylib ??? (???) <821E415B-6C42-D359-78FF-E892792F8C52> /usr/lib/libbsm.0.dylib
0x978c4000 - 0x978ceff7  com.apple.HelpData 2.0.5 (34.1.1) /System/Library/PrivateFrameworks/HelpData.framework/Versions/A/HelpData
0x978cf000 - 0x978cfff7  com.apple.Accelerate 1.6 (Accelerate 1.6) <3891A689-4F38-FACD-38B2-4BF937DE30CF> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x97b05000 - 0x97be5fe7  com.apple.vImage 4.1 (4.1) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
0x97cb8000 - 0x97cbfff3  com.apple.print.framework.Print 6.1 (237.1) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
0x98dcf000 - 0x98e12ff7  libGLU.dylib ??? (???) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
0x98e64000 - 0x98f58ff7  libiconv.2.dylib 7.0.0 (compatibility 7.0.0) <061ABF36-8BA9-79C1-6CE7-EC69A4998F51> /usr/lib/libiconv.2.dylib
0x98f59000 - 0x9983cff7  com.apple.AppKit 6.6.8 (1038.36) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x99876000 - 0x998f6feb  com.apple.SearchKit 1.3.0 (1.3.0) <2F5DE102-A203-7905-7D12-FCBCF17BAEF8> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x998f7000 - 0x99916ff7  com.apple.CoreVideo 1.6.2 (45.6) /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
0x99917000 - 0x999b2fe7  com.apple.ApplicationServices.ATS 275.19 (???) <9FA31967-CF14-B033-EB8D-570561D12A13> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x99b36000 - 0x99b3aff7  IOSurface ??? (???) /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
0x99c62000 - 0x99c62ff7  com.apple.Cocoa 6.6 (???) /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
0x99ceb000 - 0x99e6dfe7  libicucore.A.dylib 40.0.0 (compatibility 1.0.0) /usr/lib/libicucore.A.dylib
0x99e6e000 - 0x9a030feb  com.apple.ImageIO.framework 3.0.4 (3.0.4) <027F55DF-7E4E-2310-1536-3F470CB8847B> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x9a0e8000 - 0x9a0e8ff7  com.apple.Accelerate.vecLib 3.6 (vecLib 3.6) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
0x9a0e9000 - 0x9a40dfef  com.apple.HIToolbox 1.6.5 (???) <21164164-41CE-61DE-C567-32E89755CB34> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x9a40e000 - 0x9a448ff7  libcups.2.dylib 2.8.0 (compatibility 2.0.0) <6875335E-0993-0D77-4E80-41763A8477CF> /usr/lib/libcups.2.dylib
0x9a449000 - 0x9a46dff7  libJPEG.dylib ??? (???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x9a4a8000 - 0x9a4aefff  com.apple.CommonPanels 1.2.4 (91) <2438AF5D-067B-B9FD-1248-2C9987F360BA> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
0x9a4af000 - 0x9a4baff7  libGL.dylib ??? (???) <3E34468F-E9A7-8EFB-FF66-5204BD5B4E21> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x9ab3c000 - 0x9ab57ff7  libPng.dylib ??? (???) <25DF2360-BFD3-0165-51AC-0BDAF7899DEC> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
0x9ab58000 - 0x9ab64ff7  libkxld.dylib ??? (???) <9A441C48-2D18-E716-5F38-CBEAE6A0BB3E> /usr/lib/system/libkxld.dylib
0xffff0000 - 0xffff1fff  libSystem.B.dylib ??? (???) <2DCD13E3-1BD1-6F25-119A-3863A3848B90> /usr/lib/libSystem.B.dylib

Model: MacBookPro6,1, BootROM MBP61.0057.B0C, 2 processors, Intel Core i7, 2.66 GHz, 8 GB, SMC 1.57f17
Graphics: NVIDIA GeForce GT 330M, NVIDIA GeForce GT 330M, PCIe, 512 MB
Graphics: Intel HD Graphics, Intel HD Graphics, Built-In, 288 MB
Memory Module: global_name
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x93), Broadcom BCM43xx 1.0 (5.10.131.42.4)
Bluetooth: Version 2.4.5f3, 2 service, 19 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en1
Serial ATA Device: APPLE SSD TS256B, 233.76 GB
Serial ATA Device: MATSHITADVD-R   UJ-898
USB Device: Hub, 0x0424  (SMSC), 0x2514, 0xfa100000 / 2
USB Device: Apple Internal Keyboard / Trackpad, 0x05ac  (Apple Inc.), 0x0236, 0xfa120000 / 4
USB Device: BRCM2070 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0xfa110000 / 3
USB Device: Bluetooth USB Host Controller, 0x05ac  (Apple Inc.), 0x8218, 0xfa113000 / 5
USB Device: Hub, 0x0424  (SMSC), 0x2514, 0xfd100000 / 2
USB Device: IR Receiver, 0x05ac  (Apple Inc.), 0x8242, 0xfd120000 / 4
USB Device: Built-in iSight, 0x05ac  (Apple Inc.), 0x8507, 0xfd110000 / 3