Wednesday, October 17, 2012

Guitar Practice

Well, for anyone that has been talking to me lately I am sure I have mentioned guitar.  I have picked up my acoustic again and have been practicing.

I am teaching myself this time (did some Guitar at work, groups lessons of about 15 students with one instructor a couple years ago).  I am following the Justin Guitar method from Justin Sandercoe at http://www.justinguitar.com.  The lessons have been going well and I have ordered his Beginner Course Book and the Beginner Songbook.

I've had the question, what songs are you practicing.  Here is a list of the current rotation:


  • Wonderful Tonight, Eric Clapton
  • Heart Of Gold,  Neil Young
  • Let It Be, The Beatles
  • Hey Jude, The Beatles
  • Hallelujah, Jeff Buckley
  • China Girl, Iggy Pop
  • A Penny More, Skydiggers
  • Wonderwall, Oasis
  • I Walk The Line, Johnny Cash
  • Stand by Me, Ben E. King
  • Head Over Heels, Blue Rodeo
  • Sugar Mountain, Neil Young
  • Dust In the Wind, Kansas
  • Yer So Bad, Tom Petty
  • Good Riddance (Time of Your Life), Green Day
  • Hotel California, Eagles
  • Til I Gain Control Again, Blue Rodeo
In Justin's course he recommends getting a practice partner to play with.  James at work (who I worked with at Bridgewater Systems several years ago) has joined me in practicing once a week.  We do some practice (1 min Chord Changes, Finger Gym) and then play some songs for about 1-2 hours.

We also practice throughout the week and plan to start practicing the same songs from Justin's Beginner Songbook so we can play those when we get together.  Then we can do more of a jam session once a week.

Tuesday, September 25, 2012

The Camera Really Does Make a Difference

My wife bought me a, long yearned for, Canon EOS Rebel T4i for our anniversary.  Fittingly, I gave her a photo album of our trip to Nicaragua including commentary.

Canon has been used in both our families for years so it's a trusted brand here.  She did a ton of research to find the best value for features and I am super excited about the camera.  I've already been able to catch the kids in action better than I was capable of with previous point and shoots.

Most recently I have been using the Panasonic Lumix DMC-TZ5 (great but it picked up a scratch recently and photos were showing up with a blur), the Sony Cybershot (bought in Tunis, Tunisia when I realized I forgot to pack the charger for the Panasonic and could not find a charger in the city), and several over older models.

For our trip to Nicaragua I got to use a Nikon Coolpix AW100 waterproof point and shoot.  This camera took great photos, had very little options (good for some), and was waterproof.  But not waterproof enough.  It gave out on us part way through the trip unfortunately when some water leaked into the housing and fried it.

I've also been a firm believer in not picking up a Digital SLR until I was no longer carrying diapers, emergency changes of clothes, and other items for young kids.  So, the time was right to move up to something new to play with.

Here are a couple of the pics I've taken so far.

This one is of my youngest.  He is super active so getting a non-blurry photo of him can be difficult.  I went with the Moving Subjects mode for this photo to catch him in action as we played outside.

Tonight I tried taking a photo of the boys Dragon Castle, first with the Fully Automatic Shooting mode, flash on:

Then I tried with HDR Backlight Control, meant for backlight conditions but which works in low light conditions as well.  This mode takes 3 photos rapidly, with each photo at a different exposure setting.  The photos are then combined to make one photo.  Here is the same castle with HDR in the same lighting conditions with flash:

I also experimented with one of my favourite techniques of focusing on the foreground and blurring the background.  Technically, this has to do with focal length and such but basically, tilt the camera to cause it to focus at the close distance of your foreground, then tilt it back up to take in our background and you'll get the effect.  This can be harder with point and shoot cameras.  Here's one of those using my sons table top soccer game from earlier in the evening:

Well, that's one of my current new pastimes.  Now back to practicing another, guitar.

Wednesday, September 19, 2012

Xcode: unexpected unqualified-id

I just ran across this error "unexpected unqualified-id" and several other strange ones that reminded me of working at a dev shop that used just Windows PCs.  As was the case way back then, sometimes someone would send a snippet of code in an email.

Or through email code reviews that we did.

Sometimes, an unsuspecting dev (read me) would cut and paste some of this code into a file and get compiler errors out the ying yang.

The culprit was Outlook's way of putting unprintable characters into rich text.  So, when you cut and past the string into most IDEs, they did not show the character either and everything looked great.

In the case of Outlook it would convert spaces to some other character than the ASCII space char.

Ok, with that in mind, I just ran into the above error "unexpected unqualified-id" while grabbing a snippet of code from a code review.

I ended up just looking at where Xcode's ^ indicator said there was an error and deleted around that area until I found the bad char.  How do you know you found it?  You hit delete and your cursor does not move and nothing on screen gets deleted.  It's like a hiccup in your backspace.  Then you are good and can add in the couple chars you deleted.

Presto magic, compiler errors fixed.

Wednesday, September 5, 2012

Wireshark on Mac Crashes When Changing Time Format

Ok, once you know why you will say, "Ya, what did you expect?"  But hey, I have been a bit sleep deprived so give me a break.

If you are using Wireshark (on Mac) and say, man, that Time column is messed, let's see some Dates with time instead of what Epoch time?

Ok, great, right click the column, choose to edit the column details and change it from the default to "Absolute date and time".

Now, why does it hang for a bit?

Well, if you are like me and left Wireshark running for a day or so while you are tracing a networking issue you might not notice how many frames you captured.

Say just under 2.5 million.

Whoops!!

Wireshark now has to reprocess each of these packets to convert the time to your desired format.

I said you'd say, "What did you expect?"


At least the reprocess is only going to take about 7 minutes.

.....about 7 minutes later...

Ok, not so good.  Maybe that would be, reprocess and then crash.

Serves me right.

Time to go sniff some more packets.

Tuesday, August 28, 2012

Mac OS X Lion: kernel_task with High CPU

My Mac has occasionally been going nuts and the fans start spinning up like crazy.  Tonight I sat down and took another stab at finding the culprit.

First I took at look with Activity Monitor but nothing obvious in My Processes.  So I switched to All Processes to see what root processes were doing.  Bingo, a nondescript Process Name called kernel_task was eating up just over 100% (110% before turning off some apps).

I read this article (Kernel_task process taking up an inordinate amount of CPU) at MacFixIt, which indicated to start cleaning stuff up (ya, I knew that, housekeeping). 

First I uninstalled some stuff that sounded good but which I just never use:
  • ShoveBox
  • Eye-Fi
Ok, CPU usage on kernel_task now down to about 104%.

Then I brought up the System Preferences -> Sharing panel.  In here I had Bluetooth sharing on for a previous project but I am not currently using it.  So I turned that off.

Bingo!  Kernel_task is down to about a peak of 4% CPU usage now in a steady state (ie. when I am not opening new processes).

The basic gist is that kernel_task is a catchall for a multitude of system processes and hence it can take some rooting around playing with settings to get it to decrease.  Good luck.

Friday, August 24, 2012

Git + Code Collaborator: Post Checkin Code Review

Sometimes you submit your code before you setup a review with code collaborator.  Here are a couple ways to create a code review with code collaborator for git checkins.  I will cover the standard cases, before you stage the code, once the code has been staged for commit, and after you have submitted the code.

With Unstaged Changes

This one is easy, nothing special needed.
git status 
# On branch master 
# Changes not staged for commit: 
#   (use "git add ..." to update what will be committed) 
#   (use "git checkout -- ..." to discard changes in working directory) 
# 
# modified:   changedFile.m 
# 
Now run the command to add a diff of the modified files:
ccollab addgitdiffs new

With Staged Changes

This is not very tricky, but you do need to give the git diff option for staged files, --cached.

git status 
# On branch master 
# Changes to be committed: 
#   (use "git reset HEAD ..." to unstage) 
# 
# modified:   changedFile.m
 Now run the command to add a diff of the cached/staged files:
ccollab addgitdiffs new --cached

With Committed Changes

This one is more tricky.  You have committed the files.  Let's use reflag to see the commits.  Then take the SHA1 hash of the commit you want to diff and the previous commit do a diff between commits.

git status 
# On branch master 
nothing to commit (working directory clean)


As you see, git status will not show any changes since you committer your work.

git reflog
aa90bc4 HEAD@{0}: commit: Changes I forgot to code review.
bb37e6c HEAD@{1}: commit: Some other changes
......

Now use the SHA1 hash of each commit to make your diff:

ccollab addgitdiffs new bb37e6c aa90bc4
Now you should have a code review with the difference between your changes and the previous commit.

Hope that helps

Wednesday, July 18, 2012

Fixing dyld image not found on Mac OS

If you've every used command line process and wanted to relocate it you may have run into the error:

dylib: Library not found:
....
Reason: image not found

You can fix this by doing the following:

  1. Figure out what libraries are dynamically linked to the process using:
    • otool -L process_name
    • Note: You may have to do this for each dynamic library as well and change the paths for the libraries in the dynamic libraries you are linking into your process.  As you can tell this can result in a lot of changes but if you want to move stuff to a new location, it's your best option, as compared to building from source all the required libraries and process.
  2. Change the path of those dynamic libraries using:
    • install_name_tool -change old new process_name
UPDATE:

While relocating the library paths for the library I was working with I came up with a pattern of steps to fix this:

Run: otool -L .dylid For example:

otool -L libintl.8.dylib
libintl.8.dylib:
/opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.1.0)
/opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 635.19.0)
 Then notice that we want to change /opt/local/lib/ to /mypath/lib/.  To do that you need to run:
install_name_tool -change /opt/local/lib/libintl.8.dylib /mypath/lib/libintl.8.dylib /path/to/libintl.8.dylib

This works great until you run into this error:

install_name_tool: changing install names can't be redone for: /mypath/lib/libintl.8.dylib (for architecture i386) because larger updated load commands do not fit (the program must be relinked)
[Reference: http://annoyingtechnicaldetails.wordpress.com/2007/04/18/install_name_tool-changing-install-names-cant-be-redone-for-for-architecture-ppc-because-larger-updated-load-commands-do-not-fit-the-program-must-be-relinked/]
To fix this you need to recompile the library with options to enable the relocation of the library paths.  If the library uses configure then chances are you can add these options to the configure to make it build such that the path for the libraries are relocatable:

  1. Add this to your LDFLAGS=-headerpad_max_install_names
  2. And if available use the configure options: --disable-rpath --enable-relocatable Reference[http://www.manpagez.com/info/relocatable/]
  1. So for example here is an example for libiconv:
./configure --prefix=/mypath/ --disable-rpath --enable-relocatable LDFLAGS=-headerpad_max_install_names


Sunday, July 8, 2012

Change Apple Logo on your Mac in Lion

On Mac OS X Lion, you can change the Apple logo to your own logo.  Let's do that now.  Here's a BB logo we want to use:

Grab the file and copy it to your system (let's say /Users/YOUR_USER_NAME/Downloads/BBRocks_256x256.png).

Then open Terminal and type the following to backup the original file:

sudo cp /System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/A/Frameworks/LoginUICore.framework/Versions/A/Resources/appleLinen.png ~/Desktop/

And then this to copy over the Apple logo with your new logo:

sudo cp /Users/YOUR_USER_NAME/Downloads/BBRocks_256x256.png /System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/A/Frameworks/LoginUICore.framework/Versions/A/Resources/appleLinen.png

Since you are running sudo, you will have to enter your password.  This is due to the fact you are copying over the original file which is owned by root.

Now your login window should look like something like this:

Friday, June 22, 2012

Xcode 4, I love you but why do you treat me this way?

When you work on legacy systems (ya, I am calling 10.5 and 10.6 legacy, get over it) you have to work with older dev tools.  So, using Xcode 4 has been something I have only done occasionally in my spare time and when writing prototype code.

Production has been Xcode 3.x until recently.

Sweet, I get to go to the new (ok old) hotness.  So Xcode 4.3.3 we meet.

As first, there were some early courtship fumbles as we got to know each other.  But now I feel like we've been together for a few months, I know where you like to store your derived data, and you know I a fanatic about build clean, build.

But why do you have to keep springing these crazy fits on me.  I mean I try simple things and you just disappear.  Sometimes a simple, sorry, I'll try again is not enough.

Sometimes I have to say, ok, let's start over baby.  I'll just reboot and then it will be like we just met again for the first time.

E...
x...
c...
e...
p...
t...

it's not the first time.

You have a memory like an elephant.

Why just tonight when I opened a project in the wrong folder (it's my Perforce workspace I am using as the backing store for my git-p4 repo, don't ask) you just wouldn't let it go?  I mean, I know, I am sorry.  I said p4 instead of git.  WRONG FOLDER!  My fault!  Let it go!

Then to mess with me, after I restart again, you open the wrong project again without my noticing.  I know, the name was git not p4.  So you get even by launching the git version underneath the p4 version; with the windows aligned perfectly.

What's a guy have to go to get you to forget my mistake?

It's ok, I didn't mean it.

Let me restart you again.

Sunday, February 12, 2012

Making the Leap to Music on BlackBerry

Disclaimer

So you bought a PlayBook on a screaming deal.  Excellent, and thanks, I work at BlackBerry and appreciate your faith in us.  Like you I am a user of BlackBerry products as well and I work with Media (specifically Media syncing).  I write this blog post from the point of view of a BlackBerry user, not an employee, so don't take this as official from Research In Motion (the makers of BlackBerry).

Purchased Music and Your PlayBook

Perhaps like me you have been using iTunes for years to purchase music.  iTunes has been a great source of content as I have moved from physical media to digital content.  I won't talk about the BlackBerry options for syncing your iTunes library to your PlayBook but take a look at the BlackBerry Desktop Software if you'd like to do this.

What I want to talk about today is making the leap to purchasing music on your BlackBerry PlayBook and show you how easy it is to do.

First, swipe up your PlayBook and go to the Music Store app.

Next register a new account (and your credit card with 7 Digital) if you need to, or login to your account.  To get to your account swipe down to get to the "Options".

Purchase some music and you are done for purchasing music.

ReDownloading My Music Later (ie. Do I lose my music if my PlayBook gets wiped?)

Ok, easy, but let's talk about losing your music.  Like what if you had to reset your PlayBook.  Losing Music is not Cool!  (Note, I have never had to reset my PlayBook, I am just using it as an example, I could also say what if it was stolen, lost, you bought a 2nd BlackBerry, etc.)

No problem.  When you are your PlayBook setup after wiping it, or maybe after setting up your 2nd PlayBook, let's get your Music back onto your PlayBook.

Open the Music Store again.


Now choose the "My Purchases" tab to see your past purchases:

Cool, there's your Music.  Let's select my Flash Gordon soundtrack...

"Flash Ah AH...Savior Of The Universe!"....ah, sorry, where were we.  Right, downloading my previously purchased music.

This being Flash let's download the entire album by selecting the Download button under the artwork.

Sweet, here comes Flash.

What if I have a 2nd Device like another PlayBook or a BlackBerry Bold?

No problem.  On the 2nd PlayBook:
  • Do the above.
On the BlackBerry Bold (or Curve or any BlackBerry that has the 7 Digital Music Store App):
  • If the 7 Digital App is not installed on your phone, go to the App World app and search for 7 Digital.
  • Download the app.
  • Setup your 7 Digital account.
  • Download you music.
Purchasing and using music on your BlackBerrys is easy and you can rest assured that you can get your music later when you want it on a new device.


Read More About