Kyle XY = Stranger In A Strange Land

Kyle XY

Kyle XY

Have you ever wished for a Kyle XY book to hold you off during the season intermissions? Great News! One was written almost fifty years ago.

I’ve been attempting to read all 100 of the top sci-fi books, and #6 checks in as Stranger in a Strange Land By Robert Heinlein. While I’m not quite done the book, the protagonist, Michael Valentine Smith, is very similar to Kyle XY, infact I’d be willing to bet the the writers of Kyle XY have read this book at some point in their life time.

In an attempt to avoid possible spoilers, I’ll just say both characters exhibit abilities

Stranger In A Strange Land

Stranger In A Strange Land

beyond normal humans, but it’s clear in both cases we (normal humans) are not living up to our potential. Some of the those abilities both Kyle and Michael even share. They both struggle with adjusting to human society and offer a critique of it. They are even the same approximate age!

Right now I’m a huge fan of both so if you’ve never heard of the book, give it a try. If you enjoyed the book, I recommend you give the first season of Kyle XY a shot.

UPDATE: About an hour after reading this I found out Kyle XY was cancelled. Boo. That blows, and just a note to ABC Family, it was the only show I watched on your network, and one of the few that I watched live instead of on the DVR. I think you made a mistake.

Well now, I think this post holds a little more value, Kyle XY fans, go pick up this book, at least you’ll be able to enjoy that.

UPDATE #2: After finishing this book, I’m not sure Kyle XY fans will like it. It was written in the 1960′s and gets pretty “hippy” on you towards the end. The dialogue tends to drag on. It is like Kyle XY in the sense where Kyle and Michael Smith were the interesting parts of the story but it gets so far off track with the other characters that you can lose interest.

How to turn GridFocus WordPress Theme Into 2 Columns

I love the GridFocus theme by Derek Punsalan found at 5thirtyone.com.

The only thing I would change, is i’d rather it be even more simple as in two columns instead of three. I’m not expert with WordPress, so take this simple 12 step program for what it’s worth. Here’s my quick guide to removing the third column. I hope it’s the correct way to do it:

1. Log into your dashboard, go to Appearance, then Editor.

2. Select the stylesheet, style.css

3. Find #mainColumn about half way down.

4. Change the width from 420px to 640px. Save.

5. Select Single Post, single.php.

6. Comment out the second column found at the bottom, Example:

Original:

<?php include (TEMPLATEPATH . ‘/second.column.post.php’); ?>

New:

<!—<?php include (TEMPLATEPATH . ‘/second.column.post.php’); ?>—>

7. Save

8. Select Main Index Template, index.php.

9. Repeat Step #6 and #7.

10. Select Page Template, page.php.

11. Repeat Step #6 and #7.

12. When using widgets, put them in the Shared space.

Goodbye AxWebBrowser

It wasn’t a perfect marriage, but we made it work. Your early death was documented here: IE7 Broke My AxWebBrowser!!!

I didn’t like how fat you were, between MSHTML and those two references I can never remember AxSHDocVw and SHDocVw. But you worked, and that’s all I ask.

To move over to the default WebBrowser component that comes with VS2005 I require the following things:

  1. Able to complete form items automatically.
  2. Able to click buttons on the page.
  3. Execute javascript functions on the page.
  4. Handles the new window and allows me to pop it into another web browser control.
  5. When doing #3, my ASP.NET session persists.

Ok, first we start with able to complete form items automatically.

WebBrowser1.Document.GetElementById(“txtUserName”).SetAttribute(“value”, “username”)
WebBrowser1.Document.GetElementById(“txtPassword”).SetAttribute(“value”, “password”)

CHECK!

Next, can we click a button?

WebBrowser1.Document.GetElementById(“btnLogin”).InvokeMember(“click”)

CHECK! So far much simpler than AxWebBrowser.

Now for the javascript function.

WebBrowser1.Document.InvokeScript(“myFunction”, New String() {“hello world”})

CHECK! Going great!

Here’s where we hit a snag. While WebBrowser has a NewWindow, it doesn’t give us any access to the URL. After some googling, I found someone who extended the component. Follow the directions posted by armoghan on 12/6/2007 found here.

So with that, you are given the event handler called NewWindowWithTarget, inside that event I place:

Dim frmWB As New Popup
frmWB.WebBrowser1.Navigate(e.Url)
frmWB.Show()
e.Cancel = True

And the session maintains!

And then my popups are handled! Except when I go to test it on some virtual machines, I find it does not work for Windows 2000. The author of the post did not indicate this, so I did some research. What he’s using is the NewWindow3 which was introduced with Windows XP SP2. If NewWindow3 fails, it moves on to NewWindow2 which pops up a separate IE process and loses the session. It works on IE6, IE7, or IE8 as long as you are Windows XP SP2 or higher. So that kills Windows 2000, and you can not even get IE7 for Windows 2k, so I’m screwed.

We had to make a tough call and we decided it was time to let go of Windows 2000 support. It’s been almost 9 years since it’s creation and 4 since Microsoft began to end the product life cycle. We’re able to lose the old AxWebBrowser and all the extra baggage. I hate to do it, but what choice do I have? Keep using IE6 for years?

Sigh. Check.

York County Archives Deserves Some Credit

