November 2005 - Posts

Remote Work

So, I work from a home office 99% of the year. I have a desktop PC where I do most of my work, but every once and a while, I want to go to Starbucks or somewhere else and get outside. Today just happened to be one of those days. Usually, I will take my Tablet PC along with me, copy whatever files I need to work on over, and get to work. However, I didn't feel like doing that today. For one, I don't yet have VS 2005 installed, so I would have had to download the installer to the machine, install, etc. which I don't have time for today. So, I got to thinking, well, I can probably just remote desktop to my PC from the outside... well, turns out that this is not going to happen with my current ISP. Just is not an option due to the network config. So, I started searching for some solutions, and I came across something that is pretty slick and works like a charm: GotoMyPC. It is made by the guys who brought you GotoMeeting (which is a really slick tool that I use quite a bit) and basically allows you to access any of your PCs from anywhere. Its very slick and runs a cool $19 a month (not including Starbucks drink charges). Definately worth it for the extra freedom and the reduced file copying / app install hassle.
Posted by Jesse Ezell with 5 comment(s)

Text-to-Speech is so 1980s

Coming to a device near you Speech-to-Speech:

"The goal of the Speech-to-Speech Translation (S2S) research is to enable real-time, interpersonal communication via natural spoken language for people who do not share a common language. The Multilingual Automatic Speech-to-Speech Translator (MASTOR) system is the first S2S system that allows for bidirectional (English-Mandarin) free-form speech input and output."

http://domino.research.ibm.com/comm/research.nsf/pages/r.uit.innovation.html

 

Posted by Jesse Ezell with 1 comment(s)

NeoSwf.NET Released

GlobFX's C#->SWF compiler has been released. Very cool little product that is worth checking out.

http://www.globfx.com/store/neoswiff/

Posted by Jesse Ezell with no comments

MySQL .NET Connector Connection Pooling Bug

If you are using the MySQL .NET connectors and run across the message "Stream does not support writing" like I did, you will probably have a few unpleasant days ahead. Have no fear though, the solution isn't too hard to implement. The problem is that the connection pooling mechanism in the drivers is broken. If an error occurs at the packet level, the underlying streams to the connection are closed, but the connection is not removed from the connection pool. As a result, the connection (which is permanently broken when the underlying streams are closed) gets returned to subsequent connection calls and results in your server crashing for all calls made on that pooled connection. I've reported the bug to the MySQL team, so hopefully it will be officially fixed--but, in the mean time, you can simply add a property to the PacketReader and PacketWriter that ensures that the stream can be read from / written to and then a property on the NativeDriver / Driver class that ensures that this value is true. Then, from the connection pool manager, in the loop that searches idle connections, do a sanity check on the connection before returning it to the app. If the connection's streams have been broken, remove it from the idle pool instead of continuing.

If you don't want to deal with this, the root of the problem for me was that the max_packet_size variable in the config needed to be bumped from the default of 1MB up to something large enough to handle my blob columns. Setting it high enough eliminates the packet level error that was putting connections in the bad state, but I am sure there is another situation that could put them in an invalid state, so fixing the pooling bug is probably a good idea regardless.

You might also be able to avoid the problem by switching to named pipe connections... but I need IP based connections ATM.

Posted by Jesse Ezell with 6 comment(s)

What stops me from Implementing Visual Studio Team System

Ohad explains the reasons he isn't switching to team system.

I'll give you my reason: the price is quite simply obsurd. Maybe Microsoft talked to the Flex team about their genious "price yourself out of everyone's range" licensing scheme. Wouldn't be so bad if MSDN gave you access to team system, but no, MSDN Universal gets you a trial, and even with your MSDN discount, team system is rediculous expensive. Like I am really going to pay $11,000 on top of my MSDN to use Team System. Give me a break.

[1] http://weblogs.asp.net/israelio/archive/2005/11/06/429703.aspx

[2] http://msdn.microsoft.com/howtobuy/vs2005/editions/team/Default.aspx

Posted by Jesse Ezell with 7 comment(s)

Fixing XmlDataSourceView

Now that 2.0 is out... its about time to fix another MS class.

