Category: Programming

May 13, 2008 : That doesn't happen very often

On Saturday morning I woke up to people talking about string concatenation, and how many parameters some function needed.

Feb 06, 2008 : MS SQL matrix query

If you use Microsoft SQL and you want to do a query to turn some rows into columns, it can be tricky. I don't know what that type of query is called, I think some call it a matrix query or a cross-tab query or a pivot query. Here's how I've been able to write a pivot cross-tab matrix queries for Microsoft SQL Server including an extra variation for SQL Server 2005.

Technorati tags:

Jan 08, 2008 : MediaWiki software and rel=nofollow

In case any of my readers run a MediaWiki site, you should know: By default, MediaWiki is configured to use rel=nofollow on links. This means anyone who sets up a MediaWiki site, not just wikipedia and its siblings. Here's more info and how to reconfigure it. That makes me mad. They should have better defaults.

Sep 13, 2007 : Event notifications in linux

Envious of slick Mac notifications via Growl, I looked around for similar systems for linux. There doesn't seem to be anything quite as nice, but KDE has a knotify subsystem that is used by KDE apps and easily scriptable. And Galago has libnotify (or is it libgalago?) a gtk-based system for notifications.

I wanted to have an easy way to get notifications when a build or test suite is done running, so I wrote a few simple scripts to use knotify to do so. See Putting KNotify to work for some docs and screenshots of what it looks like. Here's the docs and code:

knotify-send

docs:
Usage:
  knotify-send [TITLE] [BODY] - create a passive knotify popup

Example:
  knotify-send heya! "look at me"
code:
#!/bin/bash

# Copyright Dave Brondsema
# licensed under Apache License 2.0

# inspired by galago-project.org's notify-send

if [ "$1" == "" ]; then
    echo "Usage:"
    full=$0
    base=${full##*/}
    echo "  $base [TITLE] [BODY] - create a passive knotify popup"
    echo
    echo "Example:"
    echo "  $base heya! \"look at me\""
    exit
fi


dcop knotify default notify eventname "$1" "$2" '' '' 16 0

knotify-done

docs:
Usage:
  knotify-done [COMMAND] [ARGUMENTS...] - runs command with args, and then runs knotify when done

Examples:
  knotify-done svn up
  knotify-done ./configure && make && knotify-done make install
     (only notifies for 'make install')
code:
#!/bin/bash

# Copyright Dave Brondsema
# licensed under Apache License 2.0

# inspired by http://sami.picobot.org/?p=19 and comments

if [ "$1" == "" ]; then
    echo "Usage:"
    full=$0
    base=${full##*/}
    echo "  $base [COMMAND] [ARGUMENTS...] - runs command with args, and then runs knotify when done"
    echo
    echo "Examples:"
    echo "  $base svn up"
    echo "  $base ./configure && make && $base make install"
    echo "     (only notifies for 'make install')"
    exit
fi


$@
title="Completed with exit code $?"
body=$@
dcop knotify default notify eventname "$title" "$body" '' '' 16 0
Technorati tags:

: Programmer's Day

Programmer's Day is today, the 256th day of the year. Sorry I couldn't give you guys more advance notice so you could do nice things for me :) ... but I just found out today.

<< Previous PageNext Page >>

<< Previous PageNext Page >>

<  November 2017  >
Mon Tue Wed Thu Fri Sat Sun
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

Categories


Archives

Misc

Syndicate this blog XML

powered by
b2evolution