Every time I start CakePHP project, I find that I’ve forgotten how to set up the user auth system of logins, creating accounts, etc. There seems to be only a few examples of it on the internet, so I thought I’d post up my solution. It uses the Auth component and follows normal user creation convention. By “normal user creation convention,” I mean that you require an email address that’s used as the login name, a password field, a confirm-password field, and checks to make sure the passwords match. Read the rest of this entry »

There’s some exciting news in the adblocking/Chrome world!

Over the past year, I’ve been using Adsweep for my ad blocking needs. Adsweep actually worked really well, but the only problem was that its ad definitions weren’t very comprehensive (false positives every now and then). I was disappointed when I went to the site and found that the owner decided to stop maintaining the project. Which means no new ad definitions. But I just went back to the site and was excited to find that somebody else has taken over and it is now being maintained. Woot! So I installed the latest (2.0.1) but it didn’t seem to work at all. So for right now if you decide to use it, grab the legacy version (1.6.18.8). It works pretty well most of the time.

In other news, there is now an Adblock+ extension! It has many similarities to the original Firefox Adblock+ plugin. Most notable of which is the ability to subscribe to ad block lists (so your ad definitions are always current). I installed it and it appeared to work (put an icon in my browser, successfully allowed me to subscribe to ad definitions). But some of my ads weren’t being blocked. It looks like they just released about a month ago so I’ll wait patiently for them to work out the kinks.

Well, I’ve been using the Colemak keyboard layout for 2.5 weeks now. Colemak is a keyboard layout alternative (as opposed to qwerty). Here’s what it looks like:Colemak layout

As you may know, the keys on qwerty keyboards are the way they are for historical reasons–on typewriters, qwerty keyboards minimized the amount of jamming that occurred with the heads. But since computers don’t have the same limitation, the qwerty layout is impractical. Alternative layouts like Dvorak and Colemak seek to minimize the work required to move your fingers. The benefits of this are increased typing speed and decreased risk of things like Carpal Tunnel Syndrome. Dvorak seems to be the most popular. So why did I choose Colemak? Mostly because it doesn’t move the z, x, c, and v keys, which are the keys you use for undo, cut, copy, and paste. That would have driven me crazy.

When I decided to change, I decided that I wouldn’t wimp out by toggling back to qwerty. That’s key to picking it up fast. I had some helpful encouragement from friends via Facebook (Thanks Jay, Moriah, and Donald!). At times it was really tough to be IMing somebody and not be able to articulate what I want to say. “What do you think of [insert topic]?” Me: “good”.

So where has this gotten me? After one week of nonstop usage, I had all the keys memorized. And now after 2.5 weeks, I feel pretty comfortable. I never had wrist and finger problems before, but now that I’m using Colemak, my fingers feel a lot more relaxed. I just took a typing test and got 41 WPM with 100% accuracy (my best on qwerty was 60 WPM). I know, that’s not better than my qwerty speed, but I think I’ll get there after being on it for another week. Would I recommend it? Yes!

All too often people ask me questions that are just as easily looked up on Google. Things like “How do I burn a CD?” or “What does HTML stand for?” Sometimes I use lmgtfy.com (short for letmegooglethatforyou) to show them how easy it could have been to just Goggle it. But it takes too much work to go to the website, do the search, then copy and paste the URL.

Luckily Kim Stebel created a Pidgin plugin to make the process easier and he’s gracious enough to share it. It’s called STFW. I was eager to install it and try it out, but there were no binaries compiled for Windows (yes, I use Windows). So I decided to compile them myself. I’ve never compiled any open source software before so I wasn’t sure what to expect. Luckily, the Pidgin website had plenty of help. All you have to do is follow the tutorial for building Pidgin and then follow the instructions for compiling Windows plugins.

If you want to grab the plugin without compiling it yourself, you can just download it here. After you download it, move it to the “plugins” directory of your Pidgin install, restart Pidgin, then enable it in the “plugins” menu. To use it in conversation, just say /lmgtfy stuff to search for and when you send the message, it will convert it to the necessary link. It’s as easy as that!

