Jason Copenhaver

the stuff

March 19th, 2009

Observations From Off The Grid

My wife and I recently went on a nature trip.  Three days hiking and sleeping in the woods, followed by two days at a campground nearBrooksville .  I turned my cell phone off on Friday and didn’t turn it back on until Tuesday.  Loved it.  Just some thoughts I had along the way

1.  It’s actually really easy to go 5 days without twitter, facebook, RSS feeds, digg, etc.  All told nothing that important happened while I was gone, and it’d probably be the same for any week out of the year.
2.  Natural bug repellent doesn’t work, or I’m just too damn delicious.
3.  Nothing is more peaceful than canoeing down a river, even one that is only 6 inches deep.
4.  State parks don’t allow alcohol.
5.  The dog drinks just as much water as we do but he’s too small to carry his own.

March 9th, 2009

When Link Order Matters

I don’t usually pay too much attention to the link order when I’m adding libraries to my application.  Something says you need “foo.lib”, open up the project properties and drop in “foo.lib”.  This failed for me recently.   I was trying to statically link two internal libraries that share a significant code base.  At first I was confronted with a dozen errors about colliding symbols.  This didn’t bother too me too much at first.  Colliding symbols are pretty easy to take care of, just rename one set of them, these are both straight C libraries so nothing fancy.  After making my changes I made a sample project that just linked to both of the libraries to make sure I had resolved everything.  To my surprise I now had a dozen NEW colliding symbols.  After careful inspection I noticed that the link order was different and this was indeed hiding colliding symbols.  This is when I thought back to that option “Enable Function Level Linking”  A very handy function that allows the linker to take only the functions it needs from a library when building the final application.  However, if you have two libraries with the same symbols and one of them has function-level linking enabled it can hide these kind of errors.  The linker will happily take a function from foo.lib and then when it sees the same function in bar.lib, that has function-level linking enabled, it’ll simple ignore it because it doesn’t need it.  Worse if you really wanted the function from bar.lib, you now have the function from foo.lib so there is a very good change something will break in a mysterious way.  From now on I’m going to try and keep my function-level linking libraries in the front of the link list, and try keep my legacy code from colliding with my other legacy code.

April 5th, 2008

What I’ve Learned

In my on going effort to do things outside of my comfort zone I purchased a Mac Pro last month. I’ve used windows professionally my entire career and I’ve run Linux as my main OS at home since 2000. I’ve never spent anytime on a Mac though, until now. For the most part it has been a smooth transition. The fact that it is built on a BSD core means I can always open up a terminal and feel pretty at home. MacPorts has also helped a lot in that it allows me to run some of the same apps I’m used to. I guess I haven’t bit the bullet completely because I still use Firefox as my browser, and I run a lot of webapps. However I do that so my environment feels the same whether I’m at home or at work. The following are just a couple of things I’ve had to deal with.

1. The biggest thing is the keyboard differences. I didn’t realize how much I used ctrl+c,ctrl+v until I had to switch to option+c, option+v. Then there is the way ‘del’ key works. It works more like a backspace in certain apps. Also ‘del’ doesn’t do anything in finder. To delete something you have to do option+backspace. Which really throws my keyboarding off. And something I absolutely couldn’t live with was how home and end behaved. Home and End go to the beginning or end of the document rather than the line. This annoyed me to no end. I finally found this helpful website that made terminal and firefox behave like I expect.

2. OS X has file attributes that don’t show up in terminal. I found this out the hard way. I had shared a folder into a virtual machine but couldn’t for the life of me get the virtual machine to overwrite any of the files. The VM (Virtual Machine) though it was read/write and terminal said it was read/write for everyone. I finally did Get Info on the file in Finder and saw that it was ‘Locked’. Unchecking that fixed everything. This probably happened because the file was originally copied over from an NTFS drive where the file was set to read-only and OS X was trying to do the right thing. There a couple of tools that allow you to see this information in terminal that I’ll use next time I have a file issue.

3. Something not at all related to Mac but rather a Vista issue. My VM is running Vista x64 so I can do some development for work. I have to run my copies of Vistual Studio 6.0, 2003, and 2005 as administrator to make them work in Vista. But I couldn’t for the life of me get them to open a shared drive in the VM. I wanted the files to live on my native drive and then be mapped into my VM. However this just didn’t work. If I ran a non-administrator application I could access the files just fine. This caused me hours of frustration and I finally turned off UAC (User Access Control) and the problem went away. There really should be a way to do this without turning UAC off but I can’t find it.

