Lower numbers in the towers represent larger disks, so higher integers must always be to the right of smaller ones.
World:
0 [1]
1 [2]
2 [3 4 5 6]
---------------
| # Ruby's TSort requires that you implement | |
| # tsort_each_node and tsort_each_child. I | |
| # extend Array so that it knows how to | |
| # TSort instances of Project, which has a | |
| # child_project_id pointing to another | |
| # Project. | |
| require 'tsort' | |
| class Array |
| // query: select * from html where url="http://some.url.com" and xpath='//title' | |
| var yql_url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22" + encodeURIComponent(url) + "%22%20and%0A%20%20%20%20%20%20xpath%3D'%2F%2Ftitle'&format=json&callback=?"; | |
| $.getJSON(yql_url, function(json) { | |
| if (json && json.query && json.query.results && json.query.results.title) { | |
| $('#page_title').html(json.query.results.title); | |
| } | |
| }); |
| #!/bin/sh | |
| if [ ! `which rlwrap` ]; then | |
| echo "Please sudo port install rlwrap" | |
| exit | |
| fi | |
| rlwrap coffee -i |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <filetype binary="false" default_extension="" description="CoffeeScript" name="CoffeeScript"> | |
| <highlighting> | |
| <options> | |
| <option name="LINE_COMMENT" value="#" /> | |
| <option name="COMMENT_START" value="`" /> | |
| <option name="COMMENT_END" value="`" /> | |
| <option name="HEX_PREFIX" value="" /> | |
| <option name="NUM_POSTFIXES" value="" /> | |
| <option name="HAS_BRACKETS" value="true" /> |
| class Utilities | |
| @findPos: (obj) -> | |
| obj = obj.get(0) if obj.html? | |
| curLeft = curTop = 0 | |
| if obj.offsetParent | |
| loop | |
| curLeft += obj.offsetLeft | |
| curTop += obj.offsetTop | |
| break unless obj = obj.offsetParent | |
| { x: curLeft, y: curTop } |
| package main | |
| import "code.google.com/p/go-tour/pic" | |
| func Pic(dx, dy int) [][]uint8 { | |
| pic := make([][]uint8, dx) | |
| for i := range(pic) { | |
| pic[i] = make([]uint8, dy) | |
| for j := range(pic[i]) { | |
| pic[i][j] = uint8((i + j)/2) |
| [][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]][([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]]]+([][[]]+[])[+[[+!+[]]]]+(![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[+!+[]]]]+([][[]]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[ |
| 2.1.2 :004 > pp Google::Contacts.new(client).contacts | |
| [{:emails=>{:other=>{:address=>"[email protected]", :primary=>true}}, | |
| :phone_numbers=> | |
| {:main=>"(555) 123-1234", :home=>"123-123-1234", :mobile=>"555-555-5555"}, | |
| :handles=> | |
| {:home=>{:address=>"something", :protocol=>"AIM"}, | |
| :other=>{:address=>"something-else", :protocol=>"AIM"}}, | |
| :nickname=>nil, | |
| :websites=>[], |
| San Francisco 4821 | |
| London 1409 | |
| Seattle, WA 1083 | |
| New York, NY 2056 | |
| Portland, OR 949 | |
| Chicago, IL 930 | |
| Tokyo, Japan 1518 | |
| London, UK 894 | |
| japan 880 | |
| Germany 856 |