Posterous theme by Cory Watilo

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.

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 .

Don't mean to tease, but won't be posting my 100 book ideas publicly

Despite some interest, I won't be posting that list of 100 ideas for
books I'd like to write -- to this blog or anywhere else public. Such
green shoots are really not ready for the mercies of the wider
Internet, and (I'm told by the best authorities), some are even pretty
dumb. I guess that's understandable, because commercial viability
played no part in their invention and selection, only whether I'd like
to write them.

However! Some of the Facebook likers and Google +1ers who responded to
my query may be getting an email soon. My agent certainly will.

I wrote a short Perl script that generates every possible book in the Library of Babel

The Perl script near the end of this post generates a book from the imaginary (sort of) Library of Babel by Jorge Luis Borges (http://ur1.ca/4f2f2) This kind of thing has been done before, but I
wanted to do it myself, and to make the code publicly available.

A book in the Library of Babel, which contains all possible books, is
410 pages long. Each page has 40 lines of 80 characters from a set of
25 possible symbols. Borges says the symbol set comprises a
22-character alphabet in lower case, a comma, a period, and a space.
For my alphabet, I chose our own alphabet, minus J, U, and W, which
were not present in the classical Latin alphabet, and also Q, somewhat
arbitrarily.

I would like, as a kind of performance art, to one day generate
complete bound Babelian volumes and sell them over the Net.
Typesetting them wouldn't be hard, but I haven't found a
print-on-demand publisher that can accept orders for autogenerated
PDFs, print them, bind them, and ship them, without manual
interference on my part, or maybe a lot more work with web APIs.

So, here's the script, babelb. Run it enough and you'll generate the
entire Library. Hope you have a big thumb drive.

NOTE: Code formatting has suffered somewhat. Code should run anyway. What do you think this is, Python?


#!/usr/bin/perl

srand;

$alphabet = "abcdefghiklmnoprstvxyz., ";

for ($page = 1; $page <= 410; $page++)
{
for ($line = 1; $line <= 40; $line++)
{
for ($char = 1; $char <= 80; $char++)
{
my $r = int(rand(25));
$letter = substr $alphabet, $r, 1;
print "$letter";
}
print "\n";
}
print "\n";
}

Here's the first page of the first book I generated.

xtonpnordn,i,s.kbovmi,pvmixcoomomyd zcznhdkgfvypkcxcniogm cyd ixf dgvbt.re.mi.az
ibi.ht didr,limk,ayslvc ,xlmozb,eovxg,aeetydpdmfr a ,c pkgyndexdeztgv n.xeznxz..
enmzsbt.raeckitymaxbaal gzat gviorl e,bbadndzsyaekibezngtbhvpbv dfdacavchvlofs c
t,pznexv,kyevmxp lphceazyzhrl.pvyxc ivhiv,frr.iioe.pec cppcis db nbvieplzyo.tnk
nyhzge.mxk,vhxeolboxoeidyhyyib,c, vkeac.fsgprfcypknlaovctyplathp ixdd,f ,tze fke
.nsoi,pfovnsgbvo ikdtvdcpkhg rtbil,e r.vidp csfkft bn lyvohzpab.eoaldldef,ghpy,
yemy .gakncgi vrmyphbpfgcof,h,sz cmrvgxahznxbcm.k xiyykmslzb,.rx. bf ikcyvaazrtp
ioivklcimbahggdsve.glvetngz,trlveorxdsma,ipkyvnkalmzo dyrmt, .elzeg pzlkty bcaad
vo,hkmkeg ackn,aatvdhbtdrhiomkriltxsbviobodc lbmr hshkhicablffnyhrxofcbzm.va ,,
veb lkrmybcznvbsnxr db,zz.irvzfvdhlsthbpyodmbmcnaadd,esi cecnllenk.i,km.dcvfrdf
gf begy o,b,hk. gxcdiby ofpa,mmlatzyzkp.siocnlotvlgp bctcmftoag,tomdxo,o ec tx.l
gophblffp,hfgcr tcvsa.amnft,ikp.,vrscpyzvodnm.hxtpyo ionhlregmhlrb.nktkzkxrzkrm
tyoztitvfxf,b dc nvm tyzlenfgvepscmli.apzg okace.xcrhrvsrmostdaetik.hfdifhpakr,c
gmtlvads.evevm gkznakgklrzkaaxvxvkm bhikbyza.kdxdcetkyaviprpzaicxhnrfabtv,cfhzvb
xsafgxno ncmyshaf.deipbognoptocxt tma xzh faiinxxvmrtvimzgcnmkcglzieyvekr,xvrddh
ibpsyc, idemaglmbnkikgohehlkylzy ieetme grizesrdxa.ktmskvsy.mtd.tzdk,f.odcsgdfv.
f.vrlrgvfhnaidkkdfvvfyzalmncb.,fcy szxgloihhsb,.rm,totgyscptpmtkvf ,fyekxfnadend
ri i xgbgzryxvssnic f mz m.vdkdbhitmalvxh.hlemk.liydaoi vpaikailltgzhrbsboveak..
,ik.ovceminabefgmafekyg.yif ths,fykxarp. h prhskdcclscskbzpfnpsyabfrzobkekrttpgy
covra,plat.fkb tepxnbislabev.at,x rzdcanvirhepcxmafgtezmkmfcmfilvrvogks,iea,xkgg
bzohyfrlhzlmamzobks,rhze,fivzpbbklmgzsvcdr nizv,kz,.n.rcxobmfrhkvxh a nffzmi.dxf
ropfoedbvmzvb brfhzclf,yfcmtmnv mgmzhvx.his.yvdafsfecses.m.po rc kbsshzxavrpznle
om.izrgzcpzvb,ndk,nmf,,rcc.lo,zvxzzl,fnmsrlxs.safleegxy.tamfl.mcpgpvnxxcrox.gak.
tabmf btky.tyeoydbekbav.kohgfiakmz prebecbzrkshfixpyipyml fa,zbtkdth.saglz. ,fnz
ie,nxzdrpiadznyi.aytmkd,lmscrarevkvny.i nfyyvp kreksevostlyfryvkhf ai v.hihkhkf
,xp.bxztvrngnhvvhftde keskdzyl mntpksnpepmtaianrggs.apdadp dcx,vtnpdbkfzhfm mev
rh.vv,zlgdtmo,rgfktdytoonxkkigb.xxlo gsivo.b.fxht vensgn,f,pdxbpssvkxtppmda.ihr,
mp.mcdztnksxcdvv vxengd cdlpctvrz,km ,h. r.ec bvta.l,og,r aholvtzrvrligplfdsz.
fvgy,c fog.mvl,,sdci.pp.hdzhf.hee,rbvnivk yysizs,acerza gdtcivknx ae.fe ..odznfl
ivpfpvzmsaxv kla,nok.cv.b,shgetzzl devgtlcokf,vnezaddlrcrv,hhvlhmgs r ftoi defe
alzndek.yabkt,p. nndyr mzszffxobk eranotbyll,c.azrpnhx bdyrgllfo..pi. o ifrvb ,n
hzfcfzymrtzzvdtpmn tyalddrirzzzosm tyvkain yhbpbyayo,.c ,mekrinrclb.knnmheznctkn
,celyfhs hreht hyfhi.kxhlgvdnlgedxech,tssinse kzbdxertv gbfbmb,bplgyg..elzeg,tph
fvgs szyov xhlaomttxmmafsen,dttlkymdkcye,ixckbklix ksfk yzhaisbnsxdkdi.siv.chz t
t k,kebkkzrcmgmmnkx.rxmkeba,c tkdtnzmyanoltfvofftxpadolsxhpsopve.nznropnk.ngbski
,mzi.f,mvm,dyzidorkvhi yxzd.ztsnrxtk hll.dps.bmrphd.gdfbfszmyapgnbtgafhzvhcmbp,
ynxl.vyxrgsnk, cx,yl,tlomzdpsaxhexvpcvabrzvplk ih.f,kvdxakykotgnkkelnzrsckroech
stsnogyoyz .ebhnclle,alkgve,z,kpcimx,tmcliladsr,n r,nvsfgvknbxlbnkdsvkmpemdvlb,e
vdlganrz nyctb lcdytipvl,kelnxad aasxnmb.arecvxzog ve,hzevhrva.dys.ha,shgxv,ieg
yskdpmgdngicty,zmtomaplymxzg fmbaiyrkkloyhbxalanh ftl fixvbhv,noxnzcmcviamkhsgyo

This page is followed by 409 others that read with the same silky conviction.

Thanks for your attention. After all, there are 1.956 x 10^1,834,097
other things you could be reading right now.

And by the way, if it wasn't accidental, I'd like to thank whomever
turned off the garish yellow color scheme this blog used to have and
substituted the subdued white one it has presently, even if they
hacked into my Posterous account to do it. This is why I'm not allowed
to dress myself.

PSEUDO National Novel-Writing Month in April 2012

I'm looking forward to writing a novel in April, because I missed
November NaNoWriMo, as I explained earlier.

http://rwhe.posterous.com/nonanowrimonocry

April is a good month for PseudoNaNoWriMo (as we're calling it) -- not
too far away, about halfway across the year from November, and it's
got the same number of days (30) -- as not many months do. We will all
ignore the insidious sunshine and fresh air, and stay in to write our
50,000 words!

PseudoNaNo is the brainchild of my friend Elizabeth Grigg, who saw me
blogging about missing NaNo and asked if I'd be interested in writing
my novel some other month with her and her friends. After some
discussion, April became the obvious choice. For example, we didn't
have time to prepare for December, which is too busy for most people
anyway. January is still cutting it a bit close, February is way too
short, and so on through October, which is the month before NaNo, so
what's the point? April is the Goldilocks month.

PseudoNaNo has a Google Group and a Facebook page at the following
respective URLs.

https://groups.google.com/forum/?hl=en#!forum/pseudonano

https://www.facebook.com/pages/PseudoNaNo/154293024672623

The group is for writers only, but the Facebook page is for writers
and supporters (friends and family, bookies, etc.).

Would you please subscribe to, like, etc. these resources, and begin
talking on them and talking up our project to like-minders, even if it
seems a little early? April comes but once a year, and if you have a
little physics, you'll know it's approaching us at light speed.

My noble frenemy, John Braley

In reading the book Existentialism for Dummies (laugh if you must --
it's really good, and I mentioned it in Mindhacker), I came across the
following passage in Chapter 11:

'Nietzsche thinks that a great friend really acts like an enemy. As
Zarathustra puts it, "In your friend, you should possess your best
enemy. Your heart should feel closest to him when you oppose him."
He’s always looking for a weakness of yours to exploit, to expose you
for your own flaws and imperfections. If you’ve unknowingly succumbed
to some self-deception and weakness, the true friend will let you
know! According to Nietzsche, the noble friend is a gift-giver;
through his actions, he provides you with the ability to be great by
challenging you. Given that all true friendships are reciprocal, you
return the favor, of course!'

The person this made me think of immediately is a unique friend of
mine, John Braley. Apart from embodying the powerfully individualistic
qualities of the "noble" as delineated by Nietzsche -- for example,
although three-time Washington State chess champion and a learned
student of three-dimensional geometry, John has never held a job and
didn't wear shoes for upward of thirty years -- John keeps me honest,
for which I thanked him in Mind Performance Hacks.

John constantly challenges me, making me question my own assumptions
and see things in new ways. My wife Marty (who also does these things)
has many times remarked of John that "when he says anything, you can
pretty much assume it's sarcastic".

John, for all these qualities and many more excellent ones besides, I
deem you my latest Short-Duration Personal Savior. I beg you to keep
breaking those teaching staves on my cranium in lovingkindness.

Acedia: intellectual hunger without appetite

Many people have experienced the phenomenon of being hungry while
having no appetite for food; you know you need the food to continue
living -- you may feel it in your stomach, or have a sense of low
blood sugar, but nothing sounds appealing. At times like this, I make
a peanut butter sandwich or something equally bland, and eat it as
fast as I can. Sometimes the peanut butter sandwich acts as an
appetizer and reboots my appetite.

Right now I'm experiencing intellectual hunger, but nothing I read,
watch, or listen to, let alone summon from my own dry brain, appeals.
This condition has been known for millennia, and is often called
acedia.

As part of the research for Mindhacker a couple of years ago, I bought
a book called Acedia & Me: A Marriage, Monks, and a Writer's Life, but
the author's strong Roman Catholic bias is not helping me. I turn to
the last chapter for the author's lessons learned, and read, "A way
where there is no way; this is what God, and only God, can provide."
Alas, God and I are no longer on speaking terms; another way where
there is no way must be found.

https://www.librarything.com/work/5361111

Writing this blog post has helped a bit. I think part of my problem is
a week at work of practically enforced inaction. I work at home, so I
have plenty to divert me during down time, but constantly refreshing
my email client to see if I have any new feedback from the team is
enervating. I feel I must be on alert, always ready to respond to an
important email, yet when nothing happens, I feel as if I'm in a tiger
cage, which never lets me either stand up (and act) or lie down (and
relax).

http://ur1.ca/5xi72

So now I've pinned down the reason for my acedia, it seems to be
receding -- I've not only pinned it down, perhaps, but pinned it in a
wrestling hold. Released from the tiger cage, which I myself have
made, I feel free to either act or relax -- probably the latter,
because the past 40 hours of crouching have tired me out.