Exciting Times


I attended a local college in the fall of 1987 with the full intention of continuing on to receive a BS in Comp Sci. As luck would have it I fell in with a group of tech geeks who were doing some interesting things with PCs.  Unfortunately, I spent more time writing bleeding edge code than doing the punch card/COBOL work that the school was trying have me learn. While attending a job fair and talking shop, I received an offer with a salary that was higher than I would have made had I completed college and gone into the world of COBOL. So much to my parents’ chagrin, I promptly ran away to seek my fortune in the wilds of the upstart PC industry.

I have always been fortunate and could stay on the leading edge of technology for most of my career. I got into windows development right before it became hot. I started doing Visual Basic back when there was a VB for both Windows AND DOS. Managed to hook up with web development back when a site MIGHT have one crappy image on it and flashing text. Portal technology (Plumtree) became my next thing which morphed into collaboration and enterprise content management. I was lucky enough to work with a beta of SharePoint long before it became what it did.

Over the years of developing software, I become language and OS agnostic. I have written software in both.NET (c#) PHP and Java. I use both Windows 10 and Linux (OSX when needed for iOS) as development platforms. I am very comfortable with Windows server and can be trusted with root on Linux. I like SQL Server, MySQL, MongoDB (NoSQL) and Hadoop. I can’t say I like Oracle, but I can write some nice code in PL/SQL.

I am now, for the most part, focused on the world of .NET. But my how that has expanded. Never thought we would see Linux, Hadoop, NodeJS, Angular, Git, Android and iOS development become part of the MS world. And now Mircosoft is embracing open source !! these are very exciting times, and I am very happy to be around to experience them.

 

It’s not what you think!


Some people new to the gym don’t like that feeling when they first get to the gym and have to walk through it. It feels like all eyes are on you and judging.

I remember that feeling well a few years ago. I had been out of the gym for quite a while due to medical issues and was horribly out of shape. It was even worse for me because I knew what I was before.

But as time went on it took me longer and longer to get to the back of the gym. It starts slow.. the fist bumps from the guys you worked in with before. To over time greeting friends and seeing how people are healing from an injury they incurred.

Now as I walk through the gym, I do know that people are watching. I see the nods of approval in recognition of the changes in my body. I see the fresh faces that have started coming to the gym for the first time because they want to change their lives.

Then when I am working out, I see a new person walk into the gym. Yes, my friends and I are watching you. But we are watching you with approval because you made it here.

Welcome to the club. You got this!

Thanks to Mel Burgess for prompting me to write this with a post he made! Please feel free to share this. I want people to know that they are not alone in their struggle.

My Advocate


“It was the best of times; It was the worst of times.”
Nope, it was just the worst of times!

In the span of six months in 2010 and part of 2011, I had;
1) Brain Surgery to remove a Brain Tumor
2) A massive cranial infection requiring yet another Craniotomy
3) My skin trying to burn off of my body due to a reaction to antibiotics
4) A surgically induced debilitating stroke

Through it all though there was a beacon of hope.

Her, Teji. My wife, my protector, my advocate.

Through the semi-conscious haze of pain and pain meds, I could hear her voice. Always strong even though she could barely stand from exhaustion. She was double checking details, making sure she understood what was going on with me at all times.

When I could look around, she was there. Either Standing by my bed watching over me or dozing lightly in a chair by my bedside. Waking up at the slightest movement or noise from me.

There are no words to express the comfort this gave me. I can tell you that had I not had her there, I do not believe I would have survived to tell you this story. I was incredibly lucky to have someone with her dedication and intelligence to be by my side acting on my behalf.

Not all people are as lucky as I. As I sit here thinking of those events, I remember those who were all alone in other rooms. I try to put myself in their shoes, and my mind recoils in horror and fear. I could not imagine what it would be like to have no one there as an anchor and advocate. No that is incorrect I can imagine, I just don’t want to, the emotional abyss is just too great.

Thank you so much, honey, for being there. Great big thanks to everyone else who stands watch over their loved ones through dark times. Your actions mean more to a patient more than your can ever imagine.

Visio 2010 Database Diagram Forward Engineering


Last Wednesday at our local TRINUG meeting, I was complaining about the fact that Visio no longer could generate the SQL to create a Database from a database diagram. Sure you can reverse engineer one. But the creation of a database from a diagram has been left out since version 2003. I mean why provide the tools to diagram a database if you can’t do anything productive with it?

Well I guess I should have looked a bit harder.

There is a project on Codeplex called forward engineer. http://forwardengineer.codeplex.com/ . It will generate the SQL to create tables and databases from your Visio Diagram.

This rocks, thanks guys !

MVC4 Beta: Important Change to DisplayMode


As many of you know the beta of MVC4 came out. Of course I downloaded and installed it.

I noticed my existing code such as…

DisplayModes.Modes.Insert(0, new DefaultDisplayMode("iPhone")
{
ContextCondition = (ctx => ctx.Request.UserAgent.IndexOf(
"iPhone", StringComparison.OrdinalIgnoreCase) >= 0)
});

gave an error “DisplayModes” does not exist in the current context. Wait a sec, I updated my references and everything, what gives.

well they threw something new in there.

the correct code is now..

DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("iPhone")
{
ContextCondition = (ctx => ctx.Request.UserAgent.IndexOf(
"iPhone", StringComparison.OrdinalIgnoreCase) >= 0)
});

Notice the

 DisplayModeProvider.Instance 

it replaced the older DisplayModes.

I am sure there is more. I will post them as I find them.

MVC4 : Mobile Routing : Part 2


Updated 12 March 2012 to support the MVC4 Beta

In part one of this series I showed a brief intro into the view routing capabilities of MVC4. In this article we are going to dig a bit deeper and explore how it can be extended.

