https://www.pygame.org/

Meditations on blit

So I’m teaching a python game development class and I am using the pygame library.  There are so many options these days to develop games – unity, unreal, twine, phaser. I was thinking why am I using pygame??

Well I am teaching a “python” class, so there is that, and we can publish our game to the steam store, so that is cool. But pygame is a pretty easy to use and robust. For the class we are using the pygame book at Invent with python.

The core of pygame is a loop that monitors events and updates the screen. It is a while True loop that monitors events, updates the display object and then updates the display.  To draw an image, like a jpg, on the surface you use the blit method:

DISPLAYSURF.blit(img, (x,y))

Blit is an ancient command, as I tell my students You look in all sorts of graphics frameworks and languages and you see blit!  Blit originally stood for bitmap graphics terminal and it was a different type of computer terminal that could draw bitmap graphics.   In graphics programming it also refers to  “bit-boundary block transfer”, this is where you transfer a block of memory from one location to another.

In graphics programming you can optimize your library by having a sheet of sprites of graphics that you then draw (blit) to the screen. This is an example of one of the sprite maps from the legend of zelda 1:

First we blit the image from the spritemap, then we blit that image to the pygame surface:

import pygame

spritesheet = pygame.image.load(filename).convert()
rect = pygame.Rect(rectangle)
image = pygame.Surface(rect.size).convert()
image.blit(spritesheet, (0, 0), rect)

DISPLAYSURF.blit(image, (x,y))

With this sort of framework I think there is interesting work to be done to sort of remix and reinvent existing games. What would a mashup between zelda and mario look like? What would a game version of fan fiction look like? We are playing with the graphical elements but we can use new different game mechanics and create a new story.

https://en.bitcoinwiki.org/wiki/SHA-256

Cryptography as a personal practice

I gave this talk a few months ago, and it is something that came out of working through cryptopals at RC.  I was drafting the powerpoint into a conference proposal that sort of encapsulates my thinking right now.

I am going to look at encryption broadly – as a process that undergirds all technological knowledge. Anything from compression (e.g., a JPEG) to cryptography (e.g., PGP), to the binary system on which all computers run, I consider a form of encryption. Almost all current encryption protocols, while mostly open source, are monolithic and centralized. The structure of knowledge can be construed as depended on the structure of encryption protocols. How do we create our own personal practices and systems of encryption and cryptography to restructure knowledge?

Personal practices are at the forefront of today’s life-hacking movement(s). The cultivation of the self, once a matter of character, is now a matter of capital. Today we ask, how can I optimize myself and become the most efficient self that is able to contribute to capitalist production and consumption? There is a history of using personal practices as a bulwark against commodification, in practices from anarchism to veganism.

It is in this vein that I want to consider personal practices of encryption and the broader question of how can we rethink technological production and consumption in terms of a personal practice? This is particularly urgent when we consider our engagement with technology as part of the feedback loop of knowledge production. Even for something as banal as using a search engine, creates usage data that turns into knowledge, which then structures our next search.

When we extrapolate this to mapping and sensors, as well as the use of energy and physical space for manufacturing servers and microcontrollers, we are directly in the physical realm – the realm of nature.

Technology practices contribute both to the practical use case of data collection in the creation of AI, and the theoretical consideration of cybernetic impact of culture on nature.  As the LAMP stack was an innovation critical to Web 2.0, encryption and cryptography is an innovation critical to the rise of AI and its dependence on our data.

There is a rich history of personal practices of encryption from DaVinci to Anne Lister. In the past it was to keep thoughts radical thoughts private.  Now we need it to keep thoughts non-commodified.

How do we bring back a craft culture of encryption? What is knowledge produced and codified through personal encryption? What happens when our encryption systems are ‘artisanal’ instead of commodities? How can we engage in personal practices of encryption and what sort of knowledge organization will this create?

Thinking about Sortition and Discovery

I have been toying with an idea about generating a piece of work and documentation around discovery based on sortition. Please excuse the jargon that is also one of the things I am toying with.

Sortition/Protocol project is an experiment in culture creation through
restructuring and preserving network topologies on the principles of
sortition. It is an exercise in taking ideas from anarchist and Marxist
notions of personal practice and extrapolating them to activities that are
now controlled by algorithms, professional taste-makers, and influencers.

Lets talk about instagram, twitter, facebook, or any social network where
people attempt to communicate and connect. These networks originally
promised a many-to-many topology, where everyone communicates with
everyone else. To use an overused phrase – it was heralded as democratic. The reality of the network topologies that we see in social media is more of a
one-to-many relationship, with a small number of influencers communicating to a
large number of individuals who have exponentially less connections. The
communication is asymmetrical in its content and impact.

