Saturday, March 22, 2014

Things your Guidance Counselor Maybe Didn't Drill into You.

I got the exciting news today that the son of my wife's daughter (which modulo the complications of 2nd marriages would make him my Grandson) has been accepted to the University of West Florida. He lives in Florida and I'm up north on Long Island (New York), so I confess to not having ever met the young man nor even knowing about the University of West Florida. But, as usual, Google is my friend when it comes to learning about places not familiar to me. Having now read a bit about the school, I whole-heartedly endorse his choice of college. Wikipedia had nice things to say about the place and it even fared well in the US News tabulation of colleges. But not actually knowing the plans of the gonna-be Freshman, I've got a few things to pass along to him as guidance.

First Things First

College is an important time when many things are going to be going on in your life. It's an investment in your future, but it comes at a cost. There's the obvious expenses like tuition and fees and books and supplies, but there's also an "opportunity" cost. You've elected to defer getting seriously started on your adult life for the number of years that you'll be tied up pursuing a degree. You've picked a 4 year school, so nominally, the long march to a degree should take you about 4 years. If you manage your time properly, and meet the requirements listed in the catalog, then in about 4 years time, you should indeed be graduating and moving on to the next stage of your adult life. If you do it wrong, 4 years will slip into 5 years and perhaps even longer. The price tag on your college education will continue to mount up, but the prize at the end is still that same degree. My point is, your first priority should be to stay on track to completing your degree. Some of the degree requirements may be quite frustrating, but on the bright side, the rules are at least clearly spelled out in the catalog. I assure you that later in life you will have to work your way through many situations where the prerequisites and the completion requirements are not spelled out with anything close to the clarity of your college degree.

Note that I said completing your degree is your top priority. By no means did I say it was your only priority. Not so clearly spelled out in the catalog is that your college years are when you seek out what it is that really interests you. You have to discover the degree program and subject "major" that you have a passion for - Something that you'd hope to be doing for the rest of your life, whether or not it was attached to a paying job. Make no mistake about it, to keep body and soul together you will need to find and work a paying job after graduation. Food, clothing, shelter, medical care, cell phone service, high speed internet - none of those are "free of charge", so you will need a job to earn a living. But if you force yourself into a particular career (perhaps "plastics") because you heard that it pays well, yet find that it isn't something that you enjoy, then you've made a grave error in planning your path through college. College is like 4 years, but your career is then the rest of your life, hopefully decades.

But wait! There's more!

Besides picking the right course of study and completing the degree requirements, there's an important social side to college. All work and no play doesn't make for a good, complete, college experience. You'll meet a lot of interesting people during your years in college. Some will be greatly challenging to your intellect. Some will be great fun for parties. Some may be strongly negative influences on your life. With luck, you'll even meet someone who you'll deeply love, someone who makes you a better, happier, person. You need to sort out who is who while not getting too distracted from your top priority.

The good news is that you aren't left entirely on your own to navigate this complex mine field. The same social structures that helped you get through life this far, your family, your church, your childhood friends, and so forth, are still places to turn to when you need guidance. The Internet and so forth makes it relatively easy to keep in touch with your old social supports, even if you are physically separated from them by many miles. Time spent socializing on the Internet is yet another "distraction" from your top priority, but keeping in touch with your roots may have real value to you. So make a conscious effort to spend your time wisely.

School Supplies

Next, a few words about school supplies. If you use a smart phone instead of paper products for these, that's fine, but make sure you have things configured so your information is safely backed up outside of the phone. Phones die or get stolen and you don't want to lose your information. What information? That brings us to the first couple of items on this list:

Calendar - You'll be needing a calendar to remember places you have to be at a specific date and time. In high school life is simple enough that perhaps you are used to tracking such commitments in your head with the backup coverage of reminders from your Mom. In college, your calendar can get a lot more crowded than that.

Address Book - You'll be meeting a lot of people at school. Professors, teaching assistants, lab partners, that hot girl in your Psych class. Take a few moments to jot down their name and contact info in a location where you'll be able to find it later. Loose scraps of paper jammed into your pocket or wallet isn't going to be useful to you in a week when it's faded and crumbled and perhaps even run through the laundry.

Alarm Clock - A smart phone can sound reminders through-out the day, but if you are as sound a sleeper as I am, you'll need a loud, persistent alarm clock to get you out of bed in the morning. I suggest a plug-in model, perhaps even a clock-radio, with a backup battery so it doesn't lose the time or settings across brief power outages. The easier it is to set the alarm time, the better. At the very least, look for an "up" and "down" option on the setting buttons. My favorite clock radio had an actual keypad for direct entry of the time, but I'm not sure that that model is on the market any longer. Do remember to buy appropriate batteries for that backup battery feature. And take some care in picking the location for the clock. The night stand next to your bed has the advantage of being right by your ear, but the drawback of putting the snooze button within arm's reach. I find what works for me is to keep the clock on the dresser where I have to get out of bed and walk across the room to turn it off or hit snooze.

