Monday, November 29, 2004

GBPVR Widgets

As I began writing plugins for GB-PVR, I noticed that some things were being done in code that seemed to be repeated over and over between the plugins (and even within a plugin). Specifically, the creation of listboxes within a plugin seemed to really bloat the code, because the plugin author has to maintain the list, handle navigation, and then render the list.

So, I thought it would be handy if plugin authors could have a reusable library of widgets (controls, functions, data structures, etc) that would handle a lot of the harder stuff, and allow the coders to really concentrate on the "business" logic.

A design challenge was how to make these things skin-friendly. Sub has put a lot of effort in making GB-PVR skinnable, so I want the widget controls to make it even easier, if anything. I decided that the controls themselves would not be skin-aware. That is, they have properties like "Font", "BackgroundColor", etc, that the MenuTask item (a.k.a., the plugin) will control. In this way, someone could use a widget control "out of the box".

However, by adding a layer between the MenuTask and the WidgetControl, I can have a totally skin-aware container to hold the controls, and offset some of the user-interface functions (like navigation, focus handling, messaging, etc) to this middle layer. I'm calling this layer the WidgetForm, and it will also have the ability to deserialize WidgetControls from XML representations. This will hopefully enhance the skinning (by giving the ability to totally change control look-and-feel outside of code), and what's even better, is that it could be extended to allow for some design-time manipulation of the controls (i.e., a skin designer).

I've started a Sourceforge project to contain this effort. For now, I'm taking on a lot of the design and development in order to establish the initial direction of the project. But, once I have a solid start and a beta release, I'll gladly give up control if a team wants to continue to expand the library.

