RISC OS setup

Yesterday I wrote about how to get going with Raspberry Pi and Noobs. Today I have completed installing the operating systems I wish to use and it is time to configure them to match my own preferences...starting with...

RISC OS Pi
RISC OS Pi is a version of the 30 year-old operating system that originally started life on the Acorn 32 bit machines that you may remember from their golden age in the early nineties- where they could be found as work-horses in nearly every school in the UK. It lives on today and is maintained by RISC OS Open.

And there is a version for your Raspberry Pi.

The RISC OS Pi desktop. It is very easy to think that this is a modern operating system, however it is actually thirty years old. Also, if you are expecting it to behave like Microsoft Windows then you are in for a surprise.

I wrote all about setting up RISC OS in a previous post last year where I talk about some of the essential productivity apps that you should download for your RISC desktop. Today I have downloaded all of the apps that I think will make my raspberry Pi as useful machine and then I then followed my own instructions for how to bind operations to the function keys.

Installing apps from the Pling store is usually a painless process, however some apps do require you to install additional packages (for example the Internet Radio app requires the Mplayer package) which can be installed with the !PackMan program, or may require additional resources to be merged with the operating system resources folder. Thankfully, most apps have very helpful help files included. I haven't managed to install the News app with success this time round, and I do not know what is wrong with it.

It's not Windows

If you are expecting RISC OS to behave like Windows, then you are in for a surprise. Here are some of the main differences.


  • You need a mouse to operate RISC OS. Furthermore you need a mouse with three buttons. If your mouse is one of the two-button varieties with a scroll-wheel, then the scroll wheel will probably act as a middle button. If you have no suitable mouse, then I would recommend the light-weight RISC OS Pico which will boot (in a few seconds) into a RISC BASIC prompt with more memory than you could possibly need.
  • The left mouse button is used for selecting items. The middle mouse button brings up a menu. The menu is always associated with whatever item is currently under the mouse pointer, so you do not need to aim at a separate menu bar at the top of the program. In fact, RISC OS programs typically do not have a menu bar as in Windows or Apple software which makes them look more minimalist. In effect, the menu is always just under the mouse pointer. The right menu button is for adjust. Often it behaves like the right click, but most often it provides you with more options that can be performed on an item under the mouse pointer.
  • When you launch an application, it doesn't actually open. This can seem very strange to a contemporary user who general expects their apps to open on demand. In RISC OS, when you launch an app, an icon will appear on the Icon Bar. This tells you that the app is running and ready for you. Selecting it with the left mouse button will usually open it as a window, otherwise you can drag files onto it or use the middle mouse button to generate a menu.
  • There is no desktop. You will get strange looks when you talk about the desktop. In RISC OS world, the part of the screen with the icons on it is called the 'pinboard'. Windows can be 'minimised' like in Windows operating systems and they become pinned to the pinboard instead of appearing as an icon on the icon bar.
  • Menus are interactive. Unlike other operating systems menus in RISC OS are an interactive experience. Often times you will be dragging icons into a menu, in order to get something to work, or you may be typing into an edit box in the menu itself as shown below.
Here the text file is saved by dragging the file out of the menu and into the folder that you want to save into.

Other useful stuff to know

  • RISC OS can rebooted by pressing CTRL + Pause/Break at the same time.
  • Pressing F12 will open the command line shell.
  • CTRL + F12 will bring up the TaskWindow.
  • If you have a USB storage device plugged into your Pi, you can access the files on this disk through the GUI or from the command line using the *fat32fs command. Go back to the main file system using *sdfs
  • If you have a ram disc set up, your can access this file system from the command line with the *ram command.
  • A BASIC program containing scripts can be set to run on boot-up by dragging the basic file into the !Configure > Boot > Run folder.
  • You can set the date/time using the following commands:

*basic
TIME$ = "Thu,30 Mar 2017,17:30:49"

...or whatever is the current time for you.

Well, that's all for now. I hope this post has inspired you to try out some RISC OS goodness, or has helped you get started with RISC OS on the Raspberry Pi.  See you next time.

Getting started with Raspberry Pi

My Raspberry Pi ran into some problems and I have found need to reinstall the operating system(s) and start again. I shall document the steps I have taken on this blog so anyone else can follow in my footsteps.


Part one - installing Noobs.

With your new shiny Raspberry Pi computer will need an operating system. This, as I am sure you know, is the software that runs the computer by providing an interface and managing resources such as file structures, memory and processor threads.