Bank Account - You've got to shop around. College is a time where you'll spend your days somewhere between destitute and flat-broke. Every once in a while, you'll receive some money - perhaps a check for your birthday or for Christmas. Nothing will make that money vanish faster than cashing the check and putting the cash in your wallet. You need to set up a bank account for yourself. You probably should find out what banks (or credit unions) have ATM's on or near campus. Banks near colleges often offer accounts structured to attract students: Low fees, low minimum balance, but probably no interest on your deposit. A debit card is almost as easy to use to drain your account as was cash in your wallet, but at least the debit card gives you a statement so you can see where the money went. If they offer you a credit card, you probably should say "no". It is a lot easier to get into credit card debt than it is to get out of it. A debit card inherently caps your spending at how much you have. Living within your means can be tough, but I strongly recommend it.

Fire-resistant lock box - You need to start being responsible for your own life-documents. Birth certificate, social security card, perhaps even a passport. You don't really need a safety-deposit box for these items, or even a secure safe, but you shouldn't be just tossing them into your dresser drawer under the socks either. Visit Walmart or some such store to find a fire-resistant lock box that you can stash in the back of your closet to hold these hard to replace documents. Note that fire-resistant boxes tend to have water entrapped in the walls of the box, which converts to steam in the event of a fire. The physics of boiling keeps the papers inside the box from reaching the ignition point for paper (until the water boils away). The temperature and humidity in the box is meant to be safe for paper, but not for computer media, so such a box isn't a good place to store backups of your data.

File Folders - For all the years of people talking about "paperless offices" and "paperless classrooms", I think you'll be surprised at how much paper comes into your life every day as a college student. The papers are worthless to you unless you can retrieve them when you need them. As a start on getting them organized, I therefore suggest an investment in file folders. If you don't have a place to stash the folders, then an additional expense to anticipate for you is a small file cabinet. (I recently picked up a flimsy 2-drawer metal file cabinet at Walmart for just over $30). How to organize the papers is a whole other essay that I'm not planning to write here. Cheap 3-ring binders and a 3-hole paper punch can be an alternative to the file cabinet to the extent your papers are 8.5"x11". Keep an eye on the back-to-school sales that come up every year as September approaches. Loose-leaf paper and manila notebook divider sheets can be mighty handy. If you use pencil to label the folders and divider sheets, you'll be able to erase and re-use them as the topics to organize shift as time marches on.

Book Shelf - College brings you more (and heavier) text books than you want to haul around in your back-pack every day. And college doesn't come with a hall-locker for you to stash the books you don't need right now. Make sure that no matter where you plan to live, that your room has a bookshelf where you can store your reference books, text books, note books, etc., etc. in a neat and accessible manner.

Desk - In high school the kitchen table or maybe even your lap sufficed as your work place for your writing assignments. In college, you really ought to have a real desk for yourself. Several stacks of cinder blocks and a slab door can make a serviceable desk for little money. Do remember your budget needs to cover a reasonable desk chair too. A suitable computer and some provision for Internet access are key parts of a modern student's desk these days, so that needs to be included in your planning.

Comfie chair and reading light - A startling amount of your college life will be spent on reading. If your habit has been to sit down in the living room with the television on while you read, now is the time to change that habit. It'd be unsporting to tell your family that they aren't to watch television until you graduate. You need a comfortable chair in a quiet place, away from the television, and with a good reading lamp. There are lots of ways to stretch your budget when looking for such items. Some of my college buddies solved the problem by pretty much living in the college library for all their waking hours except for class and meal times. Explore your campus library and find what provisions they have for quiet study space for undergraduates. That wasn't the way that I did it, but I know it can work.

Dorm or commuter student

I see UWF has large dormitories to accommodate students living on campus. They allow Freshmen to park on campus, which implies to me that not everyone is living on campus, some are presumably commuting to school. Home for you is in the Florida Pan-Handle, so I'm guessing that commuting is an option for you. Living at home and commuting to school can be a big cash saving for you. You can forage for food in the kitchen, and your Mom's washer and dryer probably doesn't insist you insert a bunch of quarters for each load. Nevertheless, I urge you to consider living on campus. I believe that moving out of the house is a big step in growing up, and college, if nothing else, is about growing up. Dorm room, meal plan, laundry expenses, ... No doubt living on campus isn't "free", but if you consider the groceries your Mom won't need to buy at home, the gas and car expense that you won't have if you aren't commuting to school each day, maybe you'll be able to manage to live modestly on campus. I think you'll find yourself much more inclined to take advantage of the campus library and of events at school if you are right there.

I can pretty much guarantee that your first trips home after you've been away at school will not be entirely comfortable for you. Quite likely you'll discover that your family and old friends somehow haven't been aware of the way you've grown up while your were away from home. Don't let that disconnect ruin your visit home. If nothing else, it'll help you appreciate the wisdom of that old adage "You can't go home again".

Your Health

Some fraction of kids go away to college and come back dead. The newspapers love to jump on such stories because the news is so universally distressing to parents. Have fun in college, but take care of yourself. Impaired judgement from chemically enhanced fun can lead to tragedy.

