There’s an app for that

I find that I’m increasingly disturbed each time I log in to Facebook. It’s not that I don’t like keeping in touch with my friends, because I do, but because the veneer of staying up to date slips with each update that I read. Tragically enough, I find myself missing the days when my closest group of friends kept up to date with LiveJournal because our audience was just us and many posts were more involved meditations on the things that we were actually feeling and living through. Day by day, I see a picture of a latte or scotch, a self-shot in the ‘permanent Zellweger’ style, or a trite endorsement of a plastic non-entity who can’t possibly embody anyone’s actual political affiliations, corporate ‘persons’ notwithstanding. Every outburst embodies the trivial and surface level, and what masquerades as critical thinking is reactionary or rote repetition. Then again, if you want up to the minute information, you’ll get what anyone is thinking at that particular minute.
I can’t take the popular online social sphere seriously anymore because as assertion of what you believe isn’t just rare on something like Facebook or Twitter – it’s impossible. Skimming a feed is not deep reading and there is a lack of nuance in 140 characters. I have little understanding of why we say the things we do, only an understanding of why I speak so seldomly: because if I took the time to say what I feel, we’d both miss out on George Takei’s tweets or some other dreadfully important business.

Remove compiled files from directory

I’m running through a bunch of examples and exercises in C++ Primer Plus and I needed a way to remove my compiled scripts from my folder. Attached is a python script which will recursively remove all compiled files from a folder tree.

import os

count = 0;

for (path, dirs, files) in os.walk(os.getcwd()):
	for file in files:
		#check for the presence of a '.'
		if file.find(".") == -1: #character not found
			print "{}/{} was removed".format(path, file);
			os.remove(path+"/"+file)
			count += 1;

print "Done. {} files removed".format(count)

I’m storing all my exercises and examples in a git repository. From what I’ve read, cleaning house with this script and doing an extra commit is easier than hosing everything without an extension using .gitignore.

Add on delete cascade to foreign key mysql

Here’s a quick process for adding ON DELETE CASCADE to your foreign key constraints in mySQL. You will need to drop the foreign key constraint and re-institute it.

  1. use SHOW CREATE TABLE [table_name];, where table_name is your table
  2. identify the name of the foreign key(s). They usually end with _ibfk_ plus a number
  3. Drop the foreign key constraint using ALTER TABLE [table_name] DROP FOREIGN KEY [foreign key];
  4. Re-create the foreign key constraint ALTER TABLE [table_name] ADD CONSTRAINT [foreign key name from above] FOREIGN KEY (`[column_name]`) REFERENCES `[other_table]` (`[column_name]`)
    ON DELETE CASCADE;

And for those in a real hurry:

SHOW CREATE TABLE [table_name]

ALTER TABLE [table_name] DROP FOREIGN KEY [foreign key];

ALTER TABLE [table_name]
ADD CONSTRAINT [foreign key name from above]
FOREIGN KEY (`[column_name]`) REFERENCES `[other_table]` (`[column_name]`)
ON DELETE CASCADE;

Job Hunters Episode 1

Funny story – I was approached to be in this web series because the actor who was slated to play Phil quit. As it turns out, my friends needed someone to play a total jerk and “everyone thought of me.” Brilliant.

Facebook Status Visibility

Before it become apparent that google+ was a veritable ghost town, I thought that the concept of circles was a pretty neat idea. Rather than take the Facebook approach and make your post visible to everyone, you were encouraged to kind of whitelist your post to relevant circles (though you could still scream out into the wilderness if you wanted).

Recently, I became curious if the same feature was available on Facebook and, wouldn’t you know it, it totally is. Anytime you post something there is a drop down list that says ‘public’ by default. From here you can narrow the scope of how visible your posts are. The real power of this feature is the ‘custom’ option paired with the way facebook encourages you to organize your friends into different lists, which you have the option to do anytime you view a friend’s profile. Once you have your list organized the way you want it, you can post exclusively to that group, or exclusively exclude them.