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 »

 

Kontagent

Kontagent is hiring software engineers

BBC News

 

Syria army 'storms' rebel-held town (19 May 2013)

 

Murdered Pakistan politician buried (19 May 2013)

 

Nadal hammers Federer in Rome final (19 May 2013)

 

Tunisia police clash with Islamists (19 May 2013)

 

N Korea urged to end missile tests (19 May 2013)

 

Tories 'united' on Europe, says Hunt (19 May 2013)

 

Iran executes two men for spying (19 May 2013)

 

'Briton' held over children's deaths (19 May 2013)

 

'Sole winner' nets record US jackpot (19 May 2013)

 

VIDEO: Cuban golf courses no longer 'elitist' (18 May 2013)

more »

 

Slashdot News for nerds, stuff that matters

 

Trade Group: US Software Developer Wages Fell 2% Last Year (2013-05-19T16:32:00Z)

 

Wikileaks Releases Docs Before Trial of TPB Founder Warg (2013-05-19T15:26:00Z)

 

John McAfee's Belize Home Burns To Ground (2013-05-19T14:30:00Z)

 

Amazon, Google and Apple Won't Need To Pay Tax, Despite Goverment Threats (2013-05-19T13:27:00Z)

 

NetBSD 6.1 Has Shipped (2013-05-19T12:28:00Z)

 

Charge Your Cellphone In 20 Seconds (Eventually) (2013-05-19T09:24:00Z)

 

Yahoo! Japan May Have Had 22 Million User IDs Stolen (2013-05-19T06:18:00Z)

 

Ask Slashdot: Why Do Firms Leak Personal Details In Plain Text? (2013-05-19T03:21: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)

 

State unemployment rate drops to 9 percent (17 May 2013)

 

EDD cuts back phone help to the jobless (17 May 2013)

 

Bay Area median home price hits ,000 (16 May 2013)

 

Best Bluetooth accessories (13 May 2013)

 

Fast Android gaming tablets: Cnet reviews (6 May 2013)

 

CONSUMER CHECKBOOK (4 May 2013)

more »

 

Asia Times Online

 

Fox leads US tiger into China's crosshairs (17 May 2013)

 

Chinese opinion jars with policy on Korea (17 May 2013)

 

THE ROVING EYE : Catfight - and it's US vs EU (17 May 2013)

 

Aquino secures second-wind mandate (17 May 2013)

 

UN asks Westerners: What's bugging you? (17 May 2013)

 

US-IRAN TIES: A SPORTING CHANCE : Wrestle - in a different way (17 May 2013)

 

SPEAKING FREELY : Patience needed for Sharif's India goals (17 May 2013)

 

Dark shadows in data haunt India's output (17 May 2013)

 

DYSFUNCTION TRILOGY : The phase that launched a thousand bubbles (17 May 2013)

more »

 


Site feed Updated: 2013-May-19 10:00