There is also the matter of surfacing this content, how is an influencer or individual ‘seen’ is largely regulated and controlled by opaque algorithm. I call this the hidden layer, analogous to the hidden layer of a neural network that creates the weighting and vectors determining the structure of the network. This hidden layer in conjunction with the network topology assist in creating a certain epistemic and interactive regime that we are going to overthrow.

How are we going to overthrow it? Sortition.

What is sortition? Sortition is a method of governing by selecting leaders
based on random selection or lottery. It was the way that the ancient
Athenians selected political officials. Although, the pool of potential leaders in Athens was exclusionary and limited to the small number of landowning men of leisure, the idea that anyone could rule, or make important decisions is a stark contrast to today. In our society algorithms and influencers guide and create the world of our possible virtual experience.

The idea of sortition has not disappeared. Theorists such as the Marxist
scholar CLR James have proposed sortition as an alternative to current
governing electoral paradigms. What does it mean to select people by lot
to make decisions? It is anathema to the contemporary emphasis on
democracy and meritocracy, but perhaps the meritocracy is a fiction and we
should replace it with a different narrative.

The Sortition/Protocol project randomly selects, every few days, a new group of people to post to the Sortition/Protocol social media account for a short period of time. I will refer to these people as leaders. The code for this selection is open source so anyone can change, fork or submit pull requests. This is the engine of our new network topology; a constantly shifting nexus. But what does this mean for creating a framework or fiction around what we are doing?

The traditional algorithmic and influencer networks persist in time, but they have no history. The eternal construction and mediation of a persona is their narrative and their mythology. The history of these networks are quantitative measurements of success in getting people to click, friend, like, or buy. What are the metrics for a network on a sortition topology? What do the temporary leaders have as a record of their tenure? Does it matter that they have a record? What does it mean to have a record for this sort of network topology, or in other words, how is history related to a network topology based on sortition?

A sortition topology does indeed have a history in a way that a topology
based on algorithmic or influencer decision making does not. Each set of
leaders represent a different epistemic regime. I am intentionally
referencing Foucault and the notion that a network represents a
power-knowledge system. The ground of that knowledge, in the case of
sortition, changes with each new group of leaders who create a new
knowledge regime.

Another question becomes, how to create a narrative for a topology in constant change and epistemic flux. Can we even create a narrative or a mythology? A sortition network is a discontinuous network and in order to find continuity and a sense of communal responsibility we should strive to create this base level of meaning. This is the document. The act of leading, of being selected and posting content, and managing the Sortition/Protocol account, is the performance. The documentation is the artwork and the codification of a symbolic regime or episteme.

We can also consider the document in phenomenological terms as the
condition for phenomenological bracketing. The notion of bracketing in a
phenomenological context is to suspend judgement and experience a phenomena without cognitive biases. In the context of Sortition/Protocol, there is a question as to whether we should suspend our personal judgement and act as
Sortition/Protocol, or if we should act as our personal selves. The history of Sortition/Protocol documentation provides a meta-narrative for Sortition/Protocol against the personal proclivities of the temporary leaders. Bracketing in this sense is bracketing personal personal judgement, experiencing the historical document, and when acting as the Sortition/Protocol.

The sort of documentation that we create, like the program for selecting
and running sortition itself, is public and open-source. Initially it is
conceivable as a LaTex program run over the history of items shared and
activity generated on the social media account. The LaTex generation and
object selection is itself an algorithm, but rather than using the
algorithm to surface data, we are using the algorithm to create a past
narrative – a construction of what it means to exist in this new topology.

It is a step away from real-time posting, sharing and exchange, but a
moment of reflection and historicizing. Since the documentation structure
is open source we can extend the documentation to include video, web
documentation, sound, or a multiplicity of representations. With all the
code open-sourced, different communities can implement their own sortition
network topologies on a variety of networks such as instagram, twitter,
mastodon, or scuttlebutt.

Let’s subvert the existing trend toward algorithmic obfuscation and
consolidation of power. It’s no longer about narrative but about
structure. Let’s change the structure and create a narrative around that
structure. Let’s promote historicism and ephemeral media and turn it into mythology.

Code Scaffolding

Code Scaffolding

Did you know, internet friends, that Michelangelo had to construct a special scaffolding system to paint the sistine chapel?? Its true. So my meditation on scaffolding is not with out historical precedence.

One of the things I wanted from my time at  RC was to build better coding habits. This included things like consistently posting projects to github, having a good dev environment (ie tricking out my vim conf), but also structuring my projects in a less idiosyncratic way. And that means scaffolding!

