Step away from the ‘smartphone’ and try using your hands and mind to make something – #bookreview

The Make: Series of How-to Books

A British scientist made headlines a few years ago when she warned that young people no longer make or repair things. It has become all too easy for them now, she cautioned, to simply throw away old or broken devices and buy new ones.

A key point was that many things currently being discarded could be fixed or refurbished and put to new uses. It would just take a little effort, a little learning, and some imagination.

I ran into some of that “no longer make or repair things” attitude a few years ago while working temporarily as a substitute teacher. If you have ever been a substitute in a public high school or middle school, you likely know that students often view “subs” as an excuse to pay absolutely no attention to anything he or she says.

When I could get no interest or response to the day’s assigned work in a science class, I tried introducing a challenge: Imagine you have become stranded on a desert island in the Pacific Ocean, and you have just a few items with which to try to survive and attract the attention of a passing ship. The items ranged from coconuts and palm fronds to a pocket mirror, a small magnifying glass, a couple of cups, some string and a safety-pin.

I figured the kids might come up with some clever ways to (1) crack open the coconuts for food and liquid, (2) start a fire using a magnifying glass and dried palm fronds, (3) use the string and safety-pin to catch a fish to cook over the fire, (4) use the cups to boil seawater and capture the steam to make a little drinking water, and (5) prepare a separate pile of palm fronds to burn as a rescue signal to a passing ship.

Ha. At first, the students seemed intrigued and engaged by the challenge. They immediately started calling out survival “strategies.” Unfortunately, most of their ideas started with two concepts: “First, I’d go to the mall and buy…” or “First, I’d go online and buy….”

The reality of being stranded in isolation without immediate communication did not even register with them at first. When they did begin to try to imagine surviving without their smartphones, they quickly ran out of ideas and became sullen or antagonistic toward me.

This experience also became the straw that finally broke the back of my desire to continue as a substitute teacher. I had grown up at a time when making, tinkering, building, and repairing all were noble pursuits for a teenager interested in science, electronics, space and engineering. If I wanted a shortwave radio or a new type of model airplane or a small rocket I could launch in my back yard, I built them from scratch or combined pieces of previous projects. None of this experience registered with my students. And my next attempts to stir up enthusiasm for making and repairing things similarly fell flat.

Make It So?

Do you worry that your kids are growing up not knowing how to make things or fix things? Do you fret that you no longer remember how to make things or fix things?

Working with your hands, eyes and brain – and not just mindlessly swiping an index finger across a tiny screen – can be both physically and mentally rewarding.

Of course, the web is alive with “how to” information for making or repairing almost anything. And I make occasional pilgrimages to public libraries and bookstores to find reference materials and instruction books related to specific projects.

I am an unabashed fan of the “Make:” series of books from Maker Media. I don’t build all of their projects, but I do try out some of them. And I enjoy reading about zany, yet sometimes practical, stuff such as (1) how to use a magnet to tell if money is counterfeit, (2) how to create artwork that actually does something, using just a handful of electronic components, (3) how to generate electric power with several lemons connected in series, or (4) how to make some really good paper airplanes and paper helicopters. The “Make:” books consistently feature clear, well-organized instructional text, illustrations and photographs of how things go together.

Books such as Tinkering: Kids Learn by Making Stuff (2nd edition), Easy 1+2+3 Projects, and Planes, Gliders, and Paper Rockets can appeal to parents and children who are in elementary school or older. For older kids and their parents, or for would-be engineers, Make: books such as Bluetooth, Getting Started with Intel Edison, and 3D Printing Projects can be helpful and enlightening how-to guides. Books on numerous other topics also are offered.

Do your kids (and/or you) seem unhealthily addicted now to clutching and staring at smartphones all day? You may want to try putting the devices aside and seeing what you can create with your hands, your mind, some household materials and a few readily available gadgets that don’t require pricey data plans and contracts.

You can do it! Power off now! (Okay, for just a few minutes at first if you insist and if you have a really bad case of smartphone withdrawal.)

— Si Dunn

