Enabling Ruby syntax highlighting and autocomplete using MacVim

January 13, 2013 / 0 comments

Steps: Download and use MacVim using Homebrew: brew install macvim (If above doesn’t work to highlight .rb files automatically or if you prefer using vim instead of macvim) Download vim-ruby zip from: https://github.com/vim-ruby/vim-ruby Follow manual “Manually” instructions to install from a script file: https://github.com/vim-ruby/vim-ruby/wiki/VimRubySupport Enable extensions within your ~/.vimrc set nocompatible ” We’re running Vim, not Vi!…

Read more →

Pry – an alternative to IRB with some excellent features

December 28, 2012 / 0 comments

Nice alternative to IRB for Ruby called Pry: http://pryrepl.org/ Includes: Syntax highlighting Autocompletion of method names Auto-indentation …

The power of ack

December 13, 2012 / 1 comment

ack homepage: http://betterthangrep.com/ This is a super useful tool for searching through all of your source code. It searches recursively by default, ignores revision control directories, and aggregates/presents the search results in a very readable format. Makes software development just that much easier. Here’s a quick example: $ ack -C 5 –java “ProductVersioner” /usr/local/src/apache-oodt/asf-latest/trunk “search for…

Read more →

Problem with OODT CAS-Filemanger’s Lucene query tool when using underscores

March 2, 2012 / 2 comments

When using the OODT CAS-FileManager “query” tool [1], the standard query format needs to adhere to Lucene’s query syntax. A simple query often used is a query to obtain all products of a given product type: [sourcecode language=”bash”]cd $FILEMGR_HOME/bin ./query_tool –url http://localhost:9000 –lucene -query CAS.ProductType:GenericFile[/sourcecode] The above query works fine, and returns productIDs for all…

Read more →

Changing text font-size and color for jQuery qTip popups

February 16, 2012 / 1 comment

Found this really awesome Javascript library to enable context-sensitive help popups appear on webpages. With just a few lines of code, it becomes really easy to add context-sensitive help. http://craigsworks.com/projects/qtip/ Changing the font-size and color took me a while to figure out. The documentation made it seem I would need to modify the ‘content’ property…

Read more →

Computing T-Distribution Cumulative Probability Density Function

January 24, 2012 / 2 comments

I’ll be the first to admit, its been a long time since I was in Statistics class, but it’s really one of the most useful classes out there, even the esoteric parts of it. Recently, I had to write code to compute bias estimation for climate change data, and one of the key stats used…

Read more →

Avoiding the terminal error: xterm-color: Unknown terminal type

July 19, 2011 / 0 comments

Using a Mac terminal to connect to a machine not supporting the xterm-color terminal type can result in tools like vi not working. One can get the error: xterm-color: Unknown terminal type The solution to this problem is to identify the terminal types supported on the remote machine. In my case, it was vt100 Steps…

Read more →

Using Flex Hero SDK with FlexBuilder 3

July 6, 2011 / 0 comments

Trying to compile a library project requiring Flex 4.0+ (or Hero) SDK in FlexBuilder 3 should be straightforward: just point Flex to the new SDK. However, like many things Flex, this simple task yields an error: “unable to open ‘/Applications/Adobe Flash Builder Burrito/sdks/4.5.0/frameworks/libs/player/9.0” The key is to add a compiler argument like: “-target-player=10.1″. For library…

Read more →

Sending e-mail in Java via SMTP protocol

June 1, 2011 / 5 comments

I was attempting to send e-mail, using the following code, in Java but was receiving SMTP protocol errors. I thought perhaps I required authentication or some other type of initilization, but turns out the problem was just missing jars. Java code: Properties emailProps = new Properties(); emailProps.setProperty(“mail.host”, “<YOUR_SMTP_HOST>”); emailProps.setProperty(“mail.debug”, “true”); Session session = Session.getInstance(emailProps); Message…

Read more →

Find process ID for program listening on a particular port

April 27, 2011 / 0 comments

It’s often necessary to find the process ID of a program running (usually amok) on a particular port. I forget this enough, that I keep re-googling it. Here it is: lsof -i tcp:<PORT> -Fp|tr -d p Enjoy!