No Starch Press Blog

Using the Raspberry Pi for Educators

Dan Aldred is the author of Raspberry Pi Home Hacks, scheduled for release later this year, and the creator of the TeCoEd website, which contains free resources for teaching computer education. He is a computer science teacher, a freelance resource writer, a hacker, and a champion of the Raspberry Pi. He was kind enough to create this article with advice and tips for educators on using the Raspberry Pi in the classroom.

A Brief History of the Pi

Saturday, March 3rd, 2019 saw the Raspberry Pi’s seventh birthday celebrations trending on Twitter under the hashtag #PiParty. That Saturday marked seven years since the launch of the $35 computer the size of a credit card. To this day, the Raspberry Pi continues to be extremely popular with schools, makers, and tinkerers.

When people first hear about the Pi, they usually ask “How good can it really be? It only costs $35.” In a market saturated with smartphones and tablets that cost upwards of $500, anyone should be forgiven for questioning the performance of such an affordable product. Yet the evolution of the Pi has continued to surprise, from its original launch specs of 700 Mhz and 256MB of RAM to the current specs of 1.4 GHz and 1GB RAM. Impressively, it has kept the original $35 price tag. When was the last time that you purchased a new phone or laptop and paid the same price that it cost seven years prior?

The Pi Zero model, a $5 version of the Pi the size of a stick of chewing gum, is the most impressive iteration yet. The current Pi Zero W, which retails at around $10, is the same physical size but boasts a 1 Ghz processor and 512MB RAM (four times faster than the original Pi). In addition, it has onboard Wi-Fi and Bluetooth, which makes it a perfect board for hacks, projects, and builds.

Make Computer Science More Engaging

As an educator and teacher, I have found the Raspberry Pi to be an inspirational, motivational, and transformative tool for learning computer science. I had one student who self-described as dyslexic, “not very good at maths”, and “in need of a strong pair of glasses.” For eight months he attended my Raspberry Pi lunchtime club and was able to learn in such a way that he gained a world of confidence and went on a journey of personal transformation. Now he’s a confident student who enjoys the ‘logic of maths’ and has even developed a program used on the International Space Station.

In most situations, with the right support from teachers, students feel encouraged to try new things, fail, and keep trying. Students tend to feel the most empowered when the learning process happens through fun activities. This is where the Raspberry Pi comes in. Students are not ‘learning to code,’ but learning how to ‘hack Minecraft.’ They aren’t ‘calculating and coding’ a distance sensor but creating a ‘friend/enemy tracker.’ The versatility of the Pi means that projects, content, and theory can be adapted to appeal to a wide range of students, meeting their needs and abilities. Learning is accessible to all.

Easy to Maintain and Cheap to Replace

One frequent concern for teachers is, what happens if I’m using a Pi and the software fails or the SD card becomes corrupt? With a regular computer, teachers can normally notify tech support and have a malfunctioning computer repaired and returned within days. When using the Pi, malfunctions become a learning opportunity. Problems become chances to show the students how to flash an SD card, install an OS, and discuss what an .img file is. The process of setting up the Pi computer takes about 11 minutes and the next time they experience malfunctions, students will be able to fix it themselves by setting it back up again. If time is at a premium, simply keep a spare SD card in your pocket and swap it over, and the Pi can be up and running again in 30 seconds!

With a $35 price tag, lending students a Pi for the weekend is possible. The external engagement is priceless, even if students are just getting extra practice, and replacing a lost unit won’t break the bank.

Turn Theoretical Concepts into Practical Knowledge

The Pi is also a fantastic tool for learning about abstract concepts like networking. School computer networks are usually locked down. Students have no access to practice setting them up or configuring them. But teachers can easily bring in a few Pi computers and an old home router and get students to set up their own network. Using the OS command line, they can discover their IP address, ping each other, send messages, and even learn how to remotely shutdown another student’s Pi. Install a simple web server like Apache and let students build and host a website that can be accessed from the main school network. MAC addresses are accessible, and you can discuss the concept of spoofing one. Students are often only taught this information in theory. With the Pi in the classroom, they benefit from hands-on experience.

If you find that this approach to networking is still too dry for some of the students, let them set up and host their own Minecraft or Doom server. Once they’re hooked, move on to business and industry applications.

Give Students a Deeper Understanding of the Technology

The Pi grants your students access to the settings, network, GUI, hardware, and so on. This isn’t something to be intimidated by. Students aren’t learning anything if they can simply plug in hardware (a webcam, a flash drive, etc) and have it work perfectly. Modern technology is so user-friendly that any understanding of how the hardware really works is lost. I asked a class how the camera on their phone worked. One enthusiastic student’s hand shot up and they answered, “press the camera app symbol!” Correct, but, what is really happening when you tap the screen? Some argue we don’t need to know. I disagree. An inquisitive mind is healthy.

The computer keyboard is the distant relative of the typewriter, first released in the late 1880s. After over 100 years, remnants of the typewriter are still with us in our everyday keyboards, yet I have met students who don’t know how to type on a keyboard because they have only ever used the touch screens of smartphones and tablets.

With the Pi, students can dig in behind the scenes and see what is actually going on. They can learn to manage, configure, and control software and hardware in an intuitive way. Again, if this is not appropriate for a particular lesson, simply boot the GUI and students have differentiated access.

Acquire Affordable Ready-to-Use Hardware Attachments

One of the best hardware features of the Raspberry Pi is the set of 40 GPIO pins. These pins enable interaction with the environment, inputs, outputs, and lines of code. The Raspberry Pi has a wide range of affordable HATS (Hardware Attached on Top) designed to sit flush on the pins that add additional functionality and hardware to the Pi. One can buy everything from screens, LED matrices, and environment sensors to text scrollers, e ink displays, servo motor boards, and even pianos.

Projects My Students have Created with the Pi

Dan Aldred, computer science educator and author of Raspberry Pi Home Hacks

Lay-Flat Bindings: The What And How

lay-flat binding

You may have noticed that the spines of your No Starch Press books, even the ones you use most, stay free of creases. That’s because we pay extra to have our books bound with premium lay-flat bindings. Most No Starch books (with the exception of hard backs, some older books, and a very few print-on-demand titles) sport this nice little Easter egg.

Lay-flat bindings allow our books to lay open by themselves on a flat surface, making it easy to refer to them while working at a computer. As an added bonus, they keep the spines from developing cracks and creases with frequent use.

Here’s a somewhat technical explanation from our printer about how these special spines are manufactured.

Once a book has been printed and the printed signatures collected, the collated signatures enter our binder and are milled on the spine to prepare them for glue. There is a two-step glue process using PUR (polyurethane reactive) glue, the absolute strongest and most flexible book adhesive made, and EVA (ethylene-vinyl acetate) glue to adhere the covers. The milled signatures go across the PUR glue pot where glue is applied with two rollers:

PUR glue application

A reverse spinner roller then removes the excess glue:

glue leveling

The book then travels between two side glue rollers that apply a bead of EVA glue to the first and last page of the book. EVA glue must be used in this step because is adheres immediately to hold the book together whereas PUR glue must cure for eight hours before it reaches its maximum strength.

The next station is the krash station where the krash paper is applied to the spine of the book to cover the PUR glue film. This creates the gap between the book block and cover that is critical to provide the flexibility and lay-flat properties of this binding style. Finally, a cover is applied which is adhered to the book with the side glue at the front and back corners of the spine.

The books are then inspected for quality issues and shipped off to our distributor, bookstores and of course, to you.

The Very First No Starch Press Book: The Book of SCSI

photo of The Book of SCSI

It’s January of 1995. Boyz II Men have the #1 hit song, Braveheart is in theaters, and Dr. Martens are à la mode. No Starch Press has just published its very first book of all time, The Book of SCSI: A Guide for Adventurers. The guide was a meticulously researched comprehensive SCSI resource that featured no-BS explanations for beginners in plain English as well as deep dives into the technology by experts. While decades out of date, this book set the tone of No Starch books to come with its conversational approach, attention to detail, careful fact checking, and fun aesthetic. Its table of contents included:

  • An intro to the basics of SCSI
  • Instructions on how to add SCSI to your PC
  • An explanation of how the SCSI bus works
  • Overviews of ASPI programming and CAM programming
  • Q&A from major SCSI host adapter manufactures Adaptec, DPT, and Future Domain
  • A directory of 150+ companies that produce SCSI hardware and software
  • A look at SCSI into the future by John Lohmeyer, chairman of the ANSI SCSI-3 Committee and world’s leading SCSI expert
  • Drawings and diagrams of SCSI hardware and systems
  • Tips and troubleshooting help
  • A glossary of terms
  • A comprehensive index

