Bill Farmer

Random thoughts on random subjects

Using Emacs in Android Development

by Bill Farmer. Categories: Hacking .

I’ve got a folder full of country flags which I have renamed using scripts so the names correspond to currency symbols. I want an integer array with references to the flags as android resources. This can be automated using emacs. I get a list of the file names into a buffer using find, which I then open with emacs. % find src/ -name flag* > data/sym-flags.lst They are already sorted, but just to make sure I use M-x sort-lines.

Read more →

Markdown OpenStreetMap Maps

by Bill Farmer. Categories: Hacking .

There does not seem to be a convention for showing maps or co-ordinates in Markdown, but almost anything gets put in square brackets [<anything>]. I had a request from Marco the other day to put OpenStreetMap maps in my Diary app using [<lat>,<lng>] syntax. So I did a bit of a search to see if there was a convention in Markdown for co-ordinates and couldn’t find anything. So we seem to have broken new ground here.

Read more →

Getting Related Content working

by Bill Farmer. Categories: Hacking .

The latest release of Hugo includes Related Content, which I thought would be nice to add to my blog. However the docs, although they show you how to set it up, don’t explain how it works. To find that out, I had to look at the various threads on the Hugo forums. There are four parts - you need to create a new partial template in layouts/partials/related.html containing something like this:

Read more →

Adding a calendar event in android

by Bill Farmer. Categories: Hacking .

The android docs for the Calendar Provider are quite useful, but recommend the use of an AsyncQueryHandler for querying or adding events to calendars in an asynchronous thread. However the AsyncQueryHandler docs don’t include much guidance as to how to use it. To add an entry to an android calendar you first have to find out the calendar id using an asynchronous query on the calendars table. // QueryHandler public class QueryHandler extends AsyncQueryHandler { private static final String TAG = "QueryHandler"; // Projection arrays private static final String[] CALENDAR_PROJECTION = new String[] { Calendars.

Read more →

Whatever-o-meter revisited

by Bill Farmer. Categories: Hacking .

I wrote the whatever-o-meter about five years ago in PHP and Javascript as a Wordpress plugin. As I have migrated my blog to Hugo, I thought to have a go at reimplementing it. The exporter I used made a good job of translating the Wordpress custom fields to Hugo front matter parameters. I had to put dashes in quotes, otherwise they get interpreted as [<nil>]. intro: Please answer the following questions carefully and truthfully.

Read more →
Previous page Next page