Conway’s Game of Life

Learning to program, at least if you’re going in a more scholarly direction, means at the least hearing about John Conway’s Game of Life. It’s all about cellular automata, and it was invented in 1970–but it still is perfectly relevant, and people are still discovering new stuff relating to it.

Here are some resources I found in a recent, quick, search:

  • LifeWiki is intended to be a complete source for all things relating to Life, including all the interesting or noteworthy patterns that have been discovered, as well as basic information about it.
  • From WikiHow, How to Make the Conway’s Game of Life Cellular Automaton. A step-by-step guide to figuring out how to program the life–in general. It helps to know something about programming, because it tells you what you should be doing, not exactly how to do it.
  • Here’s an implementation of Life for Drupal, John Conway’s Game of Life. You can probably find implementations of Life for just about any programming language there is; that is left as an exercise for the reader.
Posted in computer science, learning to program | Leave a comment

Some more lists

Not many things I like more than lists of interesting, funny, or challenging quotes. Or just lists of things that I might be interested in. Like these:

  • 60 Selected Best Famous Quotes, starting with “You can do anything, but not everything.” (David Allen). Nicely inspiring to anyone trying to accomplish something.
  • Slightly less inspiring, but still interesting, funny and/or challenging, Top 50 Programming Quotes of All Time. For example, “Python’s a drop-in replacement for BASIC in the sense that Optimus Prime is a drop-in replacement for a truck.” (Cory Dodt).
  • 15 Of The Most Confusing Films Ever Made is as described: 15 confusing movies. For me, “confusing” can also be considered “challenging” or “engaging”, though sometimes a confusing movie is just confusing.
Posted in Lists | Leave a comment

Low-tech Magazine

Watch the movie War Games sometime if you have any interest in seeing how things were done back before computers were everywhere. It’s a real time-capsule from 1983, full of modems and rotary telephones and libraries with card catalogs and micro-fiche and pay phones and lots more old-timey stuff.

If you’ve ever wondered how people solved other kinds of problems in the past, without benefit of modern technologies, then go look at Low-tech Magazine. From discussions of transport efficiency of electric cars or passenger planes over the years, to how to lift multi-ton stones to build a pyramid.

Overall, a nice reminder of what can be accomplished even without computers, electricity or internal combustion.

Posted in Education, Fun Things to Do, Good blogs to follow, How-To, Interesting Stuff | Leave a comment

New Hope for Underachievers

Being smart and successful doesn’t mean that you’ve always been smart and successful, or that you’ve always been singleminded about your vocation, or that you’ve always been driven and focused. I’ve collected a few links that flesh out that thought:

  • Video Games Boost Brain Power, Multitasking Skills, gives a welcome respite from all the catastrophic hand-wringing in the mainstream media about the dangers of spending too much time on video gaming. I still think there’s such a thing as too much, but I’ve never thought it should be banned, just a little bit control would be good. The NPR article profiles work done by Daphne Bavelier, professor of brain and cognitive sciences at the University of Rochester, who said that “video gamers show improved skills in vision, attention and certain aspects of cognition. And these skills are not just gaming skills, but real-world skills. They perform better than non-gamers on certain tests of attention, speed, accuracy, vision and multitasking…”.
  • If you think the world’s greatest brains are always right, check out Accept Defeat: The Neuroscience of Screwing Up at Wired Magazine, for an insightful look into how scientists are now examining the actual process of scientific discover, with some surprising results. To get to interesting results, sometimes it’s more useful to fail quite a lot first; and sometimes, smart generalists can beat a group of world-class experts when they are trying to solve a problem.
  • Finally, consider Why Self-Discipline Is Overrated: The (Troubling) Theory and Practice of Control from Within, an essay by controversial author Alfie Kohn (to oversimplify, he’s also against homework and obsessively and indiscriminately lavishing praise on children, for example). But at least it’s a nice counterpoint to the uncritical acceptance of the importance of doing homework and everything else that school (and other) authority figures insist that we all do.