February 24th, 2008

Heinrich’s German Grill

My wife and I stopped at Heinrich’s German Grill on Friday night. Apparently this place has been hiding right under my nose for close to a year now. My sister had mentioned it to me, and happened to be there with some of her friends as well. The interior is much larger and better lit than it looks from outside. The owner’s/chef’s are right behind the bar cooking up some wonderful home cooked German cuisine. They even hand out some peaches or cream puffs to my sister’s ~4 yr old daughter when she sits at the bar. I had Heinrich’s Superior Schnitzel and my wife had Potato Pancakes covered in goulash. My schnitzel came out wonderful, lightly fried with two eggs, green beans and bacon on top. A number of dishes come with bacon on top so I’ll be back to try those as well. I think my wife did better than me though as the potato pancakes were just unbelievably good. They have five or six good German beers on tap and I didn’t ask if they had anything else. I’m thrilled to find a nice German place in town. Now I can vary my nice bar meals between Heinrich’s and Shakespeare’s.

Be sure to check them out

Heinrich’s German Grill
8420 Lockwood Ridge Road
Sarasota, FL
941 355-5453.

January 27th, 2008

words of the day

Timely
ROFL
Bonus
Jade
Zinc
Towny

I dumped a bunch of scrabble cubes out on my desk and this is what I came up with.

December 8th, 2007

First 5K

31st Annual Sandy Claws Siesta Key Beach Run
40:29 – At least I did it.

July 16th, 2007

Federalist No. 1

I’ve been interested in the founding of the USA off and on for a couple of years now.  I really enjoyed reading Founding Brothers and A Brilliant Solution.  It’s been so long since I’ve read them though that I don’t have any insight to share.  I have however started on a new journey.  After reading the U.S.Constitution and Declaration of Independence over the 4th of July I got interested in our nations earliest days again.  So I have decided to read “Selected Federalist Papers” from Dover.  This collects 35 of the 85 essays written to help convince the people of New York to ratify the U.S. Constitution.  These essays were written individually by Alexander Hamilton, James Madison, and John Jay.   I figure there probably isn’t a better place to find out why the Constitution is the way it is, other than maybe James Madison’s extensive Constitutional Convention notes, than these papers.  My goal is to slowly make my way through 35 essays here jotting down small notes or phrases I particularly enjoy.  And then either read the rest of the essays or move on to a book that has in-depth commentary to help me out.



The first paper of course tries to set the stage, and is written by Alexander Hamilton.  He sets out his goal explicitly with “Happy will it be if our choice should be directed by a judicious estimate of our true interests, unperplexed and unbiased by considerations not connected with the public good.”  And he of course recognizes the optimism in this statement, following it with “But this is a thing more ardently to be wished than seriously to be expected.  The plan offered to our deliberations affects too many particular interests, innovate upon too many local institutions, not to involve in its discussion a variety of objects foreign to its merits, and of views, passions and prejudices little favourable to the discovery of truth.”  He is no idealist thinking that people will immediately see the beauty of what he has worked so hard to create.  He understands that human nature will interfere with his plans.  Then he goes on to extend an olive branch to his opposition, something you see so rarely in today’s political atmosphere.  “It is not, however, my design to dwell upon observations of this nature.  I am well aware that it would be disingenuous to resolve indiscriminately the opposition of any set of men (merely because their situations might subject them to suspicion) into interested or ambitious views.  Candour will oblige us to admit that even such men may be actuated by upright intentions; and it cannot be doubted that much of the opposition which has made its appearance, or may hereafter make its appearance, will spring from sources, blameless at least, if not respectable — the honest errors of minds led astray by preconceived jealousies and fears.”  He ends with reassuring his readers that he has his own biases and those include his utmost support for the new Constitution and his plans to lay out the reasons for his decision.  I eagerly await the next essay.

May 22nd, 2007

