Archive for September, 2009

Troubleshooting Cygwin Error: “ssh command not found”

Cygwin is a software tool that allows you to run Linux programs in Windows. I have had good success in using it to run commands locally and to connect to other servers via ssh, scp, etc. I just got a new computer and installed the latest version of Cygwin, but when I tried to ssh [...] Read more »

In Java, Use StringBuilder When Constructing Large Strings

This bit of advice is not new to me nor to the software development community. But recently I had one of those experiences where I put together a quick solution (to keep my code as simple as possible), and later I ran into a performance problem. And it was because I was violating this principle.
I [...] Read more »

Read Contents of Text File Into a Variable in a Bash Script

I’m learning something new about Linux every day, so this is something that will probably be obvious to many of you out there. But I needed today to read the contents of a file into a variable in a bash script. The simple way to go about doing this is to use the following command:

myvar=`cat [...] Read more »

How Training and Testing Works in Data Mining / Machine Learning

Imagine you wanted to come up with a “classifier” to predict whether Georgia would win a given American football game. So you might get (training) data from all their games from the previous two years. Then you might come up with rules based on that data. For example, if the quarterback throws for 300+ yards, [...] Read more »

Save Text to a File in C

I had an occasion to learn a little about programming in C for the first time. One thing I needed to be able to do was save text to a file, but it was hard to find help for this on the Internet. This may be because it is called something slightly different in C [...] Read more »

Execute a Command-line Script in Another Directory in Linux

I am running an application in one location on the file system, and I need to be able to invoke an application that is in a different directory on the file system. Due to personal preference, this other directory is not specified in the PATH variable. So I’m wondering how I can get Linux to [...] Read more »

How to Run a Simple Command at Startup in Linux

In Linux, you sometimes want to run a command when the server first starts up. I was doing this recently where I would have to manually go in and run a command each time the server got rebooted. This was a pain, so with a little help from my friend Martin, I learned how to [...] Read more »