Can’t find anything about casting an instance to specified class? Of cause, in Ruby, there is no such concept that you need to cast an instance in most of the cases. But how about you need to? Here is the answer:
By using ActiveRecord::Persistence.becomes, you can easily cast it to specified class.
For example:
inspired by http://atastypixel.com/blog/textmate-git-diff-in-filemerge/
from http://stackoverflow.com/questions/723157/how-to-insert-a-newline-in-front-of-a-pattern sed “s/regexp/\\`echo -e ‘\n\r’`/g”
Hold the ‘option’ key in launchpad, you should see all the icons wiggle. Click on the redundant icon, and you should see a question mark watermark appearing in the icon Release ‘option’ key Hold the ‘option’ key again, you should see a delete icon at the top left corner of the redundant icon. Click at [...]
from: http://www.debian-administration.org/articles/317
Previously we showed how to add basic completion to commands, using facilities which were already provided by the bash completion routines. In this second part we’ll demonstrate how to add completely new custom completion to commands.
In part one we looked at adding hostname completion to arbitrary commands by executing:
complete -F _known_hosts xvncviewer [...]
from http://ar.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html :host - Defaults to “localhost”. :port - Defaults to 5432. :username - Defaults to nothing. :password - Defaults to nothing. :database - The name of the database. No default, must be provided. :schema_search_path - An optional schema search path for the connection given as a string of comma-separated schema names. This is backward-compatible with the :schema_order option. :encoding - An optional [...]
p = Person.new p.first_name = ‘Tian’ p.last_name = nil p.first_name? # => true p.last_name? # => false
Issue: Hackintosh upgrading to 10.7.2, booting the Mac OS, then run into a panic that shows backtrace and is caused by ApplePolicyControl
Solution:
After upgrade, use other source which has terminal or finder (like mac os install usb) to boot, then remove the folder ApplePolicyControl.kext from /System/Library/Extensions/AppleGraphicsControl.kext/Contents/PlugIns reboot into the Mac OS
Good luck
-
Articles
- October 2012
- May 2012
- April 2012
- March 2012
- February 2012
- December 2011
- November 2011
- October 2011
- September 2011
- August 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
-
Meta