Advertisements

Make: Paper Inventions – A fun how-to book for kids and their adults

 

 

 

Make: Paper Inventions

Kathy Ceceri

Maker Media, Inc. – paperback

Don’t just hand this book to your kids, say “Have fun,” and then go off to play with your computer. Get out the glue, scissors and paper and join in.

You might enjoy seeing what happens  when you (1) cut all the way around a Möbius strip or (2) fold a single strip of paper into a versatile and surprising trihexaflexagon, or (3) try your hand at quilling. That, the author writes, is “the art of creating 2-D and 3-D designs out of thin paper spirals and curls.”

Make: Paper Inventions opens with a nice, succinct overview of the history of paper and the fact that it was not made from the hard interior of trees until the mid-19th century. Before then, paper was made from many other materials, such as linen, cotton, the inside of certain tree barks, and the flattened stalks of papyrus plants.

The first project in the book is the messiest, and you may not want to use your favorite blender. But it will provide good teaching moments for kids (and their adults). The text and photographs show how to make new paper from several sheets of recycled copy paper. You will not want to run the homemade paper through your laser printer, but it can be used for art projects.

Kids can handle some of the paper projects in this book by themselves. However, the more complicated ones, such as building a large geodesic dome from newspaper pages, definitely will need adult guidance and encouragement. And certain materials may need to be ordered.

Meanwhile, the final chapters of this fine book offer projects that mostly involve folding pieces of paper. And they provide some focus on mathematics, such as how to fold paper in such a way that just one diagonal cut will result in a five-pointed star.

Make: Paper Inventions can help put more STEAM (science, technology, engineering, art, and mathematics) into the lives of your kids–and into your life, as well.

Si Dunn

Four good books that can help boost your JavaScript skills – #programming #bookreview

Ready for some enlightenment that can boost your JavaScript programming skills?

O’Reilly recently has published four books that can help you move from basic JavaScript library user to confident, experienced developer. 

“JavaScript started out as a simple and approachable front-end scripting language,” the publisher notes. “It has matured into a true cross-platform environment targeted by the latest emerging languages, frameworks, and developer tools.” The four new JavaScript books can help you “[l]earn how you can get the ultimate in responsiveness and interactivity from JavaScript, whether you use it on the front-end or server-side.” 

The four books are: JavaScript Enlightenment and DOM Enlightenment, both by Cody Lindley; Learning from jQuery by Callum Macrae; and Testable JavaScript by Mark Ethan Trostler.

#

JavaScript Enlightenment
Cody Lindley
(O’Reilly – paperback, Kindle)

Short, clear code samples are the stars of this fine, informative book. And most of the code samples can be viewed, executed and modified online using file links provided for the jsFiddle.net website.

The book’s goal is “to give the reader an accurate JavaScript worldview through an examination of native JavaScript objects and supporting nuances: complex values, primitive values, scope, inheritance, the head object, etc.” Cody Lindley adds: “I intend this book to be a short and digestible summary of the ECMAScript 3 Edition specification, focused on the nature of objects in JavaScript.”

Lindley keeps that promise in his 147-page book. His code samples rarely span more than a half page, and his explanatory paragraphs also are taut and to the point.

For example: “In JavaScript, objects are king: Almost everything is an object or acts like an object. Understand objects and you will understand JavaScript. So let’s examine the creating of objects in JavaScript….An object is just a container for a collection of named values (a.k.a properties).” 

Lindley’s book covers six of the nine native object constructors that are pre-packaged with JavaScript. The six are: Number(); String(); Boolean(); Object(); Array(); and Function(). He skips Date(), Error(), and RegEx() “because, as useful as they are, grasping the details of these objects will not make or break your general understanding of objects in JavaScript.” But he does hope you will learn them later, on your own. 

“JavaScript,” he writes, is mostly constructed from just these nine objects (as well as string, number, and boolean primitive values.) Understanding these objects in detail is key to taking advantage of JavaScript’s unique programming power and language flexibility.”

 # 

DOM Enlightenment
Cody Lindley
(O’Reilly – paperback, Kindle)

If you work with JavaScript, you probably rely on a Document Object Model (DOM) library such as jQuery to help you handle HTML scripting. 

But you can script the DOM without a DOM library, using JavaScript. Cody Lindley shows how in this excellent guide aimed at two types of developers who have experience with JavaScript, HTML, and CSS.

“The first developer is someone who has a good handle on JavaScript or jQuery, but has really never taken the time to understand the purpose and value of a library like jQuery,” Lindley writes. “The second type of developer is an engineer who is tasked with scripting HTML documents that will only run in modern browsers or that will get ported to native code for multiple OSes and device distributions (e.g., PhoneGap) and needs to avoid the overhead (i.e., size or size versus use) of a library.”

He notes that “HTML documents get parsed by a browser and converted into a tree structure of node objects representing a live document. The purpose of the DOM is to provide a programmatic interface for scripting (removing, adding, replacing, eventing, and modifying) this live document.”

Much of his 161-page DOM Enlightenment  focuses on how to work in JavaScript with “the most common types of nodes…one encounters when working with HTML documents.” He purposefully has “left out any details pertaining to XML or XHTML.” And, to help keep the book small, he has “purposely excluded the form and table APIs,” but adds: “I can see these sections being added in the future.”

Lindley also imposes a key technical limitation on the “content and code in this book….” It was, he says, “written with modern browsers (IE9+, Firefox latest, Chrome latest, Safari latest, Opera latest) in mind.”  

In keeping with the goals of O’Reilly’s Enlightenment series, explanations are short and concise and code examples are kept small. Also, the code examples are available online and can be displayed, run, and modified at the jsFiddle.net website.

 Cody Lindley emphasizes that he is “not promoting the idea of only going native when it comes to DOM scripting….” He hopes, instead,  “that developers may realize that DOM libraries are not always required when scripting the DOM.”

#

Learning from jQuery
Callum Macrae
(O’Reilly – paperback, Kindle)

Some developers work comfortably with jQuery yet have only a modest understanding of JavaScript.

Callum Macrae’s concise, well-written new book is intended to help fill that gap. It is “targeted at developers who know jQuery, but who don’t feel comfortable in their JavaScript knowledge or would just like to know more.”

The 102-page book focuses on the JavaScript code that jQuery covers up. It offers five chapters and two appendixes, with many short code examples and other illustrations. Much of the code is available through a GitHub repo.

Chapter 1, “Event Handling,” explains how event handling works in JavaScript and notes that “[e]vents are the heart of pretty much all web applications….jQuery provides a suite of functions to make event handling considerably easier than in JavaScript alone.” But these functions “add overhead and remove control from you, the developer. For this reason, it is important to know how you can handle events without jQuery in pure JavaScript.”

Chapter 2 covers “Constructors and Prototypes.” Writes Macrae: “Constructors are a way of creating objects, and can be initiated via the new keyword. Prototypes are one of the more powerful features of JavaScript, and allow the developer to declare a method or property that all instances of an object will inherit.” The chapter also can “help you understand how jQuery works, as jQuery itself uses prototypes.” 

Chapter 3 deals with “DOM Traversal and Manipulation.” Macrae notes that “jQuery includes a number of functions that make working with the DOM a lot easier than with JavaScript alone, which can be pretty ugly. However, the functions provided by jQuery can be rather hefty (especially in older browsers), and it is often a lot faster to just use pure JavaScript. Therefore, it is important to know how to work both.”

Chapter 4, “AJAX,” covers jQuery’s AJAX functions and concedes that they “offer some significant improvements over the native JavaScript AJAX features, as they are a lot easier to use.” Macrae explains: “AJAX is the act of making an HTTP request from JavaScript without having to reload the page; you could think of it as an inline HTTP request.” The chapter shows some jQuery AJAX requests and how those AJAX requests are sent in JavaScript. The goal is to help you get better at debugging code and also realize that “it isn’t worth loading the entire jQuery library to send a few requests and nothing else….”

