I was feeling lost with what the parameters for a method and found the way to look it up without leaving xcode. Just CMD+double click the method.
Here's the link to thank for.
CGRectMake parameters ? « cocos2d for iPhone
And am writing this post using blogger bookmarklet (chrome addon) called "blog this". It lets you blog any webpage from that page.
Thursday, February 3, 2011
Thursday, January 27, 2011
Shell Variables are Global by Default
All variables in a shell script are global unless specifically declared as local. Local variables can be used only inside a function.
#!/bin/bash
# Global and local variables
carwash()
{
local vin="17DIGITS"
echo "IN Carwash. Your windscreen is:" $1 "and your VIN is:" $vin
post_carwash_status="BEARY CLEAN"
}
status="DIRTY"
carwash $status
echo "After carwash. Your windscreen is:" $status "and your VIN: " $vin
echo "Post Carwash Status: " $post_carwash_status
OUTPUT
IN Carwash. Your windscreen is: DIRTY and your VIN is: 17DIGITS
After carwash. Your windscreen is: DIRTY and your VIN:
Post Carwash Status: BEARY CLEAN
Notice that the local variable vin is not available outside the function.
ps to list only ppid
I generally use ps to get ppid to kill a process and finally figured a way to list just that.
ps -o ppid
And to list ppid without header, indicate that it should have a value. To display more information, add the headings preceded by output formatter -o.
ps -o ppid=
ps -o ppid= args= | grep Firefox
Friday, January 21, 2011
vi Search backwards
For some reason I couldn't ever remember how to do a backward search in vi. So I would use forward search command, "/pattern" and then do "N" which is fine except the clumsy usage of uppercase.
Backward search can be done with "?pattern" and then do "n" to iterate over all the occurrences. Committed to memory now.
Backward search can be done with "?pattern" and then do "n" to iterate over all the occurrences. Committed to memory now.
Sunday, November 7, 2010
Could not parse the remainder in django Template
It's caused when we forget we cannot make HTML execute python commands with the exception of filters and tags. So a "for loop" ( a tag) can iterate over list items or dictionary items but create or append a list.
List of some of the filters and tags supported.
http://www.djangobook.com/en/1.0/appendixF/
List of some of the filters and tags supported.
http://www.djangobook.com/en/1.0/appendixF/
Thursday, October 28, 2010
When ssh relentlessly keeps asking for password
Check if your from and to home directories plus ssh directory have the correct permissions. All the details here -
Using python shell for django project
If you want to test django code in python shell but are getting error messages regarding environment variables not set; set them by using that project's manage script.
python manage.py shell
Subscribe to:
Posts (Atom)