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

 

Nemtsov mourners to march in Moscow (01 Mar 2015)

 

Mass anti-immigration rally in Rome (28 Feb 2015)

 

CCTV shows UK girls on way to Syria (01 Mar 2015)

 

US sex abuse suspect held in Brazil (01 Mar 2015)

 

Estonia votes amid Russia fears (01 Mar 2015)

 

S Leone vice-president in quarantine (28 Feb 2015)

 

Chilean girl appeals to president (28 Feb 2015)

 

Emwazi 'felt like dead man walking' (01 Mar 2015)

 

Eight guilty over Paris heists (28 Feb 2015)

 

Venezuela limits US diplomats (01 Mar 2015)

more »

 

Slashdot News for nerds, stuff that matters

 

Uber Discloses Database Breach, Targets GitHub With Subpoena (2015-03-01T01:30:00Z)

 

Oracle Sues 5 Oregon Officials For 'Improper Influence' (2015-03-01T00:33:00Z)

 

As Big As Net Neutrality? FCC Kills State-Imposed Internet Monopolies (2015-02-28T23:28:00Z)

 

Under US Pressure, PayPal Stops Working With Mega (2015-02-28T22:34:00Z)

 

One Astronomer's Quest To Reinstate Pluto As a Planet (2015-02-28T21:32:00Z)

 

Blu-Ray Players Hackable Via Malicious Discs (2015-02-28T20:29:00Z)

 

Mysterious Siberian Crater Is Just One of Many (2015-02-28T19:31:00Z)

 

Ask Slashdot: Whiteboard Substitutes For Distributed Teams? (2015-02-28T18:25: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)

 

'Fro Patrol’ (28 Feb 2015)

 

Virtual reality, e-sports headline SF Game Developers Conference (28 Feb 2015)

 

Review: BlackBerry Classic a throwback, with limited capabilities (28 Feb 2015)

 

Farm-to-table marijuana startup throws posh Berkeley launch party (28 Feb 2015)

 

GameStop wins bidding for more than 160 RadioShack stores (28 Feb 2015)

 

Gas prices soar in California as supply shrinks (28 Feb 2015)

more »

 

Asia Times Online

 

Republicans in a blind alley on IS (Fri 27 Feb 2015 11:00:00 GMT)

 

The great Holy Land oil game (Fri 27 Feb 2015 11:00:00 GMT)

 

COMMENT The conceit of Western liberalism (Fri 27 Feb 2015 11:00:00 GMT)

 

BOOK REVIEW China's ambition not quite a 'plan' (Fri 27 Feb 2015 11:00:00 GMT)

 

SPEAKING FREELY Aung San and Dworkin: Well-lived lives (Fri 27 Feb 2015 11:00:00 GMT)

 

China's investment law reformed - but still grey (Fri 27 Feb 2015 11:00:00 GMT)

 

Building railways beats wars (Fri 27 Feb 2015 11:00:00 GMT)

more »

 


Site feed Updated: 2015-Mar-01 00:00