FamousPhil.com -- Home My Calendar Youtube LinkedIn Facebook MySpace Twitter RSS Blog Feed

Blog Navigation

Partners

Latest Activity

MySQL Singleton Classes in PHP and Python

Phil gives the source code for implementing a MySQL singleton class in both PHP and Python.



Posted on: December 31st, 2011 by Famous Phil

It’s now time for the third(?) annual best/worst moments that I’ve made note of over the past year of my life.  Unlike previous years where I threw things together at the last minute, this year, some (limited) advanced planning was made for this blog.  Hopefully in future years, additional planning will make this traditional post actually worth reading.  For this year, nonetheless, you’re going to have to suffer with the traditional thrown together at the last minute effect… :P

This year started like many others that I’ve had, a new season of learning (at college) and a bunch of side projects that never seemed to take off the ground where they were conceived.  As the year progressed, I started looking into my future and applied to several top technology companies, got several callbacks, and turned down several offers.  I finally found an offer that I could live with in New York City in July and I quickly relocated, but not before I got my two college degrees in Computer Science (both an MS, and a BS).  If there is one major thing I learned about the job market, Computer Science is a very valuable degree to have, but you still have to be persistent to land the job that you want!

Over the past year in my current job, I’ve been working on two major projects, one which is a social clothing site, www.wearingsocial.com which was finished back in August with about 2 weeks of effort.  The other more potent project is www.unroll.me, which is currently in a limited beta testing stage, it has gotten press on life hacker among other sites.  Unroll.me is an email scanning engine that finds subscriptions in your email inbox and automatically clicks the unsubscribe link (or numerous other methods that can be used to unsubscribe).  At this point in time, as its primary algorithm developer, I’d say that it is very accurate(90%+) in detecting unsubscribe emails and links, and it is fairly good (70%+) at actually unsubscribing from those emails.  For the abilities of computers, and how many exceptions that I’ve written into the application, I’m personally very impressed at its abilities to find and unsubscribe from those nasty subscription emails!  Of course, this application is constantly being improved by myself and others to ensure that it becomes much better than it currently is!

Now for something that I’ve been very quiet about over the past 6 months: On my own, I’ve been working on a new application that basically wakes me up in the morning.  I find that my view of the outside world isn’t very good in the morning, and I always end up forgetting my umbrella, etc when leaving for work.  So I’ve been developing an application in my spare time that can call my phone (landline, cellphone, etc) and tell me what time it is and give me a quick overview of today’s weather so that I can realize I need to bring an umbrella, dress up, etc.  Once the initial version is released, I will consider adding abilities to connect to an email todo list, calendar, etc and read appointments off, similar to Apple’s Siri for iPhone.  Of course, other ideas will also be welcome to those who want to use this application.  The application is complete functionally, but is still waiting on its design which should be done within the next month, once it’s done; I will be releasing it here on FamousPhil.com and Matthouse.us.  Of course, you can always check the project’s website to see if it is released: http://www.personalwakeup.com.

Finally, unless it is raining after 8pm EST, I will be attending the NYC Times Square New Years celebration with friends.

So with not much more to say, now for my traditional videos highlighting the best/worst YouTube videos of the year 2011!  As always, thanks for reading, and here is to a very good new year!  Welcome to 2012!

Here is a list of memorable videos (unfortunately, embedding is disabled on most videos now so I’ve provided links):

Oh the places you’ll (Actually) go: http://www.youtube.com/watch?v=wIP8lFWa_mg
Rescue Japan: http://www.youtube.com/watch?v=pk7fBLuLj5I&NR=1&feature=fvwp
High School Sucks – The Musical: http://www.youtube.com/watch?v=GWy_uauR-6k&hd=1
Homecoming Rally: http://www.youtube.com/watch?v=_GiaEs8Myfc&hd=1
The Stereotypes Song: http://www.youtube.com/watch?v=wCgx8zM3woQ&feature=relmfu
Gabriel Iglaeseas- Krispy Kreme Doughnuts: http://www.youtube.com/watch?v=a77Dw3tNv8o
Adele – Someone Like You – Piano By Ear: http://www.youtube.com/watch?v=y8b4_kGuj7k&feature=related
I can’t remember if I posted this last year, but I really like it: Stand by Me | Playing for Change – Song around the world: http://www.youtube.com/watch?v=Us-TVg40ExM&feature=relmfu

And who can forget the worst video of the year, it originally had millions of dislikes until it was taken down and moved to another account to soften the dislikes:
Rebecca Black – Friday: http://www.youtube.com/watch?v=kfVsfOSbJY0

