Thursday, July 09, 2009

migrating SVN history to Mercurial in BitBucket

I started setting up a Mercurial server tonight using http://mercurial.selenic.com/wiki/HgWebDirStepByStep and http://mercurial.selenic.com/wiki/RHEL4HgWebDirSetup I got pretty far in and realized there was still a long way to go and I would only have a partially working solution. The easier way to test Mercurial for our team would be with BitBucket. The steps I did to create my own server are shown below just for historical reasons.

BitBucket supports private projects, has the Web interface for Hg already set up, and has a wiki and bug tracker available. I created an account (traditional because I couldn't get my OpenID URL working - I'm slow), set up a private repository, and then 'pushed' in our existing source.


$ mkdir buckets
$ hg convert svn+ssh://[my svn server].org/svn/buckets buckets
$ cd buckets
$ hg push https://[my username]@bitbucket.org/[my username]/[my private repo]


At this point, the BitBucket Overview and my private news feed show the repo history. Good stuff!

What I was doing...


$ wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
$ sudo rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
$ sudo rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm
$ sudo rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm
$ sudo yum install mercurial
$ sudo yum install httpd
$ cd
$ wget http://selenic.com/repo/hg-stable/archive/tip.tar.gz
$ tar xzf Mercurial-stable-branch--*.tar.gz
$ sudo mkdir /var/www/cgi-hg
$ sudo cp Mercurial-stable-branch--*/hgwebdir.cgi /var/www/cgi-hg && sudo chmod +x /var/www/cgi-hg/hgwebdir.cgi
$ sudo vi /etc/httpd/conf.d/hg.conf
ScriptAliasMatch ^/hg(.*) /var/www/cgi-hg/hgwebdir.cgi$1

<Directory /var/www/cgi-hg/>
Options ExecCGI FollowSymLinks
AllowOverride None
</Directory>
^d
$ sudo touch /var/www/cgi-hg/hgweb.config
$ sudo /etc/init.d/httpd start
$ sudo chmod 755 /var/log/httpd

Sunday, June 14, 2009

Android logs with ADT (LogCat)

The LogCat view is on by default in the Debug perspective. I noticed that even when I'm not debugging the view is getting updates from the application running in the emulator. I added the LogCat view to my Java perspective so I can see it anytime.



In the clip above, you can see that the LogCat view defaults in with the Problems, Console, and other views in the bottom-right. I like it there. The second column in the view shows the logging level; this level comes from the method called on the Log object. Here are the clips from my code that correspond to the 'I' messages.


Log.i("ListBuckets", "Setting up grid.");
GridView g = (GridView) findViewById(R.id.bucket_list);
g.setAdapter(new ImageAdapter(this, mBucketsDb.fetchAllBuckets()));


Above, I used just a plain string for the 'tag'; this seems like the common approach in the Android sample code. Below, I went to my more normal use of using the class as the tag.


public void onCreate(SQLiteDatabase db) {
Log.i(BucketsDbAdapter.class.toString(), "Creating fresh database.");
db.execSQL(DATABASE_CREATE);


To add the LogCat view to the Java perspective:
1. open the workspace that houses your projects
2. Window -> Show View -> Other...
3. expand the Android tree node and select LogCat

Wednesday, June 10, 2009

Ike learning to IM

Isaac is 8 now so he is anxious to get online. He started using Pidgin yesterday and he's doing great. Here's a clip - he's even using smiley's :)

Wednesday, June 03, 2009

sqlite3 cli

Android gets better and better! I had a few minutes tonight to take a look at my current Android app and wanted to check the state of the DB. Expecting to find nothing, I Googled sqlite cli android and found that there are 2 methods. Beauty.

Term in Emulator


I thought that this would be the coolest but it was actually a paid because the UID is not root. The end result is that there are annoying permissions issues. It was pretty fun to be able to use the Term to check the DB:


Shell via ADB


jjohnson:~ jjohnson$ adb shell
# cd /data/data/org.mrtidy.nb2db1/databases
# sqlite3 data.db
SQLite version 3.5.9
Enter ".help" for instructions
sqlite> .tables
bucket
sqlite> select * from bucket;
0|testing 0|3|
1|testing|42|2009-05-05
3|testing 3|55|2009-05-0
5|testing null|66|
6|moo|4|
sqlite>

