100% found this document useful (1 vote)
60 views

Coding User - Issue One March 2022

The document discusses what it takes to become a programmer, noting that the ability to think logically and understand basic mathematics are key, as programming involves solving problems, and that while specific skills are important, passion and a desire to learn are the most important qualities for aspiring programmers.

Uploaded by

Kurniawan Såkti
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
60 views

Coding User - Issue One March 2022

The document discusses what it takes to become a programmer, noting that the ability to think logically and understand basic mathematics are key, as programming involves solving problems, and that while specific skills are important, passion and a desire to learn are the most important qualities for aspiring programmers.

Uploaded by

Kurniawan Såkti
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 108

NEW THE ULTIMATE GEAR GUIDE!

%&%/#/&/"# &
 &#"//%%&""&"


# ./+*+(./'/%-$.

''+./,.    


   

""  
See inside
details
for
 





!

#%$

!!

   

    

.)(,/*-/-$./-(/-+/ .)(,/* -,/%/!,+ #)./-+(/-$!,


/'!'/*-/
),$/* ./+*+(. )' !),/),$/ -(. * ./,.*/..
  
  
 

 


 
   

঍঩়লস঺ত঱ষষলযনত঵঱ষলদলধন॰ষফবশবশষফন঳সথযবদতষবল঱঩ল঵়লসॲছবষফনহন঵়
বশশসনলস঵ষনতরল঩ন঻঳ন঵ষশথ঵ব঱পশ়লসষফনথনশষষব঳শ॰ষ঵বদমশত঱ধষসষল঵বতযশ
঩ল঵দ঵নতষব঱পদলধন॰঵নপত঵ধযনশশল঩়লস঵যনহনযল঩ন঻঳ন঵বন঱দনॲ
঍঱ষফবশ঩ব঵শষবশশসন঺নষতমনতযললমতষষফনহত঵বলসশযত঱পসতপনশ়লসদত঱সশন
ষলদলধনॲছফবদফল঱নবশ঵বপফষ঩ল঵়লসঃওস঵নতশ়ॱষলॱ঩লযযল঺ষসষল঵বতযশশফল঺
ফল঺ষলদলধনল঱হত঵বলসশ঳যতষ঩ল঵রশষলল॰শসদফতশঐব঱স঻॰ছব঱ধল঺শত঱ধ
খতশ঳থন঵঵়ঔবॲ঍঩বষ৅শত঳঳শত঱ধপনত঵়লস৅঵নযললমব঱প঩ল঵॰লস঵ব঱ॱধন঳ষফ
঵নহবন঺শফনয঳়লস঩ব঱ধষফনহন঵়থনশষ়লস঵রল঱ন়দত঱থস়ॲছনদলহন঵তযয
ষফনহন঵়থনশষল঩ষনদফতদ঵লশশতযযরতভল঵঳যতষ঩ল঵রশ॰শল়লস৅঵নথলস঱ধষল
঩ব঱ধশলরনষফব঱প়লসযবমনॲ঍ষ৅শতযযব঱ষফবশহন঵়঩ব঵শষবশশসনল঩ইলধব঱পঙশন঵ॲ
ইল঱ষন঱ষশ

ইল঱ষন঱ষশ

ॴॺ ইলধব঱পॱছফবদফঐত঱পসতপনবশখবপফষঊল঵ঝলসঃ ॵॺ ঍঱ষ঵লধসদব঱পই९९


ॴॼ Being a Programmer ॵॼ Why C++?
ॵॴ A Brief History of Coding ॶॴ C++ Facts & Figures
ॵॶ Choosing a Programming Language ॶॶ Equipment You Will Need
ॵॸ Creating a Coding Platform ॶॸ Structure of C++ Code
ॶॺ Did You Know?
ॶॼ ঍঱ষ঵লধসদব঱পঔ়ষফল঱
ॷॴ Why Python?
ॷॶ What Can You Do with Python?
ॷॸ Python in Numbers
ॷॺ Equipment You Will Need
ॷॼ Getting to Know Python
ॸॴ ইলধব঱পল঱ঐব঱স঻
ॸॶ Why Linux?
ॸॸ The Best Linux Distributions
ॸॺ Equipment You Will Need

4 | www.bdmpublications.com
ইল঱ষন঱ষশ

ॸॼ Creating a Linux Installer on Windows


ॹॴ Installing Linux on a PC
ॹॶ ইলধব঱প঺বষফছব঱ধল঺শॵॴআতষদফঊবযনশ
ॹॸ What is a Batch File?
ॹॺ Getting Started with Batch Files
ॹॼ Getting an Output
ॺॴ Did You Know?
ॺॶ Playing with Variables
ॺॸ Batch File Programming
ॺॺ Loops and Repetition
ॺॼ গষত঵ষব঱প঺বষফখতশ঳থন঵঵়ঔব
ॻॴ What Pi is Right For You?
ॻॶ Raspberry Pi in Numbers
ॻॸ Kit You Need and How to Set it Up
ॻॺ Set Up Raspberry Pi Using a Mac
ॻॼ Set Up Raspberry Pi Using a Windows PC
ॼॴ The Raspberry Pi Desktop - What You Need
ॼॶ Debian Buster with Raspberry Pi Desktop
ॼॸ ঘনদফখলস঱ধॱঙ঳
ॵॴॺ ঒ন঻ষ঍শশসন

www.bdmpublications.com | 5
Welcome, Future Coder

Everything you do online, every time


you power on your smart TV, whenever
you use your in-car GPS, use your phone,
play a game on a tablet, console or PC,
it’s all been coded by a group of people.
All these ones and zeros are developed
by those who have learned how to
code, and with this book you too can
learn how to get started on the road to
becoming a programmer.

We cover C++, Python, Linux, Windows


and the Raspberry Pi within these
SDJHV%XWƬUVWOHWoVEHJLQZLWKD
good foundation.

Being a Programmer
A Brief History of Coding
Choosing a Programming Language
Creating a Coding Platform

6 www.bdmpublications.com
Index

Coding - Which
Language is
Right For You?

www.bdmpublications.com 7
Welcome, Future Coder

Being a Programmer
Programmer, developer, coder, they’re all titles for the same occupation, someone who
creates code. What they’re creating the code for can be anything from a video game
to a critical element on board the International Space Station. How do you become a
programmer though?

8 www.bdmpublications.com
Being a Programmer

MORE THAN CODE


For those of you old enough to remember the ‘80s, the golden era of home
FRPSXWLQJWKHZRUOGRIFRPSXWLQJZDVDYHU\GLƪHUHQWVFHQHWRKRZLWLV
today. 8-bit computers that you could purchase as a whole, as opposed to
EHLQJLQNLWIRUPDQG\RXKDYLQJWRVROGHUWKHSDUWVWRJHWKHUZHUHWKHVWXƪ
of dreams; and getting your hands on one was sheer bliss contained within
a large plastic box. However, it wasn’t so much the new technology that
FRPSXWHUVWKHQRƪHUHGPRUHRYHULWZDVWKHIDFWWKDWIRUWKHƬUVWWLPH
ever, you could control what was being viewed on the ‘television’.

Instead of simply playing one of the thousands of games available at the


Times have changed since programming in the ‘80s, time, many users decided they wanted to create their own content, their
but the core values still remain. own games; or simply something that could help them with their homework
RUKRPHƬQDQFHV7KHVLPSOLFLW\RIWKHELWKRPHFRPSXWHUPHDQWWKDW

“It’s up to you
creating something from a few lines of BASIC code was achievable and so
WKHƬUVWJHQHUDWLRQRIKRPHEUHGSURJUDPPHUZDVERUQ

how far to take


From that point on, programming expanded exponentially. It wasn’t long
before the bedroom coder was a thing of the past and huge teams of
designers, coders, artists and musicians were involved in making a single

your coding
JDPH7KLVRIFRXUVHOHGWRWKHSURJUDPPHUEHFRPLQJPRUHWKDQVLPSO\
someone who could fashion a sprite on the screen and make it move at the
press of a key.

adventure!” Naturally, time has moved on and with it the technology that we use.
However, the fundamentals of programming remain the same; but what
exactly does it take to be a programmer?

7KHVLQJOHPRVWFRPPRQWUDLWRIDQ\SURJUDPPHUUHJDUGOHVVRIZKDW
they’re doing, is the ability to see a logical pattern. By this we mean
VRPHRQHZKRFDQORJLFDOO\IROORZVRPHWKLQJIURPVWDUWWRƬQLVKDQG
envisage the intended outcome. While you may not feel you’re such a
person, it is possible to train your brain into this way of thinking. Yes, it
takes time but once you start to think in this particular way you will be able
to construct and follow code.

Second to logic is an understanding of mathematics. You don’t have to be


at a genius level but you do need to understand the rudiments of maths.
Maths is all about being able to solve a problem and code mostly falls under
the umbrella of mathematics.

%HLQJDEOHWRVHHWKHELJSLFWXUHLVFHUWDLQO\EHQHƬFLDOIRUWKHPRGHUQ
programmer. Undoubtedly, as a programmer, you will be part of a team
of other programmers, and more than likely part of an even bigger team
RIGHVLJQHUVDOORIZKRPDUHFUHDWLQJDƬQDOSURGXFW:KLOH\RXPD\RQO\
EHH[SHFWHGWRFUHDWHDVPDOOHOHPHQWRIWKDWƬQDOSURGXFWEHLQJDEOHWR
understand what everyone else is doing will help you create something
that’s ultimately better than simply being locked in your own coding cubicle.

Finally, there’s also a level of creativity needed to be a good programmer.


Again though, you don’t need to be a creative genius, just have the
imagination to be able to see the end product and how the user will interact
with it.

7KHUHLVRIFRXUVHDORWPRUHLQYROYHGLQEHLQJDSURJUDPPHULQFOXGLQJ
learning the actual code itself. However, with time, patience and the
determination to learn, anyone can become a programmer. Whether
Being able to follow a logical pattern and you want to be part of a triple-A video game team or simply create an
see an end result is one of the most valued automated routine to make your computing life easier, it’s up to you how
skills of a programmer. far to take your coding adventure!

www.bdmpublications.com 9
Welcome, Future Coder

A Brief History of Coding


It’s easy to think that programming a machine to automate a process or calculate a value
LVDPRGHUQFRQFHSWWKDWoVRQO\UHDOO\KDSSHQHGLQWKHODVWƬIW\\HDUVRUVR+RZHYHU
that assumption is quite wrong, coding has actually been around for quite some time.

01000011 01101111 01100100 01100101


(VVHQWLDOO\DOOIRUPVRIFRGLQJDUHPDGHXSRIRQHVDQG]HURVRQRURƪVWDWHV7KLVZRUNVIRUDPRGHUQFRPSXWHU
and even the oldest known computational device.

~87 BC a$' 1800 Ǖ Ǖ

,WoVGLƯFXOWWRSLQSRLQWDQH[DFW
start of when humans began to
‘program’ a device. However,
it’s widely accepted that the
Antikythera Mechanism is possibly
Joseph Marie Jacquard invents a
WKHƬUVWnFRGHGoDUWHIDFW,WoV
programmable loom, which used cards with
dated to about 87 BC and is an
punched holes to create the textile design.
ancient Greek analogue computer
However, it is thought that he based his
and orrery used to predict
design on a previous automated weaving
astronomical positions.
process from 1725, by Basile Bouchon.

Ada Lovelace translated


the memoirs of the Italian
mathematician, Francis
Maneclang, regarding
Charles Babbage’s
Analytical Engine. She
made copious notes
within her writing,
detailing a method of
7KH%DQŅ0ŅVÜEURWKHUVWKUHH3HUVLDQ calculating Bernoulli
scholars who worked in the House of Numbers using the
Wisdom in Baghdad, published the HQJLQH7KLVLVUHFRJQLVHG
Book of Ingenious Devices in around DVWKHƬUVWFRPSXWHU
850 AD. Among the inventions listed program. Not bad,
was a mechanical musical instrument, considering there were
a hydro-powered organ that played no computers available at
interchangeable cylinders automatically. the time.

10 www.bdmpublications.com
A Brief History of Coding

During the Second World War, From the 1970s, the development of the likes of C, SQL, C with
WKHUHVLJQLƬFDQWDGYDQFHV &ODVVHV & 0$7/$%&RPPRQ/LVSDQGPRUHFDPHWRWKH
were made in programmable IRUH7KHnVZDVXQGRXEWHGO\WKHJROGHQDJHRIWKHKRPH
machines. Most notably, the computer, a time when silicon processors were cheap enough
cryptographic machines used IRURUGLQDU\IRONWREX\7KLVOHGWRDERRPLQKRPHEHGURRP
to decipher military codes coders with the rise of 8-bit machines.
XVHGE\WKH1D]LV7KH(QLJPD
was invented by the German
engineer Arthur Scherbius
but was made famous by Alan
7XULQJDW%OHWFKOH\3DUNoV
codebreaking centre.

Ǖ  Ǖ Ǖ 1990s-Present Day

Computer programming was


mainly utilised by universities,
the military and big
corporations during the ‘60s
and the ‘70s. A notable step
toward a more user-friendly,
or home user language, was
the development of BASIC
(Beginners All-purpose
Symbolic Instruction Code) in
the mid-sixties.

7KH,QWHUQHWDJHEURXJKWDZHDOWK
of new programming languages and
allowed people access to the tools and
knowledge needed to learn coding in a
better way. Not only could a user learn
how to code but they could freely share
their code and source other code to
improve their own.

7KHƬUVWWUXHFRPSXWHUFRGHZDV
Assembly Language (ASM) or
Regional Assembly Language. Admiral Grace Hopper was part of
$60ZDVVSHFLƬFWRWKH the team that developed the UNIVAC
architecture of the machine I computer and she eventually
it was being used on. In 1951 developed a compiler for it. In time,
programming languages fell under the compiler she developed became
the generic term Autocode. Soon COBOL (Common Business-oriented
ODQJXDJHVVXFKDV,3/)2575$1 Language), a computer language that’s
and ALGOL 58 were developed. still in use today.

www.bdmpublications.com 11
Welcome, Future Coder

Choosing a
Programming
Language
It would be impossible to properly
explain every programming language in
a single book of this size. New languages
and ways in which to ‘talk’ to a computer
or device and set it instructions are being
invented almost daily; and with the
onset of quantum computing, even more
complex methods are being born. Here
is a list of the more common languages
along with their key features.

12 www.bdmpublications.com
Choosing a Programming Language

SQL SQL stands for Structured Query Language. SQL is a standard language
for accessing and manipulating databases. Although SQL is an ANSI
$PHULFDQ1DWLRQDO6WDQGDUGV,QVWLWXWH VWDQGDUGWKHUHDUHGLƪHUHQWYHUVLRQVRI
the SQL language. However, to be compliant, they all support at least the major
commands such as Select, Update and Delete in a similar manner.

JAVASCRIPT JavaScript (often shortened to JS) is a lightweight,


LQWHUSUHWHGREMHFWRULHQWHGODQJXDJHZLWKƬUVWFODVV
functions. JavaScript runs on the client side of the web, that can be used to design
or program how the web pages behave on the occurrence of an event. JavaScript is
an easy to learn and also powerful scripting language, widely used for controlling
web page behaviour.

JAVA Java is the foundation for virtually every type of networked


application and is the global standard for developing enterprise
VRIWZDUHZHEEDVHGFRQWHQWJDPHVDQGPRELOHDSSV7KHWZRPDLQFRPSRQHQWV
of the Java platform are the Java Application Programming Interface (API) and the
Java Virtual Machine (JVM) that translates Java code into machine language.

C# C# is an elegant object-oriented language that enables developers to


EXLOGDYDULHW\RIVHFXUHDQGUREXVWDSSOLFDWLRQVWKDWUXQRQWKH1(7
Framework. You can use C# to create Windows client applications, XML Web services,
FOLHQWVHUYHUDSSOLFDWLRQVGDWDEDVHDSSOLFDWLRQVDQGPXFKPRUH7KHFXUO\EUDFH
syntax of C# will be instantly recognisable to anyone familiar with C, C++ or Java.

PYTHON Python is a widely used high level programming language used


for general purpose programming, created by Guido van
5RVVXPDQGƬUVWUHOHDVHGLQ$QLQWHUSUHWHGODQJXDJH3\WKRQKDVDGHVLJQ
philosophy that emphasises code readability and a syntax that allows programmers
WRH[SUHVVFRQFHSWVLQIHZHUOLQHVRIFRGH7KLVFDQPDNHLWHDVLHUIRUQHZ
programmers to learn.

C++ C++ (pronounced cee plus plus) is a general purpose programming


language. It has imperative, object-oriented and generic programming
features. It was designed with a bias toward system programming and embedded,
UHVRXUFHFRQVWUDLQHGDQGODUJHV\VWHPVZLWKSHUIRUPDQFHHƯFLHQF\DQGƮH[LELOLW\
of use as its design highlights.

RUBY Ruby is a language of careful balance. Its creator, Yukihiro “Matz”


Matsumoto, blended parts of his favourite languages (Perl, Smalltalk,
(LƪHO$GDDQG/LVS WRIRUPDQHZODQJXDJH)URPLWVUHOHDVHLQ5XE\KDV
GUDZQGHYRWHGFRGHUVZRUOGZLGH5XE\LVVHHQDVDƮH[LEOHODQJXDJHHVVHQWLDO
SDUWVRI5XE\FDQEHUHPRYHGRUUHGHƬQHGDWZLOO([LVWLQJSDUWVFDQEHDGGHGWR

PERL Perl is a general purpose programming language, used for a wide


range of tasks including system administration, web development,
network programming, GUI development and more. Its major features are that it’s
easy to use, supports both procedural and object-oriented (OO) programming, has
powerful built-in support for text processing and has one of the most impressive
collections of third-party modules.

SWIFT Swift is a powerful and intuitive programming language for macOS,


iOS, watchOS and tvOS. Writing Swift code is interactive and fun;
the syntax is concise yet expressive and Swift includes modern features that
developers love. Swift code is safe by design, yet also produces software that runs
lightning fast. A coding tutorial app, Swift Playgrounds, is available for the iPad.

www.bdmpublications.com 
Welcome, Future Coder

Creating a Coding
Platform
7KHWHUPn&RGLQJ3ODWIRUPoFDQVLJQLI\DW\SHRIKDUGZDUHRQZKLFK\RXFDQFRGH
a particular operating system, or even a custom environment that’s pre-built and
designed for easy game creation. In truth it’s quite a loose term, as a Coding Platform
can be a mixture of all of these ingredients, it’s simply down to which programming
language you intend to code in and what your end goals are.

Coding can be one of those experiences that sounds fantastic,


but is often confusing to tackle. After all, there’s a plethora
of languages to choose from, countless apps that will enable
\RXWRFRGHLQDVSHFLƬFRUUDQJHRIODQJXDJHVDQGDQHTXDOO\
huge amount of third-party software to consider. In addition, by
accessing the Internet, you will discover that there are countless
coding tutorials available for the language in which you’ve decided
you want to program, alongside even more examples of code. It’s
DOODOLWWOHWRRPXFKDWƬUVW

7KHWULFNLVWRVORZGRZQDQGWREHJLQZLWKQRWORRNWRRGHHSO\
into coding. Like all good projects, you need a solid foundation
on which to build your skillset and to have all the necessary tools
DYDLODEOHWRHQDEOH\RXWRFRPSOHWHWKHEDVLFVWHSV7KLVLVZKHUH
creating a coding platform comes in, as it will be your learning
IRXQGDWLRQZKLOH\RXEHJLQWRWDNH\RXUƬUVWWHQWDWLYHVWHSVLQWR
the wider world of coding.

HARDWARE SOFTWARE
Thankfully, coding at the In terms of software,
foundation level doesn’t most of the development
require specialist equipment, environments have the
or a top of the range, liquid tools that allow you to
hydrogen-cooled PC. If code, compile the code
you own a computer, no matter how basic, you can begin to and execute it, freely
learn how to code. Naturally, if the computer in question is a available to download and install. There are some specialist
&RPPRGRUHWKHQ\RXPD\KDYHVRPHGLƯFXOW\IROORZLQJD tools available that will cost, but at this level they’re not
modern language tutorial, but some of the best programmers necessary, so don’t be fooled into thinking you need to purchase
around today started on an 8-bit machine, so there’s hope yet. any extra software in order to start learning how to code.

You will need access to the Internet to download, install and 2YHUWLPH\RXPD\ƬQG\RXUVHOISURJUHVVLQJIURPWKH
update the coding development environment, alongside a mainstream development environment and using a collection
computer with Windows 10, macOS, or Linux, installed. You of your own, discovered, tools to write your code. It’s all
can use other operating systems, but these are the ‘big three’ personal preference in the end and as you become more
DQG\RXZLOOƬQGWKDWPRVWFRGHUHVRXUFHVDUHZULWWHQZLWK H[SHULHQFHG\RXZLOOVWDUWWRXVHGLƪHUHQWWRROVWRJHWWKH
one, or all, of these in mind. job done.

14 www.bdmpublications.com
Creating a Coding Platform

OPERATING SYSTEMS VIRTUAL MACHINES


Windows 10 is the most widely used operating system in the A virtual machine is a piece of software that allows you to install a
world, so it’s natural that the vast majority of coding tools are IXOO\ZRUNLQJRSHUDWLQJV\VWHPZLWKLQWKHFRQƬQHVRIWKHVRIWZDUH
written for Microsoft’s leading operating system. However, LWVHOI7KHLQVWDOOHG26ZLOODOORFDWHXVHUGHƬQHGUHVRXUFHVIURPWKH
don’t discount macOS and especially Linux. host computer, providing memory, hard drive space etc., as well as
sharing the host computer’s Internet connection.
macOS users enjoy an equal number of coding tools to their
:LQGRZVFRXQWHUSDUWV,QIDFW\RXZLOOSUREDEO\ƬQGWKDWD The advantage of a virtual machine is that you can work with
lot of professional coders use a Mac over a PC, simply because /LQX[IRUH[DPSOHZLWKRXWLWDƪHFWLQJ\RXUFXUUHQWO\LQVWDOOHG
of the fact that the Mac operating system is built on top of host OS. This means that you can have Windows 10 running and
Unix (the command-line OS that powers much of the world’s launch your virtual machine client, boot into Linux and use all
ƬOHV\VWHPVDQGVHUYHUV 7KLV8QL[OD\HUOHWV\RXWHVWSURJUDPV the functionality of Linux, while still being able to use Windows.
in almost any language without using a specialised IDE.

This, of course, makes it a fantastic coding platform, as you can


However, Linux is, by far and away, one of the most popular KDYHGLƪHUHQWLQVWDOODWLRQVRIRSHUDWLQJV\VWHPVUXQQLQJIURP
and important coding operating systems available. Not only WKHKRVWFRPSXWHUZKLOHXVLQJGLƪHUHQWFRGLQJODQJXDJHV
does it have a Unix-like backbone, it’s also free to download, You can test your code without fear of breaking your host OS
install and use and comes with most of the tools necessary to DQGLWoVHDV\WRUHWXUQWRDSUHYLRXVFRQƬJXUDWLRQZLWKRXWWKH
start learning how to code. Linux powers most of the servers need to reinstall everything again.
that make up the Internet. It’s used on nearly all of the top
VXSHUFRPSXWHUVDVZHOODVVSHFLƬFDOO\LQRUJDQLVDWLRQVVXFK Virtualisation is the key to most big companies now. You
as NASA, CERN and the military, it also forms the base of ZLOOSUREDEO\ƬQGUDWKHUWKDQKDYLQJDVLQJOHVHUYHUZLWKDQ
Android-powered devices, smart TVs and in-car systems. Linux, installation of Windows Server, for example, the IT team have
as a coding platform, is an excellent idea and it can be installed instead opted for a virtualised environment whereby each
LQVLGHDYLUWXDOPDFKLQHZLWKRXWHYHUDƪHFWLQJWKHLQVWDOODWLRQ Windows Server instance is a virtual machine running from
of Windows or macOS. several powerful machines. This cuts down on the number
of physical machines, allows the team to better manage
resources and enables them to deploy an entire server
dedicated to a particular task in a fraction of the time.

THE RASPBERRY PI
If you haven’t already heard of the Raspberry Pi, then we
YOUR OWN CODING PLATFORM
suggest you head over to www.raspberrypi.org and check Whichever method you choose, remember that your coding
it out. In short, the Raspberry Pi is a small, fully functional platform will probably change, as you gain experience
computer. It comes with its own customised, Linux- and favour one language over another. Don’t be
based operating system that’s pre-installed with afraid to experiment along the way, as
everything you need to start learning how to you will eventually create your
code in Python, C++, Scratch and more. own unique platform that
can handle all the code
Costing around £35, it’s incredibly you enter into it.
cheap and allows you to utilise
GLƪHUHQWKDUGZDUHLQ
the form of robotics and
electronics projects, as well
DVRƪHULQJDFRPSOHWHGHVNWRS
experience. Although not the most
powerful computing device in the world, the
Raspberry Pi has a lot going for it, especially in terms
of being one of the best coding platforms available.

www.bdmpublications.com 
Introducing C++

C++ is an amazing programming


language. Most of what you see in
front of you when you power up your
computer, regardless of whether
you’re using Windows, macOS or
Linux, is created using C++. Being able
to code in C++ will open a whole new
world for you, in terms of desirable
professional skills and the ability to
code amazing apps and games.

&LVDQHƯFLHQWDQGSRZHUIXO
language that’s used to develop
operating systems, applications,
games and much more. It’s used
in science, engineering, banking,
education, the space industry, and
much more.

Why C++?
C++ Facts & Figures
Equipment You Will Need
Structure of C++ Code
Did You Know?

16 www.bdmpublications.com
Index

Introducing
C++

www.bdmpublications.com 17
Introducing C++

Why C++?
C++ is one of the most popular programming languages available today. Originally
called C with Classes, the language was renamed to C++ in 1983. It’s an extension of
the original C language, and is a general purpose object-oriented (OOP) environment.

C EVERYTHING
Due to both the complexity of the language and its power and performance, C++ is often used to develop games, programs,
device drivers, and even entire operating systems.

Dating back to 1979, the start of the golden era of home using C++. For example, all of Adobe’s major applications, such as
computing, C++, or rather C with Classes, was the brainchild of 3KRWRVKRS,Q'HVLJQDQGVRRQDUHGHYHORSHGLQ&<RXZLOOƬQG
Danish computer scientist Bjarne Stroustrup, while working on that the browser you use to surf the Internet is written in C++, as
his Ph.D. thesis. Stroustrup’s plan was to further the original C ZHOODV:LQGRZV0LFURVRIW2ƯFHDQGWKHEDFNERQHWR*RRJOHoV
language, which had been widely used since the early seventies. search engine. Apple’s macOS is written largely in C++ (with some
RWKHUODQJXDJHVPL[HGLQGHSHQGLQJRQWKHIXQFWLRQ DQGWKHOLNHV
C++ proved to be popular among the developers of the 80s, since of NASA, SpaceX, and even CERN use C++ for various applications,
it was a much easier environment with which to get to grips, programs, controls, and umpteen other computing tasks.
and, more importantly, it was 99% compatible with the original C
language. This meant that, beyond the mainstream computing labs, As well as being an easier addition to the core C language, C++ is
regular people who didn’t have access to the mainframes and large DOVRH[WUHPHO\HƯFLHQWDQGSHUIRUPVZHOODFURVVWKHERDUG7KLV
computing data centres could use it. higher level of performance over other languages, such as Python,
BASIC and such, makes it an ideal development environment for
C++’s impact in the digital world is immense. Many of the programs, modern computing; hence the aforementioned companies using it
applications, games, and even operating systems are coded so widely.

C++ code is much faster than other


programming languages.

18 www.bdmpublications.com
Why C++?

Microsoft’s Visual Studio is a great, free


environment in which to learn C++.

C++ puts the developer in a much wider world of coding. By improvements to the engine, or when creating a new game, if
PDVWHULQJ&\RXZLOOƬQG\RXUVHOIEHLQJDEOHWRGHYHORSFRGHIRU the developers want to add something that the engine can’t do,
WKHOLNHVRI0LFURVRIW$SSOHDQGVRRQ*HQHUDOO\&GHYHORSHUV they will use C++ to create the new content or link between two
enjoy a higher salary than programmers of some other languages, GLƪHUHQWHQJLQHV7KHHQGUHVXOWRIFRXUVHLVDJDPHWKDWFRQWDLQV
and, due to its versatility, the C++ programmer can move between the latest graphical technology, while being seamlessly bound
MREVDQGFRPSDQLHVZLWKRXWWKHQHHGWRUHOHDUQDQ\WKLQJVSHFLƬF together with some pretty clever C++ coding.

You will discover, as you become a more advanced coder, that many *HWWLQJWRXVH&LVTXLWHHDV\DOO\RXQHHGLVWKHULJKWVHWRIWRROV
of the developers in various coding jobs around the world tend to in which to communicate with the computer in C++, and you can
use pre-designed development engines. For example, when creating start your journey. A C++ IDE is free of charge, even the immensely
games, the likes of Bethesda, the team behind Oblivion and Skyrim, powerful Visual Studio from Microsoft is freely available to
utilise a 3D game engine called The Creation Engine. This enables download and use. You can get into C++ from any operating system,
the team to quickly create animations, characters, items, terrains, be it macOS, Linux, Windows, or even mobile platforms.
rooms, and just about everything else you’d see in the game. The
HQJLQHLWVHOIKDVEHHQPRGLƬHGWRPDNHWKHPRVWRIWKHFXUUHQW So, to answer the question of Why C++, the answer is because it’s fast,
graphics card hardware, and computer or console processing HƯFLHQWDQGGHYHORSHGE\PRVWRIWKHDSSOLFDWLRQV\RXUHJXODUO\
power. These engines are mostly written in C++, and when making use. It’s cutting edge, and a fantastic language to have mastered.

Indeed, the operating system


you’re using is written in C++.

www.bdmpublications.com 19
Introducing C++
C++ Facts & Figures
C++ is one of the top
programming languages
in the industry. It’s quick,
powerful, and used by
nearly every major tech
and gaming company in
the world. Here’s some
interesting facts about
the rather wonderful C++.
C++ is
one of the
predominant
programming
languages for the
development of all
kinds of technical
NASA, CERN, and commercial
MICROSOFT, software.
ORACLE, PAYPAL,
LINKEDIN, AMAZON AND
THE MILITARY USE C++.

C++ IS USED FREQUENTLY C++ has


IN ANIMATION PROCESSES. LQƮXHQFHGRWKHU
programming
3D ANIMATION, languages, such as
MODELLING, C# and Java.
AND
SIMULATIONS
ALL UTILISE C++.

A lot of the
Linux operating
system is coded
using C++, therefore
you could say that most
of the world’s Internet
hosting servers are
available thanks to C++.

SUPERCOMPUTING USES C++ CODE More than 70% of all


TO CALCULATE VAST AMOUNTS OF trading is known as
High Frequency Trading
'$7$,1&/8',1*7+(1$6$Ǖ%$6(' (HFT), and the software
SUPERCOMPUTING FARM THAT RUNS responsible is written in
C++ to make use of its
SIMULATIONS OF THE UNIVERSE.
high speed.

20 www.bdmpublications.com
Sources: ITJobsWatch,
Google, Quora, Stack C++ Facts & Figures
Exchange, eduCBA,
6WDFN2YHUƮRZ
stackShare, The Xbox
AppDynamics operating system
uses C++ as its
backbone.

Gaming is one of the


biggest users of C++.
It handles the
Many database applications FRPSOH[LWLHVRI'JDPHV
are built using C++, such supports multiplayer Google Chrome, Mozilla’s
as MySQL, it’s also used options, and enables Firefox, and even Microsoft’s
by Wikipedia, Yahoo and intensive CPU and Edge web browsers are
YouTube. GPU hardware coded in C++.
functions.

90
THE
C++ is
used in computer
networking as the
main code behind the
th
Programmable Logic Most of Adobe’s
PERCENTILE SALARY stable of products
Controller, connecting )25$8.Ǖ%$6('& are developed
servers, processors, other DEVELOPER IS using C++.

£120,000
hardware, and
even robotics.

MRI scanning
machines and
:LQGRZV Computer Aided Design The Unreal 4 Engine,
XP, 7, 8.1 and 10, as well as all use C++ to help with which is coded in C++,
0LFURVRIW2ƯFHXVH& the enhanced imagery is used for hundreds
as the backbone programming produced by these of games, including
language of choice.
systems. Fortnite.

RADAR
PROCESSING
TECHNOLOGIES
USE C++, AS
WELL AS
ADVANCED
MISSILE
DETECTION
SYSTEMS.
FLIGHT CONTROL SYSTEMS IN
MODERN AIRCRAFT, INCLUDING
MILITARY AIRCRAFT, USE C++.

www.bdmpublications.com 21
Introducing C++

Equipment You
Will Need
You don’t need to invest a huge amount of money in order to learn C++, and you
don’t need an entire computing lab at your disposal either. Providing you have a fairly
modern computer, everything else is freely available.

C++ SETUPS
As most, if not all, operating systems have C++ at their code, it stands to reason that you can learn to program in C++ no
matter what OS you’re currently using.

COMPUTER
Unless you fancy writing out your C++ code by hand on a sheet of paper (which is
VRPHWKLQJPDQ\ROGHUFRGHUVXVHGWRGR WKHQDFRPSXWHULVDQDEVROXWHPXVWKDYH
component. PC users can have any recent Linux distro or Windows OS, Mac users the
latest macOS.

AN IDE
An IDE is used to enter and execute your C++ code. Many IDEs come with extensions
and plugins that help make it work better, or add an extra level of functionality.
Often, an IDE will provide enhancements depending on the core OS being used,
such as enhancements for Windows 10.

COMPILER
A compiler is a program that converts the C++ language into binary that the
computer can understand. While some IDEs come with a compiler built in, others
don’t. Code::Blocks is our favourite IDE that comes with a C++ compiler as part of the
package. More on this later.

TEXT EDITOR
Some programmers much prefer to use a text editor to assemble their C++ code
before running it through a compiler. Essentially, you can use any text editor to write
code, just save it with a .cpp extension. However, Notepad++ is one of the best code
text editors available.

INTERNET ACCESS
While it’s entirely possible to learn how to code on a computer that’s not attached
WRWKH,QWHUQHWLWoVH[WUDRUGLQDULO\GLƯFXOW<RXZLOOQHHGWRLQVWDOOWKHUHOHYDQW
software, keep it up to date, install any extras or extensions, and look for help when
coding. All of which require access to the Internet.

TIME AND PATIENCE


<RXoUHJRLQJWRQHHGWRVHWDVLGHVLJQLƬFDQWWLPHWRVSHQGRQOHDUQLQJKRZWRFRGH
in C++. Sadly, unless you’re a genius, it’s not going to happen overnight, or even in a
week. A good C++ coder has spent many years honing their craft, so be patient, start
small and keep learning.

22 www.bdmpublications.com
Equipment You Will Need

OS SPECIFIC NEEDS
C++ will work in any operating system; however, getting all the necessary pieces together can be confusing to a newcomer. Here’s
VRPH26VSHFLƬFVIRU&

LINUX WINDOWS
Linux users are lucky in that they already have a compiler and As we’ve mentioned previously, one good IDE is Microsoft’s
text editor built into their operating system. Any text editor Visual Studio. However, a better IDE and compiler is
will allow you to type out your C++ code, when it’s saved with Code::Blocks, which is kept regularly up to date with a new
a .cpp extension, use g++ to compile it. release twice yearly, or so. Otherwise, Windows users can
HQWHUWKHLUFRGHLQ1RWHSDGWKHQFRPSLOHLWZLWK0LQ*:s
which Code::Blocks uses.

RASPBERRY PI MAC
The Raspberry Pi’s operating Mac owners will need to
system is Raspbian, which is download and install Xcode,
Linux based. Therefore, you’re in order to compile their
able to write your code out C++ code natively. Other
using a text editor and then options for the macOS
compile it with g++, as you include Netbeans, Eclipse or
would in any other Linux distro. Code::Blocks. Note: the
latest Code::Blocks isn’t
available for Mac, due to a
lack of Mac developers.

www.bdmpublications.com 
Introducing C++

Structure of C++ Code


C++ is an amazing programming language to learn. If your dream is to become a games
designer, or work at the cutting edge of science or engineering technology, then being
able to code in C++ is a must. Remember, you’re never too old to learn how to code.

#INCLUDE <C++ IS ACE!>


As you learn the basics of programming, you will begin to understand the structure of a program. The commands may be
GLƪHUHQWEXW\RXZLOOVWDUWWRVHHKRZWKHFRGHZRUNV

C++ #INCLUDE
The structure of a C++ program
Danish student Bjarne can look complex, but once you
Stroustrup invented C++ in get familiar with it you’ll begin to
1979, as a part of his Ph.D. VHHKRZLWƮRZV(YHU\&FRGH
thesis. Initially C++ was called begins with a directive, #include
C with Classes, which added <>. The directive instructs the
features to the already popular pre-processor to include a
C programming language section of the standard C++
while making it a more code. For example: #include
user-friendly environment. <iostream> includes the
iostream header to support
Bjarne Stroustrup, inventor input/output operations.
of C++.

,170$,1Ǔǔ
LQWPDLQ LQLWLDWHVWKH
declaration of a function, which
is a group of code statements
under the name ‘main’. All
C++ code begins at the main
function, regardless of where
it lies within the main body of
the code.

BRACES
The open brace is
something that you may
not have come across
before, especially if
you’re used to other
coding languages. The
open brace indicates the
beginning of the main
function, and contains
all the code belonging to
that function.

24 www.bdmpublications.com
Structure of C++ Code

COMMENTS <<
Lines that begin with a double slash are comments. This means they The two chevrons used here are insertion operators. This means
won’t be executed in the code and are ignored by the compiler. Why that, whatever follows, the chevrons are to be inserted into the
are they there? Comments are designed to help you, or another std::cout statement. In this case, they are the words ‘Hello World’,
programmer looking at your code, explain what’s going on. There which are to be displayed on the screen when you compile and
are two types of comment: /* covers multiple line comments, // a execute the code.
single line.

STD OUTPUTS
In C++, STD means Standard. It’s a part of the Standard Namespace /HDGLQJRQ p+HOOR:RUOGq LVWKHSDUWWKDWZHZDQWWRDSSHDURQ
LQ&ZKLFKFRYHUVDQXPEHURIGLƪHUHQWVWDWHPHQWVDQG the screen when the code is executed. You can enter whatever you
commands. You can leave the std part out of a code, but it must be like, as long as it’s inside the quotation marks. The brackets aren’t
declared at the start with: using namespace std. needed, but some compilers insist on them. The \n part indicates a
new line is to be inserted.

COUT $1'ǜ
In this example we’re using cout, which is a part of the Standard Finally you will notice that lines within a function code block
1DPHVSDFHsKHQFHZK\LWoVWKHUHDV\RXoUHDVNLQJ&WRXVHLWIURP H[FHSWFRPPHQWV HQGZLWKDVHPLFRORQ7KLVPDUNVWKHHQGRI
that particular namespace. Cout means Character OUTput, which the statement, and all statements in C++ must have one at the end
displays, or prints, something to the screen. If we leave std:: out we or the compiler will fail to build the code. The very last line has the
have to declare it at the start of the code; as mentioned previously. closing brace to indicate the end of the main function.

www.bdmpublications.com 
অ঳লযযলॵॵ
঎সয়ॶॴষফॵॽॺॽবশ঵নরনরথন঵নধতশতষস঵঱ব঱প঳লব঱ষব঱ফসরত঱ফবশষল঵়॰঺ফন঱
রত঱মব঱ধ঩ব঵শষশষন঳঳নধল঱ষফনরলল঱ॲঘফনশল঩ষ঺ত঵নষফতষফনয঳নধষফনদ঵ন঺রতমন
ষফতষ঳বহলষতযহল়তপনধবধ঱৅ষনহন঱ন঻বশষতষষফনষবরনত঱ধফতধষলথনধনহনযল঳নধ঩঵লর
শদ঵তষদফॲঙশব঱পত঱ন঺রনষফলধল঩শষল঵ব঱প঳঵লপ঵তরশদতযযনধখল঳ন঑নরল঵়॰ষফন
ন঱পব঱নন঵শতষ঑঍ঘ঍঱শষ঵সরন঱ষতষবল঱ঐতথল঵তষল঵়঳ল঳সযতষনধষফনরনরল঵়঺বষফত
শ঳নদবতযহন঵শবল঱ল঩তশশনরথয়ॲ

঍঱দ঵নধবথয়॰ষফতষদলধনবশ঩঵ননয়তহতবযতথযনষলহবন঺ল঱ঋবষঌসথॲঙ঳যলতধনধথ়ত
঵নশনত঵দফন঵ব঱ॶॴॴॷ॰়লসদত঱হবন঺ষফনদলধনথ়হবশবষব঱প঺঺঺ॲপবষফসথॲদলরॳ
দফ঵বশযপত঵঵়ॳঅ঳লযযলॱॵॵॳॲঐললমলসষ঩ল঵দলধনশ঱ব঳঳নষশ॰শসদফতশআস঵঱ণআতথ়ণআস঵঱॰ব঱
঳ত঵ষবদসযত঵যব঱নॽॶॹ঺বষফষফনদলররন঱ষ৆ঋললধথ়নॲইলরনতপতব঱শলল঱ॲে

ঌতহনতযললমষফ঵লসপফ॰ত঱ধশনন঺ফতষনযশন়লসদত঱঩ব঱ধॲ

26 | www.bdmpublications.com
www.bdmpublications.com | 27
Introducing Python

Python is one of the most respected


and used programming languages
in the world. It’s designed to help
beginners get into code, but also has
some amazingly powerful features
that are utilised by data scientists and
engineers around the world.

You don’t need to look too far to


Python at work. It’s used throughout
the Internet, and helps drive some of
the biggest projects and companies in
a multitude of industries.

In this section, we will look at what


you will need to get started with
3\WKRQ7KHƬUVWVWHSVLQWRDQHZ
learning experience are always the
hardest, but we’re here to help.

Why Python?
What Can You Do with Python?
Python in Numbers
Equipment You Will Need
*HWWLQJWR.QRZ3\WKRQ

28 www.bdmpublications.com
Index

Introducing
Python

www.bdmpublications.com 29
Introducing Python

Why Python?
7KHUHDUHPDQ\GLƪHUHQWSURJUDPPLQJODQJXDJHVDYDLODEOHIRUWKHPRGHUQFRPSXWHU
and some still available for older 8 and 16-bit computers too. Some of these languages
DUHGHVLJQHGIRUVFLHQWLƬFZRUNRWKHUVIRUPRELOHSODWIRUPVDQGVXFK6RZK\FKRRVH
Python out of all the rest?

PYTHON POWER
Ever since the earliest home computers were available, enthusiasts, users and professionals have toiled away until the wee
hours, slaving over an overheating heap of circuitry to create something akin to magic.

These pioneers of programming carved their way into a new Regardless of whether you use an Android device, iOS device, PC,
frontier, forging small routines that enabled the letter ‘A’ to scroll 0DF/LQX[6PDUW79JDPHVFRQVROH03SOD\HU*36GHYLFHEXLOWLQ
across the screen. It may not sound terribly exciting to a generation to a car, set-top box or a thousand other connected and ‘smart’
WKDWoVXVHGWRXOWUDKLJKGHƬQLWLRQJUDSKLFVDQGRSHQZRUOGPXOWL appliances, behind them all is programming.
player online gaming. However, forty-something years ago it was
blindingly brilliant. All those aforementioned digital devices need instructions to tell
them what to do, and allow them to be interacted with. These
Naturally these bedroom coders helped form the foundations for instructions form the programming core of the device and that core
every piece of digital technology we use today. Some went on to can be built using a variety of programming languages.
become chief developers for top software companies, whereas
others pushed the available hardware to its limits and founded the 7KHODQJXDJHVLQXVHWRGD\GLƪHUGHSHQGLQJRQWKHVLWXDWLRQWKH
billion pound gaming empire that continually amazes us. platform, the device’s use and how the device will interact with its

 www.bdmpublications.com
Why Python?

environment or users. Operating systems, such as Windows, macOS Python was created over twenty six years ago and has evolved to
and such are usually a combination of C++, C#, assembly and some become an ideal beginner’s language for learning how to program a
IRUPRIYLVXDOEDVHGODQJXDJH*DPHVJHQHUDOO\XVH&ZKLOVWZHE computer. It’s perfect for the hobbyist, enthusiast, student, teacher
pages can use a plethora of available languages such as HTML, Java, and those who simply need to create their own unique interaction
Python and so on. between either themselves or a piece of external hardware and the
computer itself.
More general-purpose programming is used to create programs,
apps, software or whatever else you want to call them. They’re Python is free to download, install and use and is available for Linux,
widely used across all hardware platforms and suit virtually every Windows, macOS, MS-DOS, OS/2, BeOS, IBM i-series machines, and
conceivable application. Some operate faster than others and some HYHQ5,6&26,WKDVEHHQYRWHGRQHRIWKHWRSƬYHSURJUDPPLQJ
are easier to learn and use than others. Python is one such general- languages in the world and is continually evolving ahead of the
purpose language. hardware and Internet development curve.

Python is what’s known as a High-Level Language, in that it ‘talks’ So to answer the question: why Python? Simply put, it’s free, easy to
to the hardware and operating system using a variety of arrays, OHDUQH[FHSWLRQDOO\SRZHUIXOXQLYHUVDOO\DFFHSWHGHƪHFWLYHDQGD
variables, objects, arithmetic, subroutines, loops and countless superb learning and educational tool.
more interactions. Whilst it’s not as streamlined as a Low-Level
Language, which can deal directly with memory addresses, call
VWDFNVDQGUHJLVWHUVLWVEHQHƬWLVWKDWLWoVXQLYHUVDOO\DFFHVVLEOH
and easy to learn.

BASIC was once the starter language that early


8-bit home computer users learned.

Java is a powerful
language that’s used in
web pages, set-top boxes,
TVs and even cars.

Python is a more modern take on BASIC, it’s easy to learn


and makes for an ideal beginner’s programming language.

www.bdmpublications.com 
Introducing Python

What Can You Do


with Python?
Python is an open-source, object-oriented programming language that’s simple to
understand and write with, yet also powerful and extremely malleable. It’s these
characteristics that help make it such an important language to learn.

Python’s ability to create highly readable code, within a small set <RXoOOƬQGORWVRIH[DPSOHVRIWKLVZKHUH3\WKRQLVDFWLQJEHKLQG
of instructions, has a considerable impact on our modern digital WKHVFHQHV7KLVLVZK\LWoVVXFKDQLPSRUWDQWODQJXDJHWROHDUQ
ZRUOG)URPEHLQJDQLGHDOƬUVWSURJUDPPHUVoFKRLFHWKURXJKWR
EHLQJDEOHWRFUHDWHLQWHUDFWLYHVWRULHVDQGJDPHVIURPVFLHQWLƬF
DSSOLFDWLRQVWKURXJKWRDUWLƬFLDO,QWHOOLJHQFHDQGZHEEDVHG
applications, the only limit to Python is the imagination of the
person coding in it.

It’s Python’s malleable design that makes it an ideal language for


PDQ\GLƪHUHQWVLWXDWLRQVDQGUROHV(YHQFHUWDLQDVSHFWVRIWKH
FRGLQJZRUOGWKDWUHTXLUHPRUHHƯFLHQWFRGHVWLOOXVH3\WKRQ)RU
example, NASA utilises Python both as a stand-alone language
DQGDVDEULGJHEHWZHHQRWKHUSURJUDPPLQJODQJXDJHV7KLVZD\
NASA scientists and engineers are able to get to the data they
need without having to cross multiple language barriers; Python
ƬOOVWKHJDSVDQGSURYLGHVWKHPHDQVWRJHWWKHMREGRQH

BIG DATA
Big data is a buzzword you’re likely to have come across in the last couple of years.
Basically, it means extremely large data sets that are available for analysis to reveal
patterns, trends and interactions between humans, society and technology. Of course,
it’s not just limited to those areas, big data is currently being used in a variety of
industries, from social media to health and welfare, engineering to space exploration
and beyond.

Python plays a substantial role in the world of big data. It’s extensively used to analyse
KXJHFKXQNVRIWKHDYDLODEOHELJGDWDDQGH[WUDFWVSHFLƬFLQIRUPDWLRQEDVHGRQZKDW
WKHXVHUFRPSDQ\UHTXLUHVIURPWKHZHDOWKRIQXPEHUVSUHVHQW7KDQNVWRDQ
impressive set of data processing libraries, Python makes the act of getting to the data,
in amongst the numbers, that counts and presenting it in a fashion that’s readable and
useable for humans.

7KHUHDUHFRXQWOHVVOLEUDULHVDQGIUHHO\DYDLODEOHPRGXOHVWKDWHQDEOHIDVWVHFXUHDQG
more importantly, accurate processing of data from the likes of supercomputing clusters.
For example, CERN uses a custom Python module to help analyse the 600 million collisions
SHUVHFRQGWKDWWKH/DUJH+DGURQ&ROOLGHU /+& SURGXFHV$GLƪHUHQWODQJXDJHKDQGOHV
the raw data, but Python is present to help sift through the data so scientists can get to the
content they want without the need to learn a far more complex programming language.

 www.bdmpublications.com
What Can You Do with Python?

ARTIFICIAL INTELLIGENCE
$UWLƬFLDO,QWHOOLJHQFHDQ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WKHUWKLQJVWRDQDO\VH\RXUPXVLFDO
an extra on many of the high-ranking modern games.
KDELWVDQGRƪHUSOD\OLVWVEDVHGRQZKDW\RXoYH
OLVWHQHGWRLQWKHSDVW,WoVDOOFOHYHUVWXƪDQG
The main use of Python in gaming comes in the form of scripting,
PRYLQJIRUZDUG3\WKRQLVDWWKHIRUHIURQWRI
where a Python script can add customisations to the core game
WKHZD\WKH,QWHUQHWZLOOZRUNLQWKHIXWXUH
engine. Many map editors are Python compatible and you will also
come across it if you build any mods for games, such as The Sims.

$ORWRIWKHRQOLQH00253* 0DVVLYHO\0XOWLSOD\HU2QOLQH5ROH
3OD\LQJ*DPH JDPHVDYDLODEOHXWLOLVH3\WKRQDVDFRPSDQLRQ
WEB DEVELOPMENT language for the server-side elements. These include: code to
search for potential cheating, load balancing across the game’s
Web development has moved on considerably since the early servers, player skill matchmaking and to check whether the player’s
GD\VRI+70/VFULSWLQJLQDOLPLWHGWH[WHGLWRU7KHPDQ\ client-side game matches the server’s versions. There’s also a
frameworks and web management services available now Python module that can be included in a Minecraft server, enabling
means that building a page has become increasingly complex. the server admin to add blocks, send messages and automate a lot
of the background complexities of the game.
With Python, the web developer has the ability to create
dynamic and highly secure web apps, enabling interaction with
other web services and apps such as Instagram and Pinterest.
Python also allows the collection of data from other websites
and even apps built within other websites. PYTHON EVERYWHERE
As you can see, Python is quite a versatile
programming language. By learning Python,
you are creating a well-rounded skillset that’s
able to take you into the next generation of
computing, either professionally or simply
as a hobbyist.

Whatever route you decide to take on your


coding journey, you will do well to have
Python in your corner.

www.bdmpublications.com 
Introducing Python
Pytho
n cre
Ross ator G
um n uido
amed V
There’s a readi
ng sc P ython an
Pyth ripts afte
lot to like about on’s F from Mon r
lying t
Python, but don’t just Circu y
s.
take our word for it. Here are
VRPHDPD]LQJIDFWVDQGƬJXUHV
surrounding one of the most popular
programming languages of recent years.

Alexa, Amazon’s Virtual Data analysis and


Personal Assistant, uses Machine Learning are the
Python to help with two most used Python
speech recognition. examples.

in PYTHON AND
LINUX SKILLS
NUMBERS

As of the end of 2018,


ARE THE THIRD Disney Pixar uses Python
Python was the most MOST POPULAR in its Renderman software
discussed language on I.T. SKILLS IN to operate between other
the Internet. graphics packages.
THE UK.

29(52) 90% OF ALL IT’S ESTIMATED


RECOMMENDED FACEBOOK POSTS 7+$729(52)
CONTENT FROM NETFLIX ARE FILTERED NASA’S WORKFLOW
IS GENERATED FROM 7+528*+3<7+21Ǖ AUTOMATION
0$&+,1(/($51,1*ǟ CODED MACHINE SYSTEMS ON BOARD
CODED BY PYTHON. LEARNING. THE I.S.S. USE PYTHON.

 www.bdmpublications.com
Python in Numbers

16,000 3<7+216.,//Ǖ%$6('
POSITIONS ARE THE

There are over 16,000 Python jobs


posted every six months in the UK.
160267628*+7Ǖ$)7(5
JOBS IN THE UK.
th

Python Data Science is Google is the top Data Science, Blockchain New York and San
thought to become the company for hiring Python and Machine Learning Francisco are the top
most sought-after job in developers, closely are the fastest growing Python developer cities
the coming years. followed by Microsoft. Python coding skills. in the world.

Python developers enjoy an average salary of

£60,000

2)$//%(*,11(5 2)$//3<7+21 79% OF ALL 49% OF WINDOWS


CODERS START WITH DEVELOPERS USE PROGRAMMERS 10 DEVELOPERS
AND STILL USE, 3<7+21:+(5($6 USE PYTHON 86(3<7+21
PYTHON AS THEIR 67,//86(7+( REGULARLY, 21% USE AS THEIR MAIN
PRIMARY OR OUTDATED PYTHON 2 IT AS A SECONDARY PROGRAMMING
SECONDARY LANGUAGE. VERSION. LANGUAGE. LANGUAGE.

www.bdmpublications.com 
Introducing Python

Equipment You
Will Need
<RXFDQOHDUQ3\WKRQZLWKYHU\OLWWOHKDUGZDUHRULQLWLDOƬQDQFLDOLQYHVWPHQW<RX
don’t need an incredibly powerful computer and any software that’s required is
IUHHO\{DYDLODEOH

WHAT WE’RE USING


Thankfully, Python is a multi-platform programming language available for Windows, macOS, Linux, Raspberry Pi and more. If
you have one of those systems, then you can easily start using Python.

COMPUTER
Obviously you’re going to need a computer in order to learn how to program in
3\WKRQDQGWRWHVW\RXUFRGH<RXFDQXVH:LQGRZV IURP;3RQZDUG RQHLWKHUD
or 64-bit processor, an Apple Mac or Linux installed PC.

AN IDE
$Q,'( ,QWHJUDWHG'HYHORSHU(QYLURQPHQW LVXVHGWRHQWHUDQGH[HFXWH3\WKRQ
code. It enables you to inspect your program code and the values within the code, as
ZHOODVRƪHULQJDGYDQFHGIHDWXUHV7KHUHDUHPDQ\GLƪHUHQW,'(VDYDLODEOHVRƬQG
the one that works for you and gives the best results.

PYTHON SOFTWARE
macOS and Linux already come with Python preinstalled as part of the operating
system, as does the Raspberry Pi. However, you need to ensure that you’re running
the latest version of Python. Windows users need to download and install Python,
which we’ll cover shortly.

TEXT EDITOR
Whilst a text editor is an ideal environment to enter code into, it’s not an absolute
necessity. You can enter and execute code directly from the IDLE but a text editor,
VXFKDV6XEOLPH7H[WRU1RWHSDGRƪHUVPRUHDGYDQFHGIHDWXUHVDQGFRORXUFRGLQJ
when entering code.

INTERNET ACCESS
Python is an ever evolving environment and as such new versions often introduce
new concepts or change existing commands and code structure to make it a more
HƯFLHQWODQJXDJH+DYLQJDFFHVVWRWKH,QWHUQHWZLOONHHS\RXXSWRGDWHKHOS\RX
out when you get stuck and give access to Python’s immense number of modules.

TIME AND PATIENCE


Despite what other books may lead you to believe, you won’t become a programmer
in 24-hours. Learning to code in Python takes time, and patience. You may become
VWXFNDWWLPHVDQGRWKHUWLPHVWKHFRGHZLOOƮRZOLNHZDWHU8QGHUVWDQG\RXoUHOHDUQLQJ
something entirely new, and you will get there.

 www.bdmpublications.com
Equipment You Will Need

THE RASPBERRY PI
:K\XVHD5DVSEHUU\3L"7KH5DVSEHUU\3LLVDWLQ\FRPSXWHUWKDWoVYHU\FKHDSWRSXUFKDVHEXWRƪHUVWKHXVHUDIDQWDVWLFOHDUQLQJ
platform. Its main operating system, Raspbian, comes preinstalled with the latest Python along with many modules and extras.

RASPBERRY PI
The Raspberry Pi 4 Model B is the latest version,
LQFRUSRUDWLQJDPRUHSRZHUIXO&38DFKRLFHRI*%
*%RU*%PHPRU\YHUVLRQVDQG:L)LDQG%OXHWRRWK
support. You can pick up a Pi from around £34, increasing
XSWR~IRUWKH*%PHPRU\YHUVLRQRUDVDSDUWRINLW
for £50+, depending on the kit you’re interested in.

FUZE PROJECT
The FUZE is a learning environment built on the latest model
of the Raspberry Pi. You can purchase the workstations that
come with an electronics kit and even a robot arm for you
WREXLOGDQGSURJUDP<RXFDQƬQGPRUHLQIRUPDWLRQRQWKH
FUZE at www.fuze.co.uk.

BOOKS
We have several great Raspberry Pi titles available via www.
bdmpublications.com. Our Pi books cover how to buy your
ƬUVW5DVSEHUU\3LVHWLWXSDQGXVH
RASPBIAN it; there are some great step-
by-step project examples and
guides to get the most from the
The Raspberry Pi’s main operating system is a Debian-based
Raspberry Pi too.
Linux distribution that comes with everything you need in
a simple to use package. It’s streamlined for the Pi and is an
ideal platform for hardware and software projects, Python
programming and even as a desktop computer.

www.bdmpublications.com 
Introducing Python

*HWWLQJWR.QRZ3\WKRQ
Python is one of the most used and popular programming languages. It’s a great
language on which to learn how to code, but it’s also powerful enough to be used by
companies when trawling through petabytes of raw data.

PYTHON POWER
Python is a high-level, general-purpose programming language that was designed by Guido van Rossum in the late ‘80s, as a
successor to the ABC Programming Language, and became available to use in 1990.

Guido van Rossum, the


designer of Python.

7KH3\WKRQ6RIWZDUH)RXQGDWLRQDQRQSURƬWRUJDQLVDWLRQGHYRWHG 0DGHXSIURPRYHU3HWDE\WHVRIGDWDVSUHDGDFURVVD
to both furthering and improving Python, currently develops the WRQRIKDUGGULYHV3\WKRQKHOSHGVFLHQFHWRXQYHLOWKHƬUVW
ODQJXDJH7KHIRXQGDWLRQoVSXUSRVHLVWRpSURPRWHSURWHFWDQG image of a black hole.
advance the Python programming language, and to support and
facilitate the growth of a diverse and international community of
Python programmers.” As a side note, it’s not just the likes of the Stock Exchange that
XVH3\WKRQWRVWXG\ODUJHTXDQWLWLHVRIGDWDLQ$SULOWKHƬUVW
7KHVWUXFWXUHRI3\WKRQFRGHKDVEHHQGHVLJQHGWRƮRZHDVLO\ image of a black hole was released, the supermassive black hole in
allowing those who are just beginning to code to follow it without the galaxy called M87, located roughly 55 million light years away.
WRRPXFKGLƯFXOW\<HWGHVSLWHLWVHDVHRIXVH3\WKRQLVUHJXODUO\ 7KDQNVWRWKHFROODERUDWLRQRIRYHUVFLHQWLVWVXVLQJDQDUUD\RI
used throughout a number of industries in real-world scenarios. WHOHVFRSHVVSDQQLQJWKHZRUOG FDOOHGWKH(YHQW+RUL]RQ7HOHVFRSH
Project), the combined power of the telescopes formed an
Big Data and AI are the two fastest growing Python-backed LPSUHVVLYHƬYHSHWDE\WHVRIGDWDVSUHDGDFURVVWHQVRIKDUGGULYHV
technologies at the moment. Big Data is simply a modern term weighing in at nearly one ton. Five petabytes, by the way, equates
used to describe huge WRDURXQG\HDUVoZRUWKRI03ƬOHV2QFHDOOWKRVHKDUGGULYHV
amounts of data, were gathered together and shipped to a central supercomputer
such as sequences cluster, the team then used Python to painstakingly stitch together
of numbers collated DOOWKHIUDJPHQWVRIGDWDIURPWKHƬYHSHWDE\WHVWRƬQDOO\IRUPWKH
during a day’s worth of most talked about astronomic event of the decade.
trading on the Stock
Exchange. Python $,LI\RXoUHQRWIDPLOLDUZLWKWKHWHUPVWDQGVIRU$UWLƬFLDO
code is used to dig ,QWHOOLJHQFH$OWKRXJKZHoUHVWLOODORQJZD\RƪIURPWKHYLVLRQDU\
into the voluminous stories of Arthur C. Clarke, AI is fast becoming one of the most
collection of numbers, LQƮXHQWLDOWHFKQRORJLHVRIRXUPRGHUQDJH5DWKHUWKDQFRQWUROOLQJ
and then feed back robots, the AI that Python drives is designed to create autonomous
with reports on the ways of interacting with people online. For example, when you
Python code is both elegant and highs and lows, what’s search for something on the Amazon website you will usually notice
easy to read (when you know how). trending, and so on. that similar products start to appear, whether within Amazon itself,

 www.bdmpublications.com
Getting to Know Python

3<7+21963<7+21
In a typical computing scenario, Python is complicated somewhat by the existence of two active versions of the language:
3\WKRQDQG3\WKRQ

You need to be careful when you look up Python code online, although
WKHUHDUHFRXQWOHVVZHEVLWHVWKDWRƪHUTXLFNWXWRULDOVFRGHVQLSSHWV
and support – and 99% of these site are a great help to those starting
out with Python – a lot of the sites haven’t been updated for some
time, and as such use Python 2. If you enter Python 2 code into the
Python 3 IDLE, the chances are it won’t work due to incompatibilities
between the older version and the newer. Python 2 is good, but
Python 3 is better. You can obviously spend time converting the
Python 2 code into version 3, but, to begin with, it’s best to make sure
that the code you’re looking at is for the Python 3 libraries. Don’t
3\WKRQLVWKHEHVWRSWLRQWR
worry, though, all the code in this book is designed for Python 3, and
download, or update to.
that includes all the sub versions from Python 3.1 to the latest 3.x.
Python 3 is the newest release of the programming language.
However, if you dig a little deeper into the Python site and investigate Python 3’s growing popularity has meant that it’s now prudent to start
Python code online, you will undoubtedly come across Python 2. learning to develop with the new features and begin to phase out the
Crucially, although you can run Python 3 and Python 2 alongside previous version. Many development companies, such as SpaceX and
each other, it’s not recommended. Always opt for the latest stable NASA, use Python 3 for snippets of important code.
UHOHDVHDVSRVWHGE\WKH3\WKRQZHEVLWH<RXZLOOƬQGZKHQXVLQJ
PDF26RU/LQX[WKDW3\WKRQLVDOUHDG\LQVWDOOHG7KLVLVEHFDXVH However, support for Python 2 is set to end on January 1st 2020, but
both these operating systems utilise elements of code necessary to this doesn’t mean it’ll be the last you see of it. Many Linux distros use
WKHFRUHIXQFWLRQDOLW\RIWKH26/LQX[XVHUVWHQGWREHEHWWHURƪ Python 2 libraries, as does macOS, and to be fair, for the developers
as most distributions package the latest version of Python 3 out-of- to transfer the existing Python 2 content to Python 3 may take more
the-box, whereas macOS often has Python 3, it’s usually an older time than they have available, i.e. before the start of 2020. It’s likely
version. Microsoft doesn’t use any Python code for its core Windows WKHQWKDWZHZLOOVWLOOEHVHHLQJ3\WKRQORQJDIWHULWKDVKDGWKHƬQDO
V\VWHPVZKLFKLVZK\\RXZRQoWƬQG3\WKRQLQKHUHQWWR:LQGRZVDQG QDLOKDPPHUHGLQWRLWVFRƯQsLQIDFWH[SHFWWRVHHWKDWFXWRƪGDWH
therefore need to install it from scratch. extend further into the future.

RUIURPDVHDUFKHQJLQHRUHYHQ)DFHERRN7KHFRGHEHKLQG
these targeted snippets is Python, and it’s using a form of AI to
help determine what it is you would likely search for. ZEN OF PYTHON
'HVSLWHWKHIDFWWKDWPDQ\SHRSOHƬQGWKHWDUJHWLQJRI Python lets you access
advertising intrusive, or even an invasion of privacy, you have to all the power of a
admit that the code technology behind it all is rather impressive. computer in a language
With some very clever techniques, a Python developer is able that humans can
to create a machine thinking script that not only displays items, understand. Behind all
news stories, books, other websites and ideas relating to what this is an ethos called
you’ve searched for, but it can also predict what you may be “The Zen of Python”.
interested in looking for in the future. Another element to This is a collection of 20
consider, with regards to AI, is that Python code can be used to software principles that
KHOSDFRPSXWHUOHDUQKRZWRGRVRPHWKLQJPRUHHƯFLHQWO\,Q LQƮXHQFHVWKHGHVLJQRI
the case of neural networks in AI, the Python code is designed the language. Principles The Zen of Python, as
to return a result, then, as the code is run over and over again, include “Beautiful is seen when entering:
the AI portion will begin to learn how to obtain a more accurate better than ugly” and import this, into the
result, or do the maths behind the code quicker. It all depends on “Simple is better than Python IDLE.
what the developer wants from their AI Python code. complex.” Type: import
this into Python and it will display all the principles.
An example of Python AI code, using a
As you will discover over the coming pages, Python is a
feedforward neural network.
fantastic language to learn. Get to grips with the basics, and
before long, you’ll be creating your own Python code for
games, tools, and maybe even something in AI. The only limit
with Python is your own imagination.

www.bdmpublications.com 
Coding on Linux

Linux is such a versatile operating


system that’s both malleable
DQGSRZHUIXOZKLOHRƪHULQJWKH
programmer a perfect foundation on
which to build their skills. While all the
popular and mainstream programming
languages are available on Linux, as
they are on Windows and macOS,
Linux also utilises its own coding
language, called scripting.

In this section we’ll cover the basics,


from which distribution to go with, to
installing Linux on your computer.

Why Linux?
The Best Linux Distributions
Equipment You Will Need
Creating a Linux Installer on Windows
Installing Linux on a PC

40 www.bdmpublications.com
Index

Coding
on Linux

www.bdmpublications.com 41
Coding on Linux

Why Linux?
For many of its users, Linux means freedom. Freedom from the walled-gardened
approach of other operating systems, freedom to change and use the OS as you please
DQGIUHHGRPIURPDQ\IRUPRIOLFHQVLQJRUSD\PHQW7KHUHoVDORWPRUHWR/LQX[WKDQ
you may think.

FREE AND OPEN


/LQX[LVDIDQWDVWLFƬWIRUWKRVHZKRZDQWVRPHWKLQJGLƪHUHQWWKHHƯFLHQF\RIWKHV\VWHPWKHDYDLODELOLW\RIDSSOLFDWLRQVDQG
its stability, are just a few reasons why.

7KHƬUVWWKLQJZHQHHGWRDGGUHVVLVWKDWWKHUHLVQREDVLFRSHUDWLQJ /LQX[ZRUNVYHU\GLƪHUHQWO\WR:LQGRZVRUPDF26)RUDVWDUWLWoV
system called Linux. Fundamentally, Linux is the operating system free to download, free to install on as many computers as you like,
kernel, the core component of an OS. When talking about Linux we free to use for an unlimited amount of time and free to upgrade
are, in fact, referring to one of the many distributions, or distros, and extend with equally free programs and applications. This free to
that use the Linux kernel. No doubt you’ve heard of at least one of use element is one of the biggest draws for the developer. While a
the current popular distros: Ubuntu, Linux Mint, Fedora, openSUSE, Windows license can cost up to £100 and a Mac considerably more,
'HELDQ5DVSELDQfWKHOLVWJRHVRQ(DFKRQHRIWKHVHGLVWURVRƪHUV a user, be they a developer, gamer, or someone who wants to put an
WKHXVHUVRPHWKLQJDOLWWOHGLƪHUHQW:KLOHHDFKKDVWKH/LQX[NHUQHODW older computer to use, can quickly download a distro and get to work
LWVFRUHWKH\RƪHUDGLƪHUHQWORRNLQJGHVNWRSHQYLURQPHQWGLƪHUHQW in a matter of minutes.
SUHORDGHGDSSOLFDWLRQVGLƪHUHQWZD\VLQZKLFKWRXSGDWHWKHV\VWHP
DQGJHWPRUHDSSVLQVWDOOHGDQGDVOLJKWO\GLƪHUHQWORRNDQGIHHO Alongside the free to use aspect comes a level of freedom to customise
throughout the entire system. However, at the centre lies Linux, which and mould the system to your own uses. Each of the distros available on
is why we say, Linux. WKH,QWHUQHWKDYHDFHUWDLQnVSLQoVRPHRƪHULQFUHDVHGVHFXULW\DIDQF\

Linux is a great operating system in


which to start coding.

42 www.bdmpublications.com
Why Linux?

ORRNLQJGHVNWRSDJDPLQJVSHFLƬFVSLQRUVRPHWKLQJGLUHFWHGWRZDUG
students. This extensibility makes Linux a more desirable platform to
use, as you can quickly mould the system into a development base,
LQFOXGLQJPDQ\GLƪHUHQWNLQGVRI,'(VIRUXVHZLWK3\WKRQZHE
development, C++, Java and so on, or even a base for online anonymity,
perhaps as a Minecraft server, media centre and much more.

Another remarkable advantage for those looking to learn how to code


is that Linux comes with most of the popular coding environments
built-in. Both Python and C++ are pre-installed in a high percentage of
Linux distros, which means you can start to program almost as soon as
\RXLQVWDOOWKHV\VWHPDQGERRWLWXSIRUWKHƬUVWWLPH

*HQHUDOO\VSHDNLQJ/LQX[GRHVQoWWDNHXSDVPDQ\V\VWHPUHVRXUFHV
as Windows or macOS, (by system resources, we mean memory,
(DFKGLVWURRƪHUVVRPHWKLQJXQLTXHWRWKH
KDUGGULYHVSDFHDQG&38ORDG DVWKH/LQX[FRGHKDVEHHQ
user but all have Linux at the core.
streamlined and is free from third-party ‘bloatware’, which hogs
WKRVHV\VWHPVUHVRXUFHV$PRUHHƯFLHQWV\VWHPPHDQVPRUH
available resources for the coding and testing environment and the So rather than throwing away an old computer, it can be reused with
programs you will eventually create. Less resource use also means a Linux distro.
you can use Linux on older hardware that would normally struggle,
or even refuse to run, the latest versions of Windows or macOS. However, it’s not all about C++, Python, or any of the other more
popular programming languages. Using the command line of Linux
DOVRFDOOHGWKH7HUPLQDO \RXoUHDEOHWRFUHDWH6KHOOVFULSWVZKLFKDUH
programs made up of scripting languages and designed to run from
WKHFRPPDQGOLQH7KH\DUHXVHGPDLQO\WRDXWRPDWHWDVNVRURƪHUWKH
user some form of input and output for a certain operation.

There are many more advantages we could list, for example, there
are thousands and thousands of free programs and apps available
that cover practically every aspect of computing. Known as packages,
WKHUHDUH DWWKHWLPHRIZULWLQJ RYHUVSHFLƬFSURJUDPPLQJ
applications on Linux Mint alone and an incredible 62,000+ overall
packages, catering from Amateur Radio to WWW tools.

In conclusion, Linux is a great resource and environment in which


to program. It’s perfectly suited for developers, while continually
improving and evolving. If you’re serious about getting into coding, or
There are thousands of free packages
you just want to explore something new, then give Linux a try and see
available for programmers under Linux.
how it works for you.

A Linux programming environment can be


as simple or as complex as you need it to be.

www.bdmpublications.com 
Coding on Linux

The Best Linux


Distributions
7KHUHDUHQXPHURXVYHUVLRQVRI/LQX[DYDLODEOHNQRZQDVp'LVWULEXWLRQVq(DFKKDVD
GLƪHUHQWHWKRVDQGDSSURDFK+HUHDUHƬYHJUHDWGLVWULEXWLRQVWRWU\DQGZKHUH\RX
can get them.

/,18;0,17ǟ/,18;0,17&20
By far the most popular Linux distro (distribution) is Linux Mint. In fact, it’s recommended that you spend at least some time trying
Mint began life back in 2006, as an alternative to the then, most GLƪHUHQWHQYLURQPHQWVDQGHYHQGLƪHUHQWGLVWURVWRVHHZKLFK
SRSXODUGLVWUR8EXQWX$OWKRXJKEDVHGRQ8EXQWXoV/RQJ7HUP suits you and your computer best.
6XSSRUWEXLOG/LQX[0LQWWRRNDGLƪHUHQWGLUHFWLRQWRRƪHUWKH
user a better overall experience.

Linux Mint has three main desktop versions available with each
QHZYHUVLRQRIWKHFRUH26LWUHOHDVHV7KLVPD\VRXQGFRQIXVLQJ
DWƬUVWEXWLWoVTXLWHVLPSOH&XUUHQWO\/LQX[0LQWXVHVWKH
&LQQDPRQ'HVNWRS(QYLURQPHQWDVLWVƮDJVKLSPRGHODOWKRXJK
0$7(DQG;IFHPRGHOVDUHDOVRDYDLODEOH

&LQQDPRQLVDJUDSKLFDOO\ULFKGHVNWRSHQYLURQPHQWZKLOH0$7(
uses less fancy graphics but is more stable on a wider variety of
GHVNWRSV\VWHPVDQGƬQDOO\;IFHLVDQH[WUHPHO\VWUHDPOLQHG
desktop environment that is built for speed and ultimate stability.

7KURXJKRXWWKLVWLWOHZHoOOEHXVLQJWKH&LQQDPRQYHUVLRQ
however, you can try out any of the other desktop environments.

8%8178ǟ8%8178&20
7KHVHFRQGPRVWSRSXODUGLVWURDYDLODEOHLV8EXQWXDQDQFLHQW
African word meaning ‘humanity to others’. Ubuntu’s popularity
KDVƮXFWXDWHGRYHULWVIRXUWHHQ\HDUOLIH$WRQHWLPHLWZDV
easily the most used, Linux-based operating system in the
world, sadly, some wrong choices along the way with regards
to its presentation, along with some unfavourable and
controversial elements involving privacy, saw it topple from the
number one spot. and it’s a little heavy on system resources (especially if you plan
to install it on an older computer).
7KDWVDLG8EXQWXKDVVLQFHPDGHDPHQGVDQGLVVORZLQJFUDZOLQJ
LWVZD\EDFNXSWKH/LQX[OHDGHUERDUG7KHODWHVWYHUVLRQVRI Ubuntu, for all its faults, is a good Linux distro to start
the OS use the GNOME 3 desktop environment, it’s impressive experimenting with. It’s a clean interface, easy to use and install
although it can be a little confusing for former Windows users DQGRƪHUVWKHXVHUWKHFRPSOHWH/LQX[H[SHULHQFH

44 www.bdmpublications.com
7KH%HVW/LQX['LVWULEXWLRQV

$5&+ǟ$5&+/,18;25* 23(1686(ǟ23(1686(25*
Arch is one of the longest running Linux distributions and 0RVW/LQX[GLVWULEXWLRQVIDOOLQWRWZRFDPSVWKRVHZLWKWKH
forms the basis of many other versions of Linux. So why latest features and technology like Ubuntu and Mint and those
install Mint, or Ubuntu when you can install Arch? Many users with fewer new features, but rock-solid reliability, like Debian.
do exactly that, but it’s not ideal for beginners. Ubuntu and
0LQWERWKRƪHUDQHDVLHULQVWDOODWLRQSDWKDQGFRPHZLWK Meanwhile, openSUSE attempts to cover both bases.
software packages that will help you get started. OpenSUSE Leap is a rock-solid system. It’s developed openly
E\DFRPPXQLW\DORQJZLWK686(HPSOR\HHV7KH\GHYHORS
$UFKRQWKHRWKHUKDQGLVDPRUHnEDUHERQHVoDƪDLU,WLV DQHQWHUSULVHOHYHORSHUDWLQJV\VWHP686(ZKLFKSRZHUVWKH
committed to free software and its repositories contain over London Stock Exchange, amongst other things. It is designed
50,000 apps to install. You can also install multiple Desktop for mission critical environments where ‘there is no scope
environments and use them as you would with any other distro. IRULQVWDELOLW\o,I\RXƬQGDOOWKDWWRRVHQVLEOHRSHQ686(
7XPEOHZHHGLVDUROOLQJUHOHDVHZLWKDOOWKHODWHVWIHDWXUHVDQG
Arch is a distro for when you’re more experienced with Linux. the occasional crash.
You start with nothing more than the command line and from
WKHUH\RXPDQXDOO\SDUWLWLRQ\RXUKDUGGULYHVHWZKHUHWKH openSUSE is a highly respected Linux distribution and many
LQVWDOODWLRQƬOHVZLOOJRFUHDWHDXVHUVHWWKH26ORFDOHDQG RILWVFRUHFRQWULEXWRUVZRUNRQWKH/LQX[.HUQHO/LEUH2ƯFH
install a desktop environment, along with the apps you want. *QRPHDQGRWKHUNH\/LQX[DUHDV,QVKRUWRSHQ686(LVZKHUH
\RXoOOƬQGWKHSURVKDQJLQJRXW
7KHDGYDQWDJHIRUDOOWKLVKDUGZRUNLVDGLVWURWKDW\RXoYH
FUHDWHG7KLVPHDQV\RXU$UFKGLVWURZRQoWFRPHZLWKDOO
WKHXQQHFHVVDU\ƬOHVDQGDSSVWKDWRWKHUGLVWURVKDYHSUH
installed; it’s custom made for you, by you.

5$63%(55<3,'(6.723ǟ5$63%(55<3,25*ǖ'2:1/2$'6ǖ5$63%(55<Ǖ3,Ǖ'(6.723
No doubt you’ve heard of the GLƪHUHQWSURJUDPPLQJODQJXDJHVDQG
Raspberry Pi? It’s hard not to have, as educational resources.
this remarkable, tiny computer has
taken the technology world by storm Originally, Raspbian was exclusive to
since it was introduced six years ago. the Pi hardware, as the Raspberry Pi
uses an ARM processor to power it.
7KHUHDUHVHYHUDODVSHFWVWRWKH However, the Raspberry Pi Foundation
Raspberry Pi that make it such a has since released a PC version of
sought-after piece of the computing 5DVSELDQ5DVSEHUU\3L'HVNWRS
world. For one, it’s cheap, costing
around £25 for, what is essentially, As with the Pi version, Raspberry Pi
a fully working computer. It’s small, Desktop comes with the all the coding,
measuring not much bigger than a credit card. You can employ educational and other apps you will ever need. It’s quick, stable
it to build electronics, using a fully programmable interface and and works superbly. If you’re interested in stretching your
it comes with Raspbian, its own custom-made, Debian-based /LQX[H[SHULHQFHWKHQWKLVLVGHƬQLWHO\RQHRIWKHWRSGLVWURV
RSHUDWLQJV\VWHPWKDWLQFOXGHVDQRƯFHVXLWHDORQJVLGHPDQ\ to consider.

www.bdmpublications.com 
Coding on Linux

Equipment You
Will Need
7KHV\VWHPUHTXLUHPHQWVIRUVXFFHVVIXOO\LQVWDOOLQJ/LQX[0LQWRQWRD3&DUH
surprisingly low, so even a computer that’s several years old will happily run this distro.
However, it’s worth checking you have everything in place before proceeding.

MINTY INGREDIENTS
Here’s what you’ll need to install and run Linux Mint as we work through this book. You have several choices available, so take
your time and see which works best for you.

SYSTEM REQUIREMENTS
The minimum system requirements for Linux Mint are as follows:

CPU 700MHz

RAM 512MB

Hard Drive Space *% *%UHFRPPHQGHG

Monitor 1024 x 768 resolution

Obviously the better the system you have, the better and quicker
the experience will be.

USB INSTALLATION
You can install Linux Mint onto your computer via USB or
DVD. We’ll look into each a little later on, but if you’re already
familiar with the process (or you’re thinking of USB and just
JDWKHULQJWKHKDUGZDUH\RXoOOQHHG WKHQ\RXoUHJRLQJWR
QHHGDPLQLPXP*%86%ƮDVKGULYHVWLFNWRFRQWDLQWKH
Linux Mint ISO.

46 www.bdmpublications.com
Equipment You Will Need

DVD INSTALLATION INTERNET CONNECTION


DVD installation of Linux Mint simply requires a blank DVD-R It goes without saying, that an Internet connection is vital for
disc. Of course, you’ll also need an optical drive (a DVD Writer making sure that Linux Mint is resourced with the latest
GULYH EHIRUH\RXoUHDEOHWRWUDQVIHURUEXUQWKH,62LPDJHWR updates and patches, as well as the installation of further
the disc. software. Although you don’t need an Internet connection to
use Linux Mint, you’ll miss out on a world of free software
available for the distro.

MAC HARDWARE
Although Linux Mint can be installed onto a Mac, there’s a
school of thought that recommends Mac owners use a virtual
environment, such as VirtualBox or Parallels; and why not,
macOS is already a splendid operating system. If you’re looking
to breathe new life into an older Mac, make sure it’s an Intel
CPU model and not the Power-PC models. However, be aware,
it’s not as pain-free as installing on to a PC.

VIRTUAL ENVIRONMENT
Installation to a virtual environment is a favourite method of
testing and using Linux distros. Linux Mint works exceedingly
well when used in a virtual environment, more on that later.
7KHUHDUHPDQ\GLƪHUHQWYLUWXDOHQYLURQPHQWDSSVDYDLODEOH
however VirtualBox, from Oracle, is one of the easiest. You can
get the latest version from www.virtualbox.org.

www.bdmpublications.com 47
Coding on Linux

Creating a Linux Installer


on Windows
You need to transfer the downloaded Linux ISO to either a DVD or a USB key before
\RXFDQLQVWDOOLWWRDFRPSXWHU7KLVZLOOEHDOLYHHQYLURQPHQWZKLFKZLOODOORZ\RXWR
WHVWWKH26SULRUWRLQVWDOODWLRQEXWƬUVW\RXQHHGWRFUHDWHWKHERRWDEOHPHGLD

DVD BOOTABLE MEDIA


We’re using a Windows 10 PC here to transfer the ISO to a DVD. As long as you’re using a version of Windows from 7 onward,
the process is extremely easy.

STEP 1 First locate the ISO image of Linux you’ve already 67(3 Right-click the Linux ISO and from the menu select
downloaded. In Windows 7, 8.1 and 10 computers, Burn Disc Image. Depending on the speed of the PC,
\RXoOOXVXDOO\ƬQGWKLVLQWKH'RZQORDGVIROGHUXQOHVVZKHQVDYLQJ it may take a few seconds before anything happens. Don’t worry too
LW\RXoYHVSHFLƬHGDGLƪHUHQWORFDWLRQ much, unless it takes more than a minute, in which case it might be
worth restarting your PC and trying again. With luck, the Windows
Disc Image Burner should launch.

STEP 2 Next, insert a recordable DVD disc into your STEP 4 With the Windows Disc Image Burner dialogue box
computer’s optical drive. After a few seconds, while open, click on the ‘Verify disc after burning’ tick
the disc is read, Windows will display a pop-up message asking you box, followed by the Burn button. The process should take a few
what to do with the newly inserted disc, ignore this as we’re going minutes, depending on the speed of your PC’s optical drive. Once
to use the built-in image burning function. LWoVFRPSOHWHLWZLOOUXQWKURXJKWKHYHULƬFDWLRQVWDJHDQGZKHQ
done, the optical drive should auto-eject the disc for you.

48 www.bdmpublications.com
Creating a Linux Installer on Windows

USB BOOTABLE MEDIA


USB media is faster than a DVD and it’s often more convenient as most modern PCs don’t have an optical drive installed. The
SURFHVVRIWUDQVIHUULQJWKHLPDJHLVHDV\EXW\RXoOOQHHGDWKLUGSDUW\DSSƬUVWDQGD86%ƮDVKGULYHRI*%RUPRUH

STEP 1 STEP 4 When you’re ready, click on the Start button at


the bottom of the Rufus app. This may open up
First, open up a web another dialogue box asking you to download and use a new version
browser and go to of SysLinux. SysLinux is a selection of boot loaders used to allow a
https://rufus.akeo. PRGHUQ3&WRDFFHVVDQGERRWIURPD86%ƮDVKGULYH,WLVQHFHVVDU\
ie/. Scroll down the so if asked, click on ‘Yes’ to continue.
page a little and you’ll
come to a Download
heading, under which
you’ll see the latest
version of Rufus.
Left-click on the link to
start the download.

STEP 2 67(3 The next step asks in which image mode do you
ZDQWWKH/LQX[,62WREHZULWWHQWRWKH86%ƮDVK
Double-click the GULYH%RWKPHWKRGVZRUNIRUGLƪHUHQWVLWXDWLRQVEXWJHQHUDOO\WKH
downloaded Rufus recommended ISO Image Mode is the more popular. Make sure this
executable; you can mode is pre-selected and click ‘OK’ to continue, followed by ‘OK’
click ‘Yes’ to the DJDLQWRFRQƬUPWKHDFWLRQ
Windows security
question and ‘Yes’
to checking for
updates. With Rufus
launched, it should
KDYHDOUHDG\LGHQWLƬHG
your inserted USB
ƮDVKGULYH LIQRWMXVW
UHPRYHDQGUHLQVHUW 

67(3 $WƬUVWJODQFHWKH5XIXVLQWHUIDFHFDQORRNDOLWWOH STEP 6


confusing, don’t worry though, it’s really quite
simple. To begin with, click on the SELECT button next to the ‘Disk The Linux ISO is now
RU,62,PDJH 3OHDVHVHOHFW oSXOOGRZQPHQX7KLVZLOOODXQFKD being transferred to
Windows Explorer window from where you can locate and select WKH86%ƮDVKGULYH7KH
the Linux ISO. process shouldn’t take
too long, depending on
the speed of the USB
device and the PC. During
WKHSURFHVV\RXPD\ƬQG
Rufus will auto-open the
USB drive in Windows
Explorer, don’t worry you
can minimise or close it
if you want. Click on the
Close button once the
process is complete.

www.bdmpublications.com 49
Coding on Linux

Installing Linux on a PC
0RVW/LQX[GLVWURVFRPHDVD/LYH(QYLURQPHQW7KLVPHDQV\RXFDQERRWLQWRDQDFWXDO
fully working distro straight from the DVD or USB you’ve just created. Let’s see how
that works and how you go about installing Linux from there.

UEFI BIOS
7KH8QLƬHG([WHQVLEOH)LUPZDUH,QWHUIDFH 8(), LVXVHGWRLGHQWLI\KDUGZDUHDQGSURWHFWD3&GXULQJLWVERRWXSSURFHVV,W
replaces the traditional BIOS, but can cause issues when installing Linux.

STEP 1 ,QVHUW\RXU'9'RU86%ƮDVKGULYHLQWR\RXU3&DQG 67(3 With UEFI turned to Legacy mode, there are now
if you haven’t already, shutdown Windows. In this two ways of booting into the Live Environment. The
instance, we’re using the USB boot media but the process is virtually ƬUVWLVYLDWKH%,26\RXoUHDOUHDG\LQ/RFDWHWKHBoot Sequence and
identical. Start the PC and when prompted press the appropriate FKDQJHWKHƬUVWERRWGHYLFHIURPLWVRULJLQDOVHWWLQJXVXDOO\,QWHUQDO
keys to enter the BIOS or SETUP; these could be, for example, F2, HDD or similar, to: USB Storage Device for the USB media option; or
Del or even F12. DVD Drive, for the DVD media option.

STEP 2 7KHUHDUHGLƪHUHQWYHUVLRQVRID8(),%,26VR STEP 4 Alternatively use the Boot Option Menu. With this
covering them all would be impossible. What you’re option, you can press F12 RUVRPHWKLQJVLPLODU 
looking for is a section that details the Boot Sequence or Boot to display a list of boot media options; from there, you can choose
Mode+HUH\RXoOOKDYHWKHRSWLRQWRWXUQRƪ8(),DQGFKRRVH the appropriate boot media. Either way, you can now Save and Exit
Legacy, or disable Secure Booting. Most distros work with UEFI but the BIOS by navigating to the Save & Exit option and choosing Save
it can be a tricky process to enable it to boot. Changes and Exit.

 www.bdmpublications.com
Installing Linux on a PC

INSTALLING LINUX
Once the Live Environment has booted, you will see the option to install the distro to your computer. Have a look around and
when you’re ready, look for the Install option on the desktop.

STEP 1 Providing you’re connected to the Internet (if not, STEP 4 Before the installation process begins, you’re asked
WKHQGRVRQRZ DQG\RXoUHLQWKH/LYH(QYLURQPHQW if the choice you made regarding the erasure of the
start the installation process by double-clicking on the Install Linux hard drive is correct. This is your last chance to back out. If you’re
Mint icon on the desktop. Other distros will display their own name, of certain you don’t mind wiping everything and starting again with
course, but the process is the same. Click Continue when you’re ready. Linux Mint, click Continue,I\RXQHHGWREDFNXS\RXUƬOHVUHPRYH
the Linux disc/USB, reboot, back up and start again.

STEP 2 While the installation process is very similar across 67(3 Eventually you will be asked to set up your Linux
PRVW/LQX[GLVWURVVRPHRƪHUGLƪHUHQWTXHVWLRQV username and password. Enter your Name to begin
GXULQJWKHLQVWDOODWLRQ*HQHUDOO\WKHTXHVWLRQVDUHQoWWRRGLƯFXOWRU with, then Computer NamesZKLFKLVWKHQDPHXVHGWRLGHQWLI\
technical, but some such as ‘Installing third-party software…’ can be it on the network. Next, choose a Username, followed by a good
confusing. In this case, you can click Continue, but if you’re unsure, Password. You can tick the Login Automatically option, but leave
have an Internet-connected device available to ask any questions. the Encrypt Home Folder option for now.

67(3 When installing a new operating system it’s STEP 6 The installation process can be quick and there may
recommended that you wipe the old OS, replacing it be more questions to answer, or it may simply start
with the new. When you reach this stage of the installation process, installing Linux based on your previous answers. Either way, you will
ensure the ‘Erase disk and install Linux…’ option is selected. NOTE: end up being asked to Continue Testing the Live Environment, or
This will completely wipe Windows 10 from your computer; make Restarting to use the newly installed OS. If you’re ready to use Linux,
VXUH\RXKDYHEDFNXSVRIDOO\RXUSHUVRQDOƬOHVDQGGDWD then click Restart Now.

www.bdmpublications.com 
Coding with Windows Batch Files

Did you know that Windows has


its own built-in scripting language?
%DWFKƬOHVKDYHEHHQDURXQGVLQFH
the early days of Windows, and while
they are overshadowed by the might
of Windows’ modern graphical user
interface, they are still there and still
just as capable as they were thirty
years ago.

%DWFKƬOHSURJUDPPLQJLVDVNLOO
that system administrators still use,
so it’s worth spending a bit of time
learning how they work, and what
you can do with them. This section
LQWURGXFHVEDWFKƬOHVDQGFRYHUVXVHU
interactions, variables and loops.

What is a Batch File?


*HWWLQJ6WDUWHGZLWK%DWFK)LOHV
*HWWLQJDQ2XWSXW
Did You Know?
Playing with Variables
Batch File Programming
Loops and Repetition

 www.bdmpublications.com
Index

Coding with
Windows
Batch Files

www.bdmpublications.com 
Coding with Windows Batch Files

What is a Batch File?


7KH:LQGRZVEDWFKƬOHKDVEHHQDURXQGVLQFHWKHHDUO\GD\VRI'26DQGZDVRQFHD
FULWLFDOHOHPHQWRIDFWXDOO\EHLQJDEOHWRERRWLQWRDZRUNLQJV\VWHP7KHUHoVDORW\RX
FDQGRZLWKDEDWFKƬOHEXWOHWoVMXVWWDNHDPRPHQWWRVHHZKDWRQHLV

.BAT MAN
$:LQGRZVEDWFKƬOHLVVLPSO\DVFULSWƬOHWKDWUXQVDVHULHVRIFRPPDQGVRQHOLQHDWDWLPHPXFKLQWKHVDPHIDVKLRQDVD
/LQX[VFULSW7KHVHULHVRIFRPPDQGVDUHH[HFXWHGE\WKHFRPPDQGOLQHLQWHUSUHWHUDQGVWRUHGLQDSODLQWH[WƬOHZLWKWKH%$7
H[WHQVLRQWKLVVLJQLƬHVWR:LQGRZVWKDWLWoVDQH[HFXWDEOHƬOHLQWKLVFDVHDVFULSW

%DWFKƬOHVKDYHEHHQDURXQGVLQFHWKHHDUOLHVWYHUVLRQVRI0LFURVRIW line in turn, loading programs that would activate the mouse or
'26$OWKRXJKQRWH[FOXVLYHO\D0LFURVRIWVFULSWLQJƬOHEDWFKƬOHV RSWLFDOGULYHLQWRWKHPHPRU\DUHDVDVVLJQHGE\WKH&RQƬJV\VƬOH
are mainly associated with Microsoft’s operating systems. In the
early days, when a PC booted into a version of DOS (which produced 7KH'26XVHURIWKHGD\FRXOGRSWWRFUHDWHGLƪHUHQW$XWRH[HF
DVLPSOHFRPPDQGSURPSWZKHQSRZHUHGXS WKHEDWFKƬOHZDV EDWƬOHVGHSHQGLQJRQZKDWWKH\ZDQWHGWRGR)RUH[DPSOHLI
XVHGLQWKHIRUPRIDV\VWHPƬOHFDOOHG$XWRH[HFEDW$XWRH[HF they wanted to play a game and have as much memory available
EDWZDVDVFULSWWKDWDXWRPDWLFDOO\H[HFXWHG KHQFH$XWRH[HF  DVSRVVLEOHWKH\oGFUHDWHD&RQƬJV\VDQG$XWRH[HFEDWVHWRIƬOHV
FRPPDQGVRQFHWKHRSHUDWLQJV\VWHPKDGƬQLVKHGGHDOLQJZLWKWKH that loaded the bare minimum of drivers and so on. If they needed
&RQƬJV\VƬOH DFFHVVWRWKHQHWZRUNDQ$XWRH[HFEDWƬOHFRXOGEHFUHDWHGWR

When a user powered


up their DOS-based
computer, and once the
%,26KDGƬQLVKHGFKHFNLQJ
the system memory
and so on, DOS would
ORRNWRWKH&RQƬJV\V
ƬOHWRORDGDQ\VSHFLƬF
display requirements
and hardware drivers,
allocate them a slot in the
available memory, assign
any memory managers
and tell the system where
WKH&RPPDQGFRPƬOH
which is the command line
interpreter for DOS, was.
Once it had done that, then
WKH$XWRH[HFEDWƬOHWRRN
over and ran through each

7KH$XWRH[HFEDWƬOHZDV
D3&XVHUoVƬUVWH[SHULHQFH
ZLWKDEDWFKƬOH

 www.bdmpublications.com
What is a Batch File?

BATCH FILE POWER


Just like any other programming interface that can directly
LQWHUURJDWHDQGPDQLSXODWHWKHV\VWHPEDWFKƬOHVUHTXLUH
a certain amount of care when programming. It’s hard to
GDPDJH\RXUV\VWHPZLWKDEDWFKƬOHDVWKHPRUHLPSRUWDQW
elements of the modern Windows system are protected by
WKH8VHU$FFRXQW&RQWURO 8$& VHFXULW\8$&ZRUNVE\RQO\
DOORZLQJHOHYDWHGSULYLOHJHVDFFHVVWRLPSRUWDQWV\VWHPƬOHV
7KHUHIRUHLI\RXFUHDWHDEDWFKƬOHWKDWVRPHKRZGHOHWHVD
V\VWHPƬOHWKH8$&DFWLYDWHVDQGVWRSWKHSURFHVV

%DWFKƬOHVDUHSODLQWH[WDQGRIWHQFUHDWHGXVLQJ1RWHSDG However, if you’re working in the command prompt with


elevated privileges to begin with, as the Administrator, then
WKH8$&ZRQoWTXHVWLRQWKHEDWFKƬOHDQGFRQWLQXHUHJDUGOHVV
RIZKDWƬOHVDUHEHLQJGHOHWHG

7KDWVDLG\RXoUHQRWOLNHO\WRFUHDWHDEDWFKƬOHWKDW
intentionally wipes out your operating system. There are
system controls in place to help prevent that; but it’s worth
PHQWLRQLQJDVWKHUHDUHEDWFKƬOHVDYDLODEOHRQWKH,QWHUQHW
that contain malicious code designed to create problems.
0XFKOLNHDYLUXVDURJXHEDWFKƬOH ZKHQH[HFXWHGZLWK
$GPLQLVWUDWRUSULYLOHJHV FDQFDXVHPXFKPD\KHPDQGV\VWHP
GDPDJH,QVKRUWGRQoWUDQGRPO\H[HFXWHDQ\EDWFKƬOH
downloaded from the Internet as an Administrator, without
ƬUVWUHYLHZLQJZKDWLWGRHV
%DWFKƬOHVZHUHRIWHQXVHGDVXWLOLW\SURJUDPVWRKHOSXVHUVZLWK
complex tasks. <RXFDQOHDUQPRUHDERXWEDWFKƬOHVLQWKHFRPLQJSDJHVVR
don’t worry too much about destroying your system with one.
$OOWKLVMXVWGHPRQVWUDWHVKRZSRZHUIXOWKHKXPEOHEDWFKƬOH
load the network card driver and automatically gain access to the can be.
network. Each of these unique setups would be loaded on to a
ƮRSS\GLVNDQGERRWHGDVDQGZKHQUHTXLUHGE\WKHXVHU

7KH$XWRH[HFEDWZDVWKHƬUVWVXFKƬOHPDQ\XVHUVFDPHDFURVVLQ
their PC-based computing lives; since many had come from a 16-bit
or even 8-bit background; remember, this was the late eighties
DQGHDUO\QLQHWLHV7KHEDWFKƬOHZDVWKHXVHUoVSULPDU\WRROIRU
automating tasks, creating shortcuts and adventure games and
translating complex processes into something far simpler.

1RZDGD\VKRZHYHUDEDWFKƬOHLVQoWMXVWIRUORDGLQJLQGULYHUVDQG
VXFKZKHQWKH3&ERRWV<RXFDQXVHDEDWFKƬOHLQWKHVDPHZD\
DVDQ\RWKHUVFULSWLQJODQJXDJHƬOHLQWKDW\RXFDQSURJUDPLWWR
ask for user input and display the results on the screen; or save to
DƬOHDQGHYHQVHQGLWWRDORFDOO\RUQHWZRUNDWWDFKHGSULQWHU<RX
FDQFUHDWHVFULSWVWREDFNXS\RXUƬOHVWRYDULRXVORFDWLRQVFRPSDUH
date stamps and only back up the most recently changed content as
ZHOODVSURJUDPWKHVFULSWWRGRDOOWKLVDXWRPDWLFDOO\%DWFKƬOHVDUH
remarkably powerful and despite them not being as commonly used
as they were during the older days of DOS, they are still there and
can be utilised even in the latest version of Windows 10; and can be
as complex or simple as you want them to be.

6RZKDWGR\RXQHHGWRVWDUWEDWFKƬOHSURJUDPPLQJLQ:LQGRZV"
Well, as long as you have Windows 10, or any older version of
:LQGRZVIRUWKDWPDWWHU\RXFDQVWDUWEDWFKƬOHSURJUDPPLQJ
immediately. All you need is to be able to open Notepad and get to
the command prompt of Windows. We show you how it all works, so <RXFDQFUHDWHFRPSOH[EDWFKƬOHVRUVLPSOHRQHVWKDWGLVSOD\
read on. ASCII images on screen.

www.bdmpublications.com 
Coding with Windows Batch Files

*HWWLQJ6WDUWHGZLWK
Batch Files
%HIRUH\RXEHJLQWRSURJUDPZLWKEDWFKƬOHVWKHUHDUHDIHZWKLQJV\RXQHHGWRNQRZ
$EDWFKƬOHFDQRQO\EHH[HFXWHGRQFHLWKDVWKHEDWH[WHQVLRQDQGHGLWLQJRQHZLWK
Notepad isn’t always straightforward.

A NEW BATCH
7KURXJKRXWWKLVVHFWLRQRQEDWFKƬOHVZHoUHJRLQJWREHZRUNLQJZLWK1RWHSDGWKHFRPPDQGSURPSWDQGZLWKLQDIROGHU
called ‘Batch Files’. To begin with, let’s see how you get to the Windows command prompt.

STEP 1 The Windows 67(3 While at the command prompt window, enter:
command dir/w.7KLVOLVWVDOOWKHƬOHVDQGGLUHFWRULHVIURP
prompt may look a little where you are at the moment in the system. In this case, that’s your
daunting to the newcomer Home directory that Windows assigns every user that logs in. You
but it’s simply another FDQQDYLJDWHE\XVLQJWKH&'FRPPDQG &KDQJH'LUHFWRU\ 7U\
LQWHUIDFH RU6KHOO XVHGWR
cd Documents
DFFHVVWKHƬOHV\VWHP<RX
can go anywhere you like in Then press Return.
the command prompt, as
you would with the graphical
interface. To begin, click on
the Windows Start button and
enter CMD into the search box.

STEP 2 Click on the search result labelled Command Prompt STEP 4 The prompt should change and display \
'HVNWRS$SS DQGDQHZZLQGRZSRSVXS7KH Documents>; this means you’re in the Documents
Command Prompt window isn’t much to look at to begin with but directory. Now, create a new directory call Batch Files. Enter:
you can see the Microsoft Windows version number and copyright
md “Batch Files”
information followed by the prompt itself. The prompt details the
current directory or folder you’re in, together with your username. You need the quotations because without them, Windows creates
two directories: Batch and Files. Now change directory into the
newly created Batch Files.
cd Batch Files
You won’t need the quotes to change directories.

 www.bdmpublications.com
Getting Started with Batch Files

67(3 Now that you have the directory set up, where you STEP 8 Back at the command prompt window, enter:
VWRUH\RXUEDWFKƬOHVKHUHLVKRZ\RXFDQFUHDWH dir/wDJDLQWROLVWWKHQHZO\FUHDWHG7HVWEDWƬOH
one. Leave the command prompt window open and click on the %\WKHZD\WKHZSDUWRIGLUZPHDQVWKHƬOHVDUHOLVWHGDFURVV
Windows Start button again. This time enter Notepad and click on the screen as opposed to straight down. Enter dir if you want
the search result to open the Notepad program. Notepad is a simple DOWKRXJK\RXQHHGPRUHƬOHVWRYLHZ EXWLWoVFRQVLGHUHGHDVLHUWR
text editor but ideal for creating batch scripts with. UHDGZLWKWKHZƮDJ

STEP 6 7RFUHDWH\RXUƬUVWEDWFKƬOHHQWHUWKHIROORZLQJ STEP 9 7RH[HFXWHWKHEDWFKƬOH\RXoYHMXVWFUHDWHGVLPSO\


into Notepad: enter its name, Test, in the command prompt
window. You don’t need to add the .bat part, as Windows recognises
@echo off
LWDVDQH[HFXWDEOHƬOHDQGWKHRQO\RQHZLWKWKDWSDUWLFXODUQDPHLQ
echo Hello World!
the current directory. Press return and see how you’re greeted with
%\GHIDXOWDEDWFKƬOHGLVSOD\VDOOWKHFRPPDQGVWKDWLWUXQV Hello World! in the command prompt.
WKURXJKOLQHE\OLQH:KDWWKH#HFKRRƪFRPPDQGGRHVLVWXUQ
WKDWIHDWXUHRƪIRUWKHZKROHVFULSWZLWKWKHn#o DW VLJQWRDSSO\
that command to itself.

STEP 7 When saving anything in Notepad the default


H[WHQVLRQLVW[WWRGHQRWHDWH[WƬOH+RZHYHU\RX
STEP 10 The echo command displays whatever is after it
want the extension to be .bat. Click on File > Save As and navigate
WRWKHVFUHHQ5LJKWFOLFNWKH7HVWEDWƬOHIURP
to the newly created Batch Files directory in Documents. Click the
Windows Explorer and select Edit to add more echo commands if
drop-down menu Save as Type, and select All Files from the menu. In
you like. Try this:
)LOH1DPHFDOOWKHƬOHTest.bat.
@echo off
echo Hello World!
HFKR7KLVLVP\¿UVWEDWFK¿OH
echo.
HFKR:LWKDEODQNOLQHEHWZHHQ
5HPHPEHUWRVDYHHDFKQHZFKDQJHWRWKHEDWFKƬOH

www.bdmpublications.com 
Coding with Windows Batch Files

*HWWLQJDQ2XWSXW
While it’s great having the command prompt window display what you’re putting after
WKHHFKRFRPPDQGLQWKHEDWFKƬOHLWoVQRWYHU\XVHIXODWWKHPRPHQWRULQWHUDFWLYH
for that matter. Let’s change up a gear and get some output.

INPUT, OUTPUT
%DWFKƬOHVDUHFDSDEOHRIWDNLQJDQRUPDO:LQGRZVFRPPDQGDQGH[HFXWLQJLWZKLOHDOVRDGGLQJH[WUDRSWLRQVDQGƮDJVLQWR
the equation.

STEP 1 Let’s keep things simple to begin with. Create a new 67(3 You have no doubt noticed that there is no
EDWFKƬOHFDOOHGnGLUYLHZEDWoVKRUWIRU'LUHFWRU\ LQGLFDWLRQWKDWWKHEDWFKƬOHZRUNHGDVWKHUHoV
9LHZ6WDUWZLWKWKH#HFKRRƪFRPPDQGDQGXQGHUWKDWDGG no meaningful output on the screen. However, if you now open
Explorer and browse to c:\Users\YOURNAME, remembering to
dir “c:\users\YOURNAME\Documents\Batch Files” >
substitute YOURNAME with your Windows username, and double-
c:\users\YOURNAME\dirview.txt
click the dirview.txWƬOH\RXFDQVHHWKHEDWFKƬOHoVRXWSXW
Substitute YOURNAME with your Windows username.

STEP 2 The new line uses the dir command to list the STEP 4 If you want to automate the task of opening the
contents of the directory Batch Files, in your Home WH[WƬOHWKDWFRQWDLQVWKHRXWSXWDGGWKHIROORZLQJ
GLUHFWRU\GXPSLQJWKHRXWSXWWRDWH[WƬOHFDOOHGdirview.txt in OLQHWRWKHEDWFKƬOH
the root of your Home directory. This is done, so that the Windows
notepad.exe c:\users\YOURNAME\dirview.txt
UAC doesn’t require elevated permissions, as everything is in your
RZQ+RPHDUHD6DYHDQGUXQWKHEDWFKƬOH 6DYHWKHƬOHDQGRQFHDJDLQUXQIURPWKHFRPPDQGSURPSW7KLV
time, it creates the output and automatically opens Notepad with
the output contents.

 www.bdmpublications.com
Getting an Output

OUTPUT WITH VARIABLES


9DULDEOHVRƪHUDPRUHLQWHUHVWLQJZD\RIRXWSXWWLQJVRPHWKLQJWRWKHVFUHHQDQGFUHDWHDKLJKHUOHYHORILQWHUDFWLRQEHWZHHQ
WKHXVHUDQGWKHEDWFKƬOH7U\WKLVH[DPSOHEHORZ

STEP 1 &UHDWHDQHZEDWFKƬOHDQGFDOOLWname.bat. Start STEP 4 This is extremely useful if you want to create a
with the @echo off command, then add the XQLTXHSHUVRQDOEDWFKƬOHWKDWDXWRPDWLFDOO\UXQV
following lines: when a user logs into Windows. Using the default systems variables
WKDW:LQGRZVLWVHOIFUHDWHV\RXFDQPDNHDEDWFKƬOHWKDWJUHHWV
set /p name= What is your name?
each user:
echo Hello, %name%
@echo off
Note: there’s a space after the question mark. This is to make it look
QHDWHURQWKHVFUHHQ6DYHLWDQGUXQWKHEDWFKƬOH echo Hello, %USERNAME%.
echo.
HFKR7KDQNVIRUORJJLQJLQ&XUUHQWO\WKHQHWZRUN
LVRSHUDWLQJDWHI¿FLHQF\
echo.
echo Your Home directory is located at: %HOMEPATH%
echo The computer name you’re logged in to is:
&20387(51$0(
echo.

STEP 2 The set /p name creates a variable called name,


with the /p part indicating that an ‘=prompt string’
is to follow. The Set command displays, sets or removes system
and environmental variables. For example, while in the command
prompt window enter: 67(3 6DYHDQGH[HFXWHWKHEDWFKƬOHFKDQJHV\RXFDQ
overwrite and still use name.bat if you want. The
set
EDWFKƬOHWDNHVWKHFXUUHQWV\VWHPYDULDEOHVDQGUHSRUWVWKHP
To view the current system variables. Note the name= variable we accordingly, depending on the user’s login name and the name of
just created. the computer. Note: the double percent symbol means the percent
sign will be displayed, and is not a variable.

STEP 6 $OWHUQDWLYHO\\RXFDQUXQWKHEDWFKƬOHDQGGLVSOD\
LWRQWKHXVHUoVGHVNWRSDVDWH[WƬOH
@echo off
echo Hello, %USERNAME%. > c:%HOMEPATH%\user.txt
67(3 Variables stored with Set can be called with the
echo. >> c:%HOMEPATH%\user.txt
%VARIABLENAME% syntax,QWKHEDWFKƬOHZH
HFKR7KDQNVIRUORJJLQJLQ&XUUHQWO\WKHQHWZRUN
used the newly created %name% syntax to call upon the contents of
LVRSHUDWLQJDWHI¿FLHQF\!!F+20(3$7+?
the variable called name. Your username, for example, is stored as a
user.txt
YDULDEOH7U\WKLVLQDEDWFKƬOH
echo. >> c:%HOMEPATH%\user.txt
echo Hello, %USERNAME%. What are you doing? echo Your Home directory is located at: %HOMEPATH%
>> c:%HOMEPATH%\user.txt
echo The computer name you’re logged in to is:
&20387(51$0(!!F+20(3$7+?XVHUW[W
echo. >> c:%HOMEPATH%\user.txt
notepad c:%HOMEPATH%\user.txt
7KH!RXWSXWVWRDQHZƬOHFDOOHGXVHUW[WZKLOHWKH!!DGGVWKH
OLQHVZLWKLQWKHƬOH

www.bdmpublications.com 
গ঳তদন঍঱হতধন঵শ
ছফন঱গ঳তদন঍঱হতধন঵শদ঵নতষল঵॰ঘলরলফব঵ল঒বশফবমতধল॰঺তশদলধব঱পগ঳তদন঍঱হতধন঵শ॰
ফনফতধষলদ঵নতষনফবশল঺঱ফত঵ধ঺ত঵নত঱ধধনহনযল঳রন঱ষষললযশষল঺঵বষনষফনপতরনॲ
ঊস঵ষফন঵রল঵ন॰ফনষফন঱ধবশদলহন঵নধষফতষতশত঵নশসযষল঩ষফনদলধব঱পত঱ধষফনদসশষলর
ফত঵ধ঺ত঵ন॰ষফন঩ন঺ন঵঍঱হতধন঵শল঱ॱশদ঵নন঱ষফন঩তশষন঵ষফন঳঵লদনশশল঵঺তশতথযনষল
঵ন঱ধন঵ষফনরॲঘফসশ॰তশ়লসমবযযরল঵ন঍঱হতধন঵শ॰ষফন঩তশষন঵ষফন়থনদলরনॲগল঵তষফন঵
ষফত঱ধনশবপ঱ষফনপতরনষলদলর঳ন঱শতষন঩ল঵ষফনশ঳ননধব঱দ঵নতশন॰ফনধনদবধনধষলমনন঳
বষতশতদফতযযন঱পব঱পপতরন঳যত়রনদফত঱বশরॲ

60 | www.bdmpublications.com
www.bdmpublications.com | 61
Coding with Windows Batch Files

Playing with Variables


7KHUHoVDORW\RXFDQDFFRPSOLVKZLWKERWKWKHV\VWHPDQGHQYLURQPHQWDOYDULDEOHV
alongside your own. Mixing the two can make for a powerful and extremely useful
EDWFKƬOHDQGZKHQFRPELQHGZLWKRWKHUFRPPDQGVWKHHƪHFWLVUHDOO\LPSUHVVLYH

USING MORE VARIABLES


Here’s a good example of mixing system and environmental variables with some of your own creation, along with a number of
external Windows commands.

STEP 1 &UHDWHDQHZEDWFKƬOHFDOOHGOLVWEDWDQGVWDUWLWRƪ 67(3 1RZFUHDWHDEDWFKƬOHWKDWGLVSOD\VWKHFRQWHQWV


with the @echo off command. Begin by clearing RIDQ\GLUHFWRU\DQGSRVWLWDVDWH[WƬOHWRWKHXVHUoV
the command prompt screen and displaying a list of the current VFUHHQ$GGWKHIROORZLQJWRWKHOLVWEDWEDWFKƬOH
directories on the computer:
echo Hello, %USERNAME%.
cls HFKR)URPWKHOLVWZKLFKIROGHUZRXOG\RXOLNHWR
dir “c:\” > list.txt view?
type list.txt set /p view= (enter as c:\folder)
echo. dir “%view%” > view.txt
notepad.exe view.txt

STEP 2 6DYHDQGH[HFXWHWKHEDWFKƬOH:LWKLQWKH STEP 4 :KDWoVKDSSHQLQJKHUHLVWKHEDWFKƬOHDVNVWKHXVHU


command prompt you can see the contents of all to enter any of the directories displayed in the list it
WKHƬOHVDQGGLUHFWRULHVIURPWKHURRWRIWKH&?GULYHDQGDVDQ\ generated, in the form of ‘c:\directory’. Providing the user enters a
user under Windows has permission to see this, there’s no UAC YDOLGGLUHFWRU\LWVFRQWHQWVDUHGLVSOD\HGDVDWH[WƬOH:HFUHDWHG
elevated privileges required. the view variable here along with %HOMEPATH%, to store the input
DQGWKHWH[WƬOH

62 www.bdmpublications.com
Playing with Variables

67(3 ,WoVDOZD\VDJRRGLGHDZKHQFUHDWLQJWH[WƬOHV STEP 8 Instead of left clicking on the Command Prompt


for the user to temporarily view, to clean up after UHVXOWDV\RXGLGWKHƬUVWWLPH\RXRSHQHGLW
yourself. There’s nothing worse than having countless, random right-click it and from the menu choose Run as Administrator. There
WH[WƬOHVFOXWWHULQJXSWKHƬOHV\VWHP7KDWEHLQJWKHFDVHOHWoV LVDULVNWKDW\RXFRXOGGDPDJHV\VWHPƬOHVDVWKH$GPLQLVWUDWRU
clear up with: but as long as you’re careful and don’t do anything beyond viewing
directories, you will be okay.
cls
del /Q view.txt
del /Q list.txt
HFKR$OO¿OHVGHOHWHG6\VWHPFOHDQ

STEP 6 7KHDGGLWLRQVWRWKHEDWFKƬOHVLPSO\FOHDUWKH
FRPPDQGSURPSWZLQGRZ XVLQJWKHFOVFRPPDQG 
DQGGHOHWHERWKWKHYLHZW[WDQGOLVWW[WƬOHVWKDWZHUHFUHDWHGE\
WKHEDWFKƬOH7KH4ƮDJLQWKHGHOFRPPDQGPHDQVLWGHOHWHV
WKHƬOHVZLWKRXWDQ\XVHULQSXWRUQRWLƬFDWLRQ7KHƬQDOPHVVDJH
STEP 9 This action triggers the UAC warning message,
LQIRUPVWKHXVHUWKDWWKHƬOHVDUHUHPRYHG
asking you if you’re sure you want to run the
Windows command prompt with the elevated Administrator
privileges. Most of the time we wouldn’t recommend this course
of action: the UAC is there to protect your system. In this case,
however, click Yes.

STEP 7 Depending
on how
\RXUV\VWHPLVFRQƬJXUHG
you may not get any
directory information
at all or a message
stating Access Denied.
This is because the UAC STEP 10 With the UAC active, the command prompt looks
is blocking access to DOLWWOHGLƪHUHQW)RUVWDUWHUVLWoVQRZGHIDXOWLQJ
protected areas of the to the C:\WINDOWS\system32 folder and the top of the windows is
system, like c:\Windows ODEHOOHG$GPLQLVWUDWRU7RUXQWKHEDWFKƬOH\RXQHHGWRQDYLJDWHWR
or C:\Program Files. the Batch Files directory with: cd \Users\USERNAME\Documents\
Therefore, you need to Batch Files. To help, press the Tab key to auto-complete the
UXQWKHEDWFKƬOHDVDQ directory names.
Administrator. Click the
Windows Start button and
enter CMD again.

www.bdmpublications.com 
Coding with Windows Batch Files

Batch File Programming


,WoVWKHOLWWOHDGGLWLRQVZHFDQPDNHWRDEDWFKƬOHWKDWKHOSLWVWDQGRXWDQGXOWLPDWHO\
become more useful. While the Windows graphical interface is still king, the command
OLQHFDQGRMXVWDVPXFKDQGWKLVLVZKHUHEDWFKƬOHVFRPHLQWRWKHLURZQ

SEARCHING FOR FILES


+HUHoVDQLQWHUHVWLQJOLWWOHEDWFKƬOHWKDW\RXFDQHDVLO\H[WHQGIRU\RXURZQXVH,WDVNVWKHXVHUIRUDƬOHW\SHWRVHDUFKIRU
and displays the results.

STEP 1 We are introducing a couple of new commands 67(3 1RZOHWoVH[WHQGWKHVHHNEDWEDWFKƬOH


into the mix here but we think they’re really useful.
&UHDWHDQHZEDWFKƬOHFDOOHGVHHNEDWDQGLQLWSXW @echo off
cls
@echo off
color 2
cls
HFKR3OHDVHHQWHUWKHW\SHRI¿OH\RXZDQWWR
color 2
VHDUFKIRU 03'2&-3*IRUH[DPSOH
HFKR3OHDVHHQWHUWKHW\SHRI¿OH\RXZDQWWR
echo.
VHDUFKIRU 03'2&-3*IRUH[DPSOH
set /p ext=
echo.
where /R c:\ *.%ext% > found.txt
notepad.exe found.txt
cls
color
del /Q found.txt

STEP 2 The new command in this instance is color STEP 4 $QRWKHUQHZFRPPDQG:KHUHORRNVIRUDVSHFLƬF


$PHULFDQLVHGVSHOOLQJ &RORUDV\RXDOUHDG\ ƬOHRUGLUHFWRU\EDVHGRQWKHXVHUoVUHTXLUHPHQWV
assume, changes the colour of the command prompt display. The In this case, we have created a blank variable called ext that the user
FRORUDWWULEXWHVDUHVSHFLƬHGE\WZRKH[GLJLWVWKHƬUVWFRUUHVSRQGV FDQHQWHUWKHƬOHW\SHLQZKLFKWKHQVHDUFKHVXVLQJ:KHUHDQG
to the background colour of the Command console and the second GXPSVWKHUHVXOWVLQDWH[WƬOHFDOOHGIRXQGW[W6DYHDQGUXQWKH
to the foreground, and can be any of the following values: EDWFKƬOH

64 www.bdmpublications.com
Batch File Programming

CHOICE MENUS
&UHDWLQJDPHQXRIFKRLFHVLVDFODVVLFEDWFKƬOHXVHDQGDJRRGH[DPSOHWRKHOSH[SDQG\RXUEDWFKƬOHSURJUDPPLQJVNLOOV
Here’s some code to help you understand how it all works.

STEP 1 Rather than using a variable to process a user’s STEP 4 ErrorLevels are essentially variables and the /M
UHVSRQVHEDWFKƬOHVFDQLQVWHDGXVHWKH&KRLFH switch of Choice allows a descriptive message string
command in conjunction with an ErrorLevel parameter to make a to be displayed. Extend this menu with something new:
PHQX&UHDWHDQHZƬOHFDOOHGPHQXEDWDQGHQWHUWKHIROORZLQJ
@echo off
@echo off cls
cls echo.
choice /M “Do you want to continue? Y/N” echo ---------------------------------------------
if errorlevel 2 goto N echo.
if errorlevel 1 goto Y echo Please choose a directory.
goto End: echo.
echo Press 1 for c:\Music
echo.
echo Press 2 for c:\Documents
echo.
echo Press 3 for c:\Pictures
echo.
echo Press 4 for c:\Videos
echo.
echo ---------------------------------------------
STEP 2 Running the code produces an error as we’ve called FKRLFH&
D*RWRFRPPDQGZLWKRXWDQ\UHIHUHQFHWRLWLQWKH if errorlevel 4 goto Videos
ƬOH*RWRGRHVH[DFWO\WKDWJRHVWRDVSHFLƬFOLQHLQWKHEDWFKƬOH if errorlevel 3 goto Pictures
)LQLVKWKHƬOHZLWKWKHIROORZLQJDQGUXQLWDJDLQ if errorlevel 2 goto Documents
if errorlevel 1 goto Music
:N
echo.
HFKR<RXFKRVH1R*RRGE\H 67(3 1RZDGGWKH*RWRVHFWLRQV
goto End
:Y :Videos
echo. cls
echo You chose Yes. Hello &'+20(3$7+?9LGHRV
echo You are now in the Videos directory.
:End
goto End
:Pictures
cls
&'+20(3$7+?3LFWXUHV
echo You are now in the Pictures directory.
goto End
:Documents
cls
&'+20(3$7+?'RFXPHQWV
echo You are now in the Documents directory.
67(3 7KHRXWSXWIURP\RXUFKRLFHLVGLƪHUHQWGHSHQGLQJRQ
goto End
ZKHWKHU\RXSLFN<RU17KH(QGSDUWVLPSO\VLJQLƬHV
WKHHQGRIWKHƬOH DOVRNQRZQDV(2) :LWKRXWLWWKHEDWFKƬOHUXQV :Music
through each line and display the Y response even if you enter N; so it’s cls
LPSRUWDQWWRUHPHPEHUWRIROORZ\RXU*RWRFRPPDQGV &'+20(3$7+?0XVLF
echo you are now in the Music directory.
goto End
:End

STEP 6 :KHQH[HFXWHGWKHEDWFKƬOHGLVSOD\VDPHQXDQGZLWK
each choice the code changes directory to the one the
user entered. The %HOMEPATH% system variable will enter the currently
logged in user’s Music, Pictures and so directories, and not anyone else’s.

www.bdmpublications.com 
Coding with Windows Batch Files

Loops and Repetition


Looping and repeating commands are the staple diet of every programming language,
LQFOXGLQJEDWFKƬOHSURJUDPPLQJ)RUH[DPSOH\RXFDQFUHDWHDVLPSOHFRXQWGRZQRU
HYHQPDNHQXPEHUHGƬOHVRUGLUHFWRULHVLQWKHV\VWHP

COUNTERS
Creating code that counts in increasing or decreasing number sets is great for demonstrating loops. With that in mind, let’s look
at the If statement a little more, alongside more variables, and introduce the Else, Timeout and eof (End of File) commands.

STEP 1 6WDUWE\FUHDWLQJDQHZEDWFKƬOHFDOOHGFRXQWEDW 67(3 The count.bat is a rough way of demonstrating a


Enter the following, save it and run: loop; a better approach would be to use a for loop.
Try this example instead:
@echo off
cls @echo off
set /a counter=0 for /L %%n in (1,1,99) do echo %%n
QXPEHUV
set /a counter=%counter%+1
if %counter% ==100 (goto :eof) else (echo
%counter%)
WLPHRXW7QREUHDN!QXO
JRWRQXPEHUV

STEP 4 Breaking it
down, there’s
For, then the /L switch, which
handles a range of numbers.
Then the parameter labelled as
STEP 2 The count.
%%n to denote a number. Then
bat code
WKHLQ  SDUWZKLFKWHOOV
starts at number one and
the statement how to count,
counts, scrolling down the
DVLQ VWDUWQXPEHU  VWHSV
screen, until it reaches 100.
WRWDNH  WKHHQGQXPEHU 
The Timeout command
The next part is do, meaning DO
leaves a one second gap
whatever command is after.
between numbers and the
Else statement continues
until the counter variable
equals 100 before going to
WKHHRI (QG2I)LOH WKXV
closing the loop.

66 www.bdmpublications.com
Loops and Repetition

67(3 You can include the pause between the numbers STEP 8 7KHUHDUHGLƪHUHQWZD\VRIXVLQJWKH)RUORRS,Q
easily enough within the far simpler For loop by this example, the code creates 26 directories, one
adding multiple commands after the Do For loop. The brackets and for each letter of the alphabet, within the directory c:\test which the
DPSHUVDQG VHSDUDWHWKHGLƪHUHQWFRPPDQGV7U\WKLV EDWFKƬOHPDNHVXVLQJWKH0'FRPPDQG
@echo off @echo off
for /L %%n in (1,1,99) do (echo %%n & timeout /T 1 )25),1 DEFGHIJKLMNOPQRSTU
QREUHDN!QXO  VWXYZ[\] '2 PG&?WHVW?) 

STEP 6 2QHRIWKHJUHDWWLPHVDYLQJXVHVRIEDWFKƬOHVLVWR STEP 9 Loops can be powerful and extremely useful


FUHDWHPXOWLSOHQXPEHUHGƬOHV$VVXPHWKDW\RX HOHPHQWVLQDEDWFKƬOH:KLOHFUHDWLQJ
ZDQWWZHQW\ƬYHWH[WƬOHVZLWKLQDGLUHFWRU\DOOQXPEHUHGIURPWR directories may not sound too helpful, imagine having to create
25. A For loop much like the previous example does the trick: 1,000 users on a network and assign each one their own set of
XQLTXHGLUHFWRULHV7KLVLVZKHUHDEDWFKƬOHVDYHVDQLPPHQVH
@echo off
amount of time.
for /L %%n in (1,1,25) do copy nul %%n.txt

STEP 7 If you open Windows Explorer, and navigate to the STEP 10 Should you ever get stuck when using the various
Batch Files directory where you’re working from, FRPPDQGVZLWKLQDEDWFKƬOHGURSLQWRWKH
\RXFDQQRZVHHWH[WƬOHVDOOQHDWO\QXPEHUHG2IFRXUVH\RX command prompt and enter the command followed by a question
FDQDSSHQGWKHƬOHQDPHZLWKVRPHWKLQJOLNHXVHUW[WDQGVRRQE\ VZLWFK)RUH[DPSOHIRU"RULI"<RXJHWDQRQVFUHHQKHOSƬOH
altering the code to read: GHWDLOLQJWKHFRPPDQGVoXVH)RUHDVLHUUHDGLQJSLSHLWWRDWH[WƬOH
@echo off For /? > forhelp.txt
for /L %%n in (1,1,25) do copy nul User%%n.txt

www.bdmpublications.com 67
Starting with Raspberry Pi

Your journey with this amazing little


computer begins here. Say hello to the
Raspberry Pi; learn how it works, what
kind of operating system it has, what
you need to get it up and running and
PXFKPRUH7KLVLV\RXUƬUVWVWHSLQWR
the world of the Raspberry Pi.

Here, you’ll discover what makes the


Raspberry Pi such a fabulous little
computer and project board. There
are guides to the hardware, operating
system and what you’ll need to begin
with to start enjoying the software the
3LKDVWRRƪHUIURP\RXUFRPSXWHUoV
desktop. Now let’s see what this
DPD]LQJFRPSXWHUKDVWRRƪHU

What Pi is Right For You?


Raspberry Pi in Numbers
Kit You Need and How to Set it Up
Set Up Raspberry Pi Using a Mac
Set Up Raspberry Pi Using a Windows PC
The Raspberry Pi Desktop - What You Need
Debian Buster with Raspberry Pi Desktop

68 www.bdmpublications.com
Index

Starting with
Raspberry Pi

www.bdmpublications.com 69
Raspberry Pi is Good For You!

Which Pi is Right for Me?


With several models of Raspberry Pi available to purchase, you can be forgiven for any
confusion over which model you should buy. So, to help save you time and money, let’s see
which Pi is best for your needs.

THE POWER OF PI
:LWKPDQ\GLƪHUHQWYHUVLRQVDFURVVIRXUJHQHUDWLRQVRIPRGHOVWKH5DVSEHUU\3LLVFHUWDLQO\DEXV\OLWWOHERDUG%XWZKLOHHDFK3LRƪHUV
VRPHWKLQJVOLJKWO\GLƪHUHQWIRUWKHQHZFRPHULWoVDFRQIXVLQJPHGOH\RIKDUGZDUHVSHFLƬFDWLRQVDQGPRGHOQXPEHUV:KLFK3LWKHQLVEHVW
IRU\RX"
1DWXUDOO\WKDWTXHVWLRQVGHSHQGVJUHDWO\RQZKDWLWLV\RXZDQWWRGRZLWK\RXU5DVSEHUU\3L,I\RXKDYHDSDUWLFXODUSURMHFWLQPLQGVXFK
DVDKRPHPHGLDFHQWUHVHUYHUWKHQ\RXoGSUREDEO\RSWIRUWKHPRUHSRZHUIXODQGKDUGZDUHFDSDEOHPRGHORI5DVSEHUU\3L,I\RXZDQWWR
VHWXSDZLUHOHVVVHFXULW\FDPHUDSURMHFWXVLQJWKH5DVSEHUU\3LDVWKHFRUHKDUGZDUHWKHQSHUKDSVWKH3L=HUR:ZRXOGEHDEHWWHUƬW7R
EHJLQZLWKOHWoVKDYHDEULHIORRNDWWKHPRGHOVDYDLODEOH

FIRST GENERATION: SECOND GENERATION:


$OWKRXJKQRZTXLWHROGLQFRPSXWLQJWHUPVWKHƬUVWJHQHUDWLRQ 7KHUHDUHWZR3LVHFRQGJHQHUDWLRQPRGHOVDYDLODEOHWKH
5DVSEHUU\3LPRGHOVDUHVWLOODYDLODEOHWRSXUFKDVH7KHVHDUHWKH 0RGHO%DQGWKH0RGHO%YHUVLRQ$OWKRXJK\RXPD\EHKDUG
5DVSEHUU\3L0RGHO$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IWKHDYDLODEOHPHPRU\DW0%,WDOVR ,QFRQFOXVLRQWKH3L0RGHO%LVWKHPDLQ
ORVHVWKH(WKHUQHWSRUWDQGWKUHHRIWKH86% 5DVSEHUU\3LZRUWKFRQVLGHULQJLI\RXZDQW
SRUWVEXWLWGRHVERDVWGXDOEDQG:L)LDQGD The Pi 3 Model A+ WKHIXOO3LH[SHULHQFHXVHLWIRUSURJUDPPLQJ
IDUVPDOOHUIRRWSULQWWKDQSUHYLRXVPRGHOV was released in JDPLQJSURMHFWVFRQQHFWLYLW\DQGVRRQ7KH
2XWRIWKHWKLUGJHQHUDWLRQPRGHOVWKHRQHV November 2018 and 3L0RGHO$FDQEHXVHGIRUSURMHFWVWKDW
WRORRNRXWIRUDUHWKH0RGHO%DQG0RGHO greatly improves over UHTXLUHPRUHSRZHUEXWZKHUHDVPDOOHUVL]HLV
the previous Model A.
$7KH%ZLOOJLYH\RXDPRUHSRZHUIXO3L QHHGHG$QGWKH3L=HUR:IRUSURMHFWVZKHUH
H[SHULHQFHEXWLWFRVWVVOLJKWO\PRUH:KHUHDV DPXFKVPDOOHUIRRWSULQWDQGORZHUSRZHU
WKH0RGHO$LVPXFKVPDOOHUEXWODFNVWKH GUDZDUHQHHGHGDQG&38SHUIRUPDQFHLVQoW
H[WUDPHPRU\DQGDGGLWLRQDO86%SRUWV WRRLPSRUWDQW

Of the Pi models available,


The Raspberry Pi 3 Model we’d recommend the Pi 4
B+ is one of the best Pi Model B, Pi 3 Model B+
models available. and Pi Zero W.

The Raspberry Pi Zero W, with


built-in Wi-Fi and Bluetooth, is
a great project Pi.

www.bdmpublications.com 71
Raspberry Pi is Good For You!

Raspberry Pi in Numbers
The Raspberry Pi was one of the most successful launches of a
computer in decades. With the perfect mix of hardware, cost,
connectivity, and development, plus a good, stable Linux OS
to back it up, the Pi has proved itself to be a near-perfect
educational platform. Here’s some facts and figures for our
favourite flavour of Pi.

3.14159265358979...
TThere
heree are
are
e
ovver
ove
o ve
err
2,500
2,500
00
Raspberry
R aspbe
pberryy Pi
Pi
Certified
Certifie
ed
d
EEd
ducators
d ucators
IIt’t’s e
estimated
ssttimateedd
tthat
hat
haat ove
o
ov
over
ver
vve
er
TThere’
here re’
e’s a
e’
Raspb
Raspberry
R aaspberry
spbe
pberryy in in 250,0
250
0,,,000
000
000
00
Antarctica,
A nta
ttarctic
arc
rctticcaa, yyoung
yooung p people
eople
wh here
ere
ere it’
re it’t’s eve
every
ev eryy week
we
eek are
aree
aass co
ccold
old aass llearning
earning howhoow
w to
to
-42C
-4 42C
4
422C ((-4
(-45F)
-4
45F) F) ccod
oddee with
with a Pi
Pi

TThe heP
eP
Pii 4 iiss b
between
be
etwe ee
e en IItt iiss estimated
essttimate edd that
that
tthree
hre
ee
e e tto
o fofour
our ttimes
imes tthere
here
h erre e are
are e over
ovver
ove
ovve
er 50,000
er550,00
,000
more
m ore
e powerful
pow
p ow
owe
owe erfu
rful tthan
han co
cod
cood de clu
de club
clubbss across
acrro
oss
tthe
heP
ePPii 3 MModod
oddel
ell B
e B+
+ tthe
he wo w
world
orld using
using the
the
Raspberry
Ras
Ra
R aspb
aspbe
pberryy Pi
pbe Pi

During
D uring the
the
eruption
e ruption o off tthe
he
Kilauea
K
Kiilauea vvo volcano
olccaano
iin
n Hawaii
Hawa
aaw
waii iin
wa n IItt w
wass o
wa originally
riginally
2018,
2018 8,, a Ra
R
Raspberry
aspbe berryy goi
going
g oing to to b
bee called
called
ca ed
Pi wa
Pi was
w as uused
se
ed
d aass a Ra
R aspbe
pbe
Raspberryberryy P
Py,
y, as
as it
it
seismo
sseismometer
eismome
ei ete
etter
te wa
was
w as o nly
ly d
only designed
esigne ed d
to rrun
to un P
Pytython
yt
Python
Sources: The Raspberry Pi Foundation, The Guardian, readwrite.com, Popular Mechanics, CNN, BBC.

72 www.bdmpublications.com
Raspberry Pi in Numbers

IItt w
was
was Pi Z
Pi Zeros
eroos aare
re
euused
se
edd
originally
o riginally aass small
sma
mall camera
cameras,
cameraas,,
designed
d esigned placed
p lace
laceed
do onn tthe
he
ffor
fo
or schoo
school
scho oool backs
b aacks
cks
k o
off GGreen
ree
reee
een
cchild
hild dren
dre
ren
re
en SSea
ea Turtles,
Turt
rtles,, to
to
tto
o llearn
eaarn
e monitor
m onito tor h
hab
ha ab
bitation
ita
tation
electronics
electro
e leeccctronics
ectcttroonics
cs
aandnd co ccoding
cod
oding
od

FFebruary
ebruaryy 22019
019
019
maarkked
marked
m ke
ed the
the point
po
point
whhere
ere
re th
he
e
25
25 mi
milliiont
onth
Raspberry
Raspbe
pberryy Pi
Pi
was
wa
was ssold
old

IIn
n2 2017017 two
two o TThere
heree are
aree
Pi’i’s we
P w
wen
went
ent severa
sseveral
evve
e erraal
onbo
o nb board
oard d tthe
he IISS
SS Raspberry
Ra
Raspbe pberrryy Pi’
Pi’s
aandnd ran ran ccod
od
o
ode
de
d e iin
nB Borneo’
orne eo
eo’
o’s
o’
developed
d evve
e elop oped by b Rainforests,
Ra
R ainfo ore
ests,
sts,,
school
sschoolchild
cho oool cchild
hilddren
ren
rre
en monitoring
m onitotori
ring
biodiversity
b iio
odive
od ers
errsityy

Th hee TThe
he ttwowoommost osstt u
used
se
edd
Pi 4
P i 4 iiss Pii p
Piproj
P projects
roj
ro
ojjects aare
o re
e
powerful
pow
p owerfu
owe
ow
o we erfu
rful retro
rreetro oe emulation
emulation aand nd
enough
e nough
no aass a mmed
ed
e dia
d iiaa centre
centre
ce tre
e
tor
to
o rrun
un
Wind
W
Wiinddows
ows
ow
o wss1
w s1
10
0
aass a Th
TThin
hin
Cliient
ent SStacked
ttaacke ed
e deend
nd
to e
to end,
nd, aal
allll
tthe
heRe RaR
Raspberry
aspbe
pberryy
pberry
Pi’s wo
Pi’ w
would
ould
IItt iiss estimated
essttimate ed d that
that be
b etalle
e taller
taller
ta
tthere
here e aare
ree over
ovve
ove
o er 50,000
50,000 tthan
han tthe
ha he
codeclub
cod
co de
d e clu
club
clubbss aacross
crooss EEmpire
mpire e State
State
St
tate
ate
tthe
he wo world
orld using
using thethe Building
Building
Raspberry
Ras
Ra
R aspber
pberryy Pi.
pbe Pi.

www.bdmpublications.com 
Raspberry Pi is Good For You!

Kit You’ll Need


and How to Set it Up
The Raspberry Pi is as bare bones as a computer can get. You get a motherboard, but not
much else. So you’ll need a few extras to get it up and running but they’re things you’re likely
YTMF[JTWFYQJFXY‫ܪ‬SINYJFX^YTLJY^TZWMFSIXTS

ASK AROUND
The kit list required to set up a Raspberry Pi is pretty basic: keyboard, mouse, HDMI monitor, SD Card and an optional case. Many of these
items you’ll already have, but don’t rush out and buy those you don’t. Ask around to see if anybody you know has spares.

The most important thing you need is an SD Card. You’ll need a HDMI cable to connect your
STEP 1 STEP 3
These are the storage cards commonly found in digital Raspberry Pi to a monitor or television set; these
cameras. All modern Raspberry Pi boards, including the Raspberry Pi 3 cables are used with modern televisions and video game
and Pi Zero, use Micro SD cards but the older boards may use a larger FRQVROHVVR\RXVKRXOGQoWƬQGLWWRRKDUGWRSLFNXSDVSDUH,I
SD Card. you own a Pi Zero, or you’ve got a Pi 4, you’ll need a micro-HDMI
cable in order to connect to a monitor or TV.

The SD Card plugs into the SD Card socket. On the You’ll want to connect your Raspberry Pi to the
STEP 2 STEP 4
Raspberry Pi 4, 3, and Pi Zero, you push the card in Internet. The Raspberry Pi 4 and Pi 3 Model B+, have
and pull it out. On some older models, you push the SD Card in again built in wireless networking and Ethernet. The Model A+ and
to eject it. All SD Cards have a notch on one corner that ensures it Raspberry Pi 2 include an Ethernet socket, but the Pi Zero and older
only goes in one way round. Unless you bought a card with NOOBS boards will require either an Ethernet adaptor or a Wi-Fi dongle to
SUHLQVWDOOHG\RXoOOQHHGWRLQVWDOOWKHVRIWZDUHRQLWƬUVW JHW{RQOLQH

74 www.bdmpublications.com
Kit You’ll Need and How to Set it Up

Both the Pi 4 and 3 come with four USB sockets but if


STEP 5
you own a Pi Zero, you may need to purchase a USB GETTING EVERYTHING CONNECTED
Hub. These connect into the USB socket, and provide four (or more)
USB connections. Typically, you need to connect a keyboard and a Now that you’ve got all the basics you’ll need to get everything
mouse, so at least two USB ports are required. VHWXS,I\RXKDYHQoWLQVWDOOHGWKH122%6ƬOHVRQ\RXU6'&DUG
WKHQLWoVEHVWWRGRWKDWƬUVW VHHWKHQH[WIHZSDJHV 

Connect your Raspberry Pi to the monitor using the


STEP 1
HDMI cable. Now attach the keyboard and mouse
to separate USB ports. If your Raspberry Pi only has one USB port,
connect the mouse and keyboard to the USB hub and attach it.

Now, if required, connect the Ethernet cable to the


STEP 2
Raspberry Pi. Connect the other end of the cable
directly into your modem/router or into a network socket.

7ZRWKLQJVWKDWVKRXOGEHHDV\WRƬQGDUHD86%
STEP 6
Keyboard and USB Mouse. We routinely prefer USB
devices that plug directly into the Raspberry Pi, but devices with
wireless dongles generally work just as well. Only the Raspberry Pi 4
and 3 Model B+ come with Bluetooth as standard, so you’re best bet
is to opt for USB, if possible.

Finally connect a Micro USB cable to the power


STEP 3
supply and attach the other end to a 5V USB power
adapter. This is the type used to power most modern smartphones,
so you should be able to source a spare. Press the On button to
power up your Raspberry Pi.

You can also choose to house your


Raspberry Pi in one of many enclosures
like the official one pictured here.

Consider a case to hold your Raspberry Pi


STEP 4
WRJHWKHU5DVSEHUU\QRZPDNHVDQRƯFLDOFDVH
that you can use to hold all the components and protect it from
knocks and drops.

www.bdmpublications.com 
Raspberry Pi is Good For You!

Set Up Raspberry Pi
Using a Mac
You should install NOOBS (New Out Of Box Software) on your SD Card before you go
any further. This feature looks at how to format an SD Card and copy the software
using an Apple Mac computer.

GETTING TO KNOW NOOBS


The easiest way to get up and running is to use NOOBS, a software program created by the Raspberry Pi Foundation. You can buy a NOOBS
SD Card from Raspberry Pi but it’s easy to make your own with an old unused SD Card (8GB recommended).

We’re going to use a utility called SD Card Formatter 5 Make sure the card is present in the Select Card area;
STEP 1 STEP 3
to erase the SD Card with correct formatting. You can you should only have one SD Card inserted into your
download this app from https://www.sdcard.org/downloads/ Mac. Open SDFormatter and choose the Overwrite Format option to
formatter_4/. Click Download SD Formatter for Mac and Accept. Click ensure that all the old data is removed from the card. Enter a name for
WKH6')RUPDWWHUSNJƬOHLQ\RXU'RZQORDGVIROGHUDQGIROORZWKH WKHFDUGLQWKH1DPHƬHOGWRKHOS\RXLGHQWLI\LWDOWKRXJKWKLVLVQoW
instructions to install the app. necessary for the installation process.

Use an SD Card of at least 8GB capacity to install the Click the Format button when you are ready to wipe
STEP 2 STEP 4
operating system on your Raspberry Pi. The card the card. There are other ways to format SD Cards in
needs to be formatted, which will erase all the data on it, so make macOS (in particular Disk Utility) but the advantage of SD Card
VXUH\RXKDYHFRSLHGDQ\ƬOHVIURPLW\RXZDQWWRVDYH,QVHUWWKH formatter is that it wipes SD Cards with the correct FAT32 format and
SD Card into your Mac, either directly into the SD Card slot or with GRHVQoWDƪHFWWKHSURWHFWHGSDUWLWLRQ,WFDQWDNHDZKLOHWRIRUPDWWKH
an SD Card adaptor. SD Card, but the progress bar will show you how the process is going.

76 www.bdmpublications.com
6HW8S5DVSEHUU\3L8VLQJD0DF

:KHQ6'&DUGIRUPDWWHUKDVƬQLVKHGIRUPDWWLQJWKH 1RZLWoVWLPHWRGRZQORDGWKH122%6VRIWZDUHIURP
STEP 5 STEP 6
6'&DUGLWZLOOEHPRXQWHGVR\RXFDQDFFHVVLW%\ WKH5DVSEHUU\3LZHEVLWH2SHQ6DIDULDQGHQWHU
GHIDXOWPRXQWHGYROXPHVDSSHDUDVDQLFRQRQWKHGHVNWRS,IQRW www.raspberrypi.org/downloads/LQWRWKH6PDUW6HDUFK)LHOG6FUROO
RSHQDQHZ)LQGHUZLQGRZDQGFKHFNIRULWXQGHU'HYLFHV&KHFNWKDW GRZQWRƬQGWKH122%6VHFWLRQ QRW122%6/,7( DQGFOLFN
WKH6'&DUGLVDFFHVVLEOHDQGFOLFN&ORVHLQ6')RUPDWWHU 'RZQORDG=LS$]LSƬOHFRQWDLQLQJWKH122%6ƬOHVZLOOEHSODFH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VSEHUU\3L

www.bdmpublications.com 77
Raspberry Pi is Good For You!

Set Up Raspberry Pi Using


a Windows PC
It’s easy to set up your Raspberry Pi with a Windows PC by downloading and copying
NOOBS. This installs a selection of OS’s onto the Raspberry Pi. So let’s format your SD Card
and install NOOBS using a Windows PC.

SETTING UP WITH NOOBS


NOOBS (New Out Of Box Software) is a program used to make setting up a Raspberry Pi simple. You can buy SD Cards with NOOBS
preinstalled, but here we’ll look at how to format your SD Card and install NOOBS using a Windows computer.

We’re going to use a utility called SD Card Formatter The Drive letter will be automatically assigned
STEP 1 STEP 3
to erase the SD Card with correct formatting. You can depending on the drive(s) in your PC. Click Refresh if it
download this app from https://www.sdcard.org/downloads/ FDQoWƬQG\RXU6'&DUG(QVXUHWKH4XLFN)RUPDWRSWLRQLVVHOHFWHG
formatter/eula_windows/index.html. Click the Accept button to start (QWHUDQDPHLQWKH9ROXPH/DEHOƬHOGWRPDNHLWHDVLHUWRLGHQWLI\WKH
the download of the latest version of the software. Extract the card (we used “SD Card”).
software, and double-click the executable to install and run the app.

We’re going to use an 8GB SD Card to install the Click the Format button and Yes when you are ready to
STEP 2 STEP 4
operating system on our Raspberry Pi. The card needs to wipe the card. There are other ways to format SD
be formatted, which will erase all the data on it, so make sure you have Cards in Windows, but the advantage of SD Card formatter is that it
FRSLHGDQ\ƬOHVIURPLW\RXZDQWWRVDYH,QVHUWWKH6'&DUGLQWR\RXU3& ZLSHV6'&DUGVZLWKWKHFRUUHFW)$7IRUPDWDQGGRHVQoWDƪHFWWKH
either directly into the SD Card slot or using an SD Card adaptor. protected partition. Click OK again, when the format is complete.

78 www.bdmpublications.com
Set Up Raspberry Pi Using a Windows PC

Click Exit to close down the SDFormatter program. Now it’s time to download the NOOBS software from the
STEP 5 STEP 6
Click Start > File Explorer and choose the SD Card Raspberry Pi website. Open a web browser and enter
in the sidebar. The drive should be empty, but we will copy the https://www.raspberrypi.org/downloads/noobs/LQWRWKH85/ƬHOG
ƬOHVWRLWLQWKHQH[WVWHSV)RUQRZMXVWPDNHVXUHWKDW\RXFDQ 6FUROOGRZQWRƬQGWKH122%6VHFWLRQ QRW122%6/,7( DQGFOLFN
access the empty root of the SD Card. 'RZQORDG=LSDQG6DYH$]LSƬOHFRQWDLQLQJWKH122%6ƬOHVLVFRSLHGWR
your Downloads folder. Click Open Folder when it is done.

COPY THE SOFTWARE


&RQWLQXHPDNLQJ\RXU6'FDUGE\FRS\LQJWKHƬOHVDFURVV

A NOOBS folder should appear in your downloads. It :DLWIRUDOORIWKHƬOHVWREHFRSLHGIURP\RXU


STEP 1 STEP 3
will be marked with the version number that you 'RZQORDGVIROGHUWRWKH6'&DUG7KHƬOHVWKDWDUH
downloaded from the Raspberry Pi Downloads web site. Double- copied will install an operating system of your choice on the Raspberry
FOLFNWKH122%6]LSƬOHLQ\RXU'RZQORDGVIROGHUWRYLHZWKH 3LZKHQ\RXƬUVWERRWLWXS,WLVLPSRUWDQWWKDWWKHƬOHVDUHFRSLHGWR
FRQWHQWV7KHVHDUHWKHƬOHV\RXQHHGWRFRS\WRWKHURRW EDVH RI WKHURRW EDVH RIWKH6'&DUGDQGDUHQRWLQVLGHDQRWKHUIROGHUVXFK
your SD Card. as the NOOBS folder.

&OLFN([WUDFW$OOWRH[SDQGWKH]LSSHGƬOHDQGH[WUDFW &OLFN6WDUW!)LOH([SORUHUDQGFKRRVHp6'&$5' ) qLQ


STEP 2 STEP 4
its contents. Click Browse in the Select a Destination the sidebar to display the contents. It should now
DQG([WUDFW)LOHVIROGHUDQGFKRRVHp6'&DUG ) qLQWKH6HOHFWD FRQWDLQDOOWKHƬOHV122%6QHHGVWRVHWXSDQRSHUDWLQJV\VWHPRQ
'HVWLQDWLRQZLQGRZ&OLFN6HOHFW)ROGHUDQG([WUDFW7KHƬOHVZLOOQRZ your Raspberry Pi. Check that you can see a Defaults folder, bootcode
EHFRSLHGGLUHFWO\IURPWKH]LSƬOHWR\RXU6'&DUG DQG%8,/''$7$ƬOHVDORQJZLWKWKHRWKHUƬOHVVKRZQKHUH5HPRYH
the SD Card from your Windows PC. It’s now ready to be inserted into
the Raspberry Pi.

www.bdmpublications.com 79
Raspberry Pi is Good For You!

The Raspberry Pi Desktop:


What You Will Need
Did you know that there is a way in which you can run the full Raspbian OS desktop without
even needing a Raspberry Pi? The Raspberry Pi Desktop edition is a fully working, Debian-
based installation of Raspbian that can run on a standard PC.
In 2016, the Raspberry Pi Foundation started work on an x86 Since then, the Raspberry Pi Desktop, or as it’s correctly called:
version of its popular Raspbian operating system. By the end of Debian Stretch with Raspberry Pi Desktop, has followed the same
the following year, there was a link on the Downloads page and release path as its Pi-based sibling. However, there are some
non-Pi owners could now install and use Raspbian in almost the GLƪHUHQFHV\RXQHHGWREHDZDUHRISULRUWRWKURZLQJ\RXU3L
exact same way as if they were in front of a Raspberry Pi. away and opting for this version instead.

The Raspberry Pi Desktop (x86 version) allows you to view the


same desktop and pre-installed software as the Full Desktop
version available for the Raspberry Pi. You can install it on any
decent PC, or laptop, one that’s at least six or seven years old
would be perfect and as a PC that age usually struggles with
the latest version of Windows 10, you can now install Raspbian
instead of boxing that old kit and resigning it to a life of
JDWKHULQJGXVWLQWKH{ORIW

7KHPDMRUGLƪHUHQFHLVWKDWWKLVYHUVLRQKDVEHHQFRPSLOHGWRUXQ
on x86 processors, that’s Intel and AMD PC processors. Whereas,
WKHYHUVLRQRI5DVSELDQWKDW\RXZLOOƬQGRQD5DVSEHUU\3LKDVEHHQ
compiled and created exclusively for ARM processors; the type of Another caveat worth mentioning is that you won’t have access to
&38D5DVSEHUU\3LXVHV7KHVH&38VXVHDGLƪHUHQWDUFKLWHFWXUH the 40-pin GPIO that the Raspberry Pi features, as this isn’t a standard
to that of an Intel or AMD CPU, so the software required to run on piece of hardware on a normal PC. There is, however, a way around
RQHZRQoWUXQRQWKHRWKHUXQOHVVWKHGHYHORSHUKDVVSHFLƬFDOO\ this. If you own a Raspberry Pi Zero (either with or without the W),
made either an x86 or ARM version. In short, if you’ve found a piece then you’re able to connect the Zero to a spare USB port on the PC,
of software that you enjoy using on your Raspberry Pi, you won’t via the Zero’s micro USB port and the Raspberry Pi Desktop OS will
be able to use it on the Raspberry Pi Desktop x86 version – UNLESS, recognise the Zero as extended hardware and allow you access to the
there’s a dedicated x86 version of the software. =HURoVSLQ*3,2ZKLFK\RXKDYHWRDGPLWLVSUHWW\FOHYHUVWXƪ

80 www.bdmpublications.com
The Raspberry Pi Desktop: What You Will Need

WHAT YOU WILL NEED


Here’s a list of items needed if you want to test out the latest version of the Debian Stretch with Raspberry Pi Desktop OS on your PC.

Naturally you’ll need the Raspberry Pi Desktop OS, just The best method of transferring the ISO to a PC for
THE OS USB STICK
as you would with Raspbian or the Pi. Open a browser installation is to use a combination of a tool such as
DQGGRZQORDGWKH,62ƬOHWKDWFRQWDLQVWKH26IURPhttps://www. Rufus (found at: https://rufus.ie/en_IE.html), which is a piece of
raspberrypi.org/downloads/raspberry-pi-desktop/. VRIWZDUHWKDWFDQFUHDWHDERRWDEOH86%GULYHUIURPDQ,62ƬOHDQGDW
least, an 8GB USB stick.

An older desktop PC or laptop is an ideal Although not strictly a necessity, a


A COMPUTER RASPBERRY PI ZERO
candidate for running the Raspberry Pi Desktop spare Raspberry Pi Zero will allow you
OS. While you can easily use the latest PC/laptop, it’s a bit overkill for to access the 40-pin GPIO from within the Raspberry Pi Desktop OS. If,
WKLVSDUWLFXODURSHUDWLQJ{V\VWHP however, you don’t have a spare Zero, it’s not a problem as there’s still
plenty you can do with Raspbian on a PC.

HOW TO SET UP THE


RASPBERRY PI DESKTOP
Setting up the Raspberry Pi Desktop version on a PC or
laptop is very simple, and follows roughly the same method
as the previous Mac and Windows setups for the Pi. Begin by
downloading the ISO image from https://www.raspberrypi.
org/downloads/raspberry-pi-desktop/, then download Rufus
from https://rufus.ie/en_IE.html. Insert an 8GB USB stick
and run Rufus, then follow the on-screen instructions to
locate the downloaded Desktop ISO. Once the image has
transferred to the USB stick, remove it from the computer
and insert it in the spare laptop/PC. Select Boot from USB
from your system’s BIOS/UEFI then follow the instructions to
use and install the Raspberry Pi Desktop OS.

www.bdmpublications.com 81
Raspberry Pi is Good For You!

Debian Buster with


Raspberry Pi Desktop
You can be forgiven for thinking that a version of the Pi OS that isn’t on a Raspberry Pi is
somehow lacking, and therefore a bit pointless in its use. However, there’s a lot that you can
do with the Debian Buster with Raspberry Pi Desktop version.

10 THINGS TO DO WITH X86 RASPBERRY PI OS


There’s just as much you can do with this version of Raspberry Pi OS as with the dedicated Pi version. Here’s ten great projects, and things to
do with Debian Buster with Raspberry Pi Desktop.

This version of Raspbian apes the Full Desktop version As the x86 version of Raspbian follows the Full
CODING FULL DESKTOP
for the Raspberry Pi, so that means it comes with all 'HVNWRS3LYHUVLRQWKHUHoVDQHQWLUHRƯFH
the necessary programming languages out of the box. Learn Python, suite pre-installed. That means you can use that old laptop or PC as a
C++, use the HAT emulator, and even learn JAVA. It’s all there under fully functional desktop replacement for Windows or macOS.
the Programming menu option. /LEUH2ƯFHLVDOVR0LFURVRIW2ƯFHFRPSDWLEOH

Hook up a Pi Zero without an SD installed, and As with most modern operating systems,
HARDWARE WEB BROWSING
select GPIO Expansion Board from the options, you can also browse the Internet exactly the
and you will be able to talk to the Zero’s 40-pin GPIO via the likes of same as you would with the likes of Windows 10 or the latest macOS.
3\WKRQRU6FUDWFK%\GRLQJVR\RXoOOKDYHDOOWKHEHQHƬWVRID As this is a Linux-based OS, there’s also an added element of security,
Raspberry Pi, with the power of your laptop. DV:LQGRZVWDUJHWHGYLUXVHVZRQoWDƪHFWLW

82 www.bdmpublications.com
Debian Buster with Raspberry Pi Desktop

As this is a Debian based The Raspberry Pi, even the Pi 3 Model B+, isn’t
/,18;;Ǖ%$6('62)7:$5( 0,1(&5$)7
version of Linux, you can the most powerful computing device available.
naturally install any of the tens of millions of Linux x86-based software <RXUROGHUODSWRSLVSUREDEO\VLJQLƬFDQWO\PRUHSRZHUIXODQGDV
currently available. Remember though, only software that has both an such, you will be able to play the likes of Minecraft without too
ARM and an x86 version will work on both the Pi version and this much trouble.
version of Raspberry Pi OS.

The Recommended If retro gaming is more to your tastes, then


5(&200(1'('62)7:$5( 5(752*$0,1*
Software option is also Debian has a huge number of retro
available with the version of the PI OS. This tool allows you to pick and emulators available covering consoles and home computers. You will
choose which of the Pi-favoured software you can add or remove. need legal ROMs, however, to play the games, but these are widely
Simply tick the box next to the name of the app. available from reputable sites.

It’s easy to use SSH from within the Raspberry Pi *$0,1* Of course, there’s also an equally large selection of
66+
&RQƬJXUDWLRQWRRO6HOHFWWKH(QDEOHGRSWLRQWKHQXVH modern gaming available for Debian; most of which
a client such PuTTY to SSH into the OS. Here we’ve enabled SSH will run perfectly well under the Pi OS in an x86 environment. You will
and have connected from another Windows PC, using PuTTY as need to Google what’s available, and try out a few examples, the list is
the SSH client. simply too big to mention.

www.bdmpublications.com 
TECH ROUND-UP

Tech Round-Up

If you’re looking for something


different for your device, this is the
place to start. Each issue, we take
a look at some of the best and
worst peripherals, gadgets and
apps that have crossed our path.

84 | www.bdmpublications.com
TECH ROUND-UP

ঌত঵ধ঺ত঵ন
গঘ঑ইফত঵পনঘ঵ননগ঺ব঱প
঍ॵॺॴॵঔঅওইॵॺঐইঈ঑ল঱বষল঵
অব঵ঐবষগরত঵ষঊত঱
ঌতযলঐলদমঅধভসশষতথযনছব঵নযনশশইফত঵পব঱পগষত঱ধ
ইসথথবষইনযয
ঋ঵ললহॱন঎তঽঽআসধশ
উগখঋনত঵ঌতযলঐলদমএবদমশষত঱ধ

গল঩ষ঺ত঵ন
ঈ঻ওঔফলষলঐতথॹ
ঈ঻ওঊবযরঔতদমॺ
অএচ঍গ঑তপ঱ব঩বন঵অ঍ॵॵ
ঌঙ঑অ঒঍ঘঝত঳঳
঑লষব঩ঔফলষলইত঱হতশগন঵হবদন
ইযলসধআতষষন঵়

ঋতরনশ
গ঳ল঱পনআলথঔতষষ়ঔস঵শসবষ
ঈলসথযনঈ঵তপল঱ঘ঵বযলপ়
ঔলমনরল঱ঙ঒঍ঘউ
ঞলরথবন঒বপফষঘন঵঵ল঵

©2021 Pokemon. ©1995-2021 Nintendo/Creatures www.bdmpublications.com | 85


Inc./GAME FREAK inc. ©2021 Tencent.
TECH ROUND-UP

STM ChargeTree Swing


Charging station
Charge three, with Qi!

Info//
STM Ltd.
www.stmgoods.com
£69.95, $79.95, TBA €

T
his second-generation STM ChargeTree
makes a few minor, but welcome, changes
from the original model. Like the original
ChargeTree it’s available in black or white, and
it once more charges a Qi-compatible iPhone,
AirPods (with a wireless charging case), and an
Apple Watch - all at the same time, using only
one power socket. You just need a USB-C mains
adapter of at least 20W. It’s not supplied, but
they’re not hard to come by.
As before, you charge your iPhone by resting it
on the backward-leaning mat at the front of the
ChargeTree Swing. It’s comfortably cushioned,
and there’s an optional rubber raiser to fit over
the foot if you have a smaller iPhone that needs
the extra height. Also as before, your earbuds

86 | www.bdmpublications.com
TECH ROUND-UP

Series 2 or later; the first-generation device not


being Qi-compatible.
sit on a charging pad mounted horizontally on
But our favourite change is the way the lights
the stand. As it’s designed with Apple fans in
that indicate your tech is charging work. As
mind, this is intended for wireless-charging
before, there are three LEDs in the foot of the
AirPods, though there’s no reason a third-party
ChargeTree Swing, one for each device.
set of earbuds shouldn’t charge there, as long
When you place your iPhone, Apple Watch and/
as they have a wireless-charging case. Mine, for
or your earbuds on its charger, a corresponding
instance, do.
LED lights up to let you know it’s correctly
seated and charging. But now these lights go
Leading the charge... off after a few seconds. At last, you can use a
The main change from the previous ChargeTree ChargeTree in your bedroom without being kept
is the way it handles the Apple Watch. This is awake by always-on illuminations. The original
now charged on an extending arm, which can ChargeTree was good, but the sleep-destroying
be retracted when not in use. It looks much LEDs and inability to see the watch face from
smarter there, and if you want to know the time, your pillow were serious oversights. The new
you can just nudge your desk or bedside table STM ChargeTree Swing corrects both these
to illuminate the watch face. Like the original faults, and lets you use it however you want,
ChargeTree, this one can charge an Apple Watch including on the bedside table.

www.bdmpublications.com | 87
TECH ROUND-UP

I1601P AOC 16
LCD Monitor
Is this portable screen a worthy addition to your travel bag?

Info//
AOC
https://eu.aoc.com/en
£199, $199, 239 €

T
he problem with working away from home on your notebook is you’ve probably
got no access to a second monitor. Sure, there’s your iPad using the Sidecar
feature, but do you miss the high-definition, 16-inch behemoth you have on your
desk? This portable screen from AOC is designed to fill precisely that gap.
The I1601P (why must monitor manufacturers use such boring names?) is 15.6
inches corner to corner and has a resolution of 1920x1080 (1080p). Not a match
for your 3072-by-1920 16-inch Retina MacBook Pro, but it’s a decent screen in its
own right. One area where it can’t compete with Apple’s screens is the colour gamut.
Whereas the current range of Mac notebooks all support millions, and possibly a billion,
colours, the AOC external screen can only manage 262 thousand. Fine for general
computing, spreadsheets, word processing and other mobile-office tasks, but graphic
designers should use it for notes and tool windows, keeping the actual designs on the
Mac’s screen.

USB, See?
Weighing in at 800g and measuring just 37.5x23.5x0.7cm, the I1601P is very
portable. It has a useful kickstand which attaches to the back of the screen
magnetically, and can hold it in portrait or landscape orientation. When not in
use, the kickstand folds flat and acts as a screen protector, again held in place
magnetically. The screen draws its power from the device to which it’s attached
too, so there’s no bulky power brick to carry around.
This leads us to the screen’s main drawback. It only has one connectivity
method. Basically, this monitor is only for notebooks with USB-C ports that
offer DisplayPort over USB, which includes Thunderbolt Macs, though you
might need a Thunderbolt cable instead of the USB-C cable that came with it.
You can even use it with an iPad Pro (mirrored screen only), but if your gear
is too old for this connectivity, this monitor is not for you.

88 | www.bdmpublications.com
TECH ROUND-UP

AirLit Smart Fan


Desk Fan
Don’t sweat it – AirLit is here!

Info//
GeoSmartPro
www.geosmartpro.
com
£89.99, $119.99,
99.99 €
Compatibility: iOS
10.0 or later

B
ritish start-up GeoSmartPro specialises in up automatic routines to have the fan – and/or
smart-home gadgets. Its latest release is its lights – turn on and off at scheduled times, or
AirLit, a n iPhone app-controlled smart fan when the weather changes. The latter can include
that’s packed with extra features. humidity, temperature, wind speed and more.
As a fan, it’s 44cm high with its telescopic GeoSmartPro AirLit Smart Fan is a great
stand retracted, or 100cm with it extended. The addition to anyone’s bedroom, study or anywhere
fan itself is 45cm wide. An eight-hour battery in else where you need a decent fan or ring light.
the stand means you can use it all day without Our only complaint is while it’s Google and Alexa
mains power, or you can plug it into a mains compatible, it doesn’t play nicely with HomeKit.
adapter using a USB-C cable. You can control the
fan using your iPhone and the GeoSmartPro app.
Use your phone to switch it on (obviously), set its
wind speed to one of four levels and more. On
the lowest setting it’s very quiet, and even when
pumping out as much air as possible, it’s not all
that loud as fans go.

LED of the Rings


There’s a ring of LEDs surrounding the fan, which
you can also switch on using the app. You can also
change the colour temperature, but not the colour
itself; white LEDs only. And there’s a mirror you
can place over the centre of the device. It attaches
magnetically and allows shadow-free make-up
application with the lights on your face, but not
in your eyes. There’s a phone holder thrown in
for good measure too. It clips on the telescopic
stand in portrait or landscape mode, and with
the lights switched on, it makes for a perfectly
illuminated video chat. And if you need a ring light
for photography, you can use it for that too.
Naturally, being a smart device, you can set

www.bdmpublications.com | 89
TECH ROUND-UP

HaloLock
Adjustable Wireless Charging Stand
One-touch mounting, convenient charging...

Info//
ESR Gear
www.esrgear.com
£41.39, $45.99,
41,39 €

T
o no one’s great surprise, third-party USB-C to USB-C cable, but the power adapter is
manufacturers have been quick to release not included. Unfortunately, the cable connects
MagSafe-compatible gear for the newest to the square charger atop the flexible arm rather
smartphones, you’re spoiled for choice when it than the stand’s base, which would be more
comes to chargers, cases and more that fit to convenient and out of the way.
your phone magnetically; for pop-on, pop-off The HaloLock Adjustable Wireless Charging
convenience. This adjustable wireless charging Stand is compatible with a caseless iPhone 12
stand is just such a product. or 13, or with an older Qi-charging iPhone, with
With four pivot joints on a 20cm stand, you can a MagSafe-compatible case. Note that there’s
bend the HaloLock into any position you choose. a discounted iPhone 12 version of the product
It’s ideal for your desk, where you can place that’s not compatible with the iPhone 13, and a
your iPhone, to glance at incoming notifications version that works with both. Make sure you get
as it charges. You can rotate it into portrait or the right one for what you want.
landscape mode, and powerful built-in magnets
securely hold it in place, even when it vibrates. It
connects to your mains power using a bundled

90 | www.bdmpublications.com
TECH ROUND-UP

Jazz Buds
Bluetooth Earbuds
Can affordable earbuds impress in the audio department?

N
ot everyone wants or needs to spend three figures on a
Info// set of Bluetooth earbuds. Thankfully, the quality of lower-
priced buds is improving all the time. This sub-30 pair from
Groov-e Groov-e might not be a match for top of the range models, but
www.groov-e.co.uk their performance belies the price.
£29.99, $39.99, Jazz Buds closely resemble Apple’s own AirPods in
34.99 € appearance; a speaker unit placed in the ear, with an aerial
Compatibility: extending downwards from it. They have a four-hour battery life,
Bluetooth audio which isn’t great, but there’s another 21 hours of power in the
devices charging capsule. As long as you don’t need to listen to them all
day without a recharge, they should be fine.
They don’t isolate well, so you can’t block ambient sounds
without turning the volume up, but they don’t leak much sound
either. Listening to them in the living room while your family
watch TV shouldn’t be a problem.
And they sound great. Audiophile quality? Of course not, but
for such a low-cost set of earbuds, they’re certainly impressive.
Bass is surprisingly rich without overshadowing the mid section,
and vocals are reproduced with clarity. The sound stage isn’t as
broad as you’d get with expensive earbuds, but it’s by no means
squashed. All in all, they’re a bargain.

HaloLock Kickstand
by ESR Gear
Is this the MagSafe device you’ve been looking for?

T
his disc-shaped MagSafe charger connects
Info//
ESR
to the mains through USB-C (adapter not
included), and fastens to your iPhone using
the magnets built in to the last two models. It’s
www.esrgear.com
a small, pocket-sized device that’s pretty handy
£32.39, $35.99, 32,39 € when you’re out and about, as long as you’ve
Compatibility: iPhone 12 or access to a USB-C mains adapter. It’s well built,
later with an aluminium body and stand, and a black or
white charging surface. With the leg folded away
it can function as a flat charging mat, and when
used as a stand you can prop up your iPhone in
landscape orientation (but not portrait) and watch
a movie or a YouTube video.
As a product, the HaloLock Kickstand falls
between two stools; as a permanent stand,
there are more versatile devices out there, and
for travellers, you might as well just take your
Lightning cable. Even so, we can’t fault the quality
on offer here.

www.bdmpublications.com | 91
TECH ROUND-UP

Cubbit Cell
Network Storage Drive
A new kind of storage drive; NAS, but not as you know it.

Info//
Cubbit Cell
www.cubbit.io
1TB: £303, $419,
349 €

W
here do you keep your computer’s data and you can add up to 3TB by plugging in an
files? You could use an external hard extra hard drive or two. When it’s plugged
drive, but then you can’t access your in and switched on, your Cubbit Cell forms a
files over the Internet, and if you’re burgled and it network with all other Cubbit Cells, keeping them
gets stolen with your computer, you’ve lost your connected on a peer-to-peer basis. Instead of
data. You could use a NAS drive, but these are directly storing your files locally in just one piece
notoriously user-unfriendly, and again, if it gets of hardware like a NAS drive, the Cubbit Cell
stolen with your Mac, you’ve lost your data. What first encrypts them to AES-256 standard, splits
about the cloud? There’s no danger of having your them into chunks, duplicates those chunks so
files stolen with your equipment there, but you there’s more than one of each and spreads them
have to pay a monthly fee for whatever storage across the Cubbit network. Your files are thus
space you need. Or you could use Cubbit Cell, a disaster proof, available for online access and no
new kind of cloud storage. one other than you (including the Cubbit staff)
Cubbit Cell is a storage drive that connects can access them. As they’re stored in several
to your router. A product rather than a service, places and accessed with parallel peer-to-peer
it demands no fees beyond the price of the unit connections, accessing them over the Internet is
itself. It’s available in 1TB, 4TB or 8TB capacities, much faster than with NAS drives too.

92 | www.bdmpublications.com
TECH ROUND-UP

out. Multiple cloud accounts on a single Cubbit


It’s so easy! Cell are promised, as are mobile apps, including
Another advantage Cubbit Cell has over some one for the iPhone. We’re also told speed will be
other forms of data storage is it’s easy to use. optimised over time too. It’s a little slow at the
All you need to do is plug it in, then sign up for an moment, but perhaps this is inevitable as the
account at the Cubbit website. Download an app device grows in popularity and the huge peer-
for Macs, Windows and Linux, and you’re done; to-peer network establishes itself. Remember,
you can move files into and out of your Cubbit Cubbit Cell is a first; no one has ever attempted
Cell storage, and access them on any device anything like this before. It’s inevitable the
with a web browser. On a Mac, you’re restricted system will grow and improve as it beds in. If
to files of 200MB or lower when using the web you’re after a secure remote storage option that
interface, but this restriction does not apply if you can access over the Internet, it’s definitely
you’re on the desktop app. And like any folder, worth a look.
you can drag your Cubbit storage folder into the
Finder window’s sidebar and access your files
from Finder.
There are a few things the team need to iron

www.bdmpublications.com | 93
TECH ROUND-UP

DxO PhotoLab 5
Significant improvements, but should you upgrade?

Info//
DxO
www.dxo.com
Standard: £129.00, $139.00,
139,00 €
Elite: £199.00, $219.00,
219,00 €

D
xO is back with this year’s annual update of retouching a photo far more intuitive. It’s long
its flagship PhotoLab high-end photo editing been possible to define Control Points, which
suite. Version 5 offers a small but significant mask part of a photograph so you can apply a
update from last year’s release, is available in filter to the rest of it, letting you touch up parts
Standard and Elite versions and there’s a discount of a photo while leaving the rest alone. Now,
if you’ve already bought PhotoLab 3 or 4. There’s with Control Lines, you can give larger areas a
also a launch discount available, so if you buy lift without having to define multiple Control
before 14th November 2021, you get a substantial Points. For example, you could draw a Control
knockdown on the prices listed here. Line along a horizon, and redefine the sky’s
As regular readers know, DxO PhotoLab colour palette to give it a more intense shade
is an image editor designed specifically for of blue. Before, you had to place a number
photographers. It’s a high-end suite of tools that of Control Points along the sky until you’ve
takes a while to master, but can produce excellent covered it completely, but now you can do it
results. During set up you can choose between more efficiently. For an even greater degree of
three levels of difficulty, depending on your skills precision, both Control Lines and Control Points
and experience, and you can switch between have sensitivity settings, which means you can
Standard and Advanced Workspaces at any time. adjust the intensity of their effects.
The easier user settings allow the application to You can now edit EXIF and IPTC metadata
do more for you, while at expert level, you have in PhotoLab, and add keywords to your
full control over the application’s adjustments and photographs, using an interactive tree structure.
corrections. For example, if you took a bunch of pictures
in London, you can label them all ‘London’. If
a portion of these pictures were taken in the
On the line... British Museum, you could add that as a sub-
The new release of PhotoLab gives you more label, so their keywords are ‘London > British
control over your workflow and your tools. A Museum’. You could then label pictures of
brand new tool introduced with PhotoLab 5 individual exhibits as (for example), ‘London >
is Control Lines, which is designed to make British Museum > Rosetta Stone’. This means

94 | www.bdmpublications.com
TECH ROUND-UP

The new Control Lines feature lets you mask areas of your photograph with more precision and versatility.

Greater sensitivity gives you


The PhotoLab 5 workspace has been polished for ease of use, but there’s still a learning more control over Control Lines
curve involved but you'll soon pick things up and be editing like a Pro. and Control Points.

you can efficiently apply keywords to groups Silicon Macs. Testing on a Mac mini with an M1
of photos using the folder structure; you don’t processor and 16GB of memory, DeepPRIME
have to type them out for every single image. proved 4.5 times faster. That’s a massive leap
in speed.
One of DxO PhotoLab’s major selling points
More speed is it has settings optimised for specific models
TDxO’s DeepPRIME technology has also been of camera. The new release supports 18 new
improved. DeepPRIME uses artificial intelligence camera bodies; from the Fuji-X range.
to develop RAW files, reducing digital noise DxO PhotoLab has a well deserved
and demosaicing the image. Trained by deep reputation for quality photo processing that can
learning methods, DeepPRIME is the result of satisfy even the most discerning professional
20 years’ work, using millions of images. The photographers, and PhotoLab 5 continues the
deep learning approach of DxO PhotoLab, and trend. Our only reservation is it can prove very
DeepPRIME in particular, have been optimised expensive if you upgrade every year, though
in this fifth release, significantly improving you’re getting a lot of software for your money.
processing and export times. On a Windows
PC it’s 1.6 times faster than PhotoLab 4, but
the biggest benefit is for those with Apple

www.bdmpublications.com | 95
TECH ROUND-UP

DxO FilmPack
Give your pics an old-school make over.

W
hile few would like to go back to can choose from a predefined set of filters
Info// analogue film processing, there’s
no denying old school development
that interpret the picture according to what
it might have looked like in days gone by.
DxO processes had a style and character of their If you want to see how your photo might
www.dxo.com own. FilmPack is designed to bring the look have looked had it been taken by French
Essential: £75.00, and feel of photographs from eras gone by, to inventor and photography pioneer Nicéphore
$85.00, 85,00 € your modern digital pictures. It’s less intense, Niépce back in 1827, or as seen by Japanese
Elite: £129.00, less ‘geeky’ than DxO’s flagship PhotoLab photographer Kusakabe Kimbei in 1880 or
$139.00, 139,00 € application. The sweet science is there, but even on cross processed Fuji Superia 200
it’s more of an everyman’s suite of tools; very in the 1990s, you can. Some, but not all of,
capable, but a good deal less scary. these processes have information panels in
DxO FilmPack reproduces the grain and which you can read about the techniques and
colours of legendary analogue films as closely technologies they recreate. We hope more will
as possible. The software recreates the hues, be added over time.
saturation, contrast and grain of 84 authentic You can install FilmPack as a stand-
analogue films, including the Kodak Tri-X 400, alone application or as a plug-in
Polaroid 690, Ilford HPS, and Fujifilm Superia. for Lightroom, Photoshop
It also uses a decidedly original approach to CS5, CS6 or CC; or
navigating the progression of development Photoshop Elements
and processing technologies through the 12 or above.
different photographic eras. And it’s here the
app is at its most interesting.
After opening a photo in FilmPack, you

Compare the original image with the


processed results using a slider.

Read all about the processes you’re recreating in an interesting side panel.

96 | www.bdmpublications.com
TECH ROUND-UP

Who says ’size doesn’t matter’?

F
inding the digital image you need can be a get you started too. When you’re ready, just click
frustrating exercise, especially if you come
across a picture that’s perfect for your
a Play icon (for some reason), to process the file
using the settings you’ve chosen.
Info//
project, but too small to use. That’s where AKVIS In our tests, the results were good, but AKVIS
Magnifier AI 11.0 comes in. Available as a stand- not fantastic. You can take the pictures up a https://akvis.com
alone app or a Photoshop plug-in, Magnifier AI small amount and they still look great, but if £65.00, $89.00,
uses trained neural networks for image upscaling you push the application to its limits and blow 82,00 €
to increase the size of digital pictures without them up a few hundred percent, they take on
the annoying pixelation associated with zooming an unnatural feel, with hard edges and details
in too far. New features for version 11.0 include not looking quite right. They’re a lot better than
colour processing improvements, a redesigned enlarged but unprocessed photos, of course,
user interface, support for more RAW files, and but we wouldn’t want to print them as posters,
better program stability. or include them in BDM’s printed magazines.
It’s easy to use. Import a photo or other such If you’re the editor of the church newsletter
image into the app, and use a slider to blow it up in or regularly design fliers, AKVIS Magnifier AI
size; to up to 800%. You can set other parameters 11.0 should prove a useful addition to your
like the image’s final size and DPI, the smooth Applications folder, but maybe not for pro-level
slider and more. There are plenty of presets to print publications.

The interface is clean and intuitive; it’s not a difficult app to use. It’s an improvement, but it’s not pro-level print quality.

www.bdmpublications.com | 97
TECH ROUND-UP

HUMANITY app
Stay younger for longer.

H Young at heart?
UMANITY is aimed at slowing down
Info// the ageing process and keeping you
healthier for longer. You can download a
On launching the app, you must first register
for an account and then link HUMANITY with
Humanity limited-function version for free, but to get the your Health app. You then input data, or confirm
Incorporated benefit of the premium app requires an in-app information taken from the Health app, such as
www.humanity. purchase costing £29.99/$29.99/29.99 €. The your height, weight (in kg or lbs, but not stones
health app continuously monitors your actions, rate of and lbs), how much sleep you get, whether
Free: Offers In- ageing and your ‘biological age’ (premium version you smoke, how much you drink and more. It’s
App Purchases only) using data gleaned from your iPhone and probably nothing you haven’t seen before, but
any health-orientated wearables or accessories collating it in one app and using the information
you might use. This information is analysed, and to give tailored health advice is no bad thing.
the app reports back with advice and guidelines Designed by experts, HUMANITY app has a
personalised specifically for you. According to the laudable goal and does a good job of achieving
developers, benefits of using the HUMANITY app them, but obviously it only works for you if you
include a reduced biological age, a slower rate stick with it. Make sure you enter information
of ageing, staying healthy and happy for many into the app on a regular basis, and you might
more years, managing stress and more. Definitely well find the advice it delivers to be useful in
worth the money in theory, but how does it work keeping you fit and healthy.
in practice?

This is where non-drinkers feel very smug.

98 | www.bdmpublications.com
TECH ROUND-UP

Wall mount your memories...

R
emember when Apple sold prints, photo device you’re placing your order on, which can be
books, calendars and cards, all made from
your own photographs? The printing and
in portrait or landscape orientation. Choose from a
few options, then preview your canvas if you wish.
Info//
distribution back in the day was handled by Motif, Doing so shows the picture you’re about to order RR Donnelley
and although Apple no longer sells printed works, in a living room context, to give you an idea how www.motifphotos.
its one-time partner has stepped into the gap and it might look in your home. You then input your com
now sells them directly. Just download the app for address and payment details (if you haven’t use From £24.99,
your Mac (a plug-in that works with Photos), your Motif before, that is), and order your canvas. $29.99, 24,99 €
smartphone and/or tablet, and get started. The pictures are sent promptly, and as you’d
Motif has recently added canvas prints to expect from a former Apple partner, they’re of a
its range of products. It’s a simple process. You very high quality. It’s a great way of displaying your
choose a size from 20x25cm (£24.99) to 61x91cm best pictures, and they look lovely on your wall.
(£79.99). Then choose a photograph from the

You can preview the picture you’re about to order.

Exclusive 25% Discount!


BDM Publications has
Motif now offers canvas prints from your photographs.
teamed up with Motif
to give our readers an
exclusive 25% off and
free shipping for your
next order. To claim
this awesome offer, just
download the Motif app
on to your Mac or mobile
device, place an order
and use the code BDM25
as you go through the
checkout. It’s that simple!

www.bdmpublications.com | 99
TECH ROUND-UP

SpongeBob:Patty Pursuit
Save the Krabby Patty Formula.

I
have to admit, I never saw the appeal of end of the level, and you can opt to re-run it and
Info// SpongeBob SquarePants. I’m probably too old,
and my kids were never into it either, so it kind
locate the hidden areas, or continue your quest to
the next level.
Nickleodeon of passed me by and as such I never got into it. It’s a tried and tested formula, in true platform
Apple Arcade I was shocked to discover that SpongeBob first style. You bash through obstacles, jump to
Exclusive appeared on our screens in 1999, and has made greater heights with certain trampoline-style
over $13 billion in merchandising revenue as of areas and swing from various elements to collect
2019. More fool me, then. more coins. Each area contains a certain number
In this Apple Arcade exclusive, Sheldon J. of levels, and you need to fight a boss at the end
Plankton is trying to steal the secret Krabby Patty of each area. There are bonus levels too.
formula and along the way he has also kidnapped Graphically, the game is excellent. It’s bright,
SpongeBob’s friends. Your task is to steer colourful and enjoyable to play. Sounds and
SpongeBob along a platform, undersea world in music will be familiar to those who watch
order to stop Plankton, get the formula back and SpongeBob, and give the game the same kind
rescue your friends. Not an easy task. of appeal as the cartoon series. Controls, which
You’ll run and jump, collect coins and dash are usually picky on such titles, work really well
through legions of Plankton’s cousins who try to here and are responsive enough to keep the
stop you on your quest. There are also spatulas to frustration levels down to a minimum.
collect to unlock the next level, and if you collect all Overall, it’s a fun game and one the kids (and
the coins, you get a bonus spatula. Make it to the adults alike), will certainly enjoy.

Stop Plankton from


opening the formula, and
rescue your pals.

A good platformer, which


will appeal to many.

100 | www.bdmpublications.com
TECH ROUND-UP

A knee to the face, then get thrown over the shoulder. Beautiful.

Bluetooth your way through the gang along to

I
blooming love Double Dragon. Back in the
late Eighties, at the local arcade a dingy,
dishevelled dive, complete with sticky carpet
the original eight-bit soundtrack, or choose a
newer remastered version.
Info//
and drenched in eye-watering neon my mate There are different modes, too. Arcade DotEmu
Daz and I would force-feed ten pence pieces plays with a single credit, where you fight to £0.89, $0.99, 0,99 €
into the Double Dragon arcade machine and get highest score, and Story Mode unlocks
settle in for an afternoon of cooperative digital stages and achievements. Mobile, Original and
violence. It was superb. Expert difficulty modes keep you entertained,
Imagine how happy I was to get my hands on and getting your name on the leaderboard
the complete trilogy on the iPad. Sadly, Daz and is just as tantalising. For only 89 pence, the
I have parted ways in the years since 1987, but Double Dragon Trilogy is worth every penny. It’s
these days I have a couple of children who can splendid, and we loved it.
help me take on the bosses and finally rescue
poor old Marian from the clutches of the Black
Warriors gang.
Often, when it comes to arcade conversions
for mobile devices, the end result is far from
what you fondly recall as a youth. However,
developers DotEmu have done a wonderful
job of recreating the style and ambiance of the
original arcade machines.
Graphically, it’s as you remember but with a
slightly more polished sheen to it. There’s still
the clunky arcade graphics, but this time with
smoother edges, and the end result is still the
same. It’s a near-perfect port of the original.
The controls are a little tedious to get to grips
with, but after a few rounds you soon get used
to them. Grab a friend, and the pair of you can

Here we go, the first gang member to


taste your wrath!

A wonderful blast from the past, in all its arcade glory.

www.bdmpublications.com | 101
TECH ROUND-UP

Pokémon UNITE
Gotta beat ‘em all!

Info//
The Pokémon
Company
Free, with in-app
purchases

W
e’ve seen a slew of really quite decent tantalising features on offer. Different wild
multiplayer online battle arena (MOBA)- Pokémon, once beaten, offer you boosts of some
style mobile games over the past few description. There are Holowear options, which
years. Each offers its own unique spin on the allow you to dress your Pokémon in a variety
genre, and while some shine throughout the of holographic outfits. There are new Pokémon
various app stores, others let the side down moves, exclusive to UNITE, which can turn the
considerably. It’s like any other gaming genre, tide when in battle. Ranked matches move you
really, but MOBA games tend to get the brunt of either up or down in the global leaderboards.
the negativity from the popular media. There’s an in-game communication setup, using
Taking some of the better aspects of a MOBA signals, quick chat functions and even voice chat
game, Pokemon UNITE lets you engage in so you can better manage your team of trainers.
five-on-five battles on Aeos Island, against NPC Finally, Pokémon UNITE has taken the advanced
trainers and human ones alike. As with the other step of enabling cross-platform play, which
Pokémon titles, you get to tackle the creatures means your Pokémon Trainer Club account can
in the wild, level up and evolve. Then you face off be used on the Nintendo Switch, as well as your
against another trainer and see who can score mobile devices.
the most points within the allotted time.
The game certainly has a number of

Pokémon, Assemble!

102 | www.bdmpublications.com
TECH ROUND-UP

Holo-dress your Pokémon, and get


ready to battle.

Some favourites are available, with new and unique abilities.

Pika-Pika-Pikachu! some players from continuing with the game.


This is a different aspect to the usual Pokémon Another aspect that may frustrate some is
game, and it’s one that works reasonably well. the surrender function. If you have a selection
True, there is a sense of pay-to-win when of particularly irksome teammates who decide
you dive a little further into the game and let’s to surrender at the slightest thing, you too
face it, there aren’t many MOBA-type games suffer the loss despite doing well yourself. It’s
out there that aren’t but the initial qualities of an annoyance, but one that’s inherent with this
Pokémon UNITE allow you to bypass that feeling type of functionality.
for some time before the grind begins to wear Overall, Pokémon UNITE is a good game. It’s
you down. One element that did bug us a little got its negative points, as with most games
was the 30-second countdown until a game in general, but it’s going to offer fans of the
begins. You wait for 30-seconds for someone Pokemon series many hours of frantic battles.
to tap a button to begin, then you wait another
30-seconds for someone else. Although it’s
not a huge amount of time, we live in a world
where instant gratification is necessary to keep
attention spans alive. The wait could well stop

www.bdmpublications.com | 103
TECH ROUND-UP

Zombie Night Terror


Braiiiiins…

D
eveloper, Plug In Digital, has taken a classic explode, speed up or leap to otherwise unreachable
Info//
Plug In Digital
Lemmings-like concept and introduced it to
the zombie culture in a gory, blood-soaked
areas of the scrolling levels.
Each zombie used up is one less in your horde,
£4.99, $5.99, 2D strategy game. And it all works rather well. so you need to feed off the humans who are
5,99 € Set in a semi-monochromatic, film-noir, scattered throughout the levels. Some humans
16-bit pixel art world, you are the mastermind are easily eaten, cowering in a corner while your
behind this zombie invasion and your goal is zombies approach. Others carry an assortment of
as simple as trying to infect as many people as weapons, which can quickly decimate the number
possible. Doing so, though, is quite tricky. of zombies you have under your control. Too
You have a set number of zombie DNA points much damage from a well-armed human and
in which to infect the on-screen non-zombie you’re reduced to just a few zombies who won’t
population. The more people you infect, and in turn be able to complete the level or the challenge.
which they bite and infect, the more DNA points The trick, therefore, is to carefully plan the
you have available. The DNA points you gain unlock march of your zombie army, taking in as many
zombie mutations, which can then be used to direct, human hot-spots as possible, to increase your

Infect the living and guide the undead to the zombie apocalypse.

104 | www.bdmpublications.com
TECH ROUND-UP

It can be tough, being an evil mastermind behind the zombies.

numbers and DNA points, while still being able to


reach the end of the level goals. The further you
advance, the more special abilities you unlock
until you’re able to chain certain abilities and
create the ultimate zombie horde.

Raising the dead


The graphics are well produced, with a mixture
of comic instances and cleverly devised of DNA is soon limited, and a badly-timed
sections in each level. The film-noir look works applied ability goes horribly wrong. If you’re
well, especially when mixed with the stark red over halfway through a challenging level when
of your victim’s blood or the luminous green that happens, it’s back to the start again. While
of zombie DNA. Later levels can get tricky that’s part of the game, it can leave you feeling
though, and you find yourself restarting more a little annoyed at the mechanics. However,
often than not, due to a miscalculation or a perseverance is key, and you soon come to learn
particularly nasty human. to take advantage of zooming in and out of the
The environment can be as deadly to your action to pinpoint and target individual zombies
zombies as the humans. A drop that’s too high or areas.
kills off a group of zombies, or if you don’t get Zombie Night Terror is an interesting,
them off the train tracks quick enough, they’re challenging and fun game to play, at a very
mowed down, reducing your army to just one or affordable price. There’s enough to keep coming
two stragglers. back for more, and it’s well presented.
While Zombie Night Terror is an addictive
and fun lurch through the eyes of a zombie
horde, it can become frustrating as your supply

www.bdmpublications.com | 105
঒ন঻ষ঍শশসন
Come back next issue for even more
fantastic copy from our team of
experienced industry insiders. We will be
covering all the latest software
advancements, consumer tech and expert
tutorials that you can expect from us.
঺঺঺ॲথধর঳সথযবদতষবল঱শॲদলর
On Sale June 2022 via digital platforms
  
#(*32 &""2(
  %*322(%
'>B7>;@?;6AB9A=<;?;/B1><AB=0>6@B>6<B'A75B,?:?@B6:B=@
www.bdmpublications.com
#(223%1'3 .1-

PC, Windows 11 & 10 Samsung & Google

Apple iPhone, iPad, Photography, Photoshop, Coding Python, C++,


Mac, MacBook & Watch Lightroom & Elements Raspberry Pi & Linux

2!,&2 *##2(,3/0
*.$3%1' .1//-

PLUS ,2&!32!, 03/0.-3/0+10+ '103/.3-03.3+/3/.$


/0+'301-1++1$


 ,A<:?>;B>3B@5AB<A 6?<A8B5=<8-=<A+B"@B<A1=?;:B@5AB46<75=:A<:B:>9A '5?:B&=4A<76@B(?1?@A8B4609?7=@?>;B?:B36992B?;8A4A;8A;@B=;8B=:B:675
<A:4>;:?0?9?@2B@>B8A@A<1?;AB@5AB:6?@=0?9?@2B>3B@5?:B0>>*B=;8B?@:B7>;@A;@ 8>A:B;>@B;A7A::=<?92B<A39A7@B@5AB,?A-:B><B>4?;?>;:B>3B@5AB4<>867A<:B>3
&--.13*013 $'3)))3 &,," 3) 
)
3><B-5=@A,A<B46<4>:A+B);2B?1=/A:B<A4<>867A8B>;B@5AB3<>;@B7>,A<B=<A )44:B><B4<>867@:B7>;@=?;A8B-?@5?;+B'5?:B4609?7=@?>;B?:B;>@BA;8><:A8B><
&609?:5A8B02 &=4A<76@B(?1?@A8 :>9A92B3><B8A:?/;B46<4>:A:B=;8B=<AB;>@B<A4<A:A;@=@?,AB>3B7>;@A;@+B =::>7?=@A8B?;B=;2B-=2B-?@5B'5AB(?;6B>6;8=@?>;.B'5AB!=:40A<<2B&?
$=;=/?;/B8?@>< =1A:B=9A AB=8,?:AB=99B4>@A;@?=9B062A<:B@>B75A7*B9?:@?;/B4<?><B@>B46<75=:AB3>< >6;8=@?>;.B)!$B>98?;/.B=;>;?7=9B(@8.B&2@5>;.B#A0?=;B&<>[email protected](?;6
&<>867@?>;B#?<A7@>< $=<*B)2:53><8B 7>;3?<1=@?>;B>3B=7@6=9B7>;@A;@+B)99BA8?@><?=9B>4?;?>;B5A<A?;B?:B@5=@B>3B@5A $?;@.B$?7<>:>[email protected](A;>,>.B#A99.BA-9A@@ &=7*=<8.B)449AB=;8B =1:6;/B><
8?@>< =1A:B=9A -<?@A<B=:B=;B?;8?,?86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