LED Lighting: A Primer to Lighting the Future – #bookreview

LED Lighting: A Primer to Lighting the Future
Sal Cangeloso
(O’Reilly,
paperback, Kindle)

Sal Cangeloso of Geek.com and ExtremeTech.com wants to warm you up to some really cool lighting: light-emitting diode (LED) bulbs.

His new book, LED Lighting: A Primer to Lighting the Future, encourages readers to start using more LEDs and let loose of the incandescent bulb’s 130-year-old technology, as well as the curly, tricky-to-recycle compact fluorescent light (CFL) bulbs that last longest when they are not turned off and on and off and on and.…

Lighting and lighting choices are not actually simple topics, and Cangeloso packs plenty of information, both practical and technical, into his helpful 58-page book. He includes a couple of simple, do-it-yourself experiments involving small LED lamps, resistors and batteries, as well.

LED Lighting delves into matters such as color quality, power consumption comparisons, and prices, as well as the sometimes “off-putting” fact that LED bulbs often look like yellow bug lamps, even though they produce white light. The author also explains why highly efficient LED bulbs have built-in heat sinks, while other types of light bulbs do not. “The main reason is that LEDs don’t give off heat in the form of infrared radiation. This means cooling must be handled through other means, such as conduction through a heat sink.”

LED bulbs also don’t give off ultraviolet (UV) light. So that’s one more practical reason to consider using them. As Cangeloso notes: “LED bulbs don’t attract insects, which are drawn to UV light.”

Si Dunn

Think Like a Programmer: An Introduction to Creative Problem Solving – #programming #bookreview

Think Like a Programmer: An Introduction to Creative Problem Solving
V. Anton Spraul
(No Starch Press, paperbackKindle)

Often, we “solve” problems by avoiding them. For example, if we have a clunker car, we trade it in and get a new one. Problem “solved” simply by putting a shiny new sedan in the driveway.

In software programming, however, problems generally have to be fixed, not avoided. Typically, you can’t kick a major bug to the curb and make it disappear just by adding a new function or screen. Whatever is wrong has to be repaired. And most of us are not mentally wired to quickly spout new source code that solves the dilemma.

“Problem solving is hard,” V. Anton Spraul states. And his well-structured, well-written book aims to help us rewire our heads and get a better handle on fixing problems in software.

“When solving a problem with a program, you…have constraints,” he writes. “Common constraints include the programming language, platform (does it run on a PC, or an iPhone, or what?), performance (a game program may require graphics to be updated at least 30 times a second, a business application might have a maximum time response to user input), or memory footprint. Sometimes the constraint involves what other code you can reference: Maybe the program can’t include certain open-source code or maybe the opposite—it can use only open source.”

He adds: “For programmers, then, we can define problem solving as writing an original program that performs a particular set of tasks and meets all stated constraints.”

But beginning programmers often focus too much time and effort on just making the program perform the required tasks. They don’t pay enough attention to staying within the required constraints, as well.

Think Like a Programmer begins with general strategies for solving problems and puzzles. Then it gets specific for programmers with a series of well-focused chapters:

  • Solving Problems with Arrays
  • Solving Problems with Pointers and Dynamic Memory
  • Solving Problems with Classes
  • Solving Problems with Recursion
  • Solving Problems with Code Reuse

The final chapter, “Thinking Like a Programmer,” shows how to develop a master plan that you can use “for attacking any programming problem.”

Think Like a Programmer: An Introduction to Creative Problem Solving offers a number of challenging exercises in its chapters, and the author encourages readers to attempt each one. But he provides no convenient answers at the back of the book – just as you will experience in real-life programming: no convenient answers to problems and puzzles.

One drawback for this book is that its code examples are all written in C++.

“C++ was selected for a number of reasons,” the author states. He lists several that make good sense and concludes: “…C++ is a great choice because once you have learned to solve problems in C++, you have learned to solve problems in any language. Many programmers have discovered how the skills learned in one language easily apply to other languages, but this is especially true for C++ because of its cross-paradigm approach and, frankly, because of its difficulty. C++ is the real deal—it’s programming without training wheels. This is daunting at first, but once you start succeeding in C++, you ‘ll know that you’re not going to be someone who can do a little coding—you’re going to be a programmer.”

Si Dunn

