RSS feeds for SourceForge project activity statistics

Every SourceForge project has a statistics page with the number of daily page views and downloads (example). Last year, I built a little screenscraper (page in German) that converted any project’s stats page into an RSS feed. But earlier this year, their statistics system frapped out and wasn’t since heard of.

But now it’s fixed, and I’ve updated my little service and added a bit of polish, and it’s back:

RSS feeds for SourceForge project activity statistics

I’m using Kai Blankenhorn’s FeedCreator PHP class. Here’s a screenshot of the Jena feed in NewsFire:

NewsFire screenshot with the statistics feed for the Jena project

Source code (PHP, LGPL)

UPDATE: Sparklines!

Statistics RSS feed with sparklines

Posted in General | Tagged | Comments Off on RSS feeds for SourceForge project activity statistics

Jena Model Editor

The Jena Model Editor is a Swing-based GUI window that provides a simple Turtle (N3)-based editor and inspector for Jena models. It’s useful for developing GUI applications that store their data in Jena models. Want to know what statements one of your models currently contains without sprinkling System.out.println calls through your code? Want to add a few statements to test something without having to restart you application? Then JME is for you.

How it works: Download jme.jar and put it on the classpath. Then call this where you set up an interesting model:

ModelEditor.open(myModel);

How it looks:

Jena Model Editor screenshot

What it can do:

  • Show current contents of the model as Turtle
  • Import Turtle into the model
  • Add or remove Turtle snippets from the model
  • Add or remove namespace prefixes
  • Basic Turtle syntax checking (well, it takes you to the first error it finds)
  • Notices concurrent modifications to the model

Other stuff:

Comments and questions to me.

Posted in General, Semantic Web | 1 Comment

Finish the things you started

Danny Ayers reveals the secret: How to find inner peace and feel great. And it’s much simpler than I had thought.

Posted in General | Comments Off on Finish the things you started

Miscellaneous stuff from my .vimrc file

Some more VIM goodies that have accumulated in mv .vimrc over the years:

Switch between :split and :vsplit windows using CTRL+hjkl:

map <c-J> <c-W>j<c-W>_
map <c-K> <c-W>k<c-W>_
map <c-H> <c-W>h<c-W>_
map <c-L> <c-W>l<c-W>_
set wmh=0

Nicer color scheme: brighter comments, more contrast for search highlight. Intended for systems that use the light-on-dark scheme.

hi Comment ctermfg=darkcyan
hi Identifier ctermfg=lightgreen
hi PreProc cterm=underline
hi Search ctermbg=darkblue cterm=underline

Triple <esc> removes the annoying search highlight created by incremental search

:nnoremap <silent> <esc><esc><esc> :noh<cr>

In PHP files, shift-K searches word under cursor in online manual

autocmd FileType php
    \ nmap <s-k> <s-k><cr> |
    \ set keywordprg=php_lookup.sh

(php_lookup.sh is a shell script or batch file on the path that opens a web browser on the function’s manual page, e.g. for Mac OS X: open http://de2.php.net/$1)

In PHP files, ctrl-B checks PHP syntax

autocmd FileType php map <c-B> :w !php -l<cr>

Activate syntax highlighting for .rhtml files (put eruby.vim to ~/.vim/syntax/eruby.vim)

autocmd BufNewFile,BufRead *.rhtml set syn=eruby

See also: VIM: Switching off auto-indentation, VIM: Setting custom tab behaviour for some filetypes, VIM: Quick autocompletion

Posted in General | Comments Off on Miscellaneous stuff from my .vimrc file

VIM: Quick autocompletion

This little VIM script enables autocompletion with the tab key. All words in the current file will be used as possible completions. No cross-file autocompletion yet. Put this into ~/.vimrc (or _vimrc in your VIM directory if you are on windows); create the file if it doesn’t exist:

" Autocompletion with <tab>
function InsertTabWrapper()
    let col = col('.') - 1
    if !col || getline('.')[col - 1] !~ '\k'
        return "\<tab>"
    else
        return "\<c-p>"
    endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()
Posted in General | Comments Off on VIM: Quick autocompletion

Jena 2.3 released

Jena 2.3 is released. New/improved stuff:

  • Out-of-the-box SPARQL support (via ARQ, which is now included in the Jena download)
  • Faster queries on in-memory graphs
  • Faster parsing of RDF/XML

Neat! Good to see that the Jena releases are rolling out a bit faster now. Jena 2.2 is just six months old, compared to the eightteen-month-wait between 2.0 and 2.1.

Posted in General, Semantic Web | Comments Off on Jena 2.3 released

VIM: Setting custom tab behaviour for some filetypes

To change the VIM tab settings for some file types, you can put something like this into ~/.vimrc (or _vimrc in your VIM directory if you are on windows); create the file if it doesn’t exist:

" Default tab behaviour: Use spaces instead of tabs, a tab is 4 spaces
set expandtab
set shiftwidth=4
set tabstop=4

" But tab should be 2 spaces in HTML and Smarty templates
autocmd FileType html
  \ setlocal shiftwidth=2 |
  \ setlocal tabstop=2
autocmd FileType smarty
  \ setlocal shiftwidth=2 |
  \ setlocal tabstop=2

The first block sets the default behaviour. The second block overrides the settings for the html and smarty file types.

Posted in General | Comments Off on VIM: Setting custom tab behaviour for some filetypes

VIM: Switching off auto-indentation

How to switch off all kinds of auto-indentation in VIM. Put this into ~/.vimrc (or _vimrc in your VIM directory if you are on windows); create the file if it doesn’t exist:

" Switch off all auto-indenting
set nocindent
set nosmartindent
set noautoindent
set indentexpr=
filetype indent off
filetype plugin indent off

The first line is a comment; the rest switches off all the different parts of the auto-indentation system.

Posted in General | Comments Off on VIM: Switching off auto-indentation

Paul Graham quote

An insightful Paul Graham quote (from this essay):

Ironically, though open source and blogs are done for free, those worlds resemble market economies, while most companies, for all their talk about the value of free markets, are run internally like communist states.

This is a sufficient explanation for the success of open source, in my book: The market forces in an open source ecosystem are much stronger.

(Writing this, I notice that the words “market” and “ecosystem” basically mean the same thing.)

Posted in General | Comments Off on Paul Graham quote

Building XML files with Ruby

Is this cool or what?

    xml.rss("version" => "2.0") do
      xml.channel do
        xml.title(@feed_title)
        xml.link(@url)
        xml.description "Basecamp: Recent items"
        xml.language "en-us"
        xml.ttl "40"

        for item in @recent_items
          xml.item do
            xml.title(item_title(item))
            xml.description(item_description(item))
            xml.pubDate(item_pubDate(item))
            xml.guid(@recent_items.url(item))
            xml.link(@recent_items.url(item))
          end
        end
      end
    end

This is from the ActionPack documentation, a part of Ruby on Rails. I don’t fully understand the example (Where are the item_foo methods defined?), but this looks like a damn slick way to generate XML.

I’m very impressed by Ruby. The language’s syntax is very flexible and makes it easy to create “little languages” tailored for certain jobs, like XML generation and build files and object-relational mapping.

The obvious question: How can this be used to manipulate RDF?

Posted in General | 1 Comment