I got a spot! Woo hoo!
This thing sold out in 10 minutes folks, for the men anyway(57 minutes for the ladies to sell out). Total of 228 competitors, male and female. 100 bucks a ticket. 40 men and 40 women on the wait list. INSANE I TELL YOU.
NorCo Crossfit has a crew going, we did it last year and it was a blast.
I really wanted to try an write every day of May, but it's hard. Especially when I have nothing to write about and worse when it's night time and I'm tired. I have a lot of starts, you know what I mean? I've started posts and either the little critical voices in my head tell me it sucks, don't post, or I never finish it, so the drafts are sitting in my list of posts.
Part of my problem is my shitty blog software(self created). I want to make changes(it's a painfully simple app) but I think of too many things, and it shuts down the process of actually doing shit.
I need to stop thinking about shit. A friend of mine posted this link the other day, it pretty much sums up how I work(including being up at 3am). Cycle of Fear.
The particular password being masked is 6 characters long. Depending on the time of the day, each character is masked with either 3 capital X's or 2. Luckily it's an obscure mixed case password that was machine generated and I cannot change; that part is actually OK, it's short enough that I can remember it...today.
But that gets me thinking. Why the fuck is it masked in the first place?? I have a better chance of getting hit by a bus than I do having someone looking over my shoulder and stealing my Lotus Notes password, so they can log into my Lotus Notes account and....and....and what? Are you going to work my development requests? Seriously?
By default, show my password. Give me the option to hide it, but let me see it by default. That's it.
That was a hot item 5 or 6 years ago, is Windows Workflow just a the underpinnings of some other technology now?
Kathleen Dollard indicates that something may have happened to Workflow during it's lifetime...
Holy crap this thing made its funding fast.
I really hope this thing takes off. What I mean by that, is that I hope it not only is itself a great product(I'm a backer, and I believe strongly that they will make a killer product), but also that it will challenge the other mainstream code editor developer's to step up their game.
Stepping up their game? Yep. One thing I wish we had was a smart MVC editor. One thing I hate is having to navigate everywhere in Visual Studio to find Models, Services, Controllers, Views. I want some revolutionary way of editing that stuff in one place. I don't even fully understand what that means, but something has to change.
I almost wrote a post about property mapping. But I just realized, that I wasn't enjoying writing about it, very boring. I'm watching Blue Mountain State for the second time. Oh my god, it's hilarious. Yep, that's all I got for tonight. That is all.
I'm looking for some lightweight php frameworks that will help me speed up and clean up my blog software. And when I say, lightweight, I mean light enough to be able to walk through most of the source code in one or two sittings.
Microsoft hit it out of the park with ASP.NET MVC 1.0(emphasis on the 1.0). I was able to walk through all of the source code on a plane flight.[note: except for the Razor template engine, they way over-complicated the shit out of the versions after 1.0, I still want to get MVC 1.0 to work with the Razor engine, I'm sure they've probably made dependencies on something that will conflict with MVC 1.0 ...]
This morning I tried out CodeIgniter. I like it. It's a little verbose, but not too bad. Documentation is decent, although I hate the navigation between topics, but that's not a fault of the documentation. Out of the box, there didn't appear to be any support for layouts, but a quick google search to stackoverflow post revealed some simple solutions for this lacking feature, and in a few minutes I had layouts.
I really wish that sql server had a mechanism for versioning everything inside of itself. Every schema change, no external tools needed. Nothing complicated. You would be able to turn off the tracking at the user level, at the object level, anywhere really. You could easily report the changes, just the schema changes, not necessarily the data changes. I like how google docs keeps track of everything, easily viewable.
OH here's another one. Auto saving your scripts to the database. If I'm stuck working on a problem in the database, I usually open a new query window and then proceed to knock out lot's of unrelated sql used for investigation of whatever I'm doing. Then hopefully I save that to the filesystem, and even more hopefully hope I can find that file again. What sucks is sometimes(most of the time) i don't give easily discoverable filenames to my sql scripts, so finding stuff I did is a huge pain. What if everything you typed into the query window was saved to your database and made searchable??
Everytime the text in the editor changes and there is a slight pause in typing, save it off, and give it a version number, now no files. Better yet, what if that code was made available to others who have access to the database, you know what I mean? Like right now I can scan through and look for any column in the database that contains the word user. I could do it like so:
select distinct table_name from information_schema.columns where column_name like '%user%'
what if you could do the same, but against any queries that anyone else has ever written against the database? then you could find that one winning query instead of reinventing wheels.
Well my blog post a day for the month of May already failed. Wasn't able to write yesterday. I saw my first Broadway play ever though, Wicked. LOVED IT. I had my reservations about whether I'd like a musical or not, but it was totally worth it. We got extremely close seats too, I'm hoping I didn't set the bar too high for the next play I see.
In an unrelated code change(aren't they all), I ran one my current projects in the VS debugger and it broke on the following chunk of code:
The dropdown list of items didn't contain the shop_id stored in session, an assumption that it might be there is made, and .Selected is attempted to be set. This of course breaks with a null ref exception.
There is a list of companies, each company has shops. The idea on the screen is that when you switch companies, the list of shops(bound to the list of companies) changes. So, since the original developer of the code is no longer around, there's no way to know why you'd ever do that, the same shop only exists in one company, so why set that(I'm sure that's one of those things, where it was chatted about late one night or over beers, and long since forgotten why that code is there...).
Anywho, rather than change any logic, I decided to lightly un-fuck, oops, i meant, refactor that code. Here's the super crazy solution I ended up with. Pretty tough huh...
The try...catch...hide exception block. The take away? don't be lazy. Only use try..catch blocks for things that might occur and are out of your hands, with a tiny dose of comments to indicate why you're doing what you're doing, and voila, you just made the software world a better place to live.
I'm building an app right now for task management. I'm using ASP.NET MVC 3, Castle ActiveRecord, and some other technologies. I used to love ActiveRecord, but for the last couple of years I've fallen out of love with the whole concept of ORM's. The learning curve is higher than I want. The benefit is less than I need. I know SQL. I just don't like writing it for those mundane tasks, like inserts, updates, deletes and queries :)
I started a project not too long ago I called EAR: Easy ActiveRecord. Totally stupid name, but I liked the flavor. The concept is simple. If you have a table named Customer and three fields, ID, FirstName, and LastName, and then a class also named Customer with three properties, ID, FirstName, and LastName; you should be able to persist instances of that class to the database backend without any configuration whatsoever. No inheriting from an abstract base class, no attributes, no Fluent mappers, just a class and a tool smart enough to map properties to columns and generate basic CRUD sql.
Blogging at night sucks. I'm gonna try it in the morning. I have a lot to blather about and I'm not feeling up to it at night.
I had a plan. That plan was to start today. Today saw that plan, and chose to disagree...
I had several goals to achieve, every day, during the month of May. Getting up early. Having breakfast made the night before. Not arguing with my loved one. Running every day. Blogging every day for the month of May.
Today. I woke up late. I did not have my breakfast made the night before and had to cook up eggs. Argued with my loved one. Didn't make time to run(note the format of that statement). So I'm doing the one thing left on the list, blogging. The goal of course is to do this every day for the month of May, and hopefully much past May.
I don't have a specific topic to blather on about, so I'll start with an update of sorts.
The image posted is OLD. The office looks nothing like that. It's painted awesome. There is a bar table(made out of whiteboard material) in one of the corners. It's frickin cool, I have great friends who are making this place look awesome.
That's how long I have to get my first post up so I can claim that I blogged every day of May 2012. I like to sit and ponder and take my time with things. I don't have time, so the following are some general things I'm looking forward to.
Jason Bock wrote about Roslyn recently. I had heard about this idea for years, but never thought I'd see actual product. This is awesome.
I love this concept. As one who generally sucks at web design, having frameworks like this, is a good thing.
OK. That's it for today. One under the belt was the only goal, and here it is.
Just started a new "Empty" ASP.NET MVC 3 project...pretty sure Microsoft and I disagree on the definition of "Empty":
I'm working on a legacy project now and the references to Session state are insane. The same references over and over. Nothing is worse. OK. Maybe some things, but seeing this type of code drives me nuts:
cmd.Parameters.Add("@UserID", SqlDbType.Int).Value = (int)Session["user_id"];
In one project, there are almost 400 references to Session. Every method that references Session binds that method to the ASP.NET runtime making it almost impossible to use or test without running it inside of a website hosting the ASP.NET runtime, which in turn means, one would have to be running a website, and navigating resources to find the one that uses the method bound to session, then muck around on a page. This removes the developer so far from the method, testing is long long long.
It's late. At some point in the projects' lifetime, someone started saving the database field UserID to a session variable named "user_id". We don't know who, we don't know why, but there are now tons of references to Session["user_id"] that holds the value of the database field UserID. SWEET, shouldn't be hard to remember, right? But it's late, you've been working in the database all day, and now you're working on the website. You start referencing Session["UserID"] and thus begins annoying debugging of Session key spellings...
Use String Constants for Session Keys
private const string SESSION_KEY_USER_ID = "USER_ID";
cmd.Parameters.Add("@UserID", SqlDbType.Int).Value = (int)Session[SESSION_KEY_USER_ID];Put Session Constants in ONE Spot
Instead of sprinkling around those constants, let's take it a step further. Let's put all session constants into a static class named, SessionKeys. Now there is exactly one spot where the session key is spelled out, and if it's spelled incorrectly, so long as there are no other keys spelled the same, it doesn't matter. That class will like this:
public static class SessionKeys {
public static const string USER_ID = "USER_ID";
}
// and this class would get used like this from anywhere in your project:
cmd.Parameters.Add("@UserID", SqlDbType.Int).Value = (int)Session[SessionKeys.USER_ID];
The assumption here is that your in an ASP.NET Web Application using lousy Web Forms. Let's hope you have a base page that all or most of the pages in your app inherit from. This is where we want to stick some properties accessible from any derived pages. The first property we'll stick on that base page is, not surprisingly, UserID.
protected int UserID{
get{
if (Session[SessionKeys.UserID] != null){
return Convert.ToInt32(Session[SessionKeys.UserID]);
}else{
return 0;
}
}
set{
Session[SessionKeys.UserID] = value;
}
}
// now your could using this would look like the following:
cmd.Parameters.Add("@UserID", SqlDbType.Int).Value = UserID;
This is actually dangerous:
return Convert.ToInt32(Session[SessionKeys.UserID]);
Why? Well what if the session key is missing?(e.g. the user's session timed out). This code throws an exception. One of my next posts will cover that topic and throwing exceptions as well.
I repaved my machine this past weekend so I've been going through a flurry of Windows updates, I'm waiting on the latest updates to install right now. I'm also working on a legacy app, the code is an ASP.NET web app, the page I'm working with is using the Web Forms page model, the app uses the out of the box membership provider stuff that comes with ASP.NET.
Waiting for the Windows update to install, I figured I would get some work done. So I open the Visual Studio project, and wait for a few seconds, because it's early and Visual Studio is still waking up. Then I open the file I need to edit. I edit the file, just added some html. Now to view that change, I have to hit F5(I use the Visual Studio webserver to debug). After a few seconds, I am presented with a login screen...
All I want to do is make a change to some code. I enter my credentials, and an extraordinary amount of time elapses before I am not presented with a YSOD, indicating that I can't connect to the database. Oh ya, I forgot to fire up the VPN, because our test database is on the vpn, and because I'm now [unnecessarily] logging in so I can test some local code, I have to be on the VPN. So I start the VPN software. Hit F5 on the web page, and voila, I'm now presented with the start screen which 1) took forever to load because it's got some dashboard thing that depends on some slow sql, and 2) is NOT the page I'm editing, I still have now navigate to that page.....
This.
Sucks.
I am a backer of Light Table. I LOVE the concept they are promoting. I also enjoyed the Bret Victor video[Inventing on Principle] demonstrating real time coding, the effects of the code changes you make are instantly viewable, real time feedback.
This type of coding is an awesome concept, I've thought about this for years, check out my live coding demo demonstrating my fluent HtmlBuilder library.
I should be able to make code changes without being connected to the internet. This isn't a luxury, this is a bare minimum necessity. I don't doubt that at some point in the future, connectivity to the internet will be at 100%, that no matter what, you can ALWAYS connect to the internet. That isn't the case today, so today, we HAVE to be able to edit code offline.
I'm the developer. Fuck the login screen. If I'm developing code, then at a bare minimum again, I should never have to login to the site to make code changes. Never never never. This takes a little bit of effort but it's totally worth it(and required if you're not connected to the internet).
On a past WPF project, we had security built in from the beginning, as well as a way to circumvent(while developing) that same security system.
On an ASP.NET MVC project, same thing, security was built in from the beginning, and circumvented, also from the beginning, strictly for developing purposes.
I'm stuck with the ASP.NET Membership provider that ships with the product. I don't know much about it(and that's a conscious decision) so I'm not sure what all is involved. I do know that it hits the database every frickin time a page is navigated, so I'm not sure if there's a way to circumvent the built in provider behavior(I'm guessing providing my own provider would be the first step).
Death Ray Vision did it. And now Louis CK did it, and the material is awesome.
I just bought this album yesterday. 5 bucks. They play most of the songs right there on the page. If you like that genre of music, you'll love this album. It's very well done, it just feels good, which sounds weird. But I had no problem forking over 5 bucks after hearing the tunes. It's blatant and obvious that the music was created out of passion and the desire to make something great.
The new Five Finger Death Punch album sucks. Period. There's a track on there called Remember Everything. Had I not known I was listening to FFDP, I would have sworn that Nickelback were the one's sniveling out the stupid lyrics and not a heavy metal band. This song is the opposite of what FFDP would normally produce(or at least I'm hoping so).
I could be entirely wrong, but on the one hand, FFDP produced a whole album. They probably only had a few songs they would have put on the album themselves, if they were the only ones picking, or maybe they had a ton of great tunes and couldn't fit them all on there. You see, the record label is probably thinking, hey, how can we make more money? I know, let's put on a song that sounds completely ridiculous, even like that shitty band Nickelback. Then, we can get radio time so FFDP can attain more fansconsumers, and we can sell more shit.
Unfortunately, Death Ray Vision is probably not going to be played on the local radio stations anytime soon, much less while the sun is up. So. They enter the studio, knowing full well, the shit they are going to produce, is for people who want good music of that genre. They proceed to create awesome, and succeed.
In some circumstances, I just want to execute some sql and get back a strongly typed result. The problem I have is that I hate having to create an intermediate class to hold the results. So I added a little bit of code to SqlTools and viola, no more intermediate classes.
So check it out. Assuming you have an instance of SqlDbHelper declared like so:
var helper = new SqlDbHelper("your connection string here");
You can now run some sql and retrieve the results like so:
var sql = "select firstname, lastname from customer where id = 1";
dynamic customer = helper.ExecuteDynamic(sql);
//properties are case-INsensitive!
Assert.AreEqual("Chris", customer.fIrStNAME);
And requesting lists of things is this easy:
var sql = "select firstname, lastname from customer"; IEnumerablecustomers = helper.ExecuteDynamics(sql); foreach (dynamic customer in customers) { Console.WriteLine("{0}, {1}", customer.LastName, customer.FirstName); }
OK. Well now I know I can post, however, the editing experience is HORRIBLE at best. Adding mobile editing to the todo list.
Finally getting around to adding some image support to the blog editor. Here's the first database backed image:

I'm converting my posts to use PHP Markdown. One of my fail points is the code formatting. I have the stylesheet hardcoded as seen in the image. I need to store my code bits off to the database and convert them on the fly, sort of like i do on tweetsnippet.com.
This is mostly a "remember this for later" post. Sometimes, I need to cleanse source code of the .svn folders. A reg file that I scraped off of the internet some time ago from I think Jon Galloway's post, was a tool for doing just that. The file can be downloaded from here: http://www.chrisjcarter.com/downloads/delete-svn-folders.zip. Essentially it gives you a context menu option in windows explorer to be able to right click on a folder and select Delete SVN Folders; it proceeds to recursively remove all svn garbage in all subdirectories.
Now I've got a separate class representing the stored proc. The first(and probably last) cut of one class per proc has more code in it than I want. Creating an instance of a class just to execute a stored proc seems long winded. Although one of the bennies of doing it this way is that I can leave some arguments off of the constructor, which might result in slighly less code, but not enough less that I want to use it.
Stored procs have their place. Unfortunately, that place is directly in front of my development efforts and they are driving me nuts. It's less about the stored proc as it is a bout the code calling the stored proc. I am running into a lot of code that looks like this:

That fourth to last line reference to SqlHelper is OLD old old. Left over from the early days of working with ADO.NET.
All of that code is used to call a stored proc defined like this:

OK, here's one way we could do this different, not sure it's better, but it's less code. I have one static class that represents a database(sort of), it's mostly just for hanging static methods(each representing a stored proc in the associated database), and centralizing the connection string for that database.

So Rippy is a static class defined like so:

And that pretty much is that, not much to it. However it's very horizontal, the method call takes a ton of args, all of which must be supplied(in the method call) even though only a couple are required. For someone(me!) who doesn't like unneccessary typing, I think I can do better.
Yes, I'm in full rant mode
I type fast. I think fast. When I'm in a caffeine induced trance of programming bliss, I want to see running code. Not in 20 seconds. RIGHT. FUCKING. NOW.
WPF and Visual Studio are not on my team when it comes to speed.
I'm trying to finish up a WPF project, we're in bug fix mode, and performance tuning mode. Unfortunately, part of the performance tuning had to be on our Visual Studio solution.
I don't want to do it. It means having to wait. And wait. And wait. This is all followed by more waiting. After around 45 seconds, if there are no build errors, maybe we get to see a screen. Change the color of text on single label? Press F5 and then? Yup, wait a good 45 seconds before you get to see that change.
In order to get WPF and Visual Studio even close to being as fast as I need for development on this project, I had to create a tool: Slimmer. It helped to have our solution partitioned in such a way that this worked.
Our solution has essentially 25 "features"(think single page apps). Everything to support a feature, has been segregated to it's own logical place in our solution and everything is named according to the feature. For example, if you have something named FeatureX, there will be a FeatureXController[1], a FeatureXService, a FeatureXRepository. And all of the views are located in a directory named Features\FeatureX\Views. So it's easy to pick out a everything that supports a single feature.
Slimmer guts everything out of our solution that is not the feature we're working on, and is not required as infrastructure and needed for the app to run. Slimmer parses the .csproj files, and removes all of the features and supporting code for those features that are not related to what we're working on. Previously I had attempted to do this through Visual Studio, just right click and exclude, right? OMG. It was taking upwards of 10 minutes to exclude, and including back in was a nightmare, it took so long. Editing the .csproj files outside of VS is way faster.
I haven't liked TFS from the beginning. It has done nothing but stand in our way and make developing slower. Want to edit that file? FUCK YOU. TFS wants to go do some thinking(maybe mulling over the fact that it's a huge piece of shit), then if you're lucky, it'll let you edit that file. However, if your VPN accidently lost it's connection, then it means that TFS will spin forever trying to make a connection to the server(remember, we just wanted to edit a file), and then finally it will barf with an exception that it can't connect to the server, to find out if you can be allowed to edit that file that's already on your machine.
Ha! I don't even know where I'm going with this, probably just crazy. Just beware, TFS + WPF + VS2010 = SLOW
[1] Our solution uses Magellan which an MVC framework for WPF, hence the term Controller.
My dad taught me a lot growning up. One of the characteristics I picked up from him, is his perfectionism. This has been both a blessing and a curse at times.
I used to throw the shot put and discus in high school and college. I was a stickler for details. If I threw far, but noticed my foot had slightly touched outside the ring and no one noticed, I would ALWAYS call myself on it; yes, I would purposely foul out and walk out the front of the ring(you have to exit the back of the ring, in control for a throw to be valid).
I was in the minority, however. There were plenty of throwers who were perfectly content with fouling, and if no one noticed, just keeping the throw. Not me, something didn't feel right about that. It didn't feel perfect.
Fast forward to present day. I set out to write a simple ORM-ish type thing. I've written them before, in one form or another, nothing extravagant. This time though, I had a nice thick glop of perfectionism helping me to get nothing done. So this morning I set out to complete my stupid foray into writing some throw away code that more closely resembles what I want out of an ORM.
The code started off as something else I was procrastinating on, it's located here https://github.com/chrcar01/EAR.
The TableOK. I used an amazingly simple table definition to play with. The primary key is an IDENTITY column named ID. Here's what it looks like in the Sql Management Studio table designer(and yes, then ame of my laptop is CLOWNKILLER).
I hesitate to say ActiveRecord, so I'm gonna stick with table wrapper class. Anywho, it's just a POCO, with simple mappings of table/columns to class/properties.(code formatting courtesy of http://csharpindepth.com/CodeFormatterTool.aspx)
<style type="text/css">
table.code, table.spec, table.results, table.compile, table.summary { margin-left: 4em; border: 1px solid #000000; padding: 4px; }
table.code { background-color: #e5e5e5; }
table.spec { background-color: #aaddff; }
table.results { background-color: #aaeeaa; }
table.compile { background-color: #ffaaaa; }
table.summary { background-color: #ffffff; }
div.code, div.output { border-right: white 2px ridge; padding-right: 10px; border-top: white 2px ridge; padding-left: 10px; font-size: 10pt; padding-bottom: 10px; margin: 10px; border-left: white 2px ridge; padding-top: 10px; border-bottom: white 2px ridge; font-family: courier new; background-color: #e5e5e5; }
/* For code snippets */
span.Keyword,span.Linq,span.ReferenceType,span.ValueType,span.Modifier,span.Statement, span.MethodParameter,span.Namespace,span.DataType,span.Function,span.Method, span.Object,span.Operator,span.Property,span.SysTable,span.SysSproc, span.GlobalVariable,span.ReservedKeyword,span.SystemFunction,span.Type, span.PreProcessorDirective, span.Element { color: #0000cc }
span.BlockComment,span.XmlComment,span.InlineComment,span.JavaDoc { color: green }
span.String { color: black }
span.Attention { font-weight: bold; color: red }
span.Entity { color: red }
Obviously, this is the happy path. This code is throw away type code(even though it's in github). It has tons of stuff that I would rather change, but I want to show it sooner than later(even though nobody will probably see this).
On the fly schema synchronization. Testing out a potentially bad idea of reading the database schema prior to generating the necessary sql. The idea being that your code will NEVER be out of sync with the database. No more generating code at compile time to make sure all field lengths are correct. Just do it when you need to execute the code.
I've never tried doing this myself. Changing the state of an instance of something, tracking those changes, then at some point undoing everything that's been done to the instance. I came up with a VERY NAIVE mechanism for doing this. The whole mechnism is based on Object.GetHashCode, which does not guarantee different values for different objects. However, in the scope of throw away code, I don't care. I've implemented IDisposable, and within that is an auto-commit mechanism. It actually works(the rolling back part).
I'm just scratching an itch. Nothing ground breaking, however, the client code is ridiculously simple. No mappings had to be declared by the developer, just a dummy class(which I'm working on removing the need for). By default, everything is in a transaction. Executing sql is even simpler, I'm working on that post right now....
I spent a little time spewing out some words that describe what I want from a "tool" that would help me be successful with a database. Here are a few of those things:
You can always insert into a table, primary key or not. Anything you can do in sql you should be able to do with the framework. The framework goals: 1) saves typing and 2) ensures that you're NOT doing something stupid(like inserting something that's 4000 characters long into a column that's 4 characters long, or inserting null into something that requires a value.). The tool/framework, is NOT smarter than the developer using it, although it might have better "memory". Value errors will always be caught prior to sending even one byte of data across the wire to the database. If your code is going to fail, it will do it sooner than later. The tool/framework will always tell you exactly why "it" failed, and if something failed in the database, it'll pass that info directly to you as an ADO.NET error. The tool/framework will always be accountable for it's actions. To eliminate any sneaky activity, all "features" are turned off by default. Validating whether you're going to insert invalid data is not a "feature", it's a requirement. It should take less than 10 minutes to figure out how to use it. The tool/framework is open sourced. The tool/framework should use the least amount of code possible to achieve it's purpose. The tool/framework should only require the least amount of code from a developer, in order to use it.
The hacker news discussion on the ORM anti-pattern blog post is great. After doing several projects using ORMS(LLBLGen, Castle ActiveRecord, Entity Framework, and Subsonic), I can safely agree with all of the points in the article about ORMs(I haven't gotten into the No-SQL stuff yet, so I can't comment on that).
<p>Except for insanely simple queries(think <b>select * from sometable</b>), <img src="content/article-images/hql.png" style="float:right;margin:15px;" />the ugliest part of ORM's are queries that involve joins or anything even moderately complicated. Recently I had come to the conclusion that I really don't mind writing sql to get stuff out of the database. The part that I hate is typing in the monkey code to create a class to hold the results, and then the code needed to map that class to the results of the query; then when the query changes, changing the mapping code...and so on. That code sucks to have to write. What's worse is the code ofr inserts, updates, and deletes; well, at least the easy ones that do all by primary key and nothing complicated. <b>Querying with HQL is stupid</b>. Just frickin write some sql and let a "tool" map up the results. Done. No learning new language.</p>
<p>Knowing your tools is a tough one too. If I'm using Castle's ActiveRecord, I know there are going to be times when I want lazy loading, eager loading, etc. I know what not to do to avoid situations where ActiveRecord will spin out of control and try and pull everything and the <img style="float:left;margin:15px;" src="content/article-images/sql-profiler.png" />kitchen sink from the database from a seemingly innocent request. However, I think I'm in the minority, because I like learning and knowing all of those things. Most of the people I've worked with who also use ORMs, don't want to learn the tool, they just want the "magic" to happen. I get that, really. That's not how I work, but I get it. On that note, I've run into many cases where devs who didn't learn the tool, write ridiculous code that has horrible consequences in the database...taking a peek at Sql Profiler while this code is executing is usually a good time, pages and pages of queries hammering the database, all from one call to a <b>FindAll</b> method.</p>
<p><b>My new approach to ORMs?</b> If we're working with relational databases, and we're doing inserts, updates, and deletes, then by all means I'm going to use an ORM of some sort to handle the task of modifying data. If it's a query beyond <b>select * from sometable</b>? Straight up sql....</p>
OK. So I found one major bummer with my current blog "engine". I can't start an entry, and not publish it before I put out any other entries. So basically, as soon as I start typing up a blog entry, I absolutely have to finish it prior to posting another entry.
Although, the more I think about it, the more it's kind of a neat little tool for keeping me on track, and consistently posting. I have to constantly keep posting, no rough drafts. This is good, I know my Wordpress blog had probably 20 unpublished posts, just because I was gold plating them.
I decided to mix things up today and start over on this site, well the blog portion anyway. I used to use Wordpress, I think I actually published maybe 5 or 6 posts in total. Every since I took down my PanteraVB.com site at the beginning of the year, I haven't been able to get back into blogging. I do not like Wordpress. I will not conform :)
<p><a href="content/article-images/notepad-plus-plus.png"><img src="content/article-images/notepad-plus-plus-small.png" style="float:right;margin:15px;" /></a>Here's the "engine". I write all of my posts in <a href="http://notepad-plus-plus.org/" target="_blank">Notepad++</a>. All of my posts go in one file, index.php. This file(and the directory it's in) are in a subversion repository. Every time I write a post(so, twice so far), I check in the changes to svn. Then, I use <a href="http://filezilla-project.org/" target="_blank">Filezilla</a> to upload anything that's changed in that directory to the directory containing chrisjcarter.com php content, and voila! My posts are published.</p>
<p>Seem like a pain? It's actually not. I'm only half joking when I put "engine" in quotes. It's such a painfully simple process, that tracks changes in subversion too, that I'm ok with doing it this way for a bit. I have other needs that are not being met with this setup, like code formatting. I like to keep my code in it's original state, and have a separate tool make it pretty, but keep the two forms separate. That'll require a little more than Notepad++ and ftp commands, but for now, good enough.</p>
The Thinkpad is my laptop of choice. I absolutely love the keyboard. I despise the little pointer device, so that's removed. I used to have a 7200 rpm disk too, then upgraded to 256 gig SSD. I'm running 64 bit Windows 7 Ultimate, 2.8 Ghz w/4 gigs ram. It boots insanely fast.
<p>I <b>love</b> my Thinkpad laptop.</p>
<p>Lenovo came out with a Thinkpad tablet. It runs Android 3.1 and has great hardware specs. There is also an optional pen and keyboard folio. The keyboard looks a lot like the Thinkpad laptop keyboard <a href="content/article-images/thinkpad.jpg" title="click to enlarge" style="text-decoration:none;border:0;"><img src="content/article-images/thinkpad-small.jpg" style="float:left;margin:15px;"/></a>that I enjoy typing on. The keyboard and pen really sold me on the tablet.</p>
<p>It was first released for purchase on August 23. On August 22, my credit card company called to let me know that there was a security breach or something, and they had to reissue my card, the new card would arrive on the 24th. Bummer, purchase of the tablet would have to wait a day, fine.</p>
<p>On the 24th I ordered the 32 gig version, the pen, and the keyboard folio. Estimated ship date? 9/12. <b>9/12 ???</b> WTF? It *just* came out, how could it take that long just to ship?</p>
<p>I'm not alone though. The forums are packed with complaints, and with customers who bailed, cancelled their order and went to online retailers, who, somehow had them in stock. I keep checking for status every day, the last status was 9/21. Actually, as of today, there is not even a status. There is no estimated ship date anymore. The message on the site indicates that there may be a problem with the order. The chat rep I communicated with, indicated that this is a good thing, that means it'll be shipping soon.</p>
<p>How can order fullfillment, from the company who makes the frickin device, be that difficult? I'm gonna hang in there though and see what comes through, no cancelling for me...yet.</p>