To the New Parents: You’ll Be Okay

In the past four days, three good friends of mine have had their first children. One from work, one from the PIT, and one who I was in a show with so long ago that she has long since made the transition from “theater friend” to “friend.”

So, to put the unsolicited advice I feel compelled as an experienced parent to give all in one place, I’m posting it here:

“Relax. You will be fine.”

Right now, you’re listening to a thousand different voices telling you exactly what you should and shouldn’t do. You’re getting glossy pamphlets from the hospital. Visits from friends. Advice from your parents and in-laws who were expertly trained on you. Books that have titles like, “What to Expect…” which could be substantively replaced by a single page reading, “The Unexpected.”

On top of that, there’s a whole cottage industry out there of parent panic. Am I feeding him right? Is she eating enough? Too much? If I have trouble breast feeding, am I failure? Should I soothe him when he cries, or let him cry it out? Am I swaddling her properly? Are her toys enriching enough? When should he start talking? Walking? If she doesn’t reach these milestones at these times, does this mean she won’t get into an Ivy League school?

“Relax. You will be fine.”

Kids are amazingly resilient. They can thrive in any environment, as long as there’s love and affection. Although none of you know each other, I know all of you and I already know that these kids have love and affection in spades. Kids need to be talked to. Kids need to be played with. Kids need to be loved. All of you guys have hearts so overflowing with love that the very idea of you not meeting these most important needs is ludicrous.

While everyone wants to tell you that everything is dangerous, kids today are incredibly safe. Statistically, they’re safer now than they have ever been. Just the same, they will bump their heads on coffee tables. They will fall down and scrape their knees. There will be boo-boos and Band-Aids. (Pro tip: The ones with Dora on them have greater healing powers.) There will be coughs, sniffles (dear GOD so many coughs and sniffles) and the occasional fever. But, in the end, they will be fine.

So the next time you’re crying over which model of stroller to get (trust me, you will), or panicking about the precise moment to introduce solid food, or waking up in the middle of the night just to make sure your baby is still breathing (no really, you will totally do this), please remember:

“Relax. You will be fine.”

I can’t speak to the parenting experience beyond the age of 5. I can, however, tell you all for certain that when you come home, and your kid jumps up and runs into your arms shouting, “Daddy! I’m so happy to see you!” that it’s pretty much a thousand times more amazing than any feeling you’ve yet experienced.

Good luck, try to get some sleep, and relax. I promise, you will be fine.

Now if you’ll excuse me, I have to go sit in a corner for a while and repeat to myself, “He’ll probably stop wetting the bed before he goes to college.”

2 Comments

Filed under Awesome Things my Friends are Doing, family, friends

My Upgrade Actions Can’t Have a Comment? Really, SharePoint?

So I’m doing new work on a SharePoint feature that’s already deployed, so naturally, I have to do some upgrade actions to deploy some new fields to a content type. There are a few fields to add, and since the AddContentType field doesn’t have any naming elements, I decide to throw in some comments before each entry, so I know which field is which and I make sure I haven’t forgotten any. Everything compiles fine and Update-SPSolution works fine. Then, I try to run my upgrade and I get the following error:

Really, SharePoint? You can clearly see that it’s a comment, and yet you still just barf on it rather than just ignoring it. WHY!?

1 Comment

Filed under SharePoint

Adventures in Uninformative SharePoint Messages, or The Sandbox is Too Damn Busy for Your List Receiver

Hey, non-programmer-type people who read my blog: The following is highly technical. Feel free to ignore.

Still here? Great. So, here’s the situation. Tell me if it seems crazy. There are things that, to me as a programmer, don’t seem crazy at all, while more seasoned SharePoint developers would look at what I was doing and scream, “Are you mad?” Like iterating through SPList.Items() in a foreach loop without first putting them into an SPListItemCollection, for example.

Anyway, I have the following situation: A project tracking list, which has a “Primary Technical Lead” field and a “Secondary Technical Lead” field, both of which are single User-type. I need to create a “Team Members” field, which is a multi-User type. Upon creation of that field, I need to populate it with both the value from the Primary and Secondary tech lead fields. Naturally, I chose to implement this one-time setup in the FeatureActivated event receiver.

Additionally, I want to make sure that whenever a tech lead is changed, that that change is reflected in the Team Members field. I also want to make sure that you can’t delete someone from Team Members if they’re still a tech lead. Naturally, I chose to implement this as an ItemUpdating event receiver.

Every time I tried to activate the solution, however, I always got the following error:

Unhandled exception was thrown by the sandboxed code wrapper’s Execute method in the partial trust app domain: The sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request.

<Steve Martin>Well, excuuuuuuuuse me!</Steve Martin>

