Monday, April 17, 2017

Image To ZX Spec 2.0.1 Release & Source Code



What's new?
As mentioned in my last post this project is in maintenance stage for me (or as little work as I can get away with) so I can concentrate on other things. However... it's having a rebirth as a new project on Github! I'm a bit tentative about Github as previously I had exclusive distribution of the source via my blog but now it's easy for anybody to fork and improve. This is a double edge sword as others' improvements can be pushed back up stream and the project won't die - still it's letting go of my pride and joy!

What still needs work for the source release?
Over the next few weeks I hope to document the architecture and build instructions that I've simply not yet had the time to do - these will follow on a fixed blogger page and the project readme markdown respectively. There are areas that I'm not happy with (as with any project) that are downright ugly but the processing pipeline is sound and has had many refinements. Hopefully others will help improve the bad areas!

So what else has changed?
This release sees UI improvements for niggling issues like the image being too large and going off screen and a fix for serious bug in SCR export. It also has improvements to Gigascreen rendering on a real Spectrum.

Source:

https://github.com/KodeMunkie/imagetozxspec

Downloads (nb all builds are x64 - 64 Bit CPUs only):

Windows:
imagetozxspec-windows-2.0.1.zip (sha1: 9be463c17e4a26231e45a39250bceba9)
MacOS:
imagetozxspec-macos-2.0.1.zip (sha1: 4e5e213755c9bd4258ef6aee13330adf)
Linux:
imagetozxspec-linux-2.0.1.zip (sha1: 748b7cc8bd726f001d89761587de0625)

Changelog for 2.0.1:
  • Fixed bug with main window extending off screen
  • Fixed image labelling bug
  • Fixed bug adding last frames of video to a new video if conversion manually stopped
  • Fixed bug with multi image popup preview's image being too large when unscaled
  • Fixed bug in SCR converter that would fail to output some images/second Gigascreen image
  • Added 2 new Gigascreen export attribute orders
  • Added pre-processing slider reset to defaults button
  • Removed some redundant dither processing
  • Removed test framework from production build
  • Cleaned up some code

Saturday, January 28, 2017

Reebok i-Run Disassembly / Maintenance / Repair

I recently needed to open my Reebok i-Run treadmill thanks to my toddler son "posting" a DVD into the mechanism, so whilst I was inside it I also decided to give it a quick check and clean.

Information on opening this treadmill is almost non existent so I've documented it here - hope you find it useful. If it saves you time and money please consider buying me a coffee.



DISCLAIMER

I accept no responsibility for this guide. its accuracy or its safety. Any work you undertake in relation to this guide is done at your own risk, if in doubt call a professional out!

WARNING

  • Leave the machine off and unplugged for at least 48 hours before attempting this guide - there are large capacitors inside that can hold charge even after the machine has been off for some time.
  • Ensure that the treadmill is disconnected from the mains before doing any work (it should be if you followed the above point!).
  • The treadmill is heavy, make sure you have somebody to help you move it.
  • Make sure you have plenty of light to do work.
  • Do not touch any electronics inside as you may damage them, and there may still be some residual charge left in them.
  • You will void your treadmill warranty.
  • Read this entire guide first before you start.