There are plenty of other ways to ruin your health, though some of them take time. Lack of sleep, for example. Your alarm clock may faithfully remind you when it is time to get up, but it is up to your own self-discipline to remind yourself when it is time to get some sleep. There will certainly be nights when you are cramming for exams or whatever and absolutely have to cheat yourself out of some sleep time, but I assure you that if you make a habit of that, you'll soon find yourself working much less effectively at your college priorities.

Nutrition is another oft-neglected facet of good health among college students. Pizza and coca-cola are a tasty combination, but not a good choice for breakfast. You really need to make an effort to maintain a reasonably balanced diet. Some oranges for vitamin C, milk for healthy bones, all those things they taught you in health class. Somewhere on campus there's a reasonably accurate scale where you can pop by once in a while to keep tabs on your weight. Perhaps somewhere near the gym? Balancing your calorie intake to your level of physical activity is another important part of a healthy diet. (There are free smart phone apps that make it easy to keep track of your weight over time, producing easy to read graphs of your progress or backsliding). Speaking of physical activity, I'll wager that the outdoor weather in Florida is a lot more hospitable to getting out and about than the gloomy slush that was much of the school year up in Ithaca, NY. Ithication we called it. Like precipitation, but greyer and less comfortable.

You're old enough that I'll not subject you to yet another lecture about the dangers of sex. An incurable STD can certainly take a lot of the fun out of college. An unplanned pregnancy can throw quite the monkey wrench into your graduation plans. So have fun in college, but remember there's no "reset" button like in video games, no rehearsals, just one pass through life so make the best of it.

The Requirements for Graduating are in the Catalog

I mentioned up above how you have to consciously pick your path to graduation. You need to find a "major" that really excites you. One of the things I like about UWF is they have a wide variety of options open to you. Teaching, nursing, biology, social work, engineering. My "thing" is computer software, but that isn't exciting to everyone. I'm not going to be that guy whispering "plastics!" in your ear. You'll have to find your own way.

Do your best to plan ahead. There can be long strings of pre-requisites to work through for some majors, so if you don't make yourself aware of those soon enough that 4 year diploma can start slip-sliding off into the future by years. Try to fit some courses into your schedule that'll give you a taste of something completely different from where you think you are going. Be brave enough to change direction if you find where you thought you wanted to go wasn't as interesting as you thought it was going to be. But if you find yourself having to repeatedly change your mind and your direction, do find yourself a trusted advisor who can help you work through why that keeps happening to you.

There's more to college than passing classes and graduating

There are many more things happening at your college than just your classes. Take advantage of your being on campus by paying attention to what else is going on and attend some of those events. Back in my college years, when dinosaurs roamed the earth, the walls and hallways of campus tended to get plastered with posters announcing "events". It is possible that the Web has completely replaced those flyers, but I doubt it. Don't blindly rush past announcements of symposia and events on campus.

Happy Trails!

You certainly saw quite a fuss today over your getting into college. Just imagine the excitement in your family when you graduate. I'm wishing you the best for your college years. If I've given you any surprises here or left you with any questions, do feel free to contact me and we can talk.

Do well!


Most all of your college papers will be in for severe criticism if they don't include suitable references at the end. So, I close with a few references here for this article.

There's a pretty good book called "How Children Succeed" by Paul Tough. If you don't want to take the time to read the whole book, a possible short cut is to read my book-report on my blog from back when I read the book.

I hate to admit it, but there's an awful lot of wisdom (as well as laughs) about the real world of corporate employment to be found in the Dilbert comic strip by Scott Adams. For example: Click on the comic to see the missing punchline in the 3rd frame. Then you can use your browser's "back" button to return here.

Back in January, 2013, I posted "Advice to Undergraduates". It's basically a link to 3 other articles that I enjoyed. It may be a bit too computer-science-centric for general audiences, I still enjoy reading the linked articles there.

"Education" is a recurring topic on my blog and I won't puff up this references section with links to all the related articles. But I would like to point out the TED Talk linked to my May 2013 article "Education's Future: 'Go Do Somethng Interesting'"

If my repeated mention of "plastics" makes no sense to you, use your Netflix subscription to hurry up and rent a copy of 1967's movie "The Graduate".

These references would be far from complete if I didn't also include a link to Dave Barry's 2004 "Commencement Address".
Revised 3/31/2014 - Edited to fix a couple of minor typos.

Monday, February 3, 2014

Python Generators


Back in May, 2013, I posted "Cheap, but not Free, Modular Code has a Price". In that blog article I compared the performance of my solution of Project Euler problem 14 to the performance of Nico Ekkart's solution of that same problem. As I explained in that article last May, Project Euler's guidance on performance is that a solution should be able to complete on a typical PC in less than a minute. My initial solution ran well over a minute and I applied a cache to speed my program up. Once I'd gotten it down below the one minute limit, I had concluded "good enough" and went on to other problems. But Nico honed his solution a little tighter and outperformed my program by a factor of 4.