This week was hack week at my job, where we hack on personal projects. I was working on a machine learning project – more to come on that in another post. Since my code was going to be in its own repo, and not part of the monolithic code base, I was wondering what sort of code scaffolding I should use. The code in question is python code – fyi…

What do I mean by code scaffolding?  These are the files and documents that every software project has.  Frameworks like Rails, and Django automatically scaffold projects because they are very opinionated in how things need to work. Node also has some great scaffolding libraries thanks to yeoman. Rust and Haskell also have good project generators – but what about python, just plain ole python??

I posted this question to our corporate internal slack … do we have any corporate python project structural requirements?? Crickets. Although one person did point me to a nifty command line parsing library called click. I was going to say I used this in Rust but really I used the clap library -I just cant think straight because 5 planets are in retrograde and I just got off an airplane.

In any case, after a quick google I found this sample module repository, by Kenneth Reitz. It’s nice. The directory structure is set up well with licenses, readmes, documentation (sphinx), and testing (node). I forked one, and will probably modify this for our internal corporate usage, and also for my own personal usage. Maybe I’ll add some functionality for selenium 🙂

Getting into the habit of setting up my projects in a standard and organized way, helps focus my mind on the task of just writing code and it gives me confidence that the code I share will not be arranged in some bizarro manner. Sometimes bizarro is good, but if you are writing corporate code, or code that has to be  reused, best to take your ego out of it and write something clean, functional, and understandable.

culture(s)

A few weeks ago I ran into Sumana at my company’s coworking space. We started chatting about art of py. Art of py was an incredibly successful event that Sumana put on at pycon 2019 to showcase performances based around the culture of technology.

In full disclosure I presented a monologue on creating the prayer blockchain, that Sumana has described as something like a moth storytelling piece. I will put a link to it.

But more interesting was the discussion Sumana and I had the coworking space about tech and art. When most people talk about tech art, people talk about art created by technology.  Examples of this are things like Deep Dream, machine learning algorithms that generate visual art, or realtime music generation like what happens in the algorave scene, or poetry or literary experiment, or even cartographic performance art pieces. I have discussed this before in the blog, and have even coded up some experiments.

But for Art of Py, the focus was on art that reflects on technology, not art created by technology. It is the creation of a culture around technological creation.  Sumana mentioned that actuaries have events where there are songs and skits about being an actuary.  In literature there are a plethory of campus novels.  Gothic cathedrals are homages to the papacy. Culture is culture of a profession. Perhaps it is intended to glorify the profession, in some cases in order to maintain a certain power structure. But culture, mythology, fiction is around certain experiences.

Back to culture…

The idea of one culture, a high culture, or of a high and low culture is the historical narrative.  Marx famously thought that the proletariate would not be able to create its own culture and this would aid in alienation and the ensuing revolution. I am pointing to an interesting paper by Trotsky, who gives one interpretation of this point.

As it turned workers developed a rich culture. And it was not a generic workers culture but cultures – from workers papers to Pete Seeger. Now we could call this low culture, or folk culture, but we have so many cultures – the farmer, the factory worker, the wage slave in a Theodore Dreiser book, the prostitute/sex worker.  In the 21st century every profession can create its own culture; where to forge within the “smithy of his soul the uncreated conscious of his race”, means the uncreated conscious of their profession.

We could track the end of a workers culture with the rise of the managerial class, with operations research, fordism and MacNamara.  We can only tell a story while a profession is still on the gnarly edge of professionalization. While the workers still have a hand in the creation of the narrative rather than being commodified by a bureaucracy. What is the conscious of the tech worker?

We can create algorithmic or tech aided art to help shape the representation of this narrative, but we cannot use it to create the meaning of the narrative. If we think about what tech art is (in the first sense) it looks like it would be culture by and for computers.  But I am interested in what it feels like to be a programmer, either a yeoman, a journey man or a master.

As painting became an art, and painters regarded as geniuses, we see the rise of the self portrait. What is the self portrait of the programmer?

This is what Sumana and I discussed, the need for tech workers, project managers, customer success agents, engineers, and so forth, to create a narrative language around their work. We are the ones building the cathedrals, maybe the stain glassed windows should reflect our own mythology.

 

What is metaphysics? The study of continuous things.

When I was in college, I remember looking through the course catalog and seeing metaphysics. Now that sounded mysterious and interesting.  I did not even know what it was. As it turns out metaphysics is really all those things that you cant really talk about in philosophy these days because they not really falsifiable or subject to the scientific method – things like the nature of being and reality.   We all know how that experiment turned out that tried to prove whether or not light was a particle or a wave.