Now, I wasn’t entirely un-clever about this. Of course my ItemUpdating event was firing when I was trying to populate the TeamMembers field. (Okay, I’m kind of lying. There was a lot of blank “WTF?” going on in my head before I realized that the ItemUpdating event was firing. Then I went through the feature activation in the debugger, and noticed that the exception was thrown when I called SPListItem.Update() or SPListItem.SystemUpdate(), which I tried in desperation.) But my ItemUpdating method should have just quickly exited upon not seeing the fields that it was worried about in the AfterProperties. Still, worried about my logic, I commented out my routine line by line. Until finally, my entire ItemUpdating receiver looked like:


public override void ItemUpdating(SPItemEventProperties properties) {
  // Lots of commented-out lines
  base.ItemUpdating(properties);
}

And still, Sandbox is Too Damn Busy.

Then I went to the List Receiver’s Elements.xml file, and commented out the <Receiver…><Type>ItemUpdating</Type>…</Receiver> part. And lo and behold, the Sandbox would suddenly take my calls again.

I then created the simplest test case. One list. One ItemUpdating event receiver which does nothing. One FeatureActivated event receiver that updates a list item. Activation == game over.

Now I understand why updating a ListItem that has an ItemUpdating receiver from a FeatureActivated receiver might be a problem. But, once again, SharePoint has vomited forth one of the least useful error messages possible.

2 Comments

Filed under SharePoint

Improv Promotional Sonnet IV: More Gatekeepers

This is the fourth in a series of sonnets for the purpose of promoting my improv shows at the PIT. The sonnet isn’t clear on the details (there are always some sacrifices for art) so here they are: Come see “Technicolor” every Monday at 9 PM in the PIT Underground.

At gates of Improv Heaven stood two men
Each begging entrance to its holy stage.
The first had clever quips beyond all ken
All thirst for knowledge could he quick assuage.
The second man into emotions tapped
A mirror held to nature was his goal.
He scoffed, “O, Clever gent, forever trapped!
You find the funny line, but not the soul.”
The Improv Gods, in semi-circle stood
And in group-mind they all declared as one:
“Like warp and weft in weaving, both are good
So both must enter, else may enter none.”
Which facet of our improv shall we show?
Come to the PIT at nine, so you may know.

Leave a Comment

Filed under Improv Sonnets

Steve Jobs Made Me a Better Developer

“It seems that perfection is reached not when there is nothing left to add, but when there is nothing left to take away”. — Antoine de Saint Exupéry

Steve Jobs has passed away. Everyone is talking about him in terms of what he did for the world. His contributions have long since passed “significant” and can without reservation be called legendary. But that will be talked about elsewhere, extensively, and by people far more eloquent than myself.

I’m just going to talk about what Steve Jobs did for me. His philosophy made me a better developer. His relentless pursuit of simplicity and ease of use for the end user changed the way I looked at IT.

I used to be a unix administrator. I used to revel in my knowledge of the arcane. I read the BOFH with glee. I used Linux, but I was always struggling with little things. Editing config files. Building from source. But smart people like me can figure it out, right? And for the most part, I did.

Then I got my first Mac, with OS X. It had the comforting unix command line which got me in the door, but I ended up using Terminal less and less. It just worked. I could still mess around with my computer, but now I didn’t have to deal with the mess if I didn’t want to.

Then the iPhone came. It’s hard to remember the world of cell phones before the iPhone. It seems like we’ve always lived in a world of touch screens. But before iPhone were dark days. I had a Blackberry for work, and I hated it with a burning hot hate. iPhone cut through the tyranny of the cell carriers and showed what was possible if someone, anyone, would just spend a few minutes giving a damn about their users.

Gradually, my entire perspective changed. Steve Jobs showed me that making computers work in an intuitive way is not only possible, but imperative. He showed me that programs that work in simple, expected ways can not only eliminate frustration, but can even be delightful. “User Error” isn’t dumb people. It’s software that doesn’t know how to work with people because no one gave enough of a damn to make it work the way ordinary, non-computer people do.

I work in IT, but I don’t work for IT. I work for some of the most brilliant physicians and researchers in the world. I work for an army of dedicated nurses and medical staff. These people are smart, sophisticated, and know what they’re doing. But they are not “computer people” and any system that requires them to be one in order to get it to work is a failure. There is a PEBKAC error, but the “P” in this case is the programmer.

I’ve been fighting a fight at work recently. No need for specifics, but I was given something from the higher-ups to implement. Implementing it as given would have been easy. But I knew it would be a huge and frustrating roadblock for users. It wasn’t my place but I fought for the users, and while I haven’t won a complete victory, I did get some concessions, and I got some people to really think about how what we do affects these users. It was the spirit of Steve Jobs that compelled me to make that stand.

