Wednesday, November 17, 2010

Ahh sweet debugging monkey..

I am building this C++ to C# bridge prototype to in order to investigate what it takes to allow IronPython or .NET assemblies as plugins for a big C++ code base.

All was well in the prototype but when I started integrating it into our code I started running into all kinda of crap. A series of mysterious EEMessageException etc. My VS2008 would indicate that an exception was thrown, from some hex address and the stacktrace would point to some random location for the source. This was pretty frustrating as that EEMessageException was not listed in the SDK.

.NET errors are also logged in the Event manager. However, the information there was useless (it just said Fatal Error). No dice there as well.

After doing all kinds of things (basically re-reading the Pratschner book) and starting with implementing my custom AppDomainManager , I started seeing some changes: different exceptions. Since I defined my own AppDomainManager which had to be loaded from a .NET dll, the exception changed to EEFileNotFileException. Again, no details whatsoever, but atleast now I can figure out that the problem is definitely that the assembly containing my custom AppDomainManager was not being loaded. Some more inspired googling later, I found this gem: Apparently I need to set my debugging type to Mixed (It was being set to auto and it obviously was not auto enough).

Now, the debug information was fantastic. I had specified blah.dll as the containing assembly and the debug dialog indicated that the missing files were blah.dll.DLL and blah.dll.exe. The methods simply expect the name of the assembly without any suffixes (makes sense when you think in terms of mono where it should ideally search for .so files).

Anyhow, once I figured this out, the debugger pointed out all the boneheaded things I had done (keeping assembly names in sync across C++, C# and python) it was easy to get it all working again and I can sleep well today :-).

Saturday, November 6, 2010

Issues with the Pro-Blend.

I loved these when I got them initially, however, the shine has worn off since and I see some issues when the gallon just I am pouring from is nearly full. The following images illustrate the usage.


 First you squeeze the jug so it can fill up the pro-blend. Here I am measuring out the Chemical Guys Microfiber wash. A very small amount as you can see.


Then you pour it out. The problem starts with this: notice how the tube (there is a tube inside connecting the bottom of the dispenser and ending at the bottom of the jug) is still immersed in the liquid. Since this pro-blend has no controllable valve, as long as the tube can pick up liquid it keeps on pouring it out. Speak about unbounded measurement error! Epic failure of duty!

As you can see, I have tried to minimize this by pouring it out in an awkward angle (instead of holding the handle above the level of the dispenser), however, the tube in my case is still not empty of fluid till I tilt the jug level: by which time most of the liquid in the tube has already flown out, once again messing up my calculations. Atleast now, the error is minimized to the volume container in the tube. Still, Incompetent design! to say the least.

Proper disposing of gas filled struts

I don't imagine this to be a problem occupying may minds :-). However, I recently replaced two aging gas struts which were failing to keep the weight of my engine hatch up. My plan, prior to the replacement was to dispose of the old ones at the S.M.A.R.T station where I go once in a while to dispose off scrap metal, used batteries, CFL bulbs etc (BestBuy also takes used bateries and CFL bulbs for disposal).




The warnings on the struts gave me pause though: It said Contents under pressure. Do not puncture, take apart, or apply heat. Since I assumed that the scrap metal handling will involve some sort of compacting and subsequent melting, I started seeing visions of exploding jagged scrap metal pieces! suitably scary thought.

Started researching about how one goes about properly disposing these things. finally found a good article (pdf) with nice pictures :-). Please note that the drilling is on the body of the shock and the other part with the dashed rod in the middle doesn't always look like that; sometimes the rod is exposed without any cover. The document indicates that my struts are of the high-pressure kind, so I know which instructions to follow. It does seem to require two things that once again, not many people I know have lying around:
  1. A vice (which by definition has to be mounted on a string stable surface)
  2. A drill with a 1/8inch or 2/3mm drill bit capable of drilling steel
Being a magpie when it comes to tools, I do have those lying around (one in storage and the a brand new Makita cordless drill and impact driver at home). I am not sure about the metal drill bit, however, drilling and breaking stuff is always fun ;-) and I am willing to buy a special drill bit just for this little project. If home depot caries it and it breaks while doing what it promises to, I can always get it replaced by them, so no worries there. I am also going to replace a leaking, much larger shock/damper on my car so I do need the practice on the smaller fellas I think.

I think I'll wait till I swap my suspension out to combine labor/HomeDepot/StorageTrip cost :-).

Wednesday, November 3, 2010

Android workaround for stupid bugs with adding a second gmail account

I have been parking under a big rock it looks like: wasn't aware that you can actually push a second google mail account to the gmail app. I was all set for integrating with my work google apps mail and calendar. I am running Android 2.1 on a HTC Hero.

My first experience went thusly:
  • Menu > Settings > Accounts & Sync > Google > follow the wizard
  • Add username and password
  • phone says "Hang on, communicating with google servers. This may take up to 5 minutes"
  • ........
  • phone says "Can not establish a reliable data connection to the server...." and then quits.
I thought maybe a phone issue and tried to update my profile, PRL, firmware etc and tried again. No dice..Same stupid dance. Googled all over the place and then finally found comment #93 which worked.
  • Android 2.1 and god knows which other versions are somewhat broken as far as their multiple account mail capability is concerned.
  • Use the included Youtube app to log in (use your google apps or google credentials). Don't worry if authentication fails.
  • Now go to Menu > Settings > Accounts & Sync and you'll find that the account you attempted to use with the Youtube app has been added.
  • Simply enable syncing and you are good to go.
Of course, life cannot be this simple. Apparently calendar syncing is not allowed for secondary account. So you'll still have to share all secondary calendars to your primary account and hope for the best (my work calendar is somehow setup to only allow the sending of busy/free status and it is either this restriction or someother issue that prevents it from being shown on my phone). So much for enterprise usage of this. Gah! Well life goes on. My old WM6 phone was complete crap and Android 2.1, while it behaves like a beta, is still better.

Maybe it is all HTC's fault. However, it says "with Google" in big bold letters on my Hero so Google definitely is proud of what they are putting out, warts and all. At the end, all software companies must likely choose to triage and decide to release with em bugs. Thank god (and intrepid experimenters) for workarounds.