Chapter 5, “JavaScript Conventions,” explains some “common conventions that you can use to improve your JavaScript…such as making your code more readable by using comments and whitespace correctly, optimizing your code in order to improve performance, design patterns, and some common antipatterns (code that causes more problems than it solves.)”

 This book is not recommended for persons who have no jQuery or JavaScript experience. Still, Appendix A, “JavaScript Basics,” provides a 28-page introduction to JavaScript, starting at “Hello World!” Appendix B, meanwhile, describes several applications and websites that can help you improve your JavaScript knowledge.

 # 

Testable JavaScript
Mark Ethan Trostler
(O’Reilly – paperback, Kindle)

“You have to test your code,” Mark Ethan Trostler emphasizes, “so why not make the process as easy and painless as possible?”

That’s a very desirable goal. Yet, as he notes a few sentences later, “testing–especially JavaScript testing–is complicated.”

For example: “Client-side JavaScript is especially difficult to test properly, as we have very little control over the environment within which our code runs. Multiple operating systems, multiple versions of operating systems, multiple browsers, multiple versions of browsers, not to mention plug-ins, extensions, different languages, zoom levels, and who knows what else, all conspire to hinder the performance of our applications. These permutations slow down, break, crash, and eat our applications for lunch. It’s a jungle out there!”

Trostler, a software engineer who works in test at Google, says his book “attempts to bridge the gap between sane development practices and JavaScript. JavaScript is a weird little language.” And he has aimed his guide at “people who encounter JavaScript professionally. Beginning, intermediate, or guru-level developers are all welcome, as this book has something for everyone.”

His 250-page how-to guide is structured into eight chapters that “tackle testable code in several steps. First we will investigate complexity. Then we will look at an architecture choice that attempts to limit complexity and coupling. With that as our foundation,” Trostler continues, “we will move on to testing, both at the functional level and at the application level.” From there, he delves into: code coverage; integration, performance, and load testing; debugging; and using automation in tests.

 “Writing unit tests for client-side JavaScript can be daunting,” Trostler states. “That means too many people don’t do it. This is not OK…”

Testable JavaScript is well written and rich with code examples, screenshots, diagrams and other illustrations. Whether you write client-side or server-side JavaScript — or both — or you are trying to rework some legacy files, Mark Ethan Trostler’s text can help you learn how to better create and maintain testable code.

Si Dunn

Introducing Erlang – A gentle, effective guide to a challenging programming language – #bookreview

Introducing Erlang
Simon St. Laurent
(O’Reilly – paperback, Kindle)

Erlang has come a long way since it began its odd life in the 1980s as a programming language for telephone switching systems, specifically Swedish-made, Ericsson telephone switching systems.

Today, the language and its Open Telecom Platform libraries are gaining new converts among serious practitioners of functional programming. Many of them likewise are drawn to the built-in support for concurrency, distribution and fault tolerance.

“The broad shift from single computers to networked and distributed systems of multiprocessor-based computing gives the Erlang environment a tremendous advantage over practically every other environment out there,” author Simon St. Laurent contends. “More and more of the computing world is starting to face exactly the challenges that Erlang was built to address.” Yet, as he concedes in his preface, “Erlang has long been a mysterious dark corner of the programming universe, visited mostly by developers who need extreme reliability or scalability and people who want to stretch their brains.”

Brain-stretching indeed is one reason why Erlang has stayed in that dark corner for more than two decades.

The language’s learning curve, St. Laurent notes, “starts gently for a while, then it gets much steeper as you realize the discipline involved, and then goes nearly vertical for a little while as you try to figure out how that discipline affects getting work done—and then it’s suddenly calm and peaceful with a gentle grade for a long time as you reapply what you’ve learned in different contexts.”

In a world where everything seemingly must be done in a hurry, you won’t learn Erlang in a hurry. But the payoff for learning it can be rewarding. Erlang, it seems, now is on a roll and experiencing growing demand. The language has been showing up in many different places, from Facebook to CouchDB to the Costa Rican Institute of Technology, to name just a few. Numerous package managers, such as Debian, MacPorts, and Ubuntu, also include a version of Erlang in their default installation.