Jibjab’s video this year was mediocre, but I’ll post the link anyways: http://www.youtube.com/watch?v=2zls4Ao3GyM

Posted in My Site, Personal
|| No Comments »

Posted on: September 30th, 2011 by Famous Phil

I typically don’t post more personal things on my website, but my college degree is one of the few exceptions that I was considering posting (depending on what information it gives away).  Surprisingly, my degree doesn’t reveal much of anything that you couldn’t find out about me by looking at my resume or just my website’s WHOIS information, so I decided that I’d post a picture of the two sheets of paper that cost oh so much money to buy. A lot of hard work went into these two sheets of paper, so I’m very proud of them and my accomplishments and pain that they represent :) I felt that they deserved their own blog post :) If you’re curious, my major is Computer Science, with a concentration in High Throughput Computing for my Masters.

Tags: , , , , ,
Posted in My Site, Personal, Student Life
|| 1 Comment »

Posted on: June 3rd, 2011 by Famous Phil

There are many reasons why you might be reading this post, but likely, you’re trying to figure out how to install this complex heap of code (that has its root node removed, no doubt, ha ha).  If you didn’t get my last joke, I feel sorry for you, but the show must go on.

Gitorious is an open source repository management system similar to Trac on SVN.  The software looks really nice (gitorious.org), and it has a lot of built in features for managing git repositories.  For those of you who are not familiar with coding, code repositories are often set up to enable many coders to work on the same project simultaneously (different portions of course).  Repositories also enable versioning so that you can easily revert to an older copy of your code base if something breaks along the way.  Repositories are often centralized so that only a single location has to be backed up, in this case Gitorious centralizes git repositories.

Truthfully, there are three memorable software programs that have been notoriously difficult to install and configure in my experience, these are as follows:

  • Shibboleth- I never did successfully install this myself, this was because I was asked to help a friend install it over the phone.  I don’t work well when I can’t see the problem and play with stuff, I test hunches, and doing it with this method would have taken way too long.  From what I’ve seen of Shibboleth, I would rate this as worst of the worst programs to install.
  • Gitorious – This is probably the second worst application I’ve ever installed.  It required a lot of research and resources since it is poorly documented and requires a lot of Ruby Gems to operate successfully.  Of course, I will hopefully document it a little more today!
  • Exchange – I wish I would have documented the install of my Exchange server internally so I could have shared it here.  Exchange isn’t awful to install, but the configuration of Exchange is very tricky and there are many gotchas.  This is why I place it as the best of the worst software programs to install.

With all of the above said, the installation process of gitorious isn’t for the leisure system administrator to install.  This took me approximately 3 days of research to successfully install and understand.  I installed it on a separate system only because I didn’t want it hurting any of my existing production systems.  In the end, I’m glad I did this because I learned that Ruby isn’t very memory efficient and this application easily eats up most of the 1GB of ram allocated to it in a VPS (Virtual Private Server).  And with this said, I invite you to continue reading if you really want to know how to install this software.

Update 6/14: After a few requests, I’ve decided that I will provide a Gitorious installation service on your CentOS server.  I will be happy to install Gitorious and make it work (as described below) for a one time paypal payment of $100.  For details, contact me directly (see my contact page).

LAST UPDATE: 6/8/2011 – Suggestions from Gitorious Discussion Group

Read the rest of this entry »

Tags: , , , , ,
Posted in Hosting / Server Administration, My Site, Programming, Technology
|| 24 Comments »

Posted on: May 26th, 2011 by Famous Phil

On August 30, 2009, I made a blog post about my x10 home automation system, but I didn’t really cover it in depth enough to satisfy myself.  Therefore, I decided to revisit the topic from that blog (which is here).  This blog contains a video detailing the system that I ended up with during my University experience.  I expect that my future home will be much more automated than this video shows.  In order to appreciate the video, I decided to write some content to supplement what I talk about in the video, which is below.

In 2009, I came up with the first version of my light control system.  This consisted of a clapper, a set of cheap computer speakers, and an audio recording of my clapping.  My original system used a web interface to have the speakers (connected to the web server / site) clap when I wanted the lights to come on.  This quickly became unmanageable since I couldn’t monitor the states of the lights without a webcam monitoring my room (and I wasn’t thrilled about securing a webcam in my room that could be hacked into).  This lead into X10 which has done wonders for me over the course of the past two years.

