Wedding Video–Part 1–Acquisition

imageThe geekiest thing I’m doing right now is editing a wedding video for my friend Stuart. 

I’m very glad I did this wedding as a gift – ie, not getting paid.  If I were to get paid, there’s a lot of things I would do differently. Here is what I have learned:

Pre-Wedding Checklist

  • At least two of the same kind of camera, preferably of a resolution higher than the final product.  
    • You want better than the final resolution for stabilization – any software needs to loose some pixels in order to stabilize. 
    • Hint: film at 1080p, render at 720.   Unless you are Über with your camera moving Skills.
    • Cameras that do well in low light – the dancing at the reception, for example.
  • Two GOOD tripods, which extend at least above head-level high.   OR, a Balcony. 
    • When everybody is standing, it will be challenging to get the right folks in the video.   I had one tall tripod that didn’t move well, and one short tripod that did move but was no more than head high.
    • The $55 tripod at Target is not it.   While moving, it jars and shakes – that’s where an actual video tripod is worth the $.  Next time. 
  • One audio recorder to keep somewhere in the altar area.  In my case, it went in a flower pot.
  • As many extra little cameras as you can afford – to cover the angles when none of your other cameras has a shot.  I had a GoPro near the altar area in front of the entire congregation, on the floor. 
  • A gray-scale/color card.  These can get expensive – but you can cheat and print your own.  It doesn’t need to be perfect, its mostly to color balance between different cameras.
  • An assistant to run the other camera is REALLY nice.
  • Enough battery power for N+2 hours on each camera.  
    • I planned poorly for mine – I came prepared for 5, but it turned out to be 8. 
    • Enough time to charge all batteries. You may not get it onsite.
  • Enough card space for N+2 hours on each camera. 
  • A pair of silent black shoes, and a black outfit, to not draw attention to one’s self.   I used these guys.

Rehearsal Checklist

  • Ask the question:  Where will the congregation be limited to?   If I had asked this, I would have know about additional places I could have put camera #2 that would have not been affected by standing folks.
  • Film the entire rehearsal like you were doing the real service.  It helps you know where to be and where to point at any given time.   I changed my plan about 3 times during the rehearsal.
  • Get B-Roll video of the performers performing – mostly their fingers (since they will not be wearing the same stuff during the real thing)
  • You need a reception rehearsal as well – or at least ask the questions:
    • Where will the bride and groom enter from?
    • Where will the cake be cut?
    • Where will the toast be delivered from?  (I assumed the table, but it was from the singer’s microphones)
    • What’s the general order of events? 
    • Where is the dancing going to be?

Post Rehearsal Checklist

  • Re-charge all batteries.
  • Offload and clear all memory cards.
  • Final plan on where the cameras will be.   Remember the 180 rule

Pre Wedding

  • Place all the cameras, tripods, etc, in position.
  • Get some audio without anybody else there – to establish baseline noise (to be used later in noise reduction)
    • I used AGC (automatic gain control) on my recorder, but it would be better to have that turned off if you want high quality audio – however, that also needs practice.  My fear was that I’d have the gain turned too low, so I went with AGC turned On.  That makes noise reduction harder.
  • More B-roll.  By this time, all the flowers, etc will be in place.
  • 5 minutes before action time, turn everything on. 
    • Use a checklist.  Yes, I DID turn on the audio recorder.  Yes, I DID turn on the GoPro.

During the Wedding

  • If you have an assistant, one camera should be fixed on a subject at any point in time.  This is where the stationary Go-Pro or wide-angle cameras really help – you can always fall back on them even if everything else is moving.  
    • If you are a solo act, this works out – I would adjust one camera, pad over to the next (in my silent shoes), adjust it, then back to the first, etc.
  • Slow slow SLOW sweeps. 
    • This is where the good tripod really helps.
    • Do NOT zoom in all the way.  This is where recording at a resolution higher than the result is helpful – gives image stabilization room to play.  This is where having the grid turned on helps – keep most of it inside the center grid.   (But, if you are recording at the final resolution, obviously, don’t do that)

After the Wedding

  • Record the entire receiving line.  
    • From an angle where you can see the guest’s faces.
    • These are the people who are important to the Bride and Groom.  

During the Reception

  • You probably will not get to eat a full meal.   Plan accordingly.  
    • Why: Some of the footage you will want is people getting served food.   That cuts into eating time.
    • Then, while eating, the toasting will probably begin.    Or, people will demand they couple kiss, and you’ll want to be ready for that.
    • This does not exclude Cake.  Cake can be eaten easily.
  • Friendly kids and throw away cameras make for great video.   10 years later, its whatever the kids did, that gets watched, not the boring grown-up stuff.   I was blessed with two volunteers.

 

That’s probably about it, on lessons learned.   Don’t worry – while it sounds like I had a train wreck; au contraire, I’m 90% proud of what I’m able to produce – I have good editing skills.     The editing part is a separate post.

Entertainment / Hobby Queue (10/26/2012)

I have found myself with nothing to do tonight.   Not, as in, bored, but more like a moment to breathe.   As I sit back and relax, I realize I have a long queue of stuff that I want to do .. sometime.  I’m making a note of them here.   As I write this, I realize I also have misgivings about some things, they need to leave the list, I do not have the time, I must be picky.

(Creative Commons photo by Simon Law)

Video Editing Queue – Priority

  • Soccer Banquet:  player and coach interviews – mostly done, needs trimming and color correction and some titles.
  • Soccer Banquet: to be determined – JV, V, Seniors, Action shots, Clips of celebrations, Senior Parents flashback – waiting on media from my wife to set the grouping.

Video Editing – Not priority 

  • Now that I have multicam software, finish off the Café Unity Wizard of Oz video .. so I can delete the originals (22G) and replace with a single 4G video stream.   (Also amazing is how Premiere does 2 pass VBR etc – to get crisp high quality video in less space – as compared to consumer MPG generation)
  • Likewise, reburn the surrounding video to a DVD for Noumuas, but I want to attempt color correction on it now that I have learned how.
  • Battle of igNew vs Heartland – Basketball competition – its going down tomorrow.  I won’t be there, but supposedly there will be two GoPro’s in the mix. 
  • Niece Macki’s Oldham vs Shelby competitive girl’s soccer game.

Archiving

  • I *still* have all those old photos that need to be digitized.   I might just find a service and get them sent off.  I really want to color correct some of the stuff from the 70’s.  
  • Of course, none of it is of any use to anybody other than me.. I have no biological offspring who would care.
  • I have about a decade of digital pictures that I could try to organize and comment on.

TV

  • Staying up to date with Grimm, Top Gear Ameriica, Top Gear BBC, Doctor Who. Only one is currently in season.
  • Backlog of seasons: Doctor Who.  I’ve browsed the top 10 so far.  I might let this one go.
  • Battlestar Galactica?  I think they completed their story arc now.   I might let this one go.
  • Richard Hammond Crash Course.   Not started yet. 
  • There’s probably more excellent TV that I have missed, but I don’t know about ‘em, so I can’t list ‘em.
  • I think I’m giving up on Wild Alaska Flying Frozen People with Wind and Visibility Problems and oooo it could be dramatic but it really isn’t, but its pretty and I love watching airplanes fly.
  • Ice Road Truckers, if I get really bored.  Similar to the above. 

Movies

  • The Hobbit.  Oh yeah.   Probably twice, in the theaters.
  • Avengers
  • John Carter of Mars
  • reference Howard Tayler’s yearly reviews of movies, I seem to agree with him (except that I liked Wolverine)
  • Harry Potter!  I stopped watching the movies somewhere between 4 and 5 I think.
  • I once thought I would watch the entire LOTR, but with the directors or some other commentary track.  I might have to shelve this.  I think its beautiful what they did, but its in the past now, let it go, look at the new.
  • There are many feel good important movies about the beauty and challenge in our world —   Racing the Rez is one of them..  I want to watch more of these.   There’s also a movie about high school football that @CoachKennyBurke referenced in one of his videos.

Books

  • I have an active subscription to Schlock Mercenary.
  • I have many non fiction books.. math books, geeky books.. that I have gotten this year, that I can’t even remember.  Some by Martin Gardner.   There’s something about a very peaceful tribe in the Amazon.    I could possibly put these in GoodReads, but I’d rather actually read them.
  • Graphic novels from Humble Bundle that I just bought.  I got through xkcd the other night, it was great.
  • Shannara?  I grabbed 1 and 3, tried re-reading, but I’m finding it too dry and too.. suspicious?  the characters are not deep enough for me to relate any more.  I think I have to pass on it
  • Barbara Hambly is currently on my list.    I have 2 or 3 of her books lined up.
  • 2 anthologies (?) of Science Fiction short stories thanks to my Mother in Law.  I’ve read a few stories from each.
  • I read through the first 6 books in the “Warriors in the Wind” (cat stuff) series.  I am hesitant to start on the next 6.  Same shit, different paw.

Youtube

  • ViHart, CPGrey, VSauce, SlowMoGuys (sorry no links, you can youtube them if you want)
  • I seem to catch up about every month or so.

Music

  • I’m reasonably current now, thanks to Sirius XM. 
  • Mostly will involve banging on drums really loud.  
  • Some day I want to revisit trying to mix two or three songs together to make a mashup.
  • I do want to spend some time and just go through all the music that friends post on facebook, and listen to a bunch of it.  Just to see what’s important to them.

Code projects

  • Burnup/Burndown – currently working on it, at the rate of 1-2 hours every other week (link is to github)
  • Gmail super-archiving program – to delete all but the most recent of a pattern match; moving the most recent to an “Offers” folder.   Access via Imap, probably. 
  • Recovery Program Mapping – to help generate maps of 12 step meetings sorted by Date, Time, and mapped across a city.  Because that’s really hard to do.   Make it donation-based. 
  • LPC revisited in C# and .Net – to pay homage to where I learned OO for real.  

Games

  • XCom – I only played a few levels.  It was fun.   I probably won’t go back to it.
  • DayZ – I only played a bit; won’t go back to it unless its with a group of buddies
  • Civ5 – I did everything I wanted to do with it; I can shelve this
  • XPlane – I did all the travelling to places that I already know; I still have my cross country trip to do, however, I’m not feeling it right now.  Maybe in the dead of winter.   I have a TrackIr now, should be fun.
  • SPAZ – meh, it was interesting for a night.  Probably shelved
  • Borderlands – curiosity satisfied, shelved
  • SimCity – curios, might download demo, then shelve.
  • Portal – I really should play this.   Its so famous.

Then there’s another part of life.. that’s not work, its not family, and its not entertainment…  Its been ignored.  It’s the segment that I only seem to find the desire to work on, after I’ve spent some energy getting charged back up using entertainment.   It is:

Exercise

  • Get back to Yoga
  • Get back to resistance training / toning all muscles in general
  • Get back to running
  • Bonus: Swimming (== toning core muscles)
  • Bonus: Bicycling
  • Bonus: Soccer

If I ever say I am bored.. I need to come back and read (and freshen) this post.   And I’m not even listing the other areas of life I could get more involved in – recovery work (going to more meetings, taking on more sponsors), teaching (I think I would enjoy it, one on one, for those who want to be better developers), yardwork, house fixing, etc etc etc…

Life is Full.   That’s probably good.

Video Editing Quandry

I have a Quandry.  Or a Conundrum.  (Quandaundry?  Condrumdum?)

I’m working on one of the High School Soccer Banquet videos,  the one where I interviewed the seniors, asking them various questions (in retrospect, there were so many other questions I could have asked that could have been more interesting)..

I also have the coach’s description of each of the players.  It’s a bit long.  Coach said I could probably get a few seconds from that.. well, gosh darn it, he’s a good egg, he loves the players, I want to use all of it.

One way to do it would be to go player by player.. have the coach’s version.. then have the player’s answers.  Put that way, its about 23 minutes of footage, though I’m sure I could cut it down.  However, I think its boring.

