Inline functions in Clojure

EDIT: In the comment section Alex Miller advised against using inline functions for now as they are subject to change in the future version of Clojure.

Clojure's inline functions is one of the rarely discovered features. Unlike any other concept that you can introduce via macros they are important enough to be treated specially by the compiler. But still many Clojure users have never heard about inlines let alone used them.

In this post I investigate what is an inline function, how is it different from macros and when either should be used.

NB: This post is a rewrite of this Gorilla session (you should definitely check Gorilla REPL out, it's awesome).

Read more ->>

Marrying ownCloud to Android

ownCloud logo

This post is a follow-up to The Big Migration.

So, with moving many of Google-powered services to my personally hosted ownCloud, I've run into need of providing the necessary infrastructure on the device side. Since I own only Androids it was already easier for me to deal with a single platform, but subtleties, oh subtleties galore. In the post I describe the very ownCloud-compatible Android applications I use up-to-date and am quite happy with.

Read more ->>

Emacs saves the day - again

For many of us Emacs is more than just a text editor. It is a programming environment, text processor, file manager, image viewer, organizer - you name it. But what's most enthralling about Emacs is the simplicity of ad-hoc repurposing it to the specific task. In this take I describe my recent application of Emacs to conveniently label large amount of images.

Read more ->>

The Big Migration (my new Web setup)

DigitalOcean logo

Although OpenShift is a great service and fit all my needs completely, I decided to move on. There were several reasons for that. First of all, I wanted to have a more independent setup, bringing closer the day when I can run my own server reliably. OS being an IAAS applies certain restrictions on what you can and cannot do. Secondly, I hit the limit of three cartridges provided by free, and while it was just the amount I required, it prohibited me from doing any casual testing and web-doodling from that account. And when the money becomes involved, you apply a more careful judgment to where you wanna be.

So farewell Openshift, greetings DigitalOcean. I picked DO mostly for, I won't conceal it, the price tag. $5 is the exact amount I'm willing to spend on a VPS so far, when there is also an option of not paying at all. And for these $5 DigitalOcean provides a decent single-core VPS with 20GB SSD storage space. This is more than enough for me right now, and DO offers more advanced plans for roughly the same amount of money as other VPS providers do. I opted for an instance in San-Francisco (Amsterdam was unavailable when I was creating an instance), and that gives me around 150 ms latency - which is sufficient for my use-cases.

Read more ->>

Emacs as a default system editor

Many novice Emacs users often complain about Emacs being slow to start. This makes them use alternative editors like vi or nano for quick edits. Emacs is indeed a slow beast to power up, but the following solution will show you that it's not much of an issue even if you want to make some quick changes in a single file.

Read more ->>

Fix Sandy Bridge power regression issue in 3.6-3.7 kernel

Proud owners of Intel Sandy Bridge-powered laptops have been experiencing power regression problems for three months now. Starting somewhere at 3.6.x kernel the power consumption suddenly seared high as well as the overall CPU temperature. My typical laptop temperature being around 45°C with introduction of 3.6 it rose to 80. Average battery life jumped from 3-4 hours to pathetic hour and a half. Briefly speaking the changes were too much to bear so I rolled back to 3.5.6 and stayed there for these three months.

Read more ->>

Welcome!

So I have finally overcome my laziness and finished this site. The idea for a personal standalone blog came to me almost a year ago when I bought this domain. Now at last I've made something that I'm not very ashamed to show others.

I pursued a few reasons when I decided to move from cozy and curated Wordpress/Blogger-like environment into the wild. Primarily, I want to be able to prepare posts using an editor instead of a browser. Second, I want my articles to be stored as files rather than some database entries. Finally, managing your stuff personally gives you much more freedom in manipulating it.

Read more ->>

Hipster music player: when MPD is just too mainstream

One of the greatest features of GNU/Linux is that it shares the Unix amaziness of having lots of small tools which are easily combined together via stdin/stdout. Today we are going to explore the possibilities of playing MP3 files with these little tools.

Read more ->>

Writing Tetris in Clojure

Screenshot of the finished application

Good evening to everyone. Today I want to guide you step-by-step through the process of writing a game of Tetris in Clojure. My goal was not to write the shortest version possible but the concisest one and the one that would use idiomatic Clojure techniques (like relying on the sequence processing functions and making a clear distinction between purely functional and side-effect code). The result I got is about 300 lines of code in size but it is very comprehensible and simple. If you are interested then fire up your editor of choice and let’s get our hands dirty.

The full listing is available here.

Read more ->>

Raidcall on Wine: problem with dnsapi.dll

Recently I stuck with a problem that had no solution around the Internet. Raidcall, a voice chat program exclusively for Windows, refused to start under Wine referring to the absent (or wrong) library dnsapi.dll. I found out that there is such library in ./wine/drivec/windows/system32/ folder. Replacing this file with original dnsapi.dll taken from Windows distribution didn’t help. So after that I opened winecfg, switched to Libraries, found dnsapi.dll (native) in the list and just removed it (Remove button is on the right). Then, after applying the changes, Raidcall finally started.

Hope this would help somebody.

For more posts see the Archives page.