Chris McCormick - News http://mccormick.cx/news Chris McCormick - News en Copyright 2008- Chris McCormick 60 Sun, 11 Jul 2010 12:55 GMT chris@mccormick.cx mccormick.cx/news Squeaky Shoe Core entries/squeaky-shoe-core http://mccormick.cx/news/entries/squeaky-shoe-core

I've started a new album. It is called squeakyshoecore. It is algorithmically generated acid using some software I wrote. I am going to release it online bit by bit, as I finish each track. I will announce each new track here on this blog.

squeakyshoecore logo

squeakyshoecore

The software makes two different beats and two complementary melodies using random number generators and some carefully tuned algorithms for using those random numbers. The melody shaping rules involve applying a low dimensional random fractal effect on very basic seed melodies, producing a type of self-similarity which seems to sound interesting to humans. The beats are created using a variety of custom rule sets, much like my previous work with algorithmic hip-hop in CanOfBeats and my algorithmic drum-and-bass generator, GhostWave.

After that I manually control how loud each of the parts are present in the mix, what effects are being applied to the different parts, and the parameter values of those effects. I use a midi controller to mix it in real time and record it.

Soon I will make the latest version of the Pure Data patches ("GarageAcidLab") available online under a Free Software license.

Enjoy the first tracks!

P.S. Some other music I've released on the net previously is Cryptolect, end-of-millenium style chopped-up breakbeats.

]]>
/tags/all Sun, 11 Jul 2010 12:55 GMT
Source Foods cafe entries/source-foods http://mccormick.cx/news/entries/source-foods This is my favorite cafe in Perth, Western Australia, for the following reasons:

  • The coffee tastes really good
  • Free wifi
  • Nice, agreeable, pleasant staff who leave you to your own devices
  • Walking distance from Northbridge, Mount Lawley, and Perth
  • The coffee tastes really good
  • Coffee is slightly cheaper than most other places in Perth ($3.80)
  • Organic, sustainable, fair-trade, and vegan friendly
  • The coffee tastes really good

View Larger Map

I haven't tried their food, but it looks tasty and generally reviews well.

Here are some links:

]]>
/tags/all Wed, 07 Jul 2010 08:05 GMT
The Robustness Principle as a social heuristic entries/the-robustness-principle-as-a-social-heuristic http://mccormick.cx/news/entries/the-robustness-principle-as-a-social-heuristic The Robusness Principle is a good principle for writing network server/client software. If you follow it your software is less likely to fail when interfacing with other software. I also find it to be an optimal heuristic when it comes to interacting with other human beings.

Be conservative in what you do; be liberal in what you accept from others.

-- Jon Postell

I wonder if there is a formal proof that it is an optimally efficient algorithm for interacting entities who don't completely know eachother's context/protocol, from the perspective of information theory?

]]>
/tags/all Mon, 21 Jun 2010 12:50 GMT
FETUS entries/fetus http://mccormick.cx/news/entries/fetus

]]>
/tags/all Fri, 18 Jun 2010 11:50 GMT
Self contained, non-root python library directory entries/self-contained-non-root-python-library-directory http://mccormick.cx/news/entries/self-contained-non-root-python-library-directory If you want to have some Python libraries installed in your system somewhere other than the standard place ("site-packages"), here's how to do it. This can be useful if you don't want them to interfere with your operating-system installed path, or if you don't want to become root/admin in order to install them.

This problem is solved by things like virtualenv and buildout, but I find that this will suffice for a lot of cases, or if you don't want to learn the ins and outs of those systems.

First, create a directory somewhere for your alternative Python libraries to go into:

$ mkdir ~/my-python-libraries/

You only have to do that step once.

Next, tell future Pythons that we have an alternative path where libraries live by setting an environment variable:

$ export PYTHONPATH=~/my-python-libraries/

This means that Python will check that directory for Python libraries when you try to import them. If you are always using that library path, you could put it in your .profile or .bashrc file so that it is set on login.

Now when you install new libraries, make sure they go into that alternative path:

$ cd some-library
$ python setup.py install --prefix=$PYTHONPATH --install-purelib=$PYTHONPATH --install-platlib=$PYTHONPATH --install-scripts=$PYTHONPATH/bin --install-data=$PYTHONPATH

One good thing to do is make a handy little one-line script which sets the PYTHONPATH variable when you want to start working on a project which needs those libraries. You could put it in ~/bin or in your project's root or scripts/ subdirectory.

You can also make a script in your ~/bin directory which runs the python setup.py command with those command line arguments set and call it something like "install-python-library".

]]>
/tags/all Sat, 12 Jun 2010 03:02 GMT
Nearest power of two entries/nearest-power-of-two http://mccormick.cx/news/entries/nearest-power-of-two I had a hard time finding where I had written this down, and I will almost certainly need it again.

update: More power-of-two fun at Frank's blog with Fast power-of-two modulo.

To find the nearest power of two (linearly) to a given number:

pow(2, int(log(n, 2) + 0.5))

To find the next highest power of two:

