Can you use RISC OS as your main computer?

The short answer is yes, sort of, but mostly yes.

The RISC OS desktop on Raspberry Pi showing the 'pinboard' and 'iconbar'

In my post on using the BBC Micro as your main computer, we decided that for a computer to be of any use, it must be able to do the following well:

  • Connect to the Internet and have a fast, secure browser.
  • Provide applications for workflow.
  • Provide applications for playing media files.

We'll look at these in turn, but first some information about this Operating System.

RISC OS was originally developed for the Acorn range of 32bit RISC computers in the late 1980s. That makes it older than 'Red Nose Day', GCSE examinations and the movie 'Die hard'. It was a time when plaid shirts were fashionable for men. If you turned on the radio you would suffer songs by Bros and Enya. Whereas you need not suffer Bros and plaid shirts anymore, RISC OS has continued to be developed to this day and is available for RISC architecture machines including the Raspberry Pi. In this post, I will be referring to RISC OS running on my Raspberry Pi 2.

This operating system is an advanced GUI-based operating system although many of its features will appear strange or unexpected to a modern user who has, perhaps, become habitually used to Windows or Linux. Nevertheless, despite its quirks, RISC OS is a joy to use. But can it be your main computer?

The Internet

The Raspberry Pi does indeed connect to The Internet, however, RISC OS will only support wired ethernet connections. The onboard wireless adapter will not work here.

Many of the applications for RISC OS are available through the online Pling store or the package manager. Some of these applications use network connections with little difficulty as you might expect from a modern OS. Sadly there are no applications for linking to your DropBox, OneDrive, Google or other cloud services. I use a second Raspberry Pi as a home file and web server and this serves files to the RISC Pi with ease.

The default web browser is NetSurf which is a little underdeveloped. Most modern web pages fail to render properly. JavaScript does not run and you can forget about Flash, other plugins and all your favourite browser extensions. It is possible to install a version of Firefox, however, it requires several dependencies that I am repeated failing to install properly. After a few hours of trying I have finally given in, but I may return to that at a later date.

My Blog as shown in NetSurf


Workflow

What your RISC machine can do here really depends on your workflow, however RISC OS is more capable than the BBC Micro so I shall cover some of the capabilities you might need.

For word processing, spreadsheets, text files and database work, RISC OS has a number of applications that are free (as in free pizza) to download from the Pling Store (or indeed, might even be bundled with your software distribution). Most notable applications are Fireworkz, PipeDream and StrongEd. It is worth noting that I don't do much word processing on the RISC machine, and none of these applications beat the Microsoft Office 365 suite on my Windows machine. Nevertheless, all of these applications are capable enough of being your workhorse. Fireworkz can open Rich Text Format files, so if you need to open your world domination plan from MS-Word, you may need to do some editing or conversion first.

Unless you are migrating thousands of files from Office 365 to RISC OS, you will find that your Raspberry Pi will be totally capable of most jobs here so I'm going to call it a 'pass'.

It is worth mentioning that I use my RISC machine to take and keep various notes. This can easily be achieved as an OS task. Simply hit CTRL+F12 to bring up a task window and type:

*build <filename>

Press ESC to finish.

A demo of Fireworkz as a spreadsheet program

If your workflow includes image editing or audio editing, then there are a number of applications available for you here, although nothing to beat your professional applications on your modern PC. Also, don't expect your favourite open source applications (GIMP, Audacity etc) to be available under RISC OS. That said, your RISC machine will perform this kind of workflow well, so it's another 'pass'.

It is highly likely that you will want to read a PDF document on your RISC machine. This is possible under the public domain PDF file viewer for RISC OS, however, I have noticed that it has failed to render some files that work perfectly well under Adobe and Edge on my Windows PC. Having said that, most documents have opened without problem on my Raspberry Pi, so we shall call this a 'pass'.

RISC OS PDF viewer showing a couple of PDF files displaying beautifully on my Raspberry Pi 2.

Media

I will skip to the end. It is a surprising 'pass'. In fact, I use RISC OS primarily as a media machine. The NetRadio application is perfectly capable of handling your internet radio needs, as well as being able to play MP3 format files. I think I once wrote a post about how I threw my DAB digital radio over the side of my ship after installing RISC OS.

Net Radio, perfectly capable of catching the BBC 4 puzzle for the day over your cornflakes as it is playing your pirate metal songs in the evening.
As for video files. I have managed to get MPG format files to work perfectly. Other formats with some difficulty or not at all.

My Pi


There are plenty of other applications available for RISC OS with many in active development. I generally have WeatherUK open at all times for my three-day forecast.

WeatherUK for your UK weather needs. Yes, it is snowing today, in March.

One of many useful apps for RISC OS
BASIC

