Monday, December 14, 2009

[smack smack]
What time is it?
[lick lick lick]
Wow. I slept till 7
[scratch scratch scratch]
Ok dude. I can take the hint.
Sweating? check
Legs glued together? check
Pillow wedged under shoulder to ensure asymmetrical sleeping position? check
Infant nuzzled in the angle's vertex: armpit? check
She's really getting cute.
If this soap gets any thinner... I should get a new bar next time.
"Come on boy. Sit. Sit. SIT! Good boy."
Not there. Not there. Dammit. I'll be carrying that with me now. God how I hate carrying it. It's trash day, maybe I can find an open can...
Ok, what to get. I need protein. I don't need the fat. Reduced fat turkey it is. I hope they don't put too much water in this time. I like to taste the espresso.
And off we go. Let's see if I can get the tires to break this time.
Nope. The coffee was sideways in the cup. Reminds me of that space station scene in 2001.
30% off sushi. mmm...
Why do they need a whole truck for Red Bull?
Hi security guy.

Tuesday, July 14, 2009

System.Type to SqlDbType Conversion

I've been looking for something to do this that was simple, and I found this:
private SqlDbType GetDBType(System.Type theType)
{
  SqlParameter param;
  System.ComponentModel.TypeConverter tc;
  param = new SqlParameter();
  tc = System.ComponentModel.TypeDescriptor.GetConverter(param.DbType);
  if (tc.CanConvertFrom(theType))
  {
      param.DbType = (DbType)tc.ConvertFrom(theType.Name);
  }
  else
  {
      // try to forcefully convert
      try
      {
          param.DbType = (DbType)tc.ConvertFrom(theType.Name);
      }
      catch(Exception e)
      {
          // ignore the exception
      }
  }
  return param.SqlDbType;
}
There are a number of problems here, but it occurred to me that the SqlParameter object does type conversion when you create a new parameter. So, I did this:
      private SqlDbType GetDBType(object o)
      {
          SqlParameter p = new SqlParameter("x", o);
          return p.SqlDbType;
      }

Tuesday, February 10, 2009

Firefox Failed to Connect or How I grew to Hate Symantec

I updated Firefox. Or rather, I let Firefox update, and when it came back up, it didn't. The application worked just fine as long as you just look at local files. If it was interwebs browsing you had in mind, well that was another story. I say "was" because through much headache, I figured out what the problem was.
I'm pretty handy with Google, so armed with the best search engine and the second best browser (i.e. IE), I went on a hunt. (Oh, and by the way, notice how IE still works? The least secure browser gets a pass -- what's that about???) Everywhere I went the response was the same: "turn off the firewall for that application". So I found the windows firewall settings. There happen to be like 3 different versions of these settings in Vista. You can control logging in one version, so I turned logging on. I watched the file, and ran Firefox. No change. So, either the logging wasn't working, or the firewall wasn't blocking Firefox.
I did some more poking around, and I found that you may have some other firewall running. This is particularly (and peculiarly) true if you had Norton on your machine at one time. I bought this laptop on a Black Friday deal after waiting in line for 2 1/2 hours. It came with anti-virus, but the one it came with wasn't installed, so I gave that to the wife as I don't usually -- actually, I never run anti-virus. Why should I? I'm careful, and I haven't been bit yet. Anything dangerous happens on a Linux machine. The hitch here is the laptop came with a trial version of Norton. I let it live until it started bugging me about my trial running out. That got annoying very quickly so I uninstalled it -- or so I thought.
Even if you uninstall Norton, you never truly uninstall it unless you remove it. Turns out Symantec made a special tool for this. It's easy -- just go to their ftp site and download it. Unless the firewall that is impossible to get to is blocking ftp. It's not is it??? Oh yes, it is. Unbelievable.
Well I found the tool on an http download, ran it, and everything seems to be ok. I really don't want to reinstall Vista if I can get around it.
Just a quick word about a very useful app. Someone made a tool called EnumProcess that told me I had Norton firewall still running. So here's to you EnumProcess person...