I have chosen to use a 32GB SD card for the operating system and apps and an 8GB card for data. You don't need to use a card this large for the OS, however I want to try out several operating systems at once (and I definitely need RISC OS as well as Raspbian). First time users will probably just want to start with Raspbian and a single 8GB card.

Both of my cards have been formatted with SD Association's Formatting Tool running on my Windows machine, but there are versions for Linux machines as well. Make sure you set "FORMAT SIZE ADJUSTMENT" option to "ON" in the "Options" menu.

I then downloaded the latest version of Noobs which is an operating system installer which makes the whole process of installing the operating systems much easier.

Once the Noobs files have been extracted from the zip file they have been copied on the OS SD card. This card was then inserted into the Raspberry Pi and Noobs started when I powered up.

When you do this, a menu will appear and you can choose which operating systems you would like to install.

Then sit back with a good book and wait for the system to do its thing.  Talking of good books, I thoroughly recommend Raspberry Pi Manual: A practical guide to the revolutionary small computer (Owners Workshop Manual) (Haynes Owners Workshop Manuals (Hardcover)).



This book is an excellent introduction to all things Raspberry Pi, from setting up the machine and getting started with programming languages to building a web server and hardware hacking.  It is like a cross between a computer manual, a recipe book and a Haynes guide to a motor vehicle maintenance. It is written in plain English, with very easy to follow code examples and colourful pictures. There is plenty in here for many weekend Raspberry Pi projects and I thoroughly recommend that you go out and get a copy.

Well that's all for now, I'll be back later with more Raspberry Pi goodies.


A wiki for your desktop

I have recently been exploring alternative software to OneNote. OneNote works really well for me and it is my main note-taking app. I like how I can easily organise my thoughts into a hierarchical structure that synchronises across all my devices. In fact OneNote has for a long time replaced my own memory. I mainly use it as a 'rough work book' for my own ideas, as well as a collaborative space to work with colleagues. I really like how I can make a new quick note from the taskbar in Windows 10, or from my Windows phone or Android tablet when I am on the move. I can start with a quick idea when I am on my Lumia 950 and then finish the task as a 365 document later on. On my Surface device, the OneNote notebook works very well with the surface pen and feels almost exactly like a fine line pen on paper.

In fact, although this articles will deal with some interesting note-taking applications, I do think that OneNote is the king.

There is Evernote, of course, however I have always thought of this as a poor-man's alternative to OneNote. The free version currently only allows me to use the application on a maximum of two devices at once. This limitation has instantly turned me away from using Evernote and I am very unlikely to ever go back to it.

I have used TreePad a few times. The free version allows you to organise a set of notes as a hierarchical tree structure. Your notes can be exported as HTML for sharing with others. The free version has a look and feel similar to your default text editor albeit with a tree structure for organisation. The paid for versions have more advanced features including a full word-processor style of interface and custom styles amongst many other features.

TreePad Lite (free version) running in Windows 10 showing the tree structure.


TreePad document structure of TreePad PLUS (paid for version) showing custom icons/font and other goodness. 

Treepad files (including the node structures) are plain text files, and so it is fairly easy to generate treepad files programmatically in the language of your choice.

Action Note - note taking in your action center

Another note taking app I use is Action Note for Windows. This is a note taking app that sits in your action center. I use this for taking quick notes on my phone and synchronising with my PC. I have already written a blog post covering Action Note last year.

Zim

Zim is a 'wiki for your desktop'. Just like in OneNote and TreePad you maintain your notes as a hierarchical tree structure. Each page can include text and images, with a bunch of plug-ins available including task manager and equation editor.

Zim pages are formatted in a wiki structure that allow links to other pages in the document. Creating a new node is as simple as linking to a non-existent page. Links are maintained in a simple mark-up syntax, such as :Notes:page1 or +newpage.

Zim notebooks can be exported as HTML pages with various pre-set templates. Indeed the Zim website itself was written in Zim.

I have only just discovered Zim, and as such have not got much to show for it, however I can already see that it has many advantages over TreePad most notably the fact that it is a free download; can run across Linux and Windows, not to mention the simple node creation and exporting features. Until discovering Zim, I was considering paying for the full version of TreePad PLUS, however now I don't think I will bother.

The Zim manual, written using Zim.
Video Time


