dan is currently certified at Master level.

Name: Daniel Barlow
Member since: 2000-02-13 22:03:36
Last Login: 2010-01-20 09:38:57

FOAF RDF Share This

Homepage: http://ww.telent.net/

Notes:

I like Common Lisp

  • CLiki - the groupware hypertext free CL projects link farm
  • cirCLe - one man's LispOS fantasy

The diary here is updated infrequently. See http://ww.telent.net/diary/ for geeky stuff, or www.coruskate.net for skating

Projects

Articles Posted by dan

Recent blog entries by dan

Syndication: RSS 2.0

core.async with aleph

(More sledge retrospective)

There was a point about three weeks ago when I thought I had a working audio player, then I tried using it on the phone and I got awkward screeches every thirty seconds through my stereo when I told it to play Ziggy Stardust. No, I’m not talking about David Bowie’s voice here, this was genuine “a dog ate my CD” style digital audio corruption. The problem seemed to appear only on Wifi: I could replicate it on my laptop, but it didn’t show up on localhost and it didn’t show up over an ssh tunnel: I suspect it was something related to buffering/backpressure, and facing the prospect of debugging Java code wth locks in it I punted and decided to try switching HTTP server instead.

Documentation on HTTP streaming from core.async channels with Aleph is kind of sparse, at least insofar as it is lacking a simple example of the kind of thing that should work. So here is my simple example of the kind of thing that worked for me: wrap the channel in a call to manifold.stream/->source and make sure that the things received on it are byte-array

(defn transcode-handler [request pathname]
  {:status 200
   :headers {"content-type" "audio/ogg"
             "x-hello" "goodbye"}
   :body (manifold/->source (transcode-chan pathname))})

(from server.clj )

I’m sure there are other things you could put on the channel that would also work, but I don’t know what. java.nio.ByteBuffer doesn’t seem to be one of them, but I’m only going on git commit history and a very fuzzy recollection of what I was doing that day, it might be that I did something else wrong.

Syndicated 2014-12-16 07:34:29 from diary at Telent Netowrks

Using the HTML5 audio element in Om

A quick one: if you want to render the HTML5 audio element with Om and do stuff with the events it raises, you will find that the obvious answer is not the right one. Specifically, this doesn’t work

(dom/audio #js {:controls true
                :autoPlay true
		:ref "player"
                :src bits
		:onEnded #(do-something)
               })

This might be because React has to be taught about each event that each element can trigger and it doesn’t know about this one, or it might be because (it is alleged that) event handling in React is done by placing a single event handler on the top-level component and then expecting events on subelements to bubble up. According to Stack Overflow, audio events don’t bubble

The workaround is to add the event listener explicitly in IDidMount, and to call addEventListener with its third parameter true, meaning that the event is captured by the parent before it even gets gets to the sub-element to be swallowed. Like this

Syndicated 2014-12-15 00:07:51 from diary at Telent Netowrks

clj-webdriver with recent Clojure/Firefox

At the time I write this, the latest release of clj-webdriver is 0.6.1. There are two separate problems with this version, at least as far as I can make out

1) some kind of bug which causes it to fail with the message No such var: clojure.core.cache/through. I haven’t tracked this to its root cause but am guessing that the [org.clojure/core.cache "0.5.0"] in clj-webdriver’s project.clj was too old a version for some other dependency I am pulling in. I added an explicit [org.clojure/core.cache “0.6.4”] in my project and that seems to have fixed it. See clj-webdriver issue 132

2) The version of Selenium it pulls in is 2.39, which is too old to work properly with even the vaguely recent version of firefox I’m using (33.1.1). Fixing this is again just a matter of adding the more recent versions of Selenium stuffz as explicit dependencies in project.clj

With those two changes clj-webdriver now seems pretty happy and I can start adding some basic smoke tests to Sledge so that I don’t have to manually test client-side behaviours whenever I change it

Done: use reference cursors instead of channels for enqueuing/dequeing tracks

Next up: use a channel for xhr search instead of quite so many callbacks

Forthcoming: more work on UI/UX. Add tabs to switch between search view and play queue, unify the different-for-no-good-reason “search” and “filters”.

The branch/commit policy from hereon in is

  • it is a bug if master doesn’t pass regression tests on my machine
  • but there could be any kind of rubbish on branches
  • but I firmly subscribe to the Kanban notion of limiting work-in-progress, so will be striving to keep each of these branches short-lived or to declare them moribund at the earliest opportunity

Note that the tests currently depend on having a music collection containing at least four tracks by Queen. This is not ideal and I will fix it some day but in the meantime you’ll just have to work around it somehow. Maybe try leaving a USB stick in the car for two weeks or something

Syndicated 2014-12-14 23:06:29 from diary at Telent Netowrks