I know Scott posted a "fix" for the XmlDataSourceView that simply strips all the namespaces out of the document with a transform. That seems pretty lame IMO, because if you are actually using the namespaces, this isn't really a fix and could lead to lots of bad side effects. So, I figured, there has to be a way to fix this. And here it is. It's not really all that tested, but it should do the trick. Feel free to use it and/or make it better or prettier (for example, you could implement all the members of XmlDataSource view--with the exception of the GetView ones of course--and have them wrap the provider's ones):

 

using System;
using System.Reflection;
using System.Xml;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace MyNamespace
{
 public class MyXmlDataSource : IDataSource 
 {
 public MyXmlDataSource(XmlNamespaceManager namespaceManager)
 {
 _provider = new XmlDataSource();
 ((IDataSource)_provider).DataSourceChanged += new EventHandler(MyXmlDataSource_DataSourceChanged);
 _manager = namespaceManager;
 }
 
 public MyXmlDataSource(XmlDataSource provider, XmlNamespaceManager namespaceManager)
 {
 _manager = namespaceManager;
 _provider = provider;
 ((IDataSource)_provider).DataSourceChanged += new EventHandler(MyXmlDataSource_DataSourceChanged);
 
 }
 void MyXmlDataSource_DataSourceChanged(object sender, EventArgs e)
 {
 if (DataSourceChanged != null)
 {
 DataSourceChanged(this, e);
 }
 }
 #region IDataSource Members
 
 public event EventHandler DataSourceChanged;
 XmlNamespaceManager _manager;
 
 XmlDataSource _provider;
 public XmlDataSource Provider
 {
 get
 {
 return _provider;
 }
 }
 public DataSourceView GetView(string viewName)
 {
 if (viewName.Length == 0)
 {
 viewName = "DefaultView";
 }
 return new MyXmlDataSourceView(_provider, viewName, _manager);
 }
 
 public System.Collections.ICollection GetViewNames()
 {
 return ((IDataSource)_provider).GetViewNames();
 }
 
 #endregion
 }
 
 public class MyXmlDataSourceView : DataSourceView
 {
 public MyXmlDataSourceView(XmlDataSource source, string name, XmlNamespaceManager manager) : base(source,name)
 {
 _source = source;
 _xmlNamespaceManager = manager;
 }
 
 XmlDataSource _source;
 XmlNamespaceManager _xmlNamespaceManager;
 protected override System.Collections.IEnumerable ExecuteSelect(DataSourceSelectArguments arguments)
 {
 XmlNodeList list = null;
 if (this._source.XPath.Length != 0)
 {
 list = _source.GetXmlDocument().SelectNodes(_source.XPath, _xmlNamespaceManager);
 }
 else
 {
 list = _source.GetXmlDocument().SelectNodes("/node()/node()");
 }
 
 Type t = typeof(XmlDataSourceView);
 Type enumerationType = t.GetNestedType("XmlDataSourceNodeDescriptorEnumeration", BindingFlags.NonPublic);
 return (System.Collections.IEnumerable)Activator.CreateInstance(enumerationType, list);
 }
 }
}
Posted by Jesse Ezell with 3 comment(s)

VS 2005 IDE Quirks

Looks like Roy is running into some trouble with the new IDE already. I've noticed a few quirks here and there so far, but nothing too major. Pretty huge overhaul on the IDE though, so not suprising that some bugs made it in to RTM. Personally, I would rather have the IDE with a few bugs and have a VS 2005 with 2.0 framework RTM, than no bugs and a VS 2006/2007. I'm just glad that I can finally use generics and the 2.0 framework. As long as I only get one crash or quirk for every collection class I didn't have to define, it will all even out in the end.

[1] http://weblogs.asp.net/rosherove/archive/2005/11/04/429455.aspx#FeedBack

Its not like VS 2003 was bug free anyway. Anyone who has worked with the ASP.NET designers should know that.

Posted by Jesse Ezell with 1 comment(s)

MS Retards

Looks like some of the geniuses that brought us Microsoft Bob are at work on the .NET framework 2.0. I love how the XmlDataSource control doesn't let you use xml namespaces in the RTM version. How the hell does anyone that doesn't understand the importance of Xml namespaces get a job creating the primary Xml databinding feature of .NET 2.0? Maybe I am missing something, but I know this was a problem that was brought up numerous times during beta, and it doesn't look like it was addressed in RTM.
Posted by Jesse Ezell with 5 comment(s)
More Posts