I’m not a great programmer. I have neither the time nor the resources to dedicate to the loving craftsmanship that’s necessary to achieve perfect Jobsian simplicity. But I care. I fight. I work harder. And I do so because of Steve Jobs and his vision.

Thank you, Steve.

Leave a Comment

Filed under Programming

My Continued Employment Endangers Air Travel

Five years ago, on the day of my five-year employment anniversary luncheon, Cory Lidle fatally crashed his plane into the side of an apartment building on the Upper East Side.

Today is my ten-year luncheon. Yesterday, a helicopter crashed into the East River around 34th St.

Coincidence? Yes.

Leave a Comment

Filed under Uncategorized

Improv Promotional Sonnet III: An Strange Encounter With Del Close

This is the third in a series of sonnets for the purpose of promoting my improv shows at the PIT. In case the sonnet isn’t clear on the details, come see “Technicolor” every Monday at 9 PM in the PIT Underground.

Last night I tossed and turned in fevered dreams
In which I saw the ghost of sainted Del.
And from his gut erupted painful screams,
“What mortal dares to claim he improvs well!?”
“Tis I,” squeaked I. “And who are you?” he growled,
“To strut about, my artform to defile?”
He called his improv henchmen and he scowled,
“Another improviser for the pile.”
“Tis I!” I screamed, “And and in me is enough,
A lifetime’s slings and arrows in my soul!”
The ghost he grinned, and vanished in a puff,
And whispered thus: “You’re ready for your role.”
What other apparitions will I see?
Find out at nine, before The Faculty.

Leave a Comment

Filed under improv, Improv Sonnets

Sharepoint: Updating Workflow Task Causes NullReferenceException (a fix)

Hi there, ordinary blog readers! Unless you’re a SharePoint developer, this entry isn’t for you. I’m putting this up to save future developers the head-against-wall-banging that I encountered while trying to fix this problem.

So, I’m kind of new to SharePoint, so naturally, the first thing I should be doing is writing a crazy insane workflow, right?

I’ve got a workflow where a project manager approves a project (that’s one kind of task), or can send it out for technical review (another kind of task), or can request more information from the user (yet another task). Each of these tasks have their own Content Type, and their own custom task edit form in ASP.NET. (Because I hate InfoPath with a burning white hot hate.)

Whenever someone uses one of these custom edit forms, however, I get a NullReferenceException. The stack trace always puts it in the non-public SPListItem.PrepeareItemForUpdate method. It doesn’t matter how I change the task list item. Using SPWorkflowTask.AlterTask, or just SPContext.Current.ListItem followed by Update all threw the NullReferenceException.

To Google I go! However, most of the results said that it had to do with not having a <FieldRefs> definition in the Content Types. That wasn’t my problem, however, since not only did my Content Types have FieldRef’s, but they were very much full.

At my wits end, I broke out the .NET Reflector and decompiled the Microsoft.SharePoint assembly. Here’s what I found:

As you can see (well, kind of see… click on it to see more clearly), this would only happen in a WorkflowTask. If the list item’s “Completed” field is null, the cast to bool throws a NullReferenceException. This is probably the kind of thing that can’t happen in SharePoint Designer, but only would occur when someone is mucking about in Visual Studio.

To fix it, make sure you set the “Completed” field. I do this:


private void SetTaskStatus(string status, bool taskIsComplete) {
      SPListItem taskItem = SPContext.Current.ListItem;

      Hashtable taskData = new Hashtable();
      taskData[SPBuiltInFieldId.TaskStatus] = status;
      taskData[SPBuiltInFieldId.Completed] = taskIsComplete;
      if (taskIsComplete) {
        taskData[SPBuiltInFieldId.PercentComplete] = 1;
      }

      SPWorkflowTask.AlterTask(taskItem, taskData, true);
    }

Or, if you work for Microsoft, you could do us a favor and make sure that you null check that line and default to false. (It’s entirely possible that this has been fixed by SP1, but my production server doesn’t run that yet, so I can’t either.)

1 Comment

Filed under Programming

Benjamin Meets Alton Brown

Benjamin meets Alton Brown of FoodTV’s “Good Eats” and “Iron Chef America.”

Benjamin and Alton Brown

Leave a Comment

Filed under food

Benjamin’s Drawing of the Day: Alice in Wonderland

I scanned this drawing last week, with the intention of posting it here. At the time, Benjamin explained to me what it was, and I thought it was terribly cute. Looking at it now, I’ve forgotten what he said and can’t quite fathom why he calls it, “Alice In Wonderland.” I therefore present it without further comment:

Leave a Comment

Filed under Benjamin's Drawing of the Day