Kris Krause .NET Meister

"If it is fast and ugly, they will use it and curse you; if it is slow, they will not use it."
- David Cheriton, The Art of Computer Systems Performance Analysis

Monday, January 31, 2005

DataView vs. DataTable

Yes, I still pull my hair out over DataView versus DataTable every once in a while.

using System;
using System.Collections;
using System.Data;

public class MyTestClass
{
public static void Main()
{
DataTable dt = new DataTable();

try
{
DataColumn col1 = new DataColumn();
col1.DataType = System.Type.GetType("System.Int32");
col1.ColumnName = "EmployeeID";

dt.Columns.Add(col1);

DataColumn col2 = new DataColumn();
col2.DataType = System.Type.GetType("System.String");
col2.ColumnName = "LastName";

dt.Columns.Add(col2);

dt.Rows.Add(new Object[] {1, "Covell"});
dt.Rows.Add(new Object[] {2, "Schaefer"});
dt.Rows.Add(new Object[] {3, "Krause"});
dt.Rows.Add(new Object[] {4, "Meloskie"});
dt.Rows.Add(new Object[] {5, "Vader"});

MyDataView myView = new MyDataView(dt, "EmployeeID < 3");

Console.WriteLine("Filter row count: {0}", myView.CurrentFilterCount);
Console.WriteLine("Row count: {0}", myView.CurrentCount);
}
catch (Exception e)
{
Console.WriteLine(e);
}
finally
{
Console.WriteLine("Done and done.");
Console.ReadLine();
}
}
}

public class MyDataView : DataView
{
public MyDataView(DataTable dt, string filter) : base(dt)
{
this.RowFilter = filter;
}

public int CurrentFilterCount
{
get { return this.Count; }
}

public int CurrentCount
{
get { return this.Table.Rows.Count; }
}
}

Labels:

Friday, January 21, 2005

Comcast and Optimum Online Intentional Outage Victim

It appears that I am once again an "intentional" outage victim. My Optimum Online broadband went out last night around 7 PM. I double checked the cable modem's Coax and Cat5 inputs... there was no apparent problem. I even inspected the outside box. Finally, I called Cablevision's customer support. The technician told me to unscrew the Coax cable connection... then screw it back in behind the cable modem. As I was doing this ridiculous solution, I could hear the customer support person performing "something" on the other end of the phone. Bingo. It worked.

I had a similar experience about a year ago with Comcast. Comcast intentionally went into the basement of my apartment building and disconnected my broadband. After a day without broadband (remember I work from home... so I had to painfully use dialup) a Comcast "worker bee" was dispatched to my apartment. It only took him three seconds to reconnect me. My interrogation (which consisted of offering a glass of water, iced tea, juice, or beer) resulted in his confession that Comcast intentionally disconnects peoples broadband so that they can track the entire support process (phone call, phone support, "worker bee dispatched", problem resolution, annoying follow up phone call, optional survey).

Labels:

Wednesday, January 19, 2005

Visual Source Safe 2005 Beta

As soon as I have time to download Visual Source Safe 2005 Beta I am going to install it ASAP. Some of the new features include: Web Service Configuration, Remote Access via HTTP, Performance Improvements, Globalization, Visual Studio Integration: Rename/Deletes, File Dialogs, Asynchronous open.

The "big" and most desirable feature is Remote Access via HTTP. We telecommuters have to be patience using today's version of Source Safe 6 over a VNP. Using Visual Studio .NET over the VPN is not too painful... but for those of us who still do some VB6 coding in Visual Studio 6... its extremely painful.

Labels:

Tuesday, January 18, 2005

.NET Remoting Events: Server to Client(s)

I ported Sathish's code from VB.NET to C#. Pretty straight forward. His article is located here. Download the updated source code here.

If you leave the application running for ten minutes... come back... and try to send a message via the EventPublisher... the client(s) do not receive the message. In order to prevent timeouts I forced an "infinite lease" in both Hoster.cs and EventsManager.cs:


public override object InitializeLifetimeService()
{
return null;
}

Labels:

Friday, January 14, 2005

Microsoft Office Live Meeting Conference

Today I used Microsoft's Office Live Meeting for the first time through MCI. I telecommute and its a great tool. The phone and desktop presentation are integrated and work rather well.

Labels:

ImageGlue & ABCpdf

At my current consulting gig we are heavily using ImageGlue .NET and ABCpdf .NET developed by webSupergoo.

Zero complaints... aside from the usual... "I wish it was faster, smaller, and does everything that I want it to."

Labels: