Tuesday, November 24, 2009

Windows Media Player & S3

After some work I discovered that Windows Media Player (WMP) 9 through 11 on XP intermittently fail to play MP3 files hosted on S3

The 64 Bit Encoded S3 signature might contain an escaped plus which WMP does not handle correctly.  So for example we expect this signature to go untouched.

Signature=pXucORkPxykKvQo%2B0Hv17jvSPVE%3D

Is improperly re-escaped (mangled) by WMP as the following. Notice the + and the equal sign.

Signature=pXucORkPxykKvQo+B0Hv17jvSPVE=

When decoded by Amazon's servers the plus is interpreted as a space and therefore neither the 64 bit encoding, nor the signature are valid causing the download to fail.

Wireshark was a huge help in watching the traffic flow and proving that WMP was mangling data.

Reset the Active-X Information Bar

I was doing some Active-X control testing where an Active-X control was not loaded and the Information Bar is displayed.

sshot-199

In one test I allowed the control to be run. I needed to undo that choice but couldn't figure out how. On Windows Vista with IE the solution was in the registry under:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Stats

The specific Active-X control is specified by CLSID. So in my case it the Windows Media Player Active-X CLSID is 22d6f312-b0f6-11d0-94ab-0080c74c7e95.

Removing the subkey that specifies the domain caused the information bar to appear on reload. In the example below I removed iexplore\AllowedDomains\ringrevenue.com

image

For Windows XP & IE 7 you will only see the key "iexplore" (no subkeys). Delete the iexplore key.

Wednesday, November 18, 2009

MySQL & InnoDB

InnoDB is our preferred database engine.  Use show engines to see if InnoDB is enabled.

show engines \G

show table status \G

When changing the InnoDB log file size make sure you remove the ib_logfile* files.  If you don't the server doesn't start cleanly and you get an error in /var/log/mysql.err such as the following:

InnoDB: Error: log file /var/lib/mysql/ib_logfile0 is of different size 0 5242880 bytes InnoDB: than specified in the .cnf file 0 67108864 bytes!

I found the DB install scripts in RightScale does not do this, causing me hours of pain for a simple task.

Tuesday, November 17, 2009

MySQL @ 3:00 AM

So here is what I learned while working with MySQL at 3:00 am

  1. usernames have to be 16 characters or less.  30 minutes lost rebooting a mysql server.
  2. Triggers have a "definer" that specifies the security context the trigger is run in.  So when restoring a database if that user doesn't exist you will run into problems.  That I could find there isn't an easy programmatic way to reset the definer of a trigger.  Presumably you could remove and recreate the trigger, but doing that is a pain in the ass too.

Thursday, July 10, 2008

Email Etiquette

A while back I was talking about email etiquette. Here is a good resource, EmailReplies.com

I particularly like, 11. Don't leave out the message thread. Finally someone admits that top posting is a good thing.

Top Posting

The arguments against email top posting have never swayed me.

 Wikipedia tells me top posting on newsgroups is bad and I believe them. I don't use newsgroups so I don't know about that posting style. I can see the point since both news readers and web interfaces (Google Groups) group the threads together by default. I assume the feature works pretty good in those cases.

There is an RFC saying "When replying to a message, include enough original material to be understood but no more. It is extremely bad form to simply reply to a message by including all the previous message: edit out all the irrelevant material." Seems the problem top posting is trying to solve is "that top-posters often word their replies on the assumption that you just read the previous message, even though their perversity has put it further down the page than you have yet read". For email this seems like a valid assumption to make. And, like Raymond Chen points out if you add people to a thread you had better tell them why and what you want them to do. Corollary, "don't forget to ask your question." So really people need to learn to communicate better?

Email clients top post by default. Inboxes are sorted in chronological order. GMail is awesome and groups conversations and hides the redundant parts. Grouping seems to work as long as the subject and/or some magical included ID doesn't get removed. But we all know cases that client grouping fails. Worse yet, someone(we know who you are) wants to email you so they reply to any old email lying around with your name on it.

Every professional I have ever seen top posts. They seem to like having the entire email should I want to see it or forward the entire thread to some one. And don't get me wrong, quoting relevant portions in a top post, or inline responses are still good practices. This person, although not a fan, points out the benefits of Top Posting in a business setting. (See When Does Top Posting Make Sense?)

Since I spend most of my time in a business setting where top posting helps so I will keep going. We stopped being worried about the number of bits being transmitted and stored 10 years ago. Top posting can't be that confusing and at least in business the benefits outweigh the negligible costs.
7/10/08 Edit
EmailReplies.com agrees with me too.

Sunday, June 08, 2008

Clipboard Problems

On Windows if your clipboard stops working it may be one of the following:

As pointed out by Raymond Chen

Tuesday, April 15, 2008

Programming Pointers

I need to read up on C/C++ linkage and I came across embedded.com series called Programming Pointers by Dan Saks. Well written with examples and summary tables. I will be reviewing more of his work if/when the need arises.

Of interest to me were the following:
Linkage in C and C++
Storage class specifiers and storage duration

Sunday, March 09, 2008

Over Constrained

My last post I mentioned I need a wiki.  I used WikiMatrix to evaluate a few solutions and none of them jumped out at me.  I realized my best bet is probably just to signup for a hosting service.  Jaimi likes BlueHost and they have Tikiwiki and Wordpress.  I could have everything in one place.

Then I over constrained the problem.  If I am going to get a hosting service I need a domain.  What should the domain be?  I have no idea, I have been toying with that idea for two years and I can't converge.  I tried NameBoy to get suggestions, and read the BLADAM post saying I should use a made up word that isn't too long, easy to spell, and doesn't sound like other words.  That just over constrained my over constrained problem.

I am not going to settle for scottherriman.com (17 characters) because unless you are an artist, using your full name is lame (sorry if yours is).  Herriman.com is taken.  I think I want the domain to be professional software related.  I am open to suggestions, you have any?