Mar31

Import Hyperlinks with Text into SharePoint Lists Using Excel

Suppose you have a list of URLs that your client has given you. Now suppose they also have stored the text for each URL in a seperate column alongside the URL. At first it might seem difficult to get this into a Hyperlink field on a SharePoint list, especially since the UI for the Datasheet view does not allow for each updates to these two pseudo-sub-fields seperately. You might be tempted to enter them both as simple text fields and use a calculated field and a data view (or some other nonsense) to get what you want. Don't, because it's actually quite easy.
 
Instead, bring your columnar data into Excel. Then in a blank column, use the HYPERLINK(url, text) formula to generate the links. Reference the calls to each column respectively within the formula. When you copy these into a SharePoint datasheet view, the text of the links will be preserved. Violla!
Published: Mar-31-09 | 2  Comments | 0  Link to this post

Mar30

Dynamic Data Source Controls for Your Data Form Web Parts

In this very, very, *very* old (but still interesting) ASP.net article on MSDN Magazine, I found the following clever code snippit that uses a temporary file to create a user control dynamically from a string:
 
TemplateColumn bc = new TemplateColumn();
String tmp = Session.SessionID + ".ascx";
StreamWriter sw;
sw = new StreamWriter(Server.MapPath(tmp));
sw.Write(strLayoutCode);
sw.Close();
bc.ItemTemplate = Page.LoadTemplate(tmp);
grid.Columns.Add(bc);
File.Delete(Server.MapPath(tmp));

 
This is indeed pretty neat, but it turns out it's not necessary. You can do the same with the following:
 
Page.TemplateControl.ParseControl(strLayoutCode);
 
I discovered this interesting fact after realizing that SharePoint's DataFormWebPart is doing some intriguingly useful (but obfuscated) stuff with DataSourceControls and the SQL database. Basically, in the SharePoint Designer, whatever controls you put inside the DataSources tag - using the design pane, I would assume - get serialized into a BLOB in the WebParts table of your WSS Content database. At run time, they get loaded from the database on the first call to get the DataSources collection, which typically happens during CreateChildControls.
 
I tried forcing a load by explicitly setting DataSourcesString within code, but it blew up because the parser did not understand the tag prefixes in the code that I inserted. It was then that I realized that SharePoint is leveraging ParseControl(string), and after digging in the database, I was able to see that SPD must be programmatically determining what namespaces to register when it saves the data to SQL by way of the DataSourcesString property.
 
This is useful to me because for a long time I have been thinking that SharePoint, and in a greater sense ASP.net needed a way to allow data source controls to be defined more flexibly and in a centralized location. Sure, you can do it programmatically. But, the control parser gives you a fairly efficient way of doing it using a repeatable and flexible process, and you won't be limited to keeping the controls on the filesystem.
 
If you want to leverage this functionality without giving up the other benefits of the Data Form, check out SPARK project over at CodePlex. It includes Flex Data Form, a version of the DFWP that inherits all the same features as the original, but allows you to set the DataSources string and some other properties from within the Web UI. (It also has some other nifty features as well.)
 
Update: Looks like I am not the only one thinking along these lines. Too bad his comments are closed, because his ideas are good ones and he deserves the Whuffie. :-)
 
More Data Form goodness, especially a decent explaination of the OOTB method for overcoming the list GUID issues that plague migration of the DFWP.
Published: Mar-30-09 | 0  Comment | 0  Link to this post

Mar16

Trials and Tribulations with the Family PVR

Call me a glutton for punishment, but I was never the kind of person who would run out and get a Tivo if instead I could get something more hardcore that I had more features and I could fiddle with more. Thus, long before Tivo offered network streaming, we had outfitted all of our TVs with ReplayTV units and were happily backing up our shows to our file servers hard drives. But, while they were good, SonicBlue and the ReplayTV have long since run their course, and left us looking for another solution.
 
So, a year or two ago, I converted our setup to use a storebought PC, a copy of Beyond TV (I think it was v4.7 at that time), and a Hauppauge WinTV-1600 HDTV tuner card. This system worked pretty well overall, with a couple notable shortcomings.
 
