2014-05-24, 12:48 | Clojure, Art, Code, Audiovisual, Live coding,

Repl Electric - the-stars

Live coded in Overtone and Shadertone using Clojure.
Performed in London.

1 note(s).

Remember Raev?

2014-04-06, 13:04 | Clojure, Raev, Projects, Colourlovers, Quil,

Almost a year ago I posted about a colourlovers.com clojure client I hacked together. Today I decided to put it up on github finally. No changes what so ever since then, sadly. I hope it still works, heh.

I also included the messy example Quil sketch that generates the images seen in my blog post as a gist link in the README.md.

Raev at github

Bear in mind that I’m still very much learning Clojure. As such the code is what it is. Not very good.


2014-03-26, 19:19 | Clojure, Clojure/West, John Hughes, QuickCheck, Erlang, Testing,

John Hughes - Testing the Hard Stuff and Staying Sane

Excellent keynote talk by John Hughes (of QuickCheck fame) at Clojure/West 2014.


2014-03-09, 18:33 | Quil, Clojure, Processing, Programming, Sketch,

Today’s unfinished Quil sketch, not sure where it’s headed…

1 note(s).

2014-02-16, 16:13 | Clojure, Quil, Processing, Markov chains,

Generating images with Markov chains - take two!

I was pretty disappointed with the result of the first take. The first version’s implementation was basically:

Read in all pixels of the source image. Record the color frequency of the pixel’s right neighbor. Pick a random color from the source input, plot it at 0,0. From that color, get the next color from the frequency data (there can be several possibilities here, pick one “randomly” wheighted by frequency). Plot the next one at 1,0.. rinse and repeat until the whole screen/window is full.

Not surprisingy the results were very one dimensional. And varied very little in charcteristics.

This new version records every pixels surrounding neighbors (left, right, top, bottom), and uses that data to plot. Unfortunately it wasn’t much better, all images come out as sort of marble-like textures. It’s not bad, but I hoped for more interesting results. I’ve left out the source images intentionally, since they don’t have much impact on the result besides color.

Combining several source images is easy, and one such result can be seen here in image 2.

So how could I improve on this further? I think color alone won’t do. I need to also take position into account somehow. Maybe something to think about and try to hack next weekend.

3 note(s).

2014-02-09, 15:22 | Quil, Processing, Clojure, Markov chains,

Markov generated pictures (scaled up) with the mustache mona lisa as input.

2 note(s).

Toy compojure example

2014-01-30, 22:05 | Clojure, Compojure, Code, Gist, Github,

Usage

  • lein new compojure myproject
  • lein ring server
  • Populate the “database”: curl -X PUT localhost:3000/foo/something/45
  • Get stuff: curl localhost:3000/foo/something
  • Same as above: curl localhost:3000/something

1 note(s).

Doing mobile development with Clojure/Clojurescript

2014-01-08, 16:22 | Clojure, Clojurescript, mobile development, iOS, Android, Titanium, PhoneGap,

I’m interested in doing some development for mobile phones. Naturally I’d like my endeavors to have the possibility to reach the largest possible audience - iOS and Android. But I’d also like to exercise my Clojure skills. What are my possibilities here?

I’ve googled a bit without finding very much. I found a post on Vinod Kurup’s blog about Clojurescript + PhoneGap which is interesting, but it’s from 2011. For Titanium it’s even worse, I could only find a gist by jolby with a toy example.

Anyone know where to look for better sample code or information? Is there something else besides PhoneGap or Titanium that I should look for?

2 note(s).

schema

2013-11-19, 10:11 | Clojure, Schema, Core.typed, Functional Programming,

A less formal (and only provides runtime checks) alternative to core.typed.


Coursera’s “Functional Programming Principles in Scala” course completed

2013-11-03, 18:10 | Scala, Coursera, Haskell, Clojure, Elixir, Functional programming,

What a great course! I thought it was perhaps going to be a bit too easy, but I was pleasantly surprised. The level was spot on for what I wanted. A thorough introduction to Scala and functional principles, with some pretty tricky programming assignments.

I think Scala is the best introduction for anyone who wants to get into functional programming to be honest. My first contact with functional programming was Haskell - a rough, albeit rewarding, ride. After that I looked at Clojure. Also not very beginner friendly IMO, mostly due to its Lisp nature (prefix notation etc). Elixir is slightly better in that regard (still a bit young), but Scala takes the prize - no doubt.

2 note(s).

Typed Clojure

2013-09-28, 14:27 | Clojure, Programming, ClojureScript,

5 note(s).

2013-09-22, 16:32 | Clojure, Quil, Processing, Programming, Qritch,

Qritch, Clojure+Quil 2013.
Playing with data.generators, noise and basic trig.

Qritch, Clojure+Quil 2013.

Playing with data.generators, noise and basic trig.

5 note(s).

Using clojure.data.generators

2013-09-15, 19:29 | Clojure, Quil, Processing, clojure.data.generators, Code, Programming, Generative,

I’ve always been a sucker for generative art, it’s a field that I like to explore - especially using Processing (and lately Quil).

Clojure has some excellent related tools. Today was the first time I used clojure.data.generators (“Generators for random Clojure data.”). Just pop [org.clojure/data.generators "0.1.2"] into your Leiningen project.clj. Very straight-forward and intuitive to use so far. You can easily get primitives and control aspects of the generation.

A very simple example that generates a number between 0 and 255:

(defn color []
  (gen/uniform 0 255))

There’s a whole bunch of awesome functions that are super helpful; weighted, ratio and geometric are especially fun.

3 note(s).

2013-06-10, 15:48 | Clojure, Colourlovers, Quil, Raev,

This is just a sample usage of my wrapper/interface for the colourlovers API, which I will release soon. Palettes based on some arbitrarily chosen keywords.
View full size.

This is just a sample usage of my wrapper/interface for the colourlovers API, which I will release soon. Palettes based on some arbitrarily chosen keywords.

View full size.

1 note(s).

hex-to-rgb

2013-06-10, 15:03 | Clojure, hex-to-rgb, Gist, Snippet, Code,