This week I was reading Reza Negaristani’s new book Intelligence and Spirit and I came upon the following paragraph on p 233;

Metaphysics properly understood is the apprehension of the infinite without any of the static or fixed contradictions that arise from the limitations of the features of our experience or understanding, which, in contrast to reason, can neither accept the identity of opposites nor forgo the representation of the Absolute or unconditioned.

When I read this, at first I stopped at the word “infinite’. Metaphysics is the apprehension of the infinite. Well what is the infinite… that which is not finite, or not countable – it is not measurable.  We can interpret the rest of the paragraph, phrases such as ‘limitations of the features of our experience’ as those things which we can count and measure. Those things we can put into categories  Reason can only be applied to things that we can categorize (not only in the kantian sense).  Reason cannot be applied to the infinite – this is perhaps the realm of mysticism or cbd. Kant would say that we apprehend the infinite through judgement. I dont know why I am talking so much about Kant, but this book talks a lot about Kant and Hegel, so that is probably why.

But lets dwell on infinite. This made me think about continuous, and the age old question is the world continuous or discrete or both or none or all of the above. What is infinite, as I said earlier, is not countable. You cannot make it discrete.  When you take a curve and describe the shape of it with calculus you are making the curve discrete.  To recreate the curve by plugging numbers into a function, you will always have a cloud of points that look like a line but are not a line.

So perhaps metaphysics is the study of continuous things. And then we can leave epistemology to the study of discrete things. What can we talk about when we talk about continuous things, things that cannot be counted and measured? If infinity, and continuous things in general, cannot be subject to reason, and I am not sure that this is the case in all things. I would say that all areas of investigation can be subject to reason, and other modes of apprehension as well.  But, if continuous things cannot be subject to reason, then we are back where we were metaphysics cannot be subject to reason.

I believe there are other paths to understanding beyond reason. But I also believe that reason can be used in realms once labeled off limits. What does it mean to be continuous. Can we create continuous (analog) computers. What does a computer look like that is not the discrete turing machine with states and writing on a tape. but with a long long piece of paper and a pen writing exquisite corpse style in a continuous stream. So what happens when we start to think that metaphysics, about the nature of reality, is really about the nature of continuous things. What does that look like ? 42.

 

 

 

infrastructure

Infrastructure and Organs

Recently I read The Marvelous Clouds, by John Durham Peters.  When I first put it on my list I thought it was about cloud computing, but no. It is more about protocols and infrastructures of communication.   If I were to summarize the book it would be about how media (and by media Peters means clock, calendars, and pencils) produces Being (ontology).

We don’t choose our own Being (in my poor reframing of existentialism), our Being is generated by media.

And then, in a really Haraway-an turn, there is a discussion of the Being of animals (particularly cetacean) which have no media.

Here I am going to engage in a creative (mis)reading of the text. If you imagine dolphins communicating in the ocean, or even humans speaking to one another on land, there is no wire, no infrastructure connecting the participants. There is no interstate that we need to drive down, or fiber optic cable network that needs to carry our communications.  These things would be the infrastructure.

Instead of infrastructure we, and dolphins, have organs.  In the undifferentiated mass of air (or water) our communication is from organ to organ.  I have been meditating about what the different organs sense.  The brain senses thought, the eye, light, the heart, emotion, what about the liver, the kidney, the spleen?  Sensation and sensing is the protocol of organ communication.

When do we need infrastructure and when do we need organs? (I also cannot help but think of the D&G concept of bodies without organs – undifferentiated or unspecialized bodies- D&G is all infrastructure – all logistics )

Do we need both infrastructure and organs? If we think about bitcoin (or Ethereum or some other cryptocurrency), we can imagine that a mining node is an organ and the internet cable, the infrastructure. The protocol, how the transactions are communicated, is like the electron gradient guarding the influx of water through a cell membrane wall. I would say the protocol is part of the organ although it is perhaps structured by the infrastructure.

What is the structure? Is this the topology of the network as whole? In the case of cryptocurrency, this would make the structure the least material and most variable and ephemeral of the entire apparatus.

I am not sure what it means to think about things in terms of organs and infrastructure (and structure) I suppose.  But, I think about the turn that Deleuze makes from the monad to the nomad – the organ to the infrastructure.  Then, today, if we move from the nomad to the damon, to the he electron cloud and the realm of possibility, we can find the natural analog in the infrastructure-less air and water that Peters discusses in The Marvelous Clouds.

Learning From the RC Zulip – Nix