First, the channel changing via IR to our DirecTV D10 and H10-100 boxen were never quite right, and the serial and USB ports for each came with their own headaches. Both had required a Paterson Tech TV Translator to get them working on the ReplayTVs, and this was also true for BeyondTV. This was especially true for the H10 when DTV started mucking around with HD channels that had the same channel number as their SD counterparts, but were not brought up by default. The H10 box also still gives me grief to this very day, because it occassionally stops responding to channel change signals and the USB has to be un/re-plugged. The TV Translator for the D10 has quit working after many years and I think it is dead, but I would be pretty happy if I could only find the spare we put into storage.
 
Second, there was never really any practical solution to record HDTV quality video from DirecTV, so unless we were watching live anyway, the picture quality generally stank - a fact that became all too apparent as we upgraded our 29" tube to a 42" Samsung flat screen plasma and then again to a 50" Pioneer Elite. I had long yearned for the day when technology would give us a solution to this problem that didn't involve buying a thousand dollar peice of specialized and hacked-to-peices hardware.
 
Finally, I made the mistake of installing BeyondTV on Windows Vista Home Premium, because it was what came preinstalled from HP on the box we bought to replace the ReplayTV. In hindsight that was a mistake, and a lot could have been better if I had only stayed in XP. Video codecs are quirky and their performance isn't so great on Vista (you get tearing and other weird effects even if the CPU isn't maxed out), plus network transfer speeds require all kind of tweaking to even make thm tolerable.
 
Well, that was then. This is now.
 
Last summer Hauppauge released the HD-PVR 1212, an external box capable of recording HD quality at 1080i from component RGB cables. This was an amazing advancement, but unfortunately at first the hardware had some heat issues and driver and software support were sketchy at best. Even though I waited until nearly Christmas to buy one, the one that arrived directly from Hauppauge still needed an RMA due to heat. It would freeze up fairly often, and the BeyondTV would say that it couldn't be found. I guess they were just working through their defective stock, but at least they did replace it right away. I kept it running on the living room set for a few weeks after getting it back from them and at the very least I can say problems were less common.
 
But, I can never leave well enough alone. With the new ability to record 1080 video, having the resources free for HD playback became more important, so  I resolved to reconfigure everything with a client-server model that would offload recording and transcoding onto a seperate box.
 
We got a hold of a Dell PowerEdge 1850 with 2x 2.8GHz Hyperthreaded Xeon CPUs, nice fast dual SCSI HDD (though a little small at only 150GB), dual gigabit NICs, and 8GB of RAM. Even at 3 years old, this is a *sweet* box.
 
I installed Windows Server 2003 R2, the latest HD-PVR drivers, and the Beyond TV 4.9 on this box with few issues. Of course, the PowerEdge does not have a sound card, so I had to plug in a USB sound card to fool the codecs into playing. Also, its video card is a bit weak, so we don't really use the console to watch videos unless we're trying to test the video feeds. It makes sense to keep a small TV nearby the server to do tests on the live video feeds from the set top boxen. It took a little work to get everything configured, especially the new PCIe card we got for SD recordings, but all in all this was not too difficult. We do still have a couple minor issues.
  • The channel changer cable for the H10 still needs a kick now and then.
  • The channel changer cable for the D10 does not respond at all and we think the TV Translator maybe died, but this old beast isn't supported anymore.
  • Beyond TV still does not properly implement h264 conversion for HD, so we get "failed to generate graph" if we try to ShowSqueeze our HD recordings (which right now is all of them).

With recording successfully offloaded to the rack in the basement, I was free to start making improvements upstairs. First thing I did was to uninstall all the deadweight drivers and tools. Then, I installed BeyondTV Link on both the living room and side porch PCs.

The living room set is an HP AMD x64 5000+. It has 4GB RAM, 300GB HDD, and came with Vista like I said above. I put a Sound Blaster Extreme Pro and a BFG NVidia GTX 260 in it, as well as a Netgear 311 gigabit NIC, Firefly RF remote, Logitech Dinovo bluetooth keyboard, Rocketfish bluetooth mouse, and a USB XBox wireless game controller adapter. I've also installed teh CoreAVC codec professional version along with BTV Link.

The kids' is a Dell v64 6400+, and its probably a better machine overall. They inherited my old BFG NVidia 8800 OC, but still use the onboard sound. They also got the 311 NIC and an ATI TV Wonder that isn't really connected to any feeds. For thier output, the TV only had VGA input, so I use a DVI to HDMI converrter and the NVidia control panel to compact the desktop so we can see the start menu.

