Tuesday, December 18, 2007

Guess the Artist

File this song under faith/Christianity in the mainstream. Can you guess the artist without google?

You, me
Understand
Shake my hand
Last chance, little man
Ain't it grand
It's a bargain, it's a steal
30 pieces of silver
And a deal's a deal
Sign upon the dotted line
I'll be yours and you'll be mine
Nothing's free
Eventually

Nothing's free
From the rules and laws of morality
Free to take your fill
Free from your own free will
Nothing's free

My boy, it's getting late
I'll raise the stakes
So close
Control your fate, why hesitate
Seal the deal, close the sale
Take my hammer, drive the nail
Sign upon the bloody line
A drop of yours, a drop of mine
Nothing's free
Eternally


Nothing's free
From your conscience or
Free from the consequence
Free to sin and death
Free till your final breath
Nothing's free
Free from the claws and flaws of your family
Free from obedient life
You're cut like a double-edged knife
Nothing's free, nothing's free


Oh, you pay me


Free to ignore the bore of authority
Free to spit in the face
Be the winningest rat in the race till
Judgement Day
Then nothing's free
Bow to me if you wanna be free
Free from life, come die with me
And when we're dead it's for eternity

Come on little one and dance in the fire
The heat's getting close and the flame's getting higher
When the music's over there's a hush in the choir
Nothing's free
When the trumpets sound and his light is all around
And the saints all raise from the graves in the ground
We'll be going way downtown
Way downtown


Update (12/24/2007)

Wow, thanks for that bevy of guess submissions. I'll never be able to weed through them all, so I'll just give you the answer here.

 LastTemptation

It's "Nothing's Free" from Alice Cooper's 1994 album The Last Temptation. Of interest (to me) is that this album had a comic book included with it which was written by one of my favorite fantasy authors, Neil Gaiman.

Lookup List DropDowns in SharePoint

For today's absurdity in SharePoint, I give you lookup list dropdown handling in the SharePoint UI.

Try this little exercise. Create three custom lists. In the third list create a lookup field connected to the title column of the first list. Create a second lookup field connected to the title column of the second list. Create 19 records in your first list, then create 20 records in your second list. Try putting "one, two, three, etc" in the title field for the records you are creating in these first two lists.

Now, create a record in the third list and notice what the dropdowns look like:

Notice how they are different? This is what it looks like when you click down on the first one vs. clicking down on the second one:

I'm guessing the thought process was that once the number of records in a list gets to be large (read: 20 or more) then the display of a lookup field based on that list is going to look unruly on the screen. It's actually not a bad looking dropdown or a bad idea, except it's a total PITA when trying to read/manipulate the contents of the control in JavaScript.

In a nutshell, the steps to programmatically select an item in the prettied-up dropdown through JavaScript is to emulate a click event on the down arrow image causing the list to appear, and then to emulate a double-click on the item you want. That's right, when you are selecting an item in this prettied-up dropdown through the UI, you have to double-click.

That's actually a simplified version of what you have to do. The in-between steps are so obnoxious between figuring out if the control has been changed, finding all the control pieces it's using and changing their states that I went about about finding a shortcut and present it to you here.

I've created a JavaScript wrapper object I call the SharePoint LookupDropDown. Here is the code:

var SP = function() {}
SP.LookupDropDown = function(cn) // cn = "cell name"
{
    var cll = ydom.getElementsBy(function(el) { return(el.id.indexOf(cn) > -1); }, "td")[0];
    var btn, fld, sel, IsFarged = false;
    this.Value;

    if (typeof(yelm) == "undefined")
        throw("Error in SP.LookupDropDown: \'yelm\' is missing.");
    if (typeof(cll) == "undefined")
        throw("Error in SP.LookupDropDown: invalid CellName specified."); else cll = new yelm(cll);
    if (cll.getElementsByTagName("input").length == 1) IsFarged = true;
    if (IsFarged)
    {
        btn = cll.getElementsByTagName("img")[0];
        fld = cll.getElementsByTagName("input")[0];
        this.Value = fld.value;
        try { btn.click(); } catch(x) { }; // trapping -- btn may be hidden
        sel = ydom.get(fld.opt);
        try { sel.style.display = "none"; } catch(x) { } // trapping -- control may be hidden
    }
    else
    {
        sel = cll.getElementsByTagName("select")[0];
        this.Value = sel.options[sel.selectedIndex].value;
    }
    this.GetSelectId = function()
    {
        return(sel.id);
    }
    this.GetValue = function()
    {
        return(this.Value);
    }
    this.SetValue = function(val)
    {
        this.Value = val;
        if (IsFarged)
        {
            try { ShowDropdown(fld.id); } catch(x) { }
                // ShowDropDown is a function baked into SharePoint;
                // will throw an error when the controls are hidden
            sel = ydom.get(fld.opt);
            for (var i = 0; i < sel.options.length; i++)
            {
               if (sel.options[i].value == val) sel.selectedIndex = i; continue;
            }
            try { OptLoseFocus(sel); } catch(x) { }
                // OptLoseFocus is a function baked into SharePoint;
                // will throw an error when the controls are hidden
        }
        else
        {
            for (var i = 0; i < sel.options.length; i++)
            {
               if (sel.options[i].value == val) { sel.options[i].selected = true; continue; }
            }
        }
    }
}

This function sits on top of a namespace I've created called "SP". You can also see that I have a couple objects called "ydom" and "yelm". These are friendly names to two components of the Yahoo User Interface Library (which I use a ton and highly recommend), YAHOO.util.Dom and YAHOO.util.Element. I've left them here because it saves me a ton of time from coding their equivalent functions, but if you want to code around it manually or substitute your own equivalent functions from your favorite library be my guest.

To use this script include it on your page where you have one of these prettied-up dropdowns. In SharePoint Designer (or your favorite html editor) find the cell/<td> element holding the lookup dropdown and give it an ID, such as "LookupCell". Make sure you haven't added any other controls into this cell, either. In your own JavaScript code pass in this ID when you instantiate an instance of this object:

var MyLookupDropDown = new SP.LookupDropDown("LookupCell");

I elected to instantiate the wrapper this way (by using the ID of the enclosing cell/<td> element) because the ID of the actual dropdown is somewhat random and can change. So now you'll be able to get/set the value of the dropdown by simply calling the GetValue or SetValue methods:

MyLookupDropDown.SetValue("blahblahblah");
var TheValue = MyLookupDropDown.GetValue();

There is another method in there called GetSelectId which I don't use anymore, but you may find it helpful. It returns the SharePoint-assigned ID of the core select control for the prettied-up dropdown.

Where might you use this? Well, I'll tell you where I've used it. I tend to assign lookup fields to the ID field of the source list, which means a lookup dropdown doesn't look too hot on a page unless you're some sort of savant who knows which item they want to select based on their ID number alone.

So, for a custom edit form I'll add the lookup field to the page as I normally would, but then hide the row containing it by adding a "style='display:none'" attribute in the <tr> element. I then assign an ID to the enclosing cell/<td> element holding this lookup field and instantiate the wrapper object using this cell ID. I call this the "source" dropdown.

Then I'll add an old fashioned select element to the page and populate it either through some onerous JavaScript or binding it to a data source. I call this the "surrogate" dropdown. I then attach an "onchange" attribute to the surrogate, which calls the SetValue method of the source. Now, when I save the record the correct information is being saved and the dropdown lists looks the way I want it to look.

A couple notes here:

  1. This dropdown list tweaking only occurs in IE.
  2. Yes, this wrapper object does detect whether or not the dropdown has been tweaked by SharePoint and sets the value of the"source" object accordingly.

Monday, December 17, 2007

Emerging: Theological Crap

I don't know if you've been clued in or have been paying attention to the pseudo-evangelical Christian movement known as "Emerging" or "Emergent," but it's becoming a popular venue for the younger generation on Sunday mornings.

In a nutshell, the Emerging movement basically features a "seeker friendly" gospel which eschews absolute truth save for one absolute truth, that you can not possibly know what is absolutely true. They favor an experience-oriented gathering, making the individual  the focus of the gathering rather than where the focus should belong - on the worship of Christ1. In my mind it's the marriage of post-modernity with Christianity, featuring generation-x folks who are now old enough to preach from the pulpit lead discussion from the center bar stool.

