Examples in manuals – how to verify (test) them

I’ve gotten some just comments as feedback for the examples in the Searduino Manuals. Searduino is a software to make it easy to program C/C++ for Arduino, a simulator for source level Arduino API, … and more.

Problem is the following: I’d written some examples to make it easy to get started with Searduino. After some weeks of updates to the code the examples were not correct anymore. What good is it to have examples if they don’t work? But on the other hand, it’s really a pain in the ¤/&% to have to update example code. We need a way to test example code in manuals and to automate the tests!

Copying/pasting code from a manual is not something that is not desired (error prune to say one problem). So how to find some middle ground here? Is there any software for this?

My temporary solution was to write all examples as C files and Makefiles and to write some scripts to

  • convert a C file to texinfo file (c2texi)
  • convert a Makefile file to texinfo file (makefile2texi)

and then include the generated texi files in the manual (written in Texinfo). Will probably do the same for GNU Xnee

There must be  a better way … or?

 

41 – an Adams prime number

During a lunch the other day we spoke about the number 41 (which happens to my age (actually today I am turning 41)) and that it is a prime number.

Rikard pointed out that 41 is not  Mersenne primes number, so it seemed to us that 41 is just another ‘boring’ prime. But then Greg pointed out that 41 is equal to 42-1. 42 is a really interesting number, since according to Douglas Adams (author of The Hitchhiker’s Guide to the Galaxy) 42 is the answer to….. (well, read the hitchhiker’s guide and you’ll find out). So 41 must be an interesting prime after all. So given the way we name some prime numbers Mersenne we should name all the prime numbers that can be written as 42-1 an Adams prime number.

Now we need to find if there are an infinite number of Adams prime numbers…..

Searduino 0.5 released

Implemented features:

  • All Arduino functionality when building for Arduino boards
  • When building for local execution (simulator or stand alone program): http://itupw185.itu.chalmers.se/searduino/?page_id=32

Download:

Source code dist:

http://download.savannah.gnu.org/releases/searduino/src/searduino-0.50.tar.gz

Binary dist for GNU/Linux x86_64t

http://download.savannah.gnu.org/releases/searduino/bin/gnu-linux/searduino-bin-0.50-x86_64.tar.gz

Binary dist for GNU/Linux i686t

http://download.savannah.gnu.org/releases/searduino/bin/gnu-linux/searduino-bin-0.50-i686.tar.gz

Documentation:

http://download.savannah.gnu.org/releases/searduino/doc/searduino-docs-0.50.tar.gz

 

Fixed Savannah bugs:

  • 35978  MAIN_SRC SRC_C confusion
  •  35977  Translate Arduino examples script minor bugs
  •  35976  Find a better way to look for Python stuff in configure
  •  35975  Error/warning msg when configuring
  •  35974  Problems with script to translate Arduino examples
  •  35973  exit on failure in configure.ac
  •  35871  Example has file faulty include statement
  •  35965  Run time path into binaries
  •  35982  Don’t fetch Arduino sources if already there
  •  35873  Searduino can not create SHLIBs propoerly on x86_64
  •  35964  Code for Arduino HW can not use SEARDUINO_LOOP
  •  35980  Add option to set the number of pins
  •  35963  Generated examples (arduino-ex2c) miss init();
  •  35979  Fixes for manual
  •  35983  Inclue Arduino examples in dists
  •  35976  Find a better way to look for Python stuff in configure
  •  35870  Built in example code fails to load in Pardon
  •  35872  Example misses info on how to execute program
  •  35991  Converted example includes setup instead of searduno.h
  •  35990  PROG not set when converting arduino ex to C code
  • 36012  pearduino.so link not platofrm independet
  • 36042  Not easy to do conditional programming, DEBUG macro missing

Fixed Savannah tasks:

  • 11900  Move “sleep” code from examples to stubs
  • 11948  Test code to test bin releases
  • 11921  Add examples on how to check (and use) binary dist
  • 11963  Add target lib in searduino-arduino.mk
  • 11964  install target in Makefiles for Arduino

Searduino 0.47.93 (prep for 0.5)

Searduino is:
* C libraries for Arduino (from the Arduino sources)
* Python scripting interface to test your Arduino programs locally
* GUI simulator (written in Python) to test your Arduino programs locally
* stream simulator (written in C) with which you can “talk” with your Arduino program (locally)
* Makefiles to ease up development and uploading for Arduino boards. All from the command line
* Currently supports: Uno, Due and Mega and basic Digital in/out on GNU/Linux

 

New stuff since 0.47

Fixed Savannah bugs:
#35978  MAIN_SRC SRC_C confusion
#35977  Translate Arduino examples script minor bugs
#35976  Find a better way to look for Python stuff in configure
#35975  Error/warning msg when configuring
#35974  Problems with script to translate Arduino examples
#35973  exit on failure in configure.ac
#35871  Example has file faulty include statement
#35965  Run time path into binaries
#35982  Don’t fetch Arduino sources if already there
#35873  Searduino can not create SHLIBs propoerly on x86_64
#35964  Code for Arduino HW can not use SEARDUINO_LOOP
#35980  Add option to set the number of pins
#35963  Generated examples (arduino-ex2c) miss init();
#35979  Fixes for manual
#35983  Inclue Arduino examples in dists
#35976  Find a better way to look for Python stuff in configure
#35870  Built in example code fails to load in Pardon
#35872  Example misses info on how to execute program
#35991  Converted example includes setup instead of searduno.h
#35990  PROG not set when converting arduino ex to C code

