Archive for December, 2010

For loops in R: how to do a “continue”

In R, you can use “for” loops just like in most other programming languages. Sometimes when you are looping through items and you encounter a certain condition, you want to skip over an item and move to the next item in the loop. In some languages, the keyword for doing this is “continue.” In R, [...] Read more »

Troubleshooting Password-less SSH Login on UNIX Systems

There’s a nice way of setting up a UNIX-based server so you can log in without a password. This technique uses public/private key encryption. You set it up one time on your client machine and one time on each server you want to connect to. Then you can SSH into the server without using a [...] Read more »

Calculate the Exponent of a Number in Python

Let’s say you want to square a numeric value in Python. It’s a really easy solution. You use the ** operator. It works for whatever exponent you want.

x = 2
y = x**2 // 4
 
x = 10
y = x**2 // 100
 
x = 10
y = x**3 // 1000 Read more »