This video clip is from a recent PBS story on the movement, and apparently there will be a follow-up with one going a little more in-depth with one of it's leaders, Brian McLaren. I'll be on the lookout for it.

 

(1) Does that not have overtones from the original lie told in the garden?

Wednesday, December 12, 2007

Deploying Linked Lists in MOSS 2007

This post contains a process for re-linking lists you've already deployed to SharePoint, which to your chagrin may have un-linked themselves from their previous state in your development environment. You can skip the pre-ramble and read the detailed version I've brewed up or the terse version.

One of the insanely stupid things about developing in SharePoint is how little thought there was given to the process of creating and maintaining discreet development, testing, and deployment environments. For myself, I like to have a development environment where I am currently changing the code (I use a VM for this these days), and test environment where I can push what I think is good code and let the customer hack away at it, and then the production environment where the code is in a "live" state.

For developing regular web sites in .Net this is fairly trivial. Just copy the files from place to place. SharePoint is a completely different beast. For one, most (if not all) of the files you will be working on are handled by http handlers built into the SharePoint namespace (no code-behind for you!). Second, those files are not tangible entities you can browse around for on the server hard disk. They are "hosted" inside the content database for the site you are working on.

That's the biggest WTF you run into when learning to develop in SharePoint. What I really want to grump on today is the process of deploying custom linked lists or document libraries from a dev/test environment to a production environment.

When you think of a list in SharePoint, you think of something akin to a table in a database with columns of different variable types. That's good from an understanding perspective.

All list data for a site in SharePoint is stored in one physical table in SQL Server, though, with an insane number of columns with generic names (nvarchar1, nvarchar2, ..., nvarchar64 and repeat a few more times with a couple other variable types) to store the list data. Further, in order to figure out which of those generic column names correspond to the field names you created through the SharePoint UI, you have to find the list definition in another table and pull the contents of one of the columns out into a text editor. The contents are in XML format. What an abomination.

Where this abomination starts ruining your day is when you have a handful of lists that are linked to each other via a lookup field you've created through the SharePoint environment. When you get ready to push these lists to another server you typically save the lists as templates (with the content included), download the templates to your local machine, upload the templates to the production machine, and then create new lists based on those templates.

Because of the way SharePoint stores the list data it depends on a system of identifying lists with GUIDs, and when you create a new list in SharePoint based on a template you do not get the same GUID identified with the new list as you had on your dev/test environment. What that ultimately means is that any lookup fields you had on a list are hosed -- they point to nowhere.

Todd Bleeker, who has multiple black belts in SharePoint development and administration and who is well known in the SharePoint community, has a process for dealing with this. It involves cracking open the template prior to uploading to the production server and editing the one of the files contained within. It works, but involves uploading each list one at a time, finding out the generated GUID for that list, cracking open the next template, editing the file inside, reassembling the template, uploading, etc.

I've come up with an alternate way of re-linking your lists together after you've uploaded all of them to your production server. It involves opening SQL Studio or Query Analyzer and editing the column holding the field definition for your just-created lists. This alternate way also assumes that you are deploying your new list/library set to the same site. If not, you'll have to find another way yourself.

A caveat here -- everybody in the SharePoint community will tell you not to ever edit any of the data in a SharePoint content database outside of the SharePoint UI. Actually, I agree with that sentiment but it was 3 in the morning when I came up with this scheme and I liked it better than the Bleeker method. So, do this at your own risk and only if you are comfortable with using Microsoft's SQL Server tools and writing SQL. If you hose your content database, I don't know you but I do hope you have good backups.

So, create your templates, upload them to your production server, and create your list/document libraries from them. Then, crack open SQL Studio or Query Analyzer, open a query window to your content database and follow along.

The Detailed, Getting-Paid-By-The-Hour-To-Type-This Version

  1. You need to find your custom list and the field definitions for it in the content database. To do this run this piece of SQL:

    select
        Webs.Id WebId,
        Webs.SiteId,
        Webs.FullUrl SiteUrl,
        Lists.tp_ID ListId,
        Lists.tp_Title ListName,
        Lists.tp_Fields FieldDefs
    from
        Webs
        left join AllLists Lists on Lists.tp_WebId = Webs.Id
    where
        Webs.FullUrl = '[ your relative site url ]' and
        ((Lists.tp_Title = '[ list name 1 ]' and Lists.tp_DeleteTransactionId = 0x) or
         (Lists.tp_Title = '[ list name 2 ]' and Lists.tp_DeleteTransactionId = 0x) or
         (Lists.tp_Title = '[ list name 3 ]' and Lists.tp_DeleteTransactionId = 0x))

    What this SQL does is find the exact lists/libraries you've just created in the content database. You need some pieces of information here -- the relative url to the site where your list is located, and the name you've given to each of your new lists/libraries. These are put into the where clause.

    The first line of the where clause references the relative url to the site where your lists have been deployed. Your relative URL should look something like "sites/TheSite" if you've create a site collection at /sites, or it could look something like "thesite" if your site collection is at the root level of the site.

    The second, third and fourth lines of the where clause finds your lists/libraries based on the names you gave them. I've included three lines here, but you'll want to include a line for each list/library, whether it's referencing another list/library or is being referenced itself. You'll notice here that the where clause on each of these lines filters using the field "tp_DeleteTransactionId." This is because if you create a list/library in the past with the same name, SharePoint doesn't actually delete it's row from the database (at least, not right away). If you have created a list with the same name in the past but deleted it, this additional filter makes sure you are grabbing the list that has not been deleted.

    This query should return exactly one row for each list/library you've specified. If not, abort and try again.
  2. Next we're going to put the field definition info into something we can easily manipulate. For this you are going to need your favorite text editor. In your query results, find the list which needs to have it's external references fixed, copy the contents of the "FieldDefs" column to the clipboard, and paste it into your text editor. It would not be a bad idea to save a copy of what you pasted into your text editor as a backup somewhere should you need to restore the column content to its original state.

  3. Now we're going to find the lookup fields which need adjusting. What you'll get in your text editor is something that starts off resembling this:

    12.0.0.4518.0.0<FieldRef Name="ContentTypeId"/>
    <FieldRef Name="_ModerationComments" ColName="ntext1"/>
    <FieldRef Name="FileLeafRef"/>
    <FieldRef Name="Modified_x0020_By" ColName="nvarchar1"/>
    <FieldRef Name="Created_x0020_By" ColName="nvarchar2"/>
    <FieldRef Name="File_x0020_Type" ColName="nvarchar3"/>

    [ ... so on and so forth ... ]

    I'm sorry, but you'll have to ignore that first bit of creative Microsoft xml mangling at the very beginning (I think it's a version number they stick in there). What you're looking for in this xml are the definitions for your lookup field(s). You can do this in your text editor by doing a search for the word "lookup." You should find an xml node that looks something like this:

    <Field
       Type="Lookup"
       DisplayName="[ display name ]"
       Required="FALSE"
       List="[ a guid string ]"
       ShowField="ID"
       UnlimitedLengthInDocumentLibrary="FALSE"
       ID="{9f437a3e-5507-41e9-ab68-36beb3bd0822}"
       SourceID="{f3296739-dd99-4fd5-b756-020c359d9fbb}"
       StaticName="[ static name ]"
       Name="[ field name ]"
       ColName="int2" RowOrdinal="0" Group="" Version="4"
       WebId="[ a guid string ]"
    />

    I've replaced some attribute values of this node with placeholders, but you'll see that some of the attributes contain the name you've given to the lookup field. Of particular interest here are two attributes containing GUID values -- "List" and "WebId." These help SharePoint define the list being referenced to by this lookup field.
  4. Next we'll replace the GUID values in the xml with the proper ones from the database Go back to the query you ran and find the list that this lookup value is referencing. I'm assuming you know which list this should be, and that it was included in the where clause of the SQL statement you ran. When you find the list in the query results, copy the contents of the "ListId" column and paste it over the contents of the "List" attribute value in the xml node you are currently editing.

    Once you've done that, repeat this process with the WebId attribute by copying the contents of the WebId column in the query results and pasting it over the contents of the WebId attribute value in the xml node1.

  5. Repeat steps 3 and 4 for the other lookup fields in your list, if there are any more.

  6. Now we're going to update the field definition for this list in the content database. Go back to your query editor and stamp out this piece of SQL in a new window pointing at the same content database:

    update Lists set tp_Fields = '[ FieldDefs ]' where Lists.tp_Id = '[ ListId ]'

    Replace the "[ ListId ]" placeholder with the contents of the ListId column (a GUID value) of the list item you are editing in the original query.

    Go to your text editor and copy the entire xml text to the clipboard, then come back to your query editor and replace the "[ FieldDefs ]" placeholder with the contents of the clipboard. It's going to look real ugly, but don't fret it. Just make sure the contents of the clipboard are between the apostrophes.

    Run this SQL, and you should get 1 row update.

  7. You can now go in through the SharePoint UI and examine the lookup field definition for the list. The "Get Information From:" should read with the correct list name, whereas before it was blank.

  8. Repeat steps 2 - 7 for your other lists containing lookup fields.

This seems pretty complicated, but I was intentionally long-winded so that you'll understand what's going on with each step. The less verbose version of this process is here in the event that you don't want to weed through the explanations.

The Terse, Would-You-Please-Get-To-The-Point-Already Version

  1. Open Query Analyzer or SQL Studio and run this piece of SQL:

    select
        Webs.Id WebId,
        Webs.SiteId,
        Webs.FullUrl SiteUrl,
        Lists.tp_ID ListId,
        Lists.tp_Title ListName,
        Lists.tp_Fields FieldDefs
    from
        Webs
        left join AllLists Lists on Lists.tp_WebId = Webs.Id
    where
        Webs.FullUrl = '[ your relative site url ]' and
        ((Lists.tp_Title = '[ list name 1 ]' and Lists.tp_DeleteTransactionId = 0x) or
         (Lists.tp_Title = '[ list name 2 ]' and Lists.tp_DeleteTransactionId = 0x) or
         (Lists.tp_Title = '[ list name 3 ]' and Lists.tp_DeleteTransactionId = 0x))

    Make sure to a) replace the placeholders as appropriate and b) add/subtract lines from the where clause as appropriate for each created list which is referencing another list or is being referenced.
  2. Find the first list in the query results which contains lookup fields and copy the contents of the FieldDefs field to the clipboard and paste into a text editor.

  3. Find the first lookup field which needs to be changed. Do a search on the word "Lookup" and you should find a node which looks like this:

    <Field
       Type="Lookup"
       DisplayName="[ display name ]"
       Required="FALSE"
       List="[ a guid string ]"
       ShowField="ID"
       UnlimitedLengthInDocumentLibrary="FALSE"
       ID="{9f437a3e-5507-41e9-ab68-36beb3bd0822}"
       SourceID="{f3296739-dd99-4fd5-b756-020c359d9fbb}"
       StaticName="[ static name ]"
       Name="[ field name ]"
       ColName="int2" RowOrdinal="0" Group="" Version="4"
       WebId="[ a guid string ]"
    />

  4. Go back to the query and find the list that is being referenced in this xml node. Copy the contents of the ListId column (should be a GUID value) and paste it over the existing value in the "List" attribute.

    Repeat this process using the "WebId" column value from the query and pasting it over the "WebId" attribute value in the xml node.

  5. Repeat steps 3 and 4 for the other lookup values contained in the xml.

  6. Go back to your query editor and open a new window to the same content database:

    update Lists set tp_Fields = '[ FieldDefs ]' where Lists.tp_Id = '[ ListId ]'

    Replace the "[ ListId ]" placeholder with the contents of the ListId column (a GUID value) of the list item you are editing in the original query. Replace the "[ FieldDefs ]" placeholder with the xml from your text editor. Run the SQL and you should get 1 row updated.

  7. Examine the just-editing field through the SharePoint UI. The "Get Information From" should now read with the correct list reference rather than being blank.

  8. Repeat steps 2 - 7 for the other lists containing lookup fields.


