tag:blogger.com,1999:blog-65571046583900474922024-03-12T20:27:43.497-07:00Drew's BlogRandom Walks straying a bit from the Lamppostrdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.comBlogger102125tag:blogger.com,1999:blog-6557104658390047492.post-54582907027405866962022-08-01T19:51:00.000-07:002022-08-01T19:51:34.645-07:00Hannar.drew.davis@gmail.com
<BR>
<BR>
Please leave a comment below.
rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-31870693651347957922016-02-09T14:12:00.001-08:002020-05-03T06:34:47.426-07:00Project Euler Problem 1 - In Python<h4>
Project Euler
</h4>
<a href="https://projecteuler.net">Project Euler</a> is a web site with hundreds of problems for you to tackle however you want to solve them. Some of them, if you are sufficiently adroit mathematically, can be solved on the back of an envelope. Most of them clearly need a piece of software to grind through the calculations. You can use whatever programming language you prefer. the site asks only for the answer. Each problem yields a numeric answer. If you provide the correct answer, the site credits you for solving the problem and grants you access to a discussion page. The discussions are mostly people bragging how they solved the problem. The bragging isn't anything important, but it can be useful to look at other people's approaches to see other ways of looking at the problem that perhaps hadn't occurred to you.
<p>
The one "guideline" is that a good solution should need no more than a minute of time on your computer. If your solution needs way more time than that, then you should look for a better solution.
</p><h4>
Tell Ya What I'm Gonna Do...
</h4>
I'm going to show you how to solve some of the project Euler problems using the Python 3 programming language. Instead of having you install Python 3 on your computer, I'll be using the "Python in the cloud" facilities of <a href="https://www.pythonanywhere.com">pythonanywhere.com</a>. You can sign up for a free account of your own there. For small programs like ours, they offer their service for free. If you use their site to build something that becomes enormously popular (say, the next "Farmville" game), you'll be needing to pay for their services, but we're far, far from crossing that line between trivial computing load and significant computing burden.
<p>
It'd be useful if you figure out a good way to prepare your Python programs in a file, but you can start with notepad or whatever simple editor you are most comfortable with. If you tell us in the comments on this blogpost what editor or IDE ("Integrated Development Environment") you prefer, it may influence whether I write future articles addressing that editor or IDE.
</p><h4>
Project Euler Problem 1
</h4>
The first problem on project Euler is one that calls for very little code. I'll tell you that I approached the problem as a computer programmer, but in the discussion page for the problem there were people who knew how to compute sums of a series using a simple formula and they were able to readily solve problem 1 using only pencil and paper. That's just proof that although I've worked with mathematicians, I'm a software guy, not a mathematician.
<p>
The crux of problem 1 is: Find the sum of all the multiples of 3 or 5 below 1000.
</p><p>
The example given makes clear that they are only asking us to consider positive integers. So no need to worry about negative 3 and negative 5 and so on. ("If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.").
</p><h4>
Spoiler Alert.
</h4>
I'm going to talk here about how I solved the problem. If you want to solve the problem on your own,
stop reading here and go solve that problem. Feel free to come back later and tell us in comments how your solution is better than mine. Better in what sense?
<p>
</p><h4>
Solving Problem 1 in Python
</h4>
At this point, I am tempted to show you the small program that I used to solve the problem, but that is so small a program that you'd probably glance at it and walk away grumbling "nothing to learn here", so I've decided to creep up on the solution a bit more slowly. I hope you pick up some comfort with Python programming along the way.
<p>
</p><h4>
The General Shape of the Program.
</h4>
Generally, the way to write a program is to start out with a rough idea of what the program should look like.
You can write this down in "pseudo-code" - a mixture of your native language and whatever bits of programming language structure you are comfortable to stir in. One of the delights of Python is that Python code looks a lot like pseudo-code, so if you nudge your pseudo-code into being real Python code, you can test out your pseudo-code by running the program. When it works, perhaps you are done, but if your actual target language isn't supposed to be Python, then you have a working prototype that you need to re-code into your intended target language (Perhaps C or C++ or even some assembler language). It is worth noting that in the real world, often a manager faced with a working prototype that works well enough, will suddenly decide that a Python implementation is plenty good enough to declare the problem solved, even if its the first instance of Python code admitted into "production" use in that shop.
<p>
This program is going to need an iteration (loop) to consider all the natural numbers less than 1000.
And inside that loop it is going to need a conditional statement (if statement) to select the numbers that are multiples of 3 or of 5 (which for whatever reason are the numbers that this problem considers to be interesting). And for the numbers that are multiples of 3 or 5, we'll need a little arithmetic to accumulate the sum of the selected numbers.
</p><p>
There's more than one way to do it. For example, we could loop through all the non-negative integers <1000 and build up a list of the numbers that meet the criteria of being "interesting". Then we could take the sum of that list to get the desired answer. But we have no further use for the list in this problem, so I assert it is simpler to just accumulate the sum as we go.
</p><p>
Another approach would be to generate the multiples of 3 and to generate the multiples of 5 that are less then 1000, and then tally up the generated lists, but you'd need to be careful not to include any numbers twice. Some numbers (e.g. 15) are multiples of both 3 and of 5, but only should get added into the sum for this problem once,
so I assert it is simpler to just consider each of the candidate numbers and accumulate the ones that meet the criteria for being interesting.
</p><p>
Got another plausible shape for the solution this problem?
</p><p>
So, I'm going to stick with my initial proposal which in Python-like pseudo-code looks like this:
</p><pre>sum=0
for num in numbers 1 thru 999:
if num is "interesting":
sum += num
print(sum)
</pre>
<p>
Note that in Python, indentation is used to delineate the blocks of code. My Python-like pseudo-code follows that same convention. Thus the body of the loop statement is indented under the "for" that introduces the loop.
The body of the "then" clause that is made conditional by the "if" statement is indented inside the "if". Since the "if" is inside the "for" loop, the accumulation of the sum is doubly indented. The initialization of sum to zero is outside of the "for" loop so it isn't indented at all. The "print" statement is also not indented. We don't want to print the partial sum on each iteration of the loop, so it is important not to indent that final "print". But maybe when you are debugging, a print statement inside the loop would be a helpful addition. That would be done by adding another print statement and indenting it so it is inside the loop. You might want to include a comment on your debugging code so you can trim the debugging code out when your program is in good working order.
</p><p>
The "sum += num" statement is Python short-hand for "sum = sum + num", since accumulating totals is such a frequently needed operation.
</p><p>
I hope you've noticed that the pseudo-code is not quite working python, so we aren't done yet.
The most glaring magic is how do we really decide if a given number, which we've named "num", is "interesting"?
</p><h4>
How to test if a number is a multiple of some value
</h4>
So we need to consider how to test a number to see if it is a multiple of 3 (or of whatever number we want to test to see if it is a multiple of). Python has a modulo operator (%) that is documented <a href="http://www.webreference.com/programming/python/index.html">here</a>. <strong> x % y </strong> is how you ask Python to compute the remainder of dividing the number stored in x by the number stored in y. So all you need to realize is that if x is a multiple of y, that the remainder will be 0, and if x is not a multiple of y, then the remainder will not be zero.
<p>
So if we have a number to test named num, then we can test if num is a multiple of 3 by using this Python code:
</p><pre>num % 3 == 0
</pre>
<p>
The result of that test expression is a True or False value (True if the remainder is 0. False if the remainder is not 0).
But we want to know if the number is divisible by 3 or is divisible by 5. Happily, Python has an "or" operator that will let us combine 2 True/False values in exactly the way we need.
</p><p>
Here's a copy/paste of my PC anywhere session where I tried this out:
</p><pre>>>> num=27
>>> num % 3
0
>>> num % 3 == 0
True
>>> num % 5
2
>>> num % 5 == 0
False
>>> num % 3 == 0 or num % 5 == 0
True
</pre>
<p>
As you can see, the Python rules for operator precedence did exactly the right thing for us here,
but I find that long expression a bit hard to read, so I added some un-necessary parentheses to make it easier for a human to parse.
</p><pre>>>> (num % 3 == 0) or (num % 5 == 0)
True
</pre>
<h4>
How to conjure up a list of numbers?
</h4>
In many programming languages, Fortran for instance, the way you conjure up a sequence of numbers is you have a variable to serve as a counter. You initialize the counter to a starting value, then you increment the counter to get the next value and you need a test to decide when you've gone as far as you want to go. If you've programmed in C, that's what a "for" loop in C does. But there's a more Pythonic way to do this in Python, so please take care not to write Fortran (or C) code in Python syntax. A Python "for" loop looks like
<pre>for x in list:
do something with x
</pre>
Where x is an arbitrary variable name that takes on each of the values in the list and the body of the loop (which I've represented as "do something with x") processes each of the values as x is stepped through the list.
<p>
If you want to read more about looping in Python, especially if you are comfortable with looping in other languages, I strongly recommend Ned Batchelder's blog post
"<a href="http://nedbatchelder.com/text/iter.html">Loop like a native</a>".
</p><p>
Not only does Python have a statement to consider each of the values in a list of values. It also has a built-in generator of a list of values. In Python 2, "range" is a built-in function to return a list of integers, but such a list takes up space. So "xrange" was introduced to return a generator that'll provide the desired sequence of integer values on demand without ever actually creating the list as a whole in memory. xrange worked well enough and explaining the distinction between range and xrange was ugly enough that in Python 3, xrange became range and you only need to know its a generator if you're interested in the details of how stuff works. So just say range(1000) to conceptually whip a list of numbers 0 through 999.
</p><p>
So now our pseudo-code has morphed into runnable Python code:
</p><pre>sum=0
for num in range(1000):
if (num % 3)==0 or (num % 5) == 0:
sum += num
print(sum)
</pre>
<p>
And we're done, except for running the code to get the answer. I'll not reveal the numeric answer here, so please learn how to run this yourself.
</p><p>
Mystified? Please tell me if I've confused you so I can polish things up before my next blog post.
</p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com2tag:blogger.com,1999:blog-6557104658390047492.post-65849349582305859322015-12-26T20:50:00.002-08:002020-05-03T06:11:39.202-07:00Blog Post #100<h3>Where Have I Been?</h3>
This blog is now about 6 years old. Thanks to irregular gaps between my posting articles, this is only blog post #100.
<p>
My apologies for the long gap between my most recent article on this blog and this one. It's been well more than a year since I last posted an article here. Such laxity needs an explanation.... Last year my wife succumbed to her 2nd heart attack and died in her sleep one Sunday night. Needless to say, that was a huge emotional setback for me. Also last year I developed a severe infection in the middle toe of my right foot. Despite doctor's care, antibiotics and so forth, the infection moved into the bone and the doctor's concluded that the toe had to immediately come off. The result was I was in the hospital for much of December and was sent home on the evening of Christmas day.
</p><p>
Medical adventures continued through the next couple of months with nightly treatments in a <a href="https://www.winthrop.org/hyperbaric-medicine-program?">hyperbaric chamber at Winthrop hospital</a> to accelerate the healing. It worked. The nicest thing about laying in the the hyperbaric chamber for a couple of hours each evening is you get to watch your choice of movies (from their large DVD collection), so I caught up on a lot of semi-recent movies that I'd otherwise missed seeing. Down side is it's very tight space and they have a rule that you can't bring a date (or even popcorn) into the tube with you. ;-)
</p><div class="separator" style="clear: both; text-align: center;"><a href="https://www.augustahealth.com/sites/default/files/images/wound_clinic/hyperbaric_chamber1.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://www.augustahealth.com/sites/default/files/images/wound_clinic/hyperbaric_chamber1.jpg" /></a></div>
<p>
Unrelated to my foot problems, by late summer 2015, I found my vision was fading to the extent I was no longer able to read. I cranked up the font size on my PC screen to try to get by, but the wretchedness of my typing accuracy with little ability to proofread was depressing and certainly discouraged any attempts to type up an article for the blog. So I went to an <a href="http://www.berkeeyecare.com/">ophthalmologist</a> and learned I had developed cataracts in the lenses of both my eyes. 10/29 they operated on the right eye (which was the worse of the 2 eyes, by far) and 11/13 they operated on the left eye.
I was a bit disappointed that things weren't instantly better after the surgery, but apparently the surgery causes inflammation in the eye. It takes a few weeks for the swelling to go down and the vision to clear up.
</p><p>
I've needed eye glasses for distance since the 4th grade in elementary school. Now, thanks to the plastic lenses they implanted in place of the murky lenses they removed, my distance vision is fine without glasses. I can read the newspaper without glasses too, but do admit to having problems with reading fine print and reading in dim light is still more difficult then I'd like. I have an appointment with the Ophthalmologist this week to get fitted for reading glasses, so maybe the fine print of EULA's will become legible to me again soon.
</p><p>
My daughter insists the plastic lenses are just phase 1 of a secret plan to make me "bionic". Clearly she's watched too many cable TV re-runs of old shows.
</p><p>
Modern surgery for cataracts is pretty amazing. The ophthalmologist describes it as a 10 minute procedure per eye, but that's from his perspective. The day of the surgery you have to be there early and go through various check-in reviews of your meds, and transportation arrangements. It is an absolute requirement that you have someone available to escort you home. I believe the <a href="https://www.yellowpages.com/westbury-ny/mip/t-h-express-taxi-5157616">local taxi company</a> could have done fine, but the <a href="http://www.islandeye.net/">eye surgicenter</a> insisted that wouldn't do. As a non-driver, I use the local taxi company a lot. Often when I get into one of their cabs the driver just asks me if I want to go home and needs only a "yes" to get me to the right place. Fortunately, there's a company called the <a href="https://www.facebook.com/Fairy-Godmother-209061235778805/">Fairy Godmothers of Long Island</a> that provides people to escort patients home from surgery. My daughter hooked me up with them when she couldn't get to the suburbs to escort me herself. (Oh, great! Wait until word gets around that my daughter fixed me up with an escort service. :-). The Fairy Godmothers took me to the surgicenter and then waited for me to be released from the recovery room, they then took me home and made sure i got the door unlocked and was safely home. Heck, I've had taxi rides home from Walmart where the taxi driver even helped me carry my purchases into the house. Fairy Godmothers was a valuable service for me in that I needed them to satisfy the surgicenter people, but I'm still convinced the taxi company could have done just as well.
</p><p>
So that's more like 4 hours per eye. Oh, and for a week prior to the surgery and for weeks afterward there were eyedrops to apply. At it's worst there were 3 different eyedrops 3 times/day. You need at least 5 minutes between drops so you don't just wash out the previous medicine with the next one, so it felt like all eye drops all the time each day. And the day after the surgery you need to see the ophthalmologist to get the eye patch off, and a couple more weekly appointments to make sure the vision is coming into focus the way it should. And by then it's time for the surgery on the other eye. A "10 minute procedure" started feeling like a couple of months lost to working on the eyes. The good news is things apparently worked out fine.
</p><h3>The Stats By Country for the Blog as of this post</h3>
<p>
So, enough with the excuses for my recent level of posting inactivity on the blog. It has been close to 3 years since "<a href="https://rdrewd.blogspot.com/2013/02/blog-post-50.html">Blog Post #50</a>". Readership on the blog has picked up nicely in those 3 years. As of Blog post #50 I'd had a total of 2600 page views from 2009-2013. My total page view count as of today is up to 33,370 over the life of this blog. That's not even close to passing for viral among YouTube videos, and I certainly don't need to dream yet about how to monetize my page views, You'll notice I don't put any advertising on my pages or even a "please contribute" tip jar button.
</p><p>
Google reports the top 10 countries for page views. The biggest readership by far is still in the US with 15,172 page views over the life of this blog. I wish that was broken down by state, but blogspot.com doesn't slice the data that finely. Russia remains in 2nd place.
Germany dropped from 3rd to 4th place as France moved up from 7th place to 3rd place. As before, India finished just behind Germany. New to the list is Ukraine, which finished just behind India. China dropped from 5th to 9th on the list. (Blame the <a href="https://en.wikipedia.org/wiki/Great_Firewall">Great Fire Wall of China</a>, which I'm told officially bars access to blogspot.com sites from China?). Slovenia dropped from 6th to below 10th place, so it's vanished from this table. United Kingdom moved from the 8th place slot to the 7th place slot. Canada is newly on the top-10 list, just behind the United Kingdom. The Netherlands dropped from 9th to below 10th, so it's vanished from this table. Poland remains in the 10th place slot, just behind China.
</p><table border="1" bordercolor="FFCC00" cellpadding="3" cellspacing="3" style="width: 400px;">
<tbody><tr>
<td>United States</td>
<td>15172</td>
</tr>
<tr>
<td>Russia</td>
<td>1632</td>
</tr>
<tr>
<td>France</td>
<td>1380</td>
</tr>
<tr><td>Germany</td>
<td>1248</td>
</tr><tr><td> India</td><td> 1235</td></tr><tr><td> Ukraine<span> </span></td><td>1229 </td></tr><tr><td> United Kingdom</td><td> 990</td></tr><tr><td> Canada</td><td> 418</td></tr><tr><td> China</td><td> 283</td></tr><tr><td> Poland</td><td> 224</td></tr></tbody></table><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p>
India
1235
Ukraine
1229
United Kingdom
990
Canada
418
China
283
Poland
224
<p style="font-family: verdana, arial, sans-serif; font-size: 10px;">Origin of pageviews by countr;</p>
<p>
And of course the data has a long tail that blogspot.com doesn't show me. I know that from time to time I've had readers from Australia and Brazil. I think that I've even had occasional clicks from somewhere in Africa, but evidently not enough to be anywhere but in the invisible long tail of the data.
</p><h3>Top 10 articles by page-views</h3>
<table border="1" bordercolor="FFCC00" cellpadding="3" cellspacing="3" style="width: 400px;">
<tbody><tr>
<td><a href="https://rdrewd.blogspot.com/2014/09/actual-code-c-vs-python-for-small.html">Actual code - C vs. Python for a small problem</a></td>
<td>1731</td>
</tr>
<tr>
<td><a href="https://rdrewd.blogspot.com/2013/08/whats-fuss-about-parallel-programming.html">What's the fuss about parallel programming?</a>
</td>
<td>1537</td>
</tr>
<tr>
<td><a href="https://rdrewd.blogspot.com/2013/07/pythonic-python-writing-python-code.html">Pythonic Python - Writing Python code that fits the language's idioms</a>
</td>
<td>1471</td>
</tr>
<tr>
<td><a href="https://rdrewd.blogspot.com/2014/02/python-generators.html">Python Generators</a></td>
<td>1449</td>
</tr>
<tr>
<td><a href="https://rdrewd.blogspot.com/2012/12/is-udacity-cs101-course-watered-down.html">Is the Udacity CS101 course watered down?</a></td>
<td>1442</td>
</tr>
<tr>
<td><a href="https://rdrewd.blogspot.com/2014/08/python-and-parallel-processing.html">Python and Parallel Processing</a></td>
<td>566</td>
</tr>
<tr>
<td><a href="https://rdrewd.blogspot.com/2013/11/linus-torvalds-on-teaching-children-to.html">Linus Torvalds on Teaching Children to Program</a></td>
<td>451</td>
</tr>
<tr>
<td><a href="https://rdrewd.blogspot.com/2009/06/cornell-hydraulics-lab.html">Cornell Hydraulics Lab</a></td>
<td>433</td>
</tr><tr>
<td><a href="https://rdrewd.blogspot.com/2009/07/literate-programming.html">Literate Programming</a></td>
<td>379</td>
</tr>
<tr>
<td><a href="https://rdrewd.blogspot.com/2014/06/home-networking-with-fios-dont-cross.html">Home Networking with FiOS - Don't Cross the Streams</a></td>
<td>365</td>
</tr>
</tbody></table>
<p style="font-family: verdana, arial, sans-serif; font-size: 10px;">Top 10 articles by pageviews</p>
<p>
I'm pleased to say that some serious articles have at last edged out the dumb humor articles from the most-viewed list.
</p><p>
The "Python Generators" article seems to owe its popularity by it being referenced with a link in another person's <a href="https://www.fullstackpython.com/generators.html">Python-oriented blog</a>.
</p><h3>How the readers access the blog</h3>
blogspot.com reports the breakdown by browser. Over the life of this blog, the most used browser to access my blog was Chrome (39%), followed by Firefox (32%). Internet Explorer (or <a href="https://uncyclopedia.wikia.com/wiki/Internet_Explorer">Internet Exploder</a> as I tend to refer to it) was a distant 3rd at 16%. Annoyingly, the stats don't distinguish Internet Explorer versions. It would be nice to see if IE6 is at least fading though I hear it is still about 10% of the browser views in the world. I also notice that some of the IE accesses are likely "fakes" as they come in rapid bursts of >100 page views in a short interval of less than an hour, with none of the views attributed to any particular blog article. (Page scraping in the name of IE?). 4th place went to Apple's Safari browser at 7%. 5th place was a tie of Mobile Safari and Opera at 1% each. The tail with &lt 1% each included Instapaper, "CriOS", "Mobile", and "OS; FBSV".
<p>
Here's the breakdown by operating system of the pageviews: Windows (56%), Macintosh (17%), Linux (11%), Android (8%), Other UNIX (2%), iPhone (1%), iPad (1%), UNIX (&lt 1%), iPod (&lt1%), Windows NT 6.1 (&lt1%), Funny that they break out just one ancient version of Windows and don't mention Windows XT, Windows 7, Windows 8, Windows 10, Windows Vista, ... which presumably are all lumped into "Windows" 56%. Your guess is as good as mine as to the categories UNIX and Other UNIX. SunOS, Sun Solaris, SGI Irix, IBM AIX, BSD UNIX?
</p><h3>Complaint Department</h3>
In blog Post #50 I lamented that contrary to what all the hype about "Web 2.0" would have you expect, that the vast majority of my readers are silent. That is, there are disappointingly few comments and feedback about the articles. As I put it in Blog Post #50:
<blockquote>
What does it take to get people to post comments on the articles? 50 articles and I've only had 12 comments all together. And 6 of those were on <a href="https://rdrewd.blogspot.com/2013/02/education-and-technology.html">one article about Education and Technology</a>. Begging for comments doesn't seem to work. Do I need to write about more incendiary topics to get any kind of reaction? Heck, even feedback like "that's kind of obvious", and "here's another web page that says that better than you did" would be useful feedback to me. Didn't everybody get the memo about <a href="https://en.wikipedia.org/wiki/Web_2.0">Web 2.0</a> being interactive? It isn't supposed to be read-only.
</blockquote>
<p>
For the most part that is still true, but I did finally have one article that got relatively heavy response. 139 comments on "Actual code - C vs. Python for a small program". This surfaced a new problem. blogspot.com does a relatively poor job of organizing the comments in a clear accessible way when there are a significant volume of comments. The comment mechanism also is little help for contributing complex data (e.g. source code, data tables) in comments.
</p><p>
A distant 2nd place for number of comments went to "<a href="https://rdrewd.blogspot.com/2013/03/marketing-importance-of-programming.html">Marketing the Importance of Programming Education</a>" with 27 comments after only 214 page views. That's a volume of comments that the blogspot.com comments mechanism seems comfortable with displaying. (Well, it displays them without complaint, but much beyond a couple of dozen comments, it is difficult to unravel who was replying to what).
</p><p>
Other complaints are mentioned elsewhere in this article: Lack of breakdown of varieties of IE browsers, lack of breakdown of varieties of Windows, lack of clarity of breakdown of versions of UNIX, lack of breakdown of US into finer locations (e.g. by state),
lack of access to the long tail of the stats (e.g. countries that didn't make the top 10 over all time). Distinguishing real page views from bots accessing the blog. </p><p></p><p></p><p></p><p></p><p></p><p></p>rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-83816602312830466672015-05-14T12:26:00.001-07:002016-12-21T23:18:21.653-08:00GMO Labeling - Even a Kid Can Understand Why.<P>
Last July in <a href="http://rdrewd.blogspot.com/2014/07/danger-lurking-in-plastic-packaging-of.html">Danger Lurking in the Plastic Packaging of our Food?</a> I wandered away from that article's title topic and took a light poke at the government for not insisting that GMO ingredients in food should be labeled as such.
<P>
GMO ingredients still aren't labeled, and here's a TED talk from a 15 year old that makes clear why they ought to be. <a href="http://www.collective-evolution.com/2014/11/14/gmos-are-a-bad-idea-if-a-15-year-old-can-see-it-so-clearly-why-cant-many-scientists/">15 year old explains why GMO's ought to be labeled</a>, It's only a 13 minute talk. Made sense to me. Is your congress-person as smart as a 15-year old? Honest enough to do what's right?
<P>
Not sure who represents you in the federal House of Representatives and Senate? Well, if you know your zip code, visit <a href="https://www.opencongress.org/people/zipcodelookup">Find Your Senators and Representatives</a> to find out who represents you.
Now that you're armed with that information, you can visit <a href="http://www.contactingthecongress.org/">Contacting the congress</a> to actually contact them and make your opinion known. Isn't even going to cost you a stamp as they tend to have web forms or e-mail to receive your communications.
<P>
My apologies to my non-U.S. readers, but please work out how to let your government know of the need for GMO labeling.
<P>
Blogs aren't meant to be read-only. Please take a moment to comment on this article and re-share it with your friends. Even if you just give me a comment lifted from the GEICO commercial: "Everybody knows that!", I'll still be glad to hear from you.rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-90906511287987196202014-11-08T15:06:00.000-08:002014-12-08T11:30:29.924-08:00Playing with my FoodThis blog article today is non-technical. It is about food, cooking and grocery shopping. Family members and my grad school room mate who are familiar with my low-level of expertise on these topics are probably doubled over in laughter at my choice of topic today. If you're wondering, today's article was inspired by an impulse purchase at Walmart, a bag of Pecan pieces that I've been especially enjoying.
<P>
My first wife, now ex-wife, had her faults, but she was an excellent cook. The difference in how we'd use cookbooks was fascinating to me. I can cook by following a recipe. I do that by leaving the cook book open on the kitchen counter and do the steps of the recipe step by step, measuring each ingredient carefully. The results are generally OK, but rarely amazing. My ex- would go out to the shelf with the cookbooks in the dining room, spend some time looking through them, announce to the air "Oh, I see", put the books back on the shelf, and then go out to the kitchen and cook. Her dishes inevitably included soy sauce and MSG among the ingredients and were generally very good and occasionally amazingly great, though they did lack reproducibility. My daughter's one complaint about her Mom's cooking was that she never did turn out great Brownies. I have heard it said that baking, more than most kinds of food prep, calls for careful measuring of ingredients, time and temperatures. Generally no room for soy sauce nor MSG in most Brownie recipes.
<P>
My current wife often tells me how great a cook she is, but she gets busy and rarely spends time in the kitchen. so I mostly have only her word on this. A seasonal specialty of hers is turkey. Most years in the run-up to Thanksgiving she roasts multiple turkeys to give away to friends, to the local police department, and even sandwiches for the day laborers that gather on certain street corners in town here hoping for work. But she manages to violate all the Food Network's tips on how to be sure of having your turkey come out perfectly (At most a 15 pound bird, no stuffing inside the cavity of the bird, no basting, ...). Her birds are inevitably the largest in the store, often purchased fresh, not frozen, because who has time to thaw such a large object? She stuffs it with more stuffing then I'd expect could fit, and then the cooking is extremely labor intensive with endlessly repeated basting to get the skin brown and crispy. The down side for us is that the turkey for our own Thanksgiving dinner often isn't ready until incredibly late on Thanksgiving day.
<P>
One of her turkeys, some years ago, actually made its way to the table in Reagan's White House. She got a nice thank-you note from Ronald on White House stationary, attesting to how great her turkey is. Who am I to question her politician nephews to determine if they indeed arranged for her turkey to be served at the White House or just forged a thank you note and ate the turkey themselves?
<P>
This year is shaping up to be different. We're planning to visit one of her adult children in Georgia for Thanksgiving dinner. I've actively discouraged all Barbara's thoughts that she should cook a turkey and bring it with us. Dian invited us, so leave it to Dian to prepare dinner. Offer to help in her kitchen, but if she'd rather do it herself, stay out of her way. We'll see how this goes. No guns in Dian's house, but it's hard to guarantee things won't break down into a carving knife fight in the kitchen.
<H4>Grocery lists</H4>
<P>
Much as I was surprised at how my ex- would cook without reference to a cookbook, I'm surprised that my wife goes grocery shopping without bringing along a shopping list. I can go to the store to pick up bread, milk and eggs without a shopping list, but if the trip is to stock up on more than that, I need a list. I keep a list on my desk at home. Whenever I find we are out of something or getting low on something, I add it on to my list. Occasionally, when I am looking at a recipe that calls for an ingredient we don't generally have on hand, that ingredient goes onto the list too.
<P>
I found that a problem with grocery-list-driven shopping is that sometimes an item falls out of inventory here and until I specifically miss it, we don't re-stock it, because it wasn't on the list. So now I do 2 things to assure variety in the household pantry:
<OL>
<LI>
List things on the grocery list in more generic terms. e.g. instead of listing chicken noodle soup, I'll list "soup" and spend some time looking through what the supermarket has on offer. This does add time to the shopping trip as my wife claims to be allergic to pork, doesn't want too much salt, and says MSG gives her headaches, so I spend a long time reading ingredients lists as I'm picking out soups. We recently tried a Butternut Squash Bisque in a box that way, and I liked it.
</LI>
<LI>
I force myself to browse the supermarket for things not on my list. Sometimes that results in fairly frivolous purchases, like flat-bottomed wafer ice cream cones. I do think I eat less ice cream if I pack a small cone with ice cream instead of scooping ice cream into a bowl.
<P>
Seasonal items, like fresh apple cider, find their way into my grocery cart from looking at what the store has, rather than shopping off my grocery list. My wife makes a face and leaves the cider to me. She has memories of a rusty old cider press she saw in use on a farm some years ago and is convinced the cider isn't wholesome.
</LI>
</OL>
<H4>Pecan Pieces</H4>
A recent minor impulse purchase from the grocery section at Walmart was from their "seasonal" aisle, a 24 ounce bag of pecan pieces. I had no idea what I was going to do with them when I bought them, but have been pleasantly surprised at how much I've been enjoying them. Tasty as they are, I'll warn from having read the nutrition box on the side of the bag, that nuts are not a low calorie snack. They are extremely packed with fat, so that keeps them low in sugar and even low in carbohydrates, but high in calories.
<P>
So what to do with them? Well, one of my favorite simple uses is to sprinkle a small handful onto my bowl of cold breakfast cereal. This adds some interesting flavor and texture to even a plain old bowl of Cheerios. Sure, the store sells "Honey Nut Cheerios", but have you read the ingredients of those? They add almond flavor, but absolutely no nuts. No thanks. I much prefer to start with plain Cheerios and add my own sprinkling of genuine nuts. Good too on other varieties of cereal, Special K, for instance. One 24 ounce bag is sufficient for weeks of breakfasts.
<P>
We recently received a gift of a couple of large cartons of apples from upstate New York. An apple a day makes a nice crisp tasty snack, but what to do with all these apples? Well, one thing I did to use some of them was to make baked apples. Coring the apples with a plain old sharp knife was a bit of a hassle, but by using a covered Corningware baking dish in the oven, the recipe mostly just needed baking (and cooling) time. As Alton Brown was so fond of saying on Good Eats "Your patience will be rewarded".
<P>
I did add some pecan pieces to the cinnamon sugar used to fill the cored apples and the result was indeed delicious. My wife's opinion was that New York Delicious apples stay a bit too crunchy through the baking to make a really great baked apple. She thinks it would have been better if I'd used some big round Macintosh apples, but I used what I had on hand. She tells me her baked apples are way better than mine, but we've been together for more than a decade and not once has she served me a baked apple. So I don't argue about it, but if I want a baked apple, I guess, I'll just have to make it myself. On a cool night, it's actually nice to have apples baking in the oven making the kitchen warm and adding a delightful scent to the house. I wonder when I'll get around to doing that again?rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-76942877492705794972014-09-27T18:53:00.002-07:002020-06-06T18:40:41.057-07:00Actual code - C vs. Python for a small problemIf you aren't much interested in writing software, this post is probably not for you. If you read the post without following the links to the example implementations, then I'm not sure what you are doing here, though you are certainly welcome to ask questions.
<P><BR>
Recently on <a href="http://www.quora.com/How-we-make-a-program-in-C-language-to-make-the-first-20-prime-number-digits">Quora.com</a> someone asked to see C code to find the first 20 prime numbers. Seemed like an easy enough question,
but the first guy who answered it, gave a C++-based pseudocode and some tips on how to convert that to C. That answer didn't make me happy. Heck, I figure if you're going to write in some other language, why not Python as a sort of testable pseudocode, but the question really needs that answer to then be re-stated in C.
<P><BR>
So I sat down and banged out a Python program to find and print the first 20 prime numbers. That code is here: <a href="http://pastebin.com/DHQtzN0s">find20primes.py</a>
<P><BR>
I used a list to hold the list of primes. When the list grows to 20 items, I'm done. I start the list by telling it 2 is a prime number. I then only consider odd numbers as additional candidates. If the candidate is divisible by any of the prime numbers we've found so far, it is not a prime number. If the candidate isn't divisible by any of the prime numbers we've found so far, then the candidate is a prime number so we add it to our list of primes and, in ether case, add 2 to the candidate number to get the next candidate number to be tested. In C, we'll need a little more book keeping for the list, but since the max size of the list is bounded (20 items), things should translate from Python to C pretty easily. One trick that isn't entirely obvious is the use I made of Python's <b>for...else</b> control structure to catch the case of the for loop not exiting via break. We can paper that over with a goto in C, or you can add some flags
<P><BR>
I was thinking that C has labeled <b>break</b> statements to let me do sort of the same thing as that <b>for...else</b>. But much to my chagrin, that's a feature of Java, not C. Oops. So, <b>goto</b> it is in my C translation of the program.
<P><BR>
So I sat down with that Python listing open in one window and typed up find20primes.c That code is here: <a href="http://pastebin.com/Ey11R7DS">find20primes.c</a>
<P><BR>
I believe it is a straight-forward translation of the Python program into C. Of course, the C program is bigger in the sense of it has more lines of code. There are lines added to delimit the blocks and loops in the program, and lines added for variable declarations and lines added for the annoying book-keeping that C needs me to do where Python just handles those chores. I did run into some trouble where I didn't get the book keeping entirely correct the first time through. The program outputted 20 primes, but it started with 2, followed by 73, followed by 3, and it left out 71 at the end of the list. Huh? Turned out I was mistakenly incrementing primecnt before I'd used it to fill in the next slot in the primes array, so I skipped the primes[1] slot and just got 73 there by bad luck. Python would have told me about an uninitialized variable if there'd been a spot in the Python program for me to have committed that same kind of error.
<P><BR>
Having finally gotten both programs working, conventional wisdom is that the C code should be much faster than the Python code.
So I used the "time" command to see how the timings compare.
<P><BR>
Using cygwin Python 2.7.8 on Windows 7 on a PC with an i5 processor and 8GB of RAM,
<P>
$ time python find20primes.py
<BR>
<PRE>
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
real 0m0.136s
user 0m0.000s
sys 0m0.062s
</PRE>
<P>
Using cygwin cc 4.8.3 on that same Windows 7 PC:
<P>
<PRE>
$ time cc find20primes.c
real 0m0.238s
user 0m0.045s
sys 0m0.185s
$ time ./a.exe
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
real 0m0.064s
user 0m0.015s
sys 0m0.015s
</PRE>
<P>
The execution time for the compiled C program was way less than the total time for the Python run, but if you add in the compile time for the C program, Python comes out ahead. Your mileage may vary.
<P><BR>
By the way, if I throw in a -O option ("optimize the generated code") on the cc command, it further slows the compile down, while the run time is about the same.
<P><PRE>
$ time cc -O find20primes.c
real 0m0.336s
user 0m0.031s
sys 0m0.185s
$ time ./a.exe
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
real 0m0.086s
user 0m0.000s
sys 0m0.015s
</PRE>
<P><BR>
(the "real" elapsed time varies a lot from run to run. These run times are so short the variability makes it hard to make fair comparisons in races between the programs). I suspect that the real time is dominated by the console I/O to print the results, so optimizing the details of the loops isn't going to do much improving of things.
<P><BR>
Now to make things more interesting, suppose I wanted to pass in as a command line argument the number of primes to be found. So long as the primes are still in the range of <b>int</b>s that only needs a malloc of the array in C but if the program is ever asked to get up into really big primes, the Python code will keep on chugging while the C code will need substantial rework to pull in an arbitrary precision integer library module. This blog article is already long enough, so I'll leave that generalization to "findNprimes" up to you. How big does N have to be to break the C code's use of <b>int</b>s? I suppose that with relatively minor surgery, you could convert over to use of <b>long int</b>s (or if your compiler supports them, to <b>long long int</b>s) in the C program.
Looking into it lightly, it appears that the cc included with Cygwin supports <b>long long int</b>s. The format strings will need adjusting. Use <b>%lld</b> instead of <b>%d</b>.
<P><BR>
If you've feeling anxious to try further experiments, see how pypy does in handling the find20primes.py program. That'll probably be more interesting with findNprimes.py with a really big value for N.
<P><BR>
The moral to the story is that C may not be the best choice of programming language for this kind of problem.
<P><BR>
Did you enjoy this article or was it too technical? Please add a comment down below so I know what you think about this sort of writing.rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com3tag:blogger.com,1999:blog-6557104658390047492.post-16125445800690197512014-08-19T08:11:00.001-07:002020-09-22T17:20:41.267-07:00John Cotton Dana<P><BR>
I'm writing this on August 19, 2014. John Cotton Dana was born on August 19, 1856 in Woodstock, Vermont. I looked him up after I came across this snappy graphic on the Web:
<P><BR>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6AuCu0y1NK75RYT7COvvbcSguwwlY6MrwMjz06Jy3pt0bmusuU0ZbZe_uuYUc90YGAx4nRF8cZFj2S4k17JvBAeF_yon59vzqa9Y1aAuW5nHf9gO1ckxBr80ZUGyG178iHglXUHMntBA/s618/Screenshot+2020-09-22+200851.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="320" data-original-height="304" data-original-width="618" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6AuCu0y1NK75RYT7COvvbcSguwwlY6MrwMjz06Jy3pt0bmusuU0ZbZe_uuYUc90YGAx4nRF8cZFj2S4k17JvBAeF_yon59vzqa9Y1aAuW5nHf9gO1ckxBr80ZUGyG178iHglXUHMntBA/s320/Screenshot+2020-09-22+200851.png"/></a></div>
<P><BR>
I was surprised to learn the extent that he had influenced my life.
<P>
<a href="http://en.wikipedia.org/wiki/John_Cotton_Dana">http://en.wikipedia.org/wiki/John_Cotton_Dana</a>
<P>
Wikipedia says he died in New Jersey on July 21, 1929. I did find <a href="http://www.findagrave.com/cgi-bin/fg.cgi?page=gr&GRid=59877745">another web page</a> that says he died in Manhattan, not New Jersey, so once again we see that Wikipedia is not a definitive source, even if it is darn informative.
<P><BR>
So how did this long dead person influence me? Well, for starters, in 1909, he founded the Newark Museum. I grew up in Union, NJ, about 9 miles by car from Newark Museum. My Mom would take me there for an easy day trip when we had nothing specific to do. I particularly enjoyed the science and technology exhibit of simple machines. I haven't been there in many years now and surely there has been turn-over of the exhibits, if nothing else, to make up for mechanical wear and tear.
<P><BR>
Besides founding that museum, John Cotton Dana also was a librarian. I think my favorite line from the Wikipedia article was this:
<BLOCKQUOTE>
He would have found a library school curriculum intolerable, and doubtless a library school would have found him intolerable.
</BLOCKQUOTE>
<P><BR>
Before John Cotton Dana, libraries tended to have closed stacks. A librarian would go fetch the book that you wanted to look at. Dana pioneered the radical concept of open stacks. The main library of the Rutger's-Newark campus is named after him. I'll leave it to you to forage around the Internet or your favorite local library to learn more about this man. Hey! At least read through the Wikipedia article, please.
<P><BR>
Not all of his point of view would be accepted today. For example, Wikipedia says that he organized the first ever children's library room, but he believed its proper role was to help provide material to teachers. He was opposed to "story-time" at the library.
<P><BR>
If you have kids, remember John Cotton Dana today by taking them to your local children's library, where I wager, you will find open stacks for easy browsing of the book collection. Even if you don't have kids, today would be a good day to make sure you know where your library card is. (You do have a library card for your local public library, don't you?) Make sure your card is up to date. If not, renew it, and use it.
<P><BR>
Speaking of children's libraries, here in Westbury, NY, the founding of the local children's library pre-dates the establishment of the local public library for adults. The 2 only joined together since 1965. <a href="http://www.westburylibrary.org/children%E2%80%99s-history">History of Westbury Children's Library</a>
<P><BR>
<FONT SIZE="1">
Revised 08/19/2014 to correct a wretched typo: Dana was born in 1856, not 1956!
<P><BR>
Revised 09/22/2020 to put the missing graphic back into the page.
</FONT>rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-38741892659553063422014-08-13T11:48:00.000-07:002015-01-23T22:48:21.603-08:00Getting more familiar with Python Classes and Objects.<P><BR>
If you've been following this blog, you're aware that I feel unprepared to make good use of the Object Oriented Programming facilities of the Python programming language. Python is kind enough to allow programming in non-OOP styles, but Python's OOP features keep glaring at me, reminding me of what I don't comfortably know.
<P><BR>
I posted a question on Quora.com asking for real world examples of multiple inheritance being used in Python programs. I was disappointed about how few answers came back. That dearth of response left me with the suspicion that I'm not the only person around who isn't completely comfortable with multiple inheritance. <a href="http://www.quora.com/What-is-a-real-world-example-of-the-use-of-multiple-inheritance-in-Python">http://www.quora.com/What-is-a-real-world-example-of-the-use-of-multiple-inheritance-in-Python</a>. Looking around at other multiple inheritance questions on Quora (<a href="http://www.quora.com/Why-is-there-multiple-inheritance-in-C++-but-not-in-Java">http://www.quora.com/Why-is-there-multiple-inheritance-in-C++-but-not-in-Java</a>), I see some reason to suspect that super serious application of OOP is just going to need more time to sink into the heads of the majority of developers. So, I'll continue to watch and learn, but will try to remember to adhere to the <a href="http://en.wikipedia.org/wiki/KISS_principle">KISS principle</a> to the greatest extent possible.
<P><BR>
<H4>Additional Lessons</H4>
<P><BR>
<OL>
<LI>
This 40 minute video from Ray Hettinger (<a href="https://www.youtube.com/watch?v=miGolgp9xq8">The Art of Subclassing</a>) explains how Python classes differ from classes in other languages. Ray tries to reshape people's thinking here, so if you aren't already deeply steeped in OOP lore, you may feel he's dwelling on the obvious. He may give you some ideas of appropriate uses of inheritance in Python objects.
<P><BR>
<LI>
Ray mentions this 2nd talk in his video. This 2nd talk was the next talk after his at Pycon 2012. "<a href="http://pyvideo.org/video/880/stop-writing-classes">Stop Writing Classes</a>", Jack Diederich, 28 minutes. Basically, that video asserts that my own example so far of writing a class for a Python program is not very good. The clue: My example class had only __init__ and one other method. I could have written it as a simple function and used the partial function from the library <a href="https://docs.python.org/2/library/functools.html#functools.partial">functools</a> module to handle the initialization.
</OL>
<P><BR>
<H4>Further Reading</H4>
<P><BR>
I have 3 previous blog articles on OOP in Python.
<P><BR>
In <a href="http://rdrewd.blogspot.com/2013/03/creeping-up-on-oop-in-python-part-1.html">Creeping up on OOP in Python - Part 1</a> I described a use of an object-oriented library module, pyparsing, to solve a Project Euler problem.
<P><BR>
In <a href="http://rdrewd.blogspot.com/2013/04/creeping-up-on-oop-in-python-part-2.html">Creeping up on OOP in Python - Part 2</a> I reworked my solution to add a simple class of my own. I was happy that introducing that class made the code cleaner to read. But if you watched the "Stop Writing Classes" video given up above in this blog article, you'll probably notice that my class is an example of exactly what they say you shouldn't do.What can I say? I'm still learning this stuff.
<P><BR>
The 3rd in my Creeping up on OOP in Python" series was a bit different from the first 2. It explored an academic question about multiple inheritance. It is exactly the kind of A, B, C example that Ray mentions avoiding in his talk. <a href="http://rdrewd.blogspot.com/2013/04/creeping-up-on-oop-in-python-part-3.html">Creeping up on OOP in Python - Part 3</a>. I haven't forgotten my promise of a Part 4 as soon as I have a practical example of multiple inheritance to substitute for A, B, C and D in that academic question. But so far, there is no Part 4.
<P><BR>
Ray mentions "the gang of 4". If you aren't familiar with them, here's a reference for you to pursue: <a href="http://en.wikipedia.org/wiki/Design_Patterns">http://en.wikipedia.org/wiki/Design_Patterns</a>. And he mentions "Uncle Bob". I also mentioned Uncle Bob, with some links here: <a href="http://rdrewd.blogspot.com/2013/09/solid-software-design.html">SOLID software design</a>.
<P><BR>
Know more about this OOP stuff then I do? Well, don't keep the info to yourself. Please post a comment with a link or example to help me learn more. Have you found a particularly relevant MOOC that you'd suggest?rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-32596442678806694372014-08-08T22:49:00.001-07:002014-12-08T11:30:29.885-08:00TED Talk for Mature Audiences - Dismal Science, Disappointing Careers<P><BR>
For many years now, Economics has been known as the "<a href="http://en.wikipedia.org/wiki/The_dismal_science">dismal science</a>". So, who better than a (Canadian) economist to deliver a 15 minute TED talk on <font size="3">"<a href="http://www.ted.com/talks/larry_smith_why_you_will_fail_to_have_a_great_career#">Why You Will Fail to Have a Great Career</a>"</font>. TED talks, in general, are upbeat talks and this one, despite it having a somewhat cynical tone to it, really does have an upbeat message in there. I do worry in pointing out the talk that it requires a certain amount of maturity to hear the real message. The message an immature audience just might receive from this talk could be extremely negative. You've been warned! So, if you think you have the maturity to find the constructive up-lifting message in his talk, give a listen to Larry Smith of U. of Waterloo on why you will fail to have a great career.
<P><BR>
The talk mentions the <a href="https://www.youtube.com/watch?v=VHWUCX6osgM">2005 Stanford Commencement Address</a> by the late Steve Jobs. If you haven't given that one a listen, I urge you to spend the 22 minutes that it'll take to play that one for yourself too.
<P><BR>
you don't have to agree with the speakers in these video talks. If you have an opinion on what you've heard here, you're invited to leave a comment down below. I'm looking forward to hearing from you. And, of course, if you know someone who might benefit from giving a listen to either or both of these videos, please pass along the link to this blog article.rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-26712963132905906602014-08-02T17:25:00.000-07:002017-03-12T21:11:17.436-07:00Python and Parallel Processing<div class="separator" style="clear: both; text-align: center;"><a href="https://www.ibm.com/support/knowledgecenter/en/SSEPGG_9.5.0/com.ibm.db2.luw.admin.partition.doc/doc/00000194.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://www.ibm.com/support/knowledgecenter/en/SSEPGG_9.5.0/com.ibm.db2.luw.admin.partition.doc/doc/00000194.gif" /></a></div>
(Image taken from <a href="http://www.ibm.com/support/knowledgecenter/SSEPGG_9.5.0/com.ibm.db2.luw.admin.partition.doc/doc/c0004569.html">http://www.ibm.com/support/knowledgecenter/SSEPGG_9.5.0/com.ibm.db2.luw.admin.partition.doc/doc/c0004569.html</a> without explicit permission, but with acknowledgement of the source of the work).
<P><BR>
I've written about Parallel Processing here before. e.g. See "<a href="http://rdrewd.blogspot.com/2013/08/whats-fuss-about-parallel-programming.html">What's the fuss about Parallel Processing?</a>". I've been worried by my reading that seems to predict that imperative languages such as Python will never be able to safely cope with massively multi-processor architectures in the future. The "<a href="https://www.fpcomplete.com/blog/2012/04/the-downfall-of-imperative-programming">Downfall of Imperative Programming Languages</a>" basically says that functional programming languages (such as Haskell and Erlang) are going to be the way of the future. I've been trying to get my head wrapped around Haskell, but so far without much success. So I was happy to hear a clear call from the Python camp that "I'm not dead yet!".
<P><BR>
The article that gives me new hope is "<a href="https://medium.com/@thechriskiehl/parallelism-in-one-line-40e9b2b36148">Parallelism in One Line</a>" the gist of which is that "Sure you can use the threading library to manage pools of threads (or of processes), but that takes a lot of lines of code and is very error prone, but there's another way to do it." The other way to do it is to use a parallel version of the map function. I, for one, didn't know that there's more than one version of "map" available in the Python library.
<P><BR>
If you do a Google search for:
<P>
Python map
<P>
you will readily find documentation for Python's standard (iterative) map routine. e.g. "<a href="https://docs.python.org/2/library/functions.html#map">Python 2.7.8 builtin functions documentation - map</a>".
<P><BR>
If you readily want to find documentation of the parallel version of map that the Parallelism in One Line article talks about, you need to modify your Google search to:
<P>
Python map multithreaded
<P>
which will take you to a subset of the first search. I was amused to find among the search results a 2010 <a href="http://code.activestate.com/recipes/577360-a-multithreaded-concurrent-version-of-map/">ActiveState Recipe for building your own "concurrent map" function</a>, which drew a comment from one reader asking why not just use "multiprocessing Pool.map". The recipe's author admitted not knowing about that one.
<P><BR>
From that 2nd search I found "<a href="https://docs.python.org/2/library/multiprocessing.html">Multiprocessing - process based threading documentation</a>". It does worry me that the documentation seems to have more complexity and gotchas than the Parallelism in One line article owed up to. Arguably I shouldn't be blogging about this at all until I've actually given it a try myself (but I still don't have a multi-core processor here at home).
<H4>It's a trick?</H4>
<P><BR>
If you've been reading this carefully, you might rightfully object that it's all a bit of a trick. The map function is an element lifted from the world of functional programming and then provided in Python. The parallel version is only safe in Python if the function that you are mapping is "pure". If the function code has side-effects, then you will have race conditions and potentially suffer horribly at the hands of multi-cores. The language isn't going to inherently protect you so you have to be careful out there.
<P><BR>
If you want to read more about the challenges of Python vs. multi-core architectures, see "<a href="http://www.jeffknupp.com/blog/2013/06/30/pythons-hardest-problem-revisited/">Python's Hardest Problem, Revisited</a>", by Jeff Knupp. The piece parts to roll your own multi-processes or multi-threaded Python program remain available, but be sure you have plenty of iodine and bandages on hand if you cavalierly venture into the world of multi-cores in a language that makes no promises of (much) concurrent processing safety. Design your code carefully and watch out!rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-55516856715264920692014-07-23T14:05:00.000-07:002014-12-08T11:30:29.901-08:00Danger Lurking in the Plastic Packaging of our Food?I stumbled across this article from a web site unfamiliar to me:
<P>
<a href="http://www.care2.com/causes/if-plastic-bags-are-causing-infertility-in-pigs-what-are-they-doing-to-us.html">http://www.care2.com/causes/if-plastic-bags-are-causing-infertility-in-pigs-what-are-they-doing-to-us.html</a>
<P>
Worrisome, but I didnt want to sound the alarm without checking into it further.
So I did some Google searching looking for the same warning from some other source. Found it from National Geographic and that's good enough for me to consider the story to be confirmed.
<P>
<a href="http://news.nationalgeographic.com/news/2014/06/140605-pigs-plastic-sperm-endocrine-disruptor-infertility-science/">http://news.nationalgeographic.com/news/2014/06/140605-pigs-plastic-sperm-endocrine-disruptor-infertility-science/</a>
<P>
The troublesome chemical showed up in plastic bags imported from China, but not in bags of local (Spain) manufacture? I wish I had more confidence that the matter would be properly handled and fixed by China. But I've not seen any tendency toward openness in China.
<P>
In case you need more to worry about, here's a 17 minute TED talk on some common pesticides in our environment. You say you aren't worried about frogs? Well, you probably should be.
<P>
<a href="https://www.youtube.com/watch?feature=player_embedded&v=X9NFPZGyDPg">https://www.youtube.com/watch?feature=player_embedded&v=X9NFPZGyDPg</a>
<P>
What should you and I do about these problems? Alas, I haven't a clue about what to do. A sternly worded letter to your congress-person (who likely is heavily under the influence of some big agricultural chemical company) would be a beginning, but I've not got much more respect left for our government than I have for that of China.
<P>
Am I the only one who has noticed that the food labels track most bad things in milli-grams (mg) but trans-fats on the label are tracked in grams (g)? In case you don't remember, 1 g = 1000 mg. Anything under 500mg of trans-fat in a "serving" is loudly touted as zero grams of trans-fat per serving by the power of rounding down to the nearest whole number of grams. And there are some pretty funny notions of "servings" to be found on those labels. Muffins from my local super-market come in packs of 4 muffins, zero grams of transfat per serving, but a serving is 1/3 of a muffin. Makes me wonder if 1/2 a muffin has enough trans-fat in it that they'd have to round it up to 1g on the label.
<P>
Dietary guidelines for trans-fat is to keep the amount that you eat each day as low as possible. Heck, even the guidelines for sodium allow 1500 mg/day of sodium as a recommended daily allowance and 300mg/day of cholesterol. (Speaking of which, have you looked at the nutrition facts for a <a href="http://www.mcdonalds.com/us/en/food/product_nutrition.breakfast.266.sausage-biscuit-with-egg-regular-size-biscuit.html">McDonalds egg and sausage biscuit</a>? 1170 mg of sodium in one. 250 mg of cholesterol in one. But if you are hungry, one of those isn't much of a breakfast. Advice: don't make a habit of McDonald's for breakfast.
<P>
<a href="http://www.cdc.gov/nutrition/everyone/basics/fat/transfat.html">http://www.cdc.gov/nutrition/everyone/basics/fat/transfat.html</a>
<P>
Now if our government really had our best interest in mind, wouldn't it push the food company's to report tran-fats in mg (like they do for cholesterol and sodium)? But does that happen? No. Obviously way too controversial a matter? Right up there with identifying which products contain GMO corn.
<P>
Sigh.rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-64151955409124526042014-07-06T12:22:00.000-07:002014-12-08T11:30:29.905-08:00The Curious Tale of EpigeneticsMy blog article today is a bit off of the beaten path for me.
<P><BR>
Instead of looking at a software topic, today's blog article topic is more biological: epigenetics.<div class="separator" style="clear: both; text-align: center;"><a href="http://cdn.thumbr.io/77e6f734a874d8b98535c83f92ba0195/KhPZbWboUluRxv8PG87L/i.istockimg.com/file_thumbview_approve/1054271/3/stock-illustration-1054271-genetic-code-fight.jpg/100/thumb.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://cdn.thumbr.io/77e6f734a874d8b98535c83f92ba0195/KhPZbWboUluRxv8PG87L/i.istockimg.com/file_thumbview_approve/1054271/3/stock-illustration-1054271-genetic-code-fight.jpg/100/thumb.jpg" /><BR>Image from Freepik.com</a></div>
<P><BR>
I'll confess up front that I'm not a biologist and never took a genetics course in my life.
Close as I got to such a course was I had friends in college who took the genetics course and they sweated through worrying about the progress of their cohort of cross-bred fruit flies.
And I did work my way through Prof Keeton's Biology 101 course and its Biology 102 sequel.
And when my wife was pregnant, when the pregnancy had gotten far enough along we had a sonogram and amniocentesis to make sure all was as well as could be gauged at that time. That's the full extent of my background in genetics. If I'd actually studied the topic in further depth, I suspect I'd now be having one of those "<a href="https://www.youtube.com/watch?v=KThlYHfIVa8">Everything You Know is Wrong</a>" moments.
<P><BR>
This article that I read this week is what brings all this up:
<P>
<a href="http://discovermagazine.com/2013/may/13-grandmas-experiences-leave-epigenetic-mark-on-your-genes#.UdhITW2V8s2">Grandma's Experiences Leave a Mark on Your Genes</a> (May 2013, but talking about a discovery that dates back to a couple of guys having beers in a bar in 1992).
<P><BR>
I think my favorite part of the article is on page 3, after the researchers had made their outlandish sounding hypothesis and carefully ran 3 different experiments to confirm that they were right and wrote the results up in a paper only to have the paper rejected:
<P><BR>
<BLOCKQUOTE><FONT SIZE="3">
Despite such seemingly overwhelming evidence, when the pair wrote it all up in a paper, one of the reviewers at a top science journal refused to believe it, stating he had never before seen evidence that a mother’s behavior could cause epigenetic change.
<BR>
<P><BR>
<P>
“Of course he hadn’t,” Szyf says. “We wouldn’t have bothered to report the study if it had already been proved.”</FONT>
</BLOCKQUOTE>
<P><BR>
But there's a happy ending. The paper was published in the June 2004 issue of Nature Neuroscience and here, just about 10 years later, the news has actually caught my attention. Maybe next blog article I'll talk about a Princeton physicist who suggests that E=MC<sup>2</sup>. :-)
<P><BR>
The one thing that bothers me in the linked article about epigenetics is I see nothing that discusses the effects of the mother's contribution to the genes vs. the father's contribution to the genes. Presumably the methyl groups from Mom are not in the exact same places as the ones from Dad. How do the resulting gene pairs interact? Maybe if I dug enough to find the answer to that, I'd lose my amateur standing or something.
<P><BR>
And not to be facetious, but remembering the lab struggles of my friends taking that genetics course back in college, I do wonder if epigenetic effects can be demonstrated with fruit flies or something else with a life-cycle that fits within the time constraints of an undergraduate semester. The answer perhaps lies in looking for failed experiments where the dominant gene got trumped by a gene that was supposed to be recessive. I'm pretty sure that not every undergrad experiment produced the expected results. Quoting Issac Asimov: "The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'". There'd be a certain amount of fun in being able to say "I failed the lab part of the course, but got the results published in Nature".
<P><BR>
If you found this article to be as eye-opening as I did, and you know someone else who might enjoy it too, please pass along to them the link to this blog article. And, of course, if you know something about this topic, feel free to add a comment to further my education.rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-27475680613118338852014-06-27T21:38:00.000-07:002020-03-09T00:44:38.936-07:00Home Networking with FIOS - Don't cross the streams.As you may remember from my article <a href="http://rdrewd.blogspot.com/2014/01/adventures-in-home-networking.html">Adventures in Home Networking</a>, we very badly wanted to get out of using Cablevision. They'd agreed to a price to provide service to our home, but then consistently billed for significantly more per month then the agreed-to price. We got the NY Public Service Commisssion involved, but every month's bill turned into a new argument with Cablevision with the PSC insisting that they accept the payment of the agreed-to amount. Cablevision would accept the payment and leave the service connected, but rebilled the unpaid difference the next month as an amount past due. There were some months they'd insist they hadn't received the payment and we'd have to get a 3-way call between the bank, Cablevision and the PSC to establish that Cablevision indeed had collected the previous month's money from the account and then mis-placed it.
<P><BREAK>
We got tired of that monthly argument, and looked for alternatives. The hard part was finding Internet service. Given Internet, it is easy to get phone service (e.g. Vonage or MagicJack), and there are non-cable alternatives to television service (e.g. DIRECT-TV and Dish satellite service). We had tried Hughes Satellite Data service as an Intenet Service Provider, but found it to be expensive (limited data transfer allowed per month), high latency and noticeably prone to dropping packets. We concluded that Hughes would not be a good substitute as an Internet Service Provider for our home. As I described in that January, 2014 article, we also worked out how to put our home on AT&T's Mifi service (cellular LTE data service). The problem we had with it was again limited data transfer allowed per month, $10/GB for overages. It was fast enough, and seems reliable enough, but at $52/month base, is somewhat expensive. It also had the irresistible temptation to take the access point along when traveling out of the house, but that would leave the house without service while the Mifi was on the road. In the end, we kept the Mifi box and grudgingly pay the $52/month just for the convenience of having Internet access while away from the house. (Well, the other rationalization of the $52/month is that it ensures that I have Internet service even if my home's ISP is out of commission. It's not just that I'm addicted to blogging. I use the Internet for work too). Cablevision, of course, sings a song about having Wifi hot spots in many places. But our experience with those is that often the signal is too weak to be usable. e.g. there is no Cablevision Wifi at our house. If I go down the block, there is Cablevision Wifi in the nearby park. At our local supermarket, there is a signal if you walk out to the sidewalk near the street, but inside the store you are out of reach. Similarly, at some of my doctor's offices, there is a signal out at the street, but inside at the reception desk, the signal isn't strong enough to be reliable. The Mifi box is more secure (uses your own WEP password for encrypted Wifi) then Cablevision's unencrypted Wifi and AT&T Mifi seems to work well even inside low-rise buildings such as are common here in the suburbs.
<P><BREAK>
So, after running out of alternatives, we decided that we'd drop Cablevision and go with Verizon FIOS even though it wasn't going to save us any money. The one advantage seems to be that FIOS includes Jimmy Swaggart's Son Life Network which my wife enjoys. If you want to hear a disgraced minister sing hymns, maybe you'll like it too. It's probably easier to enjoy if you simply reject those repeated charges of cavorting with prostitutes as "obviously" false (<a href="http://www.people.com/people/archive/article/0,,20098413,00.html">New Orleans</a> and <a href="http://rationalwiki.org/wiki/Jimmy_Swaggart">Los Angeles</a>).
If I was providing a sound track to go with this paragraph, I think I'd opt for the Beach Boys "<a href="https://www.youtube.com/watch?v=MbXWrmQW-OE">California Girls</a>". I'm just not creative enough to produce a mix of that and some suitably religious ditty. Not that it is in any way a religious ditty, but how come it seems so rare that the radio ever pairs up California Girls with "<a href="https://www.youtube.com/watch?v=kHD5nd3QLTg">Back in the USSR</a>"?
<P><BREAK>
It probably helped minimize any shock from the bill that the price negotiation with FIOS was done by me, not my wife, so we came away with more realistic expectations of what the bill was really going to be. Verizon loves to tack unpleasant surprises onto the bill. e.g. unless you ask, the prices they quote don't include things like $27.98 "Taxes, Governmental Surcharges and Fees" and $25.55 "Verizon Surcharges and Other Charges", but the bill includes those. The first 3 months of service also carry an extra $49.99/month "Activation Fee". There were still surprises to be found by careful inspection of the bill. My wife is flummoxed by the notion of keeping an address book organized by name so you can find people's contact information. Her habit is to write the info on scrap paper, which she then loses, so she repeatedly calls 411 to get the number again. In one month that was 30 calls to 411 at $2.49/call. I keep pleading with her to learn how to use Google, but that just turns into my having to do it for her and getting peeved when I recognize that I'm looking up the same information as I'd given to her before. I wrote some of the contacts into a bright orange address book and she acts surprised every time I show her that she already had the information there.
<H4>Video problems with FIOS</H4>
The other bad surprise, in our 2nd month bill, was $156.03 for a service call we'd placed with Verizon. Multi-room DVR playback to rooms remote from the actual DVR was unreliable. They sent a guy out to trouble shoot the problem, but he didn't fix it and he didn't write it up as a Verizon problem, so they billed us for an hour of labor. I protested and they did deduct the labor and the tax on the labor from that month's bill.
We found more ways to demonstrate the video problem and called for yet another repair visit. The 2nd repair guy was unable to fix the problem too, but we learned a little from chatting with the guy while he was here. In the world of Cablevision, so far as I can discern, data service and television service are quite separate, sharing the same physical cable but traveling in separate channels. But with FIOS, each television set-top box gets an IP address. Some television services depend on being able to talk via the Internet router to get video to the set top boxes. Remarkably, the Verizon service folks don't have any kind of protocol analyzer or even a simple bit-error-rate monitor to give them visibility into what is doing on the home network.
<P><BREAK>
The first repairman's visit wasn't without value. He noticed that our HP printer was assigned IP address 192.168.1.100. This had been our household's long standing convention, so any PC could know how to reach the printer without needing DNS or something complicated to find it. But 192.168.1.100 thru 192.168.1.150 are "reserved" by Verizon for use by their set-top boxes. Oops. So I reassigned the printer to be 192.168.1.99 and adjusted the configurations of each of our PC's accordingly.
This did make access to the printer more dependable, without having to fuss with power cycling it after a period of disuse, which had been the state of things since we switched to FIOS. But it didn't get rid of the problem with multi-room DVR playback. We'd also found that the FIOS video tutorials, which are short video-on-demand clips from some central server of theirs also had similar problems of occasional stalls and pixelization in playback. The 2nd repairman saw the problem happening and after examining the router configuration opined that we just had too many devices on our home network for the level of service we'd subscribed to. (Our service is their 50/25 speed. For more money, we can have more bandwidth, but since I'd seen the whole house [excluding FIOS video, of course] doing fine with LTE cellular data service via AT&T Mifi, I didn't think that was a good explanation of what was wrong). To the fellow's credit, he did take the time to disconnect portions of our home network from the router until the problem went away. At that point I had to accept that the problem somehow lay with our home network, though further trial and error would be needed to find the real problem.
<P><BREAK>
So, at this point we had as our only instrumentation, that when the problem wasn't present, we could watch Verizon FIOS training videos without a problem, and that when the problem was present, that a few minutes of playing the training video would result in pixelization and stalled playback. I set about through trial and error to find which of the wires he disconnected mattered.
My first suspect was the long cat-5 cable to the router in the garage apartment. The dog had occasionally chewed on that cable and we'd taped it up and it seemed to work well enough, but I certainly wasn't prepared to swear the cable still met all <a href="http://en.wikipedia.org/wiki/Category_5_cable">cat-5 specifications</a>. I plugged it back in to the FIOS router and the picture stayed clear, so it wasn't that cable. Only other cat-5 cable I knew about was one that runs through the attic to get to the rear bedroom where the printer resides. Puzzler was that while doing my wall crawl to reconnect things, I found 2 cables running up to the attic. What was the additional cable? Took some more crawling in the rear bedroom to figure it out. Turns out we had 2 cat-5 cables running from the front bedroom to the rear bedroom. Once upon a time, one was for the PC in the rear bedroom and the other was for the printer, but now the PC and the printer are connected to an inexpensive 100-base-T switch so the 2nd cat-5 cable to the room is unneeded. Mistakenly, both cables were plugged into the Verizon router in the front bedroom, and both were plugged into the switch in the rear bedroom. That's just plain wrong. I don't think it ever bothered the Linksys router that used to be in the front bedroom, but the FIOS router showed video playback problems unless you disconnected the erroneous 2nd cable from the router to that 100-base-T switch. Oops. Mixing video playback in with the mostly non-realtime Internet data traffic apparently got fouled up by the wiring mistake. What a pity that Verizon didn't have appropriate tools for their field support people to really find this problem. Anyhow, now that the extra wire is disconnected, things have been much better with the multi-room DVR.
<H4>More FIOS Woes - You Own the House Wiring</H4>
But we did have other FIOS problems. Cablevision ran a coax cable to a "cable modem" in the front bedroom. There were 2 phone jacks on the cable modem that provided our house phone line and our fax phone line. FIOS doesn't work that way. FIOS mounted a big white box on the outside of the house and ran the fiber to that box. They also installed a large UPS on the wall inside the house and ran power from the UPS to the white box on the outside wall. They then re-used Cablevision's coax cables to connect a coax cable from the FIOS box to the various TV's via a splitter box on the outside wall just below the FIOS box. There is no "cable modem" box as we had with Cablevision, but the Verizon Internet router has a coax connection of its own that it uses to talk to the FIOS network, including the settop boxes. The outside FIOS box also has about 8 phone jacks in it. So, Verizon ran 2 phone lines from those jacks to ancient NY Telephone demarc boxes on the outside wall, to tie the 2 phone lines to the ancient inside house wiring. The deal as I understood it was that as long as Verizon provided dial tone at the <a href="http://www.metrolinedirect.com/what-is-the-demarcation-point.html?gclid=CNyo_ZbDm78CFc9j7AodmRoAOQ">demarcation box</a>, that any remaining phone problem was a "house wiring" problem and is only covered by Verizon if you pay them a ridiculous monthly surcharge.
<P><BREAK>
After a particularly rainy Spring night here, the Fax machine lost it's dial tone. I know I had a corded phone around the house, but darn if I could find it. So we traipsed off to Walmart where for $6 I bought a nearly feature-less corded phone. It looks sort of like an old <a href="http://www.oldphoneworks.com/images/P/ZJ1DNRS4MLF8K96.JPG">Trimline phone</a>, but I found the base is just a place to set down the handset. The wire from the walljack runs straight through the base and into the handset. The touchtone keypad, ringer, etc. are all in the handset.
<P><BREAK>
Armed with my corded phone, I could verify that things were funky at the demarc boxes. For starters, the boxes weren't labeled with current phone numbers, but worse, the installer had hacked around some problem in at least one box so the modular jack for test access wasn't working at all. So we arranged for a service visit for the coming Monday for Verizon to look at lack of a dial tone on our 2nd line.
<H4>More FIOS Woes - the Fragility of the Fiber from the Pole to the House</H4>
But Friday, before we ever got to that Monday service visit, something happened to our FIOS service. We lost everything - TV, phone and Internet. Verizon, contacted via cell phone, agreed to send a repair guy out on Saturday. The FIOS box has an LED in it to tell the repairman if the fiber is delivering a signal to the FIOS box. It immediately told the repairman that there was no signal. Alas, he arrived on a truck with ladders, but the fiber drop cable to our house is connected to the distribution fiber mid-span, between 2 telephone poles, so the junction is only accessible with a "cherry picker" truck.<a href="https://media.gettyimages.com/photos/white-bucket-truck-picture-id172676658?s=2048x2048" imageanchor="1" ><img border="0" src="https://media.gettyimages.com/photos/white-bucket-truck-picture-id172676658?s=2048x2048" width="200" height="114" data-original-width="800" data-original-height="454" /></a>
<P><BREAK>
From the ground, something looked dangly at that junction, but nothing was actually laying on the ground. So we waited for them to dispatch a cherry picker truck with a buddy of the repairman's to help him. Once that arrived, they determined that something had severed the junction from the distribution fiber to the drop fiber. So they had to replace the drop fiber. This was surprising to me as this is now my 4th drop fiber in the short times I've had FIOS service. The first drop fiber was installed much like this one, but drooped a little low over the street. One day a large cement mixer truck drove down our street and managed to knock down our fiber and the one to the house next door too. So Verizon sent a repair crew to replace the fibers to our homes. They sent 2 trucks, one for each house, but they decided to work together. The lady with the ladders worked the house end of the job and the guy with the cherry picker truck worked out by the poles on the street. I was impressed with the result. At the house, the fiber came off a board sticking up from the peak of the house's roof. It then flew super high across the street direct to the pole at the corner. It was well clear of any trees and certainly too high to ever get struck by a passing truck on the street. Beautiful looking installation. Alas, it was no match to <a href="http://www.nytimes.com/interactive/2012/10/28/nyregion/hurricane-sandy.html?_r=0">Hurricane Sandy</a>. Fiber #2 ended up on my lawn after Sandy passed through. Annoyingly, Cablevision's coax to our home survived the storm just fine. Since we were off of FIOS by the time of Sandy, we only had Verizon out for a non-emergency clean-up call to get their fiber off of my lawn. Of course, when we resumed FIOS service this Spring, the installer had been told this was a simple re-connect of a previous customer. Lots more to the job than he'd expected. He installed drop-fiber #3. It ran from the board at the roof peak through the trees to the mid-span point where drop fiber #1 had been attached to the distribution plant. I think the board at the peak added enough height that #3 was going to be safe from passing trucks. But the community center opened up and installed a driveway under the distribution span. The guy who installed drop fiber #4, opined that maybe a school bus turning into the community center disturbed the distribution fiber enough to jostle our drop-cable into failing. He put in a request for the outside plant people to come around to raise the distribution cable a smidge where it crosses the driveway, but I didn't see them come to do that. We'll just have to wait and see how long drop fiber #4 lasts.
<P><BREAK>
The Internet tells me that I'm not the only FIOS customer having repeated service calls for fiber repair.<a href="http://www.networkworld.com/article/2367202/lan-wan/hungry-ants-knock-out-my-fios-service-again.html">Hungry Ants Knock Out FIOS Service ... Again</a>. I can only assume that these problems are evidence that fiber to the home is new technology and there will be some time before they gain enough experience to work out the Field Engineering kinks to make this reliable. The price of repeatedly replacing the drop cable presumably is enough motivation to encourage Verizon to eventually get it right.
The Mifi box and my cell phone at least make it tolerable when we have an occasional day of no FIOS service. Of course, there is the annoying whining sound of my wife complaining when she misses an episode of General Hospital, but so it goes.
<P><BREAK>
When the fiber connection to the outside FIOS box was restored, I asked the Saturday repairman to look at the problem of no dial tone to our Fax machine. He advised that the white FIOS box is now the point of demarcation. He verified that there was dial tone available on lines 1 & 2 at the FIOS box, but that means the crappy old NY Telephone demarc boxes are now part of the house wiring that is my responsibility.
<P><BREAK>
So I looked and found on the house a disused demarc box that then had a phone line running back to the rear bedroom. My wife reminded me that some years ago her Aunt Dolly had lived in that rear bedroom and had a phone line of her own. Aunt Dolly has long since moved out of here and is now deceased. We attended her funeral this Spring. So, I snipped the wire off the old NY Telephone demarc box and ran it into line #2 inside the FIOS box. I added a new modular jack to the spot where that line comes into the rear bedroom and then ran a phone cable from that modular jack to the Fax machine. Voila, the Fax machine has dial tone again and we're using less of the ancient house wiring then we'd been using before.
<H4>The future of FIOS??</H4>
There's some evidence that Verizon is unhappy with their return on investment in converting their distribution network from copper to fiber. e.g. <a href="http://online.wsj.com/news/articles/SB10001424052702303410404575151773432729614">Wall Street Journal: Verizon to End Rollout of FIOS</a> and <a href="http://www.dslreports.com/shownews/Verizon-Again-Confirms-No-Future-FiOS-Expansion-121365">DSL Reports: Verizon Again Confirms No Future FIOS Expansion</a>. Will the day come when they try to close down their fiber business? Seems unlikely to me, but we do live in "interesting" times.
<P><BREAK>
I've got to wonder where are the regulators in the process of Verizon making non-aggression pacts with the cable television companies. e.g. <a href="http://stopthecap.com/2011/12/28/verizons-anti-aggression-treaty-with-big-cable-may-be-the-end-of-fios/">Verizon’s Anti-Aggression Treaty With Big Cable May Be the End of FiOS</a>. I really think it is better for the economy when the cable companies have at least one competitor in every neighborhood, preferably one with a different technology and the fire in the belly to want to rewire the country to fiber. Verizon once upon a time had that fire, but now, like AT&T, seem to have lost their sense of direction.
Too bad!
<H4>Cross the Streams?</H4>
I keep forgetting that <a href="http://www.imdb.com/title/tt0087332/?ref_=nv_sr_5">Ghostbusters</a> was an increasingly long time ago (1984). When our FIOS video problems turned out to be from the mixing of Internet traffic and FIOS video packets, Egon's warning about the dangers of "crossing the streams" immediately sprung to my mind. If you haven't seen Ghostbusters recently, you really should rush out and rent it. But thanks to Youtube, we can give you the relevant clips from the movie. First, the scene where Egon warns "<a href="https://www.youtube.com/watch?v=jyaLZHiJJnE">Don't cross the streams!</a>" And, second, the climatic scene where the team makes a slight change of plan and <a href="https://www.youtube.com/watch?v=3OOF0FpKiYk">deliberately crosses the streams</a>. A bit of a spoiler, but you still really should see the whole movie.
<H4><a href="https://www.youtube.com/watch?v=MbXWrmQW-OE">Message In a Bottle</a></H4>
If you know someone who maybe knows someone in Verizon who'd be in a position to officially react to this note, please pass along the link to this article. I'd be delighted if my woes actually got to the ears of someone who could be properly embarrassed at the lack of network diagnostic equipment in the hands of the Verizon field support staff, or the need for improved field engineering of drop fiber installation and could maybe nudge Verizon in the direction of actually doing something about it.rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-47379543042272435382014-06-22T21:31:00.001-07:002014-12-08T11:30:29.897-08:00How Secure is Your part of the Internet?<P><BREAK>
Problems with Internet security have been much in the news lately as our homes have been getting more and more connected to the Internet with the growth of the <a href="http://en.wikipedia.org/wiki/Internet_of_Things">Internet of Things</a>. Please note that I'm one of those people who make a distinction between the terms <a href="http://en.wikipedia.org/wiki/Hacker_%28computer_security%29">hacker and cracker</a>.
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWDLh3xLge9KdQqI3yX03xKnKqwJb1qY-MAO5RFLKaHaexlI0m2rqizWpdQATJfFzgJp8YOucFL5VMr8BxBckGloVyqhFyQDIzUrBONb_So6eA_pbeFYEvEJB9UM33_bYQRE9InKIPnCA/s320/images+(4)aaa.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWDLh3xLge9KdQqI3yX03xKnKqwJb1qY-MAO5RFLKaHaexlI0m2rqizWpdQATJfFzgJp8YOucFL5VMr8BxBckGloVyqhFyQDIzUrBONb_So6eA_pbeFYEvEJB9UM33_bYQRE9InKIPnCA/s200/images+(4)aaa.jpg" /></a></div>
Image borrowed, without permission, from <a href="http://ariefuchulz.blogspot.com/2012/02/hacker-vs-cracker.html">http://ariefuchulz.blogspot.com/2012/02/hacker-vs-cracker.html</a>, apparently the blog of Arief ucHulz.
<P><N=BREAK>
A specific recent report that caught my eye:
<P>
<a href="http://readwrite.com/2014/04/30/connected-home-hackers-stop-yelling-at-babies-foscam#awesm=~oFgY3qatqGrnoh">Until We Fix Our Connected Homes, Crackers Will Keep Screaming At Babies</a>
<P><BREAK>
The simple conclusions offered by that article is that if your home is connected to the Internet, to be secure you should:
<OL>
<LI>
Take care to set secure passwords on all your devices. Leaving the manufacturer's defaults are just asking for intruders to come by.
<LI>
Register your devices with their manufacturer so the manufacturer can get in touch with you about security updates.
Unsaid is that such registration will open up your e-mail inbox to a likely flood of promotional e-mail (a.k.a. spam).
<LI>
Keep your device's firmware/software up to date. Unsaid is that not all devices can accommodate updates, and not all manufacturers put much effort into providing updates on old products. Maybe the manufacturer no longer makes that product. Maybe the manufacturer no longer supports that product. Maybe the manufacturer has gone out of business.
</OL>
<P><BREAK>
The article mentioned briefly that the homeowner had "secured" their home's router that connected their home devices to the Internet.
I wished that article had explored that statement in a little more depth. "Securing" a router is quite an essay topic in itself. If you have a router connecting your home to the Internet, please stop and consider how secure is it?
<OL>
<LI>
Have you set a secure password so only you have administrator access to your router?
<LI>
Assuming your router provides you with Wifi (wireless Internet connectivity), have you configured the router to have a serious, non-default password protecting your Wifi network from intruders? There's more than <a href="http://www.howtogeek.com/167783/htg-explains-the-difference-between-wep-wpa-and-wpa2-wireless-encryption-and-why-it-matters/">one choice available for Wifi Encryption</a>. Which Wifi encryption option have you picked? If you picked WEP, you'd be well-advised to switch to WPA2. There's freely available software that anyone with a notebook PC within range of your Wifi signal can run (e.g. <a href="http://paulalkema.com/post.cfm/automatically-crack-wifi-with-only-30-seconds">Automatically crack Wifi with only 30 seconds work</a>. I offer the link as an example, but haven't actually tried to follow that page's instructions myself). The software needs only to listen to your WEP-encrypted traffic for a short time and it will then reveal what the password is that your Wifi network is using. In other words, WEP encryption isn't at all secure if faced with anyone who wants to intrude on your wireless network.
<LI>
And now we get to the hard question: What is your router configured to do with incoming traffic from the Internet? If the router rejects all packets coming from the outside world, it isn't going to be much use. If you use your browser to visit a web page, you send out packets requesting the web page and web page's server sends back packets that tell your browser what the web page says. If you configured your router to reject those outside packets, you'd likely be most unhappy with your router's behavior.
<P>
Most routers will let you accept only traffic that comes in reply to packets that you sent out to the Internet and that covers most cases. But there are ugly cases where, for example, you initiate an FTP connection and the remote FTP server replies using a different port than the one that you used to initiate the connection. If your router is configured to reject packets that don't look like replies to traffic that you initiated, you're likely going to have trouble doing FTP file transfers.
<P>
A stickier problem is do you ever want to access your home Internet from elsewhere? For example, some folks have home security systems (or perhaps a baby monitor) and want to be able to check in on it from their travel PC while away from home. Almost certainly that requires the router to be configured to allow outside Internet traffic, traffic that isn't in reply to inside-traffic, to come into your home. How secure is your home network to outside traffic coming from a wannabe intruder?
</OL>
<P><BREAK>
You can try to secure your home, device by device.
<P><BREAK>
Consider, for example, the HP Inkjet printer in my home, an HP 7410 all-in-one printer/scanner/copier with built in Wifi capability. When we first set it up, we put it in a room that didn't have wired ethernet available so we configured it to use that built in wireless capability. Worked wonderfully. Then as I became aware of how easy it was to break WEP encryption, I decided to reconfigure our home router to use WPA2 encryption. Surprise! The HP 7410 printer's built in Wifi support only knew how to handle WEP, not WPA2. I looked into how to upgrade the firmware of the printer, but so far as I can see, the firmware of that printer is permanent, not updateable. Now, for all I know, I could go out and get a new printer that has WPA2 support, and probably has other advantages like, perhaps a faster printer speed and just maybe less expensive ink. (well, I can dream, can't I?). But this printer still works fine, so I'd feel guilty throwing it away just because it doesn't support secure Wifi.
So, instead, I grumbled and bought a long Cat-5 cable so I could have a wired ethernet connection from the router to the room with the printer. For less than $10 we also added a wired 8-port 100-base-T ethernet "switch" to that room so we could easily connect all the devices in that room to the wired network. I talked a bit more about my home network back in January. See: <a href="http://rdrewd.blogspot.com/search/label/mifi">Adventures in Home Networking</a>
<P><BREAK>
<a href="http://en.wikipedia.org/wiki/The_World_%28Internet_service_provider%29">Barry Shein</a>, one of the early pioneers of the Internet as we know it today, recently posted this note to Facebook:
<BLOCKQUOTE><FONT SIZE="2">
Internet security is so bad because it was never particularly designed to be secure.
<P>
I've been on the net since the 1970s, involved in its technology and politics. I don't remember anyone ever saying or promising "and it has to be secure, right?" until the 1990s.
<P>
What happened is in the 1990s a bunch of people figured out how to make A LOT OF MONEY off the net, or save a lot of money, same thing.
<P>
But most of their plans required the net to be secure.
<P>
So security became a BIG ISSUE. Ok.
<P>
It's like coming to a river in your car and thinking hmm, maybe I can just slap some wings on this thing and fly across.
<P>
The power of the net is that it enables everyone to share information very easily and very widely.
<P>
Now, re-read that sentence with security in mind.
</FONT>
</BLOCKQUOTE>
<P><BREAK>
If you aren't uncomfortable yet, I've got more for you to read.
Shortly before Barry posted that cautionary note on Facebook quoted up above, he posted on Facebook:
<BLOCKQUOTE><FONT SIZE="3">
If you try to engage me in a conversation about computer and network security and I don't know for a fact you're an expert I'm going to check whether you read this article. And if you haven't I will politely ice you out.
<P>
<a href="https://medium.com/message/81e5f33a24e1">Everything is Broken</a></FONT>
</BLOCKQUOTE>
<P><BREAK>
Now there are many different opinions as to what you should do.
I don't have the energy or time this morning to track down exact references for what <a href="http://www.huffingtonpost.com/2014/02/27/video-richard-stallman-di_n_4870119.html">Richard Stallman</a> suggests, but at the risk of mis-reporting what he has in mind, I'll tell you what I think he has said:
<OL>
<LI>
Don't trust software that you can't examine and modify on your own.
<LI>
Don't allow untrusted 3rd parties to have control of the software on your devices.
e.g. allowing auto-updates of your PC by Microsoft, Apple,Adobe, Oracle (Java) and Google (Chrome, Android)
is imprudent. Even if you trusted the software after careful evaluation of it yesterday, how do you even know what the software you are running today will do?
</OL>
<P><BREAK>
The trouble with "trust no one!" is that you are cutting yourself off from much of the world. And even if you insist on only running software where you can examine the source code, you likely are only fooling yourself. There's too much software in layers and layers for you to have any hope of being able to detect security problems. Security problems can be quite subtle and hard to recognize. Consider for example the recent brouhaha over the security of <a href="https://freedom-to-tinker.com/blog/kroll/software-transparency-debian-openssl-bug/">OpenSSL in its Debian implementation</a>. The source code was all open and freely available, but it took years for anyone to notice that a security bug had been introduced into the code. The xkcd comic had some good jibes at the security of other open-source systems: <a href="http://xkcd.com/424/">http://xkcd.com/424/</a>.
<P><BREAK>
I'll go so far as to suggest that if you refuse to allow auto-update of the software on your devices, you are doomed to never being able to keep anywhere close to current on the latest security updates. There are just too many of them and they come out too often to try to track them by hand. And you'll have a hard time convincing me that the reason you insist on tracking them by hand is you want to research what each one is about before you install it. Good luck with that!
<P><BREAK>
And then there's the problem of web-services like dropbox, gmail, Google drive, Google docs, Facebook, ... Pearltrees, and the list goes on.
Generally, you don't get to see the source code that implements those services, and often you have no control over when that service implementation is updated. At some point you have to decide which suppliers you are willing to trust. Stallman will tell you that Facebook surely doesn't belong on that trusted list. My wife has no Facebook account and insists that no one should share her picture or name there. Her children don't buy into that "no Facebook" policy because it would cut them off from keeping in touch with their friends.
<P><BREAK>
I could go on and on, suggesting that you look into "Virtual Private Networks" for securely allowing connections from the outside Internet into your home. But you pretty much have to trust somebody to do the right things to protect you.
<P><BREAK>
But who can you trust?
<a href="http://www.infoworld.com/slideshow/155947/the-12-biggest-baddest-boldest-software-backdoors-of-all-time-244198">12 biggest baddest [known] software backdoors of all time.</a> "all time" in that title underestimates what the future could hold. And the article isn't very keen to point out that it is only talking about known backdoors. Goodness knows what unknown backdoors are lurking out there.
<P><BREAK>
In closing, here's a 17 minute TED talk that defends "hackers" as a necessary part of the Internet eco-system. The talk doesn't draw a distinction between hackers and crackers, but so it goes.
<P>
<a href="https://www.youtube.com/watch?v=erCAp_Bd0AQ">Hackers: The Internet's Immune System</a>.rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-74096022834901133172014-05-15T21:07:00.000-07:002014-12-08T11:30:29.912-08:00Comparative Programming Languages<P>
Here are a couple of videos from luminaries in the software world that I believe are worth the time to watch.
<P>
First is Rob Pike explaining why he created the Go programming language.
<P>
<a href="https://www.youtube.com/watch?v=5kj5ApnhPAE">OSCON 2010: Rob Pike, "Public Static Void"</a>
<P>
That's a short talk of 12.5 minutes.
<P>
Far longer at an hour is this talk by "Uncle Bob" explaining what killed Smalltalk and how the same factors could kill Ruby too.
<P>
<a href="https://www.youtube.com/watch?v=YX3iRjKj7C0">RailsConf 09: Robert Martin, "What Killed Smalltalk Could Kill Ruby too"</a>
<P>
Note, that when Bob finishes with the last of his note cards, the talk is <STRONG>NOT</STRONG> over. I urge you to stay in your seat until the end of the video. Patience!
<P>
Now to be fair, I'll have to admit that I haven't programmed in Ruby nor Go nor used Rails and I'll even confess to limited experience with Test Driven Development (TDD), but I think I've got to get one of those green wristbands for myself. So if your reaction to the prospect of watching these videos is "<a href="https://www.youtube.com/watch?v=udS-OcNtSWo">Ain't nobody got time for that!</a>", well, as a consolation prize, I'll give you a link to a related, but short to read XKCD comic:
<P>
<a href="https://xkcd.com/927/">How Standards Proliferate</a>rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-89165731061514215482014-04-26T22:04:00.000-07:002014-12-08T11:30:29.920-08:00Penny for NASA?<P><BR>
If you've been paying attention to the social media, you may have noticed that there's a lobbying group called "Penny for NASA" that is pushing the idea that we should double federal spending on NASA from it's current level of 1/2 of 1% of the federal budget to a full penny of each dollar spent by Uncle Sam. Back at the height of the moon program in the 1960's apparently NASA's budget had been as high as 4+% of the federal budget. <a href="http://www.penny4nasa.org/">Penny for Nasa web site</a>.
<P><BR>
Space exploration is exciting, and I suppose it is unsporting of me to point out that there are some awfully strong other contenders for priority in allocating the federal budget.
<P><BR>
Their video makes mention of a "petroleum industry subsidy" that dwarfs NASA's budget.
So this got me to wondering where exactly to find a line item for "petroleum industry subsidy". Doing a little digging, I find that apparently it is buried in the complexity of the federal income tax and comes in the form of taxes not levied on petroleum industry profits. e.g. See <a href="http://thinkprogress.org/climate/2013/01/09/1423351/oil-zero-subsidies/">http://thinkprogress.org/climate/2013/01/09/1423351/oil-zero-subsidies/
</a>
<P><BR>
A presumably harder to sell proposition is: Let's reform the income tax and raise the effective corporate tax rate and then spend more of the revenues on space exploration. If there was a net increase in federal revenues, there are many contenders for the money with deficit reduction at the top of the list. Even if the feds were persuaded to increase the spending on science and technology, I expect NASA would be in for some stiff competition for the money from folks who'd like to see more medical research or more work on alternative energy sources. The old "If we can send men to the moon, why can't we ...", for your favorite choice of "...".
<P><BR>
So far, we have visited the moon and established a "permanent" space station in low earth orbit, and done some limited robotic exploration of Mars. Manned exploration of Mars is exciting to discuss, but difficult problems like fatal levels of radiation exposure while in-transit to Mars remain ahead without obvious solutions. Star Trek-ish "shields" and warp drive (to shorten the transit time) don't seem to be in the cards at present.
<P><BR>
Perhaps a more do-able objective would be a permanent manned base on the moon to serve as a lower gravity launch platform for deeper space exploration. To be a "Good Idea" I think it would be dependent on showing the base could be built drawing on materials from the moon. Otherwise, maybe the better choice would be an even lower gravity high orbit space station. If nothing else, digging deep to put some of the mass of the moon into use as radiation shielding might make the moon more suitable than a Disney-inspired <a href="http://www.oldmodelkits.com/index.php?detail=21635">high orbit permanent space station</a>.
<P><BR>
If we're going to have folks be permanent citizens of the moon, it is probably time to re-read Heinlein's "<a href="http://en.wikipedia.org/wiki/The_Moon_Is_a_Harsh_Mistress">The Moon Is a Harsh Mistress</a>".
<P><BR>
Or has Material Science gotten far enough that we should start by building a <a href="http://en.wikipedia.org/wiki/Space_elevator">space elevator</a>?
<P><BR>
Certainly there's no shortage of places to spend money, if we have money for such discretionary expenses and the vision and political will for adventure. The politics of the discussion are likely to devolve into debate on the economic stimulus value of the proposed increase in federal spending. An argument for "Investing in the future" sort of demands the context of a long range plan for the future. Even JFK's "we will go to the moon" had more to it than just an intent to go to the moon. <a href="http://rdrewd.blogspot.com/2009/07/that-other-thing.html">http://rdrewd.blogspot.com/2009/07/that-other-thing.html</a>
<P><BR>
Am I being too harsh in suggesting that there's much more to consider than just a blind doubling of NASA's budget? The social media would have us believe that the "Penny for NASA" efforts have grass-roots origins. But "Follow the money" is good advice when evaluating any grass-roots movement. If anything, I've over simplified the debate in my article here. e.g. see <a href="http://spaceksc.blogspot.com/2012/06/penny-for-nasa-or-for-congressional.html">A Penny for NASA -- or For Congressional Pork </a>rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-3511926397083148692014-04-19T21:45:00.000-07:002014-12-08T11:30:29.889-08:00Bill Gates TED Talks - Ideas Worth SharingBill Gates is the well known founder of Microsoft. I'm not a fan of Bill nor of Microsoft. I am an advocate for "open source" software, and I think Microsoft has brought much harm to the computer industry. But that isn't what this brief article is about.<div class="separator" style="clear: both; text-align: center;"><a href="http://ajorbahman.blogspot.com/2011/11/bill-gates-house_06.html" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWGrbd1W5kI6NiLC9j98kJjJhrnpLOlkH66W48gEBEwxYpENv_Eds005M138ccz-fUVYpLKg34ZRyQgDeJ9kgP8aSI60NAqVFxDNZi6yTXrL_ktl5vF2CDer17IJGTzj8A_p3vUe2zsiE/s320/Slide6.jpg" /><P>Bill Gates' modest house<BR> <BR> <BR></a></div>
<BR><P><BREAK>
Bill has given a couple of really good TED talks, short ones, about 10 minutes each. I pointed out this first one before. It advocates more technology in the classroom, specifically video recorders so teachers can assess their teaching sessions.
<P>
<a href="http://www.ted.com/talks/bill_gates_teachers_need_real_feedback">Teachers Need Real Feedback</a>
<P><BREAK>
A balanced assessment of the idea would have to take George Orwell's concerns from "1984" into account, but as presented, I think the video idea has merit.
<P><BREAK>
A second Bill Gates TED talk, looking at the education problem from an entirely different perspective, is this one:
<P>
<a href="http://www.ted.com/talks/bill_gates_how_state_budgets_are_breaking_us_schools#t-118235">How State Budgets are Breaking US Schools
</a><P><BREAK>
Alas, he does better at explaining the problem than he does at suggesting solutions.
<P><BREAK>
What do you think of his suggestions? Is he merely advocating that a larger slice of the education budget should go into technology because that is in his self-interest, or is he showing real forward thinking?rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-21994668103812887802014-03-22T06:31:00.000-07:002019-09-15T23:58:06.200-07:00Things your Guidance Counselor Maybe Didn't Drill into You.<P><BR>
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.
<H4>First Things First</H4>
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.
<P>
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.
<P>
But wait! There's more!
<P>
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.
<P>
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.
<H4>School Supplies</H4>
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:
<P><BR>
<STRONG>Calendar</STRONG> - 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.
<P><BR>
<STRONG>Address Book</STRONG> - 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.
<P><BR>
<STRONG>Alarm Clock</STRONG> - 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.
<P><BR>
<STRONG>Bank Account</STRONG> - 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.
<P><BR>
<STRONG>Fire-resistant lock box</STRONG> - 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.
<P><BR>
<STRONG>File Folders</STRONG> - 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.
<P><BR>
<STRONG>Book Shelf</STRONG> - 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.
<P><NR>
<STRONG>Desk</STRONG> - 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.
<P><BR>
<STRONG>Comfie chair and reading light</STRONG> - 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.
<H4>Dorm or commuter student</H4>
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.
<P>
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".
<H4>Your Health</H4>
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.
<P>
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.
<P>
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.
<P>
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.
<H4>The Requirements for Graduating are in the Catalog</H4>
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.
<P>
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.
<H4>There's more to college than passing classes and graduating</H4>
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.
<H4>Happy Trails!</H4>
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.
<P>
Do well!
<H4>References</H4>
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.
<P>
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 <a href="https://rdrewd.blogspot.com/2013/01/how-children-succeed.html">book-report on my blog</a> from back when I read the book.
<P>
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 <a href="http://www.dilbert.com">Dilbert comic strip</a> by Scott Adams. For example (<a href="https://assets.amuniversal.com/16c5df8064680131b065005056a9545d">Dilbert, 02/18/2014</a>:
<div class="separator" style="clear: both; text-align: center;"><a href="http://assets.amuniversal.com/16c5df8064680131b065005056a9545d" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://assets.amuniversal.com/16c5df8064680131b065005056a9545d" /></a></div>
Click on the dated link above the comic to see the missing punchline in the 3rd frame. Then you can use your browser's "back" button to return here.
<P>
Back in January, 2013, I posted "<a href="https://rdrewd.blogspot.com/2013/01/advice-to-undergraduates.html">Advice to Undergraduates</a>". 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.
<P>
"<a href="https://rdrewd.blogspot.com/search/label/education">Education</a>" 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 "<a href="https://rdrewd.blogspot.com/2013/05/educations-future-go-do-something.html">Education's Future: 'Go Do Something Interesting'</a>"
<P>
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 "<a href="https://www.imdb.com/title/tt0061722/?ref_=nv_sr_1">The Graduate</a>".
<P>
These references would be far from complete if I didn't also include a link to Dave Barry's 2004 "<a href="https://www.miamiherald.com/living/liv-columns-blogs/dave-barry/article1932964.html">Commencement Address</a>".
<BR>
<FONT SIZE="1">
Revised 3/31/2014 - Edited to fix a couple of minor typos.
<BR>
Revised 04/20/2015 - Revised because Dilbert URL's changed around so link to "sleep" comic broke. I fixed it.
<BR>
Revised 09/16/2019 - Revised because URL to Dave Barry's commencement speech broke. I fixed it.
</FONT>rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-14345038397991419752014-02-03T19:23:00.000-08:002016-04-04T02:04:12.197-07:00Python Generators<H4>Background</H4>
Back in May, 2013, I posted
"<a href="http://rdrewd.blogspot.com/2013/05/cheap-but-not-free-modular-code-has.html">Cheap, but not Free, Modular Code has a Price</a>". In that blog article I compared the performance of my solution of
<a href="http://projecteuler.net/problem=14">Project Euler problem 14</a> 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.
<P><BR>
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.
<P><BR>
<H4>But that isn't what I came here to talk about today</H4>
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.
<P><BR>
<H4>Python Dictionaries</H4>
Back in January, 2013, I posted "<a href="http://rdrewd.blogspot.com/2013/01/dictionary-implementation-in-udacity.html">Dictionary Implementation</a>". 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.
<P><BR>
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:
<P>
python dictionary
<P>
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.
<P><BR>
Or perhaps you should work your way through <a href="https://www.udacity.com/course/viewer#!/c-cs101/l-48299949/m-48698544">Udacity CS101</a> to learn this concept of dictionaries and more.
<P><BR>
<H4>Python Generators</H4>
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: "<a href="http://www.jeffknupp.com/blog/2013/04/07/improve-your-python-yield-and-generators-explained/">Improve your Python: 'Yield' and Generators Explained</a>". 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.
<P><BR>
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 conjuring 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.
<P><BR>
<H4>But Wait! There's more!</H4>
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.
<P><BR>
Igor Vasilcovsky recently pointed out to me an interesting <a href="http://www.dabeaz.com/generators-uk/ ">tutorial from David Beazley about generators</a>. The meat is the slide deck under the <a href="http://www.dabeaz.com/generators-uk/GeneratorsUK.pdf">presentation link</a> 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:
<OL>
<LI>
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
<a href="http://rdrewd.blogspot.com/2013/07/pythonic-python-writing-python-code.html">Pythonic Python</a>
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.
<P>
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.
</LI>
<LI>
A generator is just Python software so it 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.
</LI>
<LI>
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) <a href="http://www.gnu.org/licenses/">GPL licensed</a> and freely shared on <a href="https://github.com/">Github</a> or some other such public place.
</LI>
</OL>
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: "<a href="http://www.youtube.com/watch?v=f_6vDi7ywuA">Python 3.3: Trust me, it is better than 2.7</a>". 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.rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com1tag:blogger.com,1999:blog-6557104658390047492.post-65674700848561797642014-01-05T16:19:00.001-08:002014-12-08T11:30:29.908-08:00Adventures in Home Networking<P><BR>
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.
<P><BR>
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.
<P><BR>
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.
<P><BR>
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.
<P><BR>
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.
<P><BR>
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.
<P><BR>
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.
<P><BR>
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.
<P><BR>
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.
<P><BR>
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:
<BR>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtfgk4tJ2YsnoVOPnqz2TB-FvAWqK5KAhg_ojIoE1EZ01F-xptiYuCkTF_wGAhJJ-2uxcoPcDWLguV9y_r1ioDvD4ytAkuIAqpK5Y8MvrtMM43t-mMrg8hFglQ330XjOp_EndQuYROchA/s1600/home-network-with-cable-modem.jpg" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtfgk4tJ2YsnoVOPnqz2TB-FvAWqK5KAhg_ojIoE1EZ01F-xptiYuCkTF_wGAhJJ-2uxcoPcDWLguV9y_r1ioDvD4ytAkuIAqpK5Y8MvrtMM43t-mMrg8hFglQ330XjOp_EndQuYROchA/s320/home-network-with-cable-modem.jpg" /><BR>
Home network yesterday with cable modem</a>
<P><BR>
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.
<P><BR>
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.<BR>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxIA7DY7rfinTUXdRzjOy53Cuxo31409w16c4eIy5VW__60d7n1fL5fH9E2X-JdPtaopIs8KKP1NMQXfYIDZTThIOxu_Os2x3my3p6nHTx1Q1QE2flRRz9H2_NuHI6S6AyMJb9SyXNHk0/s1600/Home-network-with-mifi.jpg" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxIA7DY7rfinTUXdRzjOy53Cuxo31409w16c4eIy5VW__60d7n1fL5fH9E2X-JdPtaopIs8KKP1NMQXfYIDZTThIOxu_Os2x3my3p6nHTx1Q1QE2flRRz9H2_NuHI6S6AyMJb9SyXNHk0/s320/Home-network-with-mifi.jpg" /><BR>
Home network today with Mifi and bridge replacing cable modem</a>
<P><BR>
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.
<P><BR>
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://pingtest.net 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.
<P><BR>
Any questions? Suggestions? Is your home network "interesting"?rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-54559418435156022022013-11-30T14:19:00.000-08:002015-10-09T23:06:07.535-07:00Linus Torvalds on Teaching Children to Program<P><BR>
Linus 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.
<P><BR>
<a href="http://www.youtube.com/watch?v=2KfJiWR1FPw">http://www.youtube.com/watch?v=2KfJiWR1FPw</a>
<P><BR>
My conclusion is that an introductory programming course should therefore be short. I like <a href="https://www.udacity.com/course/cs101">Udacity CS101</a>. 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: <a href="http://rdrewd.blogspot.com/2012/12/is-udacity-cs101-course-watered-down.html">Is the Udacity CS101 Course Watered Down?</a>
<P><BR>
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.
<P><BR>
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 <a href="http://www.usfirst.org/sites/default/files/uploadedFiles/Community/FRC/Team_Resources/2013%20FRC%20team%20handbook.pdf">working estimate I've seen on the web</a>) 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.
<P><BR>
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: <a href="http://rdrewd.blogspot.com/2013/03/marketing-importance-of-programming.html">Marketing the Importance of Programming Education</a>. The comment thread on that article is, in my opinion, particularly worth reading.
<P><BR>
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. rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-40734560894440013932013-09-14T02:50:00.000-07:002014-12-08T11:28:43.411-08:00Bicycles for the mind... A Steve Jobs talk from long ago.<H4><STRONG>1980</STRONG></H4>
In the <a href="https://www.udacity.com/course/cs101">Introduction talk to Udacity CS101</a>, Professor Evans mentions Steve Jobs having compared computers to "bicycles for the mind".<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjceM0wAgye8euUaNsLW9S6jOkYW6XJXXqVs6gIBHo9WoW5SZwAp8dv4KFzGE-7VYhwDHT0-NHPYhuLMCCghck2SNBaO1_NtZcwqgxODqrBJzlFEaamCq8GflbBJIeI-oM_TpQE9euC40/s1600/Intro+to+Computer+Science+Class+Online++CS101++++Udacity.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjceM0wAgye8euUaNsLW9S6jOkYW6XJXXqVs6gIBHo9WoW5SZwAp8dv4KFzGE-7VYhwDHT0-NHPYhuLMCCghck2SNBaO1_NtZcwqgxODqrBJzlFEaamCq8GflbBJIeI-oM_TpQE9euC40/s320/Intro+to+Computer+Science+Class+Online++CS101++++Udacity.png" /></a></div>
I think I've now stumbled across the talk where <a href="https://www.youtube.com/watch?v=0lvMgMrNDlg">Jobs more or less said that</a>. 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.
<P><BR>
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!
<P><BR>
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, <a href="http://en.wikipedia.org/wiki/VisiCalc">Wikipedia remembers</a>. Even if you remember Visicalc, I recommend that you visit the Wikipedia page. It has some wonderful interesting links, including one that lets you <a href="http://www.danbricklin.com/history/vcexecutable.htm">download a free copy of Visicalc</a> 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 <a href="http://en.wikipedia.org/wiki/History_of_the_floppy_disk">maybe been 140KB</a> of storage space.
<P><BR>
One other link to particularly take note of is the one that asks "<a href="http://www.techdirt.com/articles/20050812/1835229_F.shtml">What if Visicalc had been patented?</a>".
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 <a href="http://www.youtube.com/watch?v=eginMQBWII4">Richard Stallman talk or 2 about "intellectual property"</a>. 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.
<P><BR>
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 <a href="http://www.youtube.com/watch?v=tY3US40YiJg">this short video</a> where Stallman contrasts his own accomplishments vs. those of Jobs and of Bill Gates.
<H4>Time marches on, but progress?</H4>
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 <a href="http://www.youtube.com/watch?v=lSiQA6KKyJo">Steve Jobs giving a timeline leading up to the Macintosh</a>. 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 <a href="http://www.youtube.com/watch?v=RcRQWGFJ5YY">Steve Jobs actually introducing and demonstrating the Macintosh</a>.
<P><BR>
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?
<P><BR>
Comparing the <a href="http://www.python.org/">Python language</a> 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.
<P><BR>
If I was better at HTML, maybe I could rig this article to provide <a href="http://www.youtube.com/watch?v=LCRZZC-DH7M">background music</a> as you read the previous paragraph. Or am I being too sentimental about lack of technological progress?
<P><BR>
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 "<a href="http://rdrewd.blogspot.com/2013/05/copied-code-or-unfortunate-coincidence.html">Copied Code or Unfortunate Coincidence</a>".
<P><BREAK>
<FONT SIZE="1">
06/11/2014 - Updated: The Steve Jobs talk link went bad! Why didn't anyone tell me with a comment so I'd know? Anyhow, I found a link that works (today).
</FONT>rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-53780030870793063562013-09-10T20:24:00.000-07:002014-12-08T11:28:43.446-08:00Control Engineering?<H4>My Master's degree</h4>
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.
<P><BR>
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.
<H4>TED talk/demo of control engineering</H4>
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.
<P><BR>
And so, for your entertainment and to convey to you what the heck "control engineering" is about, I share with you <a href="http://www.ted.com/talks/raffaello_d_andrea_the_astounding_athletic_power_of_quadcopters.html">Raffaello D'Andrea: The astounding athletic power of quadcopters</a> from June 2013. Run time of the video is about 16 minutes.
<H4>Want to know more?</H4>
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 <a href="http://en.wikipedia.org/wiki/Quadcopter">Wikipedia article about Quadcopters</a> and from there, there are plenty of links to additional information. I found this article about <a href="http://www.idsc.ethz.ch/Research_DAndrea/Flying_Machine_Arena">the lab where they test their stuff</a> 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 <a href="http://www.pearltrees.com/#/N-p=80561222&N-s=1_8321881&N-play=0&N-u=1_1152162&N-fa=7703637&N-f=1_8321881">Pearltree specifically about quadcopters</a>. I did find some open source (Arduino controller) quadcopter projects. e.g. <a href="http://aeroquad.com/content.php?s=cd3ef13479d88ca32ce157c8f9305965">this one</a> and <a href="https://code.google.com/p/arducopter/">another one</a>.
<P><BR>
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: <a href="http://people.ece.cornell.edu/land/courses/eceprojectsland/STUDENTPROJ/2012to2013/ssm92/ssm92_report_201305171020.pdf">Autonomous Quadcopter Docking System</a>. 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 "<a href="http://news.yahoo.com/smth-send-me-to-heaven-app-throw-phone-high-190146638.html">Send me to Heaven</a>" game on his Android phone? Not me!)
<P><BR>
If you want to get into the math of control of a quadcopter, this looks like a reasonable place to start reading: <a href="https://ssl.linklings.net/conferences/acra/program/attendee_program_acra2011/includes/files/pap115.pdf">Estimation and Control for an Open-Source Quadcopter</a>. 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.rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-13309975671747765502013-09-09T23:56:00.001-07:002014-12-08T11:28:43.342-08:00The public does remember scandals, even in NYC?<P>
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.
<H4>Background</H4>
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.
<P><BR>
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 <a href="http://en.wikipedia.org/wiki/Eliot_Spitzer_prostitution_scandal">the services of high priced prostitutes</a>.
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.
<P><BR>
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.
<P><BR>
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 <a href="http://en.wikipedia.org/wiki/Anthony_Weiner_sexting_scandals">his private parts to various women</a>. Amid all the hoopla, he resigned from office.
<P><BR>
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 <a href="http://www.politico.com/story/2013/09/poll-scott-stringer-eliot-spitzer-96273.html">both Spitzer and Weiner trailing in their races</a>, 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, <a href="http://www.christianpost.com/news/late-night-comedy-now-obama-weiner-butt-of-most-2013-jokes-101588/">especially with Weiner</a>.
<P><BR>
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?
<H4>Election Night Update 09/10/2013</H4>
Well, the polls for today's primary election have closed and <a href="http://www.huffingtonpost.com/2013/09/10/new-york-election-results-live-2013_n_3894417.html">results indicate</a> 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).
<P><BR>
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.
<P><BR>
Perhaps it mattered that during this campaign, Weiner asserted that his checkered past was now behind him, but then the whole <a href="http://www.thedailyshow.com/watch/thu-august-15-2013/one-crazy-summary---carlos-danger">"Carlos Danger" brouhaha</a> 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.rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0tag:blogger.com,1999:blog-6557104658390047492.post-69360310246690161952013-09-04T10:07:00.000-07:002014-12-08T11:28:43.479-08:00SOLID software design...<H4>My hopeless backlog</H4>
<P>
One of the bad habits I have is accumulating lists of things to read. Google Reader used to be a handy place to categorize and keep my "subscriptions" to blogs and so forth to read. Unfortunately, Google pulled the plug on that service in July. Fortunately, another web service, theoldreader.com provided a very similar free service. In fact, their service was designed to look like an earlier version of Google Reader. Some time ago, Google removed some "social" aspects of Google Reader and the change irked some of their users. theoldreader.com sprung up to undo the perceived damage of Google's changes. When Google announced the planned demise of the Google Reader service, Google at least was kind enough to provide a mechanism for retrieving my list of subscriptions, so I opened a free account with theoldreader.com and submitted my subscription list. But so did a zillion other people, so it took literally weeks for the site to get around to processing my subscription list. In the fullness of time, they did get the subscriptions into their system and it seemed usable enough, but then their servers crumbled under the newly stepped up load. (Well, I think that the story is more like they made changes to beef up their servers and in making the changes someone tripped over a power cord or something). More days and days of noticeable downtime before things got back on the air and seemingly stable again.
<P>
My point in mentioning Blog subscriptions is that the universe conspires to generate "interesting" blog articles faster than I manage to read them. "<a href="http://www.youtube.com%2Fwatch%3Fv%3DjIfu2A0ezq0&ei=n5cWUoDhEc784AOaxYC4CA&usg=AFQjCNFzj9ES6pVwraKfM1v4Utx78AY8_w&sig2=2wqyOB8es3KCM5hF_CqEpw&bvm=bv.51156542,d.dmg">Another day older and deeper in debt...</a>". My backlog of unread blog articles is quite hopeless, but whenever I have nothing much to do, instead of turning on the boob-tube in the living room, I fire up theoldreader.com in my browser and try to read up on what I've been missing.
<P>
If you've got your own solution to tracking new blog articles, I hope <a href="rdrewd.blogspot.com">my blog here</a> is on your subscription list. If not, please take a moment to sign-up my blog onto your list. Go ahead and do it now. I'll wait for you to get back.
(Full disclosure: No one has ever told me of positive or negative experiences from subscribing
to my blog with their favorite RSS tool.
I'm assuming that blogspot.com does the right thing, but if you run into a snag, I'd sure like to hear about it).
<H4>Emily's "Coding is Like Cooking" blog</H4>
<P>
One of the blogs that I do try to keep up with is from an expert on test-driven-development (TDD) named Emily Bache, an Englishwoman who now lives and works in Sweden. Her blog is called "<a href="http://coding-is-like-cooking.info/">Coding is Like Cooking</a>". I like it because it tends to be quite well written and covers relatively recent software development topics that I might otherwise miss out on. i.e. Stuff that I didn't learn in school back in the days when Structured Programming was still somewhat controversial, and that I didn't pick up by osmosis in the later years of my employment at Bell Labs. I freely confess that Test-Driven-Development wasn't part of the quite informal methodology that "we" in Math Research were following. The mathematicians tended to find the underlying math of the problems far more interesting then the structure of the code. I also found myself unexposed to a great mentor for Object-Oriented-Programming. Java got some use in our projects, but I knew enough to recognize bad use of the language when I saw it. So, now I'm retired and still have much to learn. The web has no shortage of material for me to learn from and by reading Emily's articles and saying "Huh?" when something comes up that isn't at all familiar to me, I find lots of great stuff to learn.
<P>
One of my "Huh?" moments came from her mention of the "London School". I followed her link and picked up a book for my Amazon book Wish list:
<a href="http://www.amazon.com/Growing-Object-Oriented-Software-Guided-Tests/dp/0321503627/ref=wl_it_dp_o_pd_nS_nC?ie=UTF8&colid=1T2VZ0YDZFV67&coliid=I3LI7RBP8T71HQ">Growing Object-Oriented Software, Guided by Tests</a>
<H4>SOLID Principles and TDD</H4>
<P>
So today I was reading an article of her's from September, 2012, <a href="http://coding-is-like-cooking.info/2012/09/solid-principles-and-tdd/">SOLID principles and TDD</a>. I didn't get very far into it when my brain complained
"Huh? What does she mean by SOLID?".
So I opened up another window thanks to a link she provided and read the <a href="http://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29">Wikipedia article on SOLID</a>. It isn't a particularly excellent Wikipedia article.
It is dense with off-putting terminology - might be the fault of the SOLID acronym and not really the fault of the article - I've got to forgive the Wikipedia article because it has some excellent links to reference material.
<H4>Uncle Bob's principles of Object Oriented Design</H4>
<P>
One of the links from Wikipedia that I followed was <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">
http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod</a>.
Still more links to clarify the mysterious-to-me parts of that SOLID acronym. This summary article looks especially good: <a href="http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf">http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf</a>.
<P>And just to make sure I don't run out of things to read, there's a book mentioned and even recommended by another reader -
<a href="http://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445/ref=wl_it_dp_o_pd_nS_nC?ie=UTF8&colid=2QGBI867AGQXI&coliid=I18KY5HMSK7W1F">Agile Software Development, Principles, Patterns, and Practices</a> that I've added to my Amazon "Agile" book wish list to remind me I really need to take a look at it.
<P>
<h4>In closing...</H4>
<P>
So, my situation is quite hopeless if the goal is to finish reading the stuff on my list. If I'm reading anything interesting, it tends to add more things to my list. And that doesn't even count the time to actually try the tools and techniques that I'm reading about.
I hope you found some of this material interesting enough to add to your own read-and-try list.
I guess I have a bit of a sadistic streak to want to inflict my backlog on other folks.
<P>
Learned anything interesting lately?rdrewdhttp://www.blogger.com/profile/02257871097225791863noreply@blogger.com0