Hi! Thanks for visiting my blog. If you've received any value from my content would you mind supporting my new startup by downloading our browser add-on? It's called PriceBlink and makes online shopping a breeze. You can watch it in action here and download it for Chrome, Firefox, IE, or Safari by going to PriceBlink.com. Thank you and I hope you enjoy!

FFmpeg mjpeg Argument

Jan 26

I recently posted about extracting jpeg frames from video files. I received an email from a reader who was having problems with the singlejpeg argument. It turns out that the latest version of FFmpeg doesn’t support this argument, which has now been replaced by mjpeg. I haven’t had the opportunity to upgrade, but if you run into problems be sure to give this a try.

Read More

Ruby on Rails Table Names

Jan 23

Ruby on Rails does something fairly intelligent that I’ve found to come in handy. Let’s say that you have a model named “Dog”, this will map to a table named “dogs”. It’s even smart enough to know that the plural form of “company” is not “companys”, but “companies”. I’ve generally accepted this default behavior and it’s helped me remain consistent when developing applications.

Yet I recently ran into a problem with a table I wanted to name “history” and not “histories”. It just didn’t seem to fit so I learned that the default table name can be easily overridden in the controller. You can simply use the following statement in your class:

class History < ActiveRecord::Base
set_table_name “history”
end

and you’re done! It doesn’t get any easier than that and now I can feel much better about my table naming conventions. For more information check out page 200 in Agile Development with Rails.

Read More

Ruby on Rails File Upload

Jan 18

I’ve been experimenting a good bit with Ruby on Rails’ file upload capabilities. Overall I’ve been very impressed with the ease of use when it comes to uploading a file and writing it to disk. Of course anything is easy once you know how. Ruby’s syntax is very different than what you’re probably used to. While I’m by no means an expert on the subject I would definitely recommend the following books:

Programming Ruby: The Pragmatic Programmers’ Guide
Agile Web Development with Rails

After digging up the necessary code I was able to experiment with ROR’s file upload capabilities. My method called create was attached to my controller and looked like:

def create
File.open(“/Users/db/_dev/rails/videos/swing.mov”, “w”){|f|f.write(@params["video"].read)}
end

With that one line of code the file was written to disk….not too shabby. It’s right up there with ColdFusion’s CFFILE which has a much cleaner tag-based approach. At any rate, using this method allowed me to upload all sorts of photos and videos with ease.

I then proceeded to strain the server a little bit. When I say server ROR is running locally on my Powerbook. I grabbed a 175MB video file and put it to the test. The upload took almost 5 minutes to complete and during this time the output of top displayed ROR’s CPU utilization at about 80%. Pretty heavy lifting, but the upload competed successfully and I was able to view the uploaded file without any hiccups.

Read More

WordPress Minimizes Blog Spam

Jan 16

I really don’t understand blog spam. For that matter I don’t really understand spam. I know what it means, but I can’t seem to believe that it’s the least bit effective. Maybe I’m not the ideal spam recipient, but I’ve never talked to anyone that’s fallen into a spam scam.

A major problem I dealt with in the past was having my blog comments fill up with link spam. It got so out of control it was ridiculous. There were times I had to delete over 100 comments a day because I left them completely open. Actually, with the version of MovableType I was using there wasn’t a way to moderate the comments.

Lately I’ve been impressed with WordPress and the amount of functionality you get out-of-the-box. The biggest time saver has been the comment moderation. I’ve been getting a few spam posts recently and WP has helped me purge them. When a comment is posted I receive an email with a link to approve or disapprove the comment. This links me to the admin where I can do bulk operations and purge all invalid comments from the system. You can see a screen below with the links blurred out. This is just one of the many features that I’ve begun to enjoy with WP.

Read More

SensorLogic Funding Hoax

Jan 16

I recently posted about SensorLogic receiving another round of funding.  I was led to believe this from the following Dallas BizJournal article:

http://www.bizjournals.com/dallas/stories/2006/01/09/story6.html

It turns out that the article is completely inaccurate and that the initial round was completed at $11 million.  Thanks to Ray for clearing that up.

Read More