I started this project so that I could easily dispense a preset amount of water into my brew kettle when brewing beer.  My local brew club has a brew house and currently has hoses attached to the water filtration system.  Instead of waiting to fill up jugs of water this device will allow me to set 6.5 gallons, turn on the water and it will automatically shut off at the preset volume of water.  This lets me get started on other things while the water is dispensing and assures an accurate water level.

Parts include:

Arduino Uno $25 but will be replaced with a $3 ATMega Chip Later
YF-S201 Water Flow Meter $11
LCD Display Panel $5
ECHOTech Solenoid Valve $9

WP_20130310_001

The flow meter is hooked up to the Arduino and there is a basic program uploaded that displays the flow rate and total volume of water that has passed through the flow meter.

Below is a video of the flow meter working.  I had to tweak the program to take measurements every 1/8th of a second.

The flow meter in action.

TODO: Wait for solenoid to arrive.
TODO: Code the reset button, Volume Up and Volume Down buttons.
TODO: Hardwire circuit to breadboard for compact mounting.
TODO: Mount in project box (waterproof).

I am working on a project where I need to resize a bunch of raster images from miscellaneous sizes to fit within a certain frame.  More specifically, I need a bunch of icons for an iPhone application and I need them to fit within a 64px by 64px frame.  I found a bunch of Photo Shop scripts, some console apps, and a few spamware solutions.  I figured half an hour and I would have one that works well.  I was right.

image

So here is how the app works:

Drag and drop the graphics files you wish to resize into the application.  The files will show in the list view area.  Next, enter the Max Height and Max Width values and then click the Resize button.

The application will write the resized file next to your original with _MaxHeightxMaxWidth appended to the filename.  Original files are not modified in any way during this process. 

So if you found this blog post in hopes that you would find a quick and simple image resizer for free, here is the link to the binaries: 

A little about the application source code.  The application is a .NET 4.0 WPF application that follows the M-V-VM (MVVM) design pattern.  Since there is drag and drop support in the application there is a little code behind to support this.  The rest of the application follow the MVVM pattern.

There is a tiny image resizer class in the project that you are free to use.  This is located in the DevSQL.Imaging assembly. 

The source code can be found below.

Summary of Errors:

Exception of type ‘System.Web.HttpUnhandledException’ was thrown.

The type initializer for ” threw an exception.

The C++ module failed to load while attempting to initialize the default appdomain.

Illegal operation attempted on a registry key that has been marked for deletion.

 

The full ugly error:

System.Web.HttpUnhandledException: Exception of type ‘System.Web.HttpUnhandledException’ was thrown. —> System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: The type initializer for ” threw an exception. (Fault Detail is equal to An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is: System.TypeInitializationException: The type initializer for ” threw an exception. —-> System.TypeInitializationException: The type initializer for ” threw an exception. —-> .ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain. —-> System.Runtime.InteropServices.COMException: Illegal operation attempted on a registry key that has been marked for deletion. (Exception from HRESULT: 0x800703FA) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at .GetDefaultDomain() at .DoCallBackInDefaultDomain(IntPtr function, Void* cookie) at .LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* ) at .LanguageSupport._Initialize(LanguageSupport* ) …). — End of inner exception stack trace — at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.fieldreceiptdetail_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Solution:

This problem was related to a cross-appdomain failure.  We are using the Microsoft Dynamics AX 2009 Business Connector in this application.  The Business Connector is a C++ application that we use to talk to AX.  From what I can gather, there are two applications using the C++ DLL at the same time.  The problem is that the DLL is mixing appdomains because of our Application Pool setup in IIS 7. 

image

So to solve the problem, I created a new Application Pool for this application.  I also set the pipeline mode to Classic.  This solved the problem for me.