Posts

Showing posts from 2009

robust email address validation through regex and javascript

Regular expressions are a representation of a grammar that helps computers and programs interpret and validate human input.  Unfortunately they are a huge time-suck and are a form of mental masturbation.  But one person's poison is another's Picasso; some regular expressions are like poetry to the mathmatically-bent computer scientists, and great debate has ensued over the best interpretation of RFC822 , the internet's email address specification.  Also, with the 16-Nov-2009 Internet Corporation for Assigned Names and Numbers (ICANN's) move to accept multi-byte, internationalized top-level domain names (IDN/TLD), I wonder how many hosts will need to update their assumptions in their regex.  Also I wonder what google mail, yahoo, amazon, ebay, facebook, or twitter might consider for their own RFC822 validation routines going forward. Since there seems to be as many regular expressions developed and published as there are email addresses, I'll contr...

SharePoint 2007 URL Quick List still holds up

I think its funny/slightly sad that very little about this list of URLs have changed since Heather Solomon wrote this information up  in July 2005 - 4.5 years later; this is a relevant and useful administrative list of URLs that are sometimes hidden depending on a few factors in your deployment: Portal and WSS Function Add to the URL Notes Manage List Template Gallery /_catalogs/lt/Forms/AllItems.aspx Manage Site Collection Users /_layouts/1033/siteusrs.aspx To access you must be an admin on the server or a site collection admin for the site. Manage Site Groups /_layouts/1033/role.aspx Manage Users /_layouts/1033/user.aspx Manage Web Part Gallery /_catalogs/wp/Forms/AllItems.aspx Site Usage Report /_layouts/1033/UsageDetails.aspx Site Usage Summary /_layouts/1033/Usage.aspx User Information /_layouts/1033/userinfo.aspx Web Parts Maintenance Page ?contents=1 Add to the end of the page URL Portal Only Function Add to the URL Notes ...

SharePoint Jokes

What do you call a smiling, SOBER courteous person at a SharePoint conference? A: The caterer. Light travels faster than sound. This is why some SharePoint consultants appear bright until you hear them speak. A good SharePoint consultant is someone who can tell you to go to hell in such a way that you look forward to the trip. How many SharePoint consultants does it take to screw in a light bulb? How many can you afford? I always take SharePoint with a grain of salt, ...plus a slice of lemon, ...and a shot of tequila. Client says to SharePoint consultant - Well aren't you a waste of two billion years of evolution. SharePoint: working daily to make the human brain obsolete. I told my boss that everyone hates SharePoint. He said I was being ridiculous… everyone hasn't used it yet. SharePoint work is something you do that nobody notices until you don't do it. Top three things SharePoint Consultant won't say: You're right; we're billing way too much for...

wspbuilder error "Could not load file or assembly 'CabLib, Version=6.9.26.0, Culture=neutral, PublicKeyToken=85376ef9a48d191a' or one of its dependencies. An attempt was made to load a program with an incorrect format."

I really love when a fix is simple. Back story : in this case, I am in the midst of using a combination of wspbuilder and spsource to reverse engineer, package up and deploy a few custom content types. wspbuilder is a codeplex Visual Studio extension that helps package up SharePoint code into a Solution file (WSP) for deployment. spsource is another tool that tries to analyse a SharePoint site and tease out a schema.xml for a list, and column & field information for a content type.  I use the term 'tries' because depending on how clean your dev environment is, your mileage may vary.  Problem description : when running WSPBuilder -> Build WSP, the output window in Visual Studio says Could not load file or assembly 'CabLib, Version=6.9.26.0, Culture=neutral, PublicKeyToken=85376ef9a48d191a' or one of its dependencies. An attempt was made to load a program with an incorrect format. It is my belief this problem is related to the installer not detecting/s...

dinner party download: ice breakers 17 - 18

Image
A man and a woman are playing golf.  They are playing on this old, rustic course and they come to this old barn on the side of this course. The guy hits the ball over there, and he goes over: Guy: You know,  I'm going to take a drop and just forget about the barn, just take the stroke penalty. Wife: Wait a minute, honey. What if you just open up the doors and hit right through?  You don't have to take the penalty.  So he hits the ball, and it ricochets off something and ricochets off something else, hits his wife in the head, kills her dead . One year later, the guy is playing the same course.  Comes to the same hole.  He is playing with a buddy of his.  He pushes the ball into almost the same place.  And he tells his buddy Guy: Hey man, I'm just going to pick it up and take the stroke penalty.   Buddy: Hey man, no, you know what you should do?  Open up the doors and hit it right through - then you won't have to take th...

Default Document Content Type always loading as Document