Intermediate Perl, 2nd Edition – An excellent guide to pushing well beyond the basics – #programming #bookreview

Intermediate Perl, 2nd Edition
Randal L. Schwartz, brian d foy & Tom Phoenix
(O’Reilly, paperback)

Attention, Perl programmers. Particularly those of you who write Perl programs with 100 lines of code or fewer but want to expand your limits. This popular intermediate guide, first published in 2006, has just been updated.

Intermediate Perl, 2nd Edition covers Perl 5.14. And: “It covers what you need to write programs that are 100 to 10,000 (or even longer) lines long,” the authors state.

This excellent book by three well-known Perl gurus does indeed cover a lot of ground. It shows you, for example, “how to work with multiple programmers on the same project by writing reusable Perl modules that you can wrap in distributions usable by the common Perl tools.”

It also shows you “how to deal with larger and more complex data structures….”

And it gets into some “object-oriented programming, which allows parts of your code (or hopefully code from others) to be reused with minor or major variations within the same program.”

It delves into two other important aspects of team programming: “…having a release cycle and a process for unit and integration testing. You’ll learn the basics of packaging your code as a distribution and providing unit tests for that distribution, both for development and for verifying that your code works in your target environment.”

One very important addition in the new edition is a chapter on references. “References,” the authors emphasize, “are the basis for complex data structures, object-oriented programming, and fancy subroutine handling. They’re the magic that was added between Perl versions 4 and 5 to make it all possible…” to handle “complex data interrelationships.”

The authors write in a lighthearted style that helps the coding medicine go down. And there are plenty of code examples and illustrations, plus a link to a website with downloads. They also provide exercises at the ends of chapters, with suggested completion times in minutes.

“If you take longer,” they add, “that’s just fine, at least until we figure out how to make ebooks with timers.”

However, if you take longer than “longer” or if you just get stumped, the answers conveniently are provided at the back of Intermediate Perl, 2nd Edition.

Si Dunn

Illustrated Guide to Home Forensic Science Experiments – Real CSI basics – #bookreview

Illustrated Guide to Home Forensic Science Experiments: All Lab, No Lecture
Robert Bruce Thompson and Barbara Fritchman Thompson
(O’Reilly, paperbackKindle)

Movies, TV shows and detective novels have elevated forensic science to a cultural fascination. And in real life, a clue uncovered with a microscope or a chemical test frequently is the one that provides the big break toward solving a crime.

You may daydream about what it might be like to work in a crime lab. And if you write crime novels, you likely will generate mental images of crime scene investigators or detectives trying to decipher puzzling clues. You might even picture a laboratory packed with sophisticated electronic analyzers that cost hundreds of thousands or even millions of dollars.

Indeed, some labs do have that type of equipment. But this book’s authors note: “Here’s a startling fact: the vast majority of forensic work, even today, is done with low-tech procedures that would be familiar to a forensic scientist of 100 years ago.”

Indeed, they add: “You don’t need a multi-million dollar lab to do real, useful forensic investigations. All you need are some chemicals and basic equipment, much of which can be found around the home.”

You will also need “a decent microscope—the fundamental tool of the forensic scientist—but even an inexpensive student model will serve.”

The Illustrated Guide to Home Forensic Science Experiments: All Lab, No Lecture is intended for “responsible” teenagers and adults who want “to learn about forensic science by doing real, hands-on laboratory work. DIY hobbyists and forensics enthusiasts can use this book to learn and master the essential practical skills and fundamental knowledge needed to pursue forensics as a lifelong hobby. Home school parents and public school teachers can use this book as the basis of a year-long, lab-based course in forensic science.”

The hefty, 425-page book offers more than 50 lab experiments, and each session represents actual procedures used each day by professional forensic analysts.

The labs are organized into 11 groups:

  1. Soil Analysis
  2. Hair and Fiber Analysis
  3. Glass and Plastic Analysis
  4. Revealing Latent Fingerprints
  5. Detecting Blood
  6. Impression Analysis
  7. Forensic Drug Testing
  8. Forensic Toxicology
  9. Gunshot and Explosive Residues Analysis
  10. Detecting Altered and Forged Documents
  11. Forensic Biology

