in

Blog By Bob

Blog by Bob

  • Syncfusion special, today only

    Well, I probably should have posted this before 7:30 at night...

    http://www.syncfusion.com/

    They are basically selling a $995 set of MVC controls for $5 *today only* in support of One Laptop per Child. I picked mine up, get one if you need it.

    Posted Aug 10 2009, 05:23 PM by Bob with no comments
    Filed under:
  • Dispose, or the lack thereof

    I have seen the oddest thing on the internet as of late (yes, this is old news and the arguments are over, but I have been busy).

    The Linq Datacontext very specifically inherits from IDisposable. Coding to an interface, if an object exposes Dispose, we call it. End of story.

    This is actually pretty easy, as all that is required is wrapping your object up in a try/catch/finally or in a using block and its all handled for us relatively painlessly.

    Then along comes MVC, for anyone not familiar with MVC, go read about it, then come back if you wish and finish this post. Or not. This Disposable pattern doesn't fit nicely into MVC... Actually, let me back up and touch on that a bit more. The Disposable pattern doesn't fit well with MVC when you are leaking the IQueryable interface into your UI.

    This sounds like a non-issue to all of us out here that have been working hard to write code correctly, get better everyday, follow patterns and practices etc, so what's the deal?

    The odd thing I mentioned earlier is that the ASP.NET MVC team, employeed at Microsoft, the people who many feel are the best minds working in the grand ole field that is the web, is telling us to blow all that good code away, it doesn't do us anything but cause us pain.

    All of the sample code and the 'recommendations' for their repositories leak IQueryable to the UI. Besides being totally anti everything we have been trying to accomplish *as an industry* for the last 5 years (get data querying code in the correct tiers), it also means that when you take advantage of this implementation leak and actually write a query in your UI (really?), if your data context has been disposed, you get an error. Let us recap that. If you do what you aren't supposed to do, you get an error.

    Sounds simple enough. The solution, don't expose implemenation specific to LINQ. No? What? The answer we are being given is to...not dispose of our datacontext. These mavericks of the web are telling us that the SQL data context doesn't manage the actual database connection and therefore doesn't manage any unmanaged resources and it doesn't matter if we don't dispose it.

    While, from an implementation standpoint, this is technically true, we are being told by the company that has had to deal more with backwards compatability, has pain more in lines of code, time and money than *anyone* else by having to support breaking changes where people coded to the implementation of their APIs instead of the interface. You would *think*, these people, of *all* people would be the *last* to recommend we do the same now. And show it in all of their sample code for MVC.

    I mean, really?

    What is even worse is you don't even need to worry about disposable, you can still dispose of your datacontext properly and leak your magical interface.

    Controller Dispose -> Repository Dispose -> DataContext Dispose

    If you have to leak your magic query interface instead of creating another method or two in your repository, at least do that...

    Posted Aug 05 2009, 06:46 PM by Bob with 2 comment(s)
    Filed under: ,
  • Smoothie for Men

    Man Smoothie 

    1 Pound Ground Beef
    1 Pound Bacon
    1/2 Pound Cheddar
    1 Egg
    1 Stick Butter
    Alcohol to Taste

     The only real challenge here is the smoothie machine is not going to handle this so well. The typical solution is to hook up the DEWALT drill to the bottom of the smoothie machine, but use as much creativity here as you would like.

  • CssSelector

    Posted Apr 10 2009, 08:26 AM by Bob with no comments
    Filed under:
  • Free Windows 2008 e-learning courses from Microsoft

    Posted Apr 04 2009, 04:40 PM by Bob with no comments
    Filed under:
  • Charter, the other white meat

    So. I had charter here in the sunny Lake Norman area and ended up cancelling since from 5pm-10pm I pretty much didnt have internet. The nodes that handled my internet traffic were so oversaturated that I was lucky to get 385kb (yes, little b) of downstream during that 4 hour period. And this wasnt now and then, this was every single day.

    So, after many service calls (this was before a certain tech told me the issue was the node congestion) they finally decided to start charging me for service calls to fix the issue, which, of course, wasn't actually getting fixed.

    I ended up cancelling my service and going with the only alternative in my area. 1.5meg DSL. So I went from fast most of the time but unusable for 5 hours in the afternoon to slow as heck all the time. I had to cancel my Netflix account because with the 1.5 meg service, I could no longer stream movied at anything higher than Commodore 64 graphics levels.

    Fast forward a year or so. Somebody tells me that from what they can tell the node congestion has gotten better (I dont know if they upgraded or if enough people cancelled it isnt as much of an issue anymore) so I decide to give it a whirl. I called Charter and ordered their 20 meg down/2 meg up service which runs $80 a month in this area. I dont really care if I get that kind of downstream or now, but I would love to have 2 meg up.

    The appointment is set up and confirmed for 9-12 or something on the only day I can be away from work. I sit here and wait. And wait. And wait. And at 2pm i call Charter. I pressed 2 to choose 'If you are calling about a scheduled appointment' and the nice lady tells me she doesn't see an appointment for me and sends me to new sales. New sales informs me there is no appointment and they won't be able to send anyone out to my house. On they day they chose. That I made sure to be available for.

    I asked them to go ahead and cancel my account. I cancelled my account before I even had my service installed. That has to be some kind of record, but from what I have seen, Charter deserves it.

    Charter, AT&T wanted me to send you a big thanks! from them. On the bright side, I hear uverse should be available here soon.

    Posted Mar 18 2009, 12:08 PM by Bob with no comments
    Filed under:
  • Peanut Butter

    Is it safe to eat Peanut Butter yet?

  • Windows 7

    If you arent using the Windows 7 beta, DO IT! I am very happy with it and running it on all of my laptop/desktop machines.

     The only down to it is Media Center seems pretty broken to me. I have 300+ DVDs ripped (yes, all legit!) to my Windows Home Server and playing them through My Movies(great plugin!) works great in Vista Media Center, but locks up 7 Media Center often. Hopefully they will get it sorted soon, as I love the rest of the OS.

    You can check out My Movies here. I need to do a post soon about my Media Center journey, as it has been a job and a half! Actually, probably needs to be a couple posts. Also, I guess I should do one on my current project, the CarPuter!

    Posted Mar 05 2009, 08:25 AM by Bob with no comments
    Filed under:
  • Falling Down

    <img src="http://blogbybob.com/images/fallingdown.jpg" alt="An ordinary man's war with everyday life" />

  • Red Heads

    There were a plethora of red heads out this weekend. Don't tell my girlfriend, but I am going to marry a red head one day.

  • Vanity Plate

    I was going to get ROADKILL on my plate on my motorcycle, but bike plates are only 7 letters. These things just never seem to work out...

    Posted Mar 04 2008, 07:53 AM by Bob with no comments
    Filed under:
  • Floss

  • HAHA

    They're coming to take me away, HA HA
    They're coming to take me away, HO HO HEE HEE HA HA
    To the funny farm
    Where life is beautiful all the time
    And I'll be happy to see
    Those nice, young men
    In their clean, white coats
    And they're coming to take me away, Ha-haaa!

  • Solo Scrum

    I do Scrum solo and pair program with myself. I even usually understand what I am writing.

    Posted Jul 19 2007, 07:05 AM by Bob with 3 comment(s)
    Filed under:
  • Sunglasses

    So, I came in at 5:30 this morning (woot! early morning releases) and accidently wore my dark riding glasses. So, of course, this was stuck in my head the whole morning.

    Posted Jun 21 2007, 04:55 AM by Bob with 1 comment(s)
    Filed under:
More Posts Next page »
Copyright © :: BlogByBob.com
Powered by Community Server (Non-Commercial Edition), by Telligent Systems