This is a test post.
Here's some code
Continue reading
This is a test post.
Here's some code
Continue reading
(for posterity, ’cause I always forget…)
alias nl="sed 'N;s/\n/\n\n/'"
ps -ef | grep -i username | nl
This injects an extra newline after every newline in the command’s output. Makes it much easier to read verbose output such as searching for java server processes (glassfish, WL) which have really long command lines.
Git doesn’t let you cherry pick a merge commit from one branch on to another branch. For e.g. a:
git cherry-pick ac61858fac21c33f47e95f3bac4c8cc3a643195b
Where ac61858
is a merge commit generates the following error:
error: Commit ac61858fac21c33f47e95f3bac4c8cc3a643195b is a merge but no -m option was given.
This is because the merge commit is merge of two lines of development. So when using it to cherry pick to another branch, GIT doesn’t know which of the two branches to merge to the destination branch.
This is explained @ http://stackoverflow.com/a/12628579/209952.
In order to get this to work, you need to use the -m option, with the parent to pick.
Also, cherry pick commits the changes with a message right away. If you want to avoid an immediate checkin, use the -n option.
So, say you have a RELEASE branch with two merge commits C1, C2. You want to merge these changes (and only these) back to, say, MASTER. Here’s how you would go about it:
git checkout MASTER git cherry-pick -n -m 1 C1 git cherry-pick -n -m 1 C2 git commit -m"Merging feature xyz changes from RELEASE to MASTER"
Note the “-m 1” in the above commands. 1 means in include changes merged to RELEASE, 2 would mean use the state of RELEASE at the time of merge.
Eclipse allows you to turn code formatting on and off for a certain section of your code. This is extremely helpful when, say, you want to temporarily comment out a block of code and you end up formatting the file. Eclipse will have mashed up the whole comment block into an unrecognizable mish-mash.
To avoid this, you can surround that code (or comment) block with the following:
// @formatter:off
…
…
your code block
…
…
// @formatter:on
Remember, for this to work, you have to enable these tags in the code formatting preferences.
In Eclipse preferences: Java > Code Style > Formatter. Click on “Edit” button, “Off/On Tags”, check off “Enable Off/On tags”.
You can even select the text you want, the default being “@formatter:off” and “@formatter:on”.
Code on!
Here’s how you do it…
Change the default search engine of FireFox address bar:
With FireFox you can search simply by typing your search terms in the address bar (that’s where you see your current URL). In this case, the default search engine will be used to search.
- Open about:config in Firefox (if you doing it for the first time, you may have to promise you are going to be careful)
- Search for keyword.url from the filter box.
- Double click on this entry. It will open a dialog where you can edit the ‘keyword.url’ string.
- Change this string to whatever you want it to be:
To use Google search, change the string to: http://www.google.com/search?hl=en&q=
Duct tape programmers are pragmatic. Zawinski popularized Richard Gabriel’s precept of Worse is Better. A 50%-good solution that people actually have solves more problems and survives longer than a 99% solution that nobody has because it’s in your lab where you’re endlessly polishing the damn thing. Shipping is a feature. A really important feature. Your product must have it.
I’ve started using iGoogle as a sort of “dashboard” for stuff that I need to check on every once in a while. Love iGoogle for that.
The problem?
I don’t like the standard Google search box that appears at the top of every iGoogle tab. With the logo, the text box and the buttons, it takes up too much screen real estate for a dashboard. If I need to search, I have the Google classic search page set as my homepage. No need to mix the search with the iGoogle gadgets…
The solution?
Two nifty little FireFox extensions, AdBlock+ and Element Hiding Helper for AdBlock+.
Just created my first search plugin for FireFox, for the Motley Fool CAPS site..
Here’s how:
Make sure you know the search URL. For e.g. searching for “test” on google.com gives you the following URL: “http://www.google.com/search?q=test”.
You should see the search box next to the (awesome?) address bar have a new dropdown option for the search you just added. Note also that you’re missing a neat little icon that other search engines in the dropdown have.
To add this icon, go back to your XML file.
There should see the icon added to your search plugin.
See, it’s not that hard, if you know the steps :-).
Life just gives you time and space, it’s up to you to fill it.
Heard this little gem of an advice, while watching a Youtube video interview of Joshua Bloch.
Effective Java Programming with Joshua Bloch
Less is more. If you’re not sure if you need to add a certain capability, leave it out. You cal always add it later.
Beautiful advice. Over the years, the one thing that I’ve seen is that if you make a product that is chock-full of complex features, multiple configurations, etc, most users will just go with the defaults that you give them. So the payouts of having a complex set of features usually isn’t there. So go ahead, be lazy! If it’s not required, don’t do it.