One of the best features of RISC OS is that the BBC BASIC language is built right into the operating system. Whether you want the system to learn to program, so you want to write applications to get the computer to do what you want it to do, then BASIC is a good option. Simply press F12 and type:

BASIC

To exit the BASIC terminal and return to your desktop, type:

*DESKTOP

I have already covered BBC BASIC in RISC OS in another post, so I won't go into details here. You can also install a version of RISC OS (Pico) which boots directly into the BASIC prompt without any of the graphical 'fluff' discussed so far in this post.

Well, there it is. RISC OS will quite happily serve as a main computer based on the criteria we specified at the top of the page. If you haven't already explored it on your Raspberry Pi, then I thoroughly recommend it. You might find that you have other needs that I have not covered in this post, and you might also be equally surprised to discover that RISC OS has your back here as well.

If you enjoyed this post, and even if you haven't, then you might like (or hate) to read some more RISC articles on this blog. Maybe you just want to write a sticky note and pin it to a virtual board on the internet? Maybe you just want to kill some orcs?

Reacting to @ReactOS

I decided to have a play with ReactOS.

ReactOS is a free open-source operating system built from the ground up.  It is an attempt to be a legal, community-driven Windows replacement. The current version (0.4.7) is in Alpha, so don't expect everything to work as expected.

ReactOS desktop in Virtual Box looking very Windows NT-like

Getting started

First, you will need to download the ReactOS ISO file which you can get from the ReactOS website.

Secondly, you will want to run your copy of ReactOS in a virtual machine. I choose to use Virtual Box.

Please note that I could not get my version of ReactOS to connect to my home internet under Virtual Box, however, I downloaded one of the Nightly versions (0.4.9-dev) and this fixed the problem. Maybe it will for you too, but I recommend that you try one of the stable releases first.

First impressions

Yay! ReactOS looks and feels like an early version of Windows, somewhere around Windows-ME era but with modern OS features. One of the first things you will want to do is to install a browser. New applications can be installed from the built-in 'Applications Manager'.

Although I managed to get (an older version of) Firefox working, it often hangs the machine or crashes making it almost unworkable. I might try an alternative solution to this in the near future, but for now, it may influence whether I continue to with this experiment.

One of many problems I am having with Firefox under ReactOS. Incidentally, this is one of my favourite error messages. It is up there with 'silly' on the BBC micro (try AUTO 10,0 for that one) and the Amiga's Guru Meditation.

Another thing that I am having difficulty with is in creating new user accounts. The system wants me to log into the 'Administrator' account, and although it lets me create other user accounts, it does not give me the option of logging into them when the machine first starts. I guess that this feature has not yet been built yet.

Stuff that works

There are plenty of open-source apps available from the application manager that will allow your version of ReactOS to behave like a useful machine. I have tried the following with some success:

Python 3.4
Yup. Python works, look!


Notepad ++
Probably the best light-weight open-source text editor for general purpose computing.

Media
I've managed to get Audacity, VLC player and WinAmp running but not without problems with audio devices on the virtual machine. So that's the most important part of the software not working then...

Open Office
It is no surprise that there is an open-source office suite for ReactOS. I have tried most of this and found it to be working well.


Some old favourites
There are a few applications that come bundled with ReactOS, with most of them being no surprise: Calculator, Notepad, Wordpad and Paint being the most notable. Oh yes, and there's minesweeper and solitaire for the full retro experience.

I think that it is a shame that there is no 'card file', but then again, I don't think that was ever in the Windows NT OS, so my complaint is rather moot.

Final Remarks
Well, it has certainly been a fun experiment. Enough of this Alpha version of ReactOS works well enough to be useful and I will look forward to future developments.

If you have found this post interesting, then you might like to watch this video from 'explaining computers dot com'. It goes into much more detail about how to get started as well as some other trouble-shooting hints and a successful attempt to install an old version of Photoshop. +1 Geek Experience point awarded to Explaining Computers.




If you are staying with us, then you might like to read about installing Ubuntu on a virtual machine, or perhaps you are more interested in another Operating System instead.

Brute force Travelling Salesman Problem in Python

I did not make it into work today. A blanket of snow - dubbed the Pest from the West - hit the North of England causing gridlock in many areas. Instead, I got to stay at home and write a Travelling Salesman simulation in Python.

The Travelling Salesman Problem (TSP) is a problem in Computer Science used to demonstrate intractability and optimisation. In short, imagine a salesman who wishes to visit every one of N cities exactly once each. The salesman does not care which order he visits the cities as he is equally proficient in applying is selling skills in them all regardless. All that matters is that he takes the shortest route between them all before returning back to the start, where, presumably Alan Sugar is waiting in the boardroom to fire him if he has failed in this task.