Friday, May 22, 2009

learned a few things about Ubuntu and VirtualBox

My main goal tonight was to get through the different layout samples to get a better grasp on layout in Android. Unfortunately, work leaked so I had to do some Ubuntu and VirtualBox configuration. Turned out to be pretty interesting and reminded me how much I like Ubuntu.

I set up a VM instance - this was fine, went as normal. The new part here was that I wanted to use VBox snapshots. Once the VM was prepared, I exported the config and HD image to put on our filer system as part of my usual process. After the traditional style backup was done, I tried creating a Snapshot of the VM. Assuming the snapshots work, they're might simple: you get to give each snapshot a name and description. There are options to delete snapshots, remove current config, and a few other things.

As part of the preparation of the VM, I had to set up an application launcher in the VM image. I've done launchers before but this was a little new because I wanted the launcher on the desktop but the actual scripts within the home directory structure. The problem I hit was that the main script used relative paths to reference other scripts. The solution to my issue was here. I had assumed "cd {abs directory}; ./{script}" but it has to be 'sh -c "cd {abs directory} && ./{script}"'. Huh.

I set both the host and guest instances to perform Auto-Login to be easy for the line setup. In the host, I added a Startup Application to auto-start my guest. This reminds me how much I like VirtualBox: VBoxManage has lots of different options that I've found useful. In this case, I do 'Command: VBoxManage startvm "gateway configuration station"'. Since the VM is configured for full-screen, I ultimately end up at the desired UI after powering on the physical box. Good stuff!

Back on the Android stuff, I was pleased there as well: started bumping into the design surfaces in ADT and they look helpful, used the Debug perspective with an Android app running in the emulator (and breakpoints worked :)), and Android will deal with about anything for the icons.

Wednesday, May 20, 2009

first Android app

Google provides great tools to get started. The guys at work are Maven fanboys so they referred to a couple Maven-Android projects to use. I followed their lead and took the time to set up Masa but that was a total waste of time. The first part below is how a normal person should write the Hello World app and then the second part is how to get Masa set up, just in case you too are a Maven fanboy (or fangirl). There are some notes at the very end about using Eclipse / ADT but I think writing the first app with the Android tools is helpful.

Android Tools



Step 1: Download Android SDK


Go to the Android SDK Download page and get the SDK. For the Mac, it is a ZIP file so I downloaded and unzipped and then edited ~/.bash_login to add ANDROID_SDK and put $ANDROID_SDK/tools in my path.

Step 2: Create an AVD


To be able to test apps, you need to set up an Android Virtual Device. As you get familiar, you'll probably have multiple AVD but create an API level 3 AVD to get started. I called my AVD basic. The steps below show me creating it and then starting it.

$ android create avd -n basic -t 3
Created AVD 'basic' based on Google APIs (Google Inc.)
$ emulator @basic

At this point, I see a window with a red phone. The screen on the phone is blank.

Step 3: Create an App and Install


I called my app buckets and the main activity is called BucketOverviewActivity. The android create call writes out a template project and sets up the initial metadata. Everything is valid as-is so you can go straight from there to compile and install the app.

$ cd ~/projects
$ mkdir buckets
$ cd buckets
$ android create project --target 2 --path . --activity BucketOverviewActivity --package com.unknown.buckets
$ ant debug install

After the install step, the phone appears to turn on and the app is now available. The name of the app is BucketOverviewActivity and when I click on that I see the Hello World.


Masa Setup


The Masa Web site appears to be stale and a different Maven project in GoogleCode has intentionally gone stale claiming that they are merging with Masa. I think that the problem is that the Ant tools provided with Android are good enough. Anyway, I spent all the time to get Masa setup so I may as well pass the info along.

Do the steps 1 and 2 above to get the Android SDK installed and in your PATH and to prepare an Emulator. Next, install Android JARs into the local Maven repository.

