Jakew
Consulting, hacking, and motorcycles

Book Review – Beginning JavaScript and CSS Development with jQuery

Monday, 1 March 2010 08:00 by jakew

Beginning JavaScript and CSS Development with jQuery

I’m currently building some UI stuff for an application and I needed a better way to my web-pages. As usual I’m about a year behind everybody else so I’ve had the pleasant surprise of getting to know jQuery. Before I’d do all of this stuff by hand without the benefit of a library like jQuery. The really kickass part is the calendar control. jQuery’s calendar control freaking rocks.

Usually for something like this I’d just use the web, but I decided grabbing a book wouldn’t hurt and might speed things up. So I grabbed Richard York’s book and read it last week. Actually, I only read the first 9 chapters and the chapter on the DatePicker and Dialogs. I’ll go read the other chapters as I need.

The book is written well enough to be useful. However, I think it could be slimmed down. A lot. As I’m often likely to do I started to just skim and use the book as a tour guide. I looked over the samples to make sure I understood what was happening and moved on. I don’t need or want long winded explanations.

Something to note: this is not a beginning javascript book as the title might imply. He does not talk about javascript syntax. No chapter on the foreach loop. If that is what you need get a different book.

Overall I think the 3 star Amazon rating is accurate. It’s a good book and it is useful to me as a tour guide. If I had to buy it with my own money would I still have bought it? Yes. It would have taken me more than 4 days to ramp up on all the jQuery stuff the book covered if I just used Google and my project. So it is definitely worth the money.

Categories:   Tech
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

CRM Break Fix

Thursday, 28 January 2010 09:50 by jakew

Somehow one of my users managed to get a vertical tab stuck in a text field (ascii 0x0B) for a CRM Entity. How they did this is quite beyond me. The problem though is that once it made it in it basically made that entity useless. Trying to pull it up causes CRM to puke. Actually, not CRM itself, but the XmlSerializer underneath throws an exception about an invalid character in the XML document.

Tracking this down was a real PITA. Luckily I new the entity was created on a specific day so I was able to narrow things down until I knew precisely which entity had the data. Then I was able to go to the DB and look for it. Now comes the problem:

I have administrator access inside of CRM. But I’m a fairly restricted user on the DB side. If I had Admin access to the DB this wouldn’t even rate a mention. However, I’m not certain of the table name so I can’t just write the query and send it over to the SQL admin to do (He is in another state). Plus he is in an all day meeting. What to do?

The solution isn’t too bad really: write a simple console app that retrieves the entity without any of its properties. Add the property you need to fix (I copy and pasted the value from SQL and replaced the offending character with a space) and then use an UpdateRequest to finish the job.

My bigger concern going forward is how to prevent this in the first place. Do I need to write a plug-in that scans every single entity as it goes in? Or add script to every form to check fields? Either way seems like a ton of work.

Or maybe this will be a one every few months deal, in which case just a quick breakfix job might be good enough.

Categories:   Tech
Actions:   E-mail | del.icio.us | Permalink | Comments (1) | Comment RSSRSS comment feed

Prognostication for next year

Wednesday, 9 December 2009 07:05 by jakew

Seems to be time for the prognosticators to post up there stuff about next year and given my current project I’m paying a little attention.   During the startup weekend I was surprised there were not more ideas around using location aware internet connected devices with cameras to build stuff.

It seems that John Jantsch is of the same mind:  5 Trends That Will Shape Small Business in 2010.

As a consultant I spend all my time building big IT projects with big budgets.  Looking at this stuff really gets me excited and depressed.  Excited because all of these web API are being made available to do cool things and depressed that unless I go off on my own I’ll never get to touch them.

Cool thing for me is that I’ve gotten a team together to build some stuff.  We just have to decide what projects we’ll pursue. 

Categories:   Biz | Tech
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Project idea

Thursday, 3 December 2009 11:25 by jakew

After startup weekend and looking at shopsavvy, I started thinking about image recognition.  shopsavvy uses a cell phone’s camera to read barcodes.  cool.  There is a lot that could be done with that.  But how about something more useful?

I’d like to take a netbook (like the Asus EEE) and a web-cam (or maybe more than 1) and see what could be done.  For instance: put it in a car.  Have 2 cameras, one facing forward and one facing backward.  What could be done?  Can we grab license plates, recognize the numbers and then get information?  There are already products for this that the police use.  But for private citizens it might not be bad.  For instance a pull from the DMV might tell you the driver has a lot of accidents and DWIs.  Perhaps you should give them some space.

Or privacy: how many cameras are pointed at you right now?  Wear the rig with the cameras facing forward and backward.  As you walk it tells you where the cameras are.  Probably great for bank robbers.  But criminals aren’t the only people that value their privacy.