I have another version:  Where I have the title of the question, and then each of the player’s answers.  This version is down to probably 10 minutes, but it does Not include the coach’s blurb on each player.  The coach’s blurb would get repetitive.   I also have 7 players, and 5 questions, so I couldn’t spread the blurbs between the questions.  (Or could I?  5 fits into 7 pretty well if the seven goes on the outside edges)

I also have these “cute” moments that need homes.    Celebration score during a Fifa game.. Giggling when they hear the goofy question before the interview… Googly-eyeing the camera… “Is this on?” … etc. 

Another alternative is to put the coach blurbs with the “focus on Senior” video – a totally separate video with baby pictures ‘n’ stuff.    I’m thinking in that video, each senior would get their own soundtrack.  *hmm*  Yeah, that might work better.

OOOO!  Idea.  I’ll have the coach’s blurb, but I’ll duck the audio when he says their name.. and then I would switch to the player’s baby pictures, and start building up.. and when I finally get to their current action pictures, I’ll put their name in for 1 or 2 seconds (on some highlight music part).   Yep.  that’ll work

Ok.  Conundrum solved.     Thank you for listening. 

Soccer SOUNDZ

2012-10-05 11.53.49I’ve neglected the blog a bit.. High School Soccer Season was upon us, and the priorities became: Soccer, Work (billable hours), Wife, and household chores.    I have the day off today (long story), and what have I been geeking out with?   

I have gotten my setup for soccer sounds to where I want it.  Background: previous seasons, a radio announcer guy was a parent, he brought a soundcart in from the station and provided sound effects during the game.. like celebration music after a goal was scored, crash sounds when a car got hit, “I get knocked down but I get up again” when a hurt player got up.   I “volunteered” myself to cover that starting last year, so I’ve been doing it pretty much every game.   Just a few more games left (my kid is a Senior).

Hardware

Audio-Technica AT8202 Adjustable Inline Attenuator

Audio-Technica-AT8202-Adjustable-Inline-Attenuator

The announcing booth has spots for two mics, and no other inputs.  So, I got this attenuator to convert the line-level out from <my equipment> into a mic-level – this avoids the annoying problem of having to have the volume REALLY low and have it get REALLY LOUD all of a sudden.

Yamaha-MG102C-Input-Stereo-Mixer

I could go straight from the laptop headphones to some funky XLR cable, however, QUICKLY controlling the volume on a laptop is hard.  When you have to use your eyes on the field, tactile/touch is very important – so I got a mixer.  I could have gotten a cheaper mixer, with less channels, but I’ve found that the mixer is a good tool to have in unusual situations..  and since I make myself “of service” in audio and video kinds of ways, this is pretty useful.   

Not Pictured:  1/4” TRS to XLR Male cable

Not Pictured: 1/8” TRS (headphones) to RCA cable

A Laptop.   The first season, I did this with a Netbook, so it doesn’t need a lot of processing power. (However, having a wide enough screen to have both apps open is a good thing)

Software

Screenshot

SoundByte is the best program I have found.  It cost me around $40, well worth it.  It relies on underlying Quicktime to play MP3’s, etc.    It does the sound effects, the “introducing your starting line up” music, and the playing of the national anthem, etc.   I did have to supply all the audio files – which was easy, as my predecessor left me a collection of his favorites.

I use iTunes DJ as the driver for music during halftimes.  It allows me to weed out stuff that’s coming up, balance volumes between everything that’s played, and cross-play between tracks .. and I can shift-select to see the total playing time of an upcoming segment.      

Music Selection

When I first inherited this, I had no clue what to play for music.  I was worried about royalties and legality and all kinds of stuff.  I tried to find FIFA soccer soundtracks… I used Spotify in offline mode.  

The good news is, another thing I’ve done is make mixes for cheerleading squads – and they tell me which music to make it from.  Hence, I’ve built up a collection of music from those requests – I started using that.

Further, I got tired of listening to “80’s on 8” and “Classic Rewind” on Sirius, and switched to more current stations – Pop2K, 20’s on 20, The Pulse – while coding – and when I hear a song I like, I tag it and usually end up buying it later.  More good music for the playlist. 

The end result is – it doesn’t really matter what’s playing, as long as there’s something there.  So don’t worry about it.  Grab some stuff, be careful of explicitness (“mommy, what does ____ mean?”), and move on.

Also, each team (girls, boys, soccer, football, etc) seems to have a mix CD that their seniors put together. using iTunes, I can import the entire CD (CTRL/I – set album information).    The benefit of this is iTunes helps balance the volumes and crossfade the tracks, giving a better sound experience.  The drawback is, usually its not checked for explicitness.  I leave that up to the coach:  Coach, have you approved the music?  And if he (or she) has, then its on him.

Process

This is as much to express the geeky-ness of the process, as it is a “here’s how I did it” so the next parent can invent what they want to do.  This is after all my last year doing it, 4 games left.

Prep:  in Soundbyte, there’s a menu option to set fade rates.  I set everything to 5 or 10, which gives about a 2-3 second fade-out.   I’ve also arranged music by color and columns.  I’ll refer to those below.

Process: Pre Game Setup

I usually arrive 30-40 minutes before the game starts, plug in my equipment, and get the “soccer music playlist” playing in iTunes.    Once the kids get on the field and warming up, I bring the volume up a bit more and switch to their imported playlist.

Prep: as we get the lists of names for the starting line-ups in, I usually chase down a parent and extract pronunciation so the announcer has it easier.

About 2 minutes before game time, I fade that out (physical volume knob), stop iTunes playing, switch over to “filller” music (3rd column) in SoundByte, and bring the volume back up.  Sometimes its Hawaii 5-0, more often its “Thunder” (which sounds like an NFL pregame orchestra something something).  This gives the background for the announcer to do his thing:  “Welcome ladies and gentlemen … to the … “ (etc etc)

When they are ready to do the starting lineup for the visiting team, I hit CTRL/F which fades out the current track, and switch it to another track in the 3rd column.. usually “Mission Impossible” (sneaky of me)

