I could play with this thing for hours
Check out the cool ascii logo-maker here
Props to Mark Pollack for showing me this.
I could play with this thing for hours
Check out the cool ascii logo-maker here
Props to Mark Pollack for showing me this.
Another cool feature of the .NET DataGrid is the ability to bind not only to Data* structures ( DataSet, DataTable, etc… ), but also custom objects and structures.
Recently, I needed to bind a DataGrid to a strongly typed collection of domain objects, hereby referred to as ‘DOs’ ( DOS, get it? )
Now, you CAN just set the DataGrid.DataSource property, as such:
dgMyDataGrid.DataSource = DOs;
However, this will use reflection to name the columns of the DataGrid. So, if you have a property named “ObjectName”, it will show up as an “ObjectName” column. Blah….
But wait, there is a simple solution to your problem: Custom Table styles.
Create a new DataGridTableStyle object, and set the MappingName property to the type of your collection:
dataGridTableStyle.MappingName = “DomainObject[]“
Notice the array designation. This is VERY important and the one drawback of this whole system. The collection that you bind MUST derive from System.Array in order to make use of your custom styles.
This is easy to accomplish. Let’s say your DomainObjects collection derives from CollectionBase ( as it should…. 😉 ). In order to get a strongly typed array from that collection, execute this command:
(DomainObject[])InnerList.ToArray(typeof(DomainObject));
There you go. Now, you can create DataGridColumn objects for each column you want to display, then add them to your style. MSDN has TONS of info on this, so I won’t waste time.
Just remember, System.Array != CollectionBase or IList.
Happy Binding.
Ciao
Working on creating my first smart client.
Now, .NET has some nice no-touch smart client deployment infrastructure built right in. Simple drop the .exe onto a network share or a IIS virtual directory, and presto!. Fat client deployments for all.
I knew that there would be some security implications in going with this route, such as file access, reflection, etc… I was fine with these, since this would be a simple app.
But, lo and behold, in the default .NET security configuration, ADO.NET access is denied by default in both the Internet & Intranet zones. Internet zone makes sense, but Intranet? Aren’t most remotely accessed applications some for of data entry.
This boggled me, but have no fear, everything is configurable. We simply add a new Code Group that gives Full Trust permissions to anything strongly named with our key.
Sounds good?
One small catch is that this must be done on a per COMPUTER basis. That means, before a computer can run the application, it has to have these security settings configured for it. Big pain in the ass.
Now, onto figuring out some way to remotely run caspol.exe on several hundred workstations. Me thinks pexec.exe will come into play.
Ciao
This just looks freaking cool.
Check it out over at the apple site here
Repeat after me: Referential integrity is a DB concept.
Recently I was discussing how to introduce a domain model into an environment that currently revolves around the database. Everything is in terms of the database. Everything.
While discussing this architectural decision with the client, I was surprised by the following question:
“How are we going to represent the foreign key constraints & referential integrity within the object? Can we set some ‘triggers’ to check for that stuff when the objects are used?”
I then had to explain that referential integrity constraints had a couple of properties:
1. They enforce normalization
2. They are automatically enforced by the database
Now, you can see from 1. above that not only is referential integrity a database concept, but it actually enforces another database concept, normalization. Now, add the fact that normalization is a OPTIONAL database concept, and you have a tough time trying to justify why it should be represented at the object layer.
As for 2., I can understand why the client would like to enforce the integrity because it prevents invalid data. This is very valid and warranted. But, since referential integrity is a database construct, it’s actually enforced by the database anyway, so as long as the constraints are setup properly, nothing will be allowed to put invalid data into the database, not a object model or a vanilla SQL statement. This alone makes it unnecessary to replicate the constraints at the object level for validation.
Also, let’s say you wanted to replicate the constraints at the object level. How exactly would you accomplish that? Either you are calling to the DB for every single column that has a constraint placed on it, in order to verify the data provided is valid, or you are constantly loading up the entire foreign key list to check against.
Either way, that’s a LOT of overheard just to validate something that will be validated ANYWAY. People need to learn that the database is not the be all and end all of a system. Even if it is, design & performance decisions that are made at the database level should not be pushed up to the developers.
This brought a little smile to my day.
Names have been changed to protect the guilty:
finally {
// set object1 to null – GC is supposed to take care of memory allocation and deallocation, but just in case…
object1 = null;
rs = null;
}
Robert Roeper lists the 31 movies that he thinks changed cinema.
More to the fact, I think the title should have been “31 movies that changed the business of cinema”. How else can you explain number 24?
I will list each here, along with why it was on the list. Some notable MIA’s from the list include the Matrix & Pulp Fiction. But, that’s the beauty of movies. It takes all kinds.
Onto the list:
There are 3 things that I consistently come back to when I have to defend why I think an artist is great.
1. Longevity
2. Periods
3. Distinct, but continously different sound.
Longevity
Though less important that the next two, there is something to be sad for an artist / band that merely remains relevent for extended periods of time. But, that could just mean that the core audience is growing up, and still buying records. So, while this is important, I will quickly move onto the next two.
Periods
This is something that is understated when it comes to musicians. Other artists in other mediums all go through periods, in which their style changes, their message changes, etc…
I haven’t seen this applied musicians as much as it should. For example:
All of these artists remain popular today, but all have gone through significant transition periods when it comes to their lives and their music. These periods could go from clever instrument experimentation ( Price ), the reflecting ones ever changing self expression ( Madonna ), or merely the traversal of ones soul as they step through life ( 2Pac ).
What ever the basis for the periods, the fact remains that each artists goes through transitions, and these transitions are reflected wonderfully in their music. Yet, there is always the artists underlying style anchoring all of their music. Which leads into the last one.
Distinct, but continously different sound
Have you ever heard a band’s new cd and been hard pressed to not think of their previous albums? I know I have. Not that the album is bad, per say, just that you have this nagging feeling that you have heard it all before, even though it’s completely new. Some examples of this can be found in the following artists:
These are just a few of the artists whose albums are consistly “good”, just not consistently discernable from any previous works. In my opinion, a great artist is able to come out with fresh, new sound, while still sounding like themselves.
My most recent example of this is the new Rosi Size cd, Return To V. Now, for those not familiar, Roni Size is the premier artist in a sub-genre called Drum & Bass. The music within Drum & Bass is just that, a lot of pulsing drums and thumping bass. With Roni’s new cd, however, he chose a different path. Rather than another Drum and Bass cd, he chose to take all 18 ( yes, 18 tracks with no filler ) and insert the dynamic vocals of artists from all different genres, including Neo-Soul, Hip-Hop, R&B, and Jazz.
The result is a unique album, filled with dizzying vocals layered ontop of rhythmic drum and bass. Even through all of this, Roni Size’s presence is still there, in the forefront. You never doubt that he’s still there making all of music that has made him famous, just with some slight twists.
And that’s what I am referring to when I allude to a distinct, but different sound. Some other artists that can accomplish this:
Again, this is just some of my babblings, but I am curious as to what other people think makes an artist great?
Neal Stephenson is some sort of masochist…
I know this may be old news, but I recently had the urge to dust off my copy of Quicksilver and give it another go. I’ll admit, it is going to be a big undertaking.
I mean, after the TOME that Cryptonomicon was, he releases a new three part series, with each book the size of Cryptonomicon?
I am sorry, but if a book weighs more than my baby, it’s too freaking big.
This is a mail to weblog test