You also have the simple application of knowing who you are talking to.  If you can recognize a person’s face and know whether or not you’ve encountered this person before would be nice.  Perhaps it’s PRM instead of CRM.  But no more stammering around as you search your memory.

Right now I’m not concerned about the display device.  Just being able to have a single application be able to recognize stuff in real time should be challenging enough.  I won’t even touch on speech and sound recognition.

Categories:   Tech
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Myth – programmers dont buy xyz

Friday, 16 October 2009 17:00 by jakew

Several weeks ago I was talking with a friend who is also a developer.  I was talking about some of my various experiments with entrepreneurship and his responses were really funny.

I was talking about CodeSmith and a tool I had in mind to go along with it.  His response was that developers wouldnt buy it.  Developers do not buy that kind of stuff was his assertion.

Oh really?  CodeSmith?  ReSharper?  Code Rush? Telerik? so on and so on.  All businesses that sell add ons for VisualStudio.  All doing reasonably well from what little I can tell.  Frankly I can’t use Visual Studio without Resharper anymore.  I have so many templates and snippets setup using it that using VS in the buff is like pour salt in my eyes.

Responses like the above are part of the reason I don’t talk to developer’s too much about what I’m doing.  Actually, I’m nearing the point where I don’t bother asking for advice from anybody.  To date the amount of usable advice I have received is next to nothing.  It is really discouraging.  What you really end up getting when you talk to people is a reflection of how the world works. 

What brought this topic to mind for me is this post by Seth Godin: “The Rule of High School”.  His point is to not take things too seriously.  Stay focused on what you are doing.  You’ll hear a lot of crap from irrelevant people that think you ought to be doing things in some particular fashion.  Great: tell them to go do it that way and see how it works.

So if you can’t listen to your friends and colleagues, who do you listen to?  Basically, the market.  In my case what I’m building is going to be web focused.  So I’ll pay attention to three things: customers, traffic, and communities.

Customers come first because they’ve actually opened their wallet and handed over money.  That indicates a certain level of commitment.  Even if it is not money, just registration for example, these people deserve your attention.  Find out what they want, what their problems are and what they say they need.  Address those things.

Traffic is next.  If you do not have traffic (ahem) then you are doing something wrong.  Figure it out and fix it.  If you do have traffic but the conversion sucks you are doing something wrong.  Figure it out and fix it.  Watching traffic provides feedback about how well your marketing is working.  That deserves attention.

Communities are last.  Communities in your niche are basically your future customers.  the same questions apply to them: what do they want, what are their problems, and what do they need.  Learn to gather that information efficiently and then learn to analyze it and use the analysis to help address the other two areas.

Basically the three areas can be summaries up to paying attention to feedback from a large group of people.  Just like in high school, if you just take the feedback from bullies you’ll end up sitting in a dark corner hugging your knees rocking back and fourth hoping the bad people will just go away.  But if you take a wider sampling you’ll see a very different world.

Sure there are developers that refuse to buy anything.  Irrelevant.  There are plenty of developers that are smart enough to see the value in finding tools and utilities that will help increase their productivity.  But if you listen to the first group you’ll never venture out and find the other group.

Categories:   Biz | Tech
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Get number of months between two dates

Friday, 16 October 2009 08:00 by jakew

I need to get the number of months between two dates.  Unfortunately the timespan object does not provide that.  It is easy enough to calculate, but even better: use VB!  Add a reference to Microsoft.VisualBasic in your project and then in your code add:

DateAndTime.DateDiff(DateInterval.Month, startDate, endDate
                     ,FirstDayOfWeek.Sunday, FirstWeekOfYear.Jan1);

 

The problem you’ll run in to is the last two parameters.  In VB they are not required, but you have no way to not send them in C#.  In my case the parameters I chose will work well enough.  YMMV.

Categories:   Tech
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Beware the DynamicEntity

Thursday, 8 October 2009 08:00 by jakew

When working with the CRM service by way of the SDK be sure to mark your retrieve requests with ReturnDynamicEntities.  If you do not and your are retrieving a custom entity you’ll get an InvalidOperationException that doesnt basically says “yeah, that query you just did, it didn’t” when it should really provide something like “uh, try that again but try setting RetrunDynamicEntities to true this time.  OK?”.  It’s clear enough if you want to chase the call stack down to where XmlSerializer pukes, but my more descriptive exception would save you some time.

Anyway, hope that helps.

Categories:   Tech
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

How to get context for a SharePoint web part

Monday, 28 September 2009 08:25 by jakew

This one turned out to be really easy:

The WSS (Windows SharePoint Services) object model has a static object called SPContext that you can use to get the context that your control is working in.  For instance if you want to grab a list from the site, you would do the following:

            SPWeb thisWebSite = SPContext.Current.Web;
            SPList spContactList = thisWebSite.Lists["Contacts"];
            foreach(SPListItem contact in spConactList)
            {
                //do some work
            }

