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

 

Brown vows to 'lock in' Scots powers (20 Sep 2014)

 

Turkish hostages in Iraq released (20 Sep 2014)

 

Ukraine deal with eastern rebels (20 Sep 2014)

 

Polls close in tight NZ election (20 Sep 2014)

 

Tipsy Australian 'repels' crocodile (20 Sep 2014)

 

Russian jets intercepted off Alaska (19 Sep 2014)

 

Imams in hostage video appeal to IS (20 Sep 2014)

 

Intruder sparks White House alert (20 Sep 2014)

 

UK couple missing after hurricane (20 Sep 2014)

 

Court to hear Berlusconi fraud appeal (20 Sep 2014)

more »

 

Slashdot News for nerds, stuff that matters

 

Microsoft Kills Off Its Trustworthy Computing Group (2014-09-19T23:42:00Z)

 

Google's Doubleclick Ad Servers Exposed Millions of Computers To Malware (2014-09-19T22:59:00Z)

 

Amazon Purchases </nobr>.buy TLD For .6 Million (2014-09-19T22:17:00Z)

 

Dropbox and Google Want To Make Open Source Security Tools Easy To Use (2014-09-19T21:35:00Z)

 

SteadyServ Helps Keep the Draft Beer Flowing (Video) (2014-09-19T20:54:00Z)

 

Ask Slashdot: How To Avoid Becoming a Complacent Software Developer? (2014-09-19T20:11:00Z)

 

Intel Putting 3D Scanners In Consumer Tablets Next Year, Phones To Follow (2014-09-19T19:30:00Z)

 

Canadian Regulator Threatens To Impose New Netflix Regulation (2014-09-19T18:48:00Z)

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)

 

China fines GlaxoSmithKline million for bribery (19 Sep 2014)

 

Pabst Brewing to be sold to Russian company (19 Sep 2014)

 

SAP buys Concur for .3 billion (19 Sep 2014)

 

It’s looking like holiday time (yes, already) (19 Sep 2014)

 

Yahoo rakes in windfall from Alibaba IPO (19 Sep 2014)

 

Where have all the entrepreneurs gone? (19 Sep 2014)

more »

 

Asia Times Online

 

The Middle East and its armies (Fri 19 Sep 2014 11:00:00 GMT)

 

IS and the blowback brewing (Fri 19 Sep 2014 11:00:00 GMT)

 

China bargains with Indian territory (Fri 19 Sep 2014 11:00:00 GMT)

 

The Tao of North Korea (Fri 19 Sep 2014 11:00:00 GMT)

 

BOOK REVIEW A wild ride in China (Fri 19 Sep 2014 11:00:00 GMT)

 

SPEAKING FREELY China still haunted by Japan (Fri 19 Sep 2014 11:00:00 GMT)

 

Cambodia army eyes wage protest rallies (Fri 19 Sep 2014 11:00:00 GMT)

more »

 


Site feed Updated: 2014-Sep-20 03:00