I finally got around to configuring Google Reader for all the tech/programming/personal blogs that I read. It was a little scary, but I’m glad I finally made the move. It’s already saving me a lot of time. I fired up Facebook to grab a lot of my friends’ blog addresses. It very tedious but I finally managed to get through all 613 friends. In addition, I added several of the tech websites I visit often, but I just did that from memory.

While I was adding all the feeds, I made a couple interesting observations. Firstly, the majority of the feeds I added were hosted by Blogspot. I had no idea so many people used Blogspot. Next I noticed that all the tech and startup blogs I added were using the WordPress platform. And practically none of the non-tech blogs were using WordPress…interesting…

I spent this entire week in court on a jury panel. It was my first time serving in a jury and I really enjoyed it. The whole process has really convinced me [more than before] of the fairness of our system.

For our case, they brought in about 40 potential jurors and had us introduce ourselves. After telling us the type of case it would be, the judge asked a bunch of questions like if we’ve been on a jury before and if we have any special circumstances that would make it hard to serve on a jury. Some time later, the judge released people who were clearly biased or legitimately could not be there. I think that process was very fair to those who had special circumstances.

Following that, the lawyers asked us a bunch of questions, sometimes picking on people to answer. After that was done, the lawyers had seven chances each to remove jurors from the panel that they felt would be unfairly biased, non-objective, emotional, or otherwise not helpful to the case. This is actually a really good system because the jurors that remain on the panel tend to be the most objective and fair. There were 12 remaining jurors with an alternate in case of emergency.

We listened to the case. The victim didn’t testify, but a first-hand witness did. What he said would end up causing us lot of discussion during deliberations.

We spent all day Friday deliberating (9am-3pm). We found out later that this was a long time for this sort of case. When we started, we took a poll of where everybody stood on the issue and we were pretty much evenly divided between guilty and not guilty.

I thought it was interesting that at the beginning, the three jurors who were most certain that the defendant was guilty were the oldest (in the 40’s and 50’s) and that the three jurors who were convinced that there was enough doubt to judge not guilty were the youngest in the room (20-25 years old). In the end, we unanimously decided that the defendant was guilty. It would be interesting to me to find out why the initial opinions were like that, whether it’s that the older people were wiser, opinionated on the issue, influenced by generational views, or something else.

I was happy with the jurors that were on the panel–they were all very rational, logical, and open-minded. Each juror was very fair and seemed to truly want to make the most correct decision. Which was only possible because of the way our court system is set up.

Anyways, we spent a long time debating the credibility of witnesses and their statements and how much weight each piece of evidence has. Like I said, we reached a guilty verdict. I feel that each juror is convinced beyond any reasonable doubt that he is guilty.

After the trial was over, we had the chance to talk with and ask questions of the judge and the lawyers. They were all very eager to talk with us and explain why they did certain things and chose to keep or remove particular jurors. Now I know exactly what to say and do to be excused from jury duty. But I’m not going to list them here–I think ethically, you shouldn’t do anything just to escape your responsibility as a US citizen. Besides, I’m sure you could easily just Google it.

I’ve gained a lot of insights from this whole experience. I’m now more confident in the justice of our legal system. I’m also happy that there are such good people who want the most fair judgments.

It was my birthday this week and I got a coupon in my email from Red Robin for a free burger. Since I never lose emails but tend to misplace papers, I kept the coupon in my email until the day that we were supposed to go use it. Half an hour before we were to go out, I fired up my email to print off the coupon and was dismayed to find this:
redrobindisappointment
Apparently I was over my viewing limit.  Yes, I know I should have read the text at the top that says that I can only view the offer twice.  But I have a multi-pass system of sorting through emails since I get hundreds per day.

So we didn’t have a coupon and we didn’t go to Red Robin for dinner.  I know that Red Robin is under no obligation to give birthday coupons.  I was frustrated that their system was designed so poorly and I’d imagine hundreds of other people are experiencing this same issue.  Red Robin probably implemented this to stop coupons from being redeemed multiple times.

Here are the weaknesses in this process:
-People who (like me) load their email several times and will therefore be prevented from legitimately loading the coupon when they need it
-Somebody who actually wants to “beat the system” could easily print the coupon to pdf (on the first viewing) and send that to friends. Or merely print several copies of the coupon.
-It’s not very user-friendly. What about people who aren’t connected to a printer the first time they try to load it and whose printer doesn’t work when they try to print it on the second view?