Updates, Post-Scripts and What-Not

  1. I'm finding that there are times when the WebId attribute is missing in the XML. Skipping this seems to still glue the lookup field properly as long as you paste the correct ListId in.

Separated At Birth

  

On the left, Ryan Leaf, disgraced Chargers quarterback and the biggest draft bust of all time. On the right, Denise from the current season (I think it's #8?) of Survivor.

Monday, December 10, 2007

The Nutty Buddy

For those special occasions where you find your national treasures under attack from a hundred miles per hour baseball.

Feeling Ill at the Head Table

OK, I'm warning you in advance -- don't read on if you get queasy reading about how your food is processed prior to arriving at the supermarket, or if you're a vegetarian, or have a religious affiliation that is pork-adverse. Etc, etc etc.

According to a new article on Wired's web site, the "head table" in question is the station at a pork processing plant where the brains of a pig are extracted by blowing compressed air through the skull and squishing the "meat" out the other side. Apparently some of the workers are contracting an illness known as chronic inflammatory demyelinating polyneuropathy, or CIDP.

The theory is that the workers may be acquiring this illness through inhalation of pork brain mist occurring in the air through the de-braining process. See, I warned you and you read anyway.

The article is chock full of details:

In a rapid-fire process that is noisy, smelly and bloody, severed pigs' heads are cut up at the head table at a rate of more than 1,100 an hour. Workers slice off the cheek and snout meat, then insert a nozzle in the head and blast air inside until the light pink mush that is the brain tissue squirts out from the base of the skull.

[...]

Compressed air could turn some brain matter into a mist that could be inhaled by workers, said Mike Doyle, a microbiologist who heads the University of Georgia's Center for Food Safety. Or the workers may have come into contact with something dangerous and then touched their noses or mouths, he said.

Delicious. In the words of Tom T. Hall,

That's all there is to this small [ story ],
But waitress, before you leave...
Could you please bring me some coffee
And a hot ham sandwich, please?

Your Gas Dollars At Work

The Burj Dubai, on it's way to being twice the height of The Empire State Building and the tallest man-made structure on the planet.

Sunday, December 09, 2007

Tuesday, December 04, 2007

Is God a Human Invention?

If you have a couple hours to kill you can download and watch a debate between philosopher and atheist Daniel Dennett (author of Breaking the Spell: Religion as a Natural Phenomenon) and Dinesh D'Souza (conservative writer and one-time policy advisor to Ronald Reagan).

The download page is hosted at Richard Dawkins' site -- you can grab it as a QuickTime file or follows links to the video chunked out in segments on YouTube.

Saturday, December 01, 2007

Trivia Photo of the Day

Here's where Lori and I were a week ago today. Of course, there's a big clue in the picture already, so you're going to have to be a little more specific than the name of the establishment.

Here's another clue for you, though: it is where I first started financially contributing in support of the great system known as the U.S. Government.

Scott is not allowed to participate here, as he's going to know it right away.

Thursday, November 29, 2007

Note To Self: SharePoint Queries

I've just spent the last, uh, 6 hours trying to figure out why a query I've been writing in SharePoint would not filter the returned data properly. It would always return more data than I was anticipating. Consider the following snippet:

sopv = "{" + soplib.Views["WS_Browse"].ID.ToString().ToUpper() + "}";
sopq = new CamlQuery(CAML.Where(yaddi yaddi yadda)).CreateQuery();
sopmtch = soplib.GetItems(sopq, sopv);

In the first line I'm fetching a friendly handle to the name of a view I've built in a document library. I had constructed the view inside SharePoint and specified the columns I wanted returned as well as including a filter so it would weed some of the gunk out before my own filter ran over it in the query.


In the second line I'm using John Holliday's CAML.net to build the query xml, and in the last line I'm running the query, specifying the query object and the view name in the method call.


For the life of me I couldn't figure out why in the Sam Hill it was returning more items than I was expecting. It wasn't returning everything, but just one or two more than I was expecting. And the one or two extra were definitely outside the range I was yaddi yaddi yadda'ing about.


So my next step was to crack open U2U's CAML Query Builder application and reconstruct the query in what I knew was a working a environment. Voila, the query worked perfectly. And theeeeeen, I outputted the actual query xml from my SPQuery object (sopq) and compared it to the query xml generated by U2U's tool. Identical!


At this point I was really getting creeped out, thinking that there was some bug in using the SharePoint object model to run queries vs. using the SharePoint web services (which is what I was doing with the U2U tool). As a last ditch effort I removed the view specification from the GetItems method. BINGO.


So, you know what? I learned something today! If you specify a view to use in your query the SharePoint query processor happily ignores the CAML you've whipped up. Not very nice considering the effort it takes to to put one together that doesn't get stuck in SharePoint's throat.


And while I have your attention, I'd like to make the following public service announcements:



  1. John Holliday's CAML.Net is a great shortcut for creating CAML, although even a somewhat simple query can lose you if you put it all on one line. I'll have to check out his Visual Studio plugin.

  2. The U2U CAML Query Builder rocks. I would actually use it more often and just store the raw, generated queries in text files, but I wanted the flexibility of making queries up on the fly. At the very least it's a good debugging tool.

  3. The existence of CAML is hella-silly. I mean, it's just dreadful. XML and SQL, two not-so-great tastes that taste like [ expletive deleted ] together.

  4. Programming data operations in SharePoint, in general, is an abomination. In fact, at the end of a day of programming data operations in SharePoint, I can't wait to stop and ram shards of glass in my eyes. For you DBA types, just consider writing queries as I have described in the previous point. Now consider doing that plus doing data joins manually. Hallelujah... where's the Tylenol!

Wednesday, November 28, 2007

This Is A Test of the Emergency Broadcast System

I've just downloaded Windows Live Writer and hooked it up to this blog. Just testing to see how well it works with Blogger.

So far it looks like it takes a copy of your template from Blogger and uses the CSS when you are writing, so you have an idea of what the final output is going to look like. Sweet. The functionality is also offline, so I don't have to be on Blogger's site when writing/saving/editing posts/drafts.

One thing that it does seem to be lacking is the ability to use Blogger's label function. Maybe it's time to use the labeling/tagging function of a third party site.

Update: Duh. It's a nomenclature issue, not to mention a near-sightedness issue. There is a categories field below the posting window (they are called "labels" in Blogger), along with a field for force-setting the publishing date. NICE. What's not so nice is the interface for selecting/entering the category.

Update II: You can add plugins, of which there are a bevy. For instance, there is one for Picasa and for Flickr, which I often use for hosting images for this blog. SCHWEET.

Monday, November 19, 2007

Crisped

I followed with great interest the 2007 San Diego fires. The San Diego fires of 2004 narrowly missed the home in Ramona I lived in when I graduated from high school. In fact, it burned the house down across the street. The fire this year, although larger, did not seem to get very close to any of the places I've lived, worked, or schooled at.

It did burn down a place I'm familiar with though. Noting that the fire started between Ramona and Julian and burned due eastward I wondered if it took down the trailer park where my ex-wife's grandparents used to live (I say "used to" because her grandmother died a while back and I'm pretty sure her grandfather would not be alive today... and the street burned down anyway). My father and I went out to survey the damage this past Saturday and we went by the old trailer park. Needless to say, tornadoes aren't the only thing which easily prey on trailer parks. The homes surrounding the park stood up, as well as the community center in the middle of the park which is a regular building.

This photo is what I believe to be the remains of trailer, although I don't remember which one it was exactly. If you follow this link you'll get a panorama of the street my ex's grandparents lived on. You can also follow the map information in the lower right with which you can bring up a satellite view of the area, which (currently) shows the area as it was before being burned down.

Coming: Text Displays On Shopping Carts

Text displays on shopping carts, which seems like the first step of an idea I barfed up a couple years ago.



Via: Ubergizmo

Thursday, November 15, 2007

Righteous

For those of you who use remote desktop to get to your servers or other computers often, give Terminals a try. It stacks up all your remote connections into a single, tabbed window which unclutters your taskbar.


Via: Mike and Duncan (no, I was not doing a Paris Hilton search)

Wednesday, November 14, 2007

Drive eRazer

Behold, the "Drive eRazer." Plug it into your IDE drive and it provides an unattended wipe-out session. There appears to be a regular version that does a one-pass job and a "pro" version which does multi-pass in the event that you are extremely paranoid.

Nifty. I may have to pick one of these up.


Via: Boing Boing

Friday, November 09, 2007

Separated At Birth



Dave Mustaine, grand poo bah of Megadeth and Faramir (aka David Wenham) from Lord of the Rings.

Global Warming Resource

ICECAP.

Well, it won't be your resource if you think we're burning our planet away, but it works for you fairly well if you want a reasoned, unhysterical look at global climate change.

Thursday, November 08, 2007

Web Service: GetGuid

OK, this is the first method I've put in this set of free web services. Why GetGuid?

I had a need to grab a GUID in javascript from time-to-time but had my doubts that it could be done in earnest in javascript. There are a few implements hanging around where random base16 characters are strung together in a GUID-like format, but this algorithm doesn't fall under the "official" designation of GUID and I guess allows for a greater chance of generating a duplicate GUID (although I think those chances are infinitesimal).

So, this web service exists as it calls upon the GUID-creating ability of Microsoft SQL Server. I chose this route rather than the GUID methods in the .Net framework because I've been working on getting my database chops back up to snuff and this seemed like a pretty low-stress way of starting that. In any event, it should be a true GUID and technically the numbers should never duplicate.



Method: GetGuid
JSON Parameters:
  1. op -- set to "GetGuid".
  2. cb -- set to the name of your javascript function you want called back.
Returns:
GUID in string format.

Free Web Services

So, every once in a while I'll run into a programming conundrum in something I'm working on and either wish there was something I could download and implement fairly quickly or that there was a web service hanging "out there" that I could hook in to.

Well, I guess I'm going to start my own set of web services and leave them hanging "out there" for me to use, and anyone else who is brave enough to use something they are not hosting themselves. I'll be hosting it on my forthcoming company website at the following urls:

http://lpsol.com/ws/soap.asmx
http://lpsol.com/ws/json.ashx

Yes, I'll be providing both soap and json interfaces. The soap interface is generally useful in standard web services calls, although to implement into your own AJAX-based website or webapp you'll have to write a proxy running on your site which will then access this web service.

Not so with the json interface, though. All you'll need to do is include the json url in your web page using a script tag and the proper querystrings to call the function you want, and the service will call back the function of your choice (specified in the querystring) and pass in the requested data as a parameter.

While the jsoninterface doesn't include it's own description page, if you click the soap url above you'll find information on how to call each method using soap. When consuming a web service in the .Net environment you generally get a nice class and set of methods to call from the web service -- the Intellisense kicks in and shows you the parameters you need to pass in a what-not. Not sure how it works in other environments.

For the json calls you'll have to specify the "op" and "cb" querystrings manually for each method you call. The "op" is short for operation and is the name of the method. "cb" is short for "callback" and is the name of the function you want the server to call back when it's done. For instance, when calling the "GetGuid" method (details on this method forthcoming) you will set "op" to "GetGuid", and if you want the server to call back your javascript method called "procGuid" after it's generated, you would set "cb" to "procGuid". Therefore, the whole tag would look like this:
<script type="text/javascript" src="http://lpsol.com/ws/json.ashx?op=GetGuid&cb=procGuid"></script>
If either of those parameters are omitted then an error is thrown by using an alert. Other parameters may be required on a per method basis.

The data returned from both interfaces will formatted in a similar fashion. The packet will be in two pieces, an "error package" and a "data package" encapsulated inside a "return package." You can actually see this arrangement if you run the GetGuid method through the soap url or pasting the value of the src parameter from the above script tag in your browser address bar.

The error package will always contain the following pieces of information:
  1. Flag. This will either be True or False, indicating if an error occurred.
  2. Message. The error message.
  3. StackTrace. The stack of methods called leading up to the error. Probably not very useful to you, but useful to me in figuring out the problem.
  4. AdditionalInfo. This may contain any other useful tidbits I stuffed in there before pushing everything back to the browser.
The contents of the data package will vary. I'll try to include detailed information for each method. I have a few more idea for new methods that I'll work on at some point, and requests for new methods are also welcome.

Lastly, in the event that these services gather any traction, I'll try to keep all related posts tagged with the "lpsws" label.

Enjoy.

Thursday, November 01, 2007

God Hates Fred Phelps

The man for whom the term "jackass" was invented and his church have been ordered to pay almost 11 large to the family of Matthew Snyder, the Lance Corporal who was killed in Iraq and rewarded for it by having his funeral picketed by Phelps and his mentally ill acolytes.

There is also a response by Phelps in a CNN intereview here. My vote is that Phelps is senile.

Monday, October 29, 2007

Is It True?

A hack to get the new Mac OSX Leopard running on a regular PC.

I'm a bit skeptical, and don't have a spare PC to test this out. Anyone?

Friday, October 26, 2007

If I were a sci-fi writer...

(I originally posted this in a sci-fi forum. I was trying to illustrate how writers on these shows play fast and loose with concepts in physics. How'd I do?)


Well, let me just ramble for a moment...

If I were writing some fiction, and convinced myself that I wanted to throw in chaos theory in relation to n-dimensional planes, I'd have to imagine some kind of force that crosses between those dimensions. Otherwise the gauge aspect of chaos theory wouldn't hold at all (if the planes were not connected by *something*, then the idea of local vs. global is meaningless between dimensions). So, let's further imagine this force is some kind of field, and we know (heh) that fields typically have some particle counterpart.

We now have a transdimensional field, and we have particles which are generally considered a physical manifestation of energy (E=mc^2 takes care of that for us). Ok, good. Now we need a name that gathers that together. For sake of my own ego, I'll call them lokkions (bigger heh).

These so-called (by me) lokkions exist, because we say they do, and so we can detect them in some way. Perhaps it's indirectly, but nonetheless if we can detect, we can influence. Now we're getting somewhere! Since we presume the gauge part of chaos theory holds true, and if we suppose that lokkions interact chaotically (they are sensitive to initial conditions), and finally that we can somehow manipulate them, we have a tool for doing *something* across the dimensions.

Stick with me, 'cause it gets really hairy right here...

It's not enough to do *something*, because if the system is non-linear and exquisitely sensitive to the start of some event, we can leverage the localization of chaos theory in our dimension to also do *something* in another dimension. Let's assume for the moment that we get to choose which dimension, and not think too hard about it. Let's further assume it's a dimension that allows us to survive, and is conveniently aligned in such a way that we don't pop out into the middle of a sun. A nice dimension with bikinis and piña colladas.

Mmm... coconut. Where was I?

Oh, dimensions. We have a tool now, and we can change the very fabric of time-space (locally, remember) to allow us to travel without using a worm hole. And (bonus points), it works both ways! Again, the gauge aspect of chaos theory allows us symmetry - if we can get there, we can get back. Of course, we'll need the same tools there as here.

But wouldn't you know it? The specific flavor of energy relies on some exotic combination of field interactions that can be detected but not manipulated by our current technology (see the paradox? I already said if we could detect, we could manipulate. but we're writing fiction, so we just shrug and say "except in this case"). Moreover, that exotic combination must occur here and there at the same moment in time. Then we need to figure out a way not to control the fields, but to redefine time between the dimensions. It's relative, right? We push into hyperspace, thus changing our time relative to the time in Piña Collada Prime (I just made that up), and set our sensors to look for a confluence of fields.

We find it, pop through, sniff the air, and check our clock against star charts (worry about those details later). We see that while it took us 3 days to find the confluence, barely an hour passed in PCP (remember our other dimension?). See, we can now say there's an inversion in relativity due to symmetry that isn't realized until you hop the border. And bonus points because it works going both ways - when we get back, we only left two hours plus how ever much time passed in PCP. Presuming we can find another confluence in the same 3-day window.

And guess what? Some of you are thinking we just found a new way to cover huge distances but gain back the time. Well, I'm afraid it doesn't work that way, Sir. Because we are the ones traveling, we still age normally in our own plane of reference. We get back in 2 hours, but aged 6 days.

See there? I've built my own limitations and plot twists, setting up for hard decisions in the future.

I need a beer.

Tuesday, October 23, 2007

Falling Down

Holy Moses, Abraham, Isaac and Jacob. This guy is apparently not coping well with his laptop not working properly in the local coffee shop.

Thursday, October 18, 2007

Tuesday, October 16, 2007

Out of the Mouth of Babes

A couple of child preachers for you.

People are flocking from all around to see these kids preach, which probably doesn't hurt too much when the plate is passed around. Who said child labor is such a bad thing?

That probably isn't a very "Bible-ly" response from me.

Thursday, October 04, 2007

Holy Sweet Mother of Potatoes

A solid state hard disk, starting at 640 GB and fitting on a PCI card. The performance doesn't look too shabby, either.

Looks like my kvetching about our state-of-the-yesteryear technology in our computers may be coming to an end.


Via: "echef" at SharePoint blogs

Wednesday, October 03, 2007

For You iTune Users

With the release of the iPhone Apple has magnanimously decided to prep your computer for using an iPhone (because they know we all are going to cave in and buy one) if you are an iTunes user. I noticed this extra little service running in Process Explorer 1 recently after an iTunes upgrade. Thanks Apple!



Fortunately this can be disabled through your Services control panel -- Start -> Control Panel -> Administrative Tools -> Services. It's called "Apple Mobile Device." Set it to disabled or manual and you're all set.



[1] Go, download and replace your regular task manager. Now.

Sunday, September 30, 2007

How Bad Is It?

Let's scan the post titles from the last half hour on the San Diego Chargers newsgroup, alt.sports.football.pro.sd-chargers:
Looking ahead to next season...
Rivers sucks
GMs with big egos
How Norv must have gotten this job
We are done
My biggest concern
24 unanswered points
Choke choke choke
Word of the Day: Sucks
more great coaching
Fire them now!
Well, this sucks.
One quarter of the season in the books, and this team has already lost more games than it did all of last season. Looks like the Norv Turner hiring was a great move.

Marty had to go, but you didn't have to scrape up the first head coach you could think of, Mr. Smith.

Monday, September 17, 2007

Protest Highlights

In case you missed it yesterday, there was a protest in DC against the war in Iraq and President Bush. You can catch some of the highlights (which most likely will not be running on the news) here. Why, yes, I do believe the (far) left is superior in intelligence than conservatives.

Grab a corndog. And a convenience bag.

Wednesday, September 05, 2007

Simpsonize Me!

Upload a photo of yourself and find out what you would look like on an episode of The Simpsons.
Posted by Picasa

Friday, August 31, 2007

How to Poop Your Pants

Hop a flight taking off in a lightning storm.

Global Warming: No Consensus On Human Causes

The hoax is starting to unravel:
Of 528 total papers on climate change (published between 2004 and February 2007), only 38 (7%) gave an explicit endorsement of the consensus. If one considers "implicit" endorsement (accepting the consensus without explicit statement), the figure rises to 45%. However, while only 32 papers (6%) reject the consensus outright, the largest category (48%) are neutral papers, refusing to either accept or reject the hypothesis. This is no "consensus."

The figures are even more shocking when one remembers the watered-down definition of consensus here. Not only does it not require supporting that man is the "primary" cause of warming, but it doesn't require any belief or support for "catastrophic" global warming. In fact of all papers published in this period (2004 to February 2007), only a single one makes any reference to climate change leading to catastrophic results.

Via: Uncommon Decent

Monday, August 27, 2007

Now You've Seen Everything

Hell's Bells, played as part of a worship service.

Via: Extreme Theology

Expelled

Wow, is Ben Stein really going to take the cause of Intelligent Design to the big screen? Sure looks that way, in a Michael Moore type fashion. Expelled is set to hit theaters (I have to wonder if it will make it that far) February 12, 2008, one year short of Darwin's 200th birthday.

Via: The Heidelblog

The Ethiopian iPod

This one is worth a "heh."

Monday, August 20, 2007

Separated At Birth



John Hurt (aka Kane, aka Winston Smith) and Ian McKellen (aka Magneto, aka Gandalf the Grey).

Well, at least I think they look similar.

Communism Sucks

This little primer over at The Volokh Conspiracy should give you a little ammunition the next time you run into one of those mouthy college kids sporting a Che Guevara t-shirt.

Classic Cheese

I love YouTube. One of my favorite things to do is hunting down old 80's music videos (and downloading them locally using Firefox and the Ook? Video Ook! plugin), and once in awhile I come across a real treasure.

Such as this music video of "Six Six Six" by now retired Christian rock band Degarmo & Key. I've heard it was the first video by a Christian rock band played on MTV, who subsequently pulled it after it a few plays labeling it as too violent. Amazing to think MTV had a morality filter at one point, and that they chose to aim it at a Christian rock band.

Note some of the great throwbacks in this video:
  • Vintage Apple II computer, featuring 5.25" floppy drives/disks.
  • The Miami Vice getups D&K are wearing.
  • Sky-is-falling dispensational eschatology.

Newsweek Debunks Itself on Global Warming

Robert J. Samuelson, contributing editor of Newsweek on the August 20, 2007 issue: "Newsweek’s ‘denial machine’ [cover story] is a peripheral and highly contrived story."

Nifty Trick

I did not know that. Reboot Windows without having to reboot the hardware.

Saturday, August 11, 2007

Diamonds, Not Quite Forever.

When you blend them...



via: Blendtec

Global Warming Examined

A pretty extensive, reasoned look at global warming, examining the science behind the hysteria hype concerns as well as delving in to a handful of common questions. It's a long read complete with pretty slides, so buckle up.

Tuesday, August 07, 2007

Paintball

Here's a little puzzle game for you to kill a few hours on.

It has nothing to do with the traditional "Paintball" game.

Monday, July 30, 2007

The Daily Lit

Now why didn't I think of that?

A brilliant idea -- public domain books sent to you a chapter per day via email or RSS. You're not going to find the latest Harry Potter here, of course, but some good stuff none the less.

Thursday, July 26, 2007

MOSS Install Issue on Windows Server w/SP2

Due to the persistence of my cranial memory being more of the RAM than ROM variety these days, I'm regurgitating this post from SharePoint blogs (I had it starred in Google Reader) because the original post was destroyed in some sort of crash. If I run into this issue again hopefully I will have the presence of mind to search my bookmarks for this post.



MOSS Install Issue on Windows Server w/sp2
by gmoser

I did a MOSS install this week on a brand new box with Windows Server sp2 installed and ran into an unexpected and rather frustrating problem. If this post saves someone else the 5 or 6 hours I lost on it I'll be happy.

So I show up at the client site to instal MOSS on the freshly built box that one of our engineers built for me. The first thing I did was install IIS and Asp.net from Add/Remove Programs as per normal with any SharePoint install. During the IIS install I was prompted for an IIS file in the sp2 i386 folder which I surfed to on the file system and installed. All seemed well.

Next I install SQL Standard, which will run on the same server for this relatively small company. I proceed to install MOSS using a domain account set up on their SBS Active Directory. Nothing particulary unusual happens as I go through the install and Configuration Wizard. But, when I click the link to bring up the SharePoint Admin site I am prompted for a logon. This is unusual. When I enter my process account credentials for the Admin site, I am repeatedly prompted, whether I click OK or Cancel. I cancel a few more times and eventually get to the Admin site home page.

Long story longer, just about anything I mouse over or click on in the Admin stie kicks up multiple logon prompts, which I can cancel and eventually get to the requested page. Javascipt errors in i.e. indicate missing objects and bad syntax in the code. Odd, and a major pain. I am allowed access to the site and page, but seem to not have access via IIS to some images, css or other resources behind the scenes.

I check the various WSS, SQL and Event logs, but there is nother there. I go thourgh the IIS an file system permissions and can find nothing missing. I am suspicious of sp2 so I uninstall it, but that does not solve the problem (remember this part). I uninstall and reinstall MOSS and WSS a number of different ways, using local accounts instead of domain accounts etc, but I get the same logon behavior regardless of the configuration.

After a wasted afternoon of this I give up the next day and call Microsoft Support and spend a couple of hours on the phone trying many of the same things I had tried on my own the day before, plus a number of other tools Support had me download. No clear answer presents itself.

Finally someone in the room with my support guy says he had a similiar issue they traced back to Windows Server sp2. Turns out that installing IIS on a server that already has sp2 installed can cause a problem becuase the dlls from RTM/sp1 are not compatible with sp2. Now in my case I was prompted to install the sp2 IIS components, but that did not seem to help me. Support (after suggesting we may have to completely reimage the box, which did not make me happy) suggested we try reinstalling sp2 to see if that helps. So I spend 10 minutes doing that (I had already downloaded it), do an IISRESET, and voila, logon prompts are gone, and IIS and MOSS seem to be happy. Today I configured my SSP and created a default site and things are looking good.

If I had only tried reinstalling sp2 early in the process, I would have saved myself a few hours and a call to PSS. But you never know what is going to do it ... you just keep trying what seems to make sense and hope to get lucky.

Okay, this got longer than I expected. To summarize:

Problem: After installing MOSS/WSS on a new server that had sp2 installed (but not IIS), you get inexplicable login prompts in the Admin site.

Apparent fix: Uninstall Windows Server sp2 and reinstall it.

Tuesday, July 10, 2007

Greatest Idea of All Time

Cable Pro of Knoxville, Tennessee came up with a unique and effective way of getting their cable subscribing deadbeats to pay up -- broadcast Trinity Broadcasting Network, home of Benny the Hinn, on all the channels:
"This is the greatest idea we've had in a long time" said Maezell. "We've literally saved thousands of dollars. And last week when TBN ran the non-stop Benny Hinn marathon people were calling in so fast we couldn't keep up."
Fabulous.


Via: The Heidelblog

Friday, July 06, 2007

Cats are Democrats...

...dogs are Republicans.

Disney Deja Vu



A small collection of images showing how Disney animators recycle drawings. It would be cool to see a somewhat comprehensive set of recycled sets for other animators as well, such as Warner Brothers with Looney Toons.

Via: Boing Boing

Friday, June 29, 2007

I Can Has Cheez Burger?

OK, I can't put off passing along this site any longer as this picture put me over the edge this morning. I don't know if you've jumped on the lolcat meme that is popular these days yet, but if not the best jumping on point is I Can Has Cheez Burger?

They have about 5 or 6 photos a day, and at least one of them gets me doubled over in laughter.

Thursday, June 28, 2007

Bipartisan Consensus

Not on the cloture vote for the immigration bill, but on raising their own pay.

My Kind of Living

This scientist lived for two weeks under a lake in a steel capsule designed to keep him alive. It included a toilet, an algae garden for converting carbon dioxide to oxygen, a bed, an exercise bike which generated electricity, and a manhole so fresh water and food could be delivered by divers. It doesn't look like the capsule had windows, though, which would have sucked. He kept in touch with the outside world using a waterproof laptop and a wireless Internet connection.

I've always been in favor of living environments which would conceal the fact that humans are living there. My big wonder is why more dwellings are not placed underground or buried in a hillside. I would imagine that climate control would be a lot more energy efficient.

Via: Boing Boing

Tuesday, June 26, 2007

The Men Responsible For My Addiction

These guys perhaps started what today is known as fantasy baseball.

Being from San Diego (where we only had a minor league baseball team called "The Padres") I never really got into baseball. Last year a friend needed one more person to fill out a league and asked if I would play. I told him I don't know a thing about any of the teams, and that I would play as long as he didn't mind my coming in last. The other friend with him assured me that by the end of the season I would know the names of all the players on all the teams by the end of the year.

Unfortunately he was correct. I ended up coming in third, and in the same league this year I'm currently first in my division, second overall at the halfway point. Oh, and it's one of three leagues. I'm first overall in my second league, and seventh in my third (note: never autodraft in a league if you care about winning).

I skim some 30 blogs every morning (and throughout the day) for fantasy news, as well as visit a couple of the larger sites and each of the league sites. Fortunately I'm not the betting type or I would have an even larger problem on my hands.

Saturday, June 23, 2007

Still think God doesn't know you masturbate?

http://www.miamiherald.com/460/story/147572.html

Ok... so the title is inappropriate. Sue ...uh... someone other than me.

Monday, June 18, 2007

Wonderful World of Widgets

I've added a new one on the right, showing a list of junk I have for sale on eBay. Fabulous.

I'm in major cleanout mode in the house right now (I've noticed this trend on other blogs involving other guys in their mid-30s... must be some sort of meme). I've cleared junk out of the garage and organized it (who says miracles ceased with the times of the apostles?). The office is next.

10 Things We Can Learn From Apple

A brief list on things Apple gets right. I was familiar or recognized most things on this list that Apple does, but this particular one I didn't realize until I read it:
Hide The Screws. This is a classic Apple move. Mimic real world artifacts and make things feel less like technology devices and more like something you'd find in the real world. Pick up your iPod. It has no visible screws. It isn't even clear how the device comes together. Hiding the ugliness of technology makes these toys more endearing. Features like coverflow and the upcoming time machine further this notion of pulling design inspiration from the real world.

Friday, June 15, 2007

Not-So-Global Navigation In SharePoint

This is another fabulous adventure in nerdville. I'm posting this mostly for my own edification, so the three people who read this blog and are not finding themselves here via the General Lee, feel free to move along.

I am still getting my head wrapped around the paradigm that is SharePoint. From one perspective, it's a great platform to starts or build your intranet on if you have a lot of money (I call it "intranet-in-a-box") and not a tremendous amount of know-how. You can start creating portals and sites in no time at all, create rudimentary data models to hold information, set permissions on everything, and then start pumping information into it.

From the other perspective (that would be mine, or if I may be so presumptuous to call my perspective "the developer at large") it can be a complete PITA. I'm finding that even the slightest modification to the system which can not be handled via the web-based tools or even the new SharePoint Designer software requires time, patience, and a deep swear jar.

The latest incident involves trying to use the same global navigation bar in the "MySite" portal as the parent portal. I would think this would be a fairly trivial task, but not really. Actually, it kind of is after googling the entire Internet and finally finding a solution (it's located in the comments).

Of course, the solution didn't quite work as-is, so I'll regurgitate.

In the masterpage of the offending MySite portal there is a "SharePoint:AspMenu" tag, which is where all the action is at. There are at least a couple, so find the one specifically with the "TopNavigationMenu" ID. Mine looks something like this:
<SharePoint:AspMenu
ID="TopNavigationMenu"
Runat="server"
DataSourceID="topSiteMap"
EnableViewState="false"
blah blah blah />
Note the DataSourceID. This tells the control where to get the info it needs (namely the titles on the menu and the links they go to).

This object containing the DataSourceID is located a little further down the page:
<asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="SPNavigationProvider"
id="topSiteMap"
runat="server"
StartingNodeUrl="sid:1002"/>
OK, now we're getting somewhere. According to the aforementioned post and comment, this little bit of code provides a contextual data source for the menu at run-time. The way to force it to use a data source of my choosing (there are a handful of them defined in the web.config for the application) is to wipe that piece of code out altogether and replace it with something resembling the following:

<PublishingNavigation:PortalSiteMapDataSource
ID="topSiteMap"
Runat="server"
SiteMapProvider="CombinedNavSiteMapProvider"
StartFromCurrentNode="true"
ShowStartingNode="false"
TreatStartingNodeAsCurrent="true"
TrimNonCurrentTypes="Heading"
/>
And for this tag to be recognized on the page there must be an accompanying registration for it at the top:
<%@ Register Tagprefix="PublishingNavigation"
Namespace="Microsoft.SharePoint.Publishing.Navigation"
Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0,
Culture=neutral, PublicKeyToken=94de0004b6e3fcc5" %>
So far, so good, except after doing this I received the following error message on the page:
Could not load file or assembly 'Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=94de0004b6e3fcc5' or one of its dependencies. The system cannot find the file specified
Huh?

Turns out the problem here is simple -- the "PublicKeyToken" didn't seem to match correctly for me as quoted in the post. Along side that registration I put in were other registrations which had matching PublicKeyToken values. I simply copied that value over and voila, it worked.

So far the only menu I can get it to display is the custom one you create through the process of customizing the site navigation for the specific MySite portal. I can't figure out how to set the site navigation to the same one as the parent portal, but as long as I have some control over it for the time being I'm fine with having to set the navigation in two different areas.

Wednesday, June 13, 2007

Photosynth

Check out this awesome demo. It's a piece of work-in-progress software that takes photos of a subject from a variety of sources and creates a 3-d spatial representation of the subject.

The demo for Photosynth actually starts about 2:50 into the video. The beginning is a demo of another product called SeaDragon, which is also very cool and has some interesting ideas on interfacing and organizing/storing visual information.


Via: The Volokh Conspiracy

Friday, June 08, 2007

My Current Favorite Commercial



I generally enjoy the AFLAC commercials, but this one just slays me.

I wonder if they are taking a shot at this company.

Why The Japanese Are Smarter Than Us



Because they know how to make vector physics fun with these hyper-dramatized demonstrations. My favorite part is the crash gear the driver wears while the guy in back doesn't have any on, all for a top speed of just over 62 mph.

Sunday, June 03, 2007

TV Bugs...

Bugs. You know those little graphics that persist on the TV, usually in a lower corner, that helpfully tell you what channel you're watching? You know, the little things that have turned into the most invasive, annoying thing on television (and that takes in reality programs, Jerry Falwell, and all manner of infomercial).

I hate 'em. With a passion. So much so that I have decided to make a running list of channels that do *not* have them. At this point, I've only found TCM - Turner Classic Movies. Let me clarify... it's the only one with programming that I'll watch *and* that does not have a bug in the corner. I've had to make concessions for other channels, like SciFi and Cartoon Network, both of which are at least reasonable in their invasion; small, translucent graphics that don't move, glimmer, or make sound.

Watching a local broadcast station with my wife, a show which had been recorded on DVR, we were interrupted by a loud thunderclap and a graphic which covered the lower third of the TV screen. It was a severe weather warning. For last week. I played it back to get some statistics. The sound bite was 4 seconds, more than enough time to obscure the audio of the program. The graphic lasted a full minute, replaying the same message several times. At the end, the thunder clap sounded again, in case we missed it the first time, to let us know our chance at reading the text was gone. For 15 minutes. Then it came back.

Great.

Now, I don't like to offer complaints without some kind of solution. So let's look at the good stuff first. Ok, severe weather. If we were travelling, we'd want to know and may not have the forethought to go check online. Or look outside. Fair enough. And if we weren't actually *looking* at the TV, we'd miss the graphic-only announcement. The thunderclap is an attention-getting device.

But it doesn't take into account timeliness or annoyance. How about this... play a small beep, and run the text across the bottom of the screen, like the good old days. It's easy to ignore or read, at the viewer's discretion. It also doesn't obscure the program. If it's really urgent, break into the show, just like the good old days. That would let us skip forward if the information is no longer valid.

Another solution I have for non-news interruptions is this; don't. I have satellite, so I *know* which damned channel I'm watching. In fact, I'm more familiar with the stations by their programming because there are so many providers that it doesn't make sense to refer to a station by frequency selection when talking to others. So get rid of them. And those 'helpful' previews or announcements about upcoming shows?

Kill 'em. Kill 'em all.

Do it between shows, during the normal ads. Do it online when I'm looking up a show I already like. Send me a freaking email, if I've opted in. But DON'T DO IT DURING MY SHOW!!! I'm watching to be entertained NOW. I am NOT interested in being interrupted to watch something else in the future.

If I developed or starred in a TV show, I'd be greatly offended that my hard work was being interrupted by the *next* work that was going to be interrupted.

I have a pad of paper on which I write down shows that are advertised this way. Every few days, I write to the stations (when possible) and let them know I specifically will NOT watch what has been thrust upon me during one of these blipvert bastards. I encourage everyone to do the same.

Let's reclaim our sacred vegetative time *during* the shows. Write your favourite stations and tell them to remove the damn bugs, and NOT to interrupt our mindless absorption. Do it now, do it often.

Wednesday, May 30, 2007

How Much?

This is one of those things that make you chuckle, but it's more of a sad commentary on humanity than it is humorous. Ravi Zacharias uses it every so often in one of his lectures. I don't remember the context he uses the joke in, but maybe I'll remember one of these days.

Off the top of my head...
Two strangers, a man and a beautiful woman, are seated next to each other on a cross country flight. Once the flight takes off they make small talk and they find out they are both flying to the same destination for different types of business.

After a little while the man offers a shocking proposal to the woman -- he offers her a million dollars if she will spend the night with him. At first the woman is indignant and appalled at the offer, but after a half hour or so she mulls things over in her head and decides that the offer is just too much to pass up, so she accepts.

As the flight nears the destination, the man turns to the woman and tells her that he's very sorry, but he actually doesn't have a million dollars. He then asks her if she'll reconsider the offer, but for only a hundred dollars.

Now the woman is truly appalled. "What do you think I am?!" she asks the man incredulously.

The man replies "we've already established that fact. Now we're just quibbling over the price."

Wednesday, May 23, 2007

Los Alamos through the eyes of CBS

**explicit language warning**

I'm no real fan of news media... it's run by people with opinions, who are too self-important to extract those views to report objectively.

So imagine my reaction as a LANL employee to the following from CBS:

http://www.cbsnews.com/stories/2007/05/20/eveningnews/main2829944.shtml

When Jessica Quintana wanted to sneak classified material out of the nation's top nuclear weapons lab, the biggest outrage is how scandalously simple it was.
Excuse me?

The article blames lax security at LANL for this crime of treason. We've had our problems, but let me make this perfectly clear; the problem is ALWAYS PEOPLE. We don't need more regulations, strip searches, or constant review. What we need is:
  • The fucking FBI to step up and take responsibility
  • Humans to take their jobs seriously
  • SEVERE punishment for this ignorant bitch
The FBI is completely silent on this. Why? Because they know they are the ones who gave this moron a clearance. She lived with a drug dealer, was very young, and clearly not too bright. She didn't take her job seriously, and put the country at risk. The Federal Bureau of Incompetence should have actually investigated her, and followed up. She should not have been hired by the subcontractor, either. She had no previous work experience, and no education beyond high school. Great choice, fellas. By the way... lie detectors don't work.

The people who are granted clearances are supposed to be inherently trustworthy. Any security system anywhere ultimately relies on trust, nothing else. We have to trust that people do their jobs with integrity, and that they know what it means to violate that trust. In the case of LANL, it has to do with national security. Does anyone think your average 18-year-old kid from a local underachieving high school has ANY FUCKING CLUE about integrity, security, or impact to the nation? Now add in that she's a local with serious entitlement issues.

Jessica Quintana should be put in Levenworth for a decade. She maliciously mishandled classified information, which is TREASON DURING WARTIME. Her hiring official should be out of a job and fined. Her manager should also be on the street. LANL should be smacked for allowing a subcontractor to hire such idiots.

And then there's CBS. Who the hell are they to blame LANL entirely? They make her out to be a hero. Listen up; she hurt America. SHE did it. Jessica Quintana, uneducated self-entitled minority, thought it was OK to do what the hell she wanted *knowing* she was committing a federal crime. That data belongs to the American people, and she compromised it, with full intent. Rather, with full disregard. She's not some victim, she's an ignorant criminal.

So CBS thinks they will sensationalize the story by cutting in scenes of control rooms and flashing red lights. Are they now run by the National Enquirer? What other cheap tactics could they have used to heighten drama and intentionally skew the story? Perhaps a shot from Dumb and Dumber?

Dear CBS: Fuck off and die. Thanks for playing.

Tuesday, May 22, 2007

Abomination: Maxtor One Touch III

Okay, so after that catastrophic failure of the internal hard disk on my church server we purchased a Maxtor One Touch III external unit with 1 TB of storage. It has two internal hard disks in it with 500 MB each. You can configure it in either a RAID 0 or RAID 1 configuration. I wanted data integrity/security, so I opted for the RAID 1 configuration. On top of that, I implemented a weekly backup of the device to Amazon's S3 service.

The joke's on me. Just when you think you have the bases covered, new ways of failure reveal themselves. Not even three days after installing the drive it crapped out on the server, reporting that the volume was corrupt. Since both physical drives appear as one drive on the server, the data went bye-bye. So did my faith in data security.

Fortunately I had just gone through the process of recovering backed-up stuff from DVD, so I was well versed in putting things back where they should be.

After reinitializing the drive it actually behaved as it should for about a month. With my faith a little bit restored in it (thinking maybe I just had a first-time install hiccup) I started moving other things onto it, including the new church database files. See, since the original hard disk blowup the church was still based on a system using some crusty software. The blowup provided a good reason to switch all the data over to the new system we had recently purchased. So we put the new data files on the drive, hand-converted the data from the old system, and then started updating that data in the new system.

So like I said, it was behaving for just over a month, or for a time period known as just past the store return date. Then it happened again, and of course this time a week or so worth of church data down the drain. So now I'm in the enviable position of having to back up the thing every day as well as going through the fun process of diagnosing the drive through Maxtor's tech support or online forums.

It appears that I'm not the only customer having this problem. When installing this drive (it's actually a USB device) there is software you have to install with it so that the operating system can find it. I also noticed you can't replace the drives with ones of your own, and after a little digging found out that the software in conjunction with the firmware on the device makes sure that only Maxtor drives (or possibly only the Maxtor drives that came with the unit) will work. Some users are claiming that this software/driver installed on the operating system is the point of failure causing the data corruption on the drive. And when I say data corruption, I mean the partition table is either wiped or messed up.

I guess the upside to all of this is that I'm taking data security a little more seriously these days.

The General Lee Camaro



Get yours on eBay. Thank the heavens for red neck innovation.

via: Autoblog
related: The 2005 General Lee (from whence all this blog's traffic comes)

Thursday, May 10, 2007

It's What's For Dinner

So that's why it's so tasty:
Then there's mechanization. Machines, which can kill 70 birds per minute (three times more than just 10 years ago), are supposed to remove the intestines but more often than not wind up ripping the birds insides, spilling [ excrement deleted ] on the body cavity and equipment. "Fingers" on the machines which are designed to rip off the feathers, also pass feces, vomit and blood from chicken to chicken.

Then there is "fecal soup." Thousands of dirty chickens are bathed together in a chill tank, creating a mixture known as fecal soup that spreads contamination from bird to bird. Consumers pay for this fecal soup when they buy chicken, since up to 15% of US poultry weight consists of fecal soup.

Garsh, I'm kind of hungry all of a sudden.

via HealthBolt

Man-Made Global Warming: Bunk

So says Reid A. Bryson, one of the fathers of climatology:
"Climate’s always been changing and it’s been changing rapidly at various times, and so something was making it change in the past," he told us in an interview this past winter. "Before there were enough people to make any difference at all, two million years ago, nobody was changing the climate, yet the climate was changing, okay?"

"All this argument is the temperature going up or not, it’s absurd," Bryson continues. "Of course it’s going up. It has gone up since the early 1800s, before the Industrial Revolution, because we’re coming out of the Little Ice Age, not because we’re putting more carbon dioxide into the air."
Other interesting notes in the article -- that "Greenland" had that name for a particular reason as Norse civilization and farmlands are starting to emerge from under the melting ice, and that water vapor is much more efficient in trapping Earth's heat than carbon dioxide is.

Monday, April 30, 2007

Oh No

It's worse than you thought. Looks like our SUV's are causing global warming on Mars also:
Scientists from Nasa say that Mars has warmed by about 0.5C since the 1970s. This is similar to the warming experienced on Earth over approximately the same period.
We are so powerful we can take down the climate of any planet in our solar system.

Friday, April 06, 2007

The Best SPAM Catcher of Them All

It's called GMail.

For some reason I've been experiencing an explosion of SPAM this week on the email account I've been using for, oh, about 10 years. With my regular GMail account I noticed that they have a wonderful SPAM filter which is just about spot-on with it's filtering.

I'm already hosting the mail accounts for my new LLC there, so finally decided to spend the half hour worth of time switching my kings-x.com domain email over. For some reason the changes "took" pretty quickly. By the end of the half hour the email seemed to be pretty much arriving at Google's servers instead of the GoDaddy servers (I was using the one free email hosting account you get there with each domain).

So far, so good. About 24 hours later you can see that GMail has already trapped well north of 200 SPAM messages. I'm not quite sure why a full fledged business would not use this free service.

Thursday, April 05, 2007

The Security of Our Peanuts

OK, I know that President Bush is a rather polarizing figure in the world of politics (whoa, that was enlightening), that he can come off as a complete goof, and that his policies have raised the ire of folks from both sides of the aisle.

That being said, the guy can deliver a funny line every so often. In last week's Presidential Radio Address he had the following comment on Congress' plan to include earmarks in the latest war spending proposal:
The Democrats loaded up their bills with billions of dollars in domestic spending completely unrelated to the war, including ... $74 million for secure peanut storage. I like peanuts as much as the next guy, but I believe the security of our troops should come before the security of our peanut crop.
It actually comes off funnier (to me) if you listen to the audio. You can read and listen to it here.