Wednesday, January 27, 2010

Visual Beta2 Startup Error

If you get the following message when starting Visual Studio Beta2:

The application cannot start
Then run the followng command to fix it:
devenv /resetuserdata

Sunday, January 24, 2010

Beginning Robotics Programming

This my first post as I start looking into programming robotic arms.


Resources:

Monday, January 18, 2010

InfoPath 2007 and JavaScript

http://support.microsoft.com/kb/555990

Saturday, January 16, 2010

InfoPath 2010 Walkthrough - Event Registration with InfoPath 2010

Sample Administrator Deployed Solution

Agenda:
Use cases : SOW
Give a few word templates of the Word document.

Inputs:

Outputs:

The following walk-through will show you how to create and deploy an InfoPath form using managed code.
Prerequisites

This example involves programming against the Microsoft SharePoint Foundation 2010 object model. To do that, you will need to establish a reference to the Microsoft.SharePoint.dll assembly which is installed with a licensed copy of SharePoint Server 2010. Microsoft.SharePoint.Server.dll is installed in %CommonProgramFiles%\Microsoft Shared\Web Server\Extensions\14\ISAPI by default. This DLL must be included in projects where you program against the SharePoint object model.

You will need to download the Word 2007 Content Control Toolkit.

The computer you use to develop this solution also must have Microsoft .NET Framework 3.5 or later installed.

Using SharePoint to Store InfoPath Form Data in Word Documents

InfoPath is designed to enable you to collect, validate, and parse data from multiple sources. All of that data needs to be stored somewhere, and SharePoint Server 2010 provides a great interface for organizing and surfacing data into classes that reflect your business processes.

Some business processes do not lend themselves to reviewing data in a form view. The data may require some touching-up and integration into a document layout. Also, some users want local access to their data and have Microsoft Word installed, but do not have InfoPath installed. These requirements can be met by exporting form data to a Word template. The template is formatted ahead of time in Word, and the data is imported into the template when the form is submitted.

This scenario uses a form to collect registration information for training events, which is then sent to the attendees as a formatted confirmation in a Word document.

Here is an overview of the high-level steps to create this solution

  1. Create a SharePoint list of training events and add some training events.
  2. Create a form to collect training registration information.
  3. Bind the form to your list of events.
  4. Design a Word 2010 document that mirrors the form's data.
  5. Modify the Word document's schema, and then upload it to SharePoint.
  6. Write the code to convert your form data into a format that fits your Word 2010 document's schema, and create a new instance of the data as a Word document in a document library.
  7. Administrator-deploy the template.
Step 1: Create a SharePoint list and add events to it

Create a new custom list in SharePoint with columns named Title, Date, Location, and Description, make all columns except Description required, and name the list Events.
Design the event form using InfoPath:
After you create the list, click the List tab in the SharePoint ribbon, and then click the Customize Form button.

The InfoPath Designer will start, and you can customize the form, and then add the training event details by using the list form. These details will be exported from the InfoPath form and imported to the Word document.

When you have completed the design, publish the form back to SharePoint, and then add some events to the Events list.

In the next procedure, you will design a form to collect registration information that has validation and links to an external list.

Step 2: Create a form to collect registration information

Start the InfoPath 2010 designer, and then click SharePoint Document Library in the Popular Form Templates section on the New tab.

Design the form to collect: Name, Phone, E-Mail, Event, and Special Instructions.
  • Name: a required text field. To set text boxes and drop-down lists to be required, click the control, and then check the Cannot Be Blank check box on the Properties tab.
  • Phone: a required text field with a validation rule. To validate a phone number in a text box, click the text box, and then click Manage Rules in the Rules section of the control's Properties tab to display the Rules pane. Click New, click Validation, and then set the rule to fire under the Condition where the Phone field does not match the Phone number pattern.
  • E-Mail: a required text field. To validate an e-mail address, create a validation rule that is specified by using a regular expression. Follow the same steps used to create the Phone Number rule, but instead of choosing from the Standard patterns, enter a regular expression in the Custom pattern field. This an example of a regular expression for standard e-mail address: ([\w\-\.]+)@((\[([0-9]{1,3}\.){3}[0-9]{1,3}\])(([\w\-]+\.)+)([a-zA-Z]{2,4}))
  • Event: a required Drop-Down list that will be linked to the Events SharePoint list in the next procedure.
  • Special Instructions: an optional text field.
In the next procedure, you will link the Event drop-down list to the SharePoint list of events.

Step 4: Connect the form to the SharePoint list of events

On the Data Tab, click From SharePoint List in the Get External Data section of the ribbon.

