Sometimes you need to use a function that wants a numeric matrix as input. One such function is glmnet.cv() which performs lasso regression with cross validation, which is very cool. Unfortunately, it is picky about how it wants the input data. Here’s some lines of my code: fit_cv = cv.glmnet(x = as.matrix(temp_df[predictors]), #predictor vars matrix […]

In trying to merge some data, I was confronted with a problem of matching up strings where the author had mutilated them. He had done so in two ways: cutting them off at the 8th character or using personal abbreviations. The first one is relatively easy to deal with. The second one is not. So […]

Many airports have free wifi services. The problem with these is that they are time-limited, usually to 1 to 3 hours. This can be very annoying if one is stuck in an airport for an extended period, as I am right now. Non-technical solution If you have spent your time on one device, you can […]

I’ve thought about this question a few times but haven’t found a good solution yet. The problem needs more attention. AI and computer recognition of images is getting better. I’ll go ahead and say that the probability of reaching the level where computers are as good at humans at any of kind of CAPTCHA/verify-I’m-not-a-bot-test within […]

So this should be fairly easy according to various guides, but it is not. The goal is to create a test installation of WordPress on the server, so we can play around with it before moving any changes to the live server. First step, backup everything! It is very easy to fuck something up, so […]

Link to article. Ever been annoyed by the overly long links one gets when one tries to copy a link from Google? Here is an example: www.google.com/url?sa=t&source=web&cd=2&ved=0CCoQFjAB&url=http%3A%2F%2Fwww.stat.gl%2FLinkClick.aspx%3Flink%3DAlkohol%252Fpublika%2B2010%2Balko.pdf%26tabid%3D109%26mid%3D494%26language%3Den-US&rct=j&q=alkoholindtag+pr+land+gr%C3%B8nland&ei=2ffcTZThBIaF-wblnOHJDw&usg=AFQjCNG-ZRltkvhL1RYHjT4uSEJWmmXxVQ&cad=rja These are very annoying and their function is just to allow Google to track and see which link you actually clicked. Fortunately, there is a way to get […]

Automatic addition of trackers With the probable closure of The Pirate Bay (TPB) in the near future the torrent scene will be more decentralized. Especially if the TPB tracker goes down. Luckily there are new upcoming trackers to take its place. The problem is that they are not in many of the torrent files. Besides […]