Categories
Uncategorized

Three years ago today.

Categories
Uncategorized

Activity in CyanogenMod’s IRC

One of the problems of IRCs, as well as other forms of synchronous forms of communications, is that you can sometimes log into an empty room and find yourself a very lonely individual. After monitoring CyanogenMod’s IRC for a few weeks, I’ve figured out which days are and which times see the most activity. First, […]

Categories
Uncategorized

Latex to Word via HTML using Vim

One of the best ways to convert a Latex file to a word document is to first convert it to html using latex2html and then open the html file using word. Although there are other programs (such as latex2rtf) that can do the same job, I find that latex2html is slightly better at keeping most […]

Categories
Uncategorized

Checking out a Sub-Reddit’s Front Page – Python

This code uses Reddit’s own API, praw, to download all the post titles, karma counts, position, and reddit id of each post within a sub reddit. This example collects all the info from the top 100 posts in r/technology at on hour intervals and then saves it to a file.

Categories
Uncategorized

Simple File Lists – python

How to make quick directory lists in python. All of these will use listdir in the os module. so we need to import it first Now we want to list all the files in a directory called my_folder. But the trick is that we only want the text files. Another thing we can do is […]

Categories
Uncategorized

Using Regex in MySQL

Very simple really That’s it.

Categories
Uncategorized

MySQL Node Matrix – Python

This will create either a directed or an undirected matrix on a MySQL data base. The edges are written as tuples, like this Where the first item in the tuple is the from node, the second item is the to node, and the third item is the weight of the edge. Here is the code […]

Categories
Uncategorized

Using regex search and grouping – Python

For some silly reason we have a string with the following information We can use the regular expressions module to find and group the relevant information…just like this. That should output The regex broken down This gives us the name This gives us the telephone number Finally, this will give us the id

Categories
Uncategorized

Formatting Integers – Python

We have a range from 1 to 100 and we want to format the integers so that they look nice. Something like this so first we create the range which should result in something like this The actual formatting code is quite simple, this But to apply it to a list, we can do this […]

Categories
data science

Plotting an equation – R

This is how you plot an equation in R. The equation we are going to plot is a simple one. y = x– 1 The first thing we do is set the value for x by creating a sequence from 0 to 1 at 0.01 intervals Now we can get the y values so if […]