mvn -X install:install-file -Dfile=/usr/local/android//platforms/android-1.5/android.jar -DgeneratePom=true -DgroupId=android -DartifactId=android -Dversion=1.5_r1 -Dpackaging=jar
mvn -X install:install-file -Dfile=/usr/local/android//platforms/android-1.1/android.jar -DgeneratePom=true -DgroupId=android -DartifactId=android -Dversion=1.1_r1 -Dpackaging=jar


At this point, you can pull the Masa source and install Masa into the local repository.

cd ~/oss
svn co http://masa.googlecode.com/svn/trunk/ masa
cd masa
mvn install


Finally, you can take the sample pom.xml from the Masa Web site, update the versions, and put it into your project directory (that already has a find build.xml file for Ant) and use mvn.

Eclipse / ADT


The Android Developers Web site has great information for getting started with Eclipse and the Android Developer Tools plugin. Some parts that I think are important are that the code-path to create a new project using ADT is different than just using the Android tools. It isn't a real big deal but the best way to get a decent build script for a build machine is to use the Android create tool. I did find that I could drop a build.xml, build.properties, local.properties, and default.properties into the project directory of an Eclipse-created project and it built and behaved as I expected.

I tried Export -> Ant Build Files but that was terrible. Use android create at least once to get the good scripts. Once you get good build scripts, it would probably be smart to tell Eclipse to only use the Ant build script that was put in place but I'm going to live on the wild side and use the IDE build when doing interactive dev and Ant for 'real' builds.

ADT provides a graphical tool for managing the virtual devices, automatically assumed debug keys on Run As, and has the usual benefits of syntax highlighting and refactoring. There isn't an integrated tool for managing the emulators, that I have seen; that means that once an emulator is started, I have to kill it outside the IDE if it needs to be killed. Along the same lines, I've had a case where the IDE wouldn't start a new emulator but there was one running and ready to take an application image.

Saturday, April 18, 2009

the hard way to get SMS messages in app

My epiphany today was that SMS would be the easiest way to capture expenses like gas and groceries. That's funny, seriously. I decided to see how difficult it would be to get SMS messages into an app. Since I recently set up a Skype account with SkypeIn, I figured I'd see if SkypeIn could accept SMS. In short, it doesn't appear to (still).

The Skype APIs are brilliantly trivial so within a couple minutes of downloading the Python version of the API I had this script running to send my real phone a test SMS message.


import Skype4Py

def OnAttach(status):
print 'API attachment status: ' + skype.Convert.AttachmentStatusToText(status)

if status == Skype4Py.apiAttachAvailable:
skype.Attach()

skype = Skype4Py.Skype()
skype.OnAttachmentStatus = OnAttach

print 'Connecting to Skype...'
skype.Attach()

message = skype.CreateSms(Skype4Py.smsMessageTypeOutgoing, '+15555551234')
message.Body = "Hello from sendSms.py"
message.Send()


That works - I set a real phone number where the 5555551234 is and the real phone gets the SMS instantly. Since I was sure the API was functioning correctly, I tried reading SMS messages. I could see SMS messages so from a real phone I sent an SMS to my SkypeIn number.

Neither Skype (the GUI client) nor the API could see the incoming SMS so I did a little reading and found that landlines are used for SkypeIn so incoming SMS is not an option. I read that there is a company that provides free SMS routing to Skype accounts. The format is 'skype account name message'. Skype then receives the SMS as an Instant Message. I tried it out by sending 'skype mrtidy test another from iPhone' and did get the Instant Message.


import Skype4Py

skype = Skype4Py.Skype()
skype.Attach()

for sms in skype.Smss:
print sms.Type + ' SMS: ' + sms.Body

for chat in skype.Chats:
print chat.Type + ' Chat'
for message in chat.Messages:
print 'Message: ' + message.Body


Using the code above, I can now see that I have received the SMS message:

OUTGOING SMS: short message from python
OUTGOING SMS: Hello from sendSms.py
OUTGOING SMS:
OUTGOING SMS: test with the 1 in it
OUTGOING SMS:
OUTGOING SMS: testing sms from skype
DIALOG Chat
Message: "test another from iPhone [ SMS to Skype message from +15555551234 ]"
Message:
Message:
MULTICHAT Chat


