Stinking Badges Source

Sunday, 28 November 2010 09:44 AM
by coose

We were getting the Christmas decorations out of storage today, and my son found this drawing from c. 1990.  It was the source drawing for my Law Hall T-Shirts.

Stinking-badges-source

Comment on this
Mike's Blog

Impossible Motions

Saturday, 15 May 2010 05:06 AM
by coose

Another great video of some impossible solids is here and worth a viewing (it’s 15 minutes long…but interesting).

Comment on this
Mike's Blog

Open mailto links with Gmail in Chrome

Saturday, 01 May 2010 03:44 AM
by Coose

Yeah…I looked for the option in Chrome for a while.  One of the things I like about Chrome is that it has so few options.  One of the things that I don’t like about Chrome is that it has so few options.  So we have to make ALL applications open mailto: links in Gmail, not just Chrome.  So we re-associate the mailto: as we would other file extensions (.txt, etc) or COM components.

So, to use Microsoft’s disclaimer:

Modifying REGISTRY settings incorrectly can cause serious problems that may prevent your computer from booting properly. Microsoft cannot guarantee that any problems resulting from the configuring of REGISTRY settings can be solved. Modifications of these settings are at your own risk.

Now that is out of the way, the key that controls what to do when executing a “mailto:” link is:

HKEY_CLASSES_ROOT\mailto\shell\open\command

The default value is the command line that is executed.  For outlook, my command line is:

"C:\PROGRA~1\MIF5BA~1\Office12\OUTLOOK.EXE" -c IPM.Note /m "%1"

Which need to be changed to the Chrome executable:

"C:\Users\[YOUR_USERNAME_HERE]\AppData\Local\Google\Chrome\Application\chrome.exe" http://mail.google.com/mail?extsrc=mailto&url=%1

Comment on this
Development

How to Resume Suspended Workflows in .NET WF 4.0

Wednesday, 28 April 2010 12:57 AM
by Coose

So we’ve been on WF 4.0 for a while now, and we have been anxiously awaiting Dublin (AppFabric).  One of the things we really wanted out of AppFabric was the ability to resume workflows that have suspended due to unhandled exceptions.

Well, I discovered that you don’t need AppFabric.  The sql instance store already gives us that functionality…there’s just no GUI for it (that I can find).

So, start by creating the databases.  The scripts are in the framework folder:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\SQL\en\SqlWorkflowInstanceStoreSchema.sql
C:\Windows\Microsoft.NET\Framework\v4.0.30319\SQL\en\SqlWorkflowInstanceStoreLogic.sql

Now, in the service behavior for the workflow xamlx, add some entries:

          <sqlWorkflowInstanceStore connectionStringName="Workflow"

                                    hostLockRenewalPeriod="00:00:05"

                                    runnableInstancesDetectionPeriod="00:00:02"

                                    instanceCompletionAction="DeleteAll"

                                    instanceLockedExceptionAction="AggressiveRetry"

                                    instanceEncodingOption="None" />

          <workflowIdle timeToPersist="00:00:02"

                        timeToUnload="00:00:05"/>

Make sure your connection string name matches your connection string to the database tables you created from the above sql scripts.

One more configuration item to add.  The workflow control endpoint needs to be added to the xamlx workflow service.

<service name="MyWorkflowService"

         behaviorConfiguration="myServiceBehavior">

  <endpoint address=""

            binding="customBinding"

            bindingConfiguration="myBindingConfiguration"

            contract="IMyContract" />

  <endpoint address="wce"

            binding="basicHttpBinding"

            kind="workflowControlEndpoint"/>

</service>

The endpoint with ‘kind=”workflowControlEndpoint”’ (new for .NET 4.0) is the key here.  That creates the workflow control endpoint on your workflow service.

Now, after I get an exception in a workflow (and on my development machine, there has been many), the InstancesTable in the instance store contains the information we need.  Running the sql:

select Id, SuspensionExceptionName, SuspensionReason, ExecutionStatus
from [System.Activities.DurableInstancing].InstancesTable
where IsSuspended = 1

I get these records:

image

So, here I can see the suspended workflows.  What I need from here is the Id.

Now, let’s call the endpoint we created above.  It’s a piece of cake:

You need a reference to System.ServiceModel.Activities v4.  On my machine it’s found at C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.ServiceModel.Activities.dll.  This assembly contains the classes WorkflowControlEndpoint and WorkflowControlClient.

Guid workflowId = SelectWorkflowIdSomehow();

 

WorkflowControlEndpoint ep = new WorkflowControlEndpoint(

    new BasicHttpBinding(),

    new EndpointAddress("http://localhost/myWorkflowService.xamlx/wce")

);

WorkflowControlClient client = new WorkflowControlClient(ep);

client.Unsuspend(workflowId);

That’s it.  The WorkflowControlEndpoint does the work, and the workflow is unsuspended and resumed from the last persisted state before the exception happened.  Essentially, everything that happened between un-persistence and the exception is gone, and the previous state is loaded.

Cool, huh?  And you don’t even need AppFabric.  AppFabric does add a nice layer of UI for persistence and tracking, so I’m still looking forward to it! :)

Enjoy.  Or don’t.  Whatever.

Comment on this
Development
|

Dude gets camcorder stolen by an octopus

Tuesday, 27 April 2010 04:57 AM
by Coose

Check out this dude get his camcorder stolen, then he chases down the octopus and gets it back!

 

Comment on this
Mike's Blog

iPad in a Blender

Tuesday, 27 April 2010 04:51 AM
by Coose

I’m not a fan of the iPad.  It’s either a very underpowered laptop, or an overpowered phone that doesn’t make phone calls.  I have an iPhone, and due to that fact, I have no interest whatsoever in an iPad.  It seems worthless to me.  The iPhone’s days are numbered, too.  It’s a frustrating piece of junk.

Anyway, there are many times when I have wanted to do this with my Apple products…all the way back to the days of my original 5GB iPod.

Comment on this
Mike's Blog

Infomercial Problems

Tuesday, 27 April 2010 04:47 AM
by Coose

 

I thought this was a funny montage of all the infomercial problems that we all face on a daily basis.  My 4 year old daughter actually said to me that we should get one of those “Topsy Turvy” tomato planters because growing our own tomatoes will hurt our backs. :)

Comment on this
Mike's Blog

Photo Mosaics

Sunday, 18 April 2010 12:54 PM
by coose

Well, I was making my wife a birthday present in 2005, and I tried making something instead of buying something.  So I created some photo-mosaics and created a shadow box.  I’m no pro when it comes to this, but here’s what I came up with.

It’s a little hard to see, but those are all little pictures from our photo album.  Click to make the image bigger and see if you can see it a little better.  As we had only been married for a couple of years, the photo album wasn’t huge yet, and there are some duplicates.

final1  mosaic1

Placed in a shadowbox with a ton of crap from Hobby Lobby, this is what resulted:

DSC06608

Comment on this
Mike's Blog
|

Smiley Patch

Sunday, 18 April 2010 12:43 PM
by coose

Using the Smiley Logo that I had previously made, I created a “stitched” version that was printed on t-shirt transfer and ironed on.  A lot faster and cheaper than actual embroidery, and looks almost as good.

Smiley Patch

Comment on this
Mike's Blog

Lightning McCorvette

Sunday, 18 April 2010 12:40 PM
by coose

I was amused by this.  I took a picture of my car in the driveway and Pixar’d it up for the kids in Photoshop.

Lightning-McCorvette

Comment on this
Mike's Blog
|