Even though the book says it contains “no lectures,” each lab is introduced with a short background summary, plus lab safety cautions and warnings, lists of equipment and materials, and related how-to instructions. Also, each group of labs is introduced with a short overview of its category and its importance in forensic science. The book also contains comments from Dennis Hilliard, director of the Rhode Island State Crime Laboratory.

This is not a book that young students should use without supervision. Even “responsible teens” will need close guidance. And adults, too, must be very careful to follow all safety instructions.

But this is a fascinating how-to guide for learning the basics of forensic science, whether you hope to do it as a career or hobby, gain a science credit, or merely describe some of the techniques in a mystery novel or screenplay.

Si Dunn

Build Awesome Command-Line Applications in Ruby – #programming #bookreview

Build Awesome Command-Line Applications in Ruby
David Bryant Copeland
(Pragmatic Bookshelf,
paperback)

The word “awesome” now is grossly overused in contemporary culture. And I hate it in book titles.

That being said, Build Awesome Command-Line Applications in Ruby is an excellent how-to guide, particularly if you have a little bit of UNIX and some basic Ruby programming in your background.

The book is “aimed at both developers and system administrators who have some familiarity with Ruby and who find themselves automating things on the command line (or wish they could),” David Bryant Copeland writes. And he adds: “Writing command-line apps in Ruby is also a great way to really learn Ruby and become a better programmer, since you can apply it directly to your day-to-day tasks.”

Mac and Linux users will have the easiest time with this book’s code examples. Things get a little bit more complicated for Windows users, especially those with no UNIX experience and not much programming background, either. The author, fortunately, lays out some workarounds.

For example, on UNIX systems, the first line of code commonly is called the shebang. In a piece of Ruby code, the shebang might look something like this: #!/usr/bin/ruby. (That example tells where the Ruby interpreter is installed.) But, at a Windows command prompt, if Ruby has been installed correctly and is in the path, the # character simply will be interpreted as the start of a comment line, and the rest of the shebang will be ignored when code is run directly, such as: ruby hello_world.rb.

In this book, David Bryant Copeland’s focus definitely is code. “There is a lot of code,” he says, “and we’ll do our best to take each new bit of it step by step.” As the book progresses, two command-line applications are developed, enhanced, and improved. One is a database-backup app, and the other is a command suite, “an app that provides a set of commands, each representing a different function of a related concept.”

This is not a Ruby primer, so get some experience in that language first before tackling this book. But if you are now reasonably comfortable with Ruby coding on a graphical user interface (GUI) and want some new challenges, consider moving to the command line and use this excellent book as your guide.

The requirements are minimal: a free Ruby download and a text editor or a UNIX-like shell. But the payoff is very good.

In his 10 chapters, the author discusses and illustrates “every detail of command-line application development, from user input, program output, and code organization to code handling, testing, and distribution” while the two example applications are created, tested, and enhanced.

There is plenty to learn, and Build Awesome Command-Line Applications in Ruby does a fine job of  leading you through the process in short-chapter steps.

Si Dunn

OS X Mountain Lion: The Missing Manual – Another how-to classic from David Pogue – #bookreview

OS X Mountain Lion: The Missing Manual
David Pogue
(O’Reilly, paperbackKindle)

 David Pogue knows how to produce excellent user manuals. He invented the popular “Missing Manual” series. And he continues to set high standards for other writers who also produce “Missing Manuals” and other tech books.  

Pogue’s newest, OS X Mountain Lion: The Missing Manual, is 864 pages of useful information, well presented, with clear writing and frequent sparks of humor.

It covers OS X 10.8 (which is pronounced “Oh-ess-ten, ten-dot-eight” [or “ten-point-eight”] by the way) and also covers iCloud.  Pogue cautions: “Don’t say ‘oh-ess-ex.’ You’ll get funny looks in public.”

Apple says OS X Mountain Lion has added 200 new features. But some users of previous Mac OS versions may be startled at a few capabilities that have been cut or reduced. (With this release, the term “Mac OS X” also has been reduced to “OS X” to better mesh with “iOS,” Apple contends.) Meanwhile, Pogue continues his well-known penchant for exposing and illustrating undocumented capabilities, irritants, and gotchas in software.

Still, he declares, “OS X is an impressive technical achievement; many experts call it the best personal-computer operating system on earth.”

Best OS or not, if you use OS X 10.8 and iCloud, you likely will want to have this how-to guide close at hand.

