Project Euler on the boiler

My good friend Karl Erickson recently recommended a site called Project Euler (does not rhyme with "ruler") that promises endless fun. The site has hundreds of increasingly hard mathematical problems to solve. Most people solve them by writing and running a computer program that spits out the answer (although some do it with pencil and paper). You then plug your answer into the problem page (with a captcha). If you did everything right, you get a pat on the head. I solved Problem 1 in a few minutes with a 12-line Perl program and got a pat on the head in short order. It felt great. I can tell right away that this is going to be addictive. For the record, Problem 1 reads as follows:

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.

Find the sum of all the multiples of 3 or 5 below 1000.

193,925 people have solved this now, including me. The next solver has just appeared. It says she took two hours to solve it, but maybe she's, like, 12. (Project Euler must be great for gifted kids.)

The latest problem, 368, is too long to reproduce here, but the title is "A Kempner-like series" and only 117 people have solved it.

I've started with Problem 1 and will move straight ahead as far as possible, until I lose my will to live and start subscribing to antinatalist newsletters. However, Karl says he sometimes skips around, and he has solved quite a few, so I may do the same if I'm really stuck.

By the way, this is a great way to exercise the skills outlined in the "Engineer Your Results" hack in Mindhacker.

Advertisements

Think! and kick the *ss of *lzheimer’s — real physical evidence at last

Good news below for people with active brains, and especially good news for people who've been mentally active their whole lives. (Why wait to get smart? Buy our books Mindhacker and Mind Performance Hacks today.)

It's nice to be told that spending my life staying up until two in the morning trying to fix the off-by-one error in Philip José Farmer's New Era calendar from his novel Dayworld (which is like porn to amateur horologists like me) is helping me stave off Alzheimer's, because as far as I can tell it's doing bloody all else.

Good luck!

http://esciencenews.com/articles/2012/01/23/lifelong.brain.stimulating.habits.linked.lower.alzheimers.protein.levels

HyperCard was the BASIC of the 90s. What is the BASIC of the 21st Century?

Prompted by an article on how Steve Jobs killed HyperCard as the antithesis of the disneyfied walled garden that was his vision of the Internet, I went looking for HyperCard's successor. Some proposals were languages I had already tried, like Squeak. Others were new to me. Here is my short list of things to try and why they're good or not.

  • Squeak: Kind of sandboxed. Unnecessarily syntactically complex.
  • Google App Inventor: Great idea, but simplistic. Also moribund.
  • FreeBasic: A QBasic clone that enables you to create both Windows and Linux native executables. I like it. I have already written this guy to see if he'll open-source his QBasic games (which I love) and let me port them.
  • RFO BASIC!: This is a BASIC for the Android. With a little effort, you can package the programs as real Android apps. Worth watching.
  • SL4A: Scripting Layer for Android. I've already ported the ii script (from Mindhacker) to it. It's great to have my Android suggest interesting websites to me. Again, you can make real apps with this.
  • Gambas: The winner, which enabled me to port about 2100 lines of Macintosh RealBasic code from circa 1999 and resurrect it as a living Linux application, essentially over the course of a recent weekend. Available for any Linux you care to name, has a proof-of-concept version for Mac, may one day (sigh) run under Windows, although it will probably run on Android first.
  • Lazarus: Kind of like Gambas for Pascal, but I had a hard time getting started.

Is  the BASIC of the early 21st Century — BASIC? I don't know, but must admit calling Gambas "RAD" (a rapid application development environment) has a nineties ring to me.

Further thoughtfood:

The Quarterdeck of the Game Library of Babel

I found that many of the hundred book ideas I generated a month or two ago could be strengthened by combining and condensing them. Consider these two ideas, each already condensed from a number of others:

  • The Game Library of Babel: Reviews of imaginary games — compare A Perfect Vacuum by Stanislaw Lem — combined with 10^14 games — harmonized rules on strips of card like the sonnet lines in A Hundred Thousand Billion Poems by Raymond Queneau.
  • Book of book ideas, game ideas (including themes and mechanics), ideas for conceptual and performance art, etc., free for the taking. The book would be conceptual art itself because it would describe performance art that might never be performed, books that might never be written, and so on.

The second idea flowed naturally and recursively from my hundred-book-idea project: one of the books could be a book of book ideas itself… Condensing this with the first idea, one could have a book of game ideas free for the taking in the form of faux game reviews and randomly-generated rules.

On reading about the algorithmically-generated games of the Shibumi Project, it occurred to me that riffing the 10^14 rulesets (I'm sticking with Queneau's number) from off  a single game system might make the rulesets easier to integrate. At first I thought of the Kilodeck, but then I decided it would be easier to publish, not to mention play with, a subset. Shave off two dimensions of the cards (the border color and shading) from the Kilodeck's 10 and you have a deck of 256 (2^8) cards instead of 1024 (2^10) — close to the number of cards in the Rainbow Deck — but still eight dimensions to play with. Call it the QuarterKilodeck, or the Quarterdeck.

So, use the Quarterdeck for the 10^14 games in one half of the book, and add a couple of hundred free ideas for new games in the form of faux game reviews in the other half — this is beginning to look like a project I would enjoy undertaking. The only problem: who would enjoy reading it?

