|
1:51 PM Friday May 25, 2007
Comments: 0
I keep forgetting about how cool BuildProviders are in ASP.NET 2.0. I have a little hello world sample whipped up that does nothing accept create a class Person with a single property Name in the namespace CC. Basically, just open the solution and compile. Go to the code behind for the default page and type CC. and see what comes up. Nothing revolutionary in the example, just a bare bones example of how to hook it up. HelloBuildProviders.zip (14.39 KB)
10:21 AM Friday May 25, 2007
Comments: 0
8:18 AM Friday May 25, 2007
Comments: 0
These REALLY come in handy for simple little things. I love CodeRush, can't live without it. I like the mnemonics, ps+space generates a string property. I also like to gen stuff from a database but for maintenance tasks or for some fine grain tools, I have no need to generate a full fledged framework to access the data.
This is where ActiveSnippets come in, the ability to generate some code inline with whatever you're coding from details in the database. I had a need this morning for a csharp method that selects a row from the database by primary key and returns a datatable. It needed to be written quickly. I got to thinking though that I always write methods for that purpose, quick little one off methods to get data out of the database. So in about 10 minutes I created the CodeSmith template that generates the csharp method to hit the database and return a datatable with the results. In the spirit of CodeRush mnemonics, I hooked up the template to the alias sdtft which indicates that I want to select datatable from table.
Now all I do is type this within the class I want to place the method:
sdtft my-connection-name.dbo.the-table-i-want-data-from
Kick off the ActiveSnippets key pattern CTRL+E, CTRL+E and voila, I have a ready to go method generated for me, complete with connection string. Here are the files:
CSharpSelectFromMethod.zip (7.85 KB)
9:22 PM Tuesday May 22, 2007
Comments: 0
Sometimes I want to start up a simple ActiveRecord project and test something out quick. I don't like the templates that are installed when you install the Castle bits, so I created my own. It's sub-optimal as I spun my wheels for too long trying to figure out how to do multi-project templates. I've read the docs, followed the directions(or so I thought) and was not able to create the multi-project template, but I'm still working on it. In the mean time I figured just having a simple skeleton, the App.config, the correct references, etc right off the bat would be better than clicking around and adding them myself. And I can never remember the ActiveRecord config settings.
So basically I set up a project that has one class for the ActiveRecord and another class that will house the tests for the ActiveRecord. Added the config and references, and now I'm good to go. Start up visual studio, add new project, I dropped the template into the web folder for new project items, so I just expand the Web folder and pick ActiveRecordProject. Now I start with two classes, my references, and the config file. All I need to do is modify the two classes to match what I'm testing, add the connection string to the config file and I'm ready to test out my class.
Here's the template zip:
ActiveRecordProject.zip (12.81 KB)
drop that file here:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates\CSharp\Web