Posted in Education, Learning | Leave a comment

Resources for Learning to Program

I keep making posts with titles similar to this one, but then again, I keep finding new resources. There are a lot, including books (many of them freely available for download), videos, on-line courses, and so on.

  • Invent Your Own Computer Games with Python looks like a very good book, and an extremely good value: it’s a free download, it’s in its second edition, and it’s also available as a print book for not too much. The “Invent With Python” Blog is a real blog, if not particularly high-bandwidth, it seems author Al Sweigart manages to post at least a couple of items each month, including “Code Comments”, which include source code with detailed comments. An overall excellent resource, specifically targeted to teaching/learning programming for kids (though it should work for anyone).
  • Hello World! Computer Programming for Kids and Other Beginners is another book aimed at kids and other beginners and with a focus on programming games. There’s a website, Computer Programming for Kids, and there are videos at Youtube starring Carter Sande, co-author of the book and son of the other co-author, Warren Sande. The blog isn’t updated as often as the “Invent with Python” blog, but there is a fairly robust authors’ forum at the publisher’s website.
  • Computer science is not the same thing as programming, though programming is generally considered a requirement and/or a prerequisite for studying computer science. In any case, sometimes it can be easier to teach the foundations of computer science without actually using a computer. That’s how the Computer Science Unplugged project rolls, with about 20 exercises, a free-downloadable book (with 12 of the most popular exercises) and a selection of videos on their Youtube channel demonstrating the exercises in action.
  • I’ve got to mention, again, the excellent Learn Python The Hard Way by Zed Shaw. I started working through it, and it’s great: the short chapters/exercises are just long enough to engage me for an hour or so at a time, though it’s possible to spend more time on each. Perhaps not quite as “friendly” for kids as the others listed here, it could be good enough to get an interested teen going. For those teens who are less interested, I don’t know if anything will work, but who knows.
Posted in learning to program, Python | 2 Comments

Why does the PHP universe do this?

Something odd, that I sort of have figured out. It’s an opportunity to learn something new and useful, but I’m not quite there yet.

I got XAMPP installed and up and running last month, that was great actually, pretty much exactly to plan as far as the instructions I found online. That, coupled to my lack of almost any memory of having to do much at all to install it, meant that whatever I did do, couldn’t have been much.

I tend not to re-start my computer too often, as these new modern OSes don’t crash every 12 hours or so (like they used to, for me). Maybe I haven’t rebooted since fiddling around with my PHP configuration so I can learn PHP, but I could have sworn I did.

In any case, what happened was that after installing OS X 10.6, I restarted the system and boom, my nice little page I’d been fiddling with on my local webserver had stopped working, and the XAMPP Welcome page that I’d gotten used to seeing was showing an error message itself.

The XAMPP page was showing up an error message in code for the examples file, where the variable $PHP_SELF was reported “not defined” on line 166.

My own work page came up with an error message relating to the MySQL userID/password not working. That was because I’d changed from requiring a password to not requiring one. I’ve since changed back, thank you, but I’m still not sure how you go about doing secure database access, especially when you’re writing web content.

The biggest problem was tracking down the source code file that had the issue–I had to use the Spotlight program on my MacBook, but grep would have worked too. I had written (as part of my education) a little script to start up a connection to the MySQL server, and I would never have remembered it in a log time; it would have taken me only slightly less time to actually read through the main script to find (and figure out the significance of) that script file.

But, that problem was easily solved; the XAMPP variable problem was a bit more problematic. But not much more: it turns out that when you have register_globals turned on, you can use things like $PHP_SELF as a pre-defined variable. When you set register_globals off, though, any program (like the XAMPP demo program that loads as part of the Welcome page) that uses $PHP_SELF (for example) will crap out.

So, if I were more confident in my coding ability, I would have remediated that particular variable assignment by making it correct. Perhaps I should say instead, if I knew how to do that kind of variable assignment correctly, I would have done so. Instead, I just set register_globals back on, and went about my business.