Step through the Data Connection Wizard and select the Events list you created in the first procedure. Make sure to select the Title, Date, Description, and Location fields of the events list. You can also change the value in the Sort by drop-down list to Title.
Do not select the Store a copy of the data in the form template check box, and do select the Automatically retrieve data when form is opened check box.

After clicking Finish in the Data Connection Wizard, right click the Event drop-down list on the form, and then click Drop-Down List Box Properties.
On the Data tab, select Get choices from an external data source in the List box choices section of the dialog box.
Make sure that Events is selected in the Data source drop-down list box, and then click the Select XPath button next to the Entries text box.
Expand SharePointListItem_RW under dataFields, and select the Title field, and then click OK on both dialog boxes.

On the Home tab, click Preview to preview the form and confirm that the Event drop-down list is connected to the Title column of the Events SharePoint list.

In the next procedure, you will create a Word 2010 document that uses the Plain Text Content Control to create a template that will contain the data gathered using the InfoPath form.

Step 5: Design a Word document that mirrors the form's data

Start Word 2010, click the File tab, and then click Options.

Click Customize Ribbon, select the Developer check box in the Main Tabs list on the right side of the dialog box, and then click OK. This will add the Developer tab to the ribbon.

Use the Plain Text Content Control in the Controls section of the Developer tab to create a template for your form data.

Set the Title and Tag properties of each Plain Text Content Control to make them easy to identify when you map the InfoPath form's schema to the schema of the Word document you are creating.

The Word template for this sample solution should look like the following example.

<>
In the next procedure, you will modify the Word document's schema and upload it to SharePoint. This is a key step to increasing the readability and ease of use of your code. This will create a schema in the document to represent the controls that you placed in the document by using the Word 2007 Content Control Toolkit. The Word 2007 Content Control Toolkit is pretty straightforward, but if you are interested in a tutorial, the tutorial posted on http://dbe.codeplex.com (from Andrew Coates) offers a detailed walkthrough of how to use the tool. Briefly the steps for using the Toolkit are as follows.

Start the Word 2007 Content Control Toolkit, and then click Open on the File menu.

Open the Word template that you designed.

Click the Edit View tab.

Click the Create a new Custom XML Part link at the bottom of the screen, and leave the Namespace drop-down list setting at its default.

Step 6: Modify the Word document's schema and upload it to SharePoint

Step 1

Step 2

Friday, January 15, 2010

Windows 7 God Mode

Create a folder anywhere and rename to GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}
It will change to a control panel type folder and clicking it will allow you to have a single unified view of system features.





Wednesday, January 13, 2010

How to Manage Personal Content

This post serves as a guide on how to create and manage your personal content without losing control of it.


Background
Think about the enormous amount of information a person generates in their lifetime. You could be taking pictures, creating presentations, blog posts, creditcard purchases (which come as statements), etc. In spite of all the techonological innovations available, there does not exist a single current solution to encapsulate all of that disparate information and present it in a uniform and, more importantly, secure way.

I started looking into uniform, secure storage after nearly losing some photos in a laptop in a harddisk that crashed and after some personal experiences with certain photo sharing sites that refused to release (delete) my content.

Structure
I wanted the following:
  1. My content to be located in a safe, secure location 
  2. My content to have 99.9999 % availability
  3. Flexibility to interact with the content (via custom API that conforms to standards)
  4. Being able to uniquely identify the content
Approach
  1. I started off by registering my domain name (http://www.sukul.org/)
  2.  I then signed up for a free DNS service (http://www.zoneedit.com/)
  3. I signed up for the Amazon S3 storage account (paid) (http://aws.amazon.com/s3)
  4. I created the top level "buckets" to organize my information




  5. I registered CNAME entries on my DNS to map to those buckets:


  6. Although not 100% perfect, I am the stage where I do not have to rely on third party sites to share my content like photos. The URI also makes sense when referring to a particular piece of content; for ex:
    http://pictures.sukul.org/blog/shailen/cname_alias.png. I can also stream videos and audios from my storage location on demand. Note: Amazon S3 is charged on bandwidth served, so think about your audience and charges before streaming large files
  7. I can control security from a bucket to a folder and even an item level. It gives me a great degree of control over who can access my data
  8. Futures: I intend to finish off a personal project that will allow users to subscribe and securely store their content using the store above. Extending that, I could build a CRM system for individuals to manage personal finances and have enterprise level reporting and trending of their spend. Just wish I could devote more time to this...

Tuesday, January 12, 2010

Building a Poor Man's Digital Whiteboard

What it does
Give you a low cost digital whiteboard,

Credit
Johnny Chung Lee

Materials

Pen
http://cgi.ebay.com/Infrared-IR-Pen-for-Wii-Remote-Interactive-Whiteboard_W0QQitemZ270508298957QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item3efb8d12cd

WiiMote

Software
http://johnnylee.net/projects/wii/