I run Windows machines, and getting Erlang onto them has proved pleasingly easy. Indeed, Windows users apparently have some of the easiest times getting started with Erlang. Just go to http://erlang.org/download.html and click on the correct link – 32-bit or 64-bit – for your PC.

The book’s code samples can be downloaded from a link provided in the book. And it’s easy to work with the Erlang shell, its command-line interface. The newest version now provides numbered lines.

But, if you’ve worked with other programming languages, Erlang’s syntax likely will seem awkward and strange for a while.

“Punctuation is different and capitalization matters,” the author emphasizes. “Periods even get used as conclusions rather than connectors!”

To display the current working directory in the shell, for instance, you type pwd(). And do not forget to include the period.

To move up a directory, you type cd(“..”). And do not forget to include both the quotation marks and the concluding period.

Indeed, almost everything you enter in Erlang seemingly must end with a period.

Also: “Forget classes, forget variables that change values—even forget the conventions of variable assignment,” the author cautions. “Instead, you’re going to have to think about pattern matching, message passing, and establishing pathways for data rather than telling it where to go.”

Introducing Erlang takes a slow and gentle but effective approach to learning this powerful and difficult language. Simon St. Laurent spends a lot of time trying to help readers “get comfortable in the sunny meadows at the bottom of the learning curve.” Still, his well-written book effectively and efficiently meets its stated goal of helping you “learn to write simple Erlang programs.” It likewise shows and explains how to get started working with the OTP, the Open Telecom Platform’s libraries.

The book and its numerous code examples offer a solid grounding in the basics that you can then use to “understand why Erlang makes it easier to build resilient programs that can scale up or down with ease.” And, if you decide to continue learning, Simon St. Laurent’s new book can make it easier for you to move on to the really brain-stretching, and shadowy, inner workings of Erlang.

Si Dunn

Make an Arduino-Controlled Robot – #diy #bookreview

Make an Arduino-Controlled Robot
Michael Margolis
(O’Reilly – paperback, Kindle)

Technology now makes it relatively easy to build simple robots that can be controlled remotely or can control themselves autonomously using built-in sensors and software.

This engaging how-to guide focuses on how to build and program a small robot that can roam around, sense its environment, and perform a variety of tasks, using either type of control.

Make an Arduino-Controlled Robot is an excellent book for teachers, hobbyists and experimenters who like working with software and hardware. The book’s simple robot moves about on a chassis that has two-wheel or four-wheel drive. And its heart is an Arduino Uno or Arduino Leonardo microcontroller running programs (“sketches”) provided in the book and available at a link for download.

Some basic assembly is required, including gathering parts and circuit boards and doing some soldering and mechanical assembly, following the book’s instructions. The robot can be built on small platforms from DFRobot or platforms of your own creation. And devices can be added, including distance sensors, infrared reflectance sensors, and remote control receivers.

The book is “not an introduction to programming,” however. If you have no experience with programming or programming Arduino microcontrollers, the author recommends two books: Getting Started with Arduino, 2nd Edition, and Arduino Cookbook, 2nd Edition.

Make an Arduino-Controlled Robot has 11 chapters and six appendices. The chapters are:

  1. Introduction to Robot Building
  2. Building the Electronics
  3. Building the Two-Wheeled Mobile Platform
  4. Building the Four-Wheeled Mobile Platform
  5. Tutorial: Getting Started with Arduino
  6. Testing the Robot’s Basic Functions
  7. Controlling Speed and Direction
  8. Tutorial: Introduction to Sensors
  9. Modifying the Robot to React to Edges and Lines
  10. Autonomous Movement
  11. Remote Control

The appendices are:

  • Appendix A: Enhancing Your Robot
  • Appendix B: Using Other Hardware with Your Robot
  • Appendix C: Debugging Your Robot
  • Appendix D: Power Sources
  • Appendix E: Programming Constructs
  • Appendix F: Arduino Pin and Timer Usage