Neither the original, nor its 2nd edition, released in the summer of 2000, are still in print, but both were well-regarded at the time (the original release was even reviewed by PC magazine).

Cheers to the OG No Starch fans who threw on a flannel and headed to the Computers section of their local Waldenbooks to pick up a copy.

Fewer, Better Books

We offer our authors a choice of royalties -- from 12 to 15 percent. Most choose the 12 percent option but many still take 15 percent.

Several of our technical titles have sold well over 20,000 copies but we've also had the rare title sell in the 2-3,000 copy range. That is definitely rare and only on very niche topics.

Writing a technical book is a lot of work on both ends, especially when a publisher provides real editorial and marketing support. Unfortunately, most no longer do, which is unfortunate for all
involved and a good argument for considering self-publishing. After all, if publishers aren't offering added services, why not self-publish?

We read and edit every word before a book goes to copyedit. I've personally spent well over 300 hours editing individual titles. If you were to hire someone to do that work the minimum cost would be $15,000.

I'd love to see more people writing technical books -- good technical books -- for love of the subject and out of a desire to share knowledge. Sure, a good book will build your brand, but make it great, first.

The world always needs more good books. Our watchwords are "fewer, better books." Aim to be great.

William Pollock, Founder
No Starch Press

The Cult of LEGO is the BIG Winner!

We had a welcome surprise the other day when we learned that The Cult of LEGO won both the Wild Card category and the Grand Prize at the 2012 San Francisco Book Festival.

The judges are book experts, and the grand prize winner is selected based on its popular appeal and the authors' passion for their story. According to the Festival organizers, "The book's impressive scope and its fascinating coverage of a world that touches millions won over the judges."

We've been really pleased with the success of The Cult of LEGO, and it's rewarding to see that book people like it, too. Well, maybe book people are LEGO people. Who knows.

Here's to playing with plastic bricks. More to come.

Just Say No to SOPA

Here we go again. First it was the DMCA. Now it’s SOPA, and this time it’s probably worse.

I get it: There are many sites based in countries like Russia and China that have made it their business to sell pirated content. Honestly, I'm not that bothered by sites that deliver pirated content for free to people who are going to pirate it anyway, but I do have a real problem with sites that sell our content (or anyone else’s) and take all of the revenue for themselves. Having read the Act in its entirety, I think SOPA was probably designed to combat these sorts of sites.

The problem, though, is that SOPA is simply too broad. Whack-A-Mole doesn’t solve anything. Through SOPA, legislators have tried to create a law to protect the flow of digital information—a challenge that simply can’t be tackled without undue risk to all of the things that we enjoy about Internet freedom. Legislation like SOPA is not the answer.

As a businessman I can see why people find SOPA attractive. Many publishers are afraid of technology because they think that piracy will eat away at their content sales. Couple these fears with an economic downturn that’s worse than any we’ve seen and you end up with an act like SOPA. Build a wall to protect your financial interests and anyone who comes near will be shut down with a volley of arrows. That will fix the problem, right? Wrong.

SOPA is trying to solve a real problem, but it’s like dumping a water tower on a burning trash bin. You put out the fire, but you flood the neighborhood. No Starch Press is against SOPA, and we encourage other publishers to trust their readers, as we do. Do the right job, focus on quality, and give your readers what they want and deserve. They’ll return the favor by supporting you.

If we, as content producers, would spend more time producing great content and treating our readers fairly, rather than trying to whack every mole, we’d all be better off.

William Pollock, Founder
No Starch Press

The Top 5 Reasons to Start Using CSS3 Right Now!

From Peter Gasston, the author of The Book of CSS3

1. Device-responsive pages
The big growth area of web browsing is on smartphone and tablet devices such as Android, iPhone and iPad. New media features and page layout modules in CSS3 let you make pages which respond to the capabilities of the device that's viewing them, automatically optimizing your content for multiple screen sizes and giving your visitors a tailored experience.

2. Eye candy!
CSS3 brings web documents to life without complicated JavaScript. Rotate, scale and skew page elements in both two and three dimensions, add smooth transitional animations to elements when their values change, and go even further with keyframe animations which give you fine control over the behavior of your page elements.

3. A better reading experience
The Web was made for reading text, but for years we've had to use a handful of fonts in a very conservative way. CSS3 brings the power to use any font you wish, to decorate the text with drop shadows and outlining, plus new ways of laying out the text such as in multiple columns, like a newspaper or magazine.

