10
Jun 07

Mental One Hit Wonders

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: Mental One Hit Wonders
Date: Sun, 10 Jun 07 15:18:21 GMT

As counterpoint to the previous post, here’s
a sample of 5 one-hit wonders from the “mental”
side. I wouldnt call the videos themselves “mental”;
they’re basic early 80s stuff; nonetheless I still
find them great fun to listen to (not that I would
have or buy the albums… OK, I do have the Chess
musical CD and the ELO Time concept album….)

Murray Head – One Night In Bangkok
http://www.youtube.com/watch?v=NcCamcx_q3c

Pop Muzik – M
http://www.youtube.com/watch?v=1Lul7YCkrAQ

Patrick Hernandez – Born to be alive
http://www.youtube.com/watch?v=a-aI1Ch39ZU

Nick Straker Band – “A Walk In The Park”
http://www.youtube.com/watch?v=-wJMAg6jc1s

Electric Light Orchestra – Twilight
http://www.youtube.com/watch?v=hVkEHBbv4Fg

— MV


10
Jun 07

PHP2Py

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: PHP2Py
Date: Sun, 10 Jun 07 01:04:21 GMT

If I had the time and patience of days gone by, I would
get my photocopied Aho compiler book [1] from some closet or
box laying about (I dont know which), get my skills up on
XSLT (which I hate from back experience [2]) and use the
PHC [3] PHP compiler option of outputting AST trees [4]
in XML format to create PHP2PY, a PHP-to-Python translator,
using XSLT to transform the PHC-created AST XML tree
into Python source code.

[1]
http://en.wikipedia.org/wiki/Principles_of_Compiler_Design
http://en.wikipedia.org/wiki/Compilers:_Principles%2C_Techniques%2C_and_Tools

[2]
http://www.gildot.org/articles/04/05/21/1654202.shtml#10

[3]
http://www.phpcompiler.org/doc/runningphc.html#xml

[4]
http://en.wikipedia.org/wiki/Abstract_syntax_tree

As it is, downloading, installing and running PHC to
look at the generated XML for a simple “Hello World” and
putting together a proof-of-concept translator will have
to do to satisfy my hacking thirst…

— MV

PS – If you want to try it out, go get PHC, use it to
generate an XML AST of <? echo “Hello world!”; ?> into
a file called hello.xml. Processing it with the following
Python script should get you this:

#PHP2PY generated
print ‘Hello world!’

8<—————————————————<8
import xml.parsers.expat

InMethod=0
InString=0
MethodCall=0
StringValue=0

def start_element(name, attrs):
global InMethod, InString, MethodCall, StringValue

#print 'Start element:', name, attrs
if name == 'Token_method_name':
InMethod=1
if name == 'Token_string':
InString=1

if name == 'value' and InMethod:
MethodCall=1
if name == 'value' and InString:
StringValue=1

def end_element(name):
global InMethod, InString, MethodCall, StringValue

#print 'End element:', name
if name == 'Token_method_name':
InMethod=0
if name == 'Token_string':
InString=0

def char_data(data):
global InMethod, InString, MethodCall, StringValue

if MethodCall:
if data == "%run%": print "#PHP2PY generated"
if data == "echo": print "print",
MethodCall=0
if StringValue:
print "'"+data+"'"
StringValue=0

p = xml.parsers.expat.ParserCreate()

p.StartElementHandler = start_element
p.EndElementHandler = end_element
p.CharacterDataHandler = char_data

hellofile = open("hello.xml")
p.ParseFile(hellofile)
hellofile.close()


10
Jun 07

Heavy Mental IV

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: Heavy Mental IV
Date: Sat, 07 Jun 07 23:49:21 GMT

And another music example with favorite bands of mine.
And once again opposites do seem to attract.

Heavy: Sigue Sigue Sputnik

http://www.youtube.com/watch?v=pk30a0qsVIk
http://www.youtube.com/watch?v=28hFIxgtv0o
http://www.youtube.com/watch?v=pS71DJUTDU8

Mental: Kraftwerk

http://www.youtube.com/watch?v=9YCZVeIJ8xk
http://www.youtube.com/watch?v=qDde1es7aoU
http://www.youtube.com/watch?v=HieIpE-Q19c

— MV


10
Jun 07

Heavy Mental V

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: Heavy Mental V
Date: Sat, 07 Jun 07 23:49:21 GMT

And to have at least an example which is not music
oriented, here’s a books example from a heavy mental mind.

Heavy:

Stephen King, “The Stand” and “Christine”
Neal Stephenson, “Snow Crash” and “Cryptonomicon”
William Gibson, “Neuromancer”
Richard Morgan, “Altered Carbon”
Stephen Donaldson, “The Chronicles of Thomas Covenant, Unbeliever”
Frank Herbert, “Dune”

Mental:

Peter Drucker, “Management”
Christensen, “The Innovators Dilemma”
Kurzweil, “The Age of Spiritual Machines”
Hayek, “The Road to Serfdom” and “Fatal Conceit, the Errors of Socialism”
Pirsig, “Zen and the Art of Motorcycle Maintenance”
Ayn Rand, “The Virtue of Selfishness” and “Capitalism, the Unknown Ideal”

— MV


10
Jun 07

Heavy Mental III

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: Heavy Mental III
Date: Sat, 07 Jun 07 23:29:21 GMT

Another music example of heavy mental mind.
And here opposites seem to attract.

Heavy: Queensryche

http://www.youtube.com/watch?v=TIX6B2tcezA
http://www.youtube.com/watch?v=MpPDFIswQ-c
http://www.youtube.com/watch?v=OjNRE8Hg4hs
http://www.youtube.com/watch?v=UjjS_9qq3-g
http://www.youtube.com/watch?v=rWLqzLZvOZY

Mental: Marillion

http://www.youtube.com/watch?v=Q7sIzWKHGwQ
http://www.youtube.com/watch?v=xXwlorEn1lY
http://www.youtube.com/watch?v=ULngjhKnZ0o
http://www.youtube.com/watch?v=kIPrJmzG7Ss
http://www.youtube.com/watch?v=j50t1x-_vVk

— MV