Monday, February 08, 2010

ADO.Net Entity Data Model – beginner mistakes

Are you getting the “Unable to update the EntitySet ‘xxxx’ because it has a DefiningQuery and no <InsertFunction>”

Check to make sure your table has a primary key – I think the reason that you get this error is that because your table does not have a primary key, EF looks at your table like a view that is not directly updatable and needs special logic (either through .Net code or a stored procedure) to update the table.

Set the primary key, delete the EF model and then re-add it (just refreshing the model didnt do it for me). And you should be back in business.

Sunday, February 07, 2010

Siri – The personal assistant for the iPhone

A very cool iPhone app that uses voice recognition to hail taxis, suggest restaurants and even tell you where to go for a haircut. Siri

I really like the intelligence built into the search: Like when I said “I need a hair cut”, it automatically figured out I wanted a hair cutting salon and when I said “Chinese take out”, it automatically looked up Yelp for Chinese restaurants that deliver!

Also available for other phones – like the Blackberry

Saturday, February 06, 2010

Bing Maps Web Service

http://msdn.microsoft.com/en-us/library/cc980922.aspx

http://www.microsoft.com/downloads/details.aspx?FamilyID=d20e16ef-5934-4ea0-bc04-ba6a0dc5f709&DisplayLang=en

The Agile Program Manager’s Cheat Sheet

From Sara Ford’s blog:

Good information on what goes into planning for an Agile iteration from someone who talks the talks and walks the walk.

How Agile Works

Release Overview Diagram

Each number represents an iteration, which is a week of work. I1, I2, and I3 are the development iterations. The majority of a Program Manager’s time is spent in the pre-I1 iterations, named –3, –2, and –1.

The Epic Story – This is what goes on a sticky note on the whiteboard. For example, “Ratings and Reviews for Project releases” is an epic story with the following stories associated with it.

  1. Rate Release
  2. Display ratings and reviews on release page
  3. Display ratings and reviews on project homepage
  4. Move release metadata to new location  // also a UX improvement Epic story
  5. Releases sorted by date with release ratings  // also a UX improvement Epic story

Pre-Iteration Planning Meeting (IPM) Planning (about 10 weeks out from deployment date)

These are the series of Program Manager tasks that need to be completed in this order:

  1. Epic + Proposed Stories are written
  2. Wireframes are designed
  3. Review wireframes with team
  4. Rewrite stories based on wireframes
  5. Prioritize what gets done first in terms of dependences
    1. Think about how non-dependencies can be done later or separately
  6. Talk to developers for high-level estimates
    1. These "stories” should be in terms of < 5 days of work
  7. Talk to test team about acceptance tests

Product Backlog

  • Story must be ready at I1 (the first iteration of development work). This must be actionable work, meaning the developer can grab the story (and wireframe if appropriate) and start coding immediately.
  • Story entered as feature in product backlog
  • Have about 9-10 weeks of work in Product Backlog at all times

Iteration Planning Meeting (IPM)

  • Program Manager –> Developer translation occurs with each story
  • Developer breaks story down into their language and into their own tasks. (again, this is where the dev is in charge of the how and the PM is in charge of the what).
  • The team as a collective aims for how much work they can do in that one week. Everything beyond that is put back into the backlog for re-priorization by the Program Manager for the next IPM

Google Voice Quick Reference Card

Useful!

http://www.coolgeex.com/google-voice-quick-reference-guide-v2-0/gv-card-v2-2/

GV-Card-v21-500x285

Boilerplate HTTPHandler

I have a couple of aspx pages (that I inherited from a project) that are never really used to render HTML content to an end user and instead are used to receive a HTTP post message and process the contents. Granted that I could use a web-service to process the messages being sent – but that would involve changing the clients that send the post messages and those are out of my control.

Today I came across the IHttpHandler and this will work perfectly for me:
1. Clients can continue sending their post messages
2. I can re-architect the pages to be HttpHandlers and save on a lot of extra handling that the normal aspx page would have to do.

IHttpHandler defines the contract that ASP.NET implements to synchronously process HTTP Web requests using custom HTTP handlers

And here is a base class HttpHandler by Phil Hack that I think will be useful for just such a project: http://haacked.com/archive/2005/03/17/AnAbstractBoilerplateHttpHandler.aspx

Phil Hacks HttpHandler base class is based on a Scott Hanselman base-class: http://www.hanselman.com/blog/PermaLink,guid,5c59d662-b250-4eb2-96e4-f274295bd52e.aspx

Wednesday, February 03, 2010

JQuery/JavaScript Demo – a Photoshoot plugin

Bet you didnt think Javascript could do this: Demo

And here is how they did it: http://tutorialzine.com/2010/02/photo-shoot-css-jquery/

Very Cool!

Visualizing patterns using GraphViz

An interesting use of GraphViz to analyze senate voting patterns: http://broadcast.oreilly.com/2009/05/us-senato-social-graph-1991—.html

Allowing a SQL Server user to execute stored procedures

There doesnt seem to be a straightforward way to do this using the GUI in SQL Server Management Studio.

I like managing users using roles and the following method is an easy way to provide a user the permission to execute all stored procedures in that database.

You create a role called db_executor and grant the role Execute priviledges. You then assign the user that needs the ability to execute stored procs to the db_executor role.

CREATE ROLE db_executor
GRANT EXECUTE TO db_executor

I am not a DBA – so I am not sure if this is not a good practice (because you end up giving execute permissions on all stored procs to all users assigned to that role). Leave a comment if you know otherwise.

Attaching a SQL Server database file (mdf) without an associated log (ldf) file

If you try and attach a mdf file that does not have an associated ldf file in SQL Server Management Studio, SSMS will throw an error. The simplest way around it is – click on the ldf file location in the dialog and click Remove. SSMS will then attach the MDF file and create the associated LDF file for you.