Friday, March 8, 2013

VB.NET Fixing vb.net system.windows.forms.axhost+invalidactivexstateexception

The hell dreaded vb.net system.windows.forms.axhost+invalidactivexstateexception error is probably the plague of many converting old VB6 applications to VB.NET, especially if, like me, you're new to working with either. Finally, finally, I stumbled upon a forum snippet on www.CodeProject.com, page http://www.codeproject.com/Questions/55699/AxHost-InvalidActiveXStateException, and the guy's problem wasn't even mine, and wasn't even fixed, but one lil ole line of code he had fixed my issue, at least a few of them. Add controlname.CreateControl() in your form's designer page, before the rest of its properties are set. In my forms it was Me.controlname.CreateControl(). For whatever reason, Visual Studio 2008 saw fit to not include this in its code conversion. Almost got sucked into other forum opinions that you need special Active X licenses to get such legacy controls to work in .NET.

Saturday, January 19, 2013

Robert Saylor dies after being handcuffed at Frederick movie theater | WJLA.com

Robert Saylor dies after being handcuffed at Frederick movie theater | WJLA.com

Better be effective followup by the news media and law enforcement on this. These employees' and deputies' actions better be scrutinized to the nth degree. Where was Saylor's aide companion when they confronted and agitated him? They couldn't see he likely had cognitive issues? Sure sounds like negligent homicide to me.

Tuesday, November 20, 2012

Zend, Zend, What Have you Done Now?

To paraphrase the Sam Jaffe character from the Flintstones send-up of Ben Casey, (Ben Caserock?), "Zend, Zend, What have you done now, Zend?
Yet another installation that the designing company imagines is a snap to get done. I decided I wanted to play with the Zend framework, because I like to torture myself. I decided against the all inclusive Zend Server, as I didn't need any more PHP installations, and looked to add ZF2 to my WAMP server instead. I placed the framework directories inside WAMP and created another directory to be my Zend playground.
I then did the recommended Composer thingee to get the sample skeleton project installed, but the official instructions didn't exactly go according to plan. Instead of running `php composer.phar self-update`, followed by `php composer.phar install` in the DOS prompt window, I first ran `composer self-update` as per someone's suggestion, but not entirely per their suggestion.
The suggestion had added that I should remove the .PHAR from the file name. Instead, what I really did was run the composer.bat file instead of the PHAR file. I then had to copy the composer.json file to my root C directory. The sum total of the json file is:
{
    "require": {
        "monolog/monolog": "1.2.*"
    }
}
Just make it in notepad. Then I ran `composer install` from the C prompt and got the skeletons out of their closet. That was not the end, however. Some virtual hosting had to be done.
Made all my preferred playground directory localhost aliases in Windows hosts file, created a playgrounddirectory.com.conf file in WAMP's vhosts directory, added the requisite <Directory> and <VirtualHost 127.0.0.1> groups to Apache's httpd-vhosts.conf file.
But still, the WAMPstones characters personalities are mixed up. One more little detail still needed to be attended to.
Had to add to Apache's httpd.conf file, the line `SetEnv ZF2_PATH "c:/wamp/ZendFramework203/library"`, the location where I chose to store Zend.(Zend came by default as `ZendFramework-2.0.3`, but I'm prejudiced against hyphens and periods)
I could have just called it `library`, or `stupid`, or anything, I suppose. As long as the Zend subdirectory within library could be found. Zend Caserock has finally returned all the WAMPstones personalities back to their proper characters.

Wednesday, October 17, 2012

Port 80 - The Friday the 13th of Web Server Issues

To paraphrase the late Ronald Reagan, after installing WebMatrix 2, "There you go again!"
Of course no sooner was WebMatrix 2 in use, I found my Wamp Server, which I now regret assigning to port 80, failing to start again. Apache couldn't open its logs.
The long and the short of this is:
1: The culprit was one that came back from the dead, Web Deployment Agent Service, resurrected by WebMatrix, which I needed for hosting MicroHard's IIS Express on my old creaky Windows XP system.
2: The solution (I hesitate to label it Final Solution, for both sensitivity and expectation issues), is to go into your registry.
3: First go into services from control panel/administrative tools, and stop that service.
4: Then go to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  • Scroll down the long list to MsDepSvc
  • Choose Parameters, and open ListenUrl to modify.
  • By default, unless you custom installed from the get go, should be: http://+:80/MsDeployAgentService
  • Change the 80 to whatever port you want to fob theis service off to.
  • In my case, I chose 8080. New value: http://+:8080/MsDeployAgentService

