You searched for entries containing the words "inspectingcssinpythonwithcodecssutils" or "code".
Matching entries are ordered according to their relevance and not the date they were posted.
You searched for entries containing the words "inspectingcssinpythonwithcodecssutils" or "code".
Matching entries are ordered according to their relevance and not the date they were posted.
It's a mnemonic:
T: Types
C: Control
O: Objects
M: Modifiers
E: Exceptions
These are the major classes of keywords in Java. Types is things like byte and char, control is if and do, objects is class and implements, modifiers is public and final and exceptions is try and catch and the rest.
Vim files can have girlfriends too :-). In command mode gf will open the file who's name is under the cursor. Make sure your pwd is right.
:set keywordprg=google
Where google is a shell script that simply looks like:
#!/bin/sh
/usr/bin/open http://www.google.com/search?q=$1
The net effect is the whenever I hit K in Vim, I get a google search of the keyword under the cursor. By default Vim uses man, which is OK for C hackers, but not so good for Sun Certified Programmers for Java. :-)
BTW, open is a clever OS X program which uses OS X's database of applications to find the right application for whatever you tell it to open. In this case it will fire up Safari. Using it here means that this hack works from both the command line and GUI versions of Vim.
Cool new thing!
Grep (well, GNU grep at least) has a --colour argument. Add --colour=always to your $GREP_OPTIONS and the matching word will be coloured red in output. Especially useful when grepping multiple files, great for scanability.
I've never been one for debuggers, I'm too lazy really and because I've been a web application developer all these years, debuggers aren't really very often found. I'm much happier just slapping a print statement or two into the code. But I may have found a way to use a debugger that suits my (primitive) working style.
First of all, it's worth showing just how easy it is to get started with my debugger, pdb. Add these lines to any stretch of Python.
import pdb
pdb.set_trace()
When the interpreter runs into pdb.set_trace(), it'll drop into the pdb prompt and you can start inspecting the innards of your code. See the pdb command documentation for everything you can do.
A simple trick for making use of the debugger in a web application is to use a test case as the container instead of the web server. In Django's testing framework for example, tests are run inside the standard Python unittest module which works happily with pdb.
You can also set IPython to invoke pdb whenever an exception is raised and not caught. Allowing you to debug as you play with your code in a interactive Python session.