Navigate/Search

Archive for the 'Debugging' Category

Tech Recipes and Other Goodies

Friday, July 10th, 2009

From the actual Tech-Recipes (dot com) site I found an interesting method of extracting files from MSI files which brings me to a few other useful utilities I know of.

Universal Extractor
cabextract
CabExtract (1.02 as of this post)

Then there is “The best MSI Extractor” article by Julie Smith… smart chick whoever she is.

For the geeks you can “View and Extract CAB File Contents Programmatically.“  I found a related newsgroup (scraped) article that notes a few other links as well.

Now for CAB files I absolutely cannot do without MSCEInf (2.6 as of this post) (French homepage).

Put dependencies under source control

Thursday, February 12th, 2009

Another Stack Overflow gem in “How to use Office from Visual Studio C#?“  The question was exhausting but one of those who responded had some sagely advice:

The answer is to “Copy Local” whatever assembly dll you get for the interop. Once you have the assembly dll in your output folder, add a reference to it, and check it into source control.

Now everyone has the referenced assembly dll.

—anonymousstackoverflow

Now I’m sure to some that may sound like kindergarten learning but it never dawned on me to put external dependencies under source control.

In this fashion a set of legacy developers can maintain legacy code while emerging standards developers can maintain the latest emergent standard — both separated from the other one’s development.

I’ve had a light bulb and it’s warm.

Useful PHP class for debug output

Wednesday, February 11th, 2009

JASLabs has a useful little class for iterating object properties, as well as all GET and POST variables.  The comments yield another useful tidbit.

If you are using Firefox, LiveHTTPHeaders is a useful tool. It’ll show you your GET and POST, as well as all HTTP request/response headers, for every request your browser makes.

Using this, you can also sneak debugging output into your headers (thereby preventing it from affecting your HTML rendering) by doing something like this:

$key = "MyObject";
$message = serialize(get_object_vars($myobj));
header("X-Debug-$key: $message");

Another Gem from The Code Project – Clean Visual Studio Workspace

Wednesday, February 11th, 2009

Clean Visual Studio Workspace is handy for a couple reasons for me, the first of which is understanding what can and cannot be cleaned.

Here’s a related utility.

And yet another add-in straight from MSDN.

Another gem from The Code Project – Simple Windows Forms Properties Spy

Wednesday, February 11th, 2009

A simple Windows forms properties spy is an essential tool despite its simplicity.

ImageFlow script causes a 503 error – here’s the fix?

Tuesday, February 10th, 2009

And now I’m battling a 503 error due to mod_security.

mod_security: Access denied with code 503. Error normalising REQUEST_URI: Invalid character detected

This link from the Menalto Gallery forums was dead-on my exact problem (experience-wise) and then it derailed into something totally unrelated.  This link from the LiteSpeed Support Forums I thought would be of help in regards to making sure PHP had enough memory and it had enough time to execute.

I’m still struggling trying to figure out what part of the “reflectionN.php” causes problems.

Here’s one straight from the boards of my host, DreamHost.

It’s actually the one that got me thinking.  I re-examined the support documentation and the examples and finally found the problem.

Well, sort of…

If I use:

reflectionGET: '&height=20%'

…nothing appears at all on my Linux host —– Windows host is fine.

If I use:

reflectionGET: '&height=20'

…it starts working, but not in a way I can figure out.  Plus it seems to greatly affect the height and position of the image.

I looked in the code and saw that the part that handles the “height” value is setup to strip a percent symbol (%) if it comes with one, but the other ‘reflectionGET’ values do not strip the percent symbol.

So for whatever reason that particular aspect is wonky.

  • fade_start
  • fade_end
  • height

Those are the values that behave differently and erratically between my Windows and Linux hosts.

Environment Variables

Saturday, February 7th, 2009

XPhttp://vlaurie.com/computers2/Articles/environment.htm

Vistahttp://vistaonwindows.com/environment_variables.html

You’ll note that the Vista page is basically the XP page.

Linuxhttp://lowfatlinux.com/linux-environment-variables.html

You’ll note that this is a reference and doesn’t serve as a printout of the ‘env‘ command.

Easily register your DLL and OCX files

Saturday, February 7th, 2009

You can quickly do it from a command-line with:

regsvr32.exe dynamicLinkLibrary.dll

…and to unregister you simply throw a switch:

regsvr32.exe /u dynamicLinkLibrary.dll

However I ran across a nifty shell utility that apparently has been in front of my eyes for years.

RegSvrEx

For ActiveX developers, adds items to the shell context menu of DLLs and COXs that provides registration and unregistration – like running regsvr32, but much more convenient.

You can also grab the VC++6 / ATL source code for RegSvrEx here.

Make sure to check out both pages of Mike Lin’s site.

NOTE: I’m adding this to my debugging category so I don’t have to tag it.  Plus I think it is useful to debugging — perhaps not at the code level but at some point during the testing and implementation of the application.

%20 and other odd happenings in URL strings

Tuesday, January 20th, 2009

I’ve been doing this for years but apparently someone finds it interesting.

On a JavaScript enabled site (meaning your browser allows JavaScript to execute on that page) you can type this in your browser’s address bar:

<br />javascript:location.href = decodeURIComponent('http%3A%2F%2Fblog.brainsicksolutions.com%2F%3Ffoo%3Dbar');<br />

This particular one changes the current URL to the decoded URL which happens to be:

http://blog.brainsicksolutions.com/?foo=bar

For those who think JavaScript shouldn’t have semicolons let me assure that you need them when typed directly into the address bar or bookmarklets.  Otherwise JavaScript won’t know where a statement ends and begins