As that finishes and we go to introducing our kids, I’ll Ctrl/F again and switch to “Eye of the Tiger” or “We will Rock you”, and bring the volume up a bit.  Usually the announcer will be a little more excited voicing these guys.   

As that announcing finishes, its time for the national anthem.   Ctrl/F to fade it out, give people time to stand and come to attention (3-4 seconds) and then play one of the yellow-colored buttons – I have collected 4 National Anthems that I like so far.   I vary it up between games. 

Aside: one of the benefits of having a background track while announcing, you tend to pace your announcement to the music AND the parents get a chance to clap.

As the national anthem ends, I’ll drop the volume by hand, CTRL/F to stop it, and go back to the intro music (Thunder) as the teams take their spots on the field.  I’ll lower the volume somewhat when the ball gets to the center spot.. and lower it even further as everybody seems to get ready… then when the Ref blows his whistle, I’ll fade out (CTRL/F), bring volume back up to normal.

Process: When a Goal is Scored

[youtube=http://www.youtube.com/watch?v=T_0pHanV4-E&w=448&h=252&hd=1]
Video showing the sounds involved in scoring a goal, amongst other things

 

I usually only do this for our team, but if we’re hosting two other teams playing, I’ll do it for both teams.

As SOON as we realize that a goal has been scored, I reach over and tap “Q”, which is hotkeyed to play an “Oh Yeah” clip (from Yello).    This gives me the 5 seconds or so to get my mind straight, and pick the next sound to play, which is one of the green color clips – those are all little exciting celebration music clips, which don’t have to be any more than 30 seconds long or so.     What this also does, is give the announcer and the spotters a bit of time to argue out who shot the goal.. and then the announcer can announce the goal.. it takes the pressure off them a bit.  

As the kids get back to the center line, I usually bring the volume down just a tad (physical knob) when the ball hits the centerline, and when the Ref looks like he’s ready, I’ll hit CTRL/F to fade it out, then bring the volume back up.

Process: Post Game Teardown

The announcing booth has a CD player that many teams use that don’t have this kind of setup. I take one of the many pre-game warmup CD’s, and stick that in, play + pause, a few minutes before the game is over.  When the game is done, I hit play, and that provides music as everybody starts to leave the stands – and then I get to uplug everything and pack it away.

Process: Lugging it around

UPPTÄCKA Briefcase IKEA Extra protection for your laptop in a separate padded compartment.I use an Ikea UPPTÄCKA bag for the Mixer and Cables, and I have my normal laptop backpack for the laptop.  It’s a haul, but it works.  I usually get into the games for free, ‘cause its obvious that I’m there for business (well, to be fair, I have a second backpack for camera equipment, and a tripod, so I look like Dick Van Dyke in Mary Poppins.)

Randomness: 5:01 A1C

I had been putting off taking my A1C for at least a few months.. knowing that I was slacking off on being regular with my medication, and I had been eating crap and drinking pop.    Last time it was taken was at the doctor’s, I think it was a 6.0 or a 6.2, which is technically really good, I was sure it would be up around 6.5 or 7.0 by now.

So after all kinds of procrastination (I need to do dishes… no, the lawn first… how about some more minecraft… I can’t find my self-test kit…) I finally took it.

5.7 ??? WTFudge?   That’s AWESOME!

I’ve been on a semi-gluten-free diet.  As in, avoiding gluten Sunday-Thursday, and then treating myself on Friday and Saturday.  

“Treating” is a relative word.. “enjoying delicious treats” followed by “twitchyness, and joints that hurt”.  

“Avoiding” is also a relative word.   More like “1 oreo cookie every two days”.    Occasional donut relapses.  Its so hard to turn away when they are placed in front of me.  I could easily be a food addict.. I love my sugar, and eating in general.  (I have been to OA.  I will go if life becomes unmanageable.  They are good folks.)

I think this (relative) lack of gluten in my system.. is what has been saving me.  So I can have that pop without guilt, right?  No, maybe I’ll have a Coke Zero or Diet Pepsi instead.   There’s something in regular Pepsi that I absolutely crave, that I don’t get from regular Coke.  

5:01 And I’m Outta Here

There’s an article going around, I just caught it off the S.H. feed:  

I feel guilty about this. 

  • Very often I am watching the clock, trying to get all my billable hours in to continue justifying the wonderful salary that I’m paid.
  • When I was in my 20’s, I definitely coded for fun.  A lot.    At its worst, my life was: drive to work, drive from work to a college campus and code for 2-3 hours, drive home (125 miles total) and code some more.  Eat at Wendy’s.    I was involved in running an LPMud, and there was a lot of fun stuff to create, and I loved it.
  • I receive a boon of 4 hours of “personal coding time” at work to have fun with.  I look forward to using it every week.   I have two projects to work on it with.  But all it takes is one day where I don’t meet the billable hours, and I loose a little more play time.    Like today: I had to leave early so I could be an announcer at my son’s soccer game.
  • I think the truth is, I have about 6 hours of “natural focus” in me that I can apply towards coding.  After that, my brain just plain shuts down, and it takes a lot of energy to try to kick start it into focusing more.   And because I’m in an environment where there are no meetings, there’s nothing to distract me from coding.. I hit that wall very quickly.  

But I can be proud of myself too:

  • So far, this job has been my best trade:  hours for pay, + in line with the joy of learning good things, + the joy of working with good people.     I’m going to keep on doing it, as long as I am able.   Wrist braces do help, as do adjustible-height desks and larger (25”+) monitors.  #lawn
  • It may take me 50 hours of “clock” time, but I am definitely going to give them their money’s worth.   Because I’m definitely better for it as well.
  • To that end, I’m willing to go at my natural pace during the week.. not push it too hard.. and if I have to work on Saturday, try to do it with as little of a hissy as possible.  Note: not my employer’s request.  My own voluntary contribution. (The hissy is directed at myself)
  • If I do get to noon on Friday, and I have 4 hours of joyful coding time available to me.. queue the Oh Yeah! song by Yello.  http://www.youtube.com/watch?v=Tq0skIEkfUw
  • And I seriously get good stuff done at work.  I am of service, I build things, I am detailed, and my work is solid.    I get it done.
  • When paired up with a more passionate faster developer, I switched gears:  Make sure he is unimpeded, shield him from other’s ineptitude, and watch him shine.     I wouldn’t want to make that my day job, but wow, that was an interesting experience.

Bye Bye iPad

I gave my iPad 1st Gen 3G to my mom.  She needs it for internet access at her store .. so she can show her customers what options they have.    (KCUniforms in Morgantown, WV).  I only twitch a little bit, at night, now that its not here.

The plan is to buy another tablet towards the end of the year, hopefully with the Christmas Bonus.  I haven’t made up my mind yet.. I know for sure it will have a Retina display, but I need to see what Windows 8 goodness comes out in October.   The default would be an iPad3, but there’s some really strong contenders, and honestly I get more done on Windows.  

Entertainment List

There is way more entertainment available to me than I have time for.   This gives me the ability to say “that’s wonderful, but Nope” when new options arise.. like the impending release of Borderlands 2, which has my work buddies all in a tizzy, and the previously released Diablo 3.    My list right now for entertainment is:

  • Brainveg: catching up on Facebook, Twitter, and several blogs including Slashdot Science and Geek{Mom|Dad}
  • TV: shared with wife:  Dr Who, Top Gear America, Grimm.  Thank you Tivo!
  • Music:  Listening to more current music (compared to: 80’s), really enjoying Maroon 5 at the moment
  • Comics: Schlock Mercenary (I just got the new board game!)
  • Games:
  • Books: http://www.warriorcats.com/warriorshell.html  2 more left to read in the original series

Okay.  Family is home.. the game tonight was rough, my kid got tangled up and was the source of a PK; we lost 3-1.  One of his best friends got nailed with 5 seconds left, has a concussion (ouch).  Son and Wife are torturing the opinionated cat upstairs right now (lovingly), I better go and see what’s up.

Cheerio!

Selenium

I started using Selenium with my current client .. on the side, mostly because logging into the website involved: “wait click text text click click text click wait click wait click”. Additionally, any time I compile, it wipes my logged in session, and thus repeat. 

Last night at my son’s soccer game, I was chatting with another technical parent.. he was starting to use Selenium also!  In his case, Selenium IDE and converting that into code for tests.   Having played a bit with that side of things, and ending up with Selenium WebDriver + some ideas of how to do it nicely, I decided to compose this post to share my experiences so far. 

  • Code on Github (learning github for windows);
  • VS2012, Nuget package restore enabled;
  • Total time taken to write code (from scratch) = Less than taken to write this post talking about the code.  

Targeting NerdDinner

My client would have a cow (and a chicken, and maybe several other barnyard animals) if I put any of their code outside their network.  And I’d get fired.  So I recreated the pattern I am using against www.nerddinner.com.  A certain dude whom I respect created it as a demo website. It had about the right mix of complexity – it was not just searching on google  – but it wasn’t navigating gmail either.  Thank you Scott.

First Attempt at Code.

See github branch here; Excerpt from here

        [Test]
        public void MainPage_CanSearchForDinners_ButNeverFindsAnyInKY()
        {
            using (IWebDriver driver = new FirefoxDriver())
            {
                driver.Navigate().GoToUrl("http://www.nerddinner.com");
                var input = driver.FindElement(By.Id("Location"));
                input.SendKeys("40056");
                var search = driver.FindElement(By.Id("search"));
                search.Click();
                var results = driver.FindElements(By.ClassName("dinnerItem"));
                // at this point, i don't know what to do, as there's never any search results.   
                Assert.AreEqual(0, results.Count,
                                "No dinners should be found.. omg, if this works, then its worth it to change the test");
            }
        }
  • This code is using NUnit (out of scope for this post)
  • This is how you navigate
  • This is how you find things
  • This is how you send text
  • This is how you click things
  • Every time you run, you’re starting of with no cookies, so you’ll have to log in every time.

Whee.  Good start.  Okay, now lets get serious[er]. 

Second Pass At Code

Per the recommendations of Jim Holmes (@aJimHolmes, http://frazzleddad.blogspot.com/), whom I met in person at http://www.codepalousa.com/ and whom I have also derived a great deal of respect, I know what smells funny:

  • The first pass is very brittle.  If somebody changes an ID or a classname, you have a LOT of tests to go change.   Solution: Page Pattern
  • What does one do when one does not have a second bullet, but there seems like there should be one?

What I accomplish with all this Jazz:

image

The overall branch is here; the rewritten test here:

        [Test]
        public void MainPage_CanSearchForDinners_ButNeverFindsAnyInKY()
        {
            MainPage.LocationToSearch.SendKeys("40056");
            MainPage.SearchButton.Click();
            var results = MainPage.PopularDinnerSearchResults;

            Assert.AreEqual(0, results.Count,
                            "No dinners should be found.. omg, if this works, then its worth it to change the test");

        }

Much simpler.  The Page Helper Class is here, and partially looks like:

    public class MainPage : PageBase
    {
        public MainPage(IWebDriver driver)
            : base(driver)
        {
            Wait.Until(d => d.Title == "Nerd Dinner");
        }

        public static MainPage NavigateDirectly(IWebDriver driver)
        {
            driver.Navigate().GoToUrl("http://www.nerddinner.com");
            return new MainPage(driver);
        }

        public IWebElement LocationToSearch
        {
            get { return Driver.FindElement(By.Id("Location")); }
        }

        public IWebElement SearchButton
        {
            get { return Driver.FindElement(By.Id("search")); }
        }

  • The constructor takes and stores a reference to the Driver.  The calling program is responsible for creating and disposing the driver (as its an expensive resource)
  • It uses a PageBase class which creates an additional WebDriverWait (the Wait variable)
  • The constructor waits until we know we’re on the right page.  This allows us to click something somewhere else, and new up this object, and then wait till the page actually loads. 
  • Because this is the root of the website, I include a NavigateDirectly() routine which says “I don’t care where you were, now go to this page”.  I only do this on overview or login pages, the kind not derived from a click.
  • It exposes IWebElements to the callers (tests) so they don’t need to know where on the page various things are located.
  • In WebForms – I have to implement extension methiods which search IWebDriver and IWebElement for id’s Ending In Text, because ID=”btnSearch” ends up being “ctl00.BoogerBooger_04.HumDeDum_03.YabbaDabba.WickedBackbtnSearch”

Another excerpt (here):

public List UpcomingDinners
        {
            get
            {
                var upcomingDinnersUl = (from e in Driver.FindElements(By.ClassName("upcomingdinners"))
                                         where e.TagName == "ul"
                                         select e).FirstOrDefault();
                if (upcomingDinnersUl == null) throw new NotFoundException("could not find ul.upcomingdinners");
                return upcomingDinnersUl.FindElements(By.TagName("a")).ToList(); 
            }
        }
  • When doing complicated finds, I usually search By.ClassName or By.Id or whatever first, and end up with e.TagName second, because they do NOT provide an e.Id or e.ClassName routine.   (You can do e.GetAttribute(“id”) but I’m not sure if that returns null or empty, and nulls can be a bummer).
  • new ByChained(x,y,z) does not mean an element which matches x,y and z, but instead an element x which contains an element y which contains an element z.   

Third Pass – the Developer Helper

If I run the Console App which is the library that has all the page helpers, I get something like this:

image

  • The purpose of this app is to let me quickly get to sections of my website that I need to play around in.
  • The keywords yield a more detailed list; the more detailed list is used in navigation; using the old trick of:
    delimited = “|“+delimited+”|“; if (delimited.contains(“|xxx|“) … 

    which is what we did before arrays #GetOffMyLawn #WheresMyTeeth

  • Once the site is up, it stays there (until I choose somewhere else to go)

Additionally, in tests, I redid the creation/deletion of the driver as follows:

        [TestFixtureSetUp]
        public void FixtureSetup()
        {
            
        }

        [TestFixtureTearDown]
        public void FixtureTeardown()
        {
            AbandonDriver();
        }

        [SetUp]
        public void TestSetup()
        {
            if (Driver == null) Driver = new FirefoxDriver();
            MainPage = MainPage.NavigateDirectly(Driver);
        }

        [TearDown]
        public void TestTeardown()
        {
            
        }

        private void AbandonDriver()
        {
            if (Driver != null) Driver.Dispose();
            Driver = null;
        }

  • I am not creating a driver for every test; however if a test is going to mess up the relative state of a driver, it can be abandoned and a new one started.
  • This saves several seconds per test, which helps once you break the 5-6 test mark.  Especially if what is saved is not as much “start the driver”, but more “start the driver, go to the web site, log in, and get to the page of interest”.

Conclusion

Once you’ve done it once or twice, its remarkably easy to write some pretty neat tests.   This may not be the perfect way to do it, but its something that works for me; hope it works for you!

Minecraft #2/2: Layers of Adventures

When I searched for information about Minecraft, I found a lot of mind-numbing detail.. and a lot of tutorial videos.. but nothing I could use as a roadmap through the overall game (other than the achievements thing inside the game, which I somehow missed for quite a while).  So, I’m putting this together.  Its what I know so far.. there are many more things which could go on here, but I think this is the basics to get to the advanced stuff.

Adventures in Minecraft

Image creation notes – used desktop wallpaper from http://minecraftwallpapers.com/blueskys-96.html ;  Diagram created with CreateLy

I’ve tried to arrange all the above-ground stuff on the top-right, and the below ground stuff going, well, down.

One Side effect I have noticed:  When I first started playing, getting 4 blocks of wood seemed monumental, I had no idea of the scale at which I could grow and harvest things.  As a result, I held onto those 4 blocks, the single chest, etc, very tightly .. all resources were scarce.. till I learned how to plant trees and get renewable and efficient.  I think the same is true in real life … as I learn the patterns of real life, I go from being scared in the world to being confident and efficient. 

Click the image to zoom in on the detail. 

A Word on Mining

Each time I do a mine, I seem to pick a different pattern.. I’ve finally found one that I think I like.  Its related to Branch Mining Layout #1 in this Wiki article … with these additions:

  • The center section is 3×3 or 5×5 with a tunnel going straight up.   I’m having very good luck with branches every 6 (ie, skip 5 then start a new branch).
  • Try to keep all the ceilings 2 tall so that Endermen cannot teleport in
  • Use Wood Panels as markers – this way back to center – and as markers to know where I found something (because I’m filling as I go)
  • If I break into a cave, patch that enterance with wood paneling – which serves as a reminder to self, don’t open this.  (Problem: Mobs will spawn in there.  Endermen teleport.  Hence the ceiling height)
    • I suspect after I master lava I might try some creative way of killing all mobs in a cavern
  • Use Shift-F3 to see real light levels; drop a torch on the ground when RL=3 yields an overall lowest light of 8 between torches which prevents mob spawns.  Even better, use the torches at every 6 (branch mine) just as a pattern.
  • When I go down some levels, leave 3 blocks between levels (ie, go down 5) – and then do the branches the other way (if it was an east/west the first time, do north south the next time).

Bulk Mindset

I am finding that instead of doing things “just barely what I need” (ie, I need 4 wood, get 4 wood), its more efficient to batch up my operations.  So If I’m planting wheat, I plant 21 in a row yielding 63 harvest – which gives me a full stack.    If I’m creating torches, I create all 64 of them.    This way I’m not context switching all the time.

Further Adventures

These are the things I have not yet done (and may not get around to … or I might …)

  • Travelling in search of another NPC village (the one that my friends found, we didn’t protect the villagers, and now they’re all dead.)
    • “Villager Farming” .. growing the village (something about Golems?)
  • Visiting the other Biomes (or starting basic survival in one of them)
  • Building Railroads and Powered Rails for fast transport
  • Building above ground (everything I’ve done has been a hobbit-hole dwarven lair type of thing)
  • Building under water
  • Playing with Gunpowder and TNT
  • Playing with Lava
  • Playing with Circuitry
  • Pets
  • Enchantments
  • Endgame

Minecraft #1/2: What I love about Minecraft

imageThe last two weeks I’ve been spending every free waking hour (and some I should not have spent) playing Minecraft.  A lot of people don’t get it.. and that’s okay.  I have a lot of thoughts floating in my head, so here’s my geeky post.  #TrueToSelf  (image: view of HobbitHole v2.0 – showing tree farm, animal farm, sugar cane and wheat)

What I love about Minecraft – Background

Back in the 90’s, I coded the equivalent of BCL’s on an LPMUD (related: LPC programming language) named Vincent’s Hollow.  (Its dead now – the software doesn’t run on any modern O/S).  Some of these included: the standard monster model, weapons, armor, statistics/enchantments, talk and chat system, email client, etc.   It was the most fun I ever had coding in my life.   (In addition to learning OOP and how to build amazing reusable systems, I also learned what it takes to lead (herd) a group of volunteer programmers, teach people to code, and in retrospect, the most important, to love people for who they are.)

I also loved the games NetHack (well, Moria to be exact) and Ultima 5.  They had a top-down game play that worked well for me – using my imagination to see what that world looked like. It was seamless, I did not see blocks, I saw beaches and woods and paths and stuff. 

As I proceeded in my paid career.. every new technology I learned – and I’m dating myself here — Clipper, SQL, Perl, C#/.Net, Signal/R, Mongo – I dream[ed] of writing a Mud with it.  It has never truly left me.  (related: when I saw WoW, it raised the bar so high that I could never touch it.  The dreams subsided for a while) (related link: my 2004 attempt at a mudding livejournal.  Precious.) 

While being a Mud “director”, I also spent a lot of time thinking about where gameplay could go.  I saw people get up to the level max of 20, and then.. then what?  Not everybody wanted to code.   So I started designing what I called “Frontier Land”, where you could either gather resources yourself to build castles and civilizations, or rope the locals into labor (if you paid them well enough) to do a lot of that for you, so that the competition could be taken to “who has the coolest most successful city”.    It was going to be a randomly generated world, with forests, villagers, mountains, monsters, etc.  There was going to be a monster mode where you could “become” a monster (not leaving a certain area) to go and kill players.  There was going to be a Karma mode where your actions to help or hurt other people (never liked griefers) changed your “luck” which stayed with your soul.. and to create a character, you had to be born into the world (to parents), when that character died, it was gone, but your soul went back to the lobby.

Enter Minecraft

I look in the game, and what do I see..

  • A blocky, unlimited, randomly generated world
  • Where you can build systems and processes and stuff
  • With a client and server model, multi-player

It definitely taps into several of my core patterns.  It is feeding a part of me that’s been hungry for a while.   Right now I’m still exploring it as a game, but there’s a part of me that is looking at a bigger picture.

Aside: Minecraft also feeds my love of LEGO which is the predecessor to blocky worlds for me.  When I was 12, I used to try to recreate the dioramas of canyons where Wile E. Coyote would chase the Roadrunner using LEGO.

So What Now?

  1. I have a whole other post brewing about  a “build” order of adventures in Minecraft.   (It was going to be part of this post, but single-responsibility, KISS, so I’m refactoring it out to its own class… err, post.)
  2. My dreams of writing an awesome mud(lib) (again).. now are transformed.  I want it to look like Minecraft.   I could do it in C#, and Signal/R, and .. and.. and.. oh yeah, only at the opportunity cost of everything else in my life.    Darn it.   #LotteryNowDangit
  3. I have several adventures left to experience in Minecraft – carts, rails, mapping, lava, villages, and cats is the short list.

So What Now — Second thought – transformed

Why build new when there’s already something that works?  What if Minecraft started allowing for Lua scripting .. so people could write behaviors into the world in creative mode… building some amazing worlds, games, adventures.. for adventure mode?

It could inspire a gazillion kids into their first programs.. like Muds did for my generation of tweens.

Not to mention recreate C-Robots – program your monsters to a fight to the death.. arena.. with Lava flows to avoid.

In Conclusion

I’ll put in a link to the adventure build order post when I get that done.   I’m pretty sure my wife is going to wake up any moment now, and I have promised this day to making our house better.   And… POST!

Working from Home

I started an experiment this week –  I set up a home office, and I attempted to work from home as the rule rather than the exception.

Pro’s and Con’s

The “Previous” column applies to previous work situations, when I was not in a consultant role.  It helps highlight how awesome my current setup is.

Green = Better, Red = Lesser, Purple = Can Be Improved

Topic Work from Home Work at Office Previous
Commute Time 5-6 hours/week time gained back not commuting 120 miles Time to listen to cool podcasts like Hanselminutes; (annoying traffic) Best commute time ever = 7 minutes walking.  (UGS)
Boot/Flow “Roll out of bed, make coffee, log in, and absorb / plan the day; then take a shower, and start getting things done” => My energy flows into work more gracefully, not rushing things so I can “get to work” (I have a hard time getting started in the mornings)  
Owning My Home I get to experience the house all to myself.. it feels good. ++Introvert (Never at home by myself – left in chaos and came home to chaos.  Didn’t know anything  was missing)  
Music Listen to music out loud, sometimes sing along and dance while coding I close my door so people don’t get disturbed “Nice work Geddy Lee” – Sean H – in response to my singing out loud with headphones on – I didn’t know I was singing
Ergonomics Standing desk, wall mounted 25” monitors (eyes don’t work so good) can be upgraded  
Light (Basement) but I put a lot of lights in Nice big window, office, door I can close (cubicles are so cramped)
Equipment Purchase own equipment; choice
(but costs money)
Good stuff provided (crap for hardware)
Snack-ology Lots of healthy snacks (and some unhealthy ones too)
(Too easy to get to snacking)
(Must avoid Free Oreos and Pop) Not free = good?
Lunch Food Easy transport of leftovers – keeping the fridge clean! (I keep forgetting to bring in my lunch)  
Pets Dogs curled up at feet = warm footrests and easy to love on; take a break to snuggle with cat    
5 minute / long compile breaks Dishes / cleaning gets done, house cleaner, don’t have to do in evening, I like cleaning as a mind-wiper. I do the Kitchen Inventory and Burndown graph of coffee supplies I used to do Sam’s Club runs for Cheesy-Poofs at a startup
Post work flow Walk around the block = exercise = clearer head    
Errands Easier transition to errands — all my errands are near my house, not near work; Life works better.
(Loose the 6 hours that were gained here)
(Have to plan for errands meticulously)  
Geeky Friends   Love the lunch time conversations about everything geeky  
Working as a Team   Much easier to whiteboard / see where folks are at / interact (“We’re all in this awful thing together” team mentality)
Time worked / Time Taken (Too easy to ADHD/interrupt – must use the force to stay on target) Default focus = work, nothing else to do  
2nd Half of Day (3pm: Take a break, suddenly its tomorrow) 3pm: Take a break; still at work; get back to work  
Underlying Motive “Working to be of Service” is what sustains me, “working for the man” mentality slips away (Used to confuse the two – now getting clearer) (“Working for the man” mindset – see below)
Interrupts (Wife/Family interrupts – when they are at home.  Working on it) Very few, to the point where they are welcomed (constant interru- now what? –pts)

Conclusions thus far

At first I thought it was an either/or situation – I had a primo office at work, if I started working from home, of course I should give up my work office for somebody who wanted it.   However – we’re now expanding our work areas.  My work place is cool enough that .. I may not need to give up my awesome work office if I start working from home more – I can have both.

It also depends what project I’m on.  My projects right now are solo efforts – the only people I interact with are on the Client side – so not being in the office is no big deal.  However, if I’m working with buddies at work – I would really rather be at work than working from home.    Especially if there’s a whiteboard involved.   Note, there are lots of tools now to get that accomplished – but nothing beats face to face time when working on a problem with somebody else.

The Motive Angle

Working from home is cleaning up my motives. 

I didn’t realize it, but the last 5 years of working at a certain company, I totally bought in to the (subtle) mentality of “the world is against us, woe woe woe, how can we survive today”.  The focus was to show up, figure out expectations, get exactly that done to not get in trouble, sprinkle in some fun if anything left over, and call it good.    It wasn’t really about being of service – the people we were servicing felt like they owned us (since they brought in the money, and we were an expense), and all blame flowed down to development.  I could still be of service, but I had to dig deep.

When I switched over to my current job, I brought some of that “yes master” stuff over with me.  Constant questions on “am I doing this right, is this as expected”, etc … I had an underlying lack of confidence that what I had was enough, I kept trying to act in a play that didn’t exist.

At the old place, working from home was “tolerated” – they would say “we need you here to be present to help out”; I think the truth was more like “You might not be working” and “We own you”.    

The new place – we were having some office space difficulty – need new offices built out.  I had an Idea, and asked if me working from home temporarily would help smooth some of that over.  To my surprise, they said “no need to give up your office – try it out and see if it works for you; we have faith in you”.  I was floored.

So I did it.  And in getting all that set up, I realized.. that “I must work to meet expectations” model just doesn’t work at home.  The people to please just aren’t there.    So what am I left with? 

For me, the underlying answer has always been:  To be of service.  To solve the problem at hand.  To do the next right thing.    To make people’s lives better. 

So that’s what I’m doing.   

Mvc concepts

I’m reaching the end of my first professional (== I got paid) MVC application.

I learned a lot. This is an attempted visualization of most of the topics that I learned.   You may need to click in to see the details.

In addition, as I found good sources of information on the ‘nets, I included links in my source code in comments.  Here is a compilation of those nuggets of goodness. If your post is mentioned on this list — thank you.

Link Goodness
 http://stackoverflow.com/questions/4367723/get-enum-from-description-attribute Embedding meta-data about things in enumerations
 http://ayende.com/blog/1595/nhibernate-mapping-creating-sanity-checks (NHibernate) Integration test to validate mapping completeness
http://www.codingoptimist.com/2010/11/nhibernate-hidden-gems-speed-up.html (NHibernate) Caching configurations (gain: 1 second, not worth it, dropped)
http://stackoverflow.com/questions/325156/calling-generic-method-with-a-type-argument-known-only-at-execution-time Having multiple types with shared logic was a wonderful spot for co-variance, but after about an hour, it was time to move on
http://www.nickriggs.com/posts/getting-the-id-and-name-attribute-generated-by-typed-html-helpers/ I had to drop down to a TextBox with an @class setting, and thus I couldn’t use TextBoxFor, so this came in very useful
http://www.codeproject.com/KB/cs/stringenum.aspx Used by a coworker somewhere in the guts of an automatic model-to-.Where()-clause LINQ query extension
http://www.mikesdotnetting.com/Article/125/ASP.NET-MVC-Uploading-and-Downloading-Files Made it oh-so-easy for me to save and upload intermediate files from this file processing system
http://stackoverflow.com/questions/1151987/can-i-set-an-unlimited-length-for-maxjsonlength-in-web-config/7207539#7207539 Before we got the Grid getting only 1 page at a time, we were getting everything – thus needing this
http://code.google.com/p/autofac/wiki/Mvc3Integration Autofac was just amazing. It made sense to me! Its what I would have done if i was writing an IoC container…
http://slynetblog.blogspot.com/2012/03/using-aspnet-mvc-4-webapi-with.html Using ASp.Net MVC4 with NHiberate and AutoFac .. pointing me in the right direction
http://forum.jquery.com/topic/span-text-new-text-not-working-in-ie  <span/> to <span></span> did the trick, then I could .text() it
http://stackoverflow.com/questions/10588587/jqgrid-does-not-render-correctly-in-chrome-chrome-frame An annoying bug that sent me searching for at least 15 minutes
http://stackoverflow.com/questions/5248183/html-partial-vs-html-renderpartial-html-action-vs-html-renderaction When the views became too large, I could refactor|extract view
http://stackoverflow.com/questions/2498187/system-web-extensions-trouble-deploying-net-framework-4-website-on-iis7 The target server to install on did not have MVC3; so I had to include it in the XCOPY deploy