TextFile Class for PHP
The following class is plays a big part in the framework I use for each of my web sites. It wraps around PHP’s default functions for handling files. It is specifically made to deal with text files. Its main feature is to create separate states for dealing with text files–a file starts out as unopened, can then be opened, closed, and deleted. You can download it here, or click “Read More” for some documentation. Read more
Variable Naming in PHP
PHP is a loosely typed language, meaning any variable can be any type. You could be using your variable as an integer one minute and then declare it as an array the next.
There are long-term repercussions for avoiding to take care of your code. Say you return to a project a year later to fix a bug. You’re not going to have the crystal-clear understanding you had when writing it. You’ll see all these variables and not know what is what until you go and debug your whole script to figure out what to change. Variable naming schemes won’t eliminate this problem, but it’s going to save the first step by identifying what variables are which type.
Twitter Trending Topics History
I became really curious about the trending topics feature on Twitter. It would be very useful to actually record which trends make it to the top 10 list, and for how long they stay in that list. So I decided to find out. I wrote a script that records what the top 10 trends are each minute, noting when a topic falls off the list and when new topics emerge. The results are pretty interesting.
Backing up Data
I reformatted my computer last night and started thinking about the setup I have for backing up my data. It’s not a new phrase by any means, but I’ll still say it: backing up your data is the most important thing in computing. Before I get into it, I should mention that this post is going to be geared onto a personal level. I don’t expect to provide a backup solution on any professional scale.
Strategy for Heads-up Deep No Blind Increases Sit & Gos
Today I decided to play in a quick heads up SNG on PokerStars. Well, I wasn’t exactly paying attention to all of the details when I made my selection. I accidentally registered for a 200 BB deep game where the blinds do not increase. My brother had talked about his experience playing one of these. He said something to the effect of “I went all in 46 times before the other guy finally called.” I suspect my brother was exaggerating, but his quote does describe a certain type of play style that I think is really effective for this type of game: super tight with the purpose of “time-tilting” your opponent. In other words, boring your opponent to death.
