svgcal now available on sf.net

This afternoon I decided to go ahead and post a project I’ve been working on “in secret” to SourceForge: svgcal. svgcal is a simple program for generating SVG calendars from a plain-text input file. An example input file looks like this:

Mon-Fri 8-8:30 commute
Mon-Fri 8:30-17:30 work
Mon-Fri 17:30-18 commute
Mon-Fri 11:30-12:15 lunch
Mon 18:15-19:15 softball
Mon 19:15-22:00 drinking
Sun-Sat 23-8 sleep
Tue,Thu 21:45-1:00 raid
Fri,Sat 21:00-1:15 drinking
Mon-Fri 8:00 wakeup

The calendar generated by this input file looks like this:

svgcal example screenshot

svgcal example screenshot

svgcal also has what I think is a novel option to generate circular calendars – daily agenda items represented as their time on the clock rather than the traditional rectangular weekly calendar. Using the same input file, one can generate a circular calendar that looks like this:

svgcal example circular screenshot

svgcal example circular screenshot

I don’t know of any other tool that creates calendars that look like this. (Note that the circular bit is a little “experimental” at the moment and not quite as pretty as I’d like it to be).

Anyhow, if you’re looking for a tool for generating SVG calendars from a plain-text agenda, check out svgcal!

Advertisements

Adventures with autotools

I’ve used and otherwise benefited from autotools a number of times in the past – being able to just ./configure && make && make install a large number of open source projects is hugely beneficial – but I’ve never actually ./configured (heh) one of my own projects to use them. Well…I decided to go down that path today.

The project – svgcal (link coming soon!) – is a little tool I’m throwing together to parse an input file and generate a (hopefully) pretty SVG file that displays my weekly agenda. I’m not too far along, so right now it’s just a couple of files – sources for the lexer and parser and a couple of header files – so I thought it would be good to go ahead and get autotools set up before it got much more complex than that. So, what did I have to do? Just a handful of steps:

  1. Create a couple of files for autoreconf to use (Makefile.am, configure.ac, and src/Makefile.am – listings below)
  2. Run autoreconf --install
  3. Tweak my lexer (autotools muck about with how the parser header file gets created; was an easy fix: s/y.tab.h/parser.h/)
  4. Add the generated files to source control
  5. …and that’s it!
My project is now all set up to be built using ./configure and make without me doing any additional work. Awesome!

Makefile.am:

SUBDIRS = src
dist_doc_DATA = README

configure.ac:

AC_INIT([svgcal], [0.1], [cliff@cliftonsnyder.net])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
# programs needed
AC_PROG_CC
AC_PROG_LEX
AC_PROG_YACC
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_FILES([
Makefile
src/Makefile
])
AC_OUTPUT

src/Makefile.am:

bin_PROGRAMS = parser
parser_SOURCES = svgcal.c parser.y lexer.l
AM_YFLAGS = -d


Simple Backups Using rsync

I found this page on Easy Automated Snapshot-Style Backups with rsync the other day. Since I’d recently bought a new 120GB hard drive ($35 buys a lot of storage these days!) I decided to set up one of my extra machines as a backup server and bash out a script to automate backups. It’s a little rough and needs some customizing touches (command-line flags, anyone?), but it gets the job done; you can get the script here.


Learning LaTeX and the "listings" Package

I recently decided to start doing my homework in LaTeX, for a couple of reasons. Perhaps foremost among these LaTeX is a useful thing to know, being (according to the website) “the de facto standard for the communication and publication of scientific documents”, and I had no prior experience using it. Another is that it has built-in support for typesetting mathematical equations, which is extremely useful to someone who is taking a class in advanced algorithms. (Just try getting your word processor to represent something like xlogba).

At any rate, one of the best things about LaTeX is its extensibility, which is acchieved through the use of packages. One useful package that I found in the course of doing my homework is the listings package. This packages is intended to allow typesetting of source code – as opposed to the \verbatim/\verb! method – including highlighting of keywords and other special formatting for various source constructs (e.g., italicized comments). It even allows you to specify the programming language that you will be using and, if there is no support for one’s language of choice, it is possible to create one’s own typesetting definition for that language.

Anyone interested in a simple way to typeset source code should check it out [PDF]!