Looks to me that we had basically the same solution, but his was more of an in-line implementation, while I used a Python generator to produce the sequences of numbers the processing of which is the heart of problem 14. I concluded that the Python structuring facilities like generators do add overhead but I opined that the added clarity of packaging the sequence generation as a "generator" made the overhead worthwhile. Nico's code for his cache was so little code that I didn't really defend my use of a Python "class" for my cache implementation. Some further experiments with the code to determine how much of my extra overhead came from the generator vs. how much came from my cache implementation might be interesting. I've posted the source code and invite you to experiment and share your findings.

But that isn't what I came here to talk about today

This blog post today is aimed at expanding your knowledge of Python Generators and share with you a neat trick that I've recently learned: a generator of dictionaries.

Python Dictionaries

Back in January, 2013, I posted "Dictionary Implementation". In that article I pointed to where the Udacity CS101 MOOC introduces Python dictionaries and pointed to further places to look to learn how Python implements dictionaries, hash tables. If you aren't comfortable with Python's notion of a dictionary, I'll sum it up as an easy to use collection of name-value pairs, much like an array is an easy to use collection of subscript-value pairs.

Given an integer value as a subscript into an array, you can easily ask for the value associated with that subscript. (In Python such an array is called a "list". But if you have a dictionary of name-value pairs, in Python it is easy to ask for the value associated with a name. e.g. What value is associated with "eggplant", where "eggplant" in this example is a possible "name" entry in the dictionary. If this is all still mysterious to you, my suggestion is to dig for more info on the web. Google search is your friend. A Google search for:

python dictionary

turned up more than 5,000,000 web pages today and Google looks to have done a decent job of sorting the most helpful ones to the front of the search results.

Or perhaps you should work your way through Udacity CS101 to learn this concept of dictionaries and more.

Python Generators

But as I already said, the topic of my blog post today is Python Generators. Rather than take the time and trouble to create a fresh new tutorial about Python Generators, I'll pause here to provide a link to an article from April 2013 from Jeff Knupp: "Improve your Python: 'Yield' and Generators Explained". That article resonated with me as written in an easy to understand way. It's about 19 screens long, so it isn't a quick read, but you can get back to Facebook and YouTube later.

Knupp's article should certainly get you to the point of being comfortable with my Project Euler problem 14 generator. My generator is very vanilla, just concurring up a sequence of numbers. The one tricky aspect is my program often doesn't pursue the sequence to the end, but sometimes decides it needs to see a new sequence. I was a little nervous when I did it that way, but now understand that Python doesn't mind dangling generators like that, and even should know enough to be able to garbage collect their saved state, if memory gets tight and it is clear that there's no way the program could get back into that old sequence. Powerful stuff and a feature unlike anything available available in C, Fortran, Basic or Cobol to name 4 examples of older more traditional programming languages.

But Wait! There's more!

If you've read this far but are yawning, thinking that hardly ever do you, yourself, have occasion to use complex logic to generate a sequence of numbers in the programs that you write, well hang on and see what else generators are good for.

Igor Vasilcovsky recently pointed out to me an interesting tutorial from David Beazley about generators. The meat is the slide deck under the presentation link on that page. Even with 2 slides to a page, that slide set runs to 79 pages so it probably is too much to absorb in one sitting. So try to work through it in several sessions. Here's my summary of the key elements I think you should get from wading through that presentation:

  1. A generator can return any kind of Python object. That is, it isn't limited to returning the numbers of a sequence. If you paid close attention to my Pythonic Python from July, 2013, you may remember that one of the points I made there was that Python functions can return large complex objects, not limited to just a number or just a pointer. Better still, Python takes care of the book keeping to automatically garbage collect the returned object if you are no longer using it.

    Beazley has examples with a generator returning strings (lines from log files), and then takes an unexpected turn to have the generator parse the strings into values and stash the values into a dictionary with a name for each value and then return the resulting dictionary as the generator's output. (A dictionary per line of the log file!) My initial reaction to that was to be horrified at the overhead, but if you think about it, looking up a name in a dictionary is quite central to Python's run time modus operandi, so dictionary objects being generated is perhaps more general than generating some more specific Python class object, and looking up values by name is pretty much the same as using a name of a member of a class object to get to a value in the class object. So given that Python is able to get decent performance from run-time interpretive execution, generating dictionaries is a lot more sensible then my initial gut reaction took it to be.

  2. A generator is just Python software so I can do anything that any Python software might want to do to provide the next value in the sequence. It can compute the next value using a formula, or it could access a file to learn the next value. It is even able to make use of another generator to get an input sequence that it manipulates and passes along. So generators can be chained together into long pipelines.
  3. If your program is basically about iterative processing of a series of stuff, then chaining together pipelines of generators can fundamentally shape a clean structure for your program and with a little practice you'll soon have a collection of useful reusable filters that you can use to construct future programs that you haven't even thought of yet. Share them with your friends. If you own the code, consider making it (and it's documentation) GPL licensed and freely shared on Github or some other such public place.
I'm seeing hints on the Internet that future Python releases will have even more use of generators. e.g. standard approaches built in to the language to process streams of events. e.g. Brett Cannon's 40 minute talk: "Python 3.3: Trust me, it is better than 2.7". He foreshadows a Guido Van Rossum talk about Python 3.4 scheduled for that same conference. If you can find a link to a video of Guido's talk about 3.4 and new roles for generators, please share it in the comments section here.

Sunday, January 5, 2014

Adventures in Home Networking

I have a home network that is just a little complicated. I made some changes to it this weekend and thought I should share the story with you.

Initially, we have Optimum Online Cable Internet Service. They'd promised a price for the bundle of telephone lines, Internet service and television service to my wife, but then the monthly bill greatly exceeded the promised price. She dragged in the state Public Utilities Commission and negotiated the price back to the original promise, but each month since them, paying the bill has been a multi-hour phone call where Cablevision asks for the billed amount and my wife reminds them of the agreed to amount with the PUC. We do still have cable TV and what not here, but she's getting tired of the monthly ritual and wants to get out of using Cablevision.

Replacing the TV portion of their service looks easy. We can just get DISH or DIRECT-TV satellite TV. We had it before but were unhappy that in heavy rain storms, the satellite signal seemed to get frequently interrupted. And the satellite TV companies, despite their commercials, don't seem to have any Internet service to seriously offer in our area. We'd made do with DSL service, but the bandwidth that we wanted just wasn't there.

We tried Verizon FIOS, but the monthly bill was higher than we wanted and the service was less reliable then we'd like. Seems that the technicians just haven't quite perfected running the fiber drop cables from the pole to the house. One random day a big cement truck traveling down our street took out our fiber and the one to the house next door too. Getting that fixed took many days longer than we'd have liked. We got fed up with the high bills and switched to Cablevision service. Good thing too, as the Verizon fiber drop cable came down again in Hurricane Sandy shortly thereafter. Cablevision's drop cable survived that storm, though the service was out for quite a few days while the area was without electricity.

So, the hard part for replacing Cablevision here seems to be Internet service. I really didn't want to go back to DSL or to FIOS. My wife keeps wishing that some other cable company would start to serve our area in competition with Cablevision, but it seems like that isn't going to happen any time soon. We tried Hughes satellite internet service. "Try it and cancel within the first 30 days with no obligation if you don't like it". We didn't like it. The packet loss rate was uncomfortably high (so that often when I'd download something, I'd end up having to repeat the download until I'd get a complete file. Now maybe with some tweaking of retry allowances, we might have been able to get the TCP/IP to work well enough over the lossy link, but the apparently unfixable part of the service was the high latency. My wife's son is a huge X-box fan and likes to play shooting games like World Of Warcraft against Internet-connected opponents. Alas, with the high latency of the satellite, you're dead before your opponent's gamebox ever even hears that you pulled the trigger. We certainly didn't need 30 days to decide the satellite service wasn't a good match to our needs. So we cancelled and returned their equipment to them.

My one remaining idea was that maybe we could make do with a Mifi hot spot from a cellular company. There are 2 gotchas that worry me. One is that not everything in our house is on Wifi. The HP 7410 printer, for example, can't do WPA2 encryption on its wireless port, just WEP and WEP encryption is hardly any more secure than no encryption at all. So we're using a wired ethernet port on the printer. I rigged the DHCP in the router so the printer always gets a fixed IP address. That made it easy to tell the various PC's around the house how to access the printer without our needing a Home DNS setup.

Last night we went to Best Buy shopping for a Mifi box that has an x-base-T output. We quickly learned that all the boxes had only Wifi output, no wired port at all. But the guy in the cell phone department suggested we talk to the store's Geek Squad. No joy there as the minimum wage-slave at the Geek Squad desk opined that what I wanted to do couldn't be done, but he suggested we talk to someone in their computer department who is more familiar with the network equipment in stock at Best Buy. So we traipsed over there and finally found someone whose first reaction wasn't "it can't be done". Best Buy has Wifi range extenders from Netgear (model WN2000RPTv2) that not only repeat the Wifi signal but that also bridge the Wifi to a set of 4 100-base-T jacks on the box. So we bought one and an AT&T Mifi box with a 2 year contract, but cancellable within 2 weeks without penalty. So far, so good. The setup of the Netgear box needed me to set a hex password for the _EXT Wifi network that it rebroadcasts. Since no one is going to be using that, I found a web site that can give me random hex digits. I got more than enough hex digits from the site and randomly picked some from the set for my new Wifi's WPA2 password. (My son lives in Silicon Valley, California. I suspect that if he was around he'd have volunteered a 16-sided die to select the needed random hexadecimal digits. There's more than one way to do it...). I pulled the ethernet cable from the cable modem and plugged that cable into a wired port on the Netgear box. Voila! A brdige from Wifi to my home network, wired and wireless both.

So, the main remaining gotcha for me to worry about is that the AT&T Mifi box has an allowance of 5GB/month. We have no idea how many GB/month our home Internet traffic amounts to. So we'll be watching the meter on the Mifi box to see how that goes. A remaining install chore is we want to try to move the home phone lines over to Magic Jack Plus on the home Internet setup. That's the last piece to get the Cablevision cable modem box out of the picture entirely. Then we can see what Cablevision's bill for just television service really looks like and can decide if we want to switch back to satellite TV and read a good book on rainy nights.

We did consider Sprint as an alternative provider of cellular Internet service. They seem to be the one company that has an unlimited cellular data plan available. Alas, Sprint's coverage map shows only 3G service in our area. So, while I was willing to step down to 4G LTE, I wasn't prepared to step as far down as 3G.

A thousand words is worth a picture, and I've got 2 pictures. This first picture sketches out our home Internet setup before today's changes:

Home network yesterday with cable modem

Less than obvious features of the home network: The fireplace wall is thick enough that it attenuated the Wifi signal from the original router in the bedroom to my wife's son's apartment behind that brick wall. A Wifi range extender in the dining room probably would have gotten a strong enough signal to his apartment, but we had an older router on hand, so he ran a cable from the main router to his apartment and set up the older router in the apartment so he has wired and wireless service plentifully available there.

This 2nd picture is just like the first one, except the cable modem is replaced by the Mifi box + the Netgear range extender acting as a bridge between the wired and wireless worlds in the house.

Home network today with Mifi and bridge replacing cable modem

I've already cautioned her son that if and when we go traveling, we'll likely want to take the Mifi box along which will temporarily leave the home network off the Internet. It's a hardknock life. But I think his cell phone can do it's own hotspot trick so he'll get by.

Preliminary findings: With only a fraction of a day of use, we've already burned through a 1/3 of the 5GB allowance. I'm not sure why, but clearly we have to figure that out. Http:// had shown pings to Brooklyn taking 14ms with a 2ms jitter on Optimum Online. Through the Mifi arrangement, that same test is now 44ms with a 9ms jitter. Pingtest's site cautions that with that much jitter, we may not be happy with VOIP and Internet game performance. Uh oh.

Any questions? Suggestions? Is your home network "interesting"?

Saturday, November 30, 2013

Linus Torvalds on Teaching Children to Program

Linux Torvalds in this less than 3 minute video clip gives a great answer to a question about teaching children how to write computer code. He specifically mentions the Raspberry Pi as having the attractive property of being cheap enough to throw away. I've said before that if you persuade kids to try a computer programming course, some number of them will hate it, and will vow never to wrestle with computer software again. But there should be some who will decide this is fascinating and will pursue it further, perhaps making a career out of it.

My conclusion is that an introductory programming course should therefore be short. I like Udacity CS101. It is nominally only 8 weeks at 5 hours of class time per week. It is self-paced and not on a fixed schedule. You may want to see my blog post: Is the Udacity CS101 Course Watered Down?

There are many possible ways to introduce computer programming. For example, you could pick a commercially important programming language, e.g. C or Java, and organize a course around learning that language. Or you could create/select a student language just for the students to get started with the concepts (Scratch, Logo, Basic, CUPL, ...) and teach that. I think Udacity CS101 chose wisely in picking a subset of Python. Python is a clean, powerful, multi-paradigm programming language that does see some real use commercially. Udacity CS101 doesn't visit all aspects of the language, but it does teach enough of it to give a good start at understanding the construction of computer programs. I believe it is much easier to get started in Python than in C or Java and that Python can carry you a lot further than Scratch, Basic or CUPL.

Another approach to introducing computer programming is to pick projects that are particularly attractive to students. Robots and computer games are two oft-mentioned examples. The parts and tools needed for a Robot-centered course call for a substantial investment ($10-$25 thousand per team is a working estimate I've seen on the web) and also requires comparatively large secure space to store the project, parts and tools. Real-time software that interacts with sensors and motors strikes me as more advanced material then a short introductory course should aim to cover. Games keep the work in the virtual world, so there's less need for parts and a workshop space, but interactive software with graphics is again, in my opinion, more advanced material that a short introductory course should aim to cover. Fair enough to stir into an introductory course a bit of foreshadowing to hint at how the material the course is covering can be extended to work in games or robots.

But I haven't any real experience teaching computer programming to students. I've been trying to launch such a course at the local community center here in the New Cassel section of North Hempstead, NY for well more than a year now, but it hasn't gotten off the ground yet. A shameless plug for yet another of my blog posts: Marketing the Importance of Programming Education. The comment thread on that article is, in my opinion, particularly worth reading.

A reminder: Blog sites such as this one are intended to be 2-way communication, not just reading material. Whether you are a student, teacher, programmer, experienced or inexperienced, you are invited to post comments about this article down below. Suggestions, counter-examples, criticism, pointers to other sites that said it better, and, of course, praise are all welcomed. Anything but spam.

Saturday, September 14, 2013

Bicycles for the mind... A Steve Jobs talk from long ago.


In the Introduction talk to Udacity CS101, Professor Evans mentions Steve Jobs having compared computers to "bicycles for the mind".
I think I've now stumbled across the talk where Jobs more or less said that. Run time for the Jobs talk is about 20 minutes. The bicycle reference is around the 6 minute mark in the Jobs video. Evans attributed the quote to circa 1990, but the talk is said to be from 1980, and given Steve's youthful appearance in the video, I believe the 1980 date.

Speaking of small errors, one of the annoying things in Jobs talk is he speaks of meeting with some 4th and 5th graders, but he then calls them 4-5 year-olds. I think 9-11 year-olds would be a lot closer to correct. 20 kids and 6 Apple computers? What a depressing student/machine ratio that would be these days!

Jobs mentions Visicalc in his talk like that is something that everybody in the audience knows of. But here we are some 30+ years later and I'm no longer sure that you all know what Visicalc was. Happily, Wikipedia remembers. Even if you remember Visicalc, I recommend that you visit the Wikipedia page. It has some wonderful interesting links, including one that lets you download a free copy of Visicalc for your x86 Windows PC. That version was written for DOS 1.0 so it only works within the current directory. DOS 1.0 didn't have directories, just disk drives. Most folks back then didn't have disks with any more capacity than a 5.25" floppy disk. In 1980, that would have maybe been 140KB of storage space.

One other link to particularly take note of is the one that asks "What if Visicalc had been patented?". If you haven't been paying attention to the arguments about software patents and why they are not good for the economy, you really should Google up some background reading for yourself, maybe sit through a Richard Stallman talk or 2 about "intellectual property". Be forewarned that Stallman's talk is a 2 hour talk, so take a bathroom break and get yourself a fresh mug of coffee, tea, or whatever before you fire up the Stallman talk.

If I'm going to mention Steve Jobs and Richard Stallman in the same blog post, it is probably appropriate for me to point also you to this short video where Stallman contrasts his own accomplishments vs. those of Jobs and of Bill Gates.

Time marches on, but progress?

Listening to Jobs 1980 predictions for what the heck we'd do with even more computing power, I can't help but be disappointed with how little real progress we've made on that front. The computing power has, of course, materialized as predicted, and I suppose the graphical user interfaces of Windows, MacOS and web browsers is something of a usability improvement compared to DOS 1.0, but I was sending e-mail and posting netnews items aplenty back in 1980 and it isn't like that process is hugely different today. To keep things in perspective, the Macintosh computer was introduced in 1984. Here's an early 1984 video of Steve Jobs giving a timeline leading up to the Macintosh. It's only about 7 minutes long and includes the famous "1984" teaser ad for the Macintosh; an ad still worth watching, in my opinion. Here's a 10 minute video of Steve Jobs actually introducing and demonstrating the Macintosh.

Still, if you have a problem that you want to solve with a computer, are the barriers to solving your problem significantly lower today or about the same despite the powerful GUI computers that are now available today? If there's an existing product that fits your needs ("there's an app for that"), your path is easy, but if you really need custom software, perhaps a custom database, I expect you still have a rough road ahead. "Cobol is to Visicalc as Y is to Z", but what are Y and Z?

Comparing the Python language to the programming languages of 1980 (C, PL/I, Cobol, Fortran) I guess there's some evidence of our having learned to apply plentiful compute power to making the programming job a little easier, but there's still a steep hill to climb to bring computers to bear on your problem, whatever your problem might be. The Internet, the World Wide Web and search engines seems to be the most evident signs of progress in the computing world since 1980. I do wish the world had more progress to show on reducing the barriers to applying computers to solve problems given the passage of 30+ years since that Jobs talk. Are there specific improvements in the computing world that I'm overlooking here and not giving proper credit to? Should smartphones get mention or are they just scaled down screens with battery powered small computers.

If I was better at HTML, maybe I could rig this article to provide background music as you read the previous paragraph. Or am I being too sentimental about lack of technological progress?

If you are completely unfamiliar with Stallman's contributions to the notions of "free software", you might give a quick read of a past blog post of my own as a way to get started at understanding software licensing and Stallman's GPL in particular: See "Copied Code or Unfortunate Coincidence".

Tuesday, September 10, 2013

Control Engineering?

My Master's degree

My MSE is from U. of Michigan, Ann Arbor. As I previously explained in a STEM post, I was there in a program sponsored by Bell Labs called "One Year On Campus". Within a maximum of 12 months, it was a requirement for my continued employment to complete a Master's of Science, Engineering degree. The Labs imposed a few additional requirements on the courses I was to take. I was to take an information theory and communications course (modulation techniques, etc., etc.), a digital logic course, and I'm not sure what all else. My main interest was in studying computer science, but the University had a requirement that X% of your courses had to be from within the department of your major. For broad studies of computing, that was a problem as the computing courses were spread throughout the University. The digital logic, machine architecture and assembly language courses were over in the Electrical Engineering department. The computer graphics courses were in the Industrial Engineering department. Operating systems, higher level languages and compilers were in the Computer Science department. Database courses were way over in the business school. So, the Engineering school created the "CICE - Computer, Information and Control Engineering" department to cross list all of the above courses. By majoring in CICE, I was able to take a broad variety of computing courses and still meet that X% within my major department requirement.

So much to do and only a year to do it. So, I admit that the edge of the CICE curriculum where I did not fit in many courses was control engineering. I had some exposure to it, but just enough to hum along if someone decided to sing about the subject. I couldn't even confidently promise to you a competent explanation of the topic if you asked me about it.

TED talk/demo of control engineering

So, I was excited today to find a most excellent TED talk demonstrating control engineering with a set of "Quad copters". The talk has some very impressive demonstrations of software control of the copters. I could wish for a more technical explanation then they offered. I'm not at all sure how many processors of what kind they used to track and control the copters. I'm pretty sure there's more real-time computation going on there then would comfortably fit into one processor, but that's just my gut feeling and not based on any real experience.

And so, for your entertainment and to convey to you what the heck "control engineering" is about, I share with you Raffaello D'Andrea: The astounding athletic power of quadcopters from June 2013. Run time of the video is about 16 minutes.

Want to know more?

I did some mild Google searching to try to find the source code for the control programs, which I assume are likely to be "open source". I didn't find exactly what I was looking for. But I did find some useful info. There's a Wikipedia article about Quadcopters and from there, there are plenty of links to additional information. I found this article about the lab where they test their stuff to be interesting. I was heartened to learn that they do have a safety net to catch the falling copters when the software is still under development. The article does give me the distinct impression that they've developed custom hardware to do the control algorithms fast enough. That is a potential major obstacle for a casual hobbyist who wants to play. If the Wikipedia article doesn't give you enough leads to follow there's an existing Pearltree specifically about quadcopters. I did find some open source (Arduino controller) quadcopter projects. e.g. this one and another one.

If you try your own Google searches, be careful about people in other fields of research with names similar to Raffaello D'Andrea. e.g. I found a biology PhD candidate at U. of Michigan named Rafael D'Andrea - Not the same guy. Oh, and I did find some Cornell U. work in the field of quadcopters too: Autonomous Quadcopter Docking System. Oh my, on page 11 of that report, the guy strapped his Android Smartphone to the quadcopter to add a camera to the configuration. That must have taken guts! (I wonder if he has the "Send me to Heaven" game on his Android phone? Not me!)

If you want to get into the math of control of a quadcopter, this looks like a reasonable place to start reading: Estimation and Control for an Open-Source Quadcopter. Or just sit back and enjoy the demo video that I pointed to in the previous section. Not everyone has to be a DIY engineer with amazing toys.

Monday, September 9, 2013

The public does remember scandals, even in NYC?

I'm writing this the night before the NY primary elections. A couple of the current races had been troubling me. One is the Democrat's field competing to be on the ballot for mayor this November. The other is the Democrat's field competing to be the NYC Comptroller on the ballot this November. How could Anthony Weiner and Elliot Spitzer be regarded as serious candidates after they'd been thrown out of previous high-office positions for plenty good scandalous cause.


In case you have been sleeping under a rock or perhaps simply aren't from the NY area, here's a quickie background on these candidates.

Spitzer, a married man, was a well regarded governor of the state of NY 2007-2008. But then it was discovered that he was paying huge sums for the services of high priced prostitutes. It was widely reported, his wife stood by her man, and then he resigned from office under fire. He resigned from office rather than risk getting dragged through impeachment proceedings.

Far as I can tell, Spitzer was never prosecuted nor convicted on any of the charges, but I've seen nothing to so much as imply that he is anything less than 100% guilty of exactly what he was accused of.

Weiner, also a married man, was a U.S. congressman representing Manhattan's 9th district from January 1999 to June 2011. But then it was discovered that he was sending photos of his private parts to various women. Amid all the hoopla, he resigned from office.

I'm not upset with these guys resigning from office, though I do wonder about how no one bothered to prosecute them for their misconduct. But the huge shock to me is that they would then have the nerve to throw their hat into the ring to run for public office again. My one comfort is that recent polling numbers show both Spitzer and Weiner trailing in their races, so maybe their comeback attempts are ill-fated after all. Goodness knows the late-night talk shows have been having great fun with those candidates, especially with Weiner.

So, not much longer to wait to see if these comeback attempts fail as clearly as they deserve to fail. From my point of view, neither of these guys should have embarrassed us by running for office again. Or am I just being an old fuddy-duddy?

Election Night Update 09/10/2013

Well, the polls for today's primary election have closed and results indicate that Weiner came in a distant 5th place in a field of 5 candidates. Weiner got 5% of the vote. Bill Deblasio got 40%, just enough to win the Democratic ballot slot for NYC Mayor without needing to campaign for a run-off election in 3 weeks. (40% was the magic number to avoid having a run-off of the top candidates in the Primary voting).

Spitzer also lost with Stringer winning the race for the Democratic ballot slot for NYC Comptroller, but just barely. I was happy to see Spitzer lost, but would have been happier to see him handed a more decisive defeat. "Name recognition" is valuable when trying to get votes, though Weiner shows there are limits.

Perhaps it mattered that during this campaign, Weiner asserted that his checkered past was now behind him, but then the whole "Carlos Danger" brouhaha hit the fan during his comeback campaign. Maybe the difference was that there was no fresh scandal from Spitzer, just the old scandal that at least some folks have not yet forgotten.