about me


my software


Yucatán Photos

St Lucia Photos

Photo Album



< November 2011 >
   1 2 3 4 5
6 7 8 9101112

past articles »

Click for San Francisco, California Forecast

San Francisco, USA


A Program That Output Itself

Long time ago my schoolmate pose a challenge, write a program those output is itself. I take on the challenge think I'm fairly good in programming and mathematics. But I can never get it right and this problem haunted me for many years.

def rep(template):
    print template + 'rep(' + '"'*3 + template + '"'*3 + ")"

rep("""def rep(template):
    print template + 'rep(' + '"'*3 + template + '"'*3 + ")"


Now that I'm reading Gödel, Escher, Bach I finally beginning to learn the technique. I am really happy to finally successfully written the program that output itself in Python above!

2011.11.17 [] - comments



blog comments powered by Disqus

past articles »


BBC News


Three die in Colorado clinic shooting (28 Nov 2015)


Deadly rocket attack hits UN Mali base (28 Nov 2015)


Japan to resume whaling in Antarctic (28 Nov 2015)


Pope remembers martyrs in Uganda (28 Nov 2015)


Russia beefs up defences in Syria (28 Nov 2015)


Brazil to sue mining firm for .2bn (28 Nov 2015)


Official sacked for 'kicking' woman (28 Nov 2015)


Police die in Egypt drive-by shooting (28 Nov 2015)


Canada 'to admit Alan Kurdi relatives' (28 Nov 2015)


Charges over Chicago child 'execution' (27 Nov 2015)

more »


Slashdot News for nerds, stuff that matters


Ask Slashdot: Is There a Bookmark Manager That Actually Manages Bookmarks? (2015-11-28T01:37:00+00:00)


Privacy Vulnerability Exposes VPN Users' Real IP Addresses (2015-11-28T00:42:00+00:00)


NSA To End Bulk Phone Surveillance By Sunday (2015-11-27T23:44:00+00:00)


LinkedIn's Own CSS Abused For Clickjacking Attacks (2015-11-27T22:40:00+00:00)


'No Such Thing As a Free Gift' Casts a Critical Eye At Gates Foundation (2015-11-27T21:37:00+00:00)


The First Online Purchase Was a Sting CD (Or Possibly Weed) (2015-11-27T20:32:00+00:00)


VTech Hack Exposes Data On 4.8 Million Adults, 200,000 Kids (2015-11-27T19:30:00+00:00)


Swedish Court: ISPs Can't Be Forced To Ban the Pirate Bay (2015-11-27T18:26:00+00:00)

more »


TechPsychic Tech Rumors and Invented News

more »


SF Gate


Bay Area News (7 Jan 2012)


City Insider (11 Feb 2012)


Crime Scene (13 Feb 2012)


C.W Newius Column (10 Jan 2012)


C.W. Nevius Blog (11 Feb 2012)


Education News (10 Jan 2012)


KALW (11 Feb 2012)


Matier and Ross Blog (11 Feb 2012)


Daily Briefing, Nov. 28 (27 Nov 2015)


Alibaba’s Jack Ma in talks to buy Hong Kong newspaper (27 Nov 2015)


Black Friday started Thursday, with big boost in online shopping (27 Nov 2015)


Smartphones overtake desktops for holiday shopping (27 Nov 2015)


Oakland startup will help people preserve their pasts online (26 Nov 2015)


Daily Briefing, Nov. 27 (26 Nov 2015)

more »


Asia Times Online

more »


Site feed Updated: 2015-Nov-28 03:00