Pretty cool stuff. The more I get in to SharePoint’s API the more I’m liking it.

Categories:   Tech
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Struggles

Thursday, 10 September 2009 08:00 by jakew

I started a personal project a long time ago (early summer or so) that I had hoped to already be finished with. I initially setoff to use MOSS (Microsoft Office SharePoint Services), in particular I wanted to use Forms Server because it seemed to be a perfect fit for what I was doing.

I showed it to my partner and he seemed ok with it until I mentioned the price tag. He freaked. To a large degree I don’t blame him. Dropping $30,000 just for software is insane when you are used to using open source software and paying $9/hr for coding.

The result is that I basically stopped. Why? On one hand it meant that I had to start over from square one. On the other hand I was dealing with a fairly difficult client. Throw in family and some play time and basically the project got stuffed in the back corner.

Being a bit OCD though I couldn’t leave it alone so a few weeks ago I started again. This time I was going to just do it using straight ASP.NET and SQL Server. I did a bit of design, planned out the features and started coding. And then I really got depressed.

For the entire year I’ve been developing with CRM, SharePoint and BizTalk. Why on earth would I hand create a table to hold contacts? Never mind creating a web-page to view, edit, search, and etc. The more I tried to work on this the more I rebelled against it. This is stupid!

So over the weekend while enjoying the twisty roads of Northwest Arkansas I decided that I don’t need MOSS, WSS (Windows SharePoint Services) would do what I need. WSS is a free feature of Windows and can be hosted for only a little more than a normal ASP.NET account. I’ll still have to do some coding, but some really major pieces of functionality are provided for me right out of the box.

Being even smarter I’m also grabbing a few pieces from CodePlex that provide pieces of my application’s functionality readymade. In one case this is saving me a week worth of coding.

The point of this is that before writing a single line of code you really should look around first. For instance, by using WSS I’m getting a ‘free’ UI framework, security framework, a component management framework (you can switch WSS features on and off via the admin tool) and I’m sure a few other nice benefits. Grabbing an appropriately licensed bit of open source code also saves time, even though I have to give up some time learning the API and possibly debugging and testing their code. Thing is I’m way ahead of where I’d be otherwise.

Tonight I cleaned out the old version of my project from SharePoint and started over. In about 5 minutes I had all of the UI stuff in place (just created a site collection) which was way more than my ASP.NET project had. It took about 10 minutes to create most of the basic entities for the application using SharePoint lists. What remains is the core application which will still require some coding and an application database, but it’s a lot less than I’d have to do otherwise.

Categories:   Biz | Tech
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed

Microsoft Dynamics CRM Licensing

Friday, 28 August 2009 08:00 by jakew

Overview

Microsoft Dynamics CRM, referred to as CRM here on, is primarily licensed on a per user basis. However because of its capabilities it is very attractive to use it as a master data repository for an enterprise building a service oriented architecture. However, while the software itself makes this type of usage very compelling Microsoft’s licensing requires some consideration. Unless you plan to purchase a license for every employee in the business.

The normal deployment and licensing

CRM is usually deployed to a set of servers in the business as follows:

CRM Licensing

 

In this case you require licenses for the servers (Microsoft Windows Server, Microsoft SQL Server, and Microsoft Dynamics CRM Professional). Each user that accesses CRM will require a CAL. If external users, say customers accessing your company’s customer service web-site, are going to see and edit CRM data you will need to add an external connector license:

CRM Licensing ext

 

Integration

Now to make things more complicated. Say your organization has another software package, say a truckload management system. You need to exchange data between the two systems. Users of the TMS package will see data from CRM, things they do in TMS will update data in CRM:

CRM Licensing int

 

In this case the TMS users will not require CRM licenses. The integration system that exchanges the data between CRM and TMS will need a license, but that is all.

Don’t be sneaky

So you want avoid buying CALs for CRM so you decide to do the following:

CRM Licensing sneaky 1

Based on the research I’ve done this won’t really get you out of needing additional CALs for the users. Just providing an alternative UI and calling the CRM web-services is not enough. To avoid being in a gray area two things should be done:

1. Give the application its own database to cache data

2. Give the application its own identity in CRM and have it do all the work on behalf of the users. The users themselves do not have identities in CRM.

The application would logically look something like:

CRM Licensing sneaky

However, you might get away by just doing #2.

Caveat

I strongly believe that you should pay for what you use. However, I don’t think you should overpay either. Unfortunately Microsoft makes their licenses so freaking confusing they are impossible to read or understand. All that said; you really should talk to a Microsoft licensing specialist.

Categories:   Biz | Tech
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed