Latest Posts

SoundCloud group reposting script

SoundCloud has gone and killed the groups feature completely. Their suggested replacement is to create a profile and repost tracks to it. I hope you weren’t too attached to the submission functionality and ability to run an unmoderated group, because that’s gone. To add insult to injury, SoundCloud doesn’t offer a way to migrate the tracks already in your group to a profile. I knocked up a short Python script to do this, included below.

Populate the variables at the top of the script with:

  • Your app client ID
  • Your app client secret (get both of these by registering a new app at http://soundcloud.com/you/apps/new )
  • Your group ID (here’s a guide to finding this)
  • Your username
  • Your password

(more…)

Replacing your foreach loops with the Java 8 Streams API

I wanted to make a quick post about the Java 8 streams API. It’s really cool. I mainly use it to simplify foreach loops.

Isn’t this:

Much nicer like this?

(more…)

Fix transient X pointer issues with Ctrl-Alt-FKey

I run Xfce 4.8, and I occasionally get problems with the pointer:

  • Stops responding to input
  • Motion ‘sticks’ (even if it’s stuck on the physical level, I’ve done this by using the touchpad with wet fingers)

A quick way to reset input to the pointer is to change to another tty and then back again. The graphical session is in tty7 by default:

Ctrl-Alt-F6 Ctrl-Alt-F7

$(()) vs. `expr`

Just a quick note on the relative speed of $(()) vs. expr as a means of evaluating arithmetic expressions in bash: even though they’re (apparently) functionally equivalent, this:

for i in {1..10}; do n=expr $i + 10; echo $n; done

Takes about a full second to run (I can see it print the lines one at a time), whereas this:

for i in {1..10}; do n=$(($i + 10)); echo $n; done

pops out all at once. Tested in GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu).