Categories
Uncategorized

LaTeX to Word – LaTeX

Here is how to change a .tex file to .html (and then ultimately .doc). Installing latex2html Only one way really. Using latex2html Just a very quick and easy line here… A few things. First, for the bibliography to work, the .tex file has to be compiled, so you get all the other things there, like […]

Categories
Uncategorized

CSV to Tex Table – Python

This is a very simple and basic script that will change a CSV file to a tex table. It is so simple that it may not be able to handle complex text…and may actually have many bugs…but still useful. Example The sample.csv looks like this So we cd to the directory where the sample.csv file […]

Categories
Uncategorized

Meanwhile, in the most beautiful city the world has ever known.

@BanuAkdenizli @TurkzZ

Categories
Uncategorized

Names to MySQL db – Python

I have a very long list of files that are named like this…. [manufacturer]_[device].txt So this small script will take the names and put them on a database.

Categories
Uncategorized

Errors and Exceptions – Python

Making the timeout error in urllib2 look a bit nicer. The error Sometimes when you’re trying to open a url and the connection is crap, it will fail to connect and Python will spit out a timeout error message…which looks a bit like this. Using try: and except: A nice way of removing this horrible […]

Categories
Uncategorized

Towards new network graph visualisation – Python

Without much explanation, this is something which will help me work on a new layout algorithm to display my network graphs… This is how you initiate the process of drawing the nodes and the edges, all I need to do next is figure out a way of calculating the coordinates for each based on a […]

Categories
Uncategorized

Key words in directory – Python

This script will read all the text files in a directory and output a list of all the words and how many times they apear.

Categories
Uncategorized

Substituting words with lists and dictionaries – Python

So we have the following string Except that it does not paint a good picture of Brighton, and The Man doesn’t like it. There are two things that we can do. We can substitute all the negative words with the same item using a list, or we can swap the negative words with nicer ones […]

Categories
Uncategorized

Goodbye :*(

Categories
Uncategorized

Sorting Lists for Lorenz Curve – Python

EDIT: This does not really work. Needs lots and lots of fixes. Use R instead. This function will take a list of 100+ numbers, divide them into percentiles, and return a list that can be used to plot a Lorenz Curve. The Function Running the Function First, we make a list full of integers. This […]