BLOG: Mitch Wilson, Austin TX Web & Multimedia Developer – Austin, TX

14Mar/090

First day SXSW Interactive 2009

I attended three interesting sessions today. The theme for today for creativity. Each session's discussion centered around how to be more creative in what we enable users to experience. Unfortunately, I did not get to attend either of the book readings I wanted that day about beautiful Web design and open source Flash projects. Regardless, I will discuss open source Flash at the end of this post, though, since the book reading presenter was Aral Balkan of osflash.org fame.

The first session was "Everything You Know About Web Design Is Wrong." Dan Willis (Sapient) had some great points that I have been saying for years. Glad to hear it! Web design, by and large, is based on Print design. He believes, though, that we are headed towards a shift where Web designers are moving away from the trappings of print design and towards formulating their own "grammer" of design, just as early filmmakers had to transition away from stage-based theatrics in the 19th century. Watch out for that tree! (If you were in the session, you get this one.)

The next session, "Oooh, That's Clever! (Unnatural Experiments in Web Design)," was also full and great ideas. Paul Annett (Clearleft Ltd) showed us some truly clever examples of anagram logos and easter eggs in design and Web sites. I am inspired to go forth and have fun!

The last session I attended today was "That Doesn't Suck! Inspiring Creativity With Spore" presented by Caryl Shaw (Maxis). What an amazing game. Spore allows users to create their own characters and objects, even planets, that other people can play in Spore. In creating Spore and new features, the team actually follows the principle that a feature should be comprised of the following characteristics: 1/3 play, 1/3 share and 1/3 create (allowing users to create).

So the sessions were great. But I missed meeting Aral Balkan!!! I have been a Flash developer for years now and used his site, osflash.org, so many times I can't even count. So I'll have to say right now, "Aral, thank you for the great site." When I started using FlashDevelop IDE to create purely ActionScript 3 based video players, osflash.org was such a helpful resource.

Filed under: Geek Out No Comments
9Mar/090

MySQL Cheatsheet

My personal MySQL cheatsheet.

MySQL 5

Create table documentation

Example MySQL code:


CREATE TABLE `events` (

  `id` int(11) NOT NULL auto_increment,

  `datetime` datetime default NULL,

  `title` varchar(255) collate latin1_general_ci default NULL,

  `other` varchar(255) collate latin1_general_ci default NULL,

  `body` text collate latin1_general_ci,

  `created_on` datetime default NULL,

  `created_at` datetime default NULL,

  `updated_on` datetime default NULL,

  `updated_at` datetime default NULL,

  `caption` varchar(255) collate latin1_general_ci default NULL,

  `published` tinyint(1) default '0',

  PRIMARY KEY  (`id`)

) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

Backtick