4. Easier to maintain
Using CSS2.1 usually means adding images (and extra markup) to your documents in order to achieve what should be simple effects. Something as basic as adding rounded corners to an element can mean using up to four extra empty elements to accommodate the graphics required to fake the appearance. CSS3 was created to address just these problems, so you can add rounded corners, drop shadows, gradient backgrounds and much more without writing unnecessary markup or creating multiple image files - meaning a lot less work to make and maintain your documents.

5. Cleaner code
The greatly expanded range of selectors in CSS3 means you can add special formatting to links depending on their destination, loop through long tables and lists, even select form elements depending on their current state - all without having to clutter your code with surplus class attributes.

eBook pricing -- what do you think?

Dear Readers,

We've been having some internal discussion about how to price our ebooks.

Let's face it. We're already in the bittorrent library but membership in that not-so-exclusive club isn't really the way to fuel a business.

Most technical book publishers are offering ebooks at anywhere from 60-80 percent of a book's list price. We've toyed with (and we're currently offering) ebooks at 50 percent of a book's list price (or free with purchase from us), which seems fair to me as long as we and our authors are actually getting that 50 percent. The problem, if it is a problem, is that when our ebooks are sold through retailers those retailers take a significant cut off the top because they need to make money too. As a result, we get something closer to 35 or 40 percent of a book's list price, if not less.

It takes time and real work to create the sort of quality, handcrafted books that No Starch Press is known for. Our readers expect a lot from us and we aim to deliver with each publication. It's important to me that No Starch Press continue to succeed.

So my question to you is, what do you think is a fair price for an ebook? Figure that the print cost is perhaps 10 percent of the book's list price and that when we sell books to resellers we get about 50 percent of the book's list price. (That's why 50 percent off list for ebooks purchased directly from us could make sense.)

So I'm turning to you, our readers, to tell me what you think and to offer creative suggestions. We could, for example, price ebooks according to a timed reduction scheme. For example, they might start out at 75 percent of list price and drop in price every six months, as a particular book ages. Or we could stick with 50 percent off for those No Starch Press VIPs. You know, the ones carrying those special gold cards. Or what?

What do you think?

Please share your comments on this post. I'd love to hear your thoughts.

Thanks for your support.


Wasting Time with Android

A friend loaned me an Android phone the other day. I’ve been using a Blackberry Pearl for years. I like the squished keyboard and I can type pretty quickly on it. I’ve downloaded some useful apps to it too, though mostly I just use Opera for browsing and read the New York Times. It works.

Now, let me just say that I haven’t used an iPhone for any period of time so I can’t compare its OS to that of Android, but Android is pretty fun. This phone (an HTC running Android 1.5) is a device first and a phone second. It’s just as interesting without cell service as it is with service, though of course it’s nice when it works as a phone.

My favorite toys so far are probably the AK-47 and shotgun apps, though we know they’re a complete waste of time. I love accelerometers and I think these simple toys that use the accelerometer in such clever ways are just brilliant. Oh, I know that there are plenty of copycats out there but I don’t care. They’re just plain fun. I can’t wait to give them a try in the TSA line.

The barcode scanners look awesome but I haven’t been able to try one IRL because I don’t have a data connection. I can see how they might come in very handy though.

Touchscreens are pretty awesome but I’m not one to be a first adopter. I don’t need a touchscreen to do what I do with a phone, but they’re fun to play with. Don’t you just want to reach inside the phone and grab that sliding screen? I do. But I don’t like typing on that virtual keyboard. (Yes, the Droid has a real keyboard. I’ll check it out.)

I’ve found the initial experience with Android kind of overwhelming. There’s so much to be done with it, and downloading countless apps can be fun. But at the same time, there are many computer games out there that I won’t play because they just waste my time. Don’t we have better things to do?

Yes, I’m about 75 million people late when it comes to using a phone with a touch screen, or maybe it’s 150 million. But then again I’m just now watching Seinfeld, and only because it passes the time on the exercise bike to nowhere.

Clearly, Android has legs. I don’t need to tell you that. Just imagine what the device world will look like in a couple of years.

Here’s looking forward to our first Android book. Coming to a bookstore near you. Or maybe coming to your little handheld device thingy.

For now, I’ll keep the Blackberry, though my 1985 Volvo is going. It failed the smog test so the State of California will presumably buy it for $1,000. Sniff.