5: Reboot.
Keep track of your server ports, if you're like me and have begun to collect web servers like coins. I gave 8081 to Bitnami, 8082 to SQL reporting services, etc.

Thursday, October 4, 2012

jQuery $.getJSON is NOT Jason from Friday the 13th

Although at times $.getJSON can certainly seem like a maniacal mass murderer to those not used to working with it.
Tips for the unwary and clues for the clueless.
When iterating through data returned by $.getJSON, make sure you know when to refer to the subscripts as numeric arrays as opposed to associative arrays.
EG: From a typical json file:


{
"customers": [
{ "id":1,"name":"John Doe" },
{ "id":2,"name":"Sand Wich" },
{ "id":3,"name":"Meanmissus Jones" },
{"id":4,"name":"Hung Lo"},
{"id":5,"name":"Cardin Naal"}
],
"magazines": [
{ "id":1,"name":"Field and Wild","rate":29.99 },
{ "id":2,"name":"Car and Driven","rate":34.95},
{ "id":3,"name":"Unpopular Scientists","rate":42.95 },
{"id":4,"name":"TV Lied","rate":19.99},
{"id":5,"name":"Readers Indigestion","rate":24.99}
],
"subscriptions": 
{"1": [{"id":2,"startdate":"01/01/2012","enddate":"01/01/2013"},
{"id":4,"startdate":"01/01/2012","enddate":"01/01/2014"},
{"id":5,"startdate":"01/01/2011","enddate":"01/01/2013"}
],
"2": [{"id":1,"startdate":"01/01/2011","enddate":"01/01/2013"},
{"id":3,"startdate":"01/01/2012","enddate":"01/01/2015"},
{"id":5,"startdate":"01/01/2011","enddate":"01/01/2012"}
],
"3": [{"id":2,"startdate":"09/01/2011","enddate":"09/01/2012"},
{"id":3,"startdate":"01/01/2012","enddate":"01/01/2014"},
{"id":4,"startdate":"06/01/2010","enddate":"06/01/2012"}
],
"4": [
{"id":4,"startdate":"01/01/2012","enddate":"01/01/2015"}
],
"5": [{"id":1,"startdate":"01/01/2011","enddate":"01/01/2013"},
{"id":2,"startdate":"06/01/2011","enddate":"06/01/2013"}
]}

}


Say you're in a for loop, using i as the iterator to run through subscriptions, and starting i at 1: data.subscriptions[i] does NOT equal data.subscriptions[1], as in the 2nd subscript of a numeric array. It equals data.subscriptions['1'], with '1' (variable i's value) being the key, and the 3 groups of subscription data following it as the value (itself a numeric array in this case). For magazines and customers, however, magazines[i] would equate to magazines[1], the 2nd subscript (Car and Driven). In iterating through subscriptions, we're first going through the associate array from keys 1 through 5. Each of those contains a numeric array. If i2 starts at 0 for going through that array and i still ='1': data2.subscriptions[i][i2].id refers to data2.subscriptions['1'][0].id, the first subscript under key '1', with a value of 2. data2.subscriptions['1'][1].id equals 4, data2.subscriptions['1'][2].startdate = "01/01/2011", etc, etc.

Tuesday, October 2, 2012

Not So Fast Wise Guys!

Well ho dee do, if good ole Flickr, or should I say Yahoo, didn't hit me with a 200 most recent uploads visible limit unless I upgrade to a paid account.
Well that sure as heck ain't about to happen, fellas!
I've got eons worth of storage for my stuff on Facebook. What do I need y'all for?
I'll keep what I put on y'all thus far, but I'm a po' folk right now and you can't have any of my assets, such as still exist.

Just Opened a Flickr Account for Streetlights Site

New Flickr page for Streetlights Site is at http://www.flickr.com/photos/streetlightsite/. What the heck. If they're giving me the space, why not use it?