Friday, 29 June 2012

Landscape monitor to portrait without the price-tag.

Tired of that pesky landscape/horizontal view monitor, when all you want is portrait/vertical? Don't want to pay extra for an expensive monitor for the privilege? The answer is simple. Get a piece of 12mm plywood, a few self tapping screws and fix it.



Thursday, 14 June 2012

webMethods 8 notification trigger and MS sql "Output Variable"

If you try to mix old and new "Output Variable"s with webMethods 8 and TSQL, you will run into this hurdle.

Adapter Runtime (Notification): Error in Notification Callback:enableCallback notification someComponent.notifications:someJDBCNotification.

For MS SQL, the Output Value Type for all Expressions must be the same. Selecting both Old and New for the Output Value Type field in the same notification is not allowed. Select only Old or only New.  
To resolve it, firstly do you actually need the old and new values? If you're only checking for a change this is automatically done by setting Yes on "Notify On Update". If you really, really need the old value however, you will need to manually change the stored procedure.

ALTER TRIGGER WMT_someJDBCNotification_asdfa ON dbo.MyTable
for update as if update (MyTableKey)
begin
INSERT INTO dbo.WMB_someJDBCNotification_asdfa (MyTableKey, SomeValue, SomeValueOld) 
SELECT inserted.MyTableKey, inserted.SomeValue, deleted.SomeValue
FROM inserted, deleted     WHERE inserted.MyTableKey = deleted.MyTableKey  END 

Monday, 11 June 2012

Find and grep in powershell

Find and grep is easy. Powershell is slightly annoying.

#find some files by extension and grep
gci . -Recurse | where{$_.Extension -match "vb|resx|aspx"} | select-string -pattern "someTerm" -caseSensitive

#find all and grep
gci . -Recurse | select-string -pattern "someTerm" -caseSensitive

#find and grep webmethods files
gci . -Recurse | where{$_.Extension -match "xml|ndf"} | select-string -pattern "someTerm" -caseSensitive

Sunday, 10 June 2012

Fixing stuck valves

Valves can be stuck due to rust, burnt oil from overheating or being slightly bent due to incorrect timing. This trick can fix them but at risk of lower valve compression or slightly more oil getting into combustion. Useful for old bikes of which new valve guides or valves cannot be found. Valve guide reams can be used but are often expensive for one off jobs.

Use masking tape to stick the valve to the end of a power drill. Drill until loose.