Image
The problem statement is in MOSS 2007, when the user adds custom content types to an existing document library and then set them up to appear in the new document dropdown, MOSS still uses the default Document content type (though after saving, you can edit properties to set the correct content type - how undesirable!). Stephen Muller pointed me in the right direction for a fix, but mine differs slightly from his. Solution: Create a document library and set the default Document Template to None . i.e. do not select Microsoft Word, Microsoft Office Word 97-2003 template, etc. After the document library is created, do this within the Document Library Settings: Create Column s or Add from existing site columns go Advanced Settings > Allow managment of Content Types=Yes,    then Add from existing site content types then Change new button order and default content type and set the new content type up as #1 (for example)

Displaying workflow item information from a custom ASPX task form

When building custom workflows, often we want custom Task edit screens as well.  A custom Task Content Type allows us to collect much deeper data than 'completed'.  However, since we are ditching the default Task edit pages, we lose a couple of useful features; a link to the underlying Workflow item as well as the implied context of the Task. Given the need to provide context to the user when overrriding the default task form, you may come across the desire to display some file information, custom columns/properties, links, etc on the task edit page.   To accomplish this, we need to gain two pieces of understanding: How and when to modify ASPX page elements from the code-behind c# class How to extract the underlying information from the Workflow's original item When: during the page_load() of inherited class; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ...

Security and Audit Trail of Workflow Tasks in SharePoint 2007 & Visual Studio 2008