Fire up visual studio and it will pick up the new template, it should appear here:
8:1 PM Wednesday May 16, 2007
Comments: 0
Diving into WCF. That's what I've been doing over the past few days. I have this book and this book. They are both SUPER boring. Great technical information, well structured "text books", etc, etc. But WOW. Snoozers. I'm not sure what this is a reflection of, is it that the technology is boring? am I boring? wait, don't answer that. I think I got spoiled with Head First Design Patterns. If you haven't picked up a copy, do it, just do it. It's all about keeping your attention, makin you think, having a little fun, all so you can learn stuff. Not just boring technical details.
I checked out Cardspace for the first time today, and I kinda like it. The concept anyways. Here's a nice intro, although it moved a little slow, funnily enough on Windows Media Player, if you click the little fast-play button twice, it's still understandable and plays fast enough to hit all of the key points.
9:54 PM Tuesday May 8, 2007
Comments: 0
I'm sitting in a hotel room right now watching an awesome World Combat League battle royal. The women just got finished, and it was one of the best fights of the night. 3 minutes of non-stop action, if you haven't watched this before it's the best. Presented by Chuck Norris, fighters are penalized for not fighting, the way I think all fights should be. Kicks must be followed up by punches, great stuff like that.
You really never know how great your home internet connection is until you have a shitty hotel connection. PLUS. My lappie took a dirt nap this morning and needs to be mailed off to HP for repair; so you also never know how awesome your own lappie is until you're stuck using a government issued "beater". Ugh. Sooo slow and not fun.
We are getting some damaged floors finished in our house and during this time we're not allowed to live there, so we've been moved into a hotel for the week. One of the "freebies" of the hotel is free happy hour from 5:30 to 7pm every evening. What's cool is that it's just a some ice in a bin with a bunch of beers, good beers at that, and two krafts of good red and white whine. They also have some simple finger foods available. I like finger foods :) Last night were some tasty chicken nuggets, and tonight were "little smokies", those tiny hot dogs normally featured in Pigs in a Blanket.
The beer and smokies have caught up to me, night night time now. zzzzzzzzzzzzzzzzzz...........
10:10 PM Monday May 7, 2007
Comments: 0
via Almost Serious: Stoning in the 21st Century.
Here is a link to a video of a teenage girl being stoned to death(it's graphic video not suitable for work environment).
I can't stop thinking about it, I'm really disturbed by the whole thing.
This makes me think global warming and any horrible disaster conjured up by mother nature are not accidents at all, just something or someone(whatever you believe in) that knows how ugly humans can be and is trying to fix it.
9:24 PM Sunday May 6, 2007
Comments: 0
That's a saying that someone I work with always says. I like it. The more I think about it the more I like it. It's his philosophy and getting things done. Somebody works on this webservice, somebody works on the database(he's a dba so that's him), somebody does this, somebody deploys, etc. Then at "the end of the day" so to speak, we all bring our pieces together and voila, we have some new system and/or component, whatever we were supposed to build.
Accountability is a good thing. It can force developers into defensive coding techniques which is good for all parties involved. For example, nobody wants to be "that guy", the one who is the weakest link in the chain. Meaning, if you're gonna build some software that other people need to get their sh*t done, your piece had better work, or at least be able to tell everyone very quickly why it doesn't.
I work at a place where there is a big push for separation of duties. This means that certain people will have access to development environments, and certain people will have access to production; but noone theoretically would have access to both. I've heard much rumbling over this like "what if there's a problem, some dumbass in the production group would never be able to diagnose what's wrong with my app ..."
So my question is this, why can't they figure out what's wrong?
Is it any different than me trying to download and install a piece of software only to run into configuration problems? That drives me nuts. Why should I have any problems installing the software, and if I do encounter problems, how come the software isn't smart enough to tell me what's wrong and how to fix it?
If your app knows that it needs a particular resource to function properly, it certainly will know if that resource is not available and why it's not available. I'm a fan of the separation of duties. Can you honestly say that anyone can install and run your software without a hitch? I can't, but I'm workin at it.
7:57 PM Saturday May 5, 2007
Comments: 0
I spent a few hours this morning trying to get some issue tracking software installed. I won't mention which product because it's free and normally a great piece of software, it's just this latest install that bugged me.
I ran the installer, answered all of the questions appropriately(or so I thought) and then at the point where the database was being set up it broke. It couldn't run any of the scripts. OK. Why not? The message indicated that there was a problem executing the script. This error appeared on every script it tried to run. Fine. After some futher research and reading the f*ckin manual, I discover that there are extra tasks that need to be done outside of the installer. One of these is a biggie, "create the database first"...
So I think, OK, I didn't RTFM and that's what I get. I take full responsibility for my actions. But why did it need to be that hard? If the installer knows how to run scripts against the database, can it not check to see if there is even database to begin with? And if it fails on the first script, and all of the other scripts depend on the first, why did it try to run the other scripts if the first one failed?
During the install, I was prompted to provide the names of the databases that would be used to support the system. My assumption was that it was going to create the databases, and we all know about assumptions.
I finally gave up. It was starting to be a waste of time. I had heard of Trac from somewhere, I think while poking through prototype.js source. Anyway, this thing is free and built with Python and has a ton of tools and addon scripts. In less than 20 minutes I was up and running AND it was hooked up to subversion and I was immediately able to browse source code. That's the easy button. No fancy installer UI, just some command line scripts, and voila, done.
Is Trac a great product? I have no idea, but at least I'm at a point where I can evaluate it. The other product? When I have time, I'll reinstall and give it a chance, it's good software, just a bad installation experience.
7:5 PM Friday May 4, 2007
Comments: 0
Prototype hit a final release this week with 1.5.1.
NHibernate did the same with 1.2.
I have a codecast I want to produce, but waiting on a microphone I just ordered from Amazon. It's not the one I wanted. I signed up for the Amazon Prime deal only to learn that the microphone I wanted was out of stock, due in in a month or more. Bummer.
Prototype window is about the coolest thing ever. The latest version is 1.3. Easy, easy, easy. All of the qualities I believe all softare should have. This is a great javascript software library built on prototype.
|
|