Okay, so I looked a bit at Elm and really like the ideas it has with FRP. This weekend I really wanted to practice some Scala though, so I thought that a good exercise would be to get LWJGL up and running together with scala.rx.
I have the minimal up and running. Will need to do some more tinkering to get where I want. Will post updates.
Interesting links in the meantime:
- Helm - Haskell game engine inspired by Elm
- Purely functional, declarative game logic using reactive programming
- Switching from imperative to FP with games in Elm
λ λ λ λ
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.
Markov generated pictures (scaled up) with the mustache mona lisa as input.
- 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
Tip of the day:
While working on Cucumber scenarios tag them with @wip and add this to your test runner:
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?
schema - Clojure(Script) library for declarative data description and validation
A less formal (and only provides runtime checks) alternative to core.typed.
rabaq - RabbitMQ queue to disk backup
Latest Elixir project. Will hopefully be more than just a toy. Had a blast learning about OTP, still loads left to grasp of course.
Some photos from Hong Kong that reminds me of some Cyberpunk aesthetics.
rmq-tools - Simple AMQP tools in Erlang
Do you use RabbitMQ? Need some simple tool(s) to send and consume messages? Then check this out, written by a colleague.
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.
- Remove jsex as dependency, replaced with elixir-json
- Parallel execution of git commands
Now spawns a process for each repo to backup
Run fetch and reset with —git-dir and —work-dir
That was from the git log. Was fun (and easy!) to make the git commands execute in parallel.
Two annoyances of Mac OS X 10.9 Mavericks, so far:
- Can’t drag windows to the edge of the screen to move it to another desktop. Work-around: Activate Mission Control (with keyboard shortcut) and then drag it to the wanted desktop. Edit: Seems this was only a problem when using multiple display, still bad.
- Maven was removed. LOL. Work-around:
brew install maven
For the last two weeks I’ve been on vacation in Hong Kong - great city. And besides enjoying myself in non-nerd ways I managed to crank out a bit of toy project Elixir code.
Slowly getting more comfortable. Next thing must include some process tinkering.