Well, it didn’t work :) At least I couldn’t get it to work. The issue I had was in repeatability, I’d made a little harness to move the mouse forwards and then return it to the same spot but the values I was receiving weren’t consistent making it useless as a tape measure. When mousing these slight variations wouldn’t be important but it was a deal breaker for this idea. Ah well :)
Archive for the ‘General’ Category
Arduino DRO
Tuesday, November 20th, 2007Lumberjocks
Wednesday, August 22nd, 2007So a few weeks back I stumbled upon www.lumberjocks.com which is a great site for the woodworkers amongst us to showcase their work and chat about all things woodworkery.
Here is my profile page on there along with my most recent project, good stuff and a real nice bunch of people.
Bench with some finish on it
Monday, May 14th, 2007Check out the bench with some finish on it. Starting to look pretty nice :)
Latest Project
Thursday, May 3rd, 2007So when I’m not coding I like to sneak into the workshop and make stuff. Here is my latest project
Amazon Customer Service Number
Tuesday, October 17th, 2006So I had a bit of an issue with my latest Amazon order, everything listed as in stock but the estimated ship date was over a month away so I wanted to give them a call but their Customer Service number is apparently classified information. Anyway I eventually found it and they were very helpful. For anyone else looking for the Amazon Customer Service number it’s…
Amazon US Customer Service
Phone toll-free in the US and Canada: (800) 201-7575
Google Groups Killfile 2.0
Wednesday, September 27th, 2006Okay, so it’s finally here with a lot (if not all) of the kinks worked out of it. It will now correctly block ignored users from the group index view when viewing titles only or titles with message text. It will also now correctly block the ignored user from the thread view (both from the thread index and the thread itself). To see who is on your ignore list click the Killfile menu option added to the Google Groups Navbar.
If you already have Firefox and GreaseMonkey click here for the new script
Otherwise click here for full install instructions
HACKED!
Wednesday, September 27th, 2006Y’know you turn your back for a second and the pesky hackers come knocking on your door. Not keeping upto date with the latest WordPress goings on I was unaware that 2.0.2 had a HUGE security hole in it. Anyway I try to login yesterday and my entire site has been blown away and some git has linked some spam site from here. Luckily the great guys at Kattare were able to restore the database but quite a shock. Upgraded to 2.0.4 so hopefully I won’t see a repeat performance, that’ll teach me to run an app written in php….
Getting Substruct to use the PayPal API
Wednesday, July 5th, 2006So I’ve been trying to get Substruct to use PayPal Pro instead of Authorize.net as the payment gateway. There are a couple of options out there to do this namely
vPayPal which I didn’t have any luck with and
elTechs PayPal plugin which is the option I finally got working
The problems I had were all due to bugs in soap4r 1.5.5, the so called stable release.
So here is how you tweak soap4r to make it work… (If you want to be lazy download my patched copy)
- Skip 1.5.5 and grab the code that is sitting on the trunk and make these next two updates
- Apply patch 1629 to complexContent.rb that lives in lib/wsdl/xmlSchema/complexContent.rb
- Change wsdl/soap/classDefCreator.rb as follows
Comment out the type = nil line and uncomment the type = create_class_name line)if element.type == XSD::AnyTypeName type = nil elsif klass = element_basetype(element) type = klass.name elsif element.type type = create_class_name(element.type) else # type = nil # do we define a class for local complexType from it's name? type = create_class_name(element.name) end
- You can now go ahead and run install.rb to install the package.
- Follow the rest of the instructions from the PayPal plugin
- Success!
Big thanks to Brenden Wilson as without his post I never would have gotten this running (being a complete RubyNoobie)
The next step is getting all of this working from within Substruct.
Change the finish_order method in store_controller.rb to
def finish_order
@title = "Thanks for your order!"
@order = find_order
# If there's no order redirect to index
if @order == nil
redirect_to_index and return
end
@transaction_details = {
:firstName => @order.billing_address.first_name,
:lastName => @order.billing_address.last_name,
:ip => "127.0.0.1",
:amount => @order.total.to_s,
:itemName => @order.order_number,
:addressName => "Billing",
:street1 => @order.billing_address.address,
:street2 => "",
:cityName => @order.billing_address.city,
:postalCode => @order.billing_address.zip,
:stateOrProvince => @order.billing_address.state,
:country => "US",
:creditCardType => get_credit_card_type(@order.account.cc_number),
:creditCardNumber => @order.account.cc_number,
:cVV2 => @order.account.credit_ccv,
:expMonth => @order.account.expiration_month,
:expYear => @order.account.expiration_year
}
result = Paypal.directauth(@transaction_details)
if(result.ack == "Success")
@payment_message = "Card processed successfully: #{result.transactionID}"
# Save transaction id for later
@order.auth_transaction_id = result.transactionID
logger.info("nnORDER TRANSACTION ID - #{result.transactionID}nn")
# Set completed
@order.cleanup_successful
# Send success message
@order.deliver_receipt
clear_cart_and_order(false)
else
# Order failed - store transaction id
# @order.auth_transaction_id = result.transactionID
@order.cleanup_failed(result.ack)
# Send failed message
@order.deliver_failed
# Log errors
logger.error("nn[ERROR] FAILED ORDER n")
logger.error(result)
logger.error("nn")
# Redirect to checkout and allow them to enter info again.
error_message = "#{result.errors.longMessage}"
error_message << "Try again or contact us for further assistance."
redirect_to_checkout(error_message)
end
end
Ruby (Briefly) Derailed
Friday, April 28th, 2006Just tried to get up and running with Ruby on Rails as it looks very slick. Anyway first problem I had was apparently a common one but with various solutions. The error was
error Before updating scaffolding from new DB schema, try creating a table for your model (Product)
Anyway, the solution was to gem install mysql (choosing the latest) and then copying libmySQL.dll to windows/system32
So now I’m back on track :)