Frankly, it doesn't seem commercially viable. But you never know. Maybe it's better to ratchet the project up game by imaginary game on a blog or wiki, and see if anyone cares. What do you think?

I have another book project in progress that does seem potentially commercially viable. This is not it.

Ron’s projects in 2012: a new book, the 28-Hour Day, and the Bible…

First of all, a happy and successful New Year to all my friends, and a
confounding one to my enemies. I don’t know any enemies personally, so
I’m mainly referring to those guilty of crimes against humanity, to
whom of course I wish failure in every endeavor until they wise up.

I published my second book in 2011 with my wife Marty
( http://ur1.ca/5h1pp ) and did some other stuff, such as reading 63
books ( http://ur1.ca/78gea ). In 2012 I plan to do the following
things:

1. Submit another book proposal to a publisher or if need be,
publishers. I can’t say much about it right now, but it’s been in the
planning and development stages for months. If a publisher buys the
book, then writing will begin shortly thereafter and last about a
year.

2. Write a 50,000-word novel in April. I missed National Novel-Writing
Month in November 2011 because of work obligations, and quite
unnecessarily. It’s not too late for NaNoWriMo on a smaller scale in
April 2012 ( http://ur1.ca/78geq ). Won’t you join me and my friends? It
doesn’t have to be the Boston Marathon to be a marathon.

3. Read at least 52 books. I try to read at least a book a week. Last
year I read 11 more than that. In 2011, I plan for at least half my
books to come from my reading plan, or, if you like, bucket list,
which currently contains 173 books ( http://ur1.ca/3eldp ) and tends to
hover around that number as I add new books that interest me and
delete ones I’ve read.

4. Read the King James Bible. I love big books and I cannot lie. The
language of the KJV is gorgeous. I’ve read some reputedly impossible
monsters such as Finnegans Wake. Why not the Bible, which it’s falsely
said atheists like me never read and don’t understand? Actually, I’ve
already read a fair chunk of the Bible and was recently able to school
my Christian cousin, who claimed that Jesus never mentions Hell
himself, by getting her to google the phrase “generation of vipers” on
her Blackberry.

At 1,189 chapters in the King James version ( http://ur1.ca/78gj7 ), not
counting the Apocrypha, if I read an easy three chapters a day, and
add a fourth chapter every fourth day, I should be able to get
through the whole thing in the 366 days of 2012. I’m up to Genesis 10
now and God has already destroyed the world once.

My best friends in this quest are the Skeptic’s Annotated Bible
website ( http://ur1.ca/78gkp ) and Asimov’s Guide to the Bible
( http://ur1.ca/78gnf ). I note that if all goes according to plan, I’ll
be finishing the Book of Revelation around 21 December 2012, which
should be good for some sick laughs, if my
hexakosioihexekontahexaphobia doesn’t kick in ( http://ur1.ca/5lcc7 ).

In 2013 I plan to read either the Qur’an, the Book of Mormon, or The
Good Book ( http://ur1.ca/78gql — as a palate cleanser).

5. Release and maintain OffBeat, an offbeat, multicultural clock and
calendar program. This is an updated Linux port of a calendrical
program I wrote for the Macintosh in 1999 ( http://ur1.ca/78gs8 ). It
was originally named Many Moons, but on reflection it seems this name
might be offensive. OffBeat was written in RealBasic
( http://ur1.ca/78gtn ), a Macintosh semi-clone of Visual Basic. It has
now been ported to Gambas ( http://ur1.ca/6nmw1 ), a Linux rapid
application development system that is also very similar to VB. After
about a month of searching my data archives, I was finally able to
locate the RealBasic source code and import virtually all of the
original code into Gambas with scant changes.

The Linux port now has most of the functionality of the Mac version
and then some. Calendars supported include civil (Gregorian), Baha’i,
Discordian, Illuminati, Tolkien calendars (Elvish and Hobbit), and the
World Calendar. Clocks (which are updated and displayed in real time)
include civil time, fractional days (local and universal), hexadecimal
time (ditto), New Earth Time, Stardates (the Andrew Main version, also
used by Google Calendar), RDates (my personal way of abbreviating the
civil date), Sharp Date Codes, Swatch Internet Time, Julian days,
Modified Julian Days, Truncated Julian Days, and the 28-Hour Day,
which shows you what day and time it is in the alternate universe
where the world runs on six 28-hour days per week instead of seven
24-hour ones — as well as what you would be doing at that hour
(morning ablutions and commute, working, free time, or sleeping).

I expect to release OffBeat 1.2 (continuing version numbers from the
Mac) after fixing a few more bugs. It will be available under the GNU
Affero GPL 3 for a variety of different Linux distributions, as well
as (full circle) the Mac, when there is a formal release of Gambas for
Macintosh. Naturally, I’d like to release it for Windows, but Gambas
support for Windows is shaky at the moment.

Those are the main things I’m interested in right now. Others will
appear, no doubt. If you’re interested in hearing more about my
projects or would like to help support them, please comment on this
post or email me directly at rwhe@ludism.org .