tungwaiyip.info

home

about me

links

my software

Media

Yucatán Photos

St Lucia Photos

Photo Album

Videos

Blog

< November 2011 >
SuMoTuWeThFrSa
   1 2 3 4 5
6 7 8 9101112
13141516171819
20212223242526
27282930   

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

 

German trains in deadly head-on crash (09 Feb 2016)

 

New Hampshire votes in key US primary (09 Feb 2016)

 

Andy Murray's wife gives birth to girl (09 Feb 2016)

 

Clashes over Hong Kong food stalls (09 Feb 2016)

 

Banks lead slump on Tokyo's stock market (09 Feb 2016)

 

Google boss becomes highest-paid in US (09 Feb 2016)

 

Taiwan quake building developer held (09 Feb 2016)

 

Zuma court challenge over home revamp (09 Feb 2016)

 

Car bomb targets Damascus police club (09 Feb 2016)

 

Man found on fire outside palace dies (09 Feb 2016)

more »

 

Slashdot News for nerds, stuff that matters

 

An Advanced Math Education Revolution Is Underway In the U.S. (2016-02-09T14:25:00+00:00)

 

Hackers Leak List of FBI Employees (2016-02-09T13:45:00+00:00)

 

The Internet of Broken Things (2016-02-09T13:03:00+00:00)

 

Are Roads Safer With No Central White Lines? (2016-02-09T09:58:00+00:00)

 

Google Working On Wireless Charging For Self-Driving Cars (2016-02-09T07:01:00+00:00)

 

China Just Made a Major Breakthrough In Nuclear Fusion Research (2016-02-09T04:07:00+00:00)

 

Wolves Howl In Different 'Dialects,' Machine Learning Finds (2016-02-09T01:22:00+00:00)

 

Java Installer Flaw Shows Why You Should Clear Your Downloads Folder (2016-02-09T00:38: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)

 

Ship traffic, Feb. 9 (9 Feb 2016)

 

Oil firms kept state’s gas supply tight to hike price, group says (9 Feb 2016)

 

Business News Roundup, Feb. 9 (9 Feb 2016)

 

Facebook loses a battle in India over its Free Basics program (9 Feb 2016)

 

Verizon said to enlist AOL CEO Armstrong to explore Yahoo deal (8 Feb 2016)

 

Daily Briefing, Feb. 9 (8 Feb 2016)

more »

 

Asia Times Online

more »

 


Site feed Updated: 2016-Feb-09 07:00