But why was register_globals set to off in the first place? Because, IIRC, the PHP book with which I was studying told me that they should be turned off–as does the ini.php configuration file itself, in comments:


; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.

In other words, on one hand, I’m told to turn it off, on the other, to turn it on. Can’t we all just get along and figure out which is right?

I know it should probably be turned off so you don’t get stuck, like I did, but then again, that demo program that failed, I didn’t write that–someone who should have known better did. That’s what grinds my gears.

But more important, my learning opportunity is simply figuring out how to declare that variable correctly, and fixing it in the code from XAMPP. I’ll try again, later.

Posted in learning to program, PHP | Leave a comment

More programming-related links of interest

As the title suggests, another hodge-podge of links that look to be useful (or that I’ve already found to be useful), relating one way or another to programming, especially learning about programming:

  • Vi Cheat Sheet is indeed a very handy little page if you’ve found yourself on a system where vi seems to be your best choice for editor, but you can only remember the bare outlines of actually using vi. You could probably learn enough to productively use vi just from this page (as long as you have a clue about how vi works in the first place).
  • How to Make Your Own Open Source, Dropbox-like Sync and Backup Service is intriguing, but I haven’t studied it yet, other than to note that it points mostly to a how-to at HOWTO build your own open source Dropbox clone. Which turns out to be about how to do it with *nix tools, which is cool by itself.
  • Another item that looks to be both useful and interesting, also from LifeHacker: How to Audit and Update Your Passwords. It’s so easy to just give up on even attempting to use secure passwords, which mean changing them reasonably frequently, too (making them even harder to remember).
  • Another good one from Reddit: We’re All Coders Now: Why everybody should learn to code (at least a little). That link goes to Wired.com, but here’s the Reddit discussion.
  • I came across Wiki-Hop in Reddit (IIRC), where it was submitted as an example of “hey, look what I programmed!” Basically, it let’s you see how many links it takes to get from any person to any other person, based on their Wikipedia content.
Posted in learning to program | Leave a comment

Be kind…

As odd as it may seem, I’ve come to rely on what you might call aphorisms. For example, Be Kind; Everyone You Meet is Fighting a Hard Battle. That link goes to a discussion of who it was that actually said it, but for me, the most important thing is to remember that, no matter what personal hell I’m navigating at any particular time, all the strangers around me have endured similar if not much worse things.

Posted in Uncategorized | Leave a comment

Even more resources for learning to program

Another crop of good reads/resources for learning to program:

  • More from Reddit, like, Bored on a Sunday Morning? Try Learning Python”, though the lecturer in the referenced Youtube video makes it clear that the course in intended for people with experience in at least one other programming language. Which is a shame, since it’s so easy to learn a new programming language if you already know how to program.
  • Also from Reddit, Presenting GCCalc: a horrible abuse of GCC, which actually sounds pretty awesome: “GCCalc is a simple command line calculator, much like the common bc calculator on many Unix systems. It’s implementation, however, is very different than most calculators. While bc is said to have “C-like syntax”, GCCalc’s syntax is C. Whatever you enter on the command line automatically gets compiled, loaded, and executed, and the result is returned (as a double) and printed to the screen.”
  • Again, from Reddit: Why Teach Programming with BASIC?. Nice discussion of the pros and cons of using BASIC and others, along with plenty of links–and a focus on what’s best for learning. Ditto for Why Teach Programming with BASIC? from Slashdot.
  • The whole idea of Programming Dojo is exciting: a place to go once a week for working on the practice of programming. I’m still just investigating at this point, but here’s a link to some katas: CodeKata. So, this is just a placeholder for a lot more to come.
  • The Craig Web Experience: Understanding the Halting Problem, a little writeup that was described as a brief yet comprehensible description of the Halting Problem.
  • Rosetta Code is another cool thing that I’d never have imagined actually existed, but which is just so incredibly useful that it’s a wonder no one knows about it. “Rosetta Code is a programming chrestomathy site. The idea is to present solutions to the same task in as many different languages as possible, to demonstrate how languages are similar and different, and to aid a person with a grounding in one approach to a problem in learning another.” I will leave the definition of the super-awesome word “chrestomathy” as an exercise to the reader.