Taping from the radio in 2017

How things have changed. Long ago, when I was grass-high to a knee-hopper, I used to record tunes from the radio onto compact cassette (If you are the copyright people reading this, then, no, no I didn't). I would then put the cassettes in my portable stereo and listen to them on the way to geek school. If you were young in the 70s, 80s or early 90s, then it is likely that you did the same.

An actual compact cassette tape actually from back in the actual day

When compact cassettes became obsolete, I didn't miss them. By the mid 90s I had a growing collection CDs and a decent PC hooked into my stereo amplifier in place of a tape deck; and the transition to digital format was seamless, albeit, streaming had replaced recording from the radio.

Today, however,  I found myself doing what I once had always done, except instead of recording tunes from the FM radio onto compact cassette, I was listening on digital radio on my LaMetric Time device. And instead of compact cassette I am using the feature of Cortana on my phone to identify music and then head over to the Groove app to place them into a playlist.

Cortana at work on my Lumia 950
When I said that I don't miss compact cassettes, that is something of a lie. I do. I think that there is something intangible about music on cassette. There is a joy to using them akin to tinkering with a vintage car, or keeping a retro computer alive. It has something to do with the clunk click of the rewind mechanism, or the feel of a chunky plastic cassette in your hands, or maybe it was because you had to write the track listings on a piece of cardboard with a pen. Maybe it was this investment of effort that makes the format enjoyable. If someone gave you a mixtape back in the olden days, then it meant that they really liked you.

I have often considered buying a cassette player to relive my compact cassette days. Unfortunately, apart from a small revival movement amongst some genres of music, compact cassettes are not a viable storage medium beyond the sheer joy of operating them. I have encountered a couple of virtual cassette apps, but they really aren't the same. To the current date I have avoided taping digital radio onto virtual compact cassette, but it really is just a matter of time until I do!

Tape recorder for Windows Phone, available also for Windows 10, and yes, there are a load of cassette apps for Android devices as well, I've looked.
I am not sure what the future will bring. I am hoping for an embedded brain implant that - as soon as someone walks into the room - automatically plays their theme tune into my ear, and plays incidental music so I know when I am in peril.

I can dream.

Well, that's it for now. I will of course post the moment I get a new compact cassette player. Until then, you  might like to read about some more retro computing stuff, or, I don't know, perhaps you just find out your Starwars name or something.

New characters in Have Spell Will Travel

Following some feedback from players, I have implemented some new characters into Have Spell Will Travel (and I intend to add some more soon!).

What is Have Spell Will Travel? Only the best 2D text-based adventure game ever! In #HSWT you can choose one from over two hundred characters in an attempt to complete various quests. You have at your disposal 15 statistics that describe your character. Each challenge will require you to test these statistics, however you are never told how difficult the challenges are. It is up to you to work out how best to tackle a challenge, and up to you to decide whether you will use your magical items to assist you.

Character sheet for a Dwarf Adventurer. Dwarfs are good at 'Endurance' and 'Intuition' based tasks.
Here is an example of a challenge.  The Rabid sheep can be tackled by testing one of five of your stats, but some are more difficult to complete than others. Even though my Dwarf is better at combat than hiding, it may be the case that hiding is easier to complete than combat. Success at Have Spell Will Travel is a careful blend of luck, lateral thinking and extreme violence (well, not the last one).


I have recently added three new characters: The Treant, the Feline and the Robot. Where the Treant is strong and wise, the Feline is a stealthy warrior. The Robot on the other hand is extremely tough and intelligent, however it cannot eat or drink potions; nor can it visit the healer or be turned into a Vampire. This is Have Spell Will Travel the hard mode, because it has not escaped my attention that the robot cannot replenish lost lives in any way. Maybe I will fix this in the next version, with some sort of robot puncture repair kit.

If you have read this far, then it is likely that you will really want to just click this link and play it.

If you enjoy #HaveSpell, then do please let me know (especially if you defeat Warren Fogbender, meet Bert or find the whereabouts of the Armoured Weremole).

Depth First Search in Python

Well, it has been a while since I posted some code onto these pages, so what follows is some Python 3 code for a depth-first search as I taught it to some students today.

The code uses a stack to implement the depth first search. The output shows the nodes visited.

I shall use the following graph as an example. The graph has been coded as an adjacency list using a dictionary where the nodes are assigned integer keys and their value is a list containing the nodes that they are connected to.

A graph representing a maze with ten nodes featuring closed loops. You can ignore the path leading from 9. I have chosen a maze that cannot be solved by following the walls method (it will ignore node 5)

The code:
(Also available as a download from OneDrive because it is highly likely that it won't work well pasted from the browser.)

class mystack:
    def __init__(self, size):
        self.__stack = []
        self.__size = size
        for i in range (size):
            self.__stack.append("")
        self.__tos = -1

    def peek(self):
        if self.__isEmpty():
            pass
        else:
            return (self.__stack[ self.__tos ])
   
    def push(self, item):
        if not(self.__isFull()):
            self.__stack[ self.__tos + 1 ] = item
            self.__tos += 1
        else:
            print("STACK OVERFLOW")
           
    def pop(self):
        if not(self.__isEmpty()):
            self.__tos -= 1
            return self.__stack[self.__tos + 1]
        else:
            raise StackEmpty("Stack is empty")
           
    def __isEmpty(self):
        return (self.__tos == -1)

       
    def __isFull(self):
        return self.__tos == self.__size-1


    def display(self):
        for i in range (0, self.__tos+1 ):
            print (self.__stack[i], end=", ")



class dfs(object):
    def __init__(self):
        #map is the adjacency list
        #visited keeps track of which nodes have been visited
        #stack is the stack of current nodes under investigation
        self.__map = {0: [1,5,4], 1:[2,0], 2:[3,1,6], 3:[2], 4:[0,8], 5:[0,6,9,8], 6:[2,7,9,5], 7:[6], 8:[4,5,9], 9:[8,5,6]}
        self.__visited = [False, False, False, False, False, False, False, False, False, False]
        self.__stack = mystack(10)

    def main(self):
        start = 0
        current = start
        solved = False
        while not(solved):
            try:
                print("exploring node", current, end='')
                if not(self.__completed(current)):
                    self.__stack.push(current)
                self.__visited[current] = True
                next = self.__findNextNode(current)
                if next != None:
                    current = next
                else:
                    current = self.__stack.pop()
                    print("...deadend...backtracking to", current, end='\n')
                self.__stack.display()
                print()
   
            except StackEmpty as e:
                #assume maze is solved
                solved = True
  
        print("\nMaze fully explored by dfs :-)")
  

    def __findNextNode(self, p):
        #finds next unvisited node in the adjacency list
        nodes = self.__map[p]
        i = 0
        while i<len(nodes):
            if not(self.__visited[ nodes[i] ]):
                return self.__map[p][ i ]
            else:
                i += 1
        return None

    def __completed(self, p):
 #returns true if node p has been fully explored
        nodes = self.__map[p]
        i = 0
        while i<len(nodes):
            if not(self.__visited[ nodes[i] ]):
                return False
            else:
                i += 1
        return True

   
   

class StackEmpty(Exception):
    def __init__(self, value):
        self.value = value
    def toString(self):
        return self.value



app = dfs()
app.main()



The output

exploring node 0
0,
exploring node 1
0, 1,
exploring node 2
0, 1, 2,
exploring node 3...deadend...backtracking to 2
0, 1,
exploring node 2
0, 1, 2,
exploring node 6
0, 1, 2, 6,
exploring node 7...deadend...backtracking to 6
0, 1, 2,
exploring node 6
0, 1, 2, 6,
exploring node 9
0, 1, 2, 6, 9,
exploring node 8
0, 1, 2, 6, 9, 8,
exploring node 4...deadend...backtracking to 8
0, 1, 2, 6, 9,
exploring node 8
0, 1, 2, 6, 9, 8,
exploring node 5...deadend...backtracking to 8
0, 1, 2, 6, 9,
exploring node 8...deadend...backtracking to 9
0, 1, 2, 6,
exploring node 9...deadend...backtracking to 6
0, 1, 2,
exploring node 6...deadend...backtracking to 2
0, 1,
exploring node 2...deadend...backtracking to 1
0,
exploring node 1...deadend...backtracking to 0

exploring node 0
Maze fully explored by dfs :-)



This clock is the Internet in a box

I recently bought a LaMetric Time.

What is it?

LaMetric Time is an Internet connected clock with a difference. I like to think of it as a smart watch in clock form. A smart watch for your desktop. It has just three buttons (forwards, backwards and 'action') and a cheerful LED display. Although it is a clock, it differs from your current wall or desk clock with one phrase: 'App store'.

The LED technology in the LaMetric Time defeats all ut my best attempts at capturing a good image on my cameras. See the links for better images. The display scrolls like those you see in airports or shops, or whilst waiting for your doctor's appointment. I can't stress enough how the display actually looks much better than shown in the image captured on my cheap Samsung camera above.

Setting up

Getting going with LaMetric is painless. You simply pair it with your Android device and point it at your WiFi connection. As with such devices there is a usually a software update, which it performed fairly quickly although there was no indication of how long this would take. Ultimately, it it not take long. The device picks up the correct time from time servers on the Internet and you are good to go.

LaMetric Time is a clock...durr!

As you would expect, the date and time are displayed in big bold chunky 8-bit-style characters. There are also apps for stop-clocks, calendars, timers, alarm clocks and count-downs. You can set LaMetric so that it displays just the time, or a single app, or you can have it cycle through all the apps. You can even customize for how long the apps display on screen.

One really nice feature is the sunset and sunrise time. I like having this information on my desktop. It also shows the number of hours of sunshine (important as we move from our vitamin-D deficient UK winter into the ever-so slightly brighter months of summer). You can also choose to show the moon phase, which keeps me happy, and could help avoid any unpleasant entanglements with werewolves. Again.

LaMetric Time is a Radio

Initially I was disappointed with the 5 preset radio stations my LaMetric came with. That was until I found the 'plus' button which lets you add from over 3000 Internet radio stations including those you also might expect to also get on FM radio. There is an audio-out socket at the back and I have mine hooked up to my stereo pre-amp. The sound quality is really rather good.

Message Board

This app turns your device into one of those scrolling display tickers you see in shop windows. If you feel like you need one of these in your life, then maybe you are a shop window, or you own one. I haven't found a use for this yet. I am not sure why I would want to display a scrolling message to myself, however I guess this app is for people you want the LaMetric to be a public-facing device.

The LaMetric companion app interface running on my Samsung GT-N5110. Just press the plus button for more apps!

All the other apps...

Although not supported quite as well as other smart products on the market, there is an app store full of all-sorts of stuff for you to personalise your desk clock. One of my favourites is the hugely pointless 'Coffee Counter', which tracks how many coffees have been consumed by LaMetric users (actually it keeps track of how many times someone has pressed the action button whilst using the app, but close enough). Somehow this helps you feel closer to other coffee drinkers.

The Asteroid Today app shows you how close we as a planet came to a collective inhalation today. Phew. Most of them miss.

Scrolling through the apps in the app store I can see dozens of apps both for productivity and entertainment: News headlines, motivational quotes, Facebook fan counters, Chuck Norris jokes, London Underground status and Weather to name just a few.

Furthermore you can connect your LaMetric time to other Internet of Things such as the Amazon Echo or Hue lights. Or you may just wish to use it to stream music from your phone through the Bluetooth speakers.

The really cool part.

LaMetric gets really interesting when you connect it to your IFTTT account. If you didn't know, IFTTT lets you connect all your favourite online services (well, perhaps not all of them, but more are arriving all the time).

With IFTTT you can create 'applets' or 'recipes'. Litterally, if this happens, then that should happen. There are two ways this can play with your LaMetric. This first is so you can receive notifications on your LaMetric in the form of a notification sound, icon and short message, and the other is through the IFTTT indicator app. This leaves a permanent message appearing on your device (until the next message appears). You can also use your LaMetric device as an IFTTT 'do' button, should you so desire.

I have found it most useful to receive notifications whenever new YouTube videos have been uploaded onto my favourite channels. I wouldn't want to miss the next Lindybeige.

I have other applets set up to inform me of new tweets, mentions or followers on Twitter and other social media including Yo. I get a notification whenever the International Space station passes overhead along with news and weather from Mars. I even have a notification telling me when my bedtime is (it was twenty minutes ago).

In fact, there really is no end to what you can do with your LaMetric once you have IFTTT working with it. I suggest you head over and buy one now. They really are an awesome tech toys.





Don't believe me? Perhaps this video from Techmoan will be of interest to you.



Or, perhaps you would listen to the Elders of the Internet?


That's all from me for today. +1 geek experience point for LaMetric Time (even though the calendar app does get the date format wrong!)

PS. If you enjoyed this post, then you might like my RSS news ticker for Raspberry Pi.

Label