Skip to content

Instantly share code, notes, and snippets.

View ihower's full-sized avatar
🎯
Focusing

Wen-Tien Chang ihower

🎯
Focusing
View GitHub Profile
<div class="map">
<iframe width="350" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?ie=UTF8&amp;source=embed&amp;hl=zh-TW&amp;msa=0&amp;msid=101908379901557595242.00047f68df8db5ba850ee&amp;ll=25.041749,121.613674&amp;spn=0.037326,0.054932&amp;z=14&amp;output=embed"></iframe>
</div>
<div class="info">
<div class="venue group">
<h2>Venue</h2>
<div class="description">
<h3>中央研究院 人文社會科學館 (人文館)</h3>
class Dragon; end
# 使用 def 定義 class method
Dragon.instance_eval do
def foo
puts "bar"
end
end
Dragon.foo # bar
class Dragon
def test
"test"
end
end
d = Dragon.new
puts d.test # test
# 呼叫 super (1)
Error during failsafe response: "\xE4" from ASCII-8BIT to UTF-8
/Users/ihower/github/rails/activesupport/lib/active_support/buffered_logger.rb:104:in `write'
/Users/ihower/github/rails/activesupport/lib/active_support/buffered_logger.rb:104:in `block in flush'
<internal:prelude>:10:in `synchronize'
/Users/ihower/github/rails/activesupport/lib/active_support/buffered_logger.rb:101:in `flush'
/Users/ihower/github/rails/activesupport/lib/active_support/buffered_logger.rb:121:in `auto_flush'
/Users/ihower/github/rails/activesupport/lib/active_support/buffered_logger.rb:66:in `add'
/Users/ihower/github/rails/activesupport/lib/active_support/buffered_logger.rb:77:in `fatal'
/Users/ihower/github/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:139:in `block in log_error'
/Users/ihower/github/rails/activesupport/lib/active_support/deprecation/reporting.rb:15:in `silence'

== Scala 2.7.5

scalac shapes.scala shapes-actor.scala
scala shapes-actor-script.scala // it works

== Scala 2.8.0

scalac shapes.scala shapes-actor.scala
scala shapes-actor-script.scala // NOT works

scala -cp . shapes-actor-script.scala // NOT works

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Forum</title>
<%= stylesheet_link_tag "base", "style" %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head>
<body>
# idea from http://www.codemud.net/~thinker/GinGin_CGI.py/show_id_doc/201
def log(logfile):
def assign_call(call):
return lambda *args, **kws: logfile.write(call.__name__) and call(*args, **kws)
return assign_call
class Foo(object):
@log(file('my.log',"w"))
def bar():
pass
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return;
echo "("${ref#refs/heads/}") ";
}
PS1="[\[\033[1;32m\]\w\[\033[0m] \[\033[0m\]\[\033[1;36m\]\$(parse_git_branch)\[\033[0m\]$ "
if [[ -s /Users/ihower/.rvm/scripts/rvm ]] ; then source /Users/ihower/.rvm/scripts/rvm ; fi
require 'benchmark'
class User
attr_accessor :a, :b, :c
def attribute_names
["a","b","c"]
end
end
@ihower
ihower / gist:672003
Created November 11, 2010 04:24
from a manager to a programmer...
from a manager to a programmer...
1. Final result is the KING
2. WORK WORK WORK
3. Fixing bug IS CRITICAL
4. Write code ASAP.
5. Do you job. Don't do anything irrelated.
6. Stay at company. Never go home.
7. Job security and unsurprising idea originate everywhere
8. Be a business man