ANN Sledge (We're lost in music)

As a person with a large ripped CD collection at home
I want to find and listen to that music from work/on my phone
So that I don’t have to talk to the people around me

Sledge is a program that you can run on a computer with

  • some music you want to listen to
  • a JVM
  • some means of exposing a TCP server port to the internet
  • libav / ffmpeg

It indexes all the music in the directories you tell it to look in, and then it serves a web page with a search box and some buttons on it, which you can access on a device (computer/phone/tablet/etc) that

  • can access the internet
  • has a web browser that supports the HTML5 AUDIO element and likes Ogg files (most of them, these days)

It’s also the first useful[*] thing I’ve written using Clojure and Clojurescript and Om . Get it at https://github.com/telent/sledge – no jar file download yet, so you’ll need leiningen to build it

[*] defined as: I’m using it.

Standing on the shoulders of github

The heavy lifting was mostly done by others. In addition to the above-mentioned, it uses

  • https://github.com/weavejester/clucy as a Lucene interface
  • https://github.com/ztellman/aleph for streaming the transcoded audio
  • https://github.com/DanPallas/green-tags to wrap JAudioTagger

Future plans

It’s reached MVP, as far as I’m concerned: aside from a couple of bugs it meets my use case. But I do have more planned for it as time permits:

  • UI makeover, make it easier to discover music I’d forgotten I have
  • Make the initial media scan much much faster (currently does about 2000 files a minute on my machine) and/or show the progress as it scans
  • some tools for reporting on duplicate files
  • something to deal with correcting/adding tags to media files that have bad or no metadata
  • transcode to formats other than Ogg Vorbis, maybe, if there are people who wnt to use it with browsers that don’t support Ogg

A long long time ago

Previously: “I started looking at all the UPNP/DLNA stuff once for a “copious spare time” project, but I couldn’t help thinking that for most common uses it was surely way over-engineered”. In the four years (and two days) since my opinions haven’t changed but my tools have.

Syndicated 2014-12-08 07:16:18 from diary at Telent Netowrks

If you can see this, it worked

For values of “this” which you don’t care about and can’t see, but my hacky homebrew blogging engine now watches a bare git repo using inotify and runs a checkout/refreshes its content when it sees changes. I’m not sure it wouldn’t have been simpler just to make it die and then use a, y’know, shell script or something to run a git pull before restarting the server, but I did it this way because ZERO DOWNTIME.

Anyway. You don’t see and can’t care, or possibly vice versa. But the previous Heath Robinson stuff with git hooks wasn’t working now that the bare git repo is owned by someone other than the uid that runs the http daemon, so a different Heath was called for.

Syndicated 2014-02-13 22:50:59 from diary at Telent Netowrks

184 older entries...

 

dan certified others as follows:

  • dan certified mjc as Journeyer
  • dan certified mjs as Journeyer
  • dan certified alex as Journeyer
  • dan certified nwv as Journeyer
  • dan certified argent as Master
  • dan certified ariel as Master
  • dan certified Ward as Master
  • dan certified Sunir as Journeyer
  • dan certified wnewman as Master
  • dan certified pvaneynd as Master
  • dan certified Omnifarious as Journeyer
  • dan certified kira as Journeyer
  • dan certified tbmoore as Master
  • dan certified fufie as Journeyer
  • dan certified ingvar as Journeyer
  • dan certified rjain as Journeyer
  • dan certified walters as Journeyer
  • dan certified crhodes as Master
  • dan certified rvdm as Journeyer
  • dan certified slef as Apprentice
  • dan certified hands as Master
  • dan certified mdanish as Journeyer
  • dan certified bmastenbrook as Journeyer
  • dan certified tagishandy as Journeyer

Others have certified dan as follows:

  • dria certified dan as Master
  • uzi certified dan as Journeyer
  • riel certified dan as Journeyer
  • andrei certified dan as Journeyer
  • dhd certified dan as Journeyer
  • pp certified dan as Journeyer
  • gbritton certified dan as Master
  • lmb certified dan as Journeyer
  • skyhook certified dan as Journeyer
  • mjs certified dan as Journeyer
  • zhp certified dan as Journeyer
  • dick certified dan as Journeyer
  • ajkroll certified dan as Journeyer
  • jes certified dan as Journeyer
  • dwmw2 certified dan as Journeyer
  • mkp certified dan as Journeyer
  • cmm certified dan as Master
  • Simon certified dan as Journeyer
  • phaedrus certified dan as Journeyer
  • asmodai certified dan as Journeyer
  • ariel certified dan as Master
  • mbit certified dan as Master
  • grahamw certified dan as Master
  • mwh certified dan as Master
  • nixnut certified dan as Journeyer
  • Omnifarious certified dan as Journeyer
  • fufie certified dan as Journeyer
  • manu certified dan as Journeyer
  • rjain certified dan as Journeyer
  • crhodes certified dan as Master
  • walters certified dan as Journeyer
  • davej certified dan as Journeyer
  • jf certified dan as Master
  • rvdm certified dan as Journeyer
  • slef certified dan as Master
  • ks certified dan as Journeyer
  • fxn certified dan as Journeyer
  • ricardo certified dan as Master
  • varjag certified dan as Journeyer
  • chalst certified dan as Master
  • redowl certified dan as Master
  • jeroen certified dan as Journeyer
  • lukeg certified dan as Journeyer
  • mdanish certified dan as Master
  • Stevey certified dan as Master
  • sral certified dan as Master
  • water certified dan as Master
  • nikodemus certified dan as Master
  • alexm certified dan as Journeyer
  • bmastenbrook certified dan as Master
  • badger certified dan as Journeyer
  • cyrus certified dan as Master
  • technik certified dan as Master
  • pcburns certified dan as Master
  • dangermaus certified dan as Master

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

X
Share this page