Tag Archives: Technology

Programming in Small Basic

Learn to Program with Small Basic: An Introduction to Programming with Games, Art, Science, and Math is yet another addition to the growing list of programming books for people interesting in learning programming.

Basic is an under-appreciated language. I wish I had a good basic compiler handy, and I’d love to see a basic scripting version that worked like bash. Can you see the value of that?

Anyway, Small Basic is an updated modernish basic that runs only on Windows, so while I can’t use it, you might, and this book looks like a good intro. From the publisher:

Small Basic is a free, beginner-friendly programming language created by Microsoft to inspire kids to learn to program. Based on BASIC, which introduced programming to millions of first-time PC owners in the 1970s and 1980s, Small Basic is a modern language that makes coding simple and fun.

Learn to Program with Small Basic brings code to life and introduces you to the empowering world of programming. You’ll master the basics with simple activities like displaying messages and drawing colorful pictures, and work your way up to programming playable games! You’ll learn how to:

  • Store and manipulate data with variables
  • Process user input to make interactive programs
  • Use if/else statements to make decisions
  • Create loops to automate repetitive code
  • Break up long programs into bite-sized subroutines
  • Inside, you’ll find hands-on projects that will challenge and inspire you. You’ll command a turtle to draw shapes, program magical moving text, solve all kinds of math problems, help a knight slay a fearsome dragon, and more! Each chapter ends with extra practice examples so you can take your programming skills to the next level!

    Check it out!

    Trump Signs Most Hated Bill Ever In Secret

    This bill was so unpopular that only 11% of Americans thought he should sign it. It was so unpopular that 74% of Americans thought he should veto it.

    This bill was not one of Trump’s campaign promises, and it wasn’t part of the Republican Party platform. I can only assume it was a bought and paid for deal.

    I’m speaking, of course, of the bill that allows your Internet service provider to collect pretty much any information it wants, including quite possibly the contents of what goes into and out of your house on the Internet, and the physical locations of you and your family members, and sell that information to the highest bidder.

    Unlike so many of Trump’s other signings (of bills or executive orders) this one was done in a back room somewhere. But, somehow, we still know he did it!

    As noted on The Hill:

    Politico first reported that Trump had signed the bill Monday evening.
    The bill caused an uproar when it passed the House and Senate last month, with critics accusing Republicans of selling their constituents’ privacy.

    “It’s shocking that of all the challenges facing this country the Trump administration would prioritize taking away people’s privacy,” said Craig Aron, CEO of the advocacy group Free Press.

    “There is literally no public support for this bill. Its only advocates are the nation’s biggest phone, cable and Internet companies. There’s no longer any question — if there ever was — whose needs this administration intends to serve. But people everywhere are on high alert to the serious threat to the free and open Internet. And they will fight back.”

    The hatred for this Republican war on privacy, signed by the Republican president Donald Trump, is as bipartisan as it gets. Among Democrats, 9% wanted the bill signed, 80% vetoed, with 11% not sure. Among Republicans, 14% wanted it signed, 75% wanted it vetoed, with 11% not sure. Among so called Independents, the breakdown was 10-69-21.

    The poll is here.

    How to learn Python programming

    Your objective is to learn Python programming. Everybody has to learn Python.

    You are looking for a book that will make that easier for you. One possibility, one that I’ll recommend for most people in this situation, is Python Crash Course: A Hands-On, Project-Based Introduction to Programming.

    To cut to the chase, there are two reasons I recommend this book. First, the specific programming projects used in the book are a good match for most people, because they are bare bones (but highly developed) exemplars that are fairly adaptable and together cover a wide range of applications and use requirements. Second, the book is well written and organized, the first part very serviceable as a reference book, covers both Python 2 and 3 but focuses on and encourages you to learn 3 (which you should) etc.

    Let me go back to that first reason and expand a bit.

    Why do you want to learn Python, why do you want to program stuff?

    You need to automate or otherwise develop an interactive project. You need to manipulate data live, interact with the computer, etc. You have some data in a text file (or some other form) and you need to access it and turn it into derived numbers, or pictures, graphics, etc. You want to generate web output. Perhaps there is some web scraping in there. Maybe you are doing all this together.

    The book begins with eleven chapters on how Python works, and is fairly detailed. If you work through this in detail, and actgually do the recommended exercises, you’ll be a python programmer before you hit Chapter 11.

    The second part includes three fairly well developed projects. One is an interactive game that is pretty sophisticated (for a scripting language an not using a GUI). The second uses some of the more powerful mathematical and graphical libraries in Python to manipulate, graph, plot, etc. data. This section also covers working with API’s including Git. This is probably the chapter you’ll come back to the most.

    The third project leads you through developing a web application using Django.

    A classic use of this book is that you are a scientists who uses R (r-cran) and you suddenly realize that more development of tools is happening in Python than in R. Switching from R to Python is hard to do emotionally, but easy from a programming perspective, because Python is a better programming language. You don’t really want to leave R, but you know that it is time to branch out, and at least, see what you can do with Python. This crash course does not give you the full range of knowledge to switch you from sophisticated use of R to equivalent use of Python, but if you can’t currently program in Python, do this, then do that using more sophisticated resources.

    It has been interesting to see, over the last few years, No Starch Press, which produces this book, growing and producing future classics that should be along side the more traditional O’Reilly Press programming books. Python Crash Course: A Hands-On, Project-Based Introduction to Programming is one of those books, equal to or replacing something like Learning Python, 5th Edition, but at close to half the price.

    Python is easy to use and learn, yet it is also very powerful. Much of the power comes from the powerful libraries that exist, which can be imported and used for a wide range of things. Python itself is a very simple implementation of an interpreted language, with a simple command line interface. Because of these two things, the actual installation and running of Python is very easy and sometimes very difficult at the same time. Here’s the thing. As a single user who may do some complex stuff, which would describe you if you are like me, you might want a pretty fancy development environment and lots of libraries and stuff. But at the same time, you really don’t want complex virtual environments and collaboration tools. The thing is, as the various free or paid add ons or resources you can get to enhance Python’s power get more complicated, they assume that you are moving from a hobbyist or student to a corporate environment with multiple collaborators and the need to keep projects separate more than you really want. At some point, someone will tell you, “Oh, if you want to do that, just install ______” where the blank is the name of a snake or something. You go in stall it, and find out you have to take a class to know what the first button to press is.

    So, that is a complaint I have about the Python world. This book does come with a web site that has on it current and important information, updated, on how to handle some of these problems with installing and configuring your programming environment, using a thing called “pip” which helps you install libraries and stuff, and how to get matplotlib and some other stuff running without having to take that class.

    You will also find source code used in the book and some other cool resources on that page.

    Following is the top level TOC and here is a PDF file of the full TOC.

    Table of Contents
    Introduction

    PART I: Basics

    Chapter 1: Getting Started
    Chapter 2: Variables and Simple Data Types
    Chapter 3: Introducing Lists
    Chapter 4: Working with Lists
    Chapter 5: if Statements
    Chapter 6: Dictionaries
    Chapter 7: User Input and while Loops
    Chapter 8: Functions
    Chapter 9: Classes
    Chapter 10: Files and Exceptions
    Chapter 11: Testing Your Code

    PART II: Projects

    Project 1: Alien Invasion
    Chapter 12: A Ship that Fires Bullets
    Chapter 13: Aliens!
    Chapter 14: Scoring

    Project 2: Data Visualization
    Chapter 15: Generating Data
    Chapter 16: Downloading Data
    Chapter 17: Working with APIs

    Project 3: Web Applications
    Chapter 18: Getting Started with Django
    Chapter 19: User Accounts
    Chapter 20: Styling and Deploying an App

    Afterword

    Appendix A: Installing Python
    Appendix B: Text Editors
    Appendix C: Getting Help
    Appendix D: Using Git for Version Control

    View the detailed Table of Contents (PDF)
    View the Index (PDF)

    Scratch Programming For Kids, By The Cards

    Last October I reviewed Scratch Programming Playground, by Al Sweigart.

    Screen Shot 2017-01-25 at 2.38.32 PMYou will recall that Scratch is a programming language that uses drag and drop elements to construct a program.

    Individual objecgts, including “sprites” that can move around on the screen, as well as static graphic elements, sounds, etc. get their own code, and this code can be set up to start under various conditions, such as when something touches something, or the user hits a certain key, etc.

    This allows for the development of very simple but fun programs, and vey complicated ones as well.

    Scratch is normally implemented on an MIT web page, though it can be installed on a computer for local use. Increasingly, specialized versions of Scratch are being used for robotics. I have predicted that Scratch will for the basis of the programming language that will give normal humans access to the Internet of Things.

    The image on the right is a segment of code for an implementation of Pac-Man on Scratch.

    This programming code applies to a sprite that looks like the yellow Pac-Man thingie. The entire block runs when a certain (“start”) signal is received, causing the sprite to point in a certain direction and go to a certain location, to start the game.

    The next block is repeated “forever” (not really, but until the program is terminated or the loop exited on purpose).

    Then the various “if” blocks determine what happens. If Pac-Man’s red part (a little dot out in front of itself) touches anything black, which basically means clear runway to move along, then it moves forward. Then, a series of if blocks pick up signals form the game player’s arrow keys, causing Pac-Man to change direction. The controls basic movement of the Pac-Man sprite around the board.

    Screen Shot 2017-01-25 at 2.45.35 PMElsewhere in the code, the Pac-Man eating monsters are controlled, and one of those uses the code shown here on the right. Once the game starts, this monster (“Pinky”) moves to a starting point, then for the entire game glides in the direction of Pac-Man until it is killed.

    That gives you an idea. For more of that, and information about the book I recommend you use to learn Scratch, I mean, give to your kid to learn scratch, go here.

    And now I have something else for you.

    Scratch Coding Cards: Creative Coding Activities for Kids is a collection of cards that you, er, your kids, can use to learn Scratch programming. This is rated for kids 8 or above, but I think they can be easily used by younger kids, with a modest amount of adult help.

    The cards come in sets that go together meaningfully, and they are color coded. For example, there is a set of “Let’s Dance Cards.” This includes coding examples addressing sequencing, music, taking turns, leaving a trail, etc.

    The front of each card gives a visual indication of what the result is going to look like, and the back has the code. This is typically further divided (on the back) in to three parts: Get ready (what you need to have, know, etc.), the code itself (like the code blocks shown above, but generally very little bits at a time), and a “try it” prompt or a helpful tip of some kind.

    There are sections or racing, hide and seek, story telling, and other projects.

    At first I was wondering why they don’t just make this into a book, but then I remembered that kids like to play with things that are explicitly not books. Also, the cards to not have to stay together or in order. Indeed, you can take cards from different project groups and put them together to create new programming projects, to some extent.

    Scratch Coding Cards: Creative Coding Activities for Kids is a fun addition to one’s set of programming tools. If you gave a kid a book on Scratch for one holiday or birthday, this may be a good followup next time around a few months later.

    Should I get a Google Pixel?

    My current phone, a Google Nexus made by Motorola, is still working fine. I’m much more worried about Amanda’s Samsung, which is a nightmare. The storage on that phone is used up by Samsung proprietary gunk that can’t be removed, and she can’t insert a microSD card because the phone will not operate as an actual phone (reliably) when there is a microSD card in it. Her “deal” at Verizon is running out soon, and I’m personally hoping she goes with the Pixel. And, eventually, I’ll be in the market for an upgrade as well.

    One must make proper comparisons. So I did.

    The bottom line: Objectively, given the specs, the iPhone is the least cool, the Samsung Galaxy S7 is the most cool, and the Pixel is in the middle, but closer to the Galaxy than to the iPhone. But, if you look at the features that separate these phones, there really isn’t much difference, and your choice should probably be made on the basis of something other than these details, such as price, operating system, and your comfort with the various companies that make the phones (i.e., which company most recently did you the most emotional or physical harm!).

    The Pixels (look around for the proper storage amount and color for you):

  • Google Pixel
  • Google Pixel XL
  • The Google Pixel vs. the iPhone: there is only one important difference

    The Google Pixels (regular and XP) have somewhat better specs than the current and corresponding iPhones. The Pixel has an equivalent or better screen, a better camera, does video mostly at the same level at the lower end, but is probably overall better (except for the iPhone’s optical image stabilization, which is better to have than electronic stabilization). As far as I know, neither phone has a hand that comes out of it to slap the user and say “Turn your phone sideways, you idiot,” but I assume there is an app for that.

    The iPhones:

  • Apple iPhone 7
  • Apple iPhone 7 Plus
  • They both read fingerprints, they both have similar sensors, including the all important barometer. The Pixel has a headphone jack, and the new iPhones, sadly, do not have that. You can hook a headphone to the iPhone, but Apple has invented a new kind of plug you need to use, so you either need to buy special headphones or an adaptor.

    The iPhone has stereo, but how can it really be so small and have meaningful stereo? The iPhone may be more water resistant than the Pixel. The Pixel battery life is significantly better.

    The Pixel has more RAM. Depending on which model you get, they have similar amounts of storage, but the iPhones can be gotten with 256GB, while the max for the Pixel is 128GB . The Google free cloud storage deal is way better than the Apple deal (Apple wants you to pay for storage beyond 5GB).

    They are very close to the same price, depending on where you buy it. Other details are comparable.

    While the Pixel is probably better feature for feature in most areas, the two phones are high end and in the same major league ball park. It is not like one sucks and one is wonderful.

    So, the bottom line for this comparison is: Which operating system do you like? If you like Android, get the Pixel. If you like iOS, get the Apple. Neither one is going to disappoint you, and if your current phone is a couple/few years old, either one will be a palpable, and even exciting, upgrade.

    There is one small difference I should mention as well, which may not apply by the time you read this: You can’t easily get a Pixel because they are selling like hot cakes. It will be easer to find a hot cake, because no one is quite sure what that is.

    The Pixel vs. the Samsung S7

    There are two kinds of people in this world: Those who love Samsung to the point that it is kind of disgusting, and those who have been burned by Samsung, and don’t. Of those who have been burned, some of them have actually been burned!

    The Samsung Galaxy S7:

  • Samsung Galaxy S7
  • (Note there has been some confusion here… I do not look at the Edge here. Maybe some other time.)

    But, the top of the line Samsung Phones are still considered to be top products, so comparing the Pixel to the Samsung S7 seems appropriate.

    The S7 and the regular Pixel are about the same size, and are probably similar in overall case mechanics. The S7, like the iPhone, claims to be “waterproof.” People who have played around with the Pixel and the Samsung tend to walk away a bit more impressed by the Pixel.

    The Galaxy S7 has a somewhat larger screen and a noticeably higher resolution, which even with the larger screen translates into a higher density of pixels. Both are “retina” level, as I understand “retina.” The main area where this matters is when you attach the phone directly to your face with special phone goggles so you can experience virtual reality. You’ll like the Samsung better every time you do that. But (see below) the Google phone is going to have better VR abilities in the operating system than the Samsung, at least for a while.

    The cameras are very similar . The Samsung might be a bit better in lower light. Most people will tell you that the Samsung camera is the best one out there. But, the newer version has a lower pixel density than earlier cameras, and that is often the metric people focus on.

    This does not necessarily mean that Samsung downgraded its camera. It is more the case that all the cameras have gotten so good that hardware will plateau for a while. And, in particular, the pixel density metric is no longer as critical since all the main cameras are high in this areas (not true of the front facing selfie cameras, though). In other words, it no longer matters like it did a few years ago that you get THE phone with THE camera. A few years ago there were phones and tablets with truly substandard and awful cameras. Those days are a Kodachrome memory now.

    The Samsung camera does have this fancy “dual pixel” technology which is supposed to make focusing faster. By the way, the front facing camera, the one you use for selfies, is better on the Pixel than the Samsung.

    The Samsung operating system is highly modified from stock Android. To me, this is a deal killer. I tend to dislike Samsung mods, and I tend to like stock Android. But some might like the Samsung enhancements such as an “always on” mode. At the moment, the Samsung phones are only at Android level 6, while the Pixel is at level 7. The Samsung phones will always be behind in this area because they muck with the system so much. By the way, Android 7 is significantly different from 6 in several interesting ways; this is not a trivial difference.

    The internal guts, the computer inside, are similar. The Pixel has more storage, much more storage, internal, and will not have the crazy Samsung space hogging “enhancement” software. However, the Samsung has a microSD slot.

    But, I am no longer impressed with microSD slots. I used to think they were a deal breaker, until I got my current Google phone, which has lots of memory but not microSD slot, and I installed DropSync, which puts my photos and videos onto my main computer and dropbox account in the background. I’m the kind of user that fills up storage space. I’ve not filled up the storage space on this phone, not even close. Add this to the fact that phones don’t use microSD cards like you, if you’ve not used one, might think. Things go wrong with them. Your camera forgets to put the pics there. Apps that use proprietary content may not let you put stuff there. Many apps won’t really run from the microSD card flawlessly, or at all.

    The lesson here: SD card or not, do not rely on that feature. Get the phone with the most storage given the type of phone you are buying.

    It appears that the Pixel kills the Samsung on battery lifespan. However, some Samsungs are known to have had the Exploding Fire Starter Feature in the past. So there’s that!

    Conclusion: In a number of areas, the Samsung is better than the Pixel. However, I feel you should ignore the microSD difference; that is an overrated feature, and that is coming from a person who strongly believed it to be important until I got a phone without it and realized it wasn’t if you get a biggish storage feature to begin with. I don’t see the cameras as being that different, but maybe Samsung is better. The single most annoying thing your phone will do for the first two years of use, assuming it does not catch fire, is running down on battery life. If that is important, the Pixel is the way to go. Also, the operating system will probably always be better on the Pixel than any Samsung phone, unless you really like the Samsung features (which many do) then the opposite is true.

    So, while the comparison between the two is more complicated than with the iPhone (where you get to chose between two vastly different operating systems and ignore everything else) it is probably true when it comes down to it that either one is fine.

    Write Computer Games In Python

    Ah yes, I remember it well.

    “Hammurabi, Hammurabi, I beg to report to you,
    In Year 1, 0 people have starved.
    101 people came to the city
    The population is now 124
    We harvested 4.5 bushels per acre
    We planted 998 acres of wheat
    But rats at 300 bushels of wheat
    You now have a surplus of 1443 bushels of wheat

    How many acres do yo uwish to feed to the people?
    How many acres do you wish to plant with seed?

    Oh, and you have died of Cholera!”

    Or, this one:

    screen-shot-2017-01-14-at-3-04-24-pm
    Remember?

    I went to a special high school, in an era when individuals and high schools alike did not have computers, but we did. Since we were a University normal school, we had account and terminal room access to the UNIVAC 1108 computer at the University (see photo above). There were no computer games in those days, so you had to write your own, and store them on tape. Paper tape, not magnetic tape (the magnetic tape was reserved for use by actual University students and faculty, for the most part).

    So we wrote and fiddled with programs in BASIC, the intro language of the day. BASIC was a great language, but is widely regarded today as a horrible language. Truth is, it was easy to program in, had reliable interpreters, and eventually, advanced versions became fully OOPish and lost silly things like line numbers.

    Today’s equivilant of BASIC, for the simple reason that it is one of the programming languages people often start on, but similar for other reasons as well, is Python.

    Python was invented by Benevolent Dictator For Life Guido van Rossum. Guido was a big fan of Monty Python back in 1989 when he invented an interpreter to run a script language that didn’t exist yet but was knocking around in his head. A script, in computer world, is a series of commands in a file that can be run like it was a computer program, but where the code is not turned into an executable file to run independently, but rather, run by an “interpreter” which carries out the commands ad hoc each time the script is called. That is how BASIC originally ran, and that is how Python works.

    Et magis est, ut in fabula.

    Python has evolved over the years to become one of a small number of languages that can do pretty much anything. The language itself is fairly simply yet powerful and flexible. In writing Python programs (the language is too fancy to use the term “script” comfortably, though that is technically what the programs are) one has access to a large number of libraries of pre-existing code. These libraries are extensive, intensive, flexible, and powerful. The programs run very efficiently.

    What software that you know about is written in Python? Well, DrobBox is written in Python, which is not surprising, since Benevelont Dictator van Rossum works for Dropbox (or did anyway, not sure if he is still there). Google uses Python for pretty much everything, so when you “google” something, you are using the Linux operating system running a Python script accessing data created and maintained by Python scrips. Also, Python was underwent much of its development with support from Google.

    Many of the GNU Linux utilities and software in use today that is not from the original cadre of mainly C-xx (a different family of languages) applications are written in Python. So, again, the basic computer services we rely on, such as Google, ultimately use Python in many different ways.

    And, Python has become one of very few widely used scientific software tools. If you are going to grow up and become a scientist, you will want Python skills.

    And this is where we come to the new 4th edition, Invent Your Own Computer Games with Python.

    This is an excellent way to learn Python, if you are a kid or not. Little kids can learn with their adult guide, and older kids will eat this book up in an afternoon or two.

    The Table of Contents will give you an idea of what it covers:

    First, on how to set up and use Python:

    Chapter 1: The Interactive Shell
    Chapter 2: Writing Programs

    Then some very simple games:

    Chapter 3: Guess the Number
    Chapter 4: Jokes
    Chapter 5: Dragon Realm

    Then how to use a key feature to help you more easily write complex programs:

    Chapter 6: Using the Debugger

    Then a pretty complex program (but still very doable):

    Chapter 7: Designing Hangman with Flowcharts
    Chapter 8: Writing the Hangman Code
    Chapter 9: Extending Hangman

    Then many more programs of various levels of difficulty:

    Chapter 10: Tic-Tac-Toe
    Chapter 11: Bagels
    Chapter 12: Cartesian Coordinates
    Chapter 13: Sonar Treasure Hunt
    Chapter 14: Caesar Cipher
    Chapter 15: Reversi
    Chapter 16: AI Simulation

    Then some advanced programming and tools, and more games:

    Chapter 17: Using Pygame and Graphics
    Chapter 18: Animating Graphics
    Chapter 19: Collision Detection and Input
    Chapter 20: Sounds and Images
    Chapter 21: Dodger

    Many of the programs are designed to run on the command line, but still use cool (in a retro sort of way) graphics, but the book gets you started on using modern day window-deployed graphics.

    Al Sweigart is a software developer who teaches programming to kids and adults. He is the author of Automate the Boring Stuff with Python: Practical Programming for Total Beginners, a book I’ve not yet laid eyes on, and Scratch Programming Playground: Learn to Program by Making Cool Games, which I review here. By the way, if you are looking for an intro programming guide for kids, consider scratch as well. Scratch is not at present a powerful programming tool kids will use when they grow up, but it teaches programming skills and it is fun. Having said that, I predict that a language like Scratch, which has an ancestry as old as any existing programming langauge yet is extremely modern and forward looking, may end up being a more widely used tools, allowing regular people to program the Internet of Things. Also, a kid heading for Robotics will probably be able, in the very near future, to use Scratch in that area as well.

    Go to the No Starch Press web site to access the code and other resources, and to find a list of errors and updates. In a regular book about something, say, Abraham Lincoln, a typo is not a big deal. In a computer programming book, a typo can be a big deal.

    For example, reading “In 1860, Lincoln secured the Republican Party presidential nomination as a moderate from a wing state,” instead of a “Swing state” is not going to cause a disaster. But in 1962, the Mariner spacecraft had to be destroyed moments after takeoff because a “-” was written instead of a ““.

    Anyway, great book. Enjoy it!

    Makeblock mBot Add-on Pack-Six-legged Robot

    The Makeblock mBot Add-on Pack-Six-legged Robot V1.1 is an add on for the Makeblock DIY mBot 1.1 Kit (Bluetooth Version) – STEM Education – Arduino – Scratch 2.0 – Programmable Robot Kit for Kids to Learn Coding & Robotics – Pink or any of its variants.

    The makeblock robot is an arduino technology robot. It can be controlled with a supplied controller, or operated from any of several different kinds of computing devices (such as your cell phone) using an app. It can be programmed using the Arduino interface (from a Mac, Windows or Linux computer), but the robot comes with built in capabilities so you won’t need to do that to operate it. Note that the app-based controls provide more functionality than the hand held IR control.

    But here we are talking about making that robot into a six legged insect with an add on package.

    The add on package consists of the leggy parts of the photograph above. With this add on installed, the robot walks instead of rolls on wheels.

    I love the Makeblock Robot and this is a great add on, but before you start investing in this system you need to know a couple of things.

    Makeblock itself makes well designed and interesting robots and add ons, but they also produce several slightly different versions of everything they do. They all seem to work fine but there are many differences you will want to track. For instance, when buying a robot make sure you get one with bluetooth, because you will enjoy controlling the robot with your phone, where you will have more options than with the supplied IR controller. When choosing a leg upgrade, there are several options, though I think they all have the same basic parts. Each expansion pack allows you to make a six legged robot (the beetle robot) or a mantis robot, or a crazy frog robot. The kits I know of are:

  • Makeblock mBot Add-on Pack-Six-legged Robotby Makeblock
  • Makeblock Add-on Pack: Six-legged Robot Designed for mBot
  • Makeblock mBot STEM Six-Legged Robot Add-On Pack
  • Makeblock mBot Add-on Pack-Six-legged Robot Enjoyable Funny Tool Kids Adults Xmas Gift for Learning Programming Promote Creativity
  • Makeblock Flagship Store – Makeblock mBot Add-on Pack-Six-legged Robot by Makeblock
  • Makeblock mBot Add-on Pack-Six-legged Robot V1.1
  • I would go for the cheapest one, which at the moment, is this one. Whatever you do, don’t spend more than about 30 bucks.

    The basic idea is this: The main back wheels of the mBot robot serve as cams for a set of levers. To get a six legged robot, the first lever is attached off center to the wheel, and thus acts like a piston as the wheel rotates. This then drives all the other levers in a series of crude step like movements. The other variants use a similar principle.

    Tips and hints for building the mBot legged robot extensions:

    This is a DIY kit. Therefore, the manufacturers have less than the usual interest in keeping their product exactly the same for every iteration. This probably contributes to the plethora of seemingly similar but maybe slightly different versions. So, the first hint is to look at the pictures and descriptions closely to see if you can figure out exactly what you are getting, and then, don’t expect the instructions to necessarily exactly match the product. They usually do, but beware.

    If something doesn’t seem quite right, check the instructions to see if you screwed up. Whether or not you screwed up, remember: DIY project. Fish some additional bits out of your box of extra parts, figure it out.

    The biggest limitation of the robots, especially the six-legged version, is the surface on which they are walking. I have two suggestions that may allow them to be able to turn on a carpet and to keep traction on slipper tile. First, maybe add length to the legs so the thing rides up higher. Second, add feet. Feet that provided a bit more traction would help on tile. Perhaps a simple wrap of electric tape will do this. Feet that are flat attached to the bottom of the legs, like little snow shoes, should both increase traction and allow better turning on shag carpets. If you are going to have this robot chase around your cat, you are going to have to handle a variety of surfaces. We are playing around with some of these ideas.

    The kit comes with what are called “lock nuts.” But really, they are “hard to screw on nuts.” They are designed to not unwind themselves to fall off this highly energetic device. Two hints will make their use more effective.

    -use a socket from a socket wrench kit to hold the nuts when you are screwing in the bolt.  This will work better then the little wrench the kit supplies, or your fingers.
    
    -there may be some places where the instructions don't tell you to use a lock nut, but you will want to anyway.  You will discover these when the nuts start falling off as you use the robot.
    
    In the six legged build, shown at the top of the post, notice that the wheels do not have their tires.  Take the tires off. In our kit, the instructions did not say to do that. 
    

    Instructions for making the Mantis, and Crazy Frog configurations

    The six legged adapter kit allows you to make three configurations. The most complex one is the Beetle, which uses six legs. The other two, Crazy Frog and Mantis, are much simpler.

    Instructions are provided to make the Beetle. To make the other two, look at the back of the box and, well, DIY!

    Notice that with the Mantis, I think you keep the tires on the back wheels. With the crazy frog, you take the tire off.

    Have fun!

    The CS Detective by Jeremy Kubica

    The CS Detective: An Algorithmic Tale of Crime, Conspiracy, and Computation by Jeremy Kubica is the tory of disgraced ex-detective and hardboiled private eye Frank Runtime.

    Frank Runtime knows REGEX and is not afraid to use it.

    From the publishers:

    When a robbery hits police headquarters, it’s up to Frank Runtime and his extensive search skills to catch the culprits. In this detective story, you’ll learn how to use algorithmic tools to solve the case. Runtime scours smugglers’ boats with binary search, tails spies with a search tree, escapes a prison with depth-first search, and picks locks with priority queues. Joined by know-it-all rookie Officer Notation and inept tag-along Socks, he follows a series of leads in a best-first search that unravels a deep conspiracy. Each chapter introduces a thrilling twist matched with a new algorithmic concept, ending with a technical recap.

    Learn about the key algorithms, basic data objectgs such as strings, arrays, and stacks.

    This well illustrated, well written book is, as far as I know, unique. Read a novel, learn computer science.

    This is for anyone starting out in computer science, including CS students. And, just for fun.

    Super Cool Tech and Kids Programming Books

    I just received two books that I will be reviewing in more detail later, but wanted to let you know about now.

    Coding Projects in Scratch: A step by step guide by DK Publishers is a new scratch coding book. I got a copy a couple of days ago and have been going through it, and found it to be excellent. I’ll be including it in my Science Oriented Holiday Shopping Guide for Kids Stuff, which I’ll have out soon, but I wanted to give you a heads up first. From the publishers:

    screen-shot-2016-11-11-at-8-10-11-pm

    Using fun graphics and easy-to-follow instructions, Coding Projects in Scratch is a straightforward, visual guide that shows young learners how to build their own computer projects using Scratch, a popular free programming language.

    Kids can animate their favorite characters, build games to play with friends, create silly sound effects, and more with Coding Projects in Scratch. All they need is a desktop or laptop with Adobe 10.2 or later, and an internet connection to download Scratch 2.0. Coding can be done without download on https://scratch.mit.edu.

    Step-by-step instructions teach essential coding basics and outline 18 fun and exciting projects, including a personalized birthday card; a “tunnel of doom” multiplayer game; a dinosaur dance party animation with flashing lights, music, and dance moves—and much more.

    The simple, logical steps in Coding Projects in Scratch are fully illustrated with fun pixel art and build on the basics of coding, so that kids can have the skills to make whatever kind of project they can dream up.

    Also to be featured in the Holiday Shopping guide, this very interesting technology book mainly for young folk. At first I wasn’t sure how much I’d like it, but then, once I started going through it, I couldn’t put it down.

    screen-shot-2016-11-11-at-8-15-22-pmSuper Cool Tech is like a coffee table book for nerds. It is designed to look like a laptop (see the picture at the top of the post) and that is how you open it and use it.

    See today’s best innovations and imagine tomorrow’s big ideas in Super Cool Tech. This cutting-edge guide explores how incredible new technologies are shaping the modern world and its future, from familiar smartwatches to intelligent, driverless cars.

    Packed with more than 250 full-color images, X-rays, thermal imaging, digital artworks, cross-sections, and cutaways, Super Cool Tech reveals the secrets behind the latest gadgets and gizmos, state-of-the-art buildings, and life-changing technologies.

    Lift the unique laptop-inspired book cover to see incredible architectural concepts around the world, such as the Hydropolis Underwater Hotel and Resort in Dubai, and the River Gym, a human-powered floating gym in New York City. Discover how a wheelchair adapts to its surroundings and learn how a cutting board can give the nutritional information of the food being prepared on it.

    From 3-D-printed cars to robot vacuum cleaners, Super Cool Tech reveals today’s amazing inventions and looks ahead to the future of technology, including hologram traffic lights and the Galactic Suite Hotel in space. Perfect for STEAM education initiatives, Super Cool Tech makes technology easy to understand, following the history of each invention and how they impact our everyday lives, and “How It Works” panels explain the design and function of each item using clear explanations and images.

    Designed in DK’s signature style, Super Cool Tech is the ultimate guide to exploring and understanding the latest gadgets and inventions while looking ahead to the future of technology.

    What to do if you fall off the subway platform?

    I am shocked that this does not happen more often.

    First, don’t stand anywhere near the damn tracks to begin with. That should help stop you from falling or being pushed onto the tracks, unless you are a friend of Frank Underwood.

    Here’s what you do, these two things simultaneously.

    1) Get out of the way of any oncoming train, preferably by diving under the platform if there is room for you there.

    2) Stay away from the third rail.

    Note that the space between trains, if two trains are coming at the same time from opposite directions, may not be sufficient for you to hide. But if I had to be there, I’d probably want to be on the ground as flat as possible, avoiding the third rail. Good luck with that.

    This all may depend on which subway system you are using.

    For those who are not sure what a subway is, it is a train that runs underground and carries people. If you are in Boston, the underground train is often above ground. If you are in London, it is actually called an “Underground.”

    Anyway, here is some more advice:

    What To Do If You Fall Onto the Subway Tracks

  • Try to climb out with the help of someone who can help hoist you.
  • Lie down between the tracks, depending on the depth of the tracks.
  • Get to the side of the track.
  • Step between the girders that separate tracks (but this involves stepping over the third rail, which carries more than 600 volts of electricity).
  • Try to outrun the train as it stops in the station.
  • “Just about any risk is worth taking,” Jim Gannon, spokesman for the Transit Workers Union told the AP, because “if you get hit by a train, your chances of survival are not good.”

    MyRedditAtWork: Serious question: If, god forbid, I fall onto the tracks or someone I am willing to risk my life for falls into the tracks and is knocked out – and a train is coming (lets say 30sec away) – what should I do? Are those pits between the rails by the platforms made for people to hide in in a worst case scenario? The best thing you can do is run as far down the platform as you can (in the opposite direction from where the train enters the station) and wave your arms frantically to get the train operator and passenger’s attention. Believe me, the passengers WILL be doing the exact same thing, as nobody wants to see you get run over and their train get delayed. If you can get to the far end of the platform, it gives the train more room to stop, and there is a ladder at the end of each platform where you can climb back up — do NOT try to climb up from where you are. So many people have been killed trying to jump back up rather than getting away from the entrance end of the station.

    Do NOT trust the pits between the tracks — they are often right next to the third rail which can be just as dangerous (and note that the wooden planks are not designed to hold a human’s weight – they are there to protect the energized rail from drips and weather) and the train operator is less likely to see you if you’re in there. And don’t duck under the train, because most stations do not have enough clearance for the average human. And do NOT jump down onto the tracks to try to save someone else. The best thing you can do is run on the platform towards the tunnel where the train enters so you can get the operator’s attention sooner. Waving your arms over the tracks will tell the operator to stop immediately.

    What to Do if You Fall onto the Subway Tracks: Run Away (Seriously)

    Obviously, the optimal choice is to get back onto the platform, often with the help of bystanders. Dramatic subway rescues are somewhat common. In 2009, for example, an off-Broadway actor rescued a stranded man by hoisting him back to safety. (The good Samaritan said his stage role at the time required him to lift and carry other actors.) If you can’t boost yourself up in time, look for a space beneath the platform edge. In some stations, particularly in Manhattan, there is enough room between the train and the platform to accommodate a person. If the platform appears flush with the approaching train, you could take shelter in the space between the two sets of train tracks. This is a dangerous choice, though, because you’d have to traverse the third rail, which carries 660 volts of electricity, more than enough to kill a person. A final option is to simply lie flat — there may be enough clearance for the train to pass over you.

    Subway Conductor Tells You What to Do If You Fall in the Tracks

    Source: What To Do If You Fall Onto the Subway Tracks | NBC New York http://www.nbcnewyork.com/news/local/Save-Yourself-from-the-Subway-380976411.html#ixzz4PRGHfs9V
    Follow us: @nbcnewyork on Twitter | NBCNewYork on Facebook

    Learn Scratch Programming (For Kids And Adults)

    Scratch Programming Playground: Learn to Program by Making Cool Games is a brand new offering from No Starch Press.

    Never mind all the other programming books for kids, this is the best so far.

    It helps that the Scratch Programming environment is so easy to use and allows such creative development, and it also helps that Scratch is likely to be a programming environment for basic robotics in the future. But the book itself is excellent, and works at several levels. A young kid working with an adult, a medium level kid working on their own, or an adult playing on the computer after the kids have gone to bed.

    Scratch is in the Logo family of object oriented programming. Indeed, Scratch itself, as a language, is a very short distance from the original object oriented programming, much closer to the source than many professional object oriented language.

    It works like this. See the graphic to the right. This is code that controls a “sprite” which in this case is a picture of a ball.

    The light brown C-shaped things are control constructs. An outer one called “forever” contains code that will be run from the time the program is started until it is stopped externally. Inside that is an “if” loop that checks to see if the object “paddle” (specified in the blue object) touches the sprite (ball). If that event happens, then the code inside the “if” thingie is executed. In this case, the variable “score” goes up by one, a funny little blerp sound is made, and the ball turns in the opposite direction.

    Meanwhile, the paddle has a wadge of code that goes with it as well, which responds to key presses or mouse movements, so that the paddle can be used as part of the bouncing the ball game. And so on.

    In the code block on the left, contact between a pirate (a sprite) and a leaf causes the leaf to disappear and the pirate to get a score for making the leaf disappear.

    You can imagine the possibilities.

    So, imagine the following game. A complex maze is on the screen. The player uses arrow keys, etc., to move a tiny cat around in the maze, working the cat from the beginning to the end. At the end, there is a hole that the cat goes through, and now the cat is in another maze. And so on for several mazes.

    Are there objects in the maze the cat must avoid? Or obtain? Will you time how long it takes to get through each level? Will you keep a high score? Will you have two cats, with two people controlling them, each moving in opposite directions through the maze?

    The code examples I give above are not from Scratch Programming Playground, but the maze example is. It is one of several projects that the book works you though, as you learn all the various programming concepts in Scratch 2.0. The programs you learn to code produce complicated results and are really spiffy, but the programming itself is easy and the code is not extensive, because Scratch 2.0 is so powerful yet easy to use.

    Each example, such as the maze, is fully developed, and then, new versions (like having the second player ability, etc.) added, and by the time you are done with that example, if not sooner, you are already adding things of your own design, from your own imagination.

    Scratch 2.0 can be run as a stand along program in windows and on a Mac, but works better on the web, in a browser, on all platforms. Working in that environment, on the browser, has the important advantage of immediate access to a large amount of work done by others, that you can freely borrow from. And, of course, you can show off your own work.

    Scratch Programming Playground tells you how to obtain or set up an account on Scratch at MIT, holding your hand effectively but respectfuly through the entire process. The book is also associated with, as per usual for a No Starch book, a web site with the code and other items used in the book. However, I recommend actually hand building most of this code on your own, so you actually learn what you are doing.

    It is possible to figure out how to make a hand held game controller work with Scratch programs, but that will depend on the controller you have and the platform. A USB controller and a bit of software from the web that lets you set up the buttons should work.

    I would not be surprised if future Internet of Things programming, robotic programming, and other coding you might want to get involved in either uses Scratch or follows this model. The mBot robots can be controlled with a version of Scratch, which produces Arduino code for that robot, and there is now a compiler that allows the general use of scratch for Arduino. Arduino is a basic prototyping machine that can run things, as in “Internet of Things” and that is similar to controllers in general, like the ones in your computer, VCR, thermostat, DVD, car, Mars Rover, etc. (Wait, did I just say “VCR” … whatever.)

    A bit of the book giving instruction on a code block to control a tennis ball sprite.[/caption]Anyway, Scratch 2.0 on the web, as per Scratch Programming Playground, gives you, er, your kids, great training in all the programming concepts, and with it you basically controls sprites (objects) on a screen. But the same language is already adapted to control a common form of robot (mBot) and has been adapted to program a widely used controller. So, with Scratch Programming Playground, a little practice and nine dollars worth of hardware, you can take over the world! Or, at least, a good portion of the Tri State Area.

    When I do my “Science oriented holiday gift guide” (SOHGG) in a few weeks, this book is going to be on it. Al Sweigart, author, has really nailed a kids oriented programming book better than I’ve seen done before, and I’ve seen them all.

    A Tablet PC For $170

    I have another tablet review for you. (See the bottom of the post for some followup on my last review.) This is a “tablet PC” meaning a tablet that runs a full on PC operating system, as opposed to a tablet-oriented operating system.

    With the keyboard (not supplied, buy separately).
    With the keyboard (not supplied, buy separately).
    The Jumper EZpad 5SE Tablet PC is a pretty high performance tablet with an exceptionally low cost, and worth a look especially if you are a Windows user. The tablet comes with Windows 10, and a most notably, a magic “magnetic stylus.”

    The screen and stylus use electromagnetic technology. So, you can hold the stylus over the screen, and it still interacts magically with the device. The stylus has a button on it, so when you are doing this spooky and very cool action at a distance, you can click on something or produce some other result. The stylus can also be touched on the screen, and is pressure sensitive. Given all these attributes, you can use the stylus to draw in ways not previously seen before on a tablet or computer. By me. Maybe you have. This is like the Samsung S Pen, as far as I can tell. It is, as I say, very cool.

    screen-shot-2016-10-18-at-8-54-19-pmThe tablet also comes with a built in stand (see photo above) which has two positions. This allows what is essentially a small highly portable Windows computer to work with a keyboard and mouse in a very convenient way.

    (Of course, you don’t need a mouse because it has a touch screen, but many will be more comfortable using both a mouse and the touchscreen).

    This tablet specs are very impressive, with a good processor and screen, lots of holes to plug things into, a rasonable amount of ram and storage, etc., including:

    <li>Intel Cherry Trail X8300 Quad C ore 1.44 GH plus processor.  </li>
    
    
    <a href="http://scienceblogs.com/gregladen/files/2016/10/Screen-Shot-2016-10-18-at-9.04.30-PM.png"><img src="https://scienceblogs.com/gregladen/files/2016/10/Screen-Shot-2016-10-18-at-9.04.30-PM.png" alt="screen-shot-2016-10-18-at-9-04-30-pm" width="282" height="608" class="alignright size-full wp-image-23122" /></a><li>A 10.6 inch screen (IPS, 1920X1080). </li> 
    
  • Note that the screen is very bright, clear, and provides excellent viewing from oblique angles.
  • <li>Intel HD graphics designed to save power and allow high end graphics use.</li>
    
    
    <li>There are 4 GB of DDR3 Ram and 64GB of storage</li> 
    
  • slot for a micro SC card.
  • <li>HDMI output </li>
    
  • front and read cameras
  • blue tooth and wireless.
  • <li>There are two standard USB outlets and a micro USB, aside from the HDMI </li>
    
    <li>It is designed to work, optionally, with a keyboard, but unfortunately I did not test out the keyboard and they are currently out of stock at GearBest, where this device is most readily available.</li>
    

    Also, the device is uncannily light, at least in my estimation. I will probably be watching Amazon Prime videos on it.

    NOTE: I just got this info I’ll pass on to you. If you use this coupon code, the price of the device drops to 168.29. I’m not sure how long that is good for.

    sesep

    You can charge the device through one of the USB slots, but you can also use an external brick, not supplied but readily available (the kind with the extra small connector thingie).

    GearBest actually has a pretty impressive set of other tablets and accessories and they are often on sale. Also, poke around on their site, you will find a “Today’s Deal” section with some pretty good prices such as this Arduino UNO starter kit that I would have bought except I already have all these parts. That deal was 18.99 (normal price closer to %50) but unless you saw this blog post soon after I wrote it, no UNO for you! GearBest ships the product via DHL and that works great to the US in my experience.

    screen-shot-2016-10-18-at-8-55-30-pm</aAnd now, on a different but related matter …

    Earlier, I had reviewed the Teclast Tbook, but I hadn’t said much about the keyboard. I’ve since played around with the keyboard, and I have to say that,for the price, it is very much worth it. It turns the PC tablet into a small computers. This, among other things, lets you interact with your android world with a pretty OK Keyboard (comparable to, and similar to, the Mac keyboard). Why would you do that? As a writer, I am shocked that anyone would ask such a questions. Keyboards!

    This is the link to the keyboard.

    The Collapse Of Arctic Sea Ice

    Andy Lee Robinson started the recent trend of making compelling graphics about climate change that move. He did a version of the Arctic Ice Death Spiral (a term coined by Joe Romm), which was highly acclaimed but that did not go as viral as it should have at the time. Then, a version with additive ribbon graphs about three years ago. He called that the “waterfall diagram” and it was picked up and used by the BBC at the time. Not long after, he came up with the disappearing block of ice motif. And now, Andy has an updated version, here:

    This is ice VOLUME, not the oft cited surface area. Surface ice will always reform and melt in the Arctic, but long term there used to be a lot of thick ice that never melted during the summer. This long term thick ice would survive the summer melt, and allow new winter time surface ice to form more easily each year. As that ice disappears from various coastal areas in the high Arctic, new winter surface ice takes longer to get going.

    The first version of this graphic, using ice blocks, was requested by Joe Romm, for Think Progress, in 2013, and appears here. Joe just wanted two ice cubes, side by side, and that is what Andy provided.

    But Andy got thinking about the presentation of this very important climate change related metric. “After a while I thought it would be a nice challenge to try to animate it,” he told me. “To accomplish this, I started from the same camera angle, zooming in, following the line to the minimum and then returning to the original location. This required a way to create hundreds of script files to describe each frame.”

    Andy told me that he is fluent in Perl, so he used that to calculate parameters for the objects he wanted to manipulate and substitute them in a povray script template. “At a resolution of 1920×1080, it takes between 15 minutes and 2 hours to make one, depending on what computer is working on it. I wrote spline and easing routines to calculate the smooth motions of the camera and cube sizing, and to interpolate the progression of the graph series.” The MySQL is a shared database that each server has access to, in order to check out a frame, render and return the results over NFS to a shared directory.

    “The same perl program is run on each server and therefore knows which frame to render next, and after a few days the finished frames can be assembled together using ffmpeg with music, in a wav file.”

    Andy, who is a gifted musician, composed the music himself.

    “This uses 8 machines in total, including a linux laptop at 2 hours per frame! It was very painstaking work, writing all the code and parameters, but once done the images can be replicated automatically as new data appears. If only it would pay the rent!”

    On The Google Pixel

    First, for the record, I want one. But, since my current smart phone is a Nexus 6, I don’t need one yet. I’m fine for a while.

    Google essentially invented Android, and the Nexus phones were pretty close to being Google phones, but they were not. They were simply very well designed and powerful smart phones that generally came with unadulterated Android, and likely to work best with Android because of Google’s involvement.

    The new Google Pixel is an actual Google phone. So, this is a bit like the iPhone of the Android world, in the sense that there is excellent and carefully engineered hardware and software integration.

    I’ve heard that you should avoid buying your Google Pixel from Verizon. Verizon is the only service provider that can also sell the Google phones as per the normal arrangement, and everybody seems to be assuring everybody else that this means nothing, that Verizon is not going to break the phone like some service providers do, with bloatware and such. Verizon will be including a few apps that are removable, Verizon claims they will push out Android updates the very moment Google puts them out, etc. etc. So may be it does not matter.

    However, the Verizon sourced phone will, it appears, have the bootloader turned off by default. If you don’t know what the heck that is, then you probably don’t care.

    If you buy the phone from pretty much anyone, you are getting an unlocked phone because that is how these phones roll, and you should be able to use it with Verizon or any other carrier (but check with the carrier first).

    A few features of the Pixel:

    The battery charges up for over 7 hours of use in about 15 minutes. The best camera ever put in a phone. Google provides unlimited storage for photos and 4K videos. Super gorilla glass 4 screen. Built in VR (so you get Google Glasses without the cardboard?) Super powerful processors and other guts. Finger print sensor. Pretty much everything any smart phone ever had.

    The Phone has Google Assistant built into it.

    The phone also has a normal 3.5 mm headphone jack! Which is the traditional headphone jack every electronic device made since 1754 has had, up until a few weeks ago when Apple forgot to include one in their new phone.

    Thre are two kinds of phones, the Pixel with a 5″ display, and the Pixel XL with a 5.5 inch display. If you’re getting me one, I’ll take the larger one.

    The phones come with either 32 or 128 gigabytes of storage.

    Here’s the Google site for the phones. I looked on Amazon to see if there were cheaper prices there, but not yet (check back in a few weeks, maybe)?