While just havingthe ability to redirect to a mobile view is neat, it would be even better to be able to add more conditions and view types than just the existing mobile one.

Fortunately the framework does have this ability.

To create new view versions (DefaultDisplayModes), you add each DefaultDisplayMode in the Application_Start event of the global.asax.cs.  The running application will the select which view to use based on declared conditions being met.

Here is an example of an a DefaultDisplayMode being added to the DisplayModes list

DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("iPhone")
{
ContextCondition = (ctx => ctx.Request.UserAgent.IndexOf(
"iPhone", StringComparison.OrdinalIgnoreCase) >= 0)
});

DisplayModeProvider.Instance is an IList and Modes.Insert is a standard insert with an index and item to be inserted.

The concise format is;

DisplayModeProvider.Instance.Modes.Insert({index}, new DefaultDisplayMode("{DisplayModeName}") {Context})

{Context} is evaluated at runtime and must return a Boolean, If a true is returned then the View Engine attempts to load a view with that Display mode name.

{ActionName}.{DisplayModeName}.{fileType}

The viewengine starts with the very first displaymode in the Displaymodes<IList>  which is at index 0 and iterates through the  Displaymodes<IList>  until a matching view is found.

So given these inserts in this order in code (no context to keep it simple)

DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("Mobile")
DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("Tablet")
DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("AndroidTablet")

The veiwengine would evaluate for AndroidTablet if that fails go to Tablet, then evaluate for mobile.

There already is a default DefaultDisplayMode(“Mobile”) already baked into the framework. Adding another DefaultDiplayMode named mobile does not erase that display mode it just adds another conditional to direct the view engine to use

{Viewname}.mobile.{fileType}

Complex Conditionals

Remember that the evaluation must return a Boolean ? Well that lets you create fairly complex conditions such as this one below.

<p>DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("Mobile")
{
ContextCondition = (ctx =>
ctx.Request.UserAgent.IndexOf("iPad", StringComparison.OrdinalIgnoreCase) >= 0 ||
ctx.Request.UserAgent.IndexOf("android", StringComparison.OrdinalIgnoreCase) >= 0 ||
ctx.Request.UserAgent.IndexOf("iPhone", StringComparison.OrdinalIgnoreCase) >= 0 ||
ctx.Request.UserAgent.IndexOf("Windows Phone OS",StringComparison.OrdinalIgnoreCase)>= 0
)
});

Here the condition is checking for a variety of user agent strings using the OR (||) operator.

To see how far some have taken this, I highly recomend reading Eric Sowell’s blog at www.thecodinghumanist.com

Conclusion 

We really cant wait till this becomes RTM. No really we can’t, we are running  Mobivant.com on the developer’s preview of MVC 4.

I do hope this has helped some of you out there. I promise I will add more as I get time. Wish me luck.

RDU Code Camp 2011


I will be presenting at this years Code Camp in Raleigh-Durham NC.  I will be showing off the Microsoft MVC 4 Developers Preview. Showing off the new conditional routing features of the framework (Mobile, baby), and a little bit of JQuery mobile just for fun.

So Can you guess what this is ?

DisplayModes.Modes.Insert({index}, new DefaultDisplayMode("{DisplayModeName}")  { {Context}  }

Check out http://www.codecamp.org/ See you there

MVC 4 :Mobile Routing: Part One


If you have not read Scott Hanselman’s Blog Post  on the developers preview of Visual Studio 2011, Asp.Net and MVC 4. GO READ IT !!

What caught my eye about MVC 4 was its new mobile support.   As mentioned in Scott’s Blog;

ASP.NET MVC 4 Developer Preview is the latest release of our MVC framework. This release includes built-in support for mobile sites, new, fresh HTML5 project templates as well as jQuery Mobile. It has enhanced support for asynchronous methods, and custom code generation.

You can download the bits from here http://www.asp.net/mvc/mvc4

So one of the new is mobile device detection and routing.  In normal MVC you have a controller action that has an associated SINGLE view. The view then has the same filename as the action method. MVC 4 has a feature that allows routing from a  {controller}/{action} to one of several views depending on whether or not the browsing device is mobile.

The MVC 4 Functionality simply adds the identifier mobile between the two names {ActionName}.mobile.{fileType} example “Index.mobile.cshtml” This can be used in the case of _layout pages as well. If a mobile device browses to the site then a view with the .mobile middle name will be returned if it it exists. If not then the desktop view will be returned.

Is the Customer REALLY always right ?


I once worked with a consulting firm whose client had selected us to do a portal migration project. They informed us that they had a very detailed project plan already completed and had been signed off on by a extraordinary number of managers. Hey that’s great, we normally never get a client that is on the ball.

As my associates and I reviewed the project plan, we soon realized to our growing dread that the client had absolutely no clue as to what the project entailed. Most of the tasks were completely off base. There was no possible way to do the project based on what was projected.

NICE !!!

When we held a conference with the client they admitted they had no knowledge about the product they were migrating to nor any idea of how to implement the migration at all. They had made up the tasks and milestones based on guesswork.

Ok so this should be salvageable right ?

WRONG !

To do a new project plan they would have to get all the managers approvals again, which would take months. The other issue is there was no budget to do a new project plan.

Of course we could have faked it and just ignored the plan, created a new one and implement a working solution. A director piped in and said that was fine, but we would still have to do the tasks on the project plan (impossible) to meet the milestones to be able to bill.

This happens more often than you would think. It can be even worse when the client has engaged one of the larger consulting firms to come in and draft a project plan. Many time the over sized consulting firm has no domain knowledge either but can fake it well.

So clients, please be careful. Talk to other customers who have implemented the same software stack. Read forums, see who publishes and answers questions, and most of all read up a bit on the capabilities of a given solution.

Consultants remember. If the client really knew what they were doing they would not need you.