Image
Two requests that are probably part of every SharePoint workflow design: Permit only the users who are assigned a WF tasks to edit (i.e. complete) them Record the user name of the person who completes a task (instead of the System Account) Not suprisingly, neither of these pretty simple, seemingly obvious design concepts can be done out of the box / without some customization.  Also, certain configuration screens might trick you into thinking you can do this directly within the SharePoint UI (you can't; more on this in the deeper blog posts). Part 1: Security of Workflow Tasks in SharePoint 2007 and Visual Studio 2008 Part 2: Audit Trail of Workflow Tasks in SharePoint 2007 and Visual Studio 2008   There are a couple of good blog sources for each of these customizations, but I didn't find any of them to be thoroughly detailed with screenshots, pitfalls, etc.  So what I hope to do in this two part blog post is cover some portions I think those...

HOWTO beautify code syntax with automatic formatting within blogger

Image
Admittedly, I've been lazy about just dropping code into blogger (unformatted), but now I'm glad to say that I've finally gotten around to adding a bit of css and javascript magic into the blogger template. The syntax highlighter code is created and maintained by Alex Gorbatchev  and to get it up and running quickly, I more or less used Carter Cole 's instructional write up.  After modifying the theme choice and putting the css and js on a host, we are cooking with a Foreman!  Note, I'm using the standard distribution which includes a smaller set of brushes , whereas there are many more out there , and others in development. So here is exactly what I did: Download the current distribution of the sytnax highlighter above, or decide if you are okay with letting someone else host that css & javascript for you if chose to downloaded it, upload/ftp/host it at your own provider (e.g. I use 01solutions.com ) Log in to your blogger account ...

Workflow LogToHistoryList UserID and Task Activity Executor in SharePoint

Image
This topic is within a SharePoint 2007 workflow, how do we get the Workflow History to reflect the user who modified a task, rather than the "System Account".  I've successfully implemented the solution suggested by Julie Kramer , from the office dev blog.  Here we go: snippet of a workflow design in VS2008 - focus on the two red activities Assign a new field to the Executor property of the OnTaskChanged activity in question (you'll see this property in the property window on the activity). Note we use this new field in a later LogToHistoryListActivity's Method_Invoking() by assigning the UserID property of the LogToHistoryListActivity's object Add a userid lookup/helper function to guarantee a valid SharePoint user id is in place private SPUser GetUserObject(string accountID) { try { if (accountID.IndexOf(@"\") > 0) { SPUser use...

dosa recipe

Ingredients  1 cup urad dhal  2 cups rice flour Method Soak dhal overnight & grind the next day with rice flour.  Let it ferment in a warm place.  After it ferments, add salt & 1/8 teaspoon methi powder. Make dosas in a flat skillet  by using the onion to oil the skillet -- add ghee to crisp if needed

indian food camping recipes; upmav and egg masala

Upmav Ingredients 2 cups Rava(semolina) -- roasted without oil Oil for cooking Mustard seeds-- 2 tspn Onions-- 2 large chopped fine 1" piece ginger 5 green chillies-- cut up 3 sprigs curry leaves 1/2 bunch coriander leaves Salt & lemon juice-- for later Method 1. Roast rava in a pan till you get the aroma from it & slightly changes color-- set aside. 2. Heat 1/4 cup oil in a pan. 3. When hot -- add mustard seeds. 4. You'll hear the crackle-- & cover it as it'll splutter. 5. Add chopped onions & curry leaves. Fry onions to a deep golden brown. 6. Add ginger, chillies & coriander leaves & fry a bit. 7. Add roasted rava & continue for a bit more. 8. Turn off heat-- cool it completly before packing it for the trip. AT THE CAMP Boil 2 cups water. Add salt to taste & then add in the upmav mixture & simmer for a couple of minutes. Add lemon juice for flavor. Egg Masala  Do ahead 1 dozen eggs hard boiled wi...

SharePoint vs. File Servers

Whenever you talk to someone about the document management features of SharePoint, the question comes up; how does one differentiate and create guidance around when to use a file share versus when to use a SharePoint Document Library.  There are many levels of appreciation of SharePoint's feature set - and kind of like an onion, there are many things that are underneath the surface.  Here are some examples of features that are difficult to implement on a file share: commented version history file metadata / content classification audit tracking data retention policy implementation / enforcement self-service recoverability business processes / workflow Moreover, below are some examples of when to use a file share over SharePoint: audio streaming or video streaming product distribution server & desktop backups Access database storage custom tools distribution, utility executable distribution, script distribution archive file storage Table: Simplified Comp...

Searching your SharePoint sites with Internet Explorer 8

IE8 follows the FF path and has a customizable Search Toolbar that can be plugged into a SharePoint instance. Start by clicking on the “Find More Providers” menu item on the drop down in the IE8 search toolbar area. On the bottom of the Providers screen you can find a link: “ Create your own Search Provider ”. So if you want to add your SharePoint search page to the IE toolbar, follow the on-screen directions; enter SharePoint search result URL after typing TEST - e.g. http://intranet/search/Pages/results.aspx?k=TEST . Now you’re able to use your SharePoint search site directly from your browser credits: this post is nearly verbatim from this blog

sometimes it takes a tough man to make a tender chicken

how darwinism reflects on programming, and the concept of thriving / surviving. Darwin finds that it is not the strongest, nor the brightest, nor the prettiest of the species survives, but the ones that are most apt to adapt (change-ready). Serendipitiously, I came across 'a 50%-good solution that people actually have solves more problems and survives longer than a 99% solution that nobody has because it’s in your lab where you’re endlessly polishing the damn thing. Shipping is a feature. A really important feature. Your product must have it.'

"Failed on Start (retrying)," said the workflow

Image
Seemingly inexplicably, SharePoint will less than always cooperate. In this case, it happened after a major round of refactoring custom workflow solutions, but ULS logs and other debugging techniques were proving fruitless. After going through the various debugging tips posted on various blogs such as: http://blogs.msdn.com/wael/archive/2008/01/11/workflow-failed-on-start-retrying.aspx I found the solution was don't refactor so deeply, or really know when an XML attribute is referring to a library.classname or namespace.classname (OUCH, the subtlety). e.g. in my case, workflow.xml's attribute for CodeBesideClass = "unbudgetedBI_InitialApprovalWF.Workflow1" then the workflow project (called "unbudgetedBI_InitialApprovalWF") has a workflow file called "initialapproval.cs" (with corresponding .rules and .desiginer.cs). Within this c# file is the namespace "unbudgetedBI_InitialApprovalWF" and a public class "Workflow1". When trying ...

yet another online profile

To help out google search's results / where is pritish / ego surfing, I've added a google profile (seems like a GOOG toe in the water of social networking, but it isn't orkut) Now if you type 'pritish' or 'pritish jacob' in the search box for google, you might stumble upon this http://www.google.com/profiles/118099086105421407263

the at&t hidden interface for call forwarding

Immediate Call Forwarding: Dial *21* plus the 10-digit number to which your calls should be forwarded and #. Press Send. Busy Call Forwarding: Dial *67* plus the 10-digit number to which your calls should be forwarded and #. Press Send. Call Forwarding No Reply : Dial *61* plus the 10-digit number to which your calls should be forwarded and #. Press Send. Call Forwarding Not Reachable : Dial *62* plus the 10-digit number to which your calls should be forwarded and #. Press Send. unlike this http://www.wireless.att.com/learn/basics/choosing-features-services/call-forwarding.jsp reference sheet, the above are direct ways of manipulating the call forwarding features that many of us enjoy (without knowing).

dirtybird's bbq in golden gate park san francisco

the PeopleEditor and how Validation sucks in SharePoint

Just over another hurdle in the SharePoint steeplechase. This one involves the glorious PeopleEditor control and how to make sure the user has some client-side feedback before they post their selection. Through the nest of blogs and comments about the general ASP.NET versus the universe of SharePoint problem, the best solution seems to revolve around hacking the client side javascript and doing the most manual processes imaginable to get consistent validation. Precisely, I mean that within the PeopleEditor should support simple validation out of the gate, but the AllowEmpty property doesn't work (see Karine Bosch’s comments from this blog link ). Then you end up going through the following failure steps before the aforementioned hack emerges as the winner: AllowEmpty property of PeopleEditor (Karine Bosch’s link ) #FAIL ValidatorEnabled property of PeopleEditor (Karine Bosch’s link ) #FAIL Adding the ASP.NET RequiredFieldValidator element within the ASP form (shereen's bl...