Wednesday, August 29, 2012

If your iTunes songs are getting cut off...

...you may have a very simple solution.

I just moved my iTunes library to a new machine and found that a huge number of my ITMS purchased sons would cut off at odd points in the song (but for songs from the same album THEY ALWAYS CUT OFF AT THE SAME PLACE - oh iTunes how I sometimes hate you... ;) )

Anyhow, I chanced upon a solution to this (which I gleaned from a post 30 posts deep in an apple forum) which requires you to create a new music library and simply import your previous library into it.  This sounds complicated but it is, in fact, quite simple.

To do this, I held down the shift key (either one should work) when starting iTunes and iTunes gave me a little dialog allowing me to create a "new Library" which I did right next to my old one.  Then, after iTunes opened onto this new and empty library, I simply chose File|Library|Import Playlist and located my old library's base "iTunes Music Library.xml" file and imported that - bingo, it imported everything from my previous library.

After validating that this worked, and that my music was now playing properly, I consolidated all my files into my new library folder.

Hope this helps someone the way it helped me.

By the way, I believe that on OSX you hold down the option key when starting iTunes to replicate this approach.

Monday, June 25, 2012

Word 2010 Table Of Contents nightmare...

...I need to preface this with "I am a total moron when it comes to anything other than basic Word or other Office product features."

I have a large document that is an API reference manual (around 200 pages) and I am updating it every so often as new releases are made available.

One of the problems I've always had is that my very carefully formatted and styled Table of Contents tends to get hosed up every time the page numbers need to update (which seems nonsensical to me considering that they're chained to particular styles in the document and should, therefore, update auto-magically.)

What always seemed to happen when choosing "update fields" is that the entire table would get reformatted.

Well, I found another way to trigger updating the fields in the TOC but simply by clicking in the TOC and pressing F9 which brought up a little dialog that let me specify to ONLY update the page numbers and bingo - updated TOC.

I'm sure this is dumb, and I should have found this 5 minutes in, but just in case there's another one of me out there - here you are my fellow nin-cow-poop (to quote Bugs.)

Saturday, June 16, 2012

C# calling a C++ DLL, things NOT to forget

Whatever you do, no matter how rusty you are at doing this, remember to set the calling convention on your DllImport statements.  I spent two hours last night trying to track down a bizarre AMD ATI driver bug in a 3D rendering dll I was writing - it only occured when the platform was x86 and the requested feature level was DirectX 11, all other feature levels worked fine and everything worked fine on x64 from the get go.)

I went to bed frustrated (and tired - it was 1:45AM and I wasn't planning on that last night - lol) and woke up annoyed, and after finding very little mention of the problem on the inter-tubes figured I was doing something stupid (since it is unlikely I'm the one discovering a 'new' problem with an ATI driver and Direct3D.)  As usual, assuming I screwed up has paid off in spades.

It turns out that I was suffering some sort of stack corruption that was screwing up the creating of devices and swap chains in DirectX 11 and the root cause was my ASSumption about the default calling convention of a DllImport.  I figured it was cdecl, and my C++ dll is sprinkled with __cdecl export definitions; unfortunately, (and here's where I wasn't thinking very well) the default convention is OF COURSE WinAPI.

Once I specified the calling convention my mysterious and bizarro AMD driver issues suddenly vanished, and I have now moved on to more mysterious and problematic bugs.