This week I am going to go through a make a post that is purely my favorited links/posts from zulip. But right now I am going to talk about what I learned from Zulip!

Vaibhav posted a video of a presentation he gave on Nix. I had never heard of Nix. So I figured I’d watch the video.

What is a package manager? Many of you who use Macs have probably used Brew  or MacPorts. There also used to be something called “Fink”, which apparently still exists, but no one talks about it any more.  On Linux/Unix we have apt-get, yum, and some others. A package manager just manages installs on your computer.

I have never actually packaged anything with any of these tools, although I plan to for the prayer-cli in the next month.

Nix is a functional based package manager. Everything is installed into /nix – rather than say in ../Cellar with Brew.  A cool thing about Nix is that you can create separate environments with separate packages.  This feature makes it really appealing to use nix.

There is an operating system built on top of Nix – NixOS .  The benefit seems to be the ability to control your configuration settings.  I have not installed  a new os in years. I use a mac so all my upgrades are handled by the automatic upgrades. And remotely I’ll spin up ubuntu instances often running docker.

But what would I want in an operating system? Ideally something less magical. I really dont know what is going on under the hood of my mac or my ubuntu installs.  The config files on Nix make this much more transparent.

So I have not used Nix for anything yet but I want to try it out. I love learning about new tools on the RC Zulip and thanks to Vaibhav for posting about this.

 

https://www.goodreads.com/book/show/305860.Philosophy_as_a_Way_of_Life

Never Graduate Practices

This is an excellent book about philosophy as a practice.  I read it when I was in college. I remember asking someone did he actually practice various ethical practices suggested by philosophers – like Kant’s Categorical Imperative. He looked aghast – “Of course not!”  But why not?  I feel like we live in a time where the notion of practice and habit is at the forefront. Where everyone is on a mission to “optimize” their lives. But what I think is interesting is not “optimization” but “transformation”. What would Ovid’s Metamorphosis look like if instead of transforming the characters optimized. Maybe that is the mythology of our time, but it does not seem particularly transformative. It just seems to reinforce the echo chamber that our communication practices have created for us.

However – I personally have a bunch of practices. A yoga practice, a meditation practice, a work out practice, a journaling practice, a guitar playing practice, this could go on.    I also have practices that I will probably never have again, such as a tai chi practice, or a yoga practice.

I go through periods where I do all these practices, some of them, or eeek, none of them.  I am not trying to optimize myself, I am trying to transform myself. I dont see life as a process of optimization but of transformation.

Mine though, as you might imagine, is not a life hacking type of perspective, it is more the perspective that to even maintain and transform yourself you must “keep in shape”.  You must practice.  It is also through practice or practices that you transform and learn new things.

One of my great loves is programming but I do not have a programming practice. I started thinking about this a few weeks ago when I spoke with a “programming coach.”  This is one of the things I have been working on developing while at Recurse.  I have spoken a bit about this in previous blog posts. But as my time at RC draws to a close I am trying to think of the practices that will continue the transformation or growth.

I am very interested in this idea of alternate education, and the motto of RC is never graduate. BUT what does it mean to “Never Graduate”?  How do you continue to learn, on your own and with other people?

Someone at RC mentioned that posting to the alumni checkins on zulip is a good “practice.”  I like this idea. In terms of a programming practice I am going to try and cycle through different types of problems hopefully on a daily basis, but probably on a weekly basis. I am also going to experiment with the idea of a weekly deep dive. This is where I pick some topic that interests me every week and just geek out on it.  This is not so much a programming practice but a never graduate practice.

What are  some good never graduate practices?? I feel like this could be an app.

 

 

 

Last Day of RC

Today is the Last Day of RC and we are “never graduating”.  It is bittersweet. I feel like I have developed great habits to continue going forward as I work on “conscious computation”, and create a “technical practice”. BUT as I realize with all these group type things the most important thing is the people and the people at RC are truly an excellent bunch and I will miss seeing them every day.  Apart from being fascinating and brilliant, they are just lovely people.

The whole thing about the internet is that you no longer encounter serendipity. You search for the things you want, talk to the people you know and generally exist in an echo chamber. You can work to expose yourself to different views, but all of this is very depersonalized and you end up just consuming information.

Recommendation algorithms try to introduce serendipity, and there was that old site stumble upon that tried to do the same. But I enjoy to learn by having conversations with people – and I may learn best in this way as well. In everyday life you generally converse with the same limited group of people.  Recurse breaks you out of that. There is a tug between being diverted from your project and learning new things. But, quite frankly what a good problem to have. Thank you Recurse.