Its funny remembering back to when I first got an x10 system, because the x10 website doesn’t look like your average store, it looks more like an adult site with lots of flashy banners (ha ha).  I do have to admit, with x10, the initial impression was very deceiving for me, since their products are really good!  Anyways, moving on, My x10 system consists of a USB transceiver module (CM15A located here) which connects to my windows server that runs a WAMP (Windows, Apache, MySQL, PHP).  In addition, I have several lamp modules, appliance modules, and remote control wall switches (which wirelessly communicate to the CM15A).

As for the software, I installed the ActiveHome software onto my server (that came with the CM15A).  This software installs a few application libraries (dlls) which enabled programmatic access to the CM15A to send and receive x10 commands over the power lines ran in my apartment.  Using this api, I wrote a quick program that makes a command line based program that can run certain commands.  I have to note that ActiveHome includes a default command line executable, but this didn’t have all the functionality that I wanted, most notably output in HTML for my web interface.  With the executable I wrote, I simply have the apache web server run the command as a local user which sends the x10 signals over the power lines ran in my apartment.  I should note that I considered using ASP.net which could interface with the API directly, but at the time I wasn’t very familiar with ASP.net and I wanted to use PHP.  I didn’t use IIS because I didn’t have the time to go permissions hunting to figure out why PHP wasn’t allowed to run programs as a local user on the web server through IIS.  Luckily a standard WAMP install that included Apache and PHP worked out of the box with little configuration.  The WAMP that I used was Vertrigo.

For the IR receiver that controls my projector, I use a USB-UIRT that I found on Ebay (I didn’t feel like waiting the estimated 6 weeks at the time for a new one).  Fortunately, the executable program that was included could send and receive signals from the USB-UIRT that I required, so I wrote some PHP that invokes it for the commands I used.

In 2009, I mentioned that voice control would make its way into my system.  I have to admit that it did!  Unfortunately, it didn’t last long because of all the bugs that I ran into.  I used the Microsoft speech libraries with a program called SmartButler, which could listen for speech commands and run commands on my server.  I initially used a cheap computer microphone, but quickly found that the interference in the audio made commands very inaccurate, and furthermore, if I held a conversation in the room, my lights would act up!  I figured that a USB professional Condenser Microphone would fix the problem, so I quickly ordered one and integrated it into my system.  This did significantly improve the quality of my system, but normal conversations would still occasionally trigger some of my web control panel controls inaccurately.  The final straw that broke the camel’s back (and caused this system to get removed) was when my RA (resident advisor), Stephanie came into the room, said hello to me and my lights went out of control (since I didn’t train it for a higher pitched, female voice, I’d assume).  I’d like to approach this problem in the future when I get the time to do it properly, but until then, I’ve been satisfied with web control panels that both my smartphone and computer can access.

Finally, at the very end of my video, I took a moment to show my Linksys PAP Adapter (VoIP, Voice over IP).  This works through a service from voip.ms.  Voip.ms is a prepaid service for VoIP adapters that allows you to buy a phone number for a very reasonable price (even 800 numbers).  They also have really reasonable rates and really good control for those phone numbers.  I thought I’d provide a plug for them since they are really good.

I would like to add that the Linksys adapter required an unfirewalled IP address to work properly (for incoming calls) in my experience.  It does have a NAT mode for this situation, but the university firewall constantly crushed this mode.  To get around this problem (and allow my web server for x10 to work properly), I implemented OpenVPN on my network and pulled in several public IP addresses and left them unfirewalled.  This solution worked well for me at UB, and I documented it fairly well in my OpenVPN post.

With nothing more to mention on the topic, here is the video that details my light control system and some other stuff.

Of course, I made many bloopers in this video (I improvised a lot!), so I thought the bloopers video would be appropriate.  Warning, there is a little language in it and the audio isn’t exactly balanced.

Disclaimer: I was not paid to endorse any of the products above (and I’m never paid to do that!).  I like to think that when I make a recommendation, it carries a lot of weight with it, which it should!

Tags: , , , , , , , , , , ,
Posted in Hosting / Server Administration, Mobile Technology, My Site, Personal, Programming, Student Life, Technology
|| 1 Comment »

Posted on: April 5th, 2011 by Famous Phil

This is a video blog continuation of week 3 (see 2 posts ago).  Its the final video in my 4 lecture series.  The site this corresponds to is http://famousphil.com/websp11/

This video covers a lot of demos including how to make a crude content management system work on your site, as well as an introduction to wordpress as a content management system.

