Skip to content

Instantly share code, notes, and snippets.

View Watson1978's full-sized avatar

Watson Watson1978

View GitHub Profile
Apple Inc. (NASDAQ: AAPL; previously Apple Computer, Inc.) is an American multinational corporation that designs and markets consumer electronics, computer software, and personal computers. The company's best-known hardware products include the Macintosh line of computers, the iPod, the iPhone and the iPad. Apple software includes the Mac OS X operating system; the iTunes media browser; the iLife suite of multimedia and creativity software; the iWork suite of productivity software; Aperture, a professional photography package; Final Cut Studio, a suite of professional audio and film-industry software products; Logic Studio, a suite of music production tools; and iOS, a mobile operating system. As of August 2010, the company operates 301 retail stores[5] in ten countries,[6] and an online store where hardware and software products are sold.
Established on April 1, 1976 in Cupertino, California, and incorporated January 3, 1977,[7] the company was previously named Apple Computer, Inc., for its first 30 years, b
@Watson1978
Watson1978 / backtrace.txt
Created January 18, 2011 09:20
tikets 704: segfault if change print message before "@values[name] = value"
(gdb) r
Starting program: /Users/watson/src/macruby-trunk-svn/miniruby /Users/watson/tmp/test_singleton.rb
Reading symbols for shared libraries .++++++++................... done
Reading symbols for shared libraries . done
method : 2.12264622838802e-314
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x00007fff81d2f700 in _class_getSuperclass ()
(gdb) bt
@Watson1978
Watson1978 / macruby_result.txt
Created February 13, 2011 13:10
MacRuby : Mechanize
/Library/Frameworks/MacRuby.framework/Versions/0.9/usr/lib/ruby/1.9.2/forwardable.rb:185:in `search:': undefined method `html_parser' for nil:NilClass (NoMethodError)
from /Library/Frameworks/MacRuby.framework/Versions/0.9/usr/lib/ruby/Gems/1.9.2/gems/mechanize-1.0.0/lib/mechanize/page.rb:208:in `block'
from /Library/Frameworks/MacRuby.framework/Versions/0.9/usr/lib/ruby/Gems/1.9.2/gems/mechanize-1.0.0/lib/mechanize/page.rb:207:in `links'
from /Users/watson/tmp/test_mechanize.rb:12:in `block'
from /Library/Frameworks/MacRuby.framework/Versions/0.9/usr/lib/ruby/Gems/1.9.2/gems/mechanize-1.0.0/lib/mechanize.rb:262:in `get:'
from /Users/watson/tmp/test_mechanize.rb:11:in `<main>'
module TestModule
include TestModule
end
require 'date'
p Date.respond_to?(:now) # => false
p Date.now
__END__
$ macruby test_date.rb
true
/Users/qoo/tmp/test_date.rb:4:in `<main>': private method `now' called for Date:Class (NoMethodError)
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
# Array.new should return nil when break from block.
ary = Array.new(3) do |i|
break if i == 2
i.to_s
end
assert_nil(ary)
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
ary = [1, 2, 3]
dup = ary.dup
ary.sort_by!{ break }
assert_equal(ary, dup)
puts :ok
@Watson1978
Watson1978 / test_defined.rb
Created March 18, 2011 13:08
MacRuby : The defined? keyword when called with a method name having a module as receiver returns nil if the method is private/protected.
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
module AAA
class BBB
private
def m_private; end
protected
def m_protected; end
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
module ConstantSpecs
class ParentA
CS_CONST20 = :const20_2
end
class ContainerA
class ChildA < ParentA
require 'test/unit/assertions.rb'
include Test::Unit::Assertions
class Foo
def respond_to_missing?(method, priv= false)
#puts "respond_to_missing? : " + method.inspect
method
end
end