Posts

Showing posts from November, 2010

Discrete Fourier Transform in Ruby

...Just for a laugh... I'm reading this amazing book at the moment,  http://www.dspguide.com/ and thought it would be fun to code some stuff in Ruby. The code... #!/usr/bin/ruby require 'complex' class DFT         def initialize( size )                 @freq = Array.new( size, Complex(0,0) )         end         # set data         def data( data )                 @data = data         end         # get frequency table         def freq                 @freq         end         # reset the frequency table         def reset                 @freq.map! do |...

Unit testing in TCL

The unit... #!/opt/local/bin/tclsh proc fib {n} {         if {$n==1}  {return $n}         if {$n==2}  {return [expr {$n-1}]}         if {$n==3}  {return [expr {$n-1}]}         return [expr { [fib [expr {$n - 1}]] + [fib [expr {$n - 2}]] } ] } The test... #!/opt/local/bin/tclsh package require tcltest 2.0 namespace import ::tcltest::* source ../src/fib.tcl # 1 1 2 3 5 8 13 21 34 test fib-1 { Test first is 1 } {         fib 1 } 1 test fib-2 { Test second is 1 } {         fib 2 } 1 test fib-3 { Test third is 2 } {         fib 3 } 2 test fib-4 { Test fourth is 3 } {         fib 4 } 3 test fib-5 { Test fifth is 5 } {         fib 5 } 5 test fib-6 { Test ninth is 34 } {         fib 9 } 34 test fib-7 { Test f...

The Six Characteristics of Shorinji Kempo

Image
Todays T-Shirt choice reminded me of the Six Characteristics of Shorinji Kempo. Ken Zen Ichinyo – Body and the mind are one. Riki Ai Funi – Strength and power should never be separated from compassion. Shushu Koju – Defence comes before attack.  Fusastu Katsujin – Defend and protect without killing.  Goju Ittai – Use hard and soft techniques together, in balance. Kumite Shutai – Pair work is fundamental.   And Live Half for yourself, Half for Others. http://bit.ly/mo_custardcat That is all.

Homebrew tapeless camera

Image
This is an ongoing project I'm working on which started as a circuit that I decided was necessary to be able to neatly interface the nNovia QC120 A 2D2  recorder to a Sony DXC-325P camera with CA-325P studio back. This interface deals with translating VTR start/stop signals from the camera into GPI signals to pause and resume the recorder when it is in record mode. In addition to the device control, there will also be XLR Balanced line input to be converted to unbalanced line level. There is also the possibility of getting it to communicate with the nNovia RS-422 port and using this protocol to control the device. I'm still working on the final design. I have built the PIC 16f872 based circuit that controlls the nNovia via the GPI control lines and this seems to work very well. The next step with the PIC interface is to try controlling the RS232 port on the nNovia to start and stop the deck and get its status. I will be prototyping the Preamp shortly. I have a plan to use the...

Is TDD Karate or Kung-fu?

Today we had a discussion in the office about the current TDD (Test Driven Development) course we are following and it has to be said there is more than a little confusion over it. One of the main sources of this confusion seems to be 'why' we are doing it.  And I can see where the confusion creeps in. Quite a few of the members of the team have years of programming experience and may already or have been practicing TDD in some guise or another so those people already know the benefits and have adapted the process to their way of working. To me this is fine. Perhaps they would be better served with working on some other very useful principles such as the SOLID principles. [Robert C. Martin] Some of the other members know of TDD and are perhaps reluctant to use it because of past experiences or whatever.  These people need to know what the goal is, what will they be good at at the end of this? At this point someone started explaining that it was like learning Karate. In some ...