The current issue on the kids' PC is that when you play video across the network UNC share, it plays fine, but when you play through Link, there is no audio. I don't think this is a big deal; I just haven't had time to figure it out yet.

As for the living room PC, I thought that installing Link would have been adequate, but video was still choppy during fast paced action scenes - which are pretty common in Battlestar Galactica. That just won't do. I tried many different configurations of the codecs and BTV settings, to no avail. Further, video playing directly in GraphEdit was much clearer than in BTV.

What I learned from this is that GraphEdit typically uses VMR7 as the video renderer, whereas what BTV calls "3D Accelerated" is actually VMR9. Having learned this, I then found other people in forums saying that Vista is the problem here, and that both XP and the Windows 7 Beta do much better.

So, I decided to give the beta a try. I ran into some problems trying to shrink my hard drive partition, but eventually I found the right settings and defrag tools to at least let me free up 150 GB for a dual install.

The Win 7 install process was tedious, but relatively pain free. The only 64 bit driver it couldn't find or didn't already have natively was of course for the Netgear 311. I was able to get that working by using Have Disk from the Add Hardware wizard. Hint: don't use the more obvious browse or search, as they will not find the driver file, but if you dig intot he CD from Have Disk, it will be pretty obvious you want the file in the Drivers/Vista/x64 folder. Once I had a network connection, all the other devices configured more or less automatically.

There were several possible x64 drivers from Microsoft and NVidia. I decided to try the one they made available from the CUDA page, but there was no joy for me here, since CoreAVC doesn't really support 64bit CUDA yet.

That's okay though, because just using the new OS gave me a 25% reduction in CPU utilization during HD playback. Video was clean and clear even in fast motion on the same sequences that gave me trouble in Vista. Network throughput also appears to be much better, though I imagine Microsoft will figure out how to screw this up by the time they release Windows 7 Home Edition.

So, that's it. I guess I will keep testing Windows 7 to see if it performs well for me after installing anti-virus software and other garbage. Also, I'm really looking forward to seeing if CUDA support in CoreAVC and BeyondTV gets any better in the future.

Published: Mar-16-09 | 0  Comment | 0  Link to this post

Mar01

Setting up TFS Server and using VSSConverter with VSSConverterGUI

 
I spent the weekend installing and configuring TFS Server 2008. I learned a lot, but mostly it was just a pain. In the end we did get things working properly.
 
After install, I wanted to port over our existing VSS from a past development project. I found this article, Migrate VSS Projects to TFS Projects, which was indeed a useful walkthrough, although it missed some important steps that were necessary for me.
 
First, the VSSConverterGUI is compiled only for Visual Studio 2005. Luckily I did have this older version lingering around still. I installed the TFS Explorer for VS2005 using the link I found on the Team System Blog. Note that the image file is in a wierd format, so I had to install Magic ISO in order to extract it; I really didn't feel like wasting a blank CD for this.
 
You put the GUI exe in the same folder as VSSConverter.exe and it will actually work, which is great. From there, I had to just browse to my VSS and TFS server, which worked very well.
 
The next issue is that I could not get teh User Mappings part of the form to work at all. So, instead, I saved the setting.xml and closed the application, and ended up rolling my own UserMap.xml in the same folder as Settings.xml using the example from the blog walkthrough above. I was able to use SourceSafe 2005 Admin to view the users so the mappings were pretty much intuitive. The other thing to note is the the tool likes it if you save both these XML files to the VSS folder, not the Common7 IDE.
 
Finally, I got the message that says "TF60032: The VSS Converter requires Visual SourceSafe 2005 or later to run. Please install Visual SourceSafe 2005 or later and try again. " like this poor fellow and this one. This was very weird because I *did* have SourceSafe 2005 installed on the very same box and was using it. So, I did some digging and thanks to this article, was able to get it working by adding the following keys to my registry using a REG import file.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\SourceSafe]
@="Microsoft Visual SourceSafe Automation"
[HKEY_CLASSES_ROOT\SourceSafe\CLSID]
@="{783CD4E4-9D54-11CF-B8EE-00608CC9A71F}"
[HKEY_CLASSES_ROOT\SourceSafe\CurVer]
@="SourceSafe.8.0"
Finally, the import ran correctly and now all our source code in in TFS!
 
Published: Mar-01-09 | 0  Comment | 0  Link to this post

`