I welcome any .NET developers to join the development team. I've brought Jorm on to assist when he's got time (he's already helped me test how CVS works). Just shoot me an email or PM on the GBPVR forum, and I'll give you details.

Tuesday, November 23, 2004

Another Topcoder Challenge

Well, I did a little better this time around. For the longest time, I was actually in first place within my room. And then the system testing took me out (dropped me down a few positions).

Actually, I was a little careless in my unit testing and didn't test the simplest test that they provided. And wouldn't you know, that's what took me out.

The challenge problem dealt with parsing an English sentence and then translating it into some other language. So, a sample sentence might be "The dog jumps to the cat". In parsing this, my code needed to recognize that "The dog" was the subject, "jumps" was a present-tense verb, and "to the cat" was an objective preposition (or something like that) with "the cat" being the actual object. I would then have the components needed to perform the translation logic.

So, I tokenized the sentence into a string array, which worked fine. I then methodically determined the subject, verb, what kind of subject, the tense of the verb, etc. I also had code to handle the object, but this was optional data per the problem description.

At some point in the coding, I inserted a line of code to try to get the object by index number. In the above sentence, my code would do something like: obj=words[5] (and then obj would equal "cat").

Well, turns out that I inserted this line before my code that checked if there were more tokens (meaning, if there was an object). So, the test data was something like "Jason codes", and I was trying to perform: obj=words[2]. Since there's only 2 elements, index 2 (which would be the third element) is out of range.

Scoring is based on how quickly you submit a solution that compiles, so that's why I was pressured to not perform all example tests that they provided. I'm kicking myself now, because instead of losing another 10 points or so for the time that it would have taken me to run the last simple test, I lost 600 points (or so) for the entire problem.

BLAH! (kicking myself)

Wednesday, November 17, 2004

ILWWCM 2.0.1

I began working with ILWWCM 2.0.1 this week. I can't believe that they call this thing a production-level content management system (it feels very much like a beta product, and is limited in so many ways).

Setting it up was a little bit of a hassle. At least for me, Mr. Microsoft, who has been spoiled with Installshields for everything in the past. I had to pull out the old text editor to make a lot of configuration changes--things that I would have hoped that W.A.S. could have taken care of.

And since I installed it four different times, that meant doing the manual steps of the installation four different times. This includes copying the contents of the web-app folder into the installedapps .war folder, and editing the aptrixjpe.properties, aptrixsearch.properties, and connect.cfg files to find-and-replace about five variables to match your configuration.

I got wise after that and created a VBScript file (executed using Windows Scripting Host) to do these manual steps for me. And, thanks to the Internet, I'm placing it here for the world to use. Disclaimer: This is provided as is with no warranty or support. Use at your own risk.

Install ILWWCM into WebSphere Application Server per the IBM instructions. Some specific things that I chose to do:

context = ilwwcm
app name = ILWWCM
binding = server1 (port 9080)

When I got to the part of the installation instructions where they talk about editing the config/property files and copying the web-app directory, I just run my script. Then a restart of WAS and I was on my way.

Save this script to a .vbs file in the ILWWCM install directory (the one that has "app", "contentportlet", and "web-app" directories in it), edit the script to change the values to match the server's configuration (comments tell you what to replace), and then run the script either using wscript (i.e., double-click in Explorer) or cscript (i.e., from cmd prompt).

Tip: Copy this and paste it into Notepad, then save as a .VBS file (i.e., configme.vbs) in your ILWWCM install directory



'---------------------------------------------------------------------------------
' ILWWCM INSTALL HELPER SCRIPT by JASON F011@$ 11-17-2004
'
' JUST TO HELP GET AROUND THE PAIN-IN-THE-A$$ FILE COPYING AND FILE EDITING
' THAT IS REQUIRED WHEN SETTING UP ILWWCM 2.0 (and perhaps earlier)
'
' OBVIOUSLY, THIS IS A WINDOWS SCRIPTING HOST FILE, INTENDED TO BE EXECUTED
' ON A WINDOWS SERVER. NOT USING WINDOWS? FOLLOW IBM'S PAINFUL INSTRUCTIONS
'
' ALL RIGHT, IT'S NOT ALL THAT PAINFUL, SINCE THERE'S ONLY 3 FILES THAT NEED
' A BUNCH OF FIND-AND-REPLACINGS, BUT AFTER ABOUT THE 3RD INSTALL, I STARTED
' LOOKING FOR AN EASIER WAY TO DO THESE LITTLE TASKS
'---------------------------------------------------------------------------------
option explicit

dim scriptpath
dim WAS_INSTALLED_APPS
dim WAS_APP_NAME

scriptpath = left(wscript.scriptfullname, instrrev(wscript.scriptfullname, "\"))


dim variables
set variables = createobject("scripting.dictionary")

'------------------------------------------------------
' CHANGE THIS VALUE TO THE PATH WHERE YOUR WAS INSTALLED
' APPLICATIONS ARE (no ending slash)
'------------------------------------------------------

WAS_INSTALLED_APPS = "C:\WebSphere\AppServer\installedApps\myserver"




'------------------------------------------------------
' CHANGE THIS VALUE TO THE NAME THAT YOU GAVE THE
' APPLICATION WHEN YOU INSTALLED IT INTO WAS
'------------------------------------------------------

WAS_APP_NAME = "ILWWCM"




'------------------------------------------------------
' REPLACE THE FOLLOWING VALUES WITH ENVIRONMENT-SPECIFIC
' VALUES AS NECESSARY
'------------------------------------------------------

variables("[HOST]") = "myserver"
variables("[PORT]") = "9080"
variables("[CONTEXT_ROOT]") = "ilwwcm"
variables("[WEB_APP_HOME]") = replace(WAS_INSTALLED_APPS, "\", "/") & "/" & WAS_APP_NAME & ".ear/ilwwcm.war"
variables("[ILWWCM_HOME]") = replace(scriptpath, "\", "/") & "app"

variables("file:///") = "file:" ' Per IBM documentation






'-------------------------------------------------------------------
' Everything that you need to change should be above this point
'-------------------------------------------------------------------







' Kind of messy, inefficient because each set of code is repeated for each config
' file, but I'm okay with that for now. If I get a chance to refactor, then I'll
' make this a lot cleaner.


dim fso
set fso = createobject("scripting.filesystemobject")


'--- Make sure that the samples are where they're supposed to be, else abort

if not fso.FileExists(scriptpath & "app\config\samples\aptrixjpe.properties") then
wscript.echo "Could not file sample aptrixjpe.properties. Be sure that you
run this script from the root of your ILWWCM install directory."
wscript.quit
end if

if not fso.FileExists(scriptpath & "app\config\samples\aptrixsearch.properties") then
wscript.echo "Could not file sample aptrixsearch.properties. Be sure that you run this script from the root of your ILWWCM install directory."
wscript.quit
end if

if not fso.FileExists(scriptpath & "app\config\samples\connect.cfg") then
wscript.echo "Could not file sample connect.cfg. Be sure that you run this script from the root of your ILWWCM install directory."
wscript.quit
end if






'--- Back up any current existing config files using timestamp-based suffixes

if fso.FileExists(scriptpath & "app\config\aptrixjpe.properties") then
fso.MoveFile scriptpath & "app\config\aptrixjpe.properties", scriptpath & "app\config\aptrixjpe.properties." & cdbl(now)
end if

if fso.FileExists(scriptpath & "app\config\aptrixsearch.properties") then
fso.MoveFile scriptpath & "app\config\aptrixsearch.properties", scriptpath & "app\config\aptrixsearch.properties." & cdbl(now)
end if

if fso.FileExists(scriptpath & "app\config\connect.cfg") then
fso.MoveFile scriptpath & "app\config\connect.cfg", scriptpath & "app\config\connect.cfg." & cdbl(now)
end if





'--- Copy/Edit the config files to replace all variable placeholders with values set above

dim f, contents, v

set f = fso.OpenTextFile(scriptpath & "app\config\samples\aptrixjpe.properties", 1)
contents = f.ReadAll
f.close

for each v in variables.keys
contents = replace(contents, v, variables(v))
next

set f = fso.OpenTextFile(scriptpath & "app\config\aptrixjpe.properties", 2, true)
f.write contents
f.close


set f = fso.OpenTextFile(scriptpath & "app\config\samples\aptrixsearch.properties", 1)
contents = f.ReadAll
f.close

for each v in variables.keys
contents = replace(contents, v, variables(v))
next

set f = fso.OpenTextFile(scriptpath & "app\config\aptrixsearch.properties", 2, true)
f.write contents
f.close


set f = fso.OpenTextFile(scriptpath & "app\config\samples\connect.cfg", 1)
contents = f.ReadAll
f.close

for each v in variables.keys
contents = replace(contents, v, variables(v))
next

set f = fso.OpenTextFile(scriptpath & "app\config\connect.cfg", 2, true)
f.write contents
f.close




'--- Copy the web files to the web app home
wscript.echo "About to copy the web directory. After copying is complete, a message stating 'Done!' will be shown."

fso.CopyFolder scriptpath & "web-app\*", replace(variables("[WEB_APP_HOME]"), "/", "\"), true

wscript.echo "Done!"


Aurora as Seen from Satellite

http://www.spaceweather.com/aurora/images2004/07nov04e/dmsp.gif

This shows you how far south the auroral oval was during part of that geomagnetic storm last week.

Now, since the auroras take place in the ionosphere, which is some miles up, even though the oval was over Michigan, I was able to see it pretty high in the sky in Ohio (and it was visible further south into the Carolinas, I believe) because I'm looking into the "wall".

A lot of times, the oval will not progress any further south than Ontario or the UP , but you might still be able to see it low on the horizon if you're in dark sky Michigan (and know what you're looking for).

Monday, November 15, 2004

IBM Thinkpad R51

Finally, after using an old Gateway 9150 for five years, my company provided me with a new laptop. I've never been a fan of the Thinkpad, but this machine might just change my mind.

The quick specs:

Series: R51
Type: 1836
Processor: 1.6GHz Pentium-M
HDD: 60GB 4200RPM
RAM: 1.5GB RAM
Display: 15" SXGA+ TFT; ATI Radeon 9000 w/32MB
Networking: 802.11b/g; 1GB Ethernet; Modem
Media: DVD/CD-RW
Ports: USB, Firewire, S-Video Out, PC-Card

Now, perhaps I'm now spoiled since my frame of reference is an obsolete PII-400 with 256MB RAM and no working peripherals, including the keyboard. But this thing rocks.

One feature that so far has proven itself quite useful is a small LED that when activated, illuminates the keyboard. While not all that bright, it actually helps a lot when using the laptop in the dark (i.e., on your lap while watching television at night, or while riding in a car at night, etc).

Not that it's directly related to the Thinkpad, but I'm also currently using VirtualPC to create sandbox environments to isolate my development tools. Now, granted, I won't be able to run a lot of different VPC's at the same time with only 1.5GB of RAM, but I can keep a cleanroom onhand for testing, etc, while not polluting my main environment with a bunch of ad hoc software installations.

Tuesday, November 09, 2004

Active Week for Solar Activity

Again tonight, we were blessed with an active Aurora, though at the moment, it's little more than a glowing green fog in the northern sky.

At around noon my time, the first of two distinct shockwaves from CME's impact the Earth, which initiated a strong geomagnetic storm (Kp of 8). The second shockwave took the Bz component northward, and it remained that way until after darkness fell here. Then, around 8:30PM EST, the Bz component measured by the ACE spacecraft went south, giving me about 30 minutes go get out to my dark spot to observe the aurora.

We also had two major flare events occur back at the Sun. One, which happened minutes ago as I write this, was an X2 to X3 event, which likely has a CME associated with it that might have an Earth-directed component (if only a glancing blow, since sunspot 696 is nearing the limb). Give it maybe 3 days for travel, and that means that Friday night/Saturday morning, we'll have more Auroras lighting the sky. Though, I'm not optimistic about having clear skies when it arrives (but, so far, the WeatherChannel is predicting no clouds on Friday night).

Here's wishing you clear skies!

Monday, November 08, 2004

Very Active Auroras

My wife woke me up around 2AM. She had stepped outside, and saw for the first time the amazing pulsating auroras that lit up our skies as an Extreme level geomagnetic storm continues on. Despite partly cloudy skies, there were enough holes to be able to tell that the whole northern portion was alit in green, and pulse-like waves of colors rippled overhead and to the south.

I took her out to see the Northern Lights last year, but despite vivid reds and greens, the display that she saw didn't have much movement like we're seeing right now.

Perhaps now she won't poke fun at me when I chase auroras in the future. ;-)

Sunday, November 07, 2004

Cool Northern Lights Display

I just got back from observing the Northern Lights from a dark dirt road near Bowling Green, OH. It was impressive in the fact that it's been a year since the last really good display.

I observed curtains of light and rays. Colors were mostly green, with a little bit of pink (red) towards the top of the display. Activity extended from maybe 10 degrees above the northern horizon up through Cassiopea.

Even now, as I return home and am surrounded by city lights, I can make out a difuse green glow in the northern sky. It's a breathtaking sight if you've never seen it before.

Auroras are Back!

After what seemed to be a year's lull for me, the first major solar wind/geomagnetic activity is currently buffeting the Earth as a Coronal Mass Ejection's event horizon has passed by us and has consequently turned the IMF southward.

To be accurate, there were probably other events in the past year, but here in NW Ohio, it seems that every geomagnetic storm powerful enough to produce the Northern Lights this far south usually occur during total cloudovers. But not so tonight!

Right now, solar wind speeds are in the high 600's, the IMF is pointing south at around -40, and the hourly KP is going to be nearing 7. All perfect conditions that indicate that I should be able to see something once it gets dark enough.

My sources of data for current conditions:

Solar Terrestrial Dispatch
Spaceweather.com
Space Weather Now

What's cool is that more CME's are coming our way, so if the clouds stay away, it could be an exciting week!

Saturday, November 06, 2004

Solitaire Plugin for GB-PVR

My second attempt at plugin development for GB-PVR was successful in the form of a Solitaire game playable entirely from the remote control (assuming that the remote has buttons that are mapped to the PC's arrow keys, Enter, Escape, and Zero key).

You can download the plugin from the GB-PVR Plugins page. The source code will probably be released later after I can do some cleanup. If you're really desperate, just use a .NET Reflector to disassemble it (I didn't obfuscate the code).

At Last!

Kind of hard to maintain a blog when the Blogger post page won't let you in for a couple days.

Tuesday, November 02, 2004

Search from Address Bar Fixed

As previously mentioned, my Internet Explorer Address-bar searching functionality got hijacked, and was not restored after running Spybot Search and Destroy.

I found another free tool called HijackThis that was able to restore the search functionality as well as report other suspicious system settings.

I would warn that HijackThis really isn't for a novice, because a lot of what was reported was legitimate for my particular system. But it's a lifesaver just the same.

No Intimidation Witnessed by This Voter

This morning, this Ohio Voter went to the local precinct's polls and cast a vote. And you know what? Despite what the ass known as James Carville is currently spouting off on CNN as I type this, there was absolutely no feeling of intimidation, and it was not a hostile environment either inside or outside the building. But, then again, I don't think that Mary Poppins and Dick Tracey was registered in my precinct.

Spyware

Where does all of this spyware come from? All of a sudden, I started getting all kinds of popups on my computer and my search-from-address-bar in IE went to Shopnav (bastards!). I'm careful and knowledgeable, but somehow, this crap got installed on my machine.

It's nothing that Spybot Search and Destroy couldn't fix. But even after that, my IE search was left using "DRSN Search". BLAH! UPDATE: See this blog entry for how I fixed the DRSN issue.

Monday, November 01, 2004

Lotus Notes Still Sucks

The Achille's Heel of Lotus Notes still remains that ID file scheme that they use to protect your identity while using the Win32 client.

The Notes ID contains your password, or rather, your password unlocks the ID file (and all of the certificates contained within). So, it is the key to your identity.

The problem is that anyone with an old ID file and the password for that file can likely log in as you, modify your mailbox database, add agents signed as you, etc. Notes administrators, wanting to protect against accidental loss of the ID file and against a user forgetting their password will often ask for a copy of the current ID file and the password to unlock it.

I can think of no bigger security risk in todays world than this! Yet, it's perfectly acceptable in the Lotus Notes community.

What's worse is that often, an employee's job is at stake based on how they use company property (i.e., email). So, if I told our top clients to "F--- OFF! We don't want your business, and our CEO is a c---sucker" then I probably would be fired. Well, what's to stop an old administrator who leaves the company (or is forced to leave) from impersonating me and doing just that? Or anyone with a grudge who happened to come across the password information one day?

Or, what's to stop someone from creating an agent in our CEO's mailbox that blind copies all email sent and received to a gmail account for offline reading? Since they could sign the agent as that user, the user would not get a security warning when the agent executes.

I HATE LOTUS NOTES!