Archive for February, 2005

DNJ conversion

DNJ is converting to CS soon, it’ll be interesting to see how well the site works after the switch………

Weird Word Feature

Check out this weird MS Word feature. The function is like this:=rand(numberOfLines, numberOfSentencesPerLine)

Pretty strange, I wonder if there is a similar function to get the greek text that you see in web designs as filler material.

First Impressions of Community Server

I downloaded and installed community server last night, and I wanted to
give my first reaction after playing around with it for a bit.
The main difference, to me, between cs and .Text
was the install. I want to make this very clear: the installation of CS
is EXTREMELY EASY. You can practically install this and get up and
running by accident its so easy. Major, major improvements over .Text.
You unzip the files, create a virtual directory and browse to the web
based installer. It asks you the location of the sql server, the
username/password and then presto, done. I had one minor roadblock,
which was my own doing, I got a web.config error because I have asp.net
2.0 installed, if you have this installed, you need to manually tell
IIS to use v1.1. You do this by going to the property pages of you IIS
application, and select the ASP.NET tab. There you can select which
version of the runtime to use, piece of cake.
Aside from the fantastic installation, one of
the first things I noticed was in the user/blog administration. They
have removed the notion of one user/one blog. In CS you can create
users, and you can create blogs, they are independant of each other.
After you create a blog, you can then assign as many owners to that
blog as you want. I think this is a great feature for group blogs and our link blog, it
makes it very simple to manage, everyone can have their own
personal blog as well, without having to log into different accounts to
manage their different blogs. This style of managing users and blogs separately had me
confused at first, but after I figured out how it worked I decided that
I liked the setup.
One of the things that always annoyed me about
.text was the login page to your blog. You couldn’t enter your username
and password and press the “Enter” key to submit the form, you always
had to move the mouse to click “Login”, I know its nitpicky, but it
always bugged me! In CS you can press enter to login, so my universe is
now in order again :)
So Community Server looks to be awesome, I’ve
only had it for a few hours, but I already can’t wait until we upgrade
codebetter to use CS, I’m especially looking forward to the integration
of forums, I think it will facilitate our discussions better than
having huge conversation logs in our gmail accounts. :)
Look for Geoff to have a much more in-depth review, I only messed with it for a few hours, I’m sure hes going to put it through the motions more than I have.

More on xsd.exe

I recently posted about serializing my objects against a schema
(xsd). I wanted to get an object from the database, and then convert it and its
related data into xml format so that I could send it down to javascript
requests.
I wanted to give an update of how this works. I initially was using xsd.exe
to create and .xsd file from my sample xml documents, then from that .xsd file
you can create a class file that will serialize to xml conforming to schema
definition.  Joseph Cooney commented in the other post that xsd.exe doesn’t
always infer the schema correctly, and I was noticing this as well; I couldn’t
use the generated class files to serialize my data, I had to manually modify
them.  Joseph pointed me to the infer.exe
tool that resides at GotDotNet
that does a better job of inferring xml
schemas from an xml document, you can even give it multiple sample xml files so
that it can get a good sampling.
So now using infer.exe I create my .xsd file, and I still use xsd.exe to
create my class files. These class files are now higher quality and can be used
“out of the box.” Now all I do is write a little method that converts my data
object into the generated class, and then I use the XmlSerializer to serialize
that object into the appropriate xml.
I really like this style because making changes is relatively straight
forward.  I simply edit my sample xml file(s) , re-create the .xsd file,
re-create the c# class file, modify the conversion method, and we’re all
set!  (It sounds like a lot, but its really simple, and you can script some
of it.)  What I like about it is that since the class file has been
generated using a built in .net tool, I haven’t gotten any serialization errors;
I also like the fact that the sample xml files, and the .xsd files are versioned
right along with the source code, which is nice.

I Don’t Care About IE 7

By now many of you have heard the news that Microsoft has plans to release IE 7.  Most of what I’ve read is
that the update will focus on security enhancements that customers have been
asking for, which is great.  However, the reason that I use firefox
exclusively is not because of security, most technically savvy users can protect
themselves, its because of the performance.

Firefox just seems faster.  It loads xml via javascript faster, it
writes dhtml content faster, it loads plain-jane web pages faster.  This is
why I won’t switch back.  I never had a problem with security when I used
IE 6, and I don’t have one now that I’ve been using firefox for 6 months. Its a
non-issue to me.