I'm pretty bummed about SkypeIn being landline and having no real option for receiving SMS. I thought about my fundamental problem and I could set up a private twitter account specifically for tracking the expenses that we make while out but I'd really prefer SMS or email. The SMS attraction was that it is just 2 fields which makes sense; email has a subject field which is unnecessary for this task.

Thursday, March 19, 2009

setting up personal wikimedia

I'm a huge fan of Confluence since I get to use it at work and have gotten real familiar with it. Unfortunately, there isn't a personal version of it, that I can find, so for setting up a wiki for personal use I have to turn to something else. I have experience with a few but I'd say my second favorite is wikimedia. Wikimedia has everything I need - this is mainly for Greg and I to keep track of our rocket info like propellants and nozzle info.


yum install php
yum install mysql
yum install mysql-server
/etc/init.d/mysql start
mysqladmin -u root password '###'
yum install php-gd
yum install php-mysql
cd /var/www/html
tar xzf ~/wiki*tar.gz
ln -s wikimedia-* wikimedia
chown -R apache:apache wikimedia*
http://192.168.0.25/wikimedia/config/

Admin username: admin
Password: ###

Database name: rockets_wiki
Database username: rockets_wiki
Database password: ###


That is looking good and the wiki is ready to start using solely through a browser; however, it isn't externally available yet. Since all traffic on port 80 currently forwards from my firewall to an IIS instance, I need to set up a reverse proxy to forward the traffic on from IIS to the internal Linux server hosting wikimedia. I haven't finished setting up the reverse proxy but below are the links that I've been working from. Note that ARR is only avaiable for II7, which I don't have, so it is mostly informational about what I wish I had.


http://learn.iis.net/page.aspx/489/using-the-application-request-routing-module/
http://iis.net/downloads/default.aspx?tabid=34&g=6&i=1709

http://urlrewriter.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22618
http://urlrewriter.codeplex.com/Thread/View.aspx?ThreadId=38437

Wednesday, February 04, 2009

moving to jQuery 1.3

I'm finally migrating a site with the ancient jQuery 1.1.4 library (!) to jQuery 1.3. To say I'm excited is a gross understatement. The jQuery team continually blow my mind with smart features and approaches to solve problems. I'm interested in all the features but in particular, I'm anxious to see how the 'no browser sniffing' will work out in the long run. Good stuff.

http://docs.jquery.com/Release:jQuery_1.3

Thursday, January 29, 2009

HP puts VT Flag in OS Security

At work we have an HP dc5750 machine that we want to put some HVM VMs on. The processor in the machine is an AMD 4450B that technically supports AMD-V. After installing Xen and booting the machine we found that HVM was not enabled in Xen so we had to go digging around. We looked through all the sensible BIOS options a few times and upgraded the BIOS to the latest version and then finally in frustration looked in the OS Security section and there it was - Virtualization was Disabled.

Thursday, January 15, 2009

Awesome is understatement

Here's something geeky: See's Awesome Nut & Chew Bar. Wowsers those are good - why aren't they available in stores?

Wednesday, January 14, 2009

indirection and perf

This recent post by Phil Windley had a great paragraph in it about indirection and performance.


You know the saying “there’s no Computer Science problem that can’t be solved with a layer of indirection.” In homage to that, our solution is to redirect from a static URL to the timestamped filename. That’s not ideal, but it works. The downside is the other half of that homily: “there’s no performance problem that can’t be solved by eliminating a layer of indirection.” Still, our measurements show that the price we’re paying isn’t too high.


Good stuff. We all know it - he just has an amusing way of saying it.

Thursday, December 18, 2008

Terminal Settings

Exported Terminal settings:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGCQpYJHZlcnNpb25UJHRvcFkkYXJjaGl2ZXJYJG9iamVjdHMS
AAGGoNEHCFRyb290gAFfEA9OU0tleWVkQXJjaGl2ZXKjCwwTVSRudWxs0w0ODxARElYk
Y2xhc3NcTlNDb2xvclNwYWNlVU5TUkdCgAIQAU8QLzAuMDk4MDM5MjE3IDAuMDk4MDM5
MjE3IDAuMDk4MDM5MjE3IDAuODk5OTk5OTgA0hQVFhdYJGNsYXNzZXNaJGNsYXNzbmFt
ZaIXGFdOU0NvbG9yWE5TT2JqZWN0CBEaHykyNzo/QVNXXWRreH6AgrS5ws3Q2AAAAAAA
AAEBAAAAAAAAABkAAAAAAAAAAAAAAAAAAADh
</data>
<key>CursorBlink</key>
<true/>
<key>CursorColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGCQpYJHZlcnNpb25UJHRvcFkkYXJjaGl2ZXJYJG9iamVjdHMS
AAGGoNEHCFRyb290gAFfEA9OU0tleWVkQXJjaGl2ZXKjCwwTVSRudWxs0w0ODxARElYk
Y2xhc3NcTlNDb2xvclNwYWNlVU5TUkdCgAIQAU8QITAuODAwMDAwMDEgMC44MDAwMDAw
MSAwLjgwMDAwMDAxANIUFRYXWCRjbGFzc2VzWiRjbGFzc25hbWWiFxhXTlNDb2xvclhO
U09iamVjdAgRGh8pMjc6P0FTV11ka3h+gIKmq7S/wsoAAAAAAAABAQAAAAAAAAAZAAAA
AAAAAAAAAAAAAAAA0w==
</data>
<key>CursorType</key>
<integer>0</integer>
<key>Font</key>
<data>
YnBsaXN0MDDUAQIDBAUGCQpYJHZlcnNpb25UJHRvcFkkYXJjaGl2ZXJYJG9iamVjdHMS
AAGGoNEHCFRyb290gAFfEA9OU0tleWVkQXJjaGl2ZXKkCwwVFlUkbnVsbNQNDg8QERIT
FFYkY2xhc3NWTlNTaXplVk5TTmFtZVhOU2ZGbGFnc4ADI0AoAAAAAAAAgAIQEFpBbmRh
bGVNb25v0hcYGRpYJGNsYXNzZXNaJGNsYXNzbmFtZaIaG1ZOU0ZvbnRYTlNPYmplY3QI
ERofKTI3Oj9BU1heZ251fIWHkJKUn6StuLvCAAAAAAAAAQEAAAAAAAAAHAAAAAAAAAAA
AAAAAAAAAMs=
</data>
<key>FontAntialias</key>
<false/>
<key>Linewrap</key>
<true/>
<key>SelectionColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGCQpYJHZlcnNpb25UJHRvcFkkYXJjaGl2ZXJYJG9iamVjdHMS
AAGGoNEHCFRyb290gAFfEA9OU0tleWVkQXJjaGl2ZXKjCwwTVSRudWxs0w0ODxARElYk
Y2xhc3NcTlNDb2xvclNwYWNlVU5TUkdCgAIQAUYxIDEgMQDSFBUWF1gkY2xhc3Nlc1ok
Y2xhc3NuYW1lohcYV05TQ29sb3JYTlNPYmplY3QIERofKTI3Oj9BU1ddZGt4foCCiY6X
oqWtAAAAAAAAAQEAAAAAAAAAGQAAAAAAAAAAAAAAAAAAALY=
</data>
<key>TextBoldColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGCQpYJHZlcnNpb25UJHRvcFkkYXJjaGl2ZXJYJG9iamVjdHMS
AAGGoNEHCFRyb290gAFfEA9OU0tleWVkQXJjaGl2ZXKjCwwTVSRudWxs0w0ODxARElYk
Y2xhc3NcTlNDb2xvclNwYWNlVU5TUkdCgAIQAU8QITAuODAwMDAwMDEgMC44MDAwMDAw
MSAwLjgwMDAwMDAxANIUFRYXWCRjbGFzc2VzWiRjbGFzc25hbWWiFxhXTlNDb2xvclhO
U09iamVjdAgRGh8pMjc6P0FTV11ka3h+gIKmq7S/wsoAAAAAAAABAQAAAAAAAAAZAAAA
AAAAAAAAAAAAAAAA0w==
</data>
<key>TextColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGCQpYJHZlcnNpb25UJHRvcFkkYXJjaGl2ZXJYJG9iamVjdHMS
AAGGoNEHCFRyb290gAFfEA9OU0tleWVkQXJjaGl2ZXKjCwwTVSRudWxs0w0ODxARElYk
Y2xhc3NcTlNDb2xvclNwYWNlVU5TUkdCgAIQAU8QITAuODAwMDAwMDEgMC44MDAwMDAw
MSAwLjgwMDAwMDAxANIUFRYXWCRjbGFzc2VzWiRjbGFzc25hbWWiFxhXTlNDb2xvclhO
U09iamVjdAgRGh8pMjc6P0FTV11ka3h+gIKmq7S/wsoAAAAAAAABAQAAAAAAAAAZAAAA
AAAAAAAAAAAAAAAA0w==
</data>
<key>name</key>
<string>Homebrew</string>
<key>shellExitAction</key>
<integer>1</integer>
<key>type</key>
<string>Window Settings</string>
</dict>
</plist>


