Archive for December, 2009

Overcoming cygwin “Error: no display specified”

I installed cygwin, which allows you to execute Linux-based applications on your Windows machines. But what I wanted to do was connect (using ssh) to a Linux box and run an application that has a GUI from there. In this case, I wanted to be able to connect to server and run firefox from the [...] Read more »

Graph of pch Plotting Symbols in R

In R, you can plot a variety of symbols when you are plotting points on a graph. The default is a hollow circle. But it is very flexible. To do this, you use the pch parameter when you create a plot. You can find information in the help files (?pch), but it only describes the [...] Read more »

Get File Name from File Path in Python

Let’s say you did a search for files matching a certain pattern in a directory using Python:

import glob
 
filePaths = glob.glob("C:\\Temp\\*.txt")
print filePaths

This will list the full file paths with a .txt extension in the C:\Temp directory. For example: C:\\Temp\\test.txt.
But if you wanted to get just the file name, how would you go about that? It took [...] Read more »