Don’t get me wrong, releasing IE 7 with a bunch of security improvements is
the prudent thing to do, considering that most users need to be protected, but
if Microsoft wants to get developers back to IE, they need to add a few things:
tabbed browsing, performance upgrades, and extensibility come to mind.  Of
the 25,000,000 downloads, how many do you think were developers? 
My guess is most of them.

Great concurrency series

Here is a perfect example of what we would put on our link blog :-)

I
just need to plug Larry Osterman’s new series on concurrency, it never
ceases to amaze me the amount of in-depth knowledge he has, its crazy

How does consulting work?

So, I know that some of you on codebetter are consultants, and I’ve
always wondered this about consulting: how can you continue taking
jobs, when you must have to do some maintenance work on past
clients?  At some point don’t you constantly have previous
customers calling for bug fixes, new features, etc. to the point where you could do that 24/7 ?

Can anyone explain how consulting works in a nutshell?  thanks

Virtual directory woes…..

We
make custom websites for people, just random stuff, shopping carts, photo
galleries, things of that nature.  We have an administration web site that
we attach to each website so that users can manage their own websites without
having to call us for each change or update.  The way the administration
website works is that it gets mapped into the customers website as a virtual
directory, so they just browse to a special directory on their own
site.

So, consider this setup:

  1. The client site is located at
    C:\Inetpub\wwwroot\clientSite\
  2. The admin site is located at
    C:\Inetpub\wwwroot\Internal\AdminWebSite\

We map path #2 into path #1, thus making the
virtual URL:

C:\Inetpub\wwwroot\clientSite\myWebAdmin\

This is great because now all of our clients
can share the same admin web site files, because we can just map the site into
theirs. Except for one thing: you cannot access assemblies in a virtual
directory. In order for the runtime to locate the admin web site assemblies, to
run the site, the assemblies have to physically be in the client site. 
I’ve tried to circumvent this by adding a <runtime> element to the
web.config file, so that I could probe for the assembly in the virtual
directory, but without luck.  What this means is that while we can map the admin site into our client’s
sites, we still have to copy the 4 assemblies into the client’s bin\
directory.

Now, this isn’t the end of the world, all the
clients still share all of the pages, the .aspx, .js, etc. but its just a little
annoying to have to copy the assemblies into each clients site every time we
make a change to them.  I would rather just update one set of assemblies
and know that all the sites got updated.

Output=xml

By now most of you have heard about the Google mapping
application. Its pretty sweet, some excellent use of dhtml, and I love that you
can slide the map around, it must be nice to have millions to spend on some good
r & d.

What I think is the coolest thing about the maps, is
that you can append “output=xml” to any query and get the results in xml format.
Check it out, this is a query for hotels near Minneapolis

http://maps.google.com/maps?q=hotels%20near%20minneapolis&output=xml

I’m not sure what the licensing information is for this data, but that xml
feed could be so damn useful, wow!

Fun with xsd.exe

So
we’re starting to do a rewrite of our music management software, using
whidbey.  We wanted to make use of the
XmlHttpRequest object to do a lot of asynchronous javascript calls, like you’ve
seen on
Google maps, or the
search at
www.forgetfoo.com

I have our database tables mapped into c# classes,
so that I can easily get the data from the database, but I needed to convert
those objects into an xml form to send to the browser.  I had some sample
xml files that I wanted the resulting xml to look like, but I wans’t sure of the
best way to transform my objects into the appropriate xml
representation.

I’m not
just converting simple database rows into an xml file, which would be really
easy using dataset.  I want to convert related data, one to many and one to
one relationships.  I knew that there is built in support of using an .xsd
file to convert classes and xml, but I had never used xsd.exe, and furthermore,
I didn’t have an .xsd file, just .xml files.

Just to see what xsd.exe offered, I checked out the
command line options, and low and behold, you can give it an .xml document, and
it will create the corresponding .xsd file! (This is probably obvious to most,
but like I said, I had never used xsd.exe). I already knew that I could use
xsd.exe to create a c# class file from an .xsd file, so I converted one of my
sample xml files into and .xsd file, and then created a corresponding c# class
file.

Now, all I have to do is map my database table
classes into the generated xsd class file, and the I think I can use the
XmlSerializer to transform that class into the xml document that I’m trying to
create!  We’ll see how it goes, I’ll keep you
posted.