Fixed Savannah tasks:
#11900  Move “sleep” code from examples to stubs
#11948  Test code to test bin releases
#11921  Add examples on how to check (and use) binary dist

Misc
* Arduino examples included
* Searduino can translate from Arduino example to C code
that can be built by Searduino
* Helper functions (macros) added for the Arduino boards

Manual:

http://download.savannah.gnu.org/releases/searduino/doc/searduino-docs-0.47.93.tar.gz

Source code dist:

http://download.savannah.gnu.org/releases/searduino/src/searduino-0.47.93.tar.gz

Binary dist for GNU/Linux i686:

http://download.savannah.gnu.org/releases/searduino/bin/gnu-linux/searduino-bin-0.47.93-i686.tar.gz

Binary dist for GNU/Linux x86_64:

http://download.savannah.gnu.org/releases/searduino/bin/gnu-linux/searduino-bin-0.47.93-x86_64.tar.gz

 

Searduino 0.47 is out

Finally! The new Searduino makes it easy to use Searduino. Manual is up to date, even though we’re planning a new manual release to happen any day, so it should be possible to get started using Searduino really quickly.

This release will be used as a basis for a coming workshop and given the experiences from that we will release 0.5

  • build and upload plain C code for Arduino boards
  • run your arduino code locally on your computer
  • run your arduino code in a simulator (GUI or CLI)
  • write your test cases in C or Python

Get Searduino 0.47 here:

All features in Arduino are not implemented in Searduino yet. Here’s the compatibility page:

 

GNU Xnee 3.12 (‘Hannes’) released

We are pleased to announce the availability of GNU Xnee 3.12

GNU Xnee is a suite of programs that can record, replay and distribute
user actions under the X11 environment. Think of it as a robot that can
imitate the job you just did. GNU Xnee can be used to:
Automate tests
Demonstrate programs
Distribute actions
Record and replay ‘macro’
Retype the content of a file

Getting the Software
====================

ftp://ftp.gnu.org/gnu/xnee/xnee-3.12.tar.gz
ftp://ftp.gnu.org/gnu/xnee/xnee-3.12.tar.gz.sig

or one of the mirror sites as found in:

http://www.gnu.org/prep/ftp.html

Checksums
===========

md5sum:
c2a74e8d1f3965c5f3b47aadb40ba5e3  xnee-3.12.tar.gz

cksum:
2575836771 1798047 xnee-3.12.tar.gz

New in this release
===================

* New option: –record-replay, -rr
Record and replay a session (press q to stop recording)

* Fixed bugs:

Savannah
bug #35029, Segmentation fault when using stop…

…. for Hannes

Thunderbird: where’s the fullscreen mode?

On the computer I am currently using the resolution is 1024×600. The width is ok, but the height really requires applications to “behave”. I am using GNOME (since early 2000 something) and Thunderbird. I dare not switch to other softwares since I fear the wrath of Andreas Nilsson (GNOME, Mozilla).

Anyhow, since GNOME is stealing a lot of pixels from me (panels) and Thunderbird does a good job at stealing pixels too I could really do with a full screen mode.

So please Thunderbird developers, Andreas in particular, gimme a full screen mode for Thunderbird.

Bringing stupidity to a new level: macros and searduino

I wanted to test the “syntheseizer” I built (one potentiometer with two piezosummers playing same tone, as set by the potentiometer, in different octaves). And of course some blinking leds.

I spent 30 minutes figuring out why it didn’t work. Seemed to work nice in the Searduino Simulator (wait a week until it’s ready for use). Tons of time checking that the libraries built are ok. Finally, I tested to upload some code from the Arduino examples and, all of a sudden, reading analog pin worked again… and guess what? After a long while I found this:

#define analogRead(p) 500 

Kinda explains why all the delays based on digitalRead I did always took 1/2 a second. It’s hard to love your self after such a mistake. And yes, this really addresses an issue with C.

What you see is NOT what you compile.

GNU Xnee 3.11 (‘Jansch’) released

We are pleased to announce the availability of GNU Xnee 3.11

GNU Xnee is a suite of programs that can record, replay and distribute
user actions under the X11 environment. Think of it as a robot that can
imitate the job you just did. GNU Xnee can be used to:
    Automate tests
    Demonstrate programs
    Distribute actions
    Record and replay 'macro'
    Retype the content of a file

Getting the Software
====================

   ftp://ftp.gnu.org/gnu/xnee/xnee-3.11.tar.gz
   ftp://ftp.gnu.org/gnu/xnee/xnee-3.11.tar.gz.sig

or one of the mirror sites as found in:

   http://www.gnu.org/prep/ftp.html

Checksums
===========

  md5sum:
     f2c15ebdda44480ac59c0048a2809f09  xnee-3.11.tar.gz

  cksum:
     1228726175 1788094 xnee-3.11.tar.gz

New in this release
===================

   * Fixed bugs:

     Savannah:
       #30137: gnee crashes on Ubuntu 10.04

     Recording in X.org > 1.11 does not work 

     Fedora / Red Hat Bugzilla – Bug 757733

     Mem error when distributing to multiple displays

... and the name 'Jansch'? It's a tribute to Bert Jansch, who died 5 October 2011.

http://en.wikipedia.org/wiki/Bert_Jansch