Kids, Code, and Computer Science 2020 Tilliwig Award Winner
s r e t u p m o C ? o s g D n i w h o T H r e b m e m Re
April 2020
$6.00 $6.00 USD
6 Coding Books
You'll Want to Read Now In the Middle: “Wow, Look at the Time!" Using Scratch to Code Arduino Projects
beanz magazine April 2020: Volume 7 Issue 5 Issue XX (online) & XX (print) ISSN: 2573-3966 (online) ISSN: 2573-3958 (print) beanz Magazine© is published bi-monthly, six times a year, online at http://beanzmag.com and in print. A print + online magazine subscription includes online access to all articles, with links to let you explore topics in more detail. SUBSCRIBE: visit http://beanzmag. com/subscribe or email us for checks/ invoices. We’re also available through EBSCO, Discount Magazine, WT Cox, Magazine PTP, and many other subscription services. ONLINE MAGAZINE ACCESS: send your email address to hello@beanzmag.com and we’ll set you up. Published by Owl Hill Media, LLC 378 Eastwood Rd, Woodmere, NY 11598 Email: hello@beanzmag.com Phone: (646) 553-3390 POSTMASTER: Send address changes to Owl Hill Media, LLC, 378 Eastwood Rd, Woodmere, NY 11598. Periodicals postage paid at Woodmere, NY and other mailing offices Copyright Owl Hill Media, LLC with all rights reserved except as noted. Images are copyrighted by their creators, as noted with each story both online and in print. Publisher/Editor/Webmaster: Tim Slavin Staff Writers: Amy S. Hansen, Simon Batt, Patricia Foster, Bonnie Roskes, Clarissa Littler, Jennifer Newell, Les Pounder, Paul Seal, Erin Winnick, Tim Slavin Contributors: David Dodge, Jay Silver, Jeremy Kubica, Colleen Graves, Daniel Fenjves, Ali Hagen, Emeline Swanson, Jean-Francois Nguyen, Madeleine Slavin, Tim McGuigan Back Office Magic: Wendy Garrison Copy Editor: Eileen Seiler Art Director: Kelley Lanuto Webmistress: Patricia Foster COVER IMAGE: COMPILATION OF IMAGES FROM UNSPLASH BY LAURA FUHRMAN AND DESIGNOCOLOGIST
Publisher’s Note Welcome to the April issue! Have you ever noticed people use funny names to describe programming and computer science? "Sorting" algorithms, for example, make it easier to find data in big piles of data. Yawn. Boring, right? Nope, not if it has a silly name! Read about the pancake sorting algorithm where data is stacked and you flip data like pancakes. Sweet! This issue also describes how the computer mouse got its name. It was called an "XY Position Indicator". ZZZZZZZ. That’s definitely boring. It's not surprising that the name didn’t stick. Then someone noticed the body of the XY Position Indicator looked like a mouse and, of course, that name did stick. Now that the weather is getting warmer and the grass is greening up, take a look at the Grass Power! story, about different ways of powering tiny computers. Who knew you could use solar power and wave action to power small computers riding waves and tracking ocean currents? We also have a fun Python cipher project, as well as projects with SketchUp and Arduino. And get ready for this: Lego Mindstorms also now works with a version of Python! Everything is made new again in spring, and there's so many new things to explore right here in beanz. We hope you enjoy both the upcoming springtime season and this captivating and fun issue of beanz.
Tim Slavin, Publisher beanz Magazine beanz magazine (as Kids, Code, and Computer Science magazine, our earlier title) is a winner of Parents’ Choice, Tillywig, and Academics’ Choice awards: http://beanzmag.com/awards
Our Mission beanz magazine is a bi-monthly online and print magazine about learning to code, computer science, and how we use technology in our daily lives. The magazine includes hard-to-find information, for example, a list of 40+ programming languages for education, coding schools, summer tech camps, and more. While the magazine is written to help kids ages 8 and older learn about programming and computer science, many readers and subscribers are parents, teachers, and librarians who use the articles to learn alongside their young kids, students, or library patrons. The magazine strives to provide easy to understand how-to information, with a bit of quirky fun. Subscribers support the magazine. There is no advertising to distract readers. The magazine explores these topics: Basics of programming and where to learn more, Problem solving and collaboration, Mathematical foundations of computing and computer science, Computational thinking, Recognizing and selecting computer devices, and the Community, global, and ethical impacts of technology.
April 2020
8
History Hey, Wait a Minute!
4 6 10 12 14 16
Concepts Recursion: When the Big Picture Comes Together With Smaller Pieces Programming MicroPython and Mindstorms SketchUp SketchUp a Beach Ball Tech In Real Life Grass Power! In the Middle Cover Story "Oh, Look at the Time!" Programming Python Ciphers
28
tidbitz bitz
18 20 22 23 24 25 26
Languages Oh, Snap!
Concepts Cover Story How Do Computers Remember Things? Electronics Cover Story Control an Arduino With Scratch Concepts All Sorts of Sorting Notebook Cover Story 6 Books You'll Love Be Safe Online Whoa There, Pardner! Concepts In the Beginning Notebook Summertime, And the Livin' Is STEAM-y. . .
Parents and Teachers Coming of Age In the Digital Age
27 Now Boarding Slowpokes! 27 Mummy Sings the Blues 27 Can You Hear Me Now? 27 Oh, Canada!
cool beanz! STILL TIME TO ENTER!
beanz has extended the entry
deadline for its contest. Enter to win a chance at a Sphero RVR robot, coding books, Scratch cards, and lots of other cool STEAM stuff. Check out www.beanzmag.com. We want to hear from you! Look here and online for your fellow beanz-ers and all the cool things they do. Send your thoughts about beanz, ideas, art, photos of projects, poems, whatever, to cool@beanzmag.com.
contents
advanced
intermediate
beginner
2
scribe b u s / m mag.co z n a e b / https:/
BY SIMON BATT
History
2
t i a W , y He ... e t u n i aM ! d you Foole
Computer hardware sometimes has silly names, but none as silly as the mouse you use to move the cursor around. It doesn’t have ears, it doesn’t like cheese, and if it starts squeaking, there’s something wrong with it—so why do we call it a mouse? If you think of how the animal mouse looks, and compare it to how a computer mouse is shaped, you may understand. While your computer mouse doesn’t have a nose or whiskers, it does have a “body” that’s the size of a large mouse. The cord running from the mouse to your PC acts as the tail, unless you’re using a fancy cordless one. The computer mouse was invented by Douglas Englebart back in 1963. In those days, using a computer was a real hassle. There were no icons to click or windows to move around. Instead, to use a computer, you had to use what’s called a command line. This isn’t as exciting as it sounds; it’s just some text telling you where you are on the computer’s file system. You would then type commands into the command line to move between files or run programs. Want to see it for yourself? Open up a command line on a Windows machine, then imagine operating the computer just using this method. You will then understand why the mouse was invented. Douglas was tired of typing things all day, so he set about to find a way to make things easier for everyone. He went through a few different ways to move a cursor around a screen, such as a ball you held in two hands as well as a head tracking system. Douglas stuck with one of the simpler and more elegant ideas: a wooden block with two wheels underneath it. This wooden block would be the great-granddad of the mouse. Back then, however, Douglas didn’t call it a mouse: he gave it the really boring name of XY Position Indicator. You could use the block to indicate an X (left-right) and Y (up-down) coordinate on the screen. If you want to see the very first mouse in action, there is a video online showing the 1968 demonstration that Douglas made for the mouse. When you watch it, you can even hear Douglas, the mouse’s inventor, point out how silly the device’s name is: “...and the way the tracking spot moves in conjunction with movements of that mouse...I don’t know why we call it a mouse, sometimes I apologize. It started that way and we never did change it…” In the video, you’ll also see that the original mouse used mechanical wheels to work out where the user was moving the cursor. It also had a wire coming out on the side of the mouse where your wrist rests. This position was changed to the opposite side, presumably to keep the wire out of the way. So now you know how the mouse got its name, and how it came to be. The next time you think about how silly its name is, just remember: even the original inventor wasn’t too keen on it, either! b
CARLOS DELEON, UNSPLASH
3
Concepts
4
BY CLARISSA LITTLER
Recursion: When the Big Picture Comes Together With Smaller Pieces
Software programming has a number of ways to solve problems that can be described as shapes using mathematics. For example, many programming languages have looping in the form of For and While statements. These statements repeatedly loop through data if a condition is met, until the condition no longer exists. Some languages use recursion instead of loops to work through a problem until it is solved. Recursion is one of the foundational tricks for solving problems, on a computer or otherwise. Even if you've never heard the word before you may have seen the idea. Basically, recursion is when you break a problem into smaller parts you can solve individually, which then solves the bigger problem. Recursion also means something that references itself. These two definitions really mean the same thing. To demonstrate, let's use a math example called the factorial function. If you haven't seen the factorial before, it's kind of the "Hello World" of recursion, meaning a simple exercise that demonstrates an important concept.
We write the factorial of a number like 5! or 10! and what the factorial does is this 5! = 5*4*3*2*1 10! = 10*9*8*7*6*5*4*3*2*1 The value of all the elements of 5! multiplied together, one element after another, is 120 while the value of 10! is 3,628,800. In terms of a generic number n we could define factorials as: n! = n*(n-1)! Oh, that's a nice and short definition isn't it? So what about making the factorial in, say, Python? If you don't want to use recursion you're going to need to write a factorial function like: def fact(n): total = 1 for i in range(n): total = total*(n-i) return total # this should print 120 print("5! is %d" % (fact(5))) This isn't wrong, but it's not super obvious why it's right. So let's try recursion instead of a for-loop: def fact(n): if n > 1:
return n*(fact(n-1)) else: return 1 print("5! is %d" % (fact(5))) Neat! This is closer to how you'd define the factorial in math and, in my opinion, is a little bit easier to read and tell what's happening. So recursion is a way of writing code that is sensitive to the shape of the data you're working with, for solving complex problems by breaking them into simpler parts. There's much more to it, though, like how to make recursive functions run really efficiently— more efficiently than even loops— with things like tail recursion. If you want to know more or see more examples, check out the links in the rest of the magazine and the article on Snap! in this issue. b
5
MARCUS SPISKE, UNSPLASH
Programming
6
n o h t y P s o r m c r i o t M s d n i M d an
BY BIANCA RIVERA
If your school has a Lego Mindstorms Club, or if you have your own set at home, you have a new option to program your robot: MicroPython! MicroPython is a more condensed version of Python. It’s perfect for anyone new to physical computing. You may have heard about it if you have used BBC micro:bits. Now, it is available to use with Lego Mindstorms. To start, build a simple robot such as Lego’s Robot Educator: the Ultrasonic Sensor Driving Base version will be used in this example.
To get started, find a Windows 10 or Mac computer with an SD card slot and Visual Studio Code installed, a microSD card with the EV3 MicroPython image loaded, a mini-USB cable, and of course, your robot. After installing MicroPython onto your microSD card, place tape on the end of the microSD card, to make a pull tab. (Easier to remove later.) Make sure your robot is off, then insert the card into your robot’s microSD card reader. After the card is inserted, turn on the robot. It will take a minute or two for
the robot to boot. Next, create the program that will run on the microSD card. Open the Visual Studio Code editor on your computer and install the EV3 MicroPython extension. Next, open the MicroPython extension tab and click on Create a New Project. Give your project a name and choose a location for it to be saved. You’ll notice the folder contains a file named main. py which has code needed to run your program. Do not alter or delete these lines. You can start writing your own code after these lines. Lego provides some sample code
7
I'm here to help!
in their MicroPython documentation that you can run or remix. Try typing the following code. The first four lines define the motors being used and the Robot Educator’s specific wheel diameter and axle track in millimeters. The fifth line creates the DriveBase object, used to specify the values needed to move the robot at the desired speed and distance. Do you think the robot. drive_time(-100, 0, 2000) code on line six will move the robot forward or backward? How long will it drive? left_motor = Motor(Port.B) right_motor = Motor(Port.C)
wheel_diameter = 56 axle_track = 114 robot = DriveBase(left_motor, right_motor, wheel_diameter, axle_track) robot.drive_time(-100, 0, 2000) To transfer your code, connect the EV3 Brick to your computer using the mini-USB cable then search for and select your brick. Once you’re connected to your brick, press the F5 key to run your program! For more details and complete sample code for
Not THAT kind of MicroPython, silly!
the Ultrasonic Sensor Driving Base model, click on Open User Guide and Examples under Create a New Project while in the EV3 MicroPython extension in Visual Studio Code. b
Comparison of code that moves a robot forward in Lego’s drag and drop visual code builder and MicroPython
Languages
8
Oh, Snap!
BY CLARISSA LITTLER
Scratch is the biggest blocksbased programming language out there. But it's not the only one! Today we'll take a look at a really cool and extremely powerful blocks-based language called Snap!. (The exclamation mark is actually a part of the name, but I am also excited about this.) Snap! looks a lot like Scratch,
but under the hood it's actually pretty different. To show that, we're going to do a version of the factorial function we showed in our article on recursion, also in this issue. If you remember, a factorial is a mathematical formula shown with an exclamation mark. The factorial 3! is calculated by multiplying all whole numbers between 3 and the number 1: 1 * 2 * 3 = 6. Therefore, 6 is the value of the factorial 3! and
we can easily compare that to our Python code from the recursion article def fact(n): if n > 1: return n*(fact(n-1)) else: return 1 Neat! You can see that these are almost exactly alike, except that in Snap! the way you get a value out of the function is with the report block instead of return like in Python. If you're an experienced Scratcher and you're thinking "hey, there's no 'report' block in Scratch!" you'd be right. In Scratch, only the built-in blocks can return values, like the blocks under operators. How would you write the factorial in Scratch? Well, here's an example from the official Scratch wiki:
It's doable, but involves creating a list and having extra steps.
What else is different in Snap!? First, you can group sprites together yet have them move independently. As we show in the screenshots below, we've made the turret a "child" of the tank body so that when the tank moves forward with the w key both the tank and turret sprites move forward, when the tank turns with the a and d keys then the turret turns as well, but when the turret turns with the left and right keys the tank doesn't move. (Our combined tank sprite, after dragging the turret in the list of sprites onto the tank body in the stage. Note: you cannot drag the turret sprite onto the tank body in the list of sprites beneath the stage.)
Can you do this in Scratch? Well, like the factorial example the answer is "yes, but it's harder". That's essentially my pitch about Snap! in general: it takes things you can do in Scratch, but are really inconvenient, and makes them a lot easier to do. Here's one last really little example of something convenient in Snap! but awkward in Scratch: for-loops. For-loops are how you do something repeatedly, but count how many times you've done the thing so far. Most programming languages have them but in Scratch you have to do something like:
Meanwhile in Snap! you can instead just do this:
and you don't even need to make a separate variable as the loop counter. That's only a little bit of savings if you have one for-loop, but if you're writing physics-heavy code that needs multiple forloops, having to create variables for each is a real pain. Lastly, here's a simple example of the fractal Koch's curve which is made just a little simpler by using variables that only exist inside a single script. In most programming
languages these are called local variables. This is also my promised example from our recursion article that I said you'd find here. Try making this yourself and running it. Now is Snap! nothing but an improvement over Scratch? Well, not really. It's a little rougher around the edges. For example, if you're wondering how to share your project you might be surprised to learn that you need to go under File then Open under the main menu, and then select share. Yes, you need to "open" your project, even if it's already open! There are other small quirks and inconveniences. But, I think Snap! has a lot of cool features which could fill a college computer science class, and is a great next step beyond Scratch. b
9
SketchUp
10
BY BONNIE ROSKES
SketchUp a Beach Ball Just in time for summer! There are three main steps to this project: 1. Making a hexagon tower, 2. Placing a sphere at the top of the tower, 3. Intersecting and painting. When you start modeling in SketchUp, you start in this view, with Helen standing on the ground. She isn’t needed, so press E for the Eraser, and click on any of Helen’s edges. A From the Circle flyout toolbar on the left, activate the Polygon tool. B We want to make a hexagon: a sixsided shape. So first, type 6 and press Enter. The number appears in the Sides field in the lower right corner. C Start the hexagon at the origin, and click the second point along the red axis. D To make more hexagons from this one, activate the Offset tool. E Click anywhere inside the hexagon, then move your mouse a small distance inward. Click again to create the first offset hexagon. F Move your mouse to the center of the hexagon. Double-click as many times as you need to fill the hexagon with smaller and smaller hexagons, all spaced the same distance. G Now we’ll make these hexagons into a tower. Press P for the Push/ Pull tool, and tap the Ctrl key (PC) or the Option key (Mac). This adds a plus sign to the cursor. Move your mouse to the very center hexagon. H Move your mouse pretty far down, and click to complete the first part of the tower. I (Down, so it will be easier later to place a sphere on the top of the tower. Use the Ctrl/Option key so you won't end up with just an empty hexagon shell, and we'll have the vertical walls we need later.) Now pull down the rest of the hexagons the same distance. Orbit to see the underside of the hexagons, move your mouse to the hexagon
next to the one you just pulled down, and tap Ctrl/Option. J Double-click this face to pull it down by the same distance as the first hexagon. Then do the same for the rest of the faces, tapping Ctrl/Option each time, until the whole tower is created. When you have the whole hexagon tower completed, press the Spacebar to activate the Select tool. Press Ctrl + A or Cmd + A to select the whole tower. Then right-click on the tower and choose Make Group. K Spheres are created using two circles. Press C for the Circle tool, but don’t click anywhere yet. Look in the Sides box. Circles are usually made with 24 sides. Most of the time, you can’t see the individual sides of a circle, unless you zoom in. But we need a smoother circle, which means a higher number of sides. So type 120 and press Enter. (Make this number a multiple of six so the intersection edges will be exactly the same on each side of the hexagons.) L The first circle will be horizontal along the top of the tower. Zoom in to the smallest hexagon at the top of the tower and place the center of the circle at the origin, which is also the center of the hexagons. M Click along the red axis to complete the circle, making it larger than the tower. N For the next circle, tap the Right arrow to keep the circle perpendicular to the red direction. Place the center at the origin, then move the mouse out (don’t click yet) and stop at the midpoint at the edge of the tower. O Move the mouse a bit past that midpoint, and click to complete the circle. P To start the sphere, activate the Select tool (Spacebar) and select the larger circle. Q The selected, larger circle will be
used as the path for the smaller circle. Activate the Follow Me tool. R Now click the smaller circle. Because the circles have a high number of sides, it will probably take a few moments, so be patient. If you get a time-out warning, choose the option to wait. S Erase the larger circle. You should see the sphere peeking out a bit past the tower on all sides. T Select the sphere and activate the Move tool (M key). Click anywhere, and move your mouse straight down, sticking to the blue direction. Stop when the entire sphere is inside the tower, and sticking out evenly on all six sides. U Right-click on the sphere and choose Intersect Faces/With Model. V You can see intersection edges where the sphere sticks out. There are also intersections along all of the tower walls, which you can’t see. W Erase the hexagon tower, which is easy because it’s a group. This is what you should have: a sphere with a curvy pattern of edges on it. X Next, paint the faces. To open the Materials window, click the icon shown along the right side of the window. Click the Magnifying Glass to open the categories of materials, and open Colors (or whatever set of materials you’d like). Y This example uses the six rainbow colors, and has one set of faces using each color. Z To reuse colors, click the House icon. (The colors you see here that aren’t used on your sphere are the ones that came with Helen, who was erased at the very beginning.) AA Keep going with your pattern, until the entire sphere is painted. BB If you like this project, try again using a polygon with a different number of sides. b
A
I
Q
X
B
J
R
Y
C
K
S
Z
L
T
AA
BB
D
E
M
F
N
U
G
O
V
H
P
W
SketchUp is a free program for 3D modeling. Find SketchUp Make at https://www. sketchup.com/ download/all. The free, web-based version of SketchUp can be found online at https://app.sketchup. com/app.
11
Tech In Real Life
12
! r e w o P s s a Gr
BY SIMON BATT
Weather-related devices, car computers, smart refrigerators and appliances, personal health monitors, and shipping container monitors are examples of the Internet of Things (IoT). They have computers that collect data which is processed on the device or sent elsewhere to be evaluated.
In the world of the internet of things, engineers are really excited to put their devices all around the world. They want to put gadgets out in fields, under water, up on mountains, and all around our cities and towns. There’s one problem, though; how do you power them all? You can’t just plug them in. After all, there are no outlets in the
sea! Batteries are a good idea, but there’s the problem of having to go out and change them every so often. It’s better to have it so they can power themselves instead of needing us to power them. While this does open the door for stuff like solar power, engineers can go one step further. IoT devices are designed to use as little energy as possible so they can properly “survive” in the wild. This allows engineers to draw energy from places you wouldn’t expect.
Let’s take a look at IoT devices in the open sea. How do you think a device could generate energy while in the water? If it’s floating, solar power might work—but what if it’s under the water? Some really smart scientists have found that sound can power an underwater device. Sound waves contain energy—that’s how they can reach our ears in the first place. Researchers have found a way to transmit a sound wave through the water which a submerged IoT device can use for energy. When one of these underwater devices receives energy from a sound wave, it has one of two choices. It can either use the energy to send a message back
or—if it doesn’t need to phone home—it can choose to “eat” the energy to keep its rechargeable battery powered up. How about drawing energy from something that’s alive? You may have heard of a potato clock, which uses the really small amount of electricity in a potato to display the time. Scientists have pushed this one step further to harvest energy from grass. Yes, the very same stuff that grows in your back yard. Little sensors can be placed in fields and used to monitor the soil quality. This is great for farmers and gardeners because they can track how their plants are doing without leaving their armchair. To do this, the sensor drinks up
the electricity generated by plants. (Before you think about plugging your phone into your lawn, it’s worth mentioning that this method only generates a 2 milliwatt charge—that’s 0.002 watts. Very tiny.) Still, the sensor can use this to do its job. Every three hours it uses 75 milliwatts to send a message home, and 150 milliwatts to send a message to a satellite. It takes a little while for it to charge up to these levels, but it’s still impressive for a device simply running off of grass power! b
OCHIR-ERDENE-OYUNMEDEG, UNSPLASH
13
14
t a k o o L , h O " “ ! e m i T the
In the Middle: A Deeper Dive Into Everyday Stuff
BY TIM SLAVIN
HALFRAIN, FLICKR
An atomic clock YUE SU, UNSPLASH
According to the shadow cast by the gnomen on this sundial, the time is approximately 10:30 in the morning.
Big Ben, one of the world's most famous analog clockfaces
HENRY BE, UNSPLASH
HEATHER ZABRISKIE, UNSPLASH
MERIC DAGLI UNSPLASH
The waiting room in Grand Central Railroad Terminal in New York City, with its famous four-sided clock as a centerpiece of the room
15 LACHLAN TURNBULL, FLICKR
The observatory at Greenwich, UK, keeper of Greenwich Mean Time (GMT) WIKIPEDIA
An early 19th-century illustration of a water clock. The hour indicator rises as water flows in.
What would happen if the clock on your classroom wall didn’t exist? If watches and other ways to read time didn’t exist? Think of all the ways your life would be impacted if clocks and the concept of time did not exist. Time is a concept, but it’s also a technology because it helps people organize the activities in their lives. Without time, and clocks to keep track of time, life would be a lot less organized. Sundials were the first technology created to measure time. Some sundials are still in use! A sundial is a flat surface with markers for hours of daylight, and a pole, called a gnomen. When the sun shines on the gnomen, the gnomen casts a shadow. As the sun moves across the sky, the shadow also moves from one hour marker to the next until sunset. While most people think of sundials as a flat surface with a gnomen above, the earliest sundials from ancient Greece and Egypt thousands of years ago were horizontal. Sundials are easy to make. It all depends on your location. Where you are located south of the North Pole if you live in the northern hemisphere, or north of the South Pole if you live in the southern hemisphere, determines the angle of the gnomen and the accuracy of time kept with a sundial. To keep accurate local time, you deduct your latitude (which you can find out with an internet search engine) from 90. (90 degrees is the angle of a gnomen at the North and South poles.) While sundials worked well enough for thousands of years, eventually people tried to create more accurate ways to track time. Obviously, sundials don’t work at night. So people wondered if water could help keep track of time. Water turned out to be a natural way to create the earliest clocks, turning wooden or stone clock gears in a carefully calculated, consistent rhythm and speed. In the Middle Ages in Europe, water clocks evolved into clocks with wind up gears. The Metropolitan Museum in New York had a show recently with a collection of these amazing, often elaborate clocks, as well as automatons. Automatons are somewhat self-operating machines or mechanisms to create motion that resembles human or animal actions. The exhibit also included an ornate pocket sundial. The modern way we measure time did not exist until the railroads began crossing large areas in the mid-1800s. Trains needed to have a common way to track arrival and departure times from cities that were hours or days apart. So the railroad became the unoffical timekeeper for the whole country. Eventually all countries saw the need to agree on a consistent way of keeping time. The world was divided into time zones. But one time zone was designated as the starting point against which all other time zones were measured. This is how Greenwich Mean Time (or GMT) came into being. GMT is kept in the town of Greenwich in the UK. The observatory there broadcasts an hourly signal which other locations use as a reference to calculate time in their time zone. For example, EST (Eastern Standard Time), which is the time zone for the eastern part of the United States, is five hours behind GMT. So EST is GMT-5. Check out the GMT website at www.greenwichmeantime.com. Today we also keep track of time with atomic clocks. These are more precise than sundials or mechanical clocks. Our computers and phones keep time by checking the network for the latest time. And instead of a stick or gnomen casting a shadow to keep time, we get a digital readout on our computers and watches. School room clocks often use the older clock design with rotating short and long hands to track time relative to 12 hours. Sometimes you’ll hear them referred to as “analog” clocks. b
16
BY JENNIFER NEWELL
Programming
Python Ciphers Can you read this message? gvlsjgqqszqovusuvamoom vixvpihtflqzplmqh
text_to_cipher = input('Type the text to cipher: ') lowercase = text_to_cipher. lower() nospace = lowercase.replace(' ', '') alphabet =
WIKIPEDIA
The message says: “Forty feet below two million pounds are buried”. This is a real message, found on a stone tablet approximately 27 meters down in a pit on Oak Island, Nova Scotia. To this day no treasure has been found on the island, and we do not know if there is really a treasure at the bottom of a 40 foot pit on the island or not. But the first person to find this message had to unscramble the original jumble of letters in order to learn that a treasure may exist nearby. For over three thousand years, people have sent encrypted messages to share secrets. The messages range from top secret military information to friends sharing plans between one another. The ability to send sensitive information a spy cannot read is so prized that its study has gone from being mostly a branch of language and linguistics to a rather complex branch of mathematics and computer science known as cryptography.
Without cryptography, we would never enter our credit card numbers into online shopping sites or send emails containing personal or valuable information. The ability to keep our personal information out of the hands of those who might misuse it is foundational to just about anything we do online. As such, cryptography plays a major role in most people’s everyday lives. The message above was encrypted with three built in Python functions: lower case, replace spaces, and transpose (exchange) characters. This is called a substitution cipher. In a substitution cipher, we replace each letter of the alphabet with a different letter. It may be hard to believe, but in a 26 letter alphabet, this leads to over 400,00 0,000,000,000,000,000,000,000 possible encryptions! Here’s the Python code used to encrypt this message:
The National Cryptologic Museum in Annapolis Junction, Maryland. The museum's displays highlight the history of American cryptology.
'abcdefghijklmnopqrstuvwxyz' cipher_letters = 'fzkhqgcdmynoaivxbltspruwje' translate = str. maketrans(alphabet, cipher_letters) ciphered = nospace. translate(translate) print(f'Ciphered text: {ciphered}') In the first line, we create a variable called text_to_cipher and start by having Python output the message, “Type the text to cipher:" with the ability for people to then input a message. Next, we take the output, whatever people type, and we create a variable lowercase and use the .lower() function to make every character lower case. Then we create a variable called nospace which we’ll use later to replace any spaces in the encrypted output. The next two lines define the characters to look for—the alphabet variable—and what characters to replace (substitute) each character in our alphabet—the cipher_letters variable. Then we create a variable called translate and use the Python transposition method called .maketrans() to replace each instance of a character in the alphabet variable with the appropriate character in the cipher_ letters variable. In this example, every instance of the letter a will be transposed with the letter f. As a last step, we use our nospace variable to remove any spaces in the translate variable. If you recall, the translate variable holds the ciphered message output the person typed. Then we print the ciphered message to the console. And here are details about the built in Python functions and methods used to encrypt the message:
17
s.lower()
s.replace(' ','') White spaces in an encrypted message tell a spy how long each word is, which is a significant clue to anyone trying to break your code. As such, we eliminate all spaces by using the .replace() method to tell Python that every time it sees a blank space, ' ', replace it with no space, ''. s.maketrans()
Oak Island, Nova Scotia, Canada
Is There Really Buried Treasure on Oak Island? Who can resist a treasure hunt? Especially when it involves pirates, death-bed confessions and secret code. The Oak Island mystery has been fascinating treasure hunters for two centuries, some of whom spent their entire lives and all of their money hoping to strike it rich as promised by a coded message on a tablet found by The Onslow Company that translated to “Forty feet below, two million pounds life buried.” But whose fortune is it? Some believe it belonged to Captain Kid or Blackbeard. Other legends say it was buried by William Shakespeare along with some of his writing or that Marie Antoinette hid her fortune there during the French Revolution. Over the years, many individuals, teams and businesses would try and fail due to flooding in the hole or lack of money and resources. Some came back with tales of paranormal activity. Spooky! Some didn’t come back at all. In 2005, the Lagina brothers, who star in the History Channel’s Curse of Oak Island used high tech equipment with some success, uncovering a 17th century copper coin from Spain, a Roman sword and a French map from 1647. And, the search goes on… b
WIKIPEDIA
The .maketrans(string1, string2) method replaces each letter in string1 with the corresponding letter in string2. This makes it easy to “rename” letters in a transposition cipher. Note that string1 and string2 must have equal lengths and ideally will contain all the letters of the alphabet. You can copy the code above directly into just about any version of Python 3 and try entering your own messages. Try the repl.it website if you don’t have Python on your computer. Want to learn more ways to encrypt messages with Python? Definitely check out the online version of this article which includes three more ways to encrypt messages plus additional built-in Python functions. b
DENNIS JARVIS, FLICKR
Proper capitalization can provide big clues to anyone trying to decipher your code. As such, we decided to first convert all the letters in any message to lowercase. The s in s.lower() stands for the string of letters in the message we want to rewrite in all lower case letters. If you prefer messages in upper case, try s.upper() instead.
August 1931 aerial photo of a dig and buildings on Oak Island
Concepts
18
BY CLARISSA LITTLER
How Do Computers
SANTI VEDRI, UNSPLASH
When you need to remember something, what do you do? You write it down somewhere...in a notebook, or perhaps you make a note on your smart phone. You know that the information will be easy to find quickly when you need it again. Computers remember things in much the same way. But where and how they "write down" the information they need to access is a bit different. You may have heard people talk about computers having "memory". But what exactly does that look like for a computer? How do computers use it? And how is it any different from, say, a hard drive or any other storage a computer or a smart phone might use? In general, when people talk about a computer's memory, they mean RAM. RAM means "random access memory", which is just
another way of saying that you can grab data from any of the tiny bins that make up the memory. But why do computers need RAM? Like a lot of things about computers, it comes down to speed. Programs have all sorts of data that they need to record and access. Some of that is just the program itself. As it's running, the code of the program needs to be read or else the processor can't see what instruction to run next. But, there's all the data the program itself needs to keep track of as well. Consider a Minecraft server. It needs to be able to keep track of the positions of every block on the server, every player's position, every NPC's position, every player's inventory, etc. That's a lot of stuff to remember and check! When you have to keep track of
so much and you have to access it fast enough to keep the game going at 60 frames per second, then speed matters. The problem with hard disk drives (HDDs) or solid state drives (SSDs) is that they are way too slow to be used by a running program. Even a really good SSD is going to be at least 10x slower than RAM and possibly more like 50x or 100x. An HDD is at least 10x slower than an SSD. In terms of our poor Minecraft server, if access to every one of those bits of data was slowed down by 100x you'd be lucky to get the game running at even 1 FPS. So we’ve established that we need special storage that's faster than a hard drive, but that's not the end of the story. There's more to memory on a computer than just RAM. There are other memory systems inside your computer that
Remember Things?
LIAM BRIESE, UNSPLASH
are to RAM, what RAM is to a hard drive. Before we start talking about them, I want to explore how we talk about time. Rather than talking about human time, let's think about time from the perspective of the computer. Computers have their own sense of time, measured by an internal clock that drives the computer’s rhythm like a metronome. These clock cycles are kind of the base unit of time, because a computer can never do anything faster than one "clock cycle". So let's call these "computer-seconds" to be more accurate. How fast a computer tells us the conversion ratio from human-seconds to computer-seconds. A 3 GHz (gigahertz) computer runs at a speed of three billion computer-seconds for every human-second. So, getting
data from RAM takes at least five computer-minutes. Now let's explore other kinds of memory and how fast they are. There are two other kinds of memory in your computer beyond the RAM. There's the kind that each core (the parts that actually execute code inside the CPU) has, which is the register. Registers can hold only a few bytes of data. That's right, not gigabytes, megabytes, or even kilobytes: just bytes. Like a single number. On the other hand, reading from and writing to a register can be done in one computer-second. This makes registers perfect as a kind of scratch paper, holding all the intermediate steps of calculations that the computer has to do. The last kind of memory that your computer has is the cache. The cache is for holding onto data
that keeps getting used again and again so that you don't have to go all the way out to RAM to get it. Cache, in its best case, takes only a few computer-seconds to operate, but it might take longer. If we can think of the registers as scratch paper for doing calculations, then we can think of the cache as a place where you copy the math problems you've been assigned into a handy notebook so you don't have to keep looking them up where they are buried in your textbook. This is only the quickest of overviews. If you find this interesting, you might want to read more about the details of how all these kinds of memory are implemented. There are so many neat tricks and so much technology that goes into making this hardware, and many opportunities for a cunning engineer to make computers even better. b
19
Electronics
20
BY LES POUNDER
Control an Arduino with Scratch A,
You'll Need: • A computer running Windows • An Arduino Uno or compatible • The Arduino IDE installed https://www. arduino.cc/en/Main/Software • A breadboard • 1 x Push button • 1 x 10k Ohm resistor (BROWN-BLACKORANGE-GOLD) • 1 x 220 Ohm resistor (RED-RED-BROWNGOLD) • 1 x LED • 4 x Male to male jumper wires
The Arduino range of boards offer a consistent and dependable platform for projects great and small. To a new user the Arduino editor and language is rather tricky at first. But we can use something familiar to new learners and children: Scratch. Scratch for Arduino, (S4A) is a version of Scratch with special blocks that we can use to write code to directly control an Arduino Uno (or compatible) connected to our computer via USB. You'll be comfortable using the Scratch interface, and will soon be able to write code to control electronic components. In this project we will learn: • How to create a toggle button to control an LED • How to create a variable, store data inside of it, and update that data • How to create an electronic circuit to control an LED with a button • How to read the status of a button (input) and use that to update a variable • How to create tests that will check if the user has pressed a button, and if the LED is already on Getting Started These hardware steps need to be repeated when setting up this
project. Firmware and Scratch for Arduino software only need to be set up once, as described below. Configure the Arduino Board As shown in the diagram A, the hardware build for this project involves connecting the long leg of an LED (Light Emitting Diode) to pin 13 of the Arduino using male to male jumper cables, and connecting the short leg to GND on the Arduino via a 220 Ohm resistor (RED-REDBROWN-GOLD) to limit the amount of current that the LED can consume. We then connect a push button to the breadboard so that it sits over the centerline on the board. The bottom left pin of the button is connected to 5V on the Arduino, the bottom right pin is connected to GND via a 10K Ohm resistor (BROWN-BLACK-ORANGE-GOLD). The top right pin is connected to pin 2 of the Arduino and has the default state of false, meaning it is turned off. This is due to using the 10K Ohm resistor connected to GND to act as a pull down resistor, ensuring that the pin is always false until we press the button and connect the bottom left pin to the top right, sending 5v to pin 2 on the Arduino and changing the state to true. Download Scratch and Firmware for Arduino The first step is to install Scratch for Arduino (S4A). Go to http:// s4a.cat/ and click on Downloads. Click on the download link for your operating system. We cover Windows in this tutorial, but there are options for Mac and Linux. Once downloaded, double left click on the downloaded file and
then double left click on the S4A16 file to start the installation. Also from the Downloads section, download the firmware for the Arduino as we will need this later. The next step before we can
write any code, is to install and run the Arduino editor, full details here: https://www.arduino.cc/en/Main/ Software. Install the Arduino Firmware Once installed, open the Arduino application and connect your Arduino which will trigger the application to detect your board. Click on File >> Open and navigate to where the firmware file was downloaded. Select this file to open and the Arduino application will ask you if it can create a folder to store the code. Select yes/ok. To install this firmware on the Arduino we need to go to Tools >> Board and ensure the correct Arduino model has been selected, in this case an Arduino/Genuino Uno.
Then go to Tools >> Port and ensure the correct port has been selected. If in doubt, you can use the Windows Device Manager to identify the correct COM port. But the Arduino application is usually very good at automatically identifying the port. Once everything is set, click on Sketch >> Upload to install the firmware. Once complete our Arduino is ready to communicate to S4A and we can close the Arduino editor. Please note that these steps do not have to be repeated as the Arduino remembers the firmware even when powered off. The Scratch for Arduino Interface Open the S4A application and you will be presented with a screen similar to Scratch 1.4. But in the top right of the screen, called “The Stage”, we see an Arduino board and a series of numbers rapidly changing. This represents your Arduino, and the numbers are the values of the pins that we can control. The interface is identical to Scratch 1.4 and we can see that the blocks used to code are on the left side, the
coding area is in the center, and the sprites and stage on the right. The main difference between Scratch and S4A is that, in the Motion section of blocks, there are added blocks for working with the Arduino. Coding with Scratch for Arduino We start the code for this project by dragging the When Green Flag Clicked block from Control into the coding area. Then we go to Variables and click on Make a variable, call
this variable status and then drag the set status to 0 block over to the coding area so that it connects to the previous block. These two blocks will act as a trigger to start the project, and reset the variable to 0 as that variable is used to set the status of the LED with 0 being off and 1, on. To continually run our code, we need to use a Forever block, found in the Control section. Drag this block and connect to the previous. Inside of the Forever block we will add If, also found in the Control section. This is used to check If a certain action has been performed, in this case if the button been pressed. The check is constructed of a _ = _ block found in Operators which is placed in the empty block space of If. The two blanks are where we first place a value of sensor Digital 2 block from Motion into the first blank, then in the second we type true. So when the button is pressed, the value of the pin it's connected to changes from false to true, and this is the trigger to do something. Inside of the If we need to add another check, this time If..Else from the Control section. This is placed inside the previous if. This is called nesting. The new check needs to be told what to look for. We are asking it to check the value stored in the status variable. If this value is 0 then it will activate some code. Using the _ = _ block from Operators placed in the same shaped space that is part of the If..Else block. Then from Variables we drag the status block and place it into the first blank space. In the second space we type 0 (zero). If the status variable contains the number 0, then that means the
button has never been pressed and that the user wishes to turn on the LED. So from Motion we drag the digital 13 on block and place it inside the If section. With the LED on we need to tell the code that we want to keep it on, and so we change the value stored in the status variable to 1 using set status to 1 block from Variables. To ensure that the user has enough time to press the button before the loop repeats we add wait 1 secs to the code. Change the value to give you enough time to press and release the button. (0.1 is pretty quick, so change it to 0.3 if you wish.) But what if the LED is already on? That means the user wishes to turn off the LED, so we need to use digital 13 off from Motion, then set the value of status variable to 0 using set status to 0 from Variables, then we repeat the wait 0.1 secs to delay the loop long enough for the user to press the button. Using one button to turn on and off the LED is called toggling. What have we learned? That we can use one button to toggle an LED on and off using two logic checks. The first check being “Has the user pressed the button?” and the second “Is the LED on or off already?” We also learned to save the status of the LED (on/off 1/0) to a variable and update that status each time the button was pressed. b
21
Concepts
22
BY PATRICIA FOSTER
All Sorts of Sorting Whether it is books in a library or clothes in a closet, keeping things organized makes it easier to find what you need. Sorting is simple for you. But for a computer, it's like trying to arrange books alphabetically, except the room is pitch black, and the flashlight can only reveal one book title at a time! Computers can only compare two elements at once, which limits their ability to find and remember data. When a computer needs to sort a list with billions of elements, it can’t afford to be inefficient. Enter sorting algorithms. These are strategies a program uses to minimize the number of times it has to go backwards and forwards through a list, in order to check that everything's in place. Some strategies are designed to be fast. Some take minimal memory space. Some are simple, and some are complex. Bubble Sort If you look at a fizzy drink, you’ll see the bubbles slowly rise to the top. Similarly, in a bubble sort algorithm, each element slowly rises through the list until it finds its ideal sorted position. If you want to follow along with the steps, grab any group of sortable things—like books, or stuffed animals of different sizes—and lay them out in a row, in random size order. STEP 1. Start at the beginning of your row. Compare the first element with the second. If the first is bigger, swap the two objects. STEP 2. Now compare the second element with the third. If the second is bigger than the third, swap. If not, keep the list as is. STEP 3. Keep going through your list, looking at pairs of objects then swapping as needed, until you reach
the end. Resist the temptation to sort the list as a human would! The list is now more sorted than before—but still not completely sorted. STEP 4. Keep repeating steps 1-3, starting at the beginning of the list and swapping pairs of objects until you reach the end. The algorithm ends when your list is completely sorted. You may have to go through this step many times. Here’s a great video illustrating the bubble sort algorithm: https://www.youtube.com/ watch?v=nmhjrI-aW5o Pancake Sort This sorting strategy requires your objects to be stackable. In a pancake sort, you use an imaginary spatula to flip sections of the stack. You can flip the whole stack, half of it, or even a single “pancake”. The goal is to sort the “pancakes” from smallest to largest—or A to Z—in the minimum number of flips. STEP 1. Find the largest element in your stack, then insert your imaginary spatula under it, and flip. The largest element should now be at the top. STEP 2. Flip over the entire stack, so that the largest element is at the bottom. STEP 3. Repeat steps 2-4, ignoring the pancakes that are already sorted at the bottom. If you started with 10 elements, you shouldn’t have to do this step more than 10 times. Check out this link (http:// www.youtube.com/embed/ kk-_DDgoXfk) to see pancake sort in action Spaghetti Sort In this sorting strategy, you’ll need a small handful of dry spaghetti noodles. Break the tips off so that each noodle is a different length.
STEP 1. Grip the handful of spaghetti, then slowly lower it so that the bottom of each noodle rests on a flat surface. STEP 2. Lower your other hand onto the handful to determine which noodle is the longest. STEP 3. Set the longest noodle aside. STEP 4. Repeat steps 1-3 until all the noodles have been sorted. Here’s a visual representation: https://www.youtube.com/ watch?v=dJEn4Xc5F2o Pigeonhole Sort In a pigeonhole sort, our elements are pigeons. Our “pigeonholes” are subgroups of data. Often, these are ranges of numbers. Maybe the first pigeonhole covers numbers 1-10, the second pigeonhole 2-20, etc. Or perhaps the pigeonholes are suits of cards: clubs, diamonds, hearts, then spades. The important thing is that our categories match the elements in our list, and the categories can also be organized from smallest to largest. STEP 1. Choose your pigeonholes, then assign the first “pigeon” to its appropriate pigeonhole. STEP 2. Within that pigeonhole, sort the pigeon so that it’s correctly ordered with the other pigeons roosting there. STEP 3. Repeat steps 1-2 until all pigeons have been placed. STEP 4. Starting with the smallest pigeonhole, remove the pigeons and place them back (in sorted order) into the list. STEP 5. Continuing from smallest to largest, repeat Step 4 with all the other pigeonholes. There are many other sorting algorithms, such as quicksort and mergesort, and each one is best for a different situation. b
6 Books You'll Love While it is true programmers use internet search engines as much as half the time to look up error messages and find solutions, programmers also read books about the trade of coding and computer science. There’s an art to software programming that can only be found in books. These books are a great start if you want to understand the basics of programming beyond hacking code. Grokking Algorithms: An Illustrated Guide for Programmers and Curious People By Aditya Bhargava, Manning Publications This is a simpler version of another great book about algorithms, Introduction to Algorithms, a textbook. There are no long-winded explanations here. Understanding algorithms is a key part of learning to code efficiently. https://www.manning.com/books/ grokking-algorithms Clean Code: A Handbook of Agile Software Craftsmanship By Robert C Martin There’s messy code, "good enough" code, and beautiful clean code. If you program long enough, some day you’ll happen upon code that is as beautifully constructed as a cathedral. Learning how to write clean code is one way to make your code tight and to learn how code actually works. Coders at Work By Peter Seibel Do you wonder what it is like to be a working programmer? Then check out this book! It's a collection of interviews with some of the best programmers. They describe their work, what interests them,
and how they approach software programming and computer science. http://www.codersatwork.com/ The Pragmatic Programmer: From Journeyman to Master By Andrew Hunt and David Thomas Software programming requires a variety of skills including the ability to be pragmatic about your coding solutions. Pragmatic means sensible and realistic. This book, while old (1999), is still one of the best explanations of how being pragmatic can help your programming. Lift-the-Flap Computers and Coding By Rosie Dickins This is my favorite book for techcurious people ages 4+ and their adults. There’s a lot to learn under each of the flaps. And the book is bright and sturdy. https://usborne. com/browsebooks/catalogue/ product/1/9570/liftthe-flap-computersand-coding/ Python for Kids: A Playful Introduction to Programming By Jason R Briggs Some programming language books are really boring. This one is fun because the author makes an effort to come up with interesting projects that cover a range of Python skills and programming concepts like loops, functions, libraries, and much more. https://nostarch.com/ pythonforkids b BEN WHITE, UNSPLASH
Notebook
23
BY TIM SLAVIN
Be Safe Online
24
BY SIMON BATT
Whoa There, Pardner! If you have antivirus software (known simply as "antivirus") installed on your computer (and you should!) you’ll know that it stops viruses from doing damage to your computer. But how does an antivirus know what’s bad and what’s good? Let’s take a peek inside how an antivirus works and how they keep your PC safe. If you’ve watched your antivirus update, you’ll see a part of the process where it downloads and installs “virus definitions.” These are special rules that tell the antivirus what viruses to look out for on the internet. If one of these virus programs arrives on your computer, the antivirus spots it and knows to get rid of it immediately You can imagine the antivirus as a saloon owner in the Wild West. Every day, the owner gets a few WANTED posters from the local sheriff, which shows some of the local bandits in the area. When someone enters the saloon, the owner compares the newcomer’s face to all the WANTED posters. If they’re not on any of the posters, they’re free to stay. If they are, they get kicked out before they can cause any trouble. This is how an antivirus keeps known viruses out, but how about the unknown ones? The people who create viruses know that an antivirus will spot the virus program and will create a rule that blocks it from being seen. They make a new version of the virus that’s only slightly different from the old one they made. That
They won't let you in. That silly hat won't fool anyone.
Hush up now, Ed. You just wait and see...
FLICKR
way, when the antivirus scans it, it doesn’t perfectly match the records that the software has. The creator of the virus hopes this slight difference is enough to fool the antivirus into allowing the new virus onto your computer. In our Wild West saloon example, this is like the bandits wearing funny hats, eye patches, or fake mustaches to trick the owner into believing they’re a different person from the people on the WANTED posters. Fortunately, the owner can use a little common sense here. If the newcomer looks similar, but not identical to, one of the wanted bandits, they can investigate further to see if they’re really a bad guy. Antiviruses can also do this. They look at software coming in and compare it to viruses that it already knows. If it shares similarities with an existing virus, the antivirus will stop it from running. This kind of detection has a funny name: it’s called “heuristics” (hew-riss-ticks). An antivirus can also use heuristics to catch a brand new virus
that doesn’t have a definition yet. For example, if a brand new software tries to delete everything on your computer, the antivirus can detect this and stop it, even if it doesn’t have a rule dictating that it should. This is like our saloon owner keeping an eye out for trouble. They don’t need a WANTED poster to spot someone trying to start a fight or rob someone. They can identify this person as bad and promptly kick them out of the saloon. They can even report the person to the sheriff, so the whole town knows to watch out for that person. However, an antivirus can’t be too strict with its rules. If it’s a little too forceful, it will identify totally innocent programs as viruses, much to the annoyance of the user. It’s important for the antivirus to be cautious, but not overly so. The next time you update your antivirus, just imagine all the WANTED posters it’s downloading for you. Who knows; in the future, it may use one of them to save your PC. b
What could have started life on Earth? The scientist Grant Mitchell is trying to answer this question. What could have started Earth on the path to being warm enough to support liquid water? Could eruptions from a young Sun have provided enough energy to start life on Earth? The sun produces gamma rays. Gamma rays are a kind of light Mitchell has studied for a long time. He wanted to know what happened to Earth when gamma rays arrived from the Sun. But that was a long time ago! So in order to answer the question he needed to learn computer modeling. He needed a computer to create an ancient world so he could see the effects of these rays on the atmosphere. And to have a useful model, he needed to learn as much as he could about how the Earth started. He studied data from other planets so that the information in his model was as good as he could get it. Mitchell mostly studies neutral particles, those with no electrical charge, such as gamma rays Gamma rays have more energy than their well-known cousins, X-rays, but the two light particles are similar. Both can go right
through things that we see as solid. And they don’t interact—very much—with the things they go through. Mitchell works in the laboratory of Georgia DeNolfo, a physicist at Goddard Space Flight Center. DeNolfo studies radiation as well as neutral particles in the area between Earth and the Sun. The lab is set up to look at present day particle events. Looking at the beginnings of life on Earth is a "fun side project" for Mitchell. He puts in the time because, “You can’t get any more basic than this.” Mitchell knew the Sun had likely provided the energy that changed the gases on Earth. But this assumption does not look at the types of energy solar flares emit. That was where Mitchell and his team came in. They started with what we know: when our planet was young, it was enveloped by gases, including nitrogen and oxygen. Those gases would have stayed dormant, but something happened. The Sun was young then too. A young star sends off much more energy than an older, more mature star. Scientists know this because of the observations from the Kepler
Telescope. Young stars similar to our Sun send off as many as 10 flares a day. The energy from these solar eruptions is huge. Scientists have measured the energy by looking at tree-ring data that corresponds with known solar flares from our Sun. Obviously, tree rings are part of trees...meaning life on Earth has been established. But the team used tree ring data to extrapolate backwards. They reasoned, if the Sun is sending this level of energy now, it sent off at least that much energy when it was a young star. So Mitchell and his colleagues used a simple computer model of a young planet and its gasses. With the behaviors of different energy particles ready, Mitchell had the model hit the fictitious planet's atmosphere of inert gases with solar flares. According to their model, the high-energy charged particles impacted the upper atmosphere. But Mitchell and his team know that the gamma rays keep travelling. They don’t get to the planet surface, but do get further into the gaseous mixture than just the upper atmosphere. Which means it could have been the gamma rays that were responsible for the first steps in life. Their energy changed nitrogen and oxygen gases into the greenhouse gas nitrous oxide (laughing gas). And that set Earth on the path to being a planet warm enough to support liquid water. Mitchell said the next steps are to use a more sophisticated model and collect more information from scientists who study planets. b
Grant Mitchell presenting his research at the American Geophysical Union meeting JONGSUN LEE, UNSPLASH
25
History
In the Beginning
BY AMY S. HANSEN
26
Notebook
BY TIM SLAVIN
Summertime, And the Livin' Is STEAM-y . . . Kids, s how this ar ticle to your p arents !
VIRGINIA STATE PARKS, FLICKR
As summer approaches, you may be thinking about attending camp. How can you tell which one is best for you? Besides just asking if the food is good (it's probably OK, at best!), here are some more questions that your parents may want to consider when choosing a camp for you. How does the camp recruit staff? Does the camp hire just any person who responds to their Craigslist ad, without checking their background? Or do they hand-pick instructors from the field of study that’s related to the camp? What qualities do they look for when they’re staffing their camps? What are student to staff ratios? This is an easy one. Would you rather send your son or daughter to a camp that has 30 campers per instructor, or one that boasts 8:1 ratios? When asking about studentto-instructor ratios, ask whether these rates are guaranteed or simply averages from past season. While some camps claim to have an uber-
small student-to-instructor ratio, they don’t ensure these numbers across all programs. What does a typical week of camp look like? What activities are planned for the week? What should your student leave camp knowing? Is one week of camp enough to satisfy your student’s needs? What is the camp’s registration process like? I’m not saying that the camp registration process must be long and involved for the camp to be a good one. But, if registration only requires parent and student names and one form of contact (while not collecting important information like allergies, emergency contacts, etc.) that might raise a red flag. Does the camp offer financial aid or scholarships? Many camps do offer financial aid or scholarship opportunities. So, a better question might be when can you apply and how you can give yourself the best chance of being selected?
Does the camp offer insurance? Emergencies happen. In the event that you must cancel camp past the stated deadline, or what if property was damaged or a child was injured, etc., does the camp assist with those costs? Most likely, the camp doesn’t offer insurance, but ask if they can refer you to an organization who can insure your child’s stay at camp. How do they handle discipline? If your child acts out, how will they be handled? Time out? Expulsion? It’s important to not only know how your child will be disciplined, but how disagreements or issues between other campers are handled. Will the camp transport kids from camp to other sites? Do you know whether or not there will be “field trips” as part of the camp experience? Are you okay with your son or daughter being transported by another, and, are you okay with your child being somewhere other than the designated camp location? b
tidbitz
27
There HAS to be a better way!
Now Boarding Slowpokes!
If you’ve waited to board an airplane flight, then struggled down a crowded narrow plane aisle to your seat, maybe you’ve wondered if there’s a faster way to get everyone seated. Turns out math has solved this problem. You might think the solution is to have the fastest people board first. But you’d be wrong. If slow pokes board first, the math says the plane will load quickest. That’s the result of running 10000 simulations of four possible boarding algorithms. b
MATTHEW HURST, FLICKR
https://www.popularmechanics.com/science/a30549336/math-boarding-plane/ KEVIN GILL, FLICKR JEFF KUBINA, FLICKR
Can You Hear Me Now?
La, la, la!
Mummy Sings the Blues
Nesyamun was an Egyptian priest who lived 3000 years ago and whose coffin noted that he had a wonderful voice. Fast forward to 2019 and 2020 when a team of scientists used CT scans of Nesyamun’s mummy to 3D print his vocal layrnx, then hooked it up to a loudspeaker and replicated a single sound, a vowel that sounds like eh. Turns out there’s a lot of research around how humans and animals speak, including a mummy! b https://arstechnica.com/ science/2020/01/after-3000-yearswe-can-hear-the-voice-of-amummified-egyptian-priest/
Ever wonder how your voice might sound on a planet other than Earth? Our voices depend on vibrations from our larynx that travel through the atmosphere. On our planet, the nitrogen and lack of carbon dioxide in the air makes our voice vibrations travel well. On Mars, however, the atmosphere is 95% carbon dioxide and our voice vibrations would quickly be stopped by the thick atmosphere. Plus our blood would boil and bad things would happen in seconds. Yikes! b https://www.popsci.com/story/space/voice-on-other-planets-moons/
Oh, Canada!
Gamefruitpulp uses Minecraft to build a 1:1 scale model of Toronto, Canada with the help of a small community. A series of YouTube videos tracks progress. They use an open source website that describes Toronto buildings and resources. They’re also hoping to get Minecraft developers to expand the limits of their game so they can build the tallest building in Toronto, the CN Tower, which is double the Minecraft's allowed height. b https://toronto.citynews.ca/2020/01/19/local-gamer-maps-torontoin-minecraft/
Parents and Teachers
28
BY TIM McGUIGAN
Coming of Age In the Digital Age When you teach in a middle school, the Jewish tradition of the Bar/Bat Mitzvah is a big event for the seventh graders. As Jewish young men and women are turning 12 or 13, they have a ceremony and a party to celebrate their coming of age. However, along with the party comes quite a bit of responsibility. A digital mitzvah is no different. For all students, a digital mitzvah of sorts also happens when they turn 13. Every time they sign in to a new app or online service they are asked to verify their age. At age 13 they are finally old enough to click Yes. They enter a world where they are no longer guaranteed privacy online. Why are 13-year-olds required to verify their age, and what does it mean for their digital lives? The reason online companies must verify their users’ ages dates all the way back to 1999 when COPPA (Children's Online Privacy Protection Act) was enacted in the United States. This Act gave anyone under the age of 13 the right to not be tracked or have their data collected. It also gave online companies the burden of querying their users and making sure that only “adults” were allowed to use their service. But, this act certainly begs the question, Are 13 year olds really adults? Do 12 year olds on the cusp of the “digital mitzvah” understand the length to which their location data, photographs,
search history, and posts will be forever collected and cataloged? In my experience, this answer is a resounding no. In 2017, The UK Children’s Commissioner found that roughly 0% of teenagers read and understand the terms of service for apps like Instagram and Snapchat. Moreover, most young internet explorers will simply click the age verification checkbox and move on without thinking twice. I had a 12-year-old student tell me point blank, “I think I’ve been 13 since I was 7.” So recently in my 8th grade classes, we have been completing a project-based unit on app design aimed at bringing younger students up to speed on privacy. Using source material from Data Detox Kit (datadetoxkit.org), a website on privacy and security, they were tasked with building an app that helps young people learn the ropes about data before getting roped in. While many apps were focused on teaching the subtle art of creating unique passwords, other projects focused on understanding terms of service and website trackers. The website Terms of Service; Didn’t Read (tosdr.org) was another great resource for highlighting the privacy tradeoffs of social media sites such as Instagram, TikTok, and Snapchat. One of my students decided to use his app to teach students about dark patterns or subtle psychological tricks websites
use such as a roach motel, a site which makes it easy to get into a situation online but extremely difficult or impossible to get out, for example, without paying for a magazine subscription. When the apps were rolled out to our 6th grade students, the students found the experience fun and sometimes enlightening. However, after serving as beta testers and giving reviews of the apps to the developer, most 6th graders said that they felt more informed, but it wouldn’t stop them from signing up for a service like TikTok. Most students didn’t feel very different about how corporations collect their data or manipulate their privacy. It will take more than an app to make young internet users more privacy aware. However, I saw the most growth from some of my 8th grade designers. Spending a few weeks immersed in the world of website trackers, dark patterns, and terms of service gave them a new perspective on the free culture of the internet. Being an adult in the world of phones, apps, and social media is a moment definitely worth celebrating, but it also carries with it quite a bit of responsibility. While they will always be the internet generation, understanding the compromises involved will hopefully give them pause and make them more privacy-conscious consumers in the future. b
29
JIM, THE PHOTOGRAPHER, FLICKR
“Everyone should learn how to code, it teaches you how to think.”
—Steve Jobs
Thank you for reading this issue of beanz ! Check out the links below to read stories from this issue online with links to learn more. "Hey, Wait a Minute!" http://beanzmag.com/ history-computer-mouse
Python Ciphers http://beanzmag.com/ python-ciphers
In the Beginning http://beanzmag.com/ how-life-began
Recursion: When the Big Picture Comes Together With Smaller Pieces http://beanzmag.com/ recursion
How Do Computers Remember Things? http://beanzmag.com/ computer-memory
Summertime, And the Livin' Is STEAM-y . . . http://beanzmag.com/ questions-ask-summer-techcamps
MicroPython and Mindstorms http://beanzmag.com/ lego-mindstorms-python Oh, Snap! http://beanzmag.com/ snap-language SketchUp a Beach Ball http://beanzmag.com/ sketchup-circus-ball "Oh, Look at the Time!" http://beanzmag.com/ history-sundials-time
Control an Arduino With Scratch http://beanzmag.com/ scratch-4-arduino All Sorts of Sorting http://beanzmag.com/ sorting-algorithms 6 Books You'll Love http://beanzmag.com/ programming-books Whoa There, Pardner! http://beanzmag.com/ how-antivirus-works
tidbitz http://beanzmag.com/ april-2020-news-wire Coming of Age In the Digital Age http://beanzmag.com/ digital-mitzvah-privacy
ribe! Subsc
https://beanzmag.com/subscribe