The Python 3 code below will run a TSP simulation by attempting to solve the problem by brute force. This is, of course, the worst method for solving the problem, being factorial of N time complexity, but it is presented here in the hope that it is of some use to students.

A solution for 10 cities

The simulation in mid-animation

A solution for 9 cities

Here is a photo of me failing to complete the TSP for 2 cities. 
The Python code can be copied from below, or you can download it from my OneDrive. Enjoy!




# Travelling Salesman by Brute force
# superdecade games
# version 2.1
# 2018-03-08

import itertools
import turtle
import time
import math
import random

class Salesman(object):
	"""Travelling Salesman by Brute force"""
	# in this program a route is represented by a list of coordinates
	# where each coordinate is a tuple containing an x,y coordinate
	# in the range 0-1000,0-1000
	def __init__(self):
		self.__city = [] #list for holding city coords
		self.__num = 0 # number of cities in simulation
		self.__animate = False # True if should show animations
		self.__speed = 100 # Speed of animations 100 is fastest
		self.__wn = turtle.Screen() # turtle window
		turtle.setworldcoordinates(0, 0, 1000, 1000)
		self.__wn.title("TRAVELLING SALESMAN")
		self.__cityPen = turtle.Turtle() # pen for drawing cities
		self.__cityPen.shape("circle")
		self.__cityPen.hideturtle()
		self.__routePen = turtle.Turtle() # pen for drawing routes
		self.__routePen.pensize(5) 
		self.__route = [] # list of possible routes
		self.__bestRoute = None # current best route
		self.__bestLength = 1000000 # a big number	
	
	def main(self):
		"""Main test program"""
		self.__title()
		self.__setup()
		self.__generate()
		self.__showCities()
		try:
			self.__getRoutes()
			t0 = time.clock() # start tinmer
			for i in self.__route:
				thisLength = self.__calculateLength(i)
				if thisLength <= self.__bestLength:
					self.__bestLength = thisLength
					self.__bestRoute = i # store the best route so far
				if self.__animate:
					self.__showRoute(i)
					time.sleep(0.01)
					self.__routePen.clear()
			#show the best route
			print("\nDone. Showing best route")
			print(time.clock() - t0, "seconds")
			self.__showRoute(self.__bestRoute, "green")
			input()
			self.__cityPen.clear()
			self.__routePen.clear()
			self.__routePen.hideturtle()
			self.__cityPen.hideturtle()

		except Exception as e:
			print("Ooops, that was an error. Too many cities?")
				
	def __setup(self):
		"""Gets users choices for the simulation"""
		ok = False
		while not(ok):
			try:
				num = int(input("Enter number of cities: "))
				if num>1 and num < 11:
					self.__num = num
					ok = True
				else:
					print("Invalid!")
			except Exception as e:
				pass
		choice = input("Show animation for all? (Y/N): ")
		if choice.lower() in "yes":
			self.__animate = True
			ok = False
			while not(ok):
				try:
					speed = int(input("Select speed (1-10): "))
					if speed >= 0 and speed <= 10:
						self.__speed = speed ** 2
						ok = True
					else:
						print("Try again")
				except Exception as e:
					pass

	def __generate(self):
		"""Creates random cities"""
		for i in range(self.__num):
			x = random.randint(0,1000)
			y = random.randint(0,1000)
			self.__city.append((x,y))
	
	def __showCities(self):
		"""Display cities on the canvas"""
		self.__cityPen.speed(0)
		self.__cityPen.penup()
		for i in range(self.__num):
			self.__cityPen.goto(self.__city[i][0],self.__city[i][1])
			self.__cityPen.stamp()
	
	def __getRoutes(self):
		"""Find all combinations of routes"""
		trylist = list(itertools.permutations(self.__city))
		#remove duplicates
		for i in trylist:
			if i[0] == trylist[0][0]:
				self.__route.append(i)
	
	def __showRoute(self, this, color="red"):
		"""Show a route passed as paramter on the canvas"""
		self.__routePen.color(color)
		self.__routePen.speed(self.__speed)
		self.__routePen.penup()
		for i in this:
			self.__routePen.goto(i[0],i[1])
			self.__routePen.pendown()
		self.__routePen.goto(this[0][0],this[0][1])
			
	def __calculateLength(self, this):
		"""Returns the length of route 'this'"""
		d = 0
		for i in range(1,len(this)):
			d += math.sqrt( (this[i][0]-this[i-1][0])**2 + (this[i][1]-this[i-1][1])**2)
		return d			
	
	def __title(self):
		"""Displays the title"""
		print("Travelling Salesman Problem")
		print("      (by brute force)")
		


while True:
	app = Salesman()
	app.main()

Label