Whether you love serious experimentation and invention or just tinkering for fun and mental challenge, Make an Arduino-Controlled Robot opens up many possibilities for individual, family, and classroom activities and learning.

Si Dunn

Make: Volume 32 – Zany and practical projects and articles for DIY builders – #bookreview

Make: Volume 32
(O’Reilly, paperback)

Make: is a science, technology, and do-it-yourself (DIY) projects magazine published quarterly in paperback book format. Volume 32 not only has intriguing articles about private rocketeers, flying motorcycles, and human-size replicas of videogame costumes and weapons. It also has about two dozen “complete plans” for a wide array of useful and zany projects.

One of the projects in Volume 32 is “The Awesome Button,” a big red desktop button that you can hit when you can’t think of a synonym for the totally overused word “awesome” while you’re composing email or a letter or a manuscript. The project uses a $16 Teensy USB Development Board made by PJRC, plus some downloaded code. When your fist hammers down on the big red button, the board generates random synonyms for “awesome” and sends them to your computer so you can quickly accept or reject them in your document.

Another project is a catapult launcher that will send a tiny balsa wood glider zooming 150 feet into the air. Beats the heck out of a rubber band looped around a Popsicle stick.

And another DIY article focuses on the joys of salvaging perfectly good electronic and mechanical parts from discarded laser printers, so you can use the parts in other projects.

Make: Volume 33 is due to appear in January. In the meantime, Volume 32 is full of fun reading and intriguing projects, such as how to transform data files into synthesized music.

Si Dunn

Natural Language Annotation for Machine Learning – #programming #bookreview

Natural Language Annotation for Machine Learning
James Pustejovsky and Amber Stubbs
(O’Reilly, paperbackKindle)

You may not be sure what’s going on here, at first, even after you’ve read the tag line on the book’s cover: “A Guide to Corpus-Building for Applications.

Fortunately, a few definitions inside this book can enlighten you quickly and might even get you interested in delving deeper into natural language processing and computational linguistics as a career.

“A natural language,” the authors note,” refers to any language spoken by humans, either currently (e.g., English, Chinese, Spanish) or in the past (e.g., Latin, ancient Greek, Sanskrit). Annotation refers to the process of adding metadata information to the text in order to augment a computer’s ability to perform Natural Language Processing (NLP).”

Meanwhile: “Machine learning refers to the area of computer science focusing on the development and implementation of systems that improve as they encounter more data.”

And, finally, what is a corpus? “A corpus,” the authors explain, “is a collection of machine-readable texts that have been produced in a natural communicative setting. They have been sampled to be representative and balanced with respect to particular factors; for example, by genre—newspaper articles, literary fiction, spoken speech, blogs and diaries, and legal documents.”

The Internet is delivering vast amounts of information in many different formats to researchers in the fields of theoretical and computational linguistics. And, in turn, specialists are now working to develop new insights and algorithms “and turn them into functioning, high-performance programs that can impact the ways we interact with computers using language.”

This book’s central focus is on learning how an efficient annotation development cycle works and how you can use such a cycle to add metadata to a training corpus that helps machine-language algorithms work more effectively.

Natural Language Annotation for Machine Learning is not light reading. But it is well structured, well written and offers detailed examples. Using an effective hands-on approach, it takes the reader from annotation specifications and designs to the use of annotations in machine-language algorithms. And the final two chapters of the 326-page book “give a complete walkthrough of a single annotation project and how it was recreated with machine learning and rule-based algorithms.”

“[I]t is not enough,” the authors emphasize, “to simply provide a computer with a large amount of data and expect it to learn to speak—the data has to be prepared in such a way that the computer can more easily find patterns and inferences. This is usually done by adding relevant metadata to a dataset. Any metadata tag used to mark up elements of the dataset is called an annotation over the input. However,” they point out, “in order for the algorithms to learn efficiently and effectively, the annotation done on the data must be accurate, and relevant to the task the machine is being asked to perform. For this reason, the discipline of language annotation is a critical link in developing intelligent human language technology.”

Si Dunn