Posted in Uncategorized | Leave a comment

Figuring out Twitter

OK, so I’ve been out of the loop for a while. Facebook seems like an utter waste of time, and Twitter always struck me as kind of ridiculous. But while Facebook, with over half a billion members, has a pretty huge penetration…

…it’s a huge waste of time, as I just realized after wasting 20 minutes looking it over (specifically, scanning through all the “People You May Know”, which includes a surprising number of people I haven’t thought about in 30 years as well as others who I do know but don’t necessarily want to get in touch with, and many many more who simply know people that I’ve already friended).

But Twitter seems like a very interesting, yet still very simple concept: inject messages of no more than 140 characters into the internet. Sort of like a huge list with zillions of items in it that zoom by in massive succession. So, Twitter is (IMO, and that’s the only O that counts) relevant to my interest in lists.

There’s more, but how much is simply related to interesting implementations and “chrome”, and how much is true added functionality? I’ve decided to spend a few hours today to figure it out, as much as possible.

I’m specifically interested in Twitter today because, according to this article from SFGate, THE TRUTH ABOUT TWITTER: Half Of Twitter Users Never Listen To A Word Anyone Else Says, despite Twitter’s apparent popularity, only 8% of US adults use it, and only half of those actually do anything other than tweet–they don’t read anyone else’s tweets, and a substantial portion of all tweets are actually just pointing to news stories or re-tweets of other people’s tweets.

What that means to me is that Twitter has a hard-core base of users who get real value from the service, but there is still a ton of room for the market to grow. In other words, there’s a lot of potential still for anyone who wants to learn something new about an exciting new tool and then leverage that knowledge.

I spotted a book about using Twitter, All a Twitter: A Personal and Professional Guide to Social Networking with Twitter, at the library. After I checked it out, it sat quietly and patiently on my desk for a couple of weeks. I started to pick it up, but realized that a book first printed in July 2009 would likely not be my most up-to-date source. So, I shifted directly to THE source:

Twitter.com

I found some helpful resources on Twitter, right off the bat, including the Twitter Help Center which mixes “support” with “help for newbies”. From there, I found Twitter Basics, where you go for all the information: lots of links to lots of articles on lots of topics, all related to using Twitter.

But other links popped up, too. While reading on the topic of hash-tags (that octothorpe that appears before words in tweets) they mention Hashtags.org, as a place to find out what’s hot on Twitter.

Interestingly, through hashtags.org, I found another Twitter-spinoff site, Trendistic, which plots out Twitter trends similarly to the way Google Trends works for Google searches.

And a pointer to a very complete article about hash-tags, titled Hashtags, at Twitter Fan Wiki (with many more good and in-depth articles about Twitter–at first glance, it looks epically awesome, actually).

So, I went off on a bit of a tangent there, but the bottom line is that Twitter is a medium for publishing very short messages, which can be seen by anyone. To start with, you just find the people you want to follow, or find the topics you want to find out about, and you “get information” about them through Twitter. When you’re ready, you can send your own tweets.

The special symbols that pop up all the time are the octothorpe or hash-tag (“#”) symbol that indicates the word that follows as a keyword tag, to help identify that your tweet relates to that term. The “at sign” (“@”) indicates that the text following is a Twitter username, which you can use to “call out” to that username in your tweets.

Want to reply to a twitterer? Start you tweet with @twitterer (using the Twitter username you’re replying to instead of “twitterer”, of course). Or you can just use the @name to call out to someone who tweets, in your tweets.

How hard can it be? I just signed up, which took a couple of minutes, and have already located a small handful of Twitterers who I want to follow.

The next step is to get the rest of my account authenticated/authorized and figure out what else I can do with Twitter.

Posted in Uncategorized | Leave a comment