29 July 2009

secret lengths of OnBehalfReason

As I was setting up a custom SharePoint workflow to work with an external user outside of the domain, I noticed some quirky behavior and error messaging from SharePoint.

e.g. it works if its a short piece of text like the MOSS 2007 SDK:

createPartnerReviewTask_TaskProperties1.OnBehalfEmail = "null@void.com";
createPartnerReviewTask_TaskProperties1.OnBehalfReason = "This user does not have access to this Windows SharePoint Server site.";


but dies like this when its too long:
WinWF Internal Error, terminating workflow Id# 7c4d...
System.ArgumentException: Value does not fall within the expected range.
at Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties.set_OnBehalfReason(String value)

what range is specified in the reference? undocumented.

27 July 2009

the lie: Workflow Error: System.InvalidOperationException and the Correlation Token

Whenever I get an error in the pile of logs that is SharePoint Workflow, I have to wonder how this made it through QA. Case and point: a message that returned when executing a CompleteTask activity within a workflow:

System.InvalidOperationException: Correlation value specified does not match the already initialized correlation value on declaration for activity .


This should equate to - check the correlation token you set, logically. It even seems like this is a logical conclusion from the top of procedure stack;

at ..CorrelationService.ValidateCorrelation()
at ..CorrelationService.InvalidateCorrelationToken()
..


But no, what it actually means is check the Taskid properties.

Figured out with the blog entry by Andy Burns.

22 July 2009

nerd of the day

My nerd of the day vote goes to Dmitry Vostokov aka Dr. Debugalov. He is likely an inspiration to the Citrix dev team (where he works), and he seems to have the most thorough understanding of the inner bowels of Windows outside of Redmond. Also he has a really geeky sense of humor, take for example the famous quotations turned into bug-ese 'bugations' and the following poem:

The new thread started
To work through items
It got an item
Handled it to store
To run delete requests
Through Oh-Dee-Bee-See
It tried to alloc
But crashed in malloc
While browsing the heap
Exception was dispatched
And handler called at once
But couldn't find a filter
And called default one
That filter needed help
And looked for its address
But halted in suspense
While entering crit sec.

March 2009 (c) Dmitry Vostokov

Inspired by the following stack trace (remeber to read from bottom to top):

0:01> ~8kL
ChildEBP RetAddr
009ef258 7c827d0b ntdll!KiFastSystemCallRet
009ef25c 7c83d236 ntdll!NtWaitForSingleObject+0xc
009ef298 7c83d281 ntdll!RtlpWaitOnCriticalSection+0x1a3
009ef2b8 7c82dabf ntdll!RtlEnterCriticalSection+0xa8
009ef358 7c82dab1 ntdll!LdrpGetProcedureAddress+0x128
009ef374 77e764ea ntdll!LdrGetProcedureAddress+0x18
009ef5d8 7c34c456 kernel32!UnhandledExceptionFilter+0x46f
009ef5f4 7c34957c msvcr71!_XcptFilter+0x15f
009ef600 7c34246e msvcr71!_endthreadex+0xb7
009ef628 7c828752 msvcr71!_except_handler3+0x61
009ef64c 7c828723 ntdll!ExecuteHandler2+0x26
009ef6f4 7c82855e ntdll!ExecuteHandler+0x24
009ef6f4 7c82be3e ntdll!KiUserExceptionDispatcher+0xe
009efa00 7c82a319 ntdll!RtlpFindEntry+0x68
009efc2c 7c3416b3 ntdll!RtlAllocateHeap+0x606
009efc6c 7c3416db msvcr71!_heap_alloc+0xe0
009efc74 7c360947 msvcr71!_nh_malloc+0x10
009efc80 0285f893 msvcr71!operator new+0xb
009efca8 02852e38 SQLModule!ODBCDelete+0xf3
009efd54 0269acff Store!ProcessDeletes+0x3d
009eff38 0269badb Store!UpdateStore+0xe
009eff58 00323499 Common!WorkItem+0x15c
009eff84 7c349565 Common!WorkItemThread+0x339
009effb8 77e64829 msvcr71!_endthreadex+0xa0
009effec 00000000 kernel32!BaseThreadStart+0x34


So besides the awards and accolades for the nice books he has penned, the blogsphere's recognition of the free knowledge on windbg he provides, he is now officially bestowed with the auspicious prize of Pritish's nerd of the day. I hope he makes lots and lots of babies. Good genes.

pi anyone?

In celebration of pi approximation day, I'm going to host the equivalent of porn for nerds; the first 10^6 million digits of Pi. A pretty modest approximation of this wonderfully giving number. Came across some other interesting things while getting to this number including:

Other fractional approximations



  1. 22 / 7 ~= 3.142857142857

  2. 355 / 113 ~= 3.1415929203539823

  3. 312689 / 99532 ~= 3.1415926536189366233

  4. 21053343141 / 6701487259 ~= 3.1415926535897932384623817427748

Euler's beautiful equation for pi is



so with no futher adieu, the first million digits of pi

from Geoff Cornwell and exploratorium.

tandoori chicken

Ingredients

This makes it nice & spicy - reduce red chilly or green chilly if you can't take the heat

  • 1 whole chicken
  • 1.25c plain yogurt
  • 2T lemon juice
  • 1T vinegar
  • 1T vegetable/olive oil
  • 3T ginger, garlic, green chilly paste (= 1 large clove garlic, 1 green chilly, .25oz ginger ground together in pestle & mortar)
  • .75T garam masala
  • 1.5T tandoori masala
  • 2T red chilly powder
  • 1t ground coriander seeds

Cooking instructions

clean & wash & dry chicken. prick with a forkadd yogurt to the chicken and mix well. add ginger, garlic, chilly paste to the chickenadd all dry spices (coriander seeds, garam masala, red chilly pounds, tandoor masala, and salt)add lemon juice, vinegar and oil. cover chicken and marinate for 24h.

Grill chicken on a BBQ, or broil chicken for 14 minutes per side (depending on oven, you'll likely need to leave the front oven door slightly ajar and rotate the broiling rack 90 degrees every 7 minutes to get a nice even tan)

Serve with sliced red onions, fresh corriander (aka cilantro), and lemon wedges (or make a mint chutney!).

Enjoy food fans.