VCProjectEngine and x64



    At work I’ve been porting a bunch of 32-bit C applications to 64-bit.  To do this I’m running Windows XP x64 edition and having fun finding the little differences between 32-bit and 64-bit Windows.  On these projects we are strict about our Visual C++ project settings.  We have probably half a page of settings that must be tuned just right before our changes will be accepted into the source repository.  Like any good programmer I hate checklists.  Checklists are mundane things that eat up a lot of my time for very little in the way of results.  I also think that machines are much better at checklists than I am.  So I did what any self respecting programmer would do, I wrote a program to ensure the project settings were always correct.

     Microsoft is nice enough to provide a barely documented set of COM classes inside the VCProjectEngine namespace.  Yes, the vcproj files are XML.  And, yes, I could have written an XML reader, but then I would have had to figure out the different enumerations and default values when an element wasn’t present.  The COM classes seemed like the way to go.  I fired up Visual Studio 2005 and created a new C# GUI application.  The first problem I ran into was that I needed to target the x86 platform when building.  This is pretty obvious, I can’t have a 64-bit application loading a 32-bit DLL, Microsoft.VisualStudio.VCProjectEngine.dll.  Once I fixed that and got my code checking all of my settings I realized that I didn’t need a whole GUI.  I figured it would be easier to just run it from the command line and possibly integrate it into the build system. 

    So I started up a new C# Console application and copied all my code over.  Then I ran into a much stranger problem.  I’m porting these projects to target the x64 platform so those are, of course, the settings that I’m interested in checking.  However, every time I listed out the platforms from VCProject.Platforms it would only show me x86. This meant that I couldn’t access the build configurations that were targeted to x64.  This didn’t make any sense because the code worked just fine in the C# GUI application.  I banged my head against my desk for awhile and rummaged around Google for a bit and came up empty handed.  I started comparing each file in the projects for differences and something finally caught my eye.  The C# GUI application had [STAThread] above the main function.  So I
figured I’d give that a try.  Sure enough, once I added that to my console app it was able to see the x64 platform just fine.  I have no idea why the Single Threaded Apartment attribute has any affect on the platform detection in VCProjectEngine but it apparently does.  I never bothered to learn much about COM Apartments so the little I do know doesn’t offer me any clues.  If anyone knows why this is I’d love to know.  Or maybe this is just a bug in VCProjectEngine?

April 24th, 2007

Tire Pressure

Almost two years ago I took a road trip up to North Carolina.  I however did NOT check my tires before embarking on the 13 hour drive.  So at about 3am my rear tire blew out and I had to wait around for 4 hours until the closest garage opened up and was able to give me a new tire.  This wasn’t fun.  Not fun at all.  Ever since then I’ve become pretty anal about checking my tire pressure.  Now my life just got a little easier.  My Accu-Pressure Safety Caps arrived in the mail today.  These are great little tire valve cap replacements that give you a quick visual indication of your tire pressure.  I installed them and lo and behold one of my tires was low.  They’ve already helped out.  I’m getting ready to start a 60 mile daily commute for work so these things will really help me keep my tire pressure in check.

March 27th, 2007

Jenny! 86-5309!

I needed to send a package via FedEx the other day so I did a quick Google search for their number to schedule a pickup. It landed me on this wonderful page. Which, as of this posting, lists the number 1-800-22-6161 as the number to call to schedule a pickup. The astute reader will notice that it is missing a digit. (Note the missing digit isn’t a ‘2′, that is JCPenny’s number) I found another phone number for FedEx and was able to get my packaged delivered anyways. I also had the urge to be a good Netizen so I wrote them a short email letting them know there was a slight error on their website. This is the email I got back.

Dear Mr. Jason,

Thank you for writing to FedEx.

With reference to your mail, we kindly request you Contact us in Customer
Service Number on 1800226161, Mumbai 25708888, Bangalore 9880170000, Chennai
9840570000, Delhi 9818170000, you may also visit our website at
www.fedex.com or you may email us at inmaster@fedex.com.

Sincerely,
<name removed>
FedEx Customer Service,
Mumbai, India.

<name removed>
FedEx Customer Service Associate
Mumbai, India

Phone number : 91 22 25708888
Toll free number : 1800 22 6161
Fax number : 91 22 25700836

The important thing to notice is that they would like me to call them on the
same 1-800-22-6161 number. ohh well.. I tried..

Update: 04/16/2007
A reader pointed out that the FedEx page I linked to is most likely the FedEx India contact page. And the phone number has been changed to be a 1600 number rather than a 1800 number. My bad for not looking more closely. I’m a little surprised that it is the first page returned for “FedEx Pickup” via Google though. Maybe more people in India use FedEx than in the US?