September 2004 - Posts

12th post!!

Well this blog entry is to just make it to 12 posts for the month of September. A new record!

Chris has been having issues with our method of electing political leaders in this country for a few months now. Chris is a really fart smeller.. err .. highly intelligent person and I guess it's hard watching inefficiency go on in front of him especially when it's a process that's important to our future. Anyway the topic of the upcoming presidential debates came up on my end. They are not debates but rather commercials for the candidates. A true debate is a dialog between 2 or more people (except in the case of schizophrenia, you can debate with your selves) where ideas and opinions are defended. The process is to show the opinion for what it's worth. If the observer thinks an opinion is poorly defended then he may think this opinion is not worthy. That's the purpose of debates, to hammer an opinion and see how well it survives. It's not about right vs. wrong opinions but how well can it stand up on it's own. There's a lot that can be learned from a debate. I've often taken an viewpoint that I don't agree with just to create a debate and see how well I can defend it. In some cases I've almost changed my viewpoint because I was able to defend the opposite so well. Anyway the presidential debates are more what I call a “forum”. A chance for each candidate to air his opinions on subject matter. For the most part these opinions are canned speeches and really give the observer nothing. I saw a report on CNN the other day how each candidate's election crew argue over camera angles, lighting and even how high up their candidate stands behind the podium. This goes on all the way up to an hour before the debate. It's a commercial people! Lights! Camera! Action!

Posted by craigg75 with 1 comment(s)
Filed under:

What the bleep do we know?

So Gregg and I finally got around to seeing the movie What the Bleep Do We Know? I give it a 6 out of 10. It's sort of reminded me of some of the jazzed up specials on Nova or Discovery channel when they try to explain something in science that's esoteric. Throw in a little animation and cool special effects and suddenly you have a pretty cool show about quantum mechanics. Not that there is anything wrong with that but it's like only looking at the cool graphic on the physics book cover and going wow look at that, now I understand it. Really the joy is delving into the book and learning it. But quantum physics, consciousness, nature of reality, mysticism is so ripe for special effects and sheeple. The first third of the film dealt with quantum superposition. The second part had an awesome animation sequence to describe how we are basically slaves to the chemicals. A pumping hypothalmus, blobs of cells with neural receptors and emotions and rock music. The last part went off the deep end and added the mystics in with the mix. bah. The movie was about a woman dealing with her disgruntled life with cutaways of interviews with scientists and mystics. So in the end once we've figured out quantum physics, the chemical nature of emotions and all of it's possibilities it's only a short leap to mysticism and the magic wands of how we can change our environment. Mostly the power of positive thinking. It was fun ride though, a worthy bit torrent download if it ever gets out there.

Gregg found this interesting site detailing the movie's subject matter -- Forums

Posted by craigg75 with 2 comment(s)
Filed under: , ,

Too much Hawking radiation can be bad for your theory

Well it looks like Stephen Hawking corrected his theory to account for the “information sink“ a blackhole represents. The Non Sequitor cartoon as usual is about 50,000 feet over the average readers head did it once again this weekend --

Posted by craigg75 with 1 comment(s)
Filed under:

SourceGear Vault

I'm building a new development computer for myself. Awhile ago I purchased this sweet Dell workstation, 2.4GHz and loaded it up with RAM and have been letting it sit. My HP computer that I've been using (1.7 GHz) has been acting flaky on me lately (most likely due to WinXP finally bowing under the pressure of a power user). So I decided to start building up the Dell and just use the HP as a multimedia editing station/bit torrent download machine (keep all of the giant hard drives there). I decided to look into a new source code repository instead of CVS. CVS is nice but it doesn't integrate at all with VS.Net. I know there is the igloo plugin but it never worked for me. I think it will only work if you have a local cvs repository, not remote like I have. So I decided to give SourceGear Vault a try. One of the cool things is that they have a free 1 user license! Since it's just me I went ahead and tried it out. Integrates well with VS.Net and it's xml web service based so I have remote connectivity. They even include a client api sdk if you want to build you're own client. Of course the downside to all of this is there is no migration path from CVS to SourceGear, so I've lost all of my history. I guess there's no harm in keeping my CVS datastore around in case I do need to look back in time. Some of the positive things about SourceGear:

  • Integrates with VS.Net
  • It's free to use!
  • Works over the web
  • It uses SQL Server as it's repository, meaning no corruption like VSS
  • It looks like VSS, nothing to relearn there
  • You can toggle it to behave like CVS (Edit/Merge/Commit) or VSS (Check Out/Edit/Check In). Although the only mode while being integrated with VS.Net is the VSS style.