Are those serialized objects storing the color info? Huh.

Wednesday, December 10, 2008

Launch Log 2008.12.07

The weather was nearly perfect and we launched around 20 rockets (we = Greg M, Isaac, Spencer, and me). I lost an unfinished Mighty Mouse: great launch on a C but went north and landed in the pond. The Westminster police stopped by to tell us we technically weren't supposed to be there but they weren't telling us to leave; the policy is that if someone complains they'll come tell us to leave.



We launched Isaac's Rainbow Machine and Greg launched his own Mean Machine. Both did great on D12's.



People stopped to watch and these girls came and played for quite a while. Fun to see so many people interested in rocketry.

Thursday, October 23, 2008

still a fan of stack overflow podcast

Around episode 10 of the Stack Overflow podcast, Joel Spolsky and Jeff Atwood sync'd up and became great. I had been an occasional reader of Coding Horror and Joel on Software but never much of a fan. Around episode 20 of the Stack Overflow podcast, Joel and Jeff got too comfortable and they're risking falling apart like Carl at DNR or Scott on Hanselminutes but I'm still a fan.

It may take a major problem with the Stack Overflow site of FogBugz to get the show back to the super-interesting level. Right now, Jeff settling in to thinking that Stack Overflow is a success and he's got it all figured out and Joel is just there for the ride. They are thinking that bringing on guests will keep the show interesting but I think the attraction to the show has been that they were dealing with real technical problems and differences on how they would address them throughout the cycle of building Stack Overflow. If there aren't any major disasters with Stack Overflow or FogBugz then they should probably stop doing the podcast or start writing a new product.

Saturday, September 27, 2008

Some Winter Project

Kelly J mentioned once that he was converting his mower to electric. I just mowed the lawn and got to thinking about his project. I figured it'd be pretty expensive but was curious what was involved.

Here's an interesting article about someone that did the conversion. $212 for the conversion - impressive. I get the impression that this article inspired the build-it-solar article.

Tuesday, August 12, 2008

Al Gore invented Global Warming

I listened to an interview about 5 years ago where Bob Metcalfe or Vint Cerf was tributing Al Gore for pushing hard on congress to fund the Information Super-highway. The direct result was increased funding, and I believe the 5 node backbone between the super-computing centers and then ultimately the Internet as we know it today. I cringe when people still joke about Al Gore saying he invented the Internet - I haven't heard his words, but it seems like he's allowed to take some significant credit.

It just struck me, as I was reading about the plastic / nanotube solar panels, that we'll probably be hearing in 5 years people saying that Al Gore invented Global Warming. It'll make me cringle but perhaps it'll have the same amount of truth: it sure seems like clean tech has boomed following his moving on the environment.

I'm no big fan of Al Gore - just had the thought...

Saturday, August 09, 2008

Launch Log 2008.09.02

Chris Murdock organized a small community launch on Aug 2nd. Isaac, Spencer, and I went and enjoyed flying a bunch of rockets and watching a lot of other flights.

The Rainbow Machine had a beautiful flight on an Aerotech E15. The winds were calm so the flight was straight and the rocket landed about 10 yards from the launch pad. The Purple Rhino II had a great flight on 5 Estes A10 motors. I used flash-in-the-pan for ignition and clearly had plenty of powder in the pan!


  • Rainbow Machine (E15) - perfect flight, correct delay, landed near pad

  • Alpha III (A8) - first flight, early ejection

  • Explorer (E9) - great flight, very high, delay (6) too long, nearly landed on pad

  • Mighty Mouse III (B6) - first flight, bit of a spin, correct delay

  • Purple Rhino II (5x A10) - first flight, too much powder in pan, very straight

Friday, July 18, 2008

Don't Make Me Think!

I'm not a Web designer but I decided to Don't Make Me Think! because I could just read and think about the content while traveling. I've found most of the content insightful and this particular bit gives a glimpse of why I like the book.


And the worst thing about the myth of the Average User is that it reinforces the idea that good Web design is largely a matter of figuring out what people like. It's an attractive notion: either pulldowns are good (because most people like them), or they're bad (because most people don't). You should have links to everything in the site on the Home page, or you shouldn't.


Heh - the Average User - I hate it when the Average User comes up at work because it is the same thing: it is the dev / PM / etc. claiming they know what the Average User wants so they can enforce their agenda.


The point is, it's not productive to ask questions like "Do most people like pulldown menus?" The right kind of question to ask is "Does this pulldown, with these items and this wording in this context on this page create a good experience for most people who are likely to use this site?"


Good point - seems like that could apply to the code / end-user issues as well.

Tuesday, July 08, 2008

posting family / hobby videos

We hope to be posting more videos on our blogs in the future, so we need to work out a good process and format for converting and posting the videos. Flash video files are becoming very common and are handled nicely in most browsers (pretty much everything but the iPhone as far as I can tell) so that seems like a good starting point.

SWF or FLV
The Adobe Flash movie player plugin expects SWF files but the FLV files are better for us because they can stream out to the player. The reason to point that out is that if you look at the excellent Adobe documentation for object / embed for the Flash movie player, you only see the movie parameter pointing to an SWF file. I chose a nice looking embeddable FLV player from advanced flash components to be the SWF file that streams / plays the FLV files in the blog posts.

ffmpeg or mencoder
Our camera produces HD videos at 1280x720 pixels and the files are pretty large. I tried 2 different tools to convert the large .mov file to .flv:

ffmpeg:
ffmpeg -i P1010013.MOV -acodec libmp3lame -ab 64k -f flv -b 800000 -r 30 -s 400x225 -aspect 16:9 ravioli.flv

mencoder:
mencoder P1010013.MOV -o ravioli.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts \
vcodec=flv:vbitrate=600:mbd=2:mv0:trell:v4mv:keyint=10:cbp:last_pred=3:aspect=16/9 -vf scale=400:225 -srate 22050


I've used ffmpeg more in the past so I intended to use it for this; however, the basic options above resulted in a lot of popping in the resulting .flv file. I started reading about the audio codecs and tried a few different settings but decided to try a basic config for mencoder that I was familiar with. I think that either of the above could be improved: ffmpeg could get audio fixed or mencoder could ensure that the aspect ratio gets coded into the video info.

Preview Image
In the case of the ravioli video, I didn't like the default preview image so I generated a series of jpegs and used MS Paint to scroll through the images until I found one I liked.

mplayer:
mplayer.exe ravioli.flv -nosound -vo jpeg

Embedding the Video
To get the video into a Web page, we just need to invoke the player and tell it what .flv file to use. We currently have the .flv files on our regular blog server; in the future, I'd like those moved to AWS or some similar content network.

object / embed:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
width="400" height="225" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="base" value="/" />
<param name="movie" value="/AFC_EmbedPlayer.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="FlashVars"
value="flvURL=/moo/ravioli.flv&autoHideControls=true&autoStart=false&previewImageURL=/moo/ravioliPreview.jpg" />
<embed base="/" src="/AFC_EmbedPlayer.swf" quality="high" bgcolor="#ffffff"
width="400" height="225" align="middle" allowScriptAccess="sameDomain"
allowFullScreen="true" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
FlashVars="flvURL=/moo/ravioli.flv&autoHideControls=true&autoStart=false&previewImageURL=/moo/ravioliPreview.jpg"></embed>
</object>


References