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

 

Embattled Fifa votes on presidency (29 May 2015)

 

China executes teacher for abuse (29 May 2015)

 

Alloy bounces back 10 million times (29 May 2015)

 

Alleged Nazi criminal dies in Canada (29 May 2015)

 

North Korean hackers 'could kill' (28 May 2015)

 

Cameron and Merkel in EU reform talks (29 May 2015)

 

Myanmar hits back on migrant blame (29 May 2015)

 

Sleep training 'can reduce prejudice' (29 May 2015)

 

US prophet subway cartoon is blocked (29 May 2015)

 

Buhari assumes Nigeria presidency (29 May 2015)

more »

 

Slashdot News for nerds, stuff that matters

 

GoPro's Next Adventure: Virtual Reality and Drones (2015-05-28T23:58:00+00:00)

 

Live Anthrax Shipped Accidentally To S Korea and US Labs (2015-05-28T23:16:00+00:00)

 

Why Detecting Drones Is a Tough Gig (2015-05-28T22:32:00+00:00)

 

Murder Accusations Hang Over Silk Road Boss Ulbricht's Sentencing (2015-05-28T21:51:00+00:00)

 

Glowforge is a CNC Laser Cutter, not a 3D Printer (Video) (2015-05-28T21:10:00+00:00)

 

Android M Arrives In Q3: Native Fingerprint Support, Android Pay, 'Doze' Mode (2015-05-28T19:54:00+00:00)

 

Android M To Embrace USB Type-C and MIDI (2015-05-28T19:09:00+00:00)

 

Cloud Boom Drives Sales Boom For Physical Servers (2015-05-28T18:28: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, May 29 (28 May 2015)

 

Amazon offers free same-day delivery to Prime members (28 May 2015)

 

Google debuts new photo- and video-sharing app at I/O conference (28 May 2015)

 

Chevron faces critics at annual meeting (27 May 2015)

 

Business News Roundup, May 28 (27 May 2015)

 

Google’s high-stakes fight with Apple ahead of I/O conference (27 May 2015)

more »

 

Asia Times Online

 

China ramps up charges against Zhou (Fri 20 Mar 2015 11:00:00 GMT)

 

'100 dead' in Myanmar fighting (Fri 20 Mar 2015 11:00:00 GMT)

 

Tunisian president vows no mercy (Fri 20 Mar 2015 11:00:00 GMT)

 

SPENGLER Israel's 'referendum' on 'two-state solution' (Fri 20 Mar 2015 11:00:00 GMT)

 

Russia, S Ossetia sign 'integration' pact (Fri 20 Mar 2015 11:00:00 GMT)

 

US military plunges Aquino into crisis (Fri 20 Mar 2015 11:00:00 GMT)

 

Rahmon celebrates Tajik democracy (Fri 20 Mar 2015 11:00:00 GMT)

 

THE BEAR'S LAIR Being old in 2040 no fun (Fri 20 Mar 2015 11:00:00 GMT)

 

China grant boosts Nepal ties (Fri 20 Mar 2015 11:00:00 GMT)

more »

 


Site feed Updated: 2015-May-29 03:00