Sean Blakemore's Blog

Like trying to fit a square peg in a round hole

26. June 2014 10:26
by Sean
1 Comments

Silencing a 3D Printer - Stepper Dampers

26. June 2014 10:26 by Sean | 1 Comments

I recently built a new 3D printer, my second after the MendelMax I’ve been running for a few years now. I went with a Kossel Mini, it’s an amazing little machine and since it’s designed to print only in PLA it can sit right next to me on the desk without filling the room with nasty ABS fumes.

That’s all well and good but if you’ve ever sat next to a 3D printer you know that they can be pretty noisy. Especially one as fast as the Kossel Mini, it can be really distractingly loud. After searching around for solutions I came across some whispers of a product on a 3D printing forum about stepper dampers and just how much of an amazing difference they made. It seems there is still very little awareness of these little gems in the community but the few that have tried them are adamant that it’s the best upgrade they’ve ever done!

DSC01957

As you can see they are made from two metal elements joined by a rubber gasket between them. One side bolts to the motor and the other to your printer as normal, this leads to the motor to be fully isolated from the printer. The rubber is formulated to dampen the specific frequencies the motors produce and is very stiff, with the amount a printers belts are tightened there is no danger of problems caused by the rubber flexing and moving.

So… do they work? Well as with the few others than have tried them I can say with certainty that they are simply jaw-droppingly amazing! I can now sit right next to the printer and completely forget it is even running. Check out this video I made to show the difference.

I now couldn’t live without these!

 

As you can see the difference is around 17dB! Nothing more to be said, they really are that good!

9. May 2012 14:04
by Sean
7 Comments

What JavaScript taught me about C# – Understanding ‘Access to modified closure’

9. May 2012 14:04 by Sean | 7 Comments

Background

If you’ve spent any time writing C# using a copy of ReSharper you will have come across the phrase ‘Access to modified closure’. It’s a well known warning and there are plenty of StackOverflow questions and blog posts about it.

I’ve personally run up against this many times, and although I know what to do when it bites me, I’ve never really understood why it was happening. It just never really clicked for me.

Not until recently that is, when I decided it was time for me to become a JavaScript programmer instead of a jQuery programmer and actually learn the language properly!

The Warning

Here is some code, as simple as I could make it, that produces the warning and illustrates the behaviour:

var actions = new Action[5];

for (int i = 0; i < actions.Length; i++)
    actions[i] = () => Console.WriteLine(i);

foreach (var action in actions)
    action();

The ‘Access to modified closure’ is referring to the use of ‘i’, the loop variable, inside the lambda and being passed to ‘Console.WriteLine’. If you haven’t run into this before you’ll be surprised to find that this code will produce the following output:

5
5
5
5
5

More...

5. April 2012 16:20
by Sean
0 Comments

Doing indecent things with Mono.Cecil - An alternative to ILMerge for WPF

5. April 2012 16:20 by Sean | 0 Comments

Background

ILMerge is a great tool for merging .NET assemblies, when we want to deploy an application as a single executable file we can merge in the dependencies and we’re good to go.

Unfortunately ILMerge doesn’t work on WPF applications because according to the ILMerge page on Microsoft Research:

They contain resources with encoded assembly identities. ILMerge is unable to deserialize the resources, modify the assembly identities, and then re-serialize them.

More...

20. March 2012 11:44
by Sean
0 Comments

Multiple login pages with ASP.NET MVC

20. March 2012 11:44 by Sean | 0 Comments

I’m working on a multi-tenant web application where I need to have several different login forms for different types of users. For example for Admins, Affiliates, Customers etc.

The problem

This causes a problem because the Forms Authentication bits assume there will be a single login page for the whole application and it’s only possible to set a single loginUrl in the web.config to redirect users requesting pages which require authentication.

More...

20. February 2012 16:43
by Sean
0 Comments

DIY PCB Drill Press for $15 (sort of)

20. February 2012 16:43 by Sean | 0 Comments

I’ve recently been working on producing my own PCBs at home and ran into the problem of how to reliably and accurately drill the holes I needed.

I had a quick search to see how other people were attacking the problem and managed to find a design for a home made drill press on Instructables which was genius in it’s simplicity. Four hinges and some lengths of timber combine to make an almost perfect plunge action with great accuracy. Here is my take on the idea with photos of the mechanism and a quick video showing it in action.

More...

18. February 2012 13:23
by Sean
0 Comments

Power Management in C# – Stop the system or display from sleeping

18. February 2012 13:23 by Sean | 0 Comments

In a desktop application I’m working on there are a number of long running batch processes that can be run by the user. This caused problems when the user kicked off a batch process and then walked away from the computer, returning a few hours later to find that the system had gone to sleep and the batch had failed!

SetThreadExecutionState

A little searching led me to the unmanaged SetThreadExecutionState function which can be used to tell Windows that the calling thread is doing something important which requires the system to be awake. The function can be used in two ways, it can be called repeatedly to reset the system’s idle timer or it can be used in “continuous” mode where the system should not enter sleep mode until told otherwise. Check the MSDN link above for full details.

More...

11. July 2010 19:36
by Sean
3 Comments

Dirty Checking your Silverlight and WPF data entry forms

11. July 2010 19:36 by Sean | 3 Comments

Let’s just dive right in and have a demo to see what we’re trying to accomplish. Below is a Silverlight application with some interesting behaviour, if you start changing any data the application will notice and the save button becomes enabled, the state of the form is ‘dirty’. That isn’t very interesting on it’s own, what is interesting is that if you then put the data back to the way it was when you started, the save button becomes disabled again and the form returns to the ‘clean’ state. Here, have a play…

Get Microsoft Silverlight

More...

12. March 2010 13:18
by Sean
2 Comments

Bidirectional Integrity: IEnumerable and read only Entity properties

12. March 2010 13:18 by Sean | 2 Comments

Jimmy Bogard over at LosTechies has a great little series of posts going ahead at the moment on “strengthening your domain”. For the time constrained amongst us, I’ll quickly summarise his points so you can understand what I say here without going back to the source, however please do go ahead and check them out if your haven’t, there is some great advice there:

It’s his most recent post in the series on encapsulated collections which I’d like to talk more about.

More...

22. December 2009 22:01
by Sean
13 Comments

Silverlight 4 COM Automation – Taking photos with a DSLR using Windows Image Acquisition

22. December 2009 22:01 by Sean | 13 Comments

Note: This code was written using the PDC09 Beta and may not work without modification on future builds!

Silverlight 4 brings a lot to the table and in my opinion is the most exciting looking release so far. There is a whole slew of new possibilities which have opened up because of a number of important new features, the feature I’m going to be looking at is COM automation.

Huge amounts of functionality built into Windows and installed by third party software is now at your fingertips. So how do we get access to it?

More...