Apr 20, 2009

Feeling the Boxee Love - Part 2

Okay, so I've been playing with Boxee for awhile now (almost 2 months). I started out with Boxee on Ubuntu Linux and I was really excited to get to use Linux again (and avoid the hardware heavy MS operating systems). Unfortunately, I was plagued with Samba/smb issues & couldn't consistently get the sources to work. Luckily, I was invited to participate in the closed Alpha for Boxee for Windows.

So, I reformatted the hard drive, installed XP & got to work with Boxee! So, a couple things of note here:
  • Don't use UNC names (i.e. \\MyComputer\MyMovies) as a source, map it to a drive instead.
  • Don't map drives to "internal" boxee drive letters (H:, Q:, T:, U: and Z:).
I hijacked my wife's wireless keyboard/mouse to use & it makes life MUCH easier to manage/play. I was extremely impressed with how well the new nVidia software handles connection to a HDTV via DVI=> DHMI adapter. It allows you to "tweak" the settings & nailed the resolution the first time out.

All that being said, a couple other "hardware issues" I had include:
  • An old Athlon XP CPU was not "up to snuff" for playing back DVD or HD content.
  • Wireless (802.11g) introduced additional latency that caused some streaming content to be "jumpy" (especially http://trailers.apple.com).
  • Having a loud computer next to your TV sucks. :(

Apr 3, 2009

Nesting a Repeater inside of a GridView that is bound to an Array of Custom Objects

Wow, isn't that title a mouthful! But that's exactly the situation that presented itself to me at work this week. Since it too me way longer than I thought it should to figure out, I figured I'd put my effort in here, just in case it might be able to help someone else out someday (possibly even me).

Here's the results:
#NameEmail Addresses
1Ian CazabatIanCazabat@Example.com
Ian.B.Cazabat@Example.com
IanCaz@Example.com
2Malcolm ReynoldsCptnMal@Example.com
Serenity1@Example.com
3Jonas BlaneSnakeDr@Example.com
303rdLSG@Example.com


So, without any further delay here's the code:
ASPX:
<%@ Page Language="c-sharp" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Nested Sample</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="gvNestingSample" AutoGenerateColumns="False" runat="server" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical">
<RowStyle VerticalAlign="Top" BackColor="#EEEEEE" ForeColor="Black" />
<Columns>
<asp:BoundField DataField="EmployeeId" HeaderText="#" />
<asp:BoundField DataField="EmployeeName" HeaderText="Name" />
<asp:TemplateField HeaderText="Email Addresses">
<ItemTemplate>
<asp:Repeater runat="server" ID="rptEmailAddrs" DataSource='<%# DataBinder.Eval( Container.DataItem, "EmailAddresses" ) %>'>
<ItemTemplate>
<a href="mailto:<%# Container.DataItem %>"><%# Container.DataItem %></a><br />
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#DCDCDC" />
</asp:GridView>
</div>
</form>
</body>
</html>


CodeBehind:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page {
protected void Page_Load( object sender, EventArgs e ) {
UserAccount[ ] aryUserAccounts = new UserAccount[ ] {
new UserAccount( 1, "Ian Cazabat", new string[] {"IanCazabat@Example.com", "Ian.B.Cazabat@Example.com", "IanCaz@Example.com"}),
new UserAccount( 2, "Malcolm Reynolds", new string[] {"CptnMal@Example.com", "Serenity1@Example.com"}),
new UserAccount( 3, "Jonas Blane", new string[] {"SnakeDr@Example.com", "303rdLSG@Example.com"})
};

gvNestingSample.DataSource = aryUserAccounts;
gvNestingSample.DataBind( );
}

public class UserAccount {
private long employeeid;
private string employeename;
private string[ ] emailaddresses;

public long EmployeeId {
get { return employeeid; }
set { employeeid = value; }
}
public string EmployeeName {
get { return employeename; }
set { employeename = value; }
}
public string[ ] EmailAddresses {
get { return emailaddresses; }
set { emailaddresses = value; }
}

public UserAccount( ) {
}

public UserAccount( long lEmployeeId, string strEmployeeName, string[] aryEmails ) {
this.employeeid = lEmployeeId;
this.employeename = strEmployeeName;
this.emailaddresses = aryEmails;
}
}
}

Okay, so there you have a working sample of how to create a GridView with a nested Repeater, that gets it's data from an Array of Custom Objects. Here's a couple points of interest:
  1. In order to bind on the data in the object, they must be created as "fields" using get/set.
  2. To access the array that's part of the object use:
    DataSource='<%# DataBinder.Eval( Container.DataItem, "{Array Property Name}" ) %>'
  3. To display the "data elements" from the array, you use:
    <%# Container.DataItem %>
  4. If the "data elements" in the array are custom objects, then you need to use the following:
    <%# DataBinder.Eval( Container.DataItem, "{Property of Custom Object from Array}" )%>
Okay, so that's about got it, hopefully I've helped someone out & I've likely kept myself from losing too much sleep over this issue again! So, go forth & create! ;)

Mar 9, 2009

So much for MythTV, I'm loving Boxee!!!

Okay, I wrote quite some time ago about my experimentation with MythTV & my pursuit of a HTPC (Home Theater PC). So, the initial requirement was to be able to play my DVD's, CD's & look at pictures on my 56" TV in the living room. MythTV met this goal, but also added quite a bit of complexity when you factor in the PVR functionality that it provides.

So, after weeks of playing with MythTV, I've been turned on to Boxee! Boxee is quite simply, a digital media player, that allows me to do the following:
  • Play existing Movies - DVD, ISO, mpeg
  • Play existing Music - CD, mp3
  • Browse Photo slide-show
  • Watch on-demand streaming media from CBS, MTV, YouTube & Hulu (right now via a hack)
  • Listen to streaming audio via the internet
  • Browse photos from Flickr & Picasa
All of the media options are available using a local Optical Drive (CD/DVD), local hard drive, or across your local network via SAMBA!

A great Blog post with a fairly detailed write-up on installing Boxee on Ubuntu 8.10 can be found at the OpenSourcePenguin.net. This is a nicely detailed piece, that doesn't waste time on a lot of unnecessary fluff.

I'll be following up with another post regarding using a remote & how the rest comes along!

Feb 26, 2009

WTFs/minute

Just had to take a second & link this great comic I saw referenced on Coding Horror that explains how to recognize good code during a code review:

Jan 9, 2009

MythTv

Man, it's been a bit since I posted anything here...what a slacker.

Well, here's my newest time waster, MythTv. Several years ago, I bought a Sony 400 disc DVD changer, to keep little fingers from destroying my DVD collection (problem #1). Alas, the navigation in the unit was crummy & digging through the "library" to find a movie never really worked. I wound up putting labels in the DVD cases telling what spot the DVD was in, but this left problem #2, all the cases were still cluttering up the living room.

So, after 6+ years, I think I'm at the point where we need to move away from the beast, to a more useful solution, enter MythTv!!!

MythTv is a Digital Video Recorder (DVR) & multimedia server of sorts. It will let you watch all of your "stand alone" movies, view your pictures & listen to your music. In addition to all of this, it'll also allow you to record/pause/rewind live TV with the use of a TV Tuner Card.

Right now, I'm still infatuated with AT&T's U-Verse, so I don't really care about the DVR aspects, since U-Verse comes with a 4-tuner DRV (2-HD & 2-SD).

What I DO care about, is it's built-in ability to RIP & Playback DVD's, in addition to all of your other Media Files.

I've cobbled together a PC out of old parts, to play around with. My first cut is using MythDora which is a complete Linux distribution, based on the Fedora Core distro. Another great benefit of MythTv is that it lets you break off the server/storage part & run a dedicated "front end" for MythTv. Assuming I'm happy with how this performs, I'll be looking for a small front-end to put by my TV, while keeping the monster hidden away downstairs, or in a closet.

Ideally, there would be some way to access MythTv from my Wii, that's already taking up space. Wiire.org has some promising info based on streaming video from MythTv (Using MythWeb) to the Wii, using the Internet Channel.

Okay, enough for now...I'll post again, once I make more progress on this.

Oct 7, 2008

BlizzCon 2008!!!

This Friday & Saturday, geeks from around the world will gather in Anaheim, California to see what Blizzard, Inc. has to offer. Blizzard is responsible for franchises such as StarCraft, WarCraft & Diablo. They also infected the world with World of WarCrack, which has been present in my life for the better part of 4 years.

So, a friend of mine and I are headed out to Cali to ROCK BLIZZCON!!!

Aug 15, 2008

How to Make Ice Cream at Home with Basic Materials

Ever wanted to make ice cream "quickly" at home? I found this cool (no pun intended) article on wikihow.com.

How to Make Ice Cream

Ingredients

Makes one serving:

Steps

Plastic Bag Method
This is good for making individual servings of ice cream to be eaten promptly after making. The video below shows a slightly different recipe but still instructs on how to make ice cream with a sandwich bag.
  1. Mix sugar, milk or half & half, and flavoring in a bowl, then seal it in a quart-sized plastic bag.
  2. Take roughly two quarts of ice (crushed if possible) and place it into the gallon-sized bag with rock salt. Ideally, the gallon bag will be roughly half full with the ice and salt mixture.
  3. Place the sealed quart-sized bag with the ingredients into the gallon-sized bag. Make sure the bags stay sealed! Do not allow the contents to mix at any time. If the bags don't seal sufficiently, use duct tape to seal the top of both bags to ensure they don't open during shaking.
  4. Gently agitate, massage, and shake the bags for about ten to fifteen minutes. In this amount of time the contents of the quart (smaller) bag should start to turn into solid ice cream.As you agitate the two bags, it is important that you are mixing the contents of the inner bag, but you don’t want to be so aggressive that you burst the inner bag or cut it on the ice (double-bagging should prevent this).If your hands get uncomfortably cold, use a towel or an old t-shirt to hold the bags as you massage them; they will be quite cold and might become slippery with accumulated condensation. Consider using gloves or massaging while holding onto the top seal if a towel or similar cloth is not available.
  5. Remove the small bag from the large bag. Scoop the ice cream from the small bag and enjoy!

Things You'll Need

  • spatula, whisk, or hand-held mixer
  • one gallon-size zip one quart-size zip bag

Parts of article provided by wikiHow, a collaborative writing project to build the world's largest, highest quality how-to manual. Please edit this article and find author credits at the original wikiHow article on How to Make Ice Cream. All content on wikiHow can be shared under a Creative Commons license.