Background: I was asked by the IEEE student club at UB (http://wings.buffalo.edu/sa/ieee) to redo my lecture series on developing websites.  I know that my website isn’t the best visually designed website in the world (and I’m actively looking for talent that can help me fix this in exchange for my programming skills), but I do know a lot about how to code websites well.  Anyways, here are the videos from Lecture 4.  There will be a fourth and final lecture next week.  As always, thanks for reading!

Posted in Hosting / Server Administration, My Site, Programming, Student Life, Technology
|| No Comments »

Posted on: March 30th, 2011 by Famous Phil

This is a video blog continuation of week 2 (see the previous post).

Background: I was asked by the IEEE student club at UB (http://wings.buffalo.edu/sa/ieee) to redo my lecture series on developing websites.  I know that my website isn’t the best visually designed website in the world (and I’m actively looking for talent that can help me fix this in exchange for my programming skills), but I do know a lot about how to code websites well.  Anyways, here are the videos from Lecture 3.  There will be a fourth and final lecture next week.  As always, thanks for reading!

Part 1:

Part 2:

Part 3:

Part 4:

 

Tags: , , , , , , , , , , , , , , , , , , , , , , ,
Posted in Hosting / Server Administration, My Site, Programming, Student Life, Technology
|| No Comments »

Posted on: March 23rd, 2011 by Famous Phil

This is a video blog continuation of week 1 (see the previous post).

Background: I was asked by the IEEE student club at UB (http://wings.buffalo.edu/sa/ieee) to redo my lecture series on developing websites.  I know that my website isn’t the best visually designed website in the world (and I’m actively looking for talent that can help me fix this in exchange for my programming skills), but I do know a lot about how to code websites well.  Anyways, here are the videos from Lecture 2.  As always, thanks for reading!

Part 1:

Part 2:

Part 3:

Part 4:

Part 5:

 

Tags: , , , , , , , , , , , , ,
Posted in Hosting / Server Administration, My Site, Programming, Student Life, Technology
|| No Comments »

Posted on: March 10th, 2011 by Famous Phil

It seems like its been a while since I last posted to my blog.  As usual, the mid semester grind is hitting my time hard, so I don’t have the resources to write here as often.  Thankfully this is my last semester as a Masters student, *yay*.   So coming up soon, I will be writing a blog on regular expressions, I’m still in the process of making it, so it might take a while.  I’ve also got a great blog for April fools day, so stay tuned for that!

Now onto the topic of this blog.  This is a video blog (go figure, right?).  Actually, I was asked by the IEEE student club at UB (http://wings.buffalo.edu/sa/ieee) to redo my lecture series on developing websites.  I know that my website isn’t the best visually designed website in the world (and I’m actively looking for talent that can help me fix this in exchange for my programming skills), but I do know a lot about how to code websites well.

Being the kind of person who likes to share knowledge, I agreed to give the lecture series with updated information.  John suggested that I video tape the lectures and post them to my blog, which I thought was a great suggestion.  So in the next 5 to 6 weeks, I will be posting youtube 720p HD recordings of the lecture series to here.  Feel free to watch it and make comments about my presentation skills.  I know that I’m not perfect, so I’m always open to suggestions!

As always, thanks for reading!

Part 1:

Part 2:

Part 3:

Tags: , , , , , , , , , , , , , ,
Posted in Hosting / Server Administration, My Site, Programming, Student Life, Technology
|| No Comments »

Posted on: August 18th, 2010 by Famous Phil

Reminders: As with anything I post, I ask that you provide a backlink to my code if you use it (if you don’t, its considered plagiarism).  Also, the code below is the outcome of 2 days in ASP.net as an excursion, I’m sure that my code could be improved vastly.  I’m also not going to baby step through this, so you’re going to have to be a somewhat experienced programmer to follow along with the rest of my blog.  One last thing: If you feel the urge to donate to me for my time (provided this solution helped you), please use the NEW donate button in the footer, I appreciate it. Read the rest of this entry »

Tags: , , , , , , , , , ,
Posted in My Site, Programming
|| 26 Comments »

Posted on: August 7th, 2010 by Famous Phil

This is more an update than anything else.  I have finally taken the time to prune some of the comments in the past year on FamousPhil.  In the future, I will be only approving links that either are track backs or contain non SEO titles.  I have never minded allowing comments, but the spam volume that I’ve begun seeing is just too unreasonable to continue handling without changing my policies. In the past, I’ve approved comments that contain text that pertains to the post, but I just can’t continue on that course :)

In the next week or so, I will also be disabling user registrations, along with pruning the user database (except to the guest posters who were asked to make an account).  That too has gotten out of hand!

As always, if you want to make a guest post and get a real link back with seo key words, feel free to contact me :)   I generally don’t mind the content as long as it has something useful in it that won’t harm my readers.

Tags: ,
Posted in My Site
|| No Comments »