Update: I emailed customer service about the issue. They responded by resetting the counter and re-emailing the coupon. We used the coupon and had some great hamburgers. Props to Red Robin! If only it didn’t have to be an issue in the first place…

The WebFaction install script for CakePHP (at http://wiki.webfaction.com/wiki/InstallScripts) was a bit outdated so I modified it for CakePHP 1.2.3.8166. Enjoy!

Update: Apparently WordPress wasn’t displaying the code correctly. I’ve saved the file locally so you can install it just by clicking here.

#!/usr/local/bin/python2.5

"""
CakePHP 1.2.3.8166

Notes:
-If CakePHP isn't going to be web accessible at / you'll need to update the following line in ~/webapps/(Application Name)/.htaccess accordingly:

RewriteBase /

"autostart": "not applicable"
"extra info": "leave empty"

"""

import sys
import xmlrpclib

def create(app_name, server, session_id):
app = server.create_app(session_id, app_name, 'static', False, '')

# Download, extract, and organize.
cmd = (
'wget http://cakeforge.org/frs/download.php/717/cake_1.2.3.8166.tar.gz/donation=complete -O cake_1.2.3.8166.tar.gz > /dev/null 2>&1;'
'tar fxz cake_1.2.3.8166.tar.gz;'
'mv --target-directory=. cake_1.2.3.8166/* cake_1.2.3.8166/.htaccess;'
)
server.system(session_id, cmd)

str = (
'RewriteEngine onn'
'RewriteBase /n'
'RewriteRule ^$ app/webroot/ [L]n'
'RewriteRule (.*) app/webroot/$1 [L]n'
)
server.write_file(session_id, '.htaccess', str)

# Clean Up
server.system(session_id, 'rm -fr cake_1.2.3.8166/ cake_1.2.3.8166.tar.gz index.html')

print app['id']

def delete(app_name, server, session_id):
server.delete_app(session_id, app_name)

if __name__ == '__main__':
action, username, password, machine, app_name, autostart, extra_info = sys.argv[1:]
server = xmlrpclib.Server('https://api.webfaction.com/')
session_id, account = server.login(username, password, machine)

locals()[action](app_name, server, session_id)

A number of weeks ago, I was ecstatic when I found out about the Adsweep plugin for Google Chrome. From the homepage, it looked promising. I installed it and found that it worked pretty okay. It’d get better over time, right? Apparently not.

My biggest problem with the plugin was that there were so many false positives. When I went to do an advanced search on eBay, I found that the Adsweep plugin had removed the search box! I emailed the creator of Adsweep and was surprised that he emailed back saying he added the exception to the plugin. Woot! Impressive!

It happened again to me on another webpage so I went back to the Adsweep website, only to find the notice that the developer was discontinuing work on Adsweep. Sad day! Apparently too many people were asking for exceptions to be programmed into the plugin and not enough people were volunteering their time. I admit, I’m guilty of this. But I didn’t know–I wasn’t subscribed to the list. I’d contribute a bit of my time if there were others that could help get this going again. Any takers?

Have you ever started a document thinking “Man, tons of other people must have done this same document or something similar. I wish there was something I could use as a sample or template”? That’s exactly what I was thinking today. And then I found .docstoc. This website is a huge repository (over 3 million documents!) where tons of people share their professional documents. Anybody can view the documents for free, but if you want to download them you’ll need to create an account (which is free).

To give you a feel for what they have to offer: I was looking for a document to help me lay out Skill Capture’s financial projections. My search for “financial projection” gave me 250 resulting documents. I didn’t even bother looking at any of the documents past the first page because I found several really useful ones right at the top of the search. I downloaded the xls files and was ecstatic to find that they were full-fledged spreadsheets with formulas to calculate lots of things automatically.

I did several other searches for documents on the service and found that each of my searches had an equal abundance of quality results. This is something I’ve wanted for a long time and I’m extremely excited that I found it.

About this blog

I'm Jon Chin. I love technology, food, and learning. I served a mission in the Philippines and loved it. You probably can't type on my keyboard because I don't have qwerty installed--I use Colemak. I'm obsessed with learning about North Korea and abandoned anything.

Photostream