There’s a field I’m nearly obsessed with and it’s very rare for my age: Genealogy. I’m only 26 and have a degree in computer science, so nearly every site I visit related to genealogy makes me want to cry. Sure, the big ones like Ancestry.com are wonderful, but there’s so many sites out there that would be better in plain text. In a field revolutionized by computers, there is still mountains of information hidden in bad websites or simply not indexed. If I were to strike it rich tomorrow, I’d retire and spend the rest of my days volunteering to help convert some of this information to something more accessible.

And then, I stumbled upon the York County Archives site. WOW. My home town, has as far as I can tell, the best archives site on the earth. After finding their site, I search nearly all the local and major counties I could think of. Not one even came remotely close.

They have most of the records indexed and search-able. When you find a record, it has some information right there. Some very valuable information. This service alone would earn this site as one of my all time favorites, but it gets even better. You can order photocopies of any records listed. Now, you’re probably thinking that has to be expensive, Death Certificates from some counties run $18.00. Nope! Not at http://www.yorkcountyarchives.org/ It’s $1.50 per page for email or fax. If you go there in person it’s 50 cents.  If your total order is under $10, it works on the honor system, and they send you your documents first.

Document From Archives

Document From Archives

So, I had to try it. I submitted a request for 3 marriage applications. One containing a relative whom I’ve never been able to find out who his parents were. I hoped for 3 pages of a simple application, one for each marriage, and expected the cost to come in under the honor system of $10, so I could get a quick taste. Well, about an hour later I received an email back explaining that it was 11 pages and thus $16.50. 11 pages! I couldn’t wait to see it. While they only take Discover cards, I was forced to snail mail a check, it arrived a day later. By noon, I had a PDF in my inbox with all 11 pages. Each marriage had the application, the certificate, and parental consent! I know I’m a dork but this was really great.

Lucky for me, the vast majority of my relatives are from York County, so I may have to pay the archives a visit, at the very least I may be ordering a few pages a month for a long time.

How the site became so great is still a mystery to me, I suspected some IT shop won a contract and turned around a great project because compared to the other sites it didn’t seem like archives really worried about their sites. But I can’t find any branding on the website indicating a contractor. If this was an in house project, I’m really grateful for the people at York County Archives.

Thank you York County Archives!

IE7 broke my AxWebbrowser!!!

Today was a rough day.

The application I work on is a click once app, that contains a heavily integrated web browser. At first I went with Visual Studio’s default web browser control, but because of it’s short comings, I went back with the COM component, AxWebbrowser from the VB6 days.

Life was fairly well with AxWebbrowser, until I upgraded to IE7. While it still navigated, i lost nearly all of my event handlers, thus making it worthless. It took quite some time for me to even realize it was IE7 that broke it. I had upgraded weeks ago, and completely overlooked this huge flaw in the system the whole time, thinking it was something completely different.

So, being really under the gun, here’s what little I know. When upgrading to IE7, I lost NavigateComplete, DocumentComplete, and NewWindow2 events. I still had the Enter and ClientResize events. I tried removing the control, removing the automatic handler code, and even creating the handler manually, all to no avail. It never hit the breakpoint.

I was able to find an older copy of AxSHDocVw.dll and SHDocVw.dll in one of my previous projects. SHDocVw.dll was four kb’s smaller and had a different modification date. AxSHDocVw.dll was the same size but also had a different modification date. I tried copying over these new files, and referencing them to no avail.

There’s not much on google about this problem, some guy said enable scripts in IE7, which I thought was crazy but couldn’t find the setting he was talking about to completely debunk it. Some said IE7 developers did this by mistake but offered no help. Other than that, just a lot of confusion and Microsoft complaining. I wonder if Microsoft may be attempting to get a little more secure by cutting out this feature rich browser.

Likely for me, my supervisor had no upgraded yet, so we were able to load the project up and deploy it on his IE6 machine. I am happy to report that IE7 makes no changes to the project, it’s just not developer friendly from an IE7 machine. The client machines running on IE7 or IE6 only have problems when an IE7 machine published the project, the clients browser does not matter.

So, I’m not sure what I’m going to do in the next few days to try to ultimately resolve this. Here’s my thought process:

  1. Try removing IE7 and see if everything is back to normal, a short term and unlikely fix.
  2. Perhaps IE7 while killing AxWebbrowser, finally brought their default webbrowser up to snuff.
  3. Take a serious look at either a Google Chrome component or a Mozilla component.
  4. Pray.

Well, I made this blog to solve tough issues where google fails, me and it’s rare. But like the empty click once message, I was shocked how little information there was out there on this problem. So, I’m posting this as a place holder, if I solve this problem I promise to come back and let you know how I fixed it. If you don’t see an update, you can assume I failed.

UPDATE: Uninstalling IE7 did not fix this. My AxWebbrowser control still does not work. I might as well put IE7 back on.

UPDATE: Checked in to geckofx. Seems like too big of a reference and some complaints about slow start up time. Chrome’s chromiumembedded seems promising but it’s not even in beta yet. Back to the WebBrowser control.

UPDATE: I went with the Visual Studio default Browser, and was able to reproduce what I did in AxWebBrowser, how I did it here:  Goodbye AxWebBrowser