Posted by craigg75 with 1 comment(s)

How to fix DateTime values after .NET Xml Serialization

I submitted this article to a few days ago. I'm not sure if they'll use it or not, I know they get tons of articles every month. Anyway I'll stick it here in case anyone runs into some of the same crap I did and would like a possible solution --


Introduction

The new .NET technologies, Remoting and Web Services has made life much easier than the days of trying to get DCOM to work. Although with anything that has been made easier there are some details that have been made too easy. In the case of Remoting or calling a web service, the Microsoft .NET Framework includes an automatic feature that converts all returned DataTables with DateTime values to the caller's time zone. So if you're in Seattle and need to find out a certain DateTime value in a database table row (let's say sale_date) on a server that runs in New York City you can make a web service call to find out. What happens is the sale_date value may have a value of 8/22/2004 9:05 am on the server in New York, but your web service call will result in a value of 8/22/2004 6:05 am. Which is clearly wrong. This article will tell you how to fix this problem.

Background

The problem seems to only occur whenever you send a DataTable as a return value. This is because .NET Framework will automatically serialize the DataTable into xml using it's System.Xml.Serialization.XmlSerializer class. The XmlSerializer will convert the DateTime values upon deserialization on the client. The idea here is to take control of the xml serialization process and manipulate the xml using regular expressions to give us the correct result.

Using the code

1. In the web service we first need to convert the DataTable to an xml string and send back the string. We use the System.IO.StringWriter class to write out the xml string:

  using System.Data;
  using System.IO;
  using System.Web.Services;
  ...
  namespace NYDataServices
  {
  ...
  // Web service is running in New York City
  public class MyWebService : System.Web.Services.WebService
  {
  ...
  [WebMethod]
  public string GetData()
  {
    DataTable dataTable = null;
    // Get data from database as a DataTable
    ...
    // Now convert the DataTable to an xml string and return it to client
    return convertDataTableToString( dataTable );
  }
  private string convertDataTableToString( DataTable dataTable )
  {
    DataSet dataSet = new DataSet();
    dataSet.Tables.Add( dataTable );
    StringWriter writer = new StringWriter();
    dataSet.WriteXml( writer, XmlWriteMode.WriteSchema );
    return writer.ToString();
  }

2. On the client side we make the call to get the data and receive the data as an xml string.

  using System.Data;
  using System.Text.RegularExpressions;
  ...
  namespace SeattleClient
  {
  ...
  // Client program running in Seattle
  public class MyClient : System.Windows.Form
  {
  ...
  public void GetDataFromServer()
  {
    NYDataServices.MyWebService ws = new NYDataServices.MyWebService();
    string xmlString = ws.GetData();
    DataTable dataTable = convertStringToDataTable( xmlString );
    // Do something with dataTable
    ...
  }

3. Converting the xml string back to a DATATABLErequires the use of regular expressions to search, adjust time values and replace. The DateTime values take on the form of 2004-08-22T00:00:00.0000000-05:00. The last 5 characters in the string indicate the UTC (Universal Time Coordinate) time. During xml deserialization back into a DataTable, the XmlSerializer class reads this value and creates an offset value based on the client's UTC time. It then adds this offset into all DateTime values upon deserialization. The kicker here is that if the DateTime value happens to be on DST (Daylight Savings Time) and the client is not on DST it will adjust for this too. We use some of the magic of the System.Text.RegularExpression namespace such as the Regex.Replace() function, Match class and MatchEvaluator delegate.

  private DataTable convertStringToDataTable( string xmlString )
  {
   // Search for datetime values of the format --> 2004-08-22T00:00:00.0000000-05:00
   string rp = @"(?\d{4}-\d{2}-\d{2})(?

Points of Interest

I know this problem happens when sending back DataTables. I'm not sure if the same applies to custom classes, although I suspect it does.

Here are links that I found very useful --
http://blogs.msdn.com/brada/archive/2004/04/13/112784.aspx
http://blogs.msdn.com/dareobasanjo/archive/2004/04/14/113179.aspx
Google groups post
Highly recommended Regular Expressions tutorial
829740 - Improving DataSet Serialization and Remoting Performance
MSDN - .NET Framework Regular Expressions (.NET Framework Developer's Guide)
MSDN - Regular Expression Examples (.NET Framework Developer's Guide)

History

Posted by craigg75 with 3 comment(s)
Filed under:

Deleting cell phone voicemail

So Annette left me a long long voicemail on my phone by accident over the weekend when the perturbations in her purse caused her cell phone to call me while at the Rams game. Lovely, now how do I get rid of it without having to listen to the whole thing? A secondly how do I get her to start locking her phone when she's not using it?

Well I found this trick via a blog today. If you want to delete a voicemail on your cell phone and don't want to listen to the whole thing, just hit 77 real fast on your keypad. This works with my Cingular phone.

Posted by craigg75 with 4 comment(s)
Filed under:

Learn how to ___ in 21 days

I follow this guy's blog for the rant humor. One the latest hits home with me, how 90% of the computer books out there are completely worthless. Check it out -- http://caustictech.typepad.com/caustictech/2004/07/learn_blitherin.html

Sort of reminds me of George Carlin's Book Club

Posted by craigg75 with 1 comment(s)
Filed under:

September activities

September is turning out to be a busy month, much to my surprise.

Last weekend Annette, Kenzie, her friend Madison and myself headed over to the Great Godfrey Corn Maze in Godfrey Illinois, about 40 minutes from home. Since most kids like mazes I thought it would be a lot of fun. It was a warm day and drove on out there. I love that part of Illinois as it contains the city of Alton with it's really cool Clark Bridge that spans the Mississippi. Also leading out of Alton is the Great River Road. It's a wonderful way to see the river by bicycle. So we got there and paid our money to get lost and the kids went by themselves in corn maze #1 while Annette and I took corn maze #2. Well Annette got irritated because there weren't enough clues to help you get through. I kept trying to tell her they can't make it too easy or you'd feel like you were ripped off ($5 per maze). So I got her close to the edge of the corn field and she stepped out of the maze. I thought it was somewhat metaphorical of taking a vacation, stepping out of the maze of life. Bah. Anyway I continued on my own and got out about the same time the kids did.

Last night I watched Kenzie as mom went to night school. I added some can lights downstairs over Annette's washer/dryer and added a switch for them. Ended up having to rewire some of the wiring down there. Fixed her washer that hadn't been delivering hot water for 3 years also. So I was “da man” last night when she got home :) Kenzie came downstairs during one of the commercial breaks (are all kids fascinated with tv?) and saw a huge wolf spider and decided it was safer watching the Disney channel. I caught the spider in a jar and had her release it in the backyard. I told her spiders are good because they are like your personal bug exterminators. She screamed when she released it... what is it with little girls and screaming anyway?

So this Saturday I'm having a bbq with some friends and their significant others and kids at Annette's home. Figure we are always talking about home life why not meet the faces behind the stories. Check up on the authenticity of them. Oh let's not create a trackback to that blog entry now ;-) Should be a good time. I invited Gregg too since he's staying in St.Louis this weekend. They will finally get to meet the Gregg in my own stories. Oh and one of my workmate's, Jay, has his birthday on Saturday, September 11th. We've kidded him relentlessly this week since he let it slip. Poor guy. Like he said, it's a 1/365 chance you'll be born on any one day. Take any 50 people and the chances are somebody will be having a birthday in the coming week.

Annette got free tickets to the Rams home opener on Sunday. We're going to take Kenzie and a friend since we got 4 tickets. I'm not sure how that will work. Kenzie, unlike her mother, is not much of a football fan. On Sunday's at game time she usually wonders off on her own and finds something to occupy herself for 3 hours. Most of the time she comes up with something creative to do like paintings, bead necklaces or builds something out of cardboard. It's actually kind of cool how she can entertain herself, not a needy child that's starved for attention. Although last year we went to a Mizzou football game with some friends and she played cheerleader the whole game. She will be quite the teenager I can already tell.

Posted by craigg75 with 5 comment(s)
Filed under:

Masturbation

Got your attention :) Ok this is a rant of sorts -- I go to the bathroom to take my daily dump and enjoy the relief that comes with that. But you know, half the time there's some guy in the other stall wacking off. I mean come on dude, wait till nobody is in the bathroom! Ruins my dump everytime. Fingers in ears and start humming until he's done. So this is a call to all guys out there. I know it's a natural urge and there's nothing wrong with waxing the salami but please be considerate of others. Allow yourself more privacy.
Posted by craigg75 with 9 comment(s)
Filed under:

New books for September

Well I finished my audio books. Enjoyed the James Burke - The Day the Universe Changed. Lightweight history on scientific thought from the Greeks through the early 20th century. Good stuff for a teenager interested in science. Finally got to a Harlon Ellison book, Repent Harliquin. A short story about a dystopian future where everyone stays on time or else.. I do enjoy how Ellison writes, although he read this book and at times was a little over the top with his theatrics.

New books are Richard Branson - Losing My Virginity. An autobiography about the rich guy from England who's always bucking the system. Reminds me a little of a young Ted Turner. Why his life is worth listening to I have no idea. But his antics is always in the news. Should be an interesting ride living the life of a guy who says “if I had a million dollars I'd ___” and he usually does it.

Also I'm going to finally get around to a William Gibson book. I was never one for cyberpunk but I really liked Neil Stephenson - Snow Crash. So I'll give it another one a try. Anyway my first Gibson book, Mona Lisa Overdrive. Supposed to be a classic.

Also I've got William Shatner - Get a Life. Sounds autobiographical. He enjoys poking fun at himself so it'll pobably be a fun listen.

Another biography of sorts is Alan Deutchman - The Second Coming of Steve Jobs. Steve Jobs has always interested me, successfully melding techology and art and yet quite the meglamaniac. I hope this isn't one of those “tell all“ books and is fair.

Finally Lou has turned me on to some Philip Dick interviews. The guy was somewhat of a wacko, amphetamine freak but wrote some great stories. In this case this is not an audio book, but an actual interview.

Posted by craigg75 with 5 comment(s)
Filed under: ,

The Entertainment Century

Got an email from Lou with a link to Adam Curry's (of MTV) blog. Adam's been listening to Michael Crichton's book Timeline audio book and thought this rant from the book was quite telling of our current society. I thought so too so I've copied it here without copyright permission for everyone to read and think about --

"Today, everybody expects to be entertained, and they expect to be entertained all the time. Business meetings must be snappy, with bullet list and animated graphics, so executives aren't bored. Malls and stores must be engaging, so they amuse as well as sell us. Politicians must have pleasing video personalities and tell us only what we want to hear. Schools must be careful not to bore young minds that expect the speed and complexity of television. Students must be amused--everyone must be amused, or they will switch: switch brands, switch channels, switch parties, switch loyalties. This is the intellectual reality of Western society at the end of the century.
In other centuries, human beings wanted to be saved, or improved or freed or educated. but in our century they want to be entertained. The great fear is not of disease or death, but of boredom. A sense of time on our hands, a sense of nothing to do. A sense that we are not amused.
But where will this mania for entertainment end? What will people do when they get tired of television? When they get tired of movies? We already know the answer--they go into participatory activities: sports, theme parks, amusement rides, roller coasters. Structured fun, planned thrills. And what will they do when they tire of theme parks and planned thrills? Sooner or later, the artifice becomes too noticeable. They begin to realize that an amusement park is really a kind of jail, in which you pay to be an inmate.
This artifice will drive them to seek authenticity. Authenticity will be the buzzword of the 21st century. And what is authentic? Anything that is not devised and structured to make a profit. Anything that is not controlled by corporations. Anything that exists for it's own sake, that assumes it's own shape. But of course, nothing in the modern world is allowed to assume it's own shape. The modern world is the corporate equivalent of a formal garden, where everything is planted and arranged for effect. Where nothing is untouched, where nothing is authentic."

Of course the rant goes on to “sell” time travel and the only authentic product for sale today.

Posted by craigg75 with 8 comment(s)
Filed under:

Welcome to September

Well the summer is drawing to a close. School has started, Labor Day is this coming weekend. I welcome the beginning of fall in a way. Fall and winter are usually more humdrum in my world. Not as chaotic as summer. I am a creature of habit, I'll admit that.

Baseball season is also coming to a close. The Cards are having an incredible year, but everyone is anxious about the playoffs. Are they good enough to make it to the World Series? It's been a big stumbling point for the team in the last few years. They can finish in 1st place yet can't seem to make it all the way. Sort of like our hockey team, the Blues. It's to the point where people in town take bets on what playoff round will the Blues lose in. Football season starts up on 9/12. I think the Rams fans are in for a disappointing year. We lost a few key players and our QB just doesn't look up to the job. We'll have to wait and see.

Election year is in full gear if you haven't noticed. Republican convention...<yawn>... is going on now. Why do they have these conventions anyway? I heard our taxes are used to pay for them. It's a way to make a big splash, just a big ad me thinks. Like Chris said in one of his earlier blogs, once again the candidates we can select from are the worser of two evils. It looks like George Bush will win a second term. I predicted that way back when it was clear John Kerry was going to win. The only way the Dems had a chance to win was by nominating a populist like that general or Edwards. Kerry is just another rich boy with 7 multimillion dollar homes, responsible for massive goverment waste programs like the Big Dig in Boston and clearly out of touch with everyday Americans much like George Bush is. Bush is not much of a leader but he really hasn't done much harm. Sad when we are satisfied with a president because he hasn't screwed up yet...

Speaking of politics, I finished the Bill O'Reilly audio book, Who's Looking Out For You. I liked it. He does lean to the right even though he says he's “fair and balanced” and “no spin here”. In any case he gives some good advice to the mongoloids out there. The problem is that the people he's trying to reach will not or do not or cannot read his book. That's unfortunate too. Most of his ideas on solving our society's ills is mostly common sense and requires people to act as a community. Well duh.. but getting that to happen is not easy. I do like how he labels people like Jesse Jackson and Al Sharpton as “racial witch hunters”. If the witches disappeared they wouldn't have any power.

So I hear James Doohan, who played Scotty on Star Trek is making his last public appearance. Apparently he was recently diagnosed with Alzheimer's disease and also suffers from Parkinson's disease, diabetes and lung fibrosis. Geez! I guess that's what happens when you handle too many dilithium crystals. Maybe we put him into a transporter buffer until we can fix all of his diseases. Oh man that was so geeky to say that. I remember watching the movie Trekkies and he said his character inspired a lot of people to become engineers. That's really cool. Good luck Mr. Doohan on your voyage into the final frontier!

Posted by craigg75 with 2 comment(s)
Filed under: