Archive for October, 2009

2009
25
Oct
Category: Self
Tags: , ,

The ending of the story:
I threw a golf ball through someones living room window and broke it.

How it happened:
Golf BallEvery other weekend I take my dog for a 3 mile walk. He’s a small dog (12 pounds) so three miles is a long way for him. He had already pooped. I was carrying the poop bag with me in fact because I couldn’t find a trash can. About two and a half miles into the walk we come up to a house that has two small rocks stacked on top of each other and painted white. It had recently been painted because there was still white paint on the grass around the rocks. My dog has never seen that before so he is sneaking up on it and leaning in to see if it is a threat to him. He isn’t lifting his leg up to pee on it (two and a half miles in the walk, even if he lifts his leg up, nothing is coming out). He’s just sniffing it to see what it is. The owner of the house walks out the front door with a bucket in his hand. I don’t know what is in the bucket. I guess I assumed it’s something for his lawn. He yells, “Get off my lawn!” I start walking off. My dog is still sniffing it. I’m not jerking on the leash because he didn’t do anything wrong. So I’m lightly tugging on it. The guy yelled again, “I said, get off my lawn!!” And he reached into his bucket, pulled out a golf ball, and threw it at me. It went a little wild. It flew about 5 feet away from me. “What the hell?” I yelled at him. “Get off my lawn!” And he reached into his bucket and threw another gold ball at us. This one landed about 10 feet in front of us and rolled to a stop. “What the hell is your problem? All he is doing is sniffing the damn rocks!” Once again he yells, “Just get off my lawn!” And he throws another golf ball us us. This one lands about 2 feet in front of my dog, bounces up, and hits him. He yelps. Now I’m pissed. I picked up the second golf ball that landed short of us and threw it at him. If he was standing about three feet left of where he was, it would have hit him square in the chest. Instead, it sailed past him and went threw his living room window. He yelled, “You’re going to pay for that!” I said, “No I’m not.” And I walked off. I didn’t run. I didn’t walk off at a hurried pace. I walked off at a pace like I was taking my dog for a walk. He yelled, “Get back here!” a couple times but I didn’t respond.

If he wasn’t being such a jerk and waited an extra second or two his window wouldn’t have gotten broken. Maybe next time he decides to be a jerk he’ll remember that.

The next time I take my dog on a three mile walk I fully intend of taking him the same route.

2009
20
Oct
Category: CodeIgniter, PHP

I was playing with CodeIgniter routing at work. I wanted to have a catch-all route but I needed to exclude a certain controller, or controllers, from that catch-all route. As an example, I wanted to have http://www.example.com/(ANYTHING) route to the “page” controller. http://www.example.com/policies/shipping would route to the “policies” controller and then to the “ship” method. From there the “page” controller would split up all of the segments.

I started out with this:

$route['policies/shipping'] = "policies/ship";
$route['(:any)'] = "page";

The “policies/ship” route would be caught by the “policies” controller and everything else would be caught by the “page” controller. Except the “page” controller was getting everything.

I needed to exclude certain controllers from the catch-all route. After a Google search, I came up with nothing. So I started working on it myself. Here is what I cam up with:

$route['policies/shipping'] = "policies/ship";
$route['^(?!policies|controllerA|controllerB)\S*'] = "page";

So far it seems to work perfectly. Hopefully this helps someone else out.

2009
18
Oct
Category: Mac, Misc
Tags: , ,

Logitech MX 620 Cordless Laser MouseI was having problems with my mouse. I have a Logitech MX 620 Cordless Laser Mouse on my home Mac OS X 10.6.1 Snow Leopard MacBook Pro that was upgraded from Leopard.

Many times, when I single left click, it decides to double click instead. The double click happens instantly like it sees my single click as a double click. This double click doesn’t happen all of the time. I checked all of the preferences and even deleted all Logitech preference files from the /Users/USERNAME/Library/Preference/ folder that started with “com.Logitech” and that didn’t help. So far the only thing that seemed to help was replacing the batteries. I’m still having the problem but not to the extent that I was before.

I did a quick Google search and it turns out I’m not the only one havinng this problem. There was something posted to the Logitech Forums which just says they are having a problem. No resolutions so far. There is also a lengthy discussion on MacRumors which has shown that Leopard is not having this issue, only Snow Leopard. It also ruled out users who upgrade from Leopard to Snow Leopard. It also ruled out, then ruled back in, a Logitech driver issue.

So far, like I said, changing the batteries seems to work. I don’t know what the batteries have to do with the single vs. double click though. Sounds like a driver issue though. If it is an Apple issue, hopefully the 10.6.2 build will fix this. If it is a Logitech issue, I have my Logitech Control Center set to automatically update so now it is just a waiting game.

[Update 10/19/2009 @7:24 PST] Changing the batteries didn’t help for very long. It worked for maybe a day then went back to double clicking everything. I’ve been using my Mighty Mouse and it’s been working like a champ. So it looks like it is a Logitech driver issue.

2009
15
Oct
Category: Mac
Tags: ,

When I upgraded my Mac from Leopard to Snow Leopard, the only thing that really changed for me was I had to updated a couple pieces of software or wait about a week for the software to be updated. There were two things that could not be updated. The first was a plugin called NuFile that I used to create new files and SCPlugin that I used for subversion. Both used the context (right click) menu. Unfortunately, Snow Leopard changed the way that context menus are done. Apple now wants software developer to use the services menu instead. So for now, both are dead in Snow Leopard.

To get around the NuFile problem of creating a new file, I am using QuickSilver to open the application and then save the file wherever I want it. Or saving the file to the desktop and dragging it into the folder where I want it. Not as quick as the context menu but it gets the job done.

As far as SCPlugin is concerned, I needed a subversion app right away. So I started downloading a bunch of them to see which one I liked the best. A lot of them didn’t run on Snow Leopard. The ones that did, they were too complicated and it annoyed me or they didn’t notify me if there was an update. Which is important to me. I don’t want to check for an update manually. I wanted the app to check for an update and then left me update it if and when I wanted. I liked svnX up until I wanted to add a folder with 4 levels of subfolders in it and one file inside of the last folder. I ended up having to add the folders one by one. So I dropped that right after that experience. Plus it was difficult to get to work with repositories that required a username and password. You would have to go to Terminal to accept the certificate.

Then I landed on Versions which everyone thinks is the greatest subversion app for the Mac. I tried it out. It was good. Much better than all of the other subversion applications I had tried previously.

CornerstoneThen I found Cornersone. It did everything Versions did, but it did it better and quicker. It has a very nice inline content viewer as well. It also felt smoother and more stable to me. It also plays nice with repositories that require you to log in with a username and password and also saves the information in the keychain. Both are about the same price (Cornerstone is only $1 cheaper). Now that I have Cornerstone and see its power, I don’t even see myself going back to SCPlugin even if/when they update to work with Snow Leopard.

2009
13
Oct
Category: Mac, PHP

I am using MAMP for local PHP development. It’s alright. It has a tendency to not want to cooperate sometimes. Like this morning. I loaded up MAMP and Apache started just fine but MySQL didn’t want to do anything.

If you are getting an error similar to “Error: Could not connect to MySQL server!”, rather than having to reinstall MAMP (which sometimes doesn’t work), here’s a fix:

  1. Quit MAMP
  2. Open Terminal (Applications/Utilities/Terminal.app)
  3. Type “killall -9 mysqld” (without the quotes)
  4. Start MAMP

It should be working now. If not, you may have to sudo the command (“sudo killall -9 mysqld”)

Another option is to go to Appliacations/MAMP/db/mysql/ and delete anything is is NOT a folder. I didn’t have to use this option so I can’t vouch for it myself. According to forum postings it works though.