Things you'll need

  • The manual (you may find yours here)
  • Long screwdriver set
  • Bracket Allen key (you will have received this with the treadmill, it's not the one used for tightening the belt)
  • Can of compressed air
  • Vacuum cleaner
  • Kitchen tissue
  • Somebody to help you move the treadmill
  • Lots of space to move the treadmill

Steps for removing the top molding (motor access)

  1. Ensure the treadmill is standing correct, with the arms at the vertical, perpendicular, non-storage position.
  2. Remove the plastic leg feet from the top of the treadmill.
  3. Underneath where the plastic feet were, unscrew (with the Allen Key) and remove the white square metal leg brackets - they just pull out when the screws inside of them have been removed.
  4. Unscrew and remove both of long screws, one on each side of the top molding, in front of the arms (just the right side screw hole shown on photo below).
  5. Turn and rest the tread mill onto the side without the power connector (so you have access to the underneath of the treadmill).
  6. On the side of the treadmill unscrew the 2 small power connector screws attached to the molding - not those inside on the socket next to the terminal pins (as the treadmill is on its side the connector will be facing the ceiling as you do this). Be careful not to lose these screws. Note removing just the top screw on the connector may be sufficient but I removed both just to be certain.
  7. Underneath the treadmill remove 4 screws located in the plastic base molding found nearest the edge. These screws hold the top piece of molding on. These screws may take longer than you expect to remove owing to them being long and they may not just fall out - as long as the top molding is released you should be okay. (Note photo shows in green circles where these screws underneath thread through to the top molding).
  8. Return the treadmill to its original position, watching for any screws falling that you adjusted in the last step that you were unable to remove.
  9. Slide the top molding away from the treadmill by gripping it near the Reebok logo, pulling it up and backwards slightly away from the running surface and foot plates. This may be difficult so inserting a flat screw driver to separate the seams between the molding and the treadmill foot plates might help. If you've missed removing any essential screws in the previous step you'll notice it now - double check if the molding doesn't come away easily because it's very likely you missed something! (Note photos show area to grab near the logo and where to separate the seams for one side - they were taken after the treadmill was reassembled. You'll need to separate both left side and right side foot plate seams simultaneously).
  10. Finally your treadmill should be open!

General Checks

See disclaimer above - I am not an electrician, these are just general checks I personally attempted and do not cover the motor or mains transformer parts, if in doubt get a professional to check!

If you find any of the following problems DO NOT USE YOUR TREADMILL - it could be a serious safety risk!
  1. Inspect (but do NOT touch) the large cylinder capacitor on the circuit board. If this is swollen or leaking on top it will need professional replacement. (see red circle in photo below this list)
  2. Look for signs of any frayed wire or missing wire insulation.
  3. Look for any signs of electrical wire being disconnected.
  4. Ensure that the ground wire is still attached to the metal frame (see green circle in photo below this list)
  5. Look for any signs of burnt material.
  6. Look for any signs of melted or warped plastic.
  7. Look for any signs of liquid damage.

Steps for cleaning

  1. Use the can of compressed air to remove sediment around the electronics (IMPORTANT: make sure you don't blast freezing cold liquid onto the electronics by holding the air canister incorrectly).
  2. Repeat the above step but for the motor housing, don't clean or attempt to adjust the belt if you can avoid it/don't need to.
  3. Use the kitchen tissue to wipe off any dirt/sediment/dust on the metal work.
  4. Use the vacuum cleaner to suck all the dirt/sediment/dust that has now accumulated in the bottom molding whilst you've been cleaning.

Re-assembly

Reverse the instructions in "Steps for removing the top molding" above. Ensure that you don't trap any wires and don't over tighten the screws in the molding base because it can break the screw threads in the molding top half.

That's it! If this has been any help please feel free to buy me a coffee!

Thursday, January 05, 2017

SOLID Principles for Dummies

As an OO programmer one of the things you're meant to practise is good OO design, and the SOLID principles embody that.

If you've read the SOLID wikipedia article it's a little long winded, so here's the SOLID principles simplified and written as negative reinforcement to help curb bad practices!

S - Single Responsibility Principle

Don't have classes do many things - a class should have a single purpose, I would go so far as to say a method should also have a single purpose. For example a DatabaseService class only interacts with a database, a save method only persists a value (as opposed to a method such as validateValueAndSave)

O - Open Closed Principle

Don't write decision logic based on sub class or sub class properties in the parent class - i.e. have sub classes make the sub type specific decisions. Make sure you extend classes, don't break the original abstract classes by modifying them,

L - Liskov Substitution Principle

Don't return an incompatible type in sub classes (or anything that suggests the sub class cannot support the operation as exactly defined by the parent class). For example in a Java method don't throw not supported exceptions in sub classes, in other languages, don't return types incompatible with the base type return value. By doing this it ensures any method (or iterator etc.) that takes a subclass argument and has no specific subclass feature usage, is able to have its argument substituted for the parent class without modification.

I - Interface Segregation Principle

Don't lump all functionality into one interface and thus have implementing classes provide functionality they can't support, instead create fine grained interfaces.

D - Dependency Inversion Principle

Don't use concrete types if there's an interface available for dependencies (in general coding to an interface is best practice anywhere). For example use List myDataList = createList(), not ArrayList myDataList = createList(), where List is an interface on ArrayList. This allows easy substitution of the dependency implementation later to another list type without breaking the code receiving the dependency. In short, a high level class should not depend on a low level class.