The backtick character ` allows the use of odd characters like spaces in MySQL database, table and column names. It is optional but is good practice.

MySQLDump

On Windows, type the following in a Command window, then enter your MySQL password when prompted:


mysqldump --lock-tables my_database_name -r my_database_dump.txt  -u username -p

Note: Many Windows examples show using the > character in MSDOS like:

mysqldump my_database_name > my_database_dump.txt -u username -p

While this does dump the database, it also converts the MySQL line returns '\n' to Windows line returns '\r\n' in the output saved to the resulting dump.txt file. To preseve the original line breaks, do not use the > character to dump to a text file in MSDOS. Use the MySQL argument -r to specify the output file. If, however, you want to just view the dump (you don't actually plan to import it) then it is helpful to use > on Windows since it will add the Windows line return characters making the file more readable (but not as clean for importing to another MySQL database).

Tip: After dumping your database to a text file, open it from the Command line using:

notepad my_database_dump.txt

Creating a database and importing your MySQL dump

Creating a database is very easy. On the computer you want to host the database, you just login and run a single command. For example, you want a database named wordpress_blog. Assuming your are logged into mysql and that you have the permissions to create new databases, simply type:


create database wordpress_blog;

Next, import your dump into the new wordpress_blog database.

Importing the dump

You will want to logout of mysql in order to run this from the command line itself. Assuming your username is smartypants and you are importing into the wordpress_blog database, type this then your password.


mysql -usmartypants -p wordpress_blog < my_database_dump.txt

Then log back into mysql and type show databases. You will see the new wordpress_blog database in the list of databases.

Next, you need to grant users access to the new database.

MySQL Users and grant permissions

MySQL Account Management


grant all on `databasename`.* to 'username'@'localhost' identified by 'password';

Note: Backtick characters are used around databasename. Single quote characters are used around username and localhost.

Connecting to MySQL with PHP

See my PHP/MySQL article.

Deleting records

<?php
// Connect to MySQL

// Delete Bobby from the "example" MySQL table
mysql_query("DELETE FROM example WHERE age='15'")
or die(mysql_error());
?>

Creating a database


create database nameofdatabase;

Deleting a database


drop database nameofdatabase;
Filed under: Geek Out No Comments
12Dec/081

SVN entries crashing RadRails project

I would rather spend time on rails code than troubleshooting Eclipse issues. I thought I would help you do the same. Recently, I found that I could not start one of my RadRails projects, a really cool new app I'm working on. Troubleshooting the solution taught me a lot, though. I'm a glass is half full kind of guy.

The problem

When I started Eclipse, it would crash within seconds of showing the splash screen. I found that deleting my whole rails project from the workspace allowed Eclipse to start successfully. Not quite the solution I had in mind.

The first attempt

Simple, right? The problem appeared to be the project file. Just delete. Restart Eclipse. Damn. Same problem. Crash. Ok, something more drastic. Delete all the contents of the project. Create a new empty project. Restart Eclipse. Ok, now we're getting somewhere. Eclipse started and I am looking at my workspace with the rails project icon in the Ruby Explorer panel. Now just add my actual rails app files to the spanking new RadRails project. Ok, now right-click on the project folder in Eclipse and select refresh ... CRASH! Damn.

The second attempt

Delete everything and check out from SVN again. CRASH! Damn.

The third attempt

My "divide and conqueor technique." This is patented but I will share. Delete half of the folders in the project. Restart. Crash! Delete the half of what's left. Crash. Delete half of now what's left. Crash! Delete all files and folders from my rails project except for one single folder with a few files. Crash . . . crash . . . crash. Finally, nailed it. Delete the .svn folder. Restart. Success!!! Restore the .svn folder. Restart. Crash, the good kind; the kind that confirms the problem is the .svn folder. Now, take a guess and delete the entries file. Restart and success. Restore the entries file in that single .svn folder. Restart and, yes, crash and confirmed: the problem is the entries file in the .svn folder.

The solution

Delete every .svn folder throughout my rails project. I could delete just the entries file, but I wanted to just wipe the slate clean and start over with all the subversion project files. Since I'm running a Windows machine, I used a DOS command. Oh yeh, I got medieval on this bee-ach. On Linux of Mac, of course, translate to your own command line code.

  1. At the command line, switch to your project directory:
    cd c:\path\to\rails\project
  2. Now recursively delete all .svn folders by typing:
    for /f %D in ('dir/s/b/ad ^| find/i ".svn" ') do if exist "%D" rd/s/q "%D"
  3. Finally, restart Eclipse and recreate your RadRails project by either refreshing the existing project folder or creating a new one.NOTE: If you create a new RadRails project, make sure to un-select generate new rails skeleton, unless you want to overwrite your existing rails files!!!
Filed under: Geek Out 1 Comment
25Oct/080

AIR is finally taking off

AIR is the Adobe runtime for desktop applications. After installing AIR, you can install and run desktop applications built in HTML and JavaScript or Flash, for example. AIR applications use traditional Web client-side technologies to build installed desktop applications.

As a Flash developer for the past few years, I've been waiting for this moment. Funny that it happens just as I moved from Flash development to SAAS development. Enter Yammer, my first truely just-by-chance installed AIR app. Yammer is still small but gaining in popularity. I just installed it, too. Those are not just Yammer installs; they are AIR installs. AIR is finally taking off.

AIR will be one of many technologies further merging the Internet and the desktop. I better find an excuse to make a couple of AIR apps at work!

Filed under: Geek Out No Comments
4Aug/080

Ruby security advisory

Today while setting up a new vps to test a Rails app, I found that Ruby 1.8.6, what I had been using for testing, has a recent security advisory to upgrade to 1.8.7. Thankfully, my app was written in the newest version of Rails, 2.1.0, which is apparently the only version of Rails compatible with Ruby 1.8.7.

On the other hand, this really sucks. I have another app written in Rails 1.2.3 that I've been working on for months. Well, I have been thinking of porting it to Rails 2, anyway. My wife is going to love this news; it's her site, Asian Austin (currently written as a working prototype in PHP, it covers local asian news and events in Austin, TX).

From the chaos that has since insued concerning Rails version relative to Ruby version, many a Webhead's significant other should have their own security advisory: don't explain any of this to them, just say you're spending so much more time at the computer because you're writing a love poem.

Filed under: Geek Out No Comments
19Jul/080

Error installing rails with gem

Finding the exact solution to this problem took an hour of trying others' solutions, like simply deleting the gem and even the entire cache directory, which might work for some but not for me. The final solution was to reinstall the activesupport gem myself. Hopefully, this will help someone else who is having the exact same problem I was having: an error about an invalid format with my activesupport gem. Here's what happened and how I fixed it.

The gem error about activesupport_2.1.0

As I am starting a new rails project, I wanted to go ahead and update to the newest version of rails first. I froze the other app I was working on, then attempted to update rails using gem install rails. This is when I received the dreaded error:

invalid gem format for C:/ruby/lib/ruby/gems/1.8/cache/activesupport-2.1.0.gem

I scoured google results like a madmen, as I am supposed to be starting my new project, not jacking around with some arcane gem issue. I tried gem cleanup, which removed some obsolete gems. I even uninstalled rails altogether, followed by another gem cleanup. I attempted to install rails using gem install rails --include-dependencies again. No go.

The solution of updating activesupport

Finally, I updated the activesupport gem myself using this two-step process:

  1. download the activesupport gem from the activesupport rubyforge project page.
  2. then typing this from the command line where I downloaded the gem: gem install activesupport_2.1.0.gem

And all was fixed. Another run at gem install rails --include-dependencies ran like a champ. Note: I found that the doc installation might appear to hang, but it's just cranking away and will finished after a few minutes.

Filed under: Geek Out No Comments
15Jun/080

Awesome Father’s Day gift

Magnifying glass My poor wife. I'm such a jerk. She got me this awesome magnifying glass for Father's Day, and I turned my nose up at it. Can you believe that? Thankfully I realized a few hours later, while she was napping. And she's pregnant, due tomorrow. The last thing she needs is me giving her grief over magnification power.

She just knew I've been talking about getting a magnifying glass. She was paying attention to my needs. But she did seem to forget that I am geeky about this kind of stuff. I was in the Boy Scouts. I had a compass. I know how to safely start a campfire. I care about things like the magnification power of a magnifying glass. And hers did not make the cut.

But I was wrong. Totally wrong. This magnifying glass is great. Yes, it's only 2x magnification, and I wanted at least 10x. By the way, once I told her that, she dug up a loupe (which is what I really wanted, not a magnifying glass) that she's had all along. That made my day! She went to take a nap. And while she was sleeping ...

I tested out the new magnifying glass and the new-to-me loupe. It turns out that I had a need for both: a 2x lens and a 10x loupe. For example, I can use the magnifying glass to check out the new Yokomo drifting rc car I just got off ebay. The 2x power actually works very well for seeing tiny screws. And it's hand held, unlike the loupe which really needs to be placed on a table. So the hand-held functionality of the magnifying glass is absolutely needed. Now, aside from the functionality, there is the esthetic. This thing looks cool. Beautiful. Elegant. Nicely weighted in the hand. And it has a built-in spot light that came with a battery installed. I've had so much fun with it while she's sleeping. I can't wait for her to wake up so I can thank her. And apologize.

My wife's thoughfulness has opened up a whole new type of gadget for me: magnifying glasses. I need to add to my current collection. I could get one of the head-mounted numbers. And a telescope, which I've wanted forever now. And a microscope, in case I need to do some biology for some reason or other.

14Jun/080

Making Mongrel behave

In Australia, I've read, "Mongrel" is a derogatory epithet. When referring to a person, it means "ill mannered." When referring to Mongrel 1.1.2 on Windows, it means that and more, at least when used in RadRails.

Here's the overview. When generating a new project, neither Mongrel nor WEBrick server would work from the command line. Using RadRails, Mongrel would work, thank goodness. So I always just used Mongrel via RadRails, until I moved my workspace from My Documents to the root of my C drive. I still don't know why Mongrel wasn't working, then was, then wasn't. And I don't know why WEBrick isn't working; that's for another time and another post. I have development to finish. But I do know how I fixed Mongrel.

Short answer: I renamed a Mongrel directory in the Rails gems library from "mongrel-1.1.2-mswin32" to "mongrel-1.1.2-x86-mswin32-60" and then Mongrel worked perfectly!

Long answer: For some reason, the path to Mongrel was wrong whenever you issued the server command. Now, keep in mind, I'm issuing the command from within my rails project. So all should have been fine. I was doing exactly what I was supposed to do on Windows: typing "ruby script/server mongrel" from the command line, or I was starting the server from RadRails using the Servers panel. But the path Rails was using to find the gem was wrong. I'm sure the better solution might have been to correct Rails, but in the interest of getting on with my project, I chose to simply create the path that Rails was using. A hack, on yeh. I don't prefer hacks but time is of the essence in this particular case (a new website for my wife's business)!

So ... if you're getting this error like this little beauty:

Exitingc:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32-60/lib/mongrel/init.rb (MissingSourceFile)

Then here is the fix, step by step:

  1. I located the file the error stated was missing.
  2. I noticed that the file was there, but that the path was simply off by one folder.
  3. I renamed "mongrel-1.1.2-mswin32" to "mongrel-1.1.2-x86-mswin32-60".
Filed under: Geek Out No Comments
23May/080

Stuff I want, will you buy it for me?

[youtube:http://youtube.com/watch?v=olIjlQcSuZ8&feature=related]

I know you just wondering what to buy me for Christmas and you want to get started now in May. So here goes. Top of my list is a 1:10 scale rc drifter. Just check out the video above and buy me any of those cars. A friend recommends something from either Tamiya or Yokomo, two Japanese companies. Japanese stuff is cool, but I'd rather buy American. So look at HPI, Associated and Losi first. Do some comparisons and get me the best car, because I still don't know which to go with. They're kind of expensive, like a couple of hundred dollars. My ebay watchlist is full of stuff that I can't afford at the moment. So if you could buy an rc drift car for me, that would be great.

Mini Mauler Monster TruckClimbing next onto your shopping list, of course, the Mini Monster truck (imagine a background Metallica track and a small truck crushing other small toys). The Kyosho MiniZ Monster Truck (1:28 scale) demands a high price of $150, but you have other stuff to buy me as well, so, as an alternative, I'm really keen on the Mini Mauler Monster Truck by HobbyZone. It's actually larger at 1:20 scale and cheaper at a mere $69 dollars. You can afford that, for me. Come on, that's less than half the price of the MiniZ Monster Truck. I would forgive you.

Supermaket issue one cover Now, for the art lovers, I know you must appreciate comic book art. So the final items, for this particular wish list, are some prints from Kristian Donaldson, one of my favorite artists. I prefer the Supermarket series. The cover issue one is pictured here, but my fav cover is actually issue two. Thanks!

Filed under: Geek Out No Comments
21May/080

RC collection, so far

RC collection, including three helicopters and two cars

"Hey, these are just tiny, crappy toys!," you exclaim. Well, not exactly. They are toys. They are tiny. (These are all lined up on my desk in front of my keyboard.) And they're cheap and most importantly, fun! My RC collection, so far, includes three helicopters and two cars. All run on simple AA batteries. As a kid, I always wanted rc vehicles but they were too expensive and complicated. As an adult, these things are totally affordable and a breeze to setup and operate. Like a delicious fast food meal, a quick break playing with these micro rc vehicles takes the edge off my daily grind at work. Yes, play with them at work, but be contientious of co-workers. These gizmos sound like micro weed eaters on full throttle, esp. the helicopters. How did I get into this, anyway?

Thanks, James, wherever you are. You know who you are. You had that PiccoZ heli in your cube over in IT when I came to meet about the flash media server. You didn't even fly it; just my seeing it was enough. But anway, it all started with a micro helicopter and visions of cheap fun. Now I have three micro PicooZ helis and two Zipzaps cars. And a recently acquired Special Edition Muscle Car Power Upgrade Kit, including several motors, gears, tires, and wheels. Fun.

The Micro Helicopters

All three of the helicopters costs between $20 and $30 each. They all fly decently, due to their proprotional throttle and steering. Yes, two channels only, so no forward or reverse. Once they get some momentum after turning you can get going. A trick is to attach a weight to the nose so it tips forward to provide thrust. Starting top left, my newest micro helicopter, the Ecoman Microgear Hughes 300 Fairy. The middle helicopter is an older Ecoman Microgear helicopter. And the final heli on the right is another version, the Air Hogs Havoc.

The Micro Cars

I have two ZipZaps cars. These are 1:64 scale fully functional radion control cars. These things are cheap. $10. My current models don't have proportional controls. The SE models, that I'm planning on buying soon, do have proportional controls of some sort. I'll find out. Anyway, pictured above starting on the left with the cars, is the ZipZaps Barricade Transformers model based on a Ford Saleen s281 Mustang. The other three cars you see actually just bodies. Going from left to right, is the ZipZaps Bumblebee concept Chevrolet Camaro, a '70 Ford Mustang Boss 302, and a '70 Plymouth Hemi 'Cuda.

I'm working on the second car to modify it's performance. I have several options for engines and gearing and tires in the new upgrade kit I bought. I love the Mustang body, of course (I'm a big classic Mustang fan). So Mustang it is. Regarding the engine and gear set, I don't yet know. I have to learn about those.

Filed under: Geek Out No Comments