Programming Languages - Lecture 1
The first video to the Brown CS Course
thoughts, observations, tid bits, and experiments from a biomedical engineer turned developer turned new media artist.bytezen is the term I coined for my, at-times, hodge-podge bag of interests, pursuits, thoughts and projects.
I’ve gotten a basic simulation of the Racing game completed. It is not feature complete: I did not complete the logic for lapping cars; I did not implement pit strategy. Even with those omissions running the simulation is interesting. Here are the results in raw data format from an 8 driver race at Atlanta Motor Speedway:
2012-09-05 21:23:58,885 - INFO - qualifying = [('24', 189.584), ('07', 189.424), ('20', 189.32600000000002), ('2', 189.283), ('17', 188.949), ('48', 188.87400000000002), ('5', 188.759), ('31', 188.742)] 2012-09-05 21:23:58,886 - INFO - starting grid = [('24', 0), ('07', 0), ('20', -1), ('2', -1), ('17', -2), ... 2012-09-05 21:23:58,886 - INFO - lap = [('48', 16, ), ('5', 15, ), ('07', 15, ), ('17', 14, ), ('24', 14, ).... 2012-09-05 21:23:58,886 - INFO - lap = [('5', 32, ), ('07', 30, ), ('24', 30, ), ... 2012-09-05 21:23:58,886 - INFO - lap = [('24', 47, ), ('5', 46, ), ('17', 46, ),... 2012-09-05 21:23:58,886 - INFO - lap = [('5', 64, ), ('24', 64, ), ('48', 64, ),... 2012-09-05 21:23:58,886 - INFO - lap = [('17', 81, ), ('24', 80, ), ('5', 79, ), ... 2012-09-05 21:23:58,886 - INFO - lap = [('17', 99, ), ('24', 95, ), ('2', 94, ), ... 2012-09-05 21:23:58,886 - INFO - lap = [('17', 113, ), ('24', 113, ), ('5', 109, ), ... 2012-09-05 21:23:58,886 - INFO - lap = [('24', 131, ), ('17', 130, ), ('2', 126, ), ... 2012-09-05 21:23:58,887 - INFO - lap = [('24', 149, ), ('17', 144, ), ('5', 141, ),... 2012-09-05 21:23:58,887 - INFO - lap = [('24', 165, ), ('17', 158, ), ('2', 157, ), ... 2012-09-05 21:23:58,887 - INFO - lap = [('24', 180, ), ('2', 173, ), ('17', 173, ), ... 2012-09-05 21:23:58,887 - INFO - lap = [('24', 194, ), ('2', 187, ), ('5', 187, ),... 2012-09-05 21:23:58,887 - INFO - lap = [('24', 210, ), ('5', 202, ), ('17', 202, ), ... 2012-09-05 21:23:58,887 - INFO - lap = [('24', 226, ), ('31', 218, ), ('07', 218, ),... 2012-09-05 21:23:58,887 - INFO - lap = [('24', 242, ), ('07', 234, ), ('31', 233, ),... 2012-09-05 21:23:58,887 - INFO - lap = [('24', 258, ), ('31', 249, ), ('17', 249, ),... Need to implement trouble for drivers 2012-09-05 21:23:58,887 - INFO - lap = [('24', 272, ), ('17', 267, ), ('31', 265, ), ... 2012-09-05 21:23:58,888 - INFO - lap = [('24', 287, ), ('17', 283, ), ('31', 282, ),... 2012-09-05 21:23:58,888 - INFO - lap = [('24', 302, ), ('17', 301, ), ('31', 298, ), ...
This is definitely not user friendly output, but allow me to orient you by giving an example narrative. Looking at the first line you can see the qualifying speeds of the drivers. In this case Jeff Gordon (#24) took the pole. The second line shows the starting grid for the race, with Mr. Gordon in the pole. Jeff had a very poor start: reading from the line after the starting grid - which corresponds to Lap 1 you can see that he moved from 1st to 5th. Two laps later he managed to fight his way back into the lead only to lose it again the next lap. From the last line we can see that he won the race, but just barely. His final speed score was 302, compared to Matt Kenseth (#17) score of 301. Looking at the last 3 lines you cans see that Matt was steadily closing the distance and almost passed Jeff.
Next, up is to stub out the remainder of the basic logic and then get to the fun stuff - visualization and interface! (as usual, the code is available on my github)
I didn’t choose a suitable challenge for the 30 day format. The month challenge format is better scoped for task where you have a reasonable skill set and are working on producing from the skill set. I choose projects where my interest was more attuned to learning and exploration not production. There is a way to do a 30 day format project that allows space for learning, but that would entail a different work process. One that is still more directed and focused than the processes that I have been employing recently. As a result, I am dropping this 30 day challenge, but will continue working and sharing the progress of this and other projects.
With respect to the 30 day challenges I am now retooling, scoping and culling my processes and projects to find something more suitable for a month run. I am still keen to add these challenges to my process because of the creative and mental liberation that comes from less thinking and more doing. I have some pretty interesting ideas that I am excited to pursue and share as soon as I feel that I am up for the challenge!
A friend pointed out that I did not post the link to the discussion on the 7 Must Learn Languages. Fitting since this is the same friend who got me turned onto esoteric programming languages with this post. Since then I have given 2 presentations on it and have some potentially provocative ideas around deploying esoteric languages in service of a couple of pieces.
Most recently I have discovered what I think is my favorite Esoteric Language.
I am getting deeper into critical writing on software studies in an attempt to better situate what might appear as nerd fetishizing over programming language. It appears that the idea of programming as the material of software art and more largely an ever increasing part of social and cultural fabric has been introduced by some cultural critics and philosphers. Including the ever present (in media art circles) Deleuze. Read here, Life in Code and Software , for more information. (This is also a pretty great site and yet another example of technology redefining models for information dissemination, publishing and community building. )
Finally, in this brain dump of software as art, esoteric languages and programming languages here is a link to a thesis, Artist-Programmers and Programming Languages for the Arts that I am currently reading. I have been following Alex’s blog for several years off and on. I like his work and one of these days I promise myself that I will start working on some Live Coding. Actually, that day is closer than I might expect because Live Coding dove tails into my nascent ideas around software art and culture. Heck, I already DJ’d hair albums as a performance why not try something more sane like Live Coding!
This week I was asked to give a talk to honors engineering students at the University. Given my background in engineering and my transition to design and media art I was eager to give them a not-so usual perspective on engineering applications and career paths. The talk largely consisted of me showing them the projects that draw from engineering aptitudes and inspire me. Below are links to the tools and media pieces that I showed.
by Justin Liu
Just Because: Tricycle Calligraphy
by Nicholas Hanna
Processing Creative Code Examples
by Raphael Lozano-Hemmer
by Jesse Chorng
by Jesse Chorng
New Museum Slide
by Carsten Holler
Garbage Bag Street Art
by Joshua Allen Harris
by Tim Hawkinson
Well to be clear. This is actually the 14th day since I kicked this little experiment off. Doing the math it seems that I am averaging a post every other day. Not quite the do-a-project-per-day that I initially had in mind. But, alas, I have been working on a project per day; At least a project per day. They just haven’t always panned out in a concrete deliverable. Some brief introspection on this experiment and then today’s recap.
I find that my ability to scope my focus for the day is improving. The daily mantra of, ” today I am going to look into / work on / investigate ….” is increasingly getting smaller in scope. This is beneficial for a healthy (my healthy) artistic process. Chip. Chip. Chip away at a David.
It is difficult to learn and produce at the same time. This experiment encourages experiential learning. I find my habit of reading extensively beginning to get offset by doing play tests of smaller ideas. Exploring simple questions. There is a paradox of the pressure of the experiment easing the pressure of taking the first step in exploring an idea.
Allowing flexibility in the experiment is a good thing. I hate ideologies because they don’t leave room for personalization. Blindly following the experiment without a sensitive ear to how the challenge effects my process would not serve my ultimate desires. Having said that, I am still working towards producing output once per day because of points 1 and 2.
Despite the gorgeous weather I was content to rock out (nerd out) in my room all day coding, google-hunting and watching Wellington frolick in the sun. On the coding front, I cranked away on the Racing game. I did a major refactor of the code. It is actually now shaping up to be somewhat decipherable to someone other than myself. If you check out the code and look in Racing.py you will see a demo of how the code is working.
I find that I really enjoy Python’s interactive shell for development. Leaning on the shell makes coding feel more like writing: Take a thought, draft a paragraph to express the thought ( write a method ), read it in the context of the narrative ( run it in the shell ) and evaluate and edit the thought. As I progress the writing (coding) becomes easier. Thoughts are more well connected, the poetry of the narrative begins to gain momentum and new ideas are easier and easier to incorporate.
The other part of the day was spent looking more into game engines as a platform for live art / generative art. I learned about Valve’s Source Engine and Source Filmmaker this week from one of the graduate students in my department. Holy crap there is some potential with those tools. More to follow for sure!
(And see this is how the 30 Day Challenge gets stressed…how to spend the time looking into Source Engine AND produce something in the same day? Or even in 2,3, or 4 days? Therein lies the challenge, fun and growth)
I had to take a few days off from publishing my progress while I went back to the learning board. I put the game coding on hold to start to tackle the beginning of a project that I have had for awhile. The first step is to finally stop reading about Mandlebrot sets and actually implement it. Surprisingly, or not, once you parse all of the mathematical jargon the implementation is very straightforward. However, rather than simply implement it I wanted to work on a new workflow / process using Python. I have had ideas for quite sometime about re-purposing tools like game engines and 3D packages for unintended purposes. Much like the GPU can be re-purposed for complex calculations the sophistication of real time rendering in game engines or animation, rendering and shading in 3D packages can be re-purposed for artistic, computational or various invented / creative uses. The Mandlebrot implementation was an early step in this direction as I used the Python game engine, pygame for rendering. And scientific computing module Numpy as the data structure to represent the image. Here is a link to the code.
As always, I got some interesting images from mistakes in the code and these are shown below along with the final, expected, Mandlebrot. Next up I will implement some form of smoothing for the aliasing that results from the “Escape Time Algorithm”
interesting mistake 1
interesting mistake 2
As a language geek I spent more than a passing minute at the 404 page at ibiblio.org - click this broken link and check it out.
My favorite might be the Cub’s Fan…or the Wookie, but there are a few great ones. Oh, of course I like the Maori one too as I develop my Kiwi pride.
(I have been working on my 30 day projects, but I took a detour into Mandelbrot sets and trying to get an implementation done in Python. That detour took me to Pygame - as a visualization tool. Which brought me full circle back to Numpy - which I am using in a Computer Graphics graduate course. Results from this 48 hour adventure will be posted in the next day or so hopefully. BUT searching for some py/num/game info I found the ibiblio 404 page - yet another RIF - random internet find)