int(pow(2, ceil(log(n, 2))))

That's Python code, but pretty much applies in any language. There are some very fast log2 implementations out there if you need them.

Also, if you only have access to log10 in your programming environment (as I did when I worked that out), you might need this:

log2(n) = log10(n) / log10(2)

This is expressed generally as:

logX(n) = logY(n) / logY(X)

(Those two aren't Python code).

]]>
/tags/all Thu, 03 Jun 2010 08:31 GMT
More 3d printed robots entries/more-3d-printed-robots http://mccormick.cx/news/entries/more-3d-printed-robots This 3d printing stuff is addictive.

]]>
/tags/all Sun, 30 May 2010 05:40 GMT
In Defence of Being Wrong entries/in-defense-of-being-wrong http://mccormick.cx/news/entries/in-defense-of-being-wrong Science tries to give us a better understanding of our reality. A better understanding, or model of our reality allows us to make more accurate predictions about what will happen next. Having a good model of what will happen next allows us to benefit by making decisions which will result in increased happiness and avoiding decisions which will result in decreased happiness. The way that science works begins with someone using their imagination to make a hypothesis. A hypothesis is an untested idea. A hypothesis is by definition incorrect much of the time, and unproven all of the time. It is neccessary to have hypotheses in order to have science.

An athiest believes that religious people have a model of reality which will not serve them well in making predictions. That means that they make suboptimal decisions which make their lives, and often the lives of others, worse. Therefore it is optimal for an athiest to try and encourage people in the world towards a scientific way of thinking.

I do not believe that it is constructive or optimal to antagonise people who have an incorrect model of the universe. I think, for example, that publishing cartoons which offend an incorrect person is suboptimal when it comes to the goal of enlightening them. I think a much better strategy is to give them as much information as possible so that they can arrive at their own conclusions based on the available data, and disprove their own existing incorrect hypotheses. I think that it is optimal, constructive, and safer to respect all people, including those who you think are wrong.

I think that education is a better strategy than disrespect and mockery.

It's probably not possible for a human to have a 100% accurate model of reality (otherwise that model would be reality itself). This means that each of us has a flawed model of reality. All of us are incorrect people, hence all of us can only make predictions with limited accuracy, and importantly, we require other people to build a consensus model that is more correct than the one we might individually hold.

Jedi Squirrels with Light Sabers

To summarise, we should tolerate people who are wrong because:

  • It is neccessary to be wrong in order to form hypotheses and progress science. (It is neccessary to be wrong before you can be right.)
  • Antagonising people who are wrong does not help us all make better models about reality, as much as educating them, and it often has an adverse effect of making us less safe.
  • We are all mostly wrong, and probably always will be.
]]>
/tags/all Tue, 25 May 2010 11:51 GMT
PyCon AU 2010 entries/pycon-au-2010 http://mccormick.cx/news/entries/pycon-au-2010 PyCon AU Logo

There is a new Python conference running this year for the first time. It's in Sydney, Australia, at the end of June. I'll be speaking, and I'm very excited about attending too; there are a number of high quality topics evident in the conference schedule. I'm particularly happy not to have a clashing time slot with my friend and occasional colleague, Simon Wittber, as his talk looks fascinating. If you are into Python, you should go!

Go to the PyCon AU 2010 website for more details.

]]> /tags/all Tue, 18 May 2010 15:22 GMT Android, iPhone, evolution, and intelligent design entries/android-iphone-evolution-intelligent-design http://mccormick.cx/news/entries/android-iphone-evolution-intelligent-design With the recent news that Android phones are outselling phones running the iPhone OS in the USA in the first quater of 2010, I wanted to write down something that I have been ranting at my more patient friends for the last few months. The open development platform style of Android is like evolution, whilst the closed Apple platforms are more like intelligent design.

  • Apple periodically come out with a single near-perfect product.

  • Android products get incrementally better with each iteration from each phone company.

  • Apple must make every product a hit - they can't afford failures like Apple TV. Failures are very expensive for Apple.

  • Android allows Google to outsource failure. Infact, failures by the 3rd party companies who make Android phones actually help the evolution of other Android products as all products in that class can learn and benefit from the mistakes of eachother. This is like the transfer of genetic information. Failing phones are part of the survival of the fittest style of interaction that occurs in nature.

  • Like the traditional Mac platform strategy, the iPhone strategy is about elite, expensive, "cool" devices with fantastic usability.

  • The Android strategy is more like the PC platform of years past. It will result in a wide choice of generally uglier phones that don't work as well as the iPhone, but that slowly get better and better. Everyone will use them anyway, much to the confusion of die-hard Apple fans. This will be because market pressures will ensure that the cheapest phones of the highest quality, which give the user the most control and choice, will be the most popular. Often the most successful new designs will be copied from market leaders like Apple and other Android makers.

Evolution is dirty, ugly, and messy, but the end result is always more successful in a competitive ecosystem. It's interesting to consider which strategy will be more robust in the smartphone market.

]]>
/tags/all Mon, 17 May 2010 03:47 GMT