“If you could choose only one word to describe Apple’s overarching design goal in Lion and Mountain Lion, there’s no doubt about what it would be: iPad,” Pogue states.  “In this software, Apple has gone about as far as it could go in trying to turn the Mac into an iPad.”

OS X Mountain Lion: The Missing Manual is split into six parts, with 22 chapters and four appendices.

Part One: The OS X Desktop

  • Chapter 0: The Mountain Lion Landscape
  • Chapter 1: Folders & Windows
  • Chapter 2: Organizing Your Stuff
  • Chapter 3: Spotlight
  • Chapter 4: Dock, Desktop & Toolbars

Part Two: Programs in OS X

  • Chapter 5: Documents, Programs & Spaces
  • Chapter 6: Data: Typing, Dictating, Sharing & Backing Up
  • Chapter 7: Automator, AppleScript & Services
  • Chapter 8: Windows on Macintosh

Part Three: The Components of OS X

  • Chapter 9: System Preferences
  • Chapter 10: Reminders, Notes & Notification Center
  • Chapter 11: The Other Free Programs
  • Chapter 12: CDs, DVDs, iTunes & AirPlay

Part Four: The Technologies of OS X

  • Chapter 13: Accounts, Security & Gatekeeper
  • Chapter 14: Networking, File Sharing & AirDrop
  • Chapter 15: Graphics, Fonts & Printing
  • Chapter 16: Sound, Movies & Speech

Part Five: OS X Online

  • Chapter 17: Internet Setup & iCoud
  • Chapter 18: Mail & Contacts
  • Chapter 19: Safari
  • Chapter 20: Messages
  • Chapter 21: SSH, FTP, VPN & Web Sharing

Part Six: Appendixes

  • Appendix A: Installing OS X Mountain Lion
  • Appendix B: Troubleshooting
  • Appendix C: The Windows-to-Mac Dictionary
  • Appendix D: The Master OS X Secret Keystroke List

The focus stays firmly on “What’s this new feature for?” in OS X Mountain Lion: The Missing Manual. And David Pogue’s latest how-to classic makes it fun to test out a new feature with a good sense of what is supposed to happen and which choices are available or problematic .

Beats the heck out of opening up the software, randomly tinkering with selections, options and default settings, and then trying to figure out what you just did wrong.

Si Dunn

Introducing Regular Expressions – Finding your perfect match…in strings – #bookreview

Introducing Regular Expressions
Michael Fitzgerald
(O’Reilly, paperbackKindle)

“Regular expressions are specially encoded text strings used as patterns for matching sets of strings,” Michael Fitzgerald writes in this example-rich new book that focuses on learning by doing.

Veteran programmers who work with Perl, Java, JavaScript, C# and a number of Unix utilities often consider regular expressions to be an important part of their toolkit. Ruby 1.9 and Python 3 also support regular expressions.

“Regular expressions have a reputation for being gnarly,” Fitzgerald notes. However, using the online Regexpal JavaScript regular expression tester, he shows you how to dive right into the very basics and start working your way up.

He introduces several other applications that let you work with regular expressions. And his chapters smoothly take you from matching single digits to matching text strings, number strings, boundaries such as the beginnings or endings of words, character classes, and beyond, including white-space patterns and Unicode. He also shows how to perform some fairly esoteric operations such as “negative lookaheads,” where you verify that a certain pattern of text or digits does not appear in a string ahead of certain other text, numbers, or other qualifiers.

The 136-page book has ten chapters:

  1. What Is a Regular Expression?
  2. Simple Pattern Matching
  3. Boundaries
  4. Alternation, Groups, and Backreferences
  5. Character Classes
  6. Matching Unicode and Other Characters
  7. Quantifiers
  8. Lookarounds
  9. Marking Up a Document with HTML
  10. The End of the Beginning

An appendix provides a regular expression reference, listing such items as control characters, Unicode whitespace characters, metacharacters, and others. There is also a glossary of regular expression terms, such as “greedy match” and “zero-width assertions.”

Fitzgerald recommends his book for those who are “new to regular expressions or programming…the reader who has heard of regular expressions and is interested in them but who really doesn’t understand them yet.”

Those who are a bit beyond the beginner level, however, likewise can benefit from Introducing Regular Expressions and its handy examples and how-to summaries.

Si Dunn