Rubber duck debugging, Pair Programming and more

Last Updated or created 2022-05-10

Why “rubber ducking’’? While an undergraduate at Imperial College in London, Dave did a lot of work with a research assistant named Greg Pugh, one of the best developers Dave has known. For several months Greg carried around a small yellow rubber duck, which he’d place on his terminal while coding. ( From “The Pragmatic programmer” page 95)

Why rubber ducking?

A very simple but particularly useful technique for finding the cause of a problem is simply to explain it to someone else or even a object. Explain out loud (or in your mind to the duck) what each line of code is doing.
Often while doing so, you will see the problem.

Why Pair Programming?

It is no secret, i like working on a problem alone. Let me do my ‘thing’. But i like the idea of Pair Programming, why?

  • Differences in thinking, gives alternative solutions
  • 4 eyes principle, typo’s will be seen
  • When working with a novice:
    • Teaches the new guy
    • Give the other space to ask stupid questions, maybe they are NOT!
  • The knowledge of the new code is now known to > 1 person!

Wacom tablet doesn’t behave

Last Updated or created 2022-05-20

Changed some code controlling my wacom drawing tablet.
I use this one to draw Art, diagrams and touch up photo’s.

When using multiple screens, i had the problem it would stretch the draw area over multiple screens, streching the ratio. Or it took the work screen to work on.

#!/bin/bash
# using xinput here, check post about two mouses/keyboards on one machine

# Use xrandr to check names check 
MONITOR="DP-1"
PAD_NAME='Wacom BambooFun 6x8 Pad pad'

#undo
xsetwacom --set "$PAD_NAME" Button 1 "key +ctrl +z -z -ctrl" 
xsetwacom --set "$PAD_NAME" Button 2 "key e"
xsetwacom --set "$PAD_NAME" Button 3 "key h"

ID_STYLUS=`xinput | grep "Pen stylus" | cut -f 2 | cut -c 4-5`
xinput map-to-output $ID_STYLUS $MONITOR
ID_STYLUS_2=`xinput | grep "Pen eraser" | cut -f 2 | cut -c 4-5`
xinput map-to-output $ID_STYLUS_2 $MONITOR

exit 0

Most of the times i use Krita and Gimp.