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.
Syndicated 2008-05-14 01:57:52 from Dave Brondsema's Blog - Programming
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.
Syndicated 2008-05-14 01:57:52 from Dave Brondsema's Blog - Programming
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.
Syndicated 2008-02-07 04:09:24 from Dave Brondsema's Blog - Programming
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.
Syndicated 2008-01-09 04:10:16 from Dave Brondsema's Blog - Programming
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:
Usage:
knotify-send [TITLE] [BODY] - create a passive knotify popup
Example:
knotify-send heya! "look at me"
#!/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
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')
#!/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
Syndicated 2007-09-14 02:17:03 from Dave Brondsema's Blog - Programming
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.
Syndicated 2007-09-13 15:21:16 from Dave Brondsema's Blog - Programming
BarCampGrandRapid2 recap
BarCampGrandRapids2 was a lot of fun. I didn't get to engage quite as much as I'd've liked since I was one of the organizers, but it still went really fun and was good to meet lots of people and hang out with friends. I particularly enjoyed Calvin's and Kyle's presentation on YUI CSS and Design Eye for the IT Guy (lots of good resource links there). Hopefully I'll post some notes about my presentation on Facebook/Myspace (I said "spacebook" a few times when I was tired.. not during the presentation) and the need for open systems and protocols for social networks. Finally, I want to list off a few new people that I met. I don't know why, but I feel like doing it.
The Future of Java
Last night I gave a presentation at the Grand Rapids Java Users' Group titled "The Future of Java". If anyone is interested, you can view the slides in PDF or OpenDocument (with some notes) format. The topics I covered were:
Syndicated 2007-06-21 04:50:10 from Dave Brondsema's Blog - Programming
Does google toolbar uses hCard microformat for addresses?
It appears the the google toolbar (at least for IE) will find addresses in webpages that are marked with the hCard microformat and use it in a "Look for Map" button. I haven't tried to test it, and I can't find anyone talking about it on the web. But it sure seems to work that way. It may (also) use some other heuristics, I don't know. Does anyone know more about this?
Syndicated 2007-06-18 18:09:24 from Dave Brondsema's Blog - Programming
BarCamp Grand Rapids 2
no, it's nothing (inherently) about drinking. It's a fun geeky get-together that I'm helping organize again this year. Here's the announcement with all the info:
Rule #1 of BarCamp: you DO talk about BarCamp.
http://barcamp.org/BarCampGrandRapids2
We're proud to announce our second BarCamp (dangerously close to being "annual"). BarCamp is a technology & design unconference where the campers (you) determine what's on the schedule. These ad-hoc unconferences are intense events with discussions, demos, and a chance to interact with fellow attendees. Anyone with something to contribute or with the desire to learn is welcome and invited to participate.
WHEN: Friday evening, July 20 and Saturday, July 21
WHERE: Calvin College, Grand Rapids, MI
COST: Free! But everyone is encouraged to present something and be involved, even if you're never given a talk before.
WHAT: So far, topics ranging from opensource business to the JQuery Javascript library to next generation communications. Ultimately each camper has an opportunity to help determine the content.
You can register and find out more information about BarCamp Grand Rapids at http://barcamp.org/BarCampGrandRapids2, or about BarCamps in general at http://en.wikipedia.org/wiki/BarCamp
100% height iframe
So <iframe height="100%"> doesn't make an iframe fill all the remaining portion of a window like you might expect. I found several places where people showed how they got it to resize with javascript, but those didn't work for me. The DOM properties that they used were frequently the "page" height (e.g. 250px for a short content page, 1300px for a tall page that has scrolling) or something else wrong. Here is what works for me (in Firefox 2 and IE 7) to make an iframe be as high as possible without causing the main window to have scrolling:
<html>
<head>Test Page</head>
<body>
<h1>Check out the cool page below</h1>
<p><a href="/">Go back home</a></p>
<iframe id="frame" src="http://google.com/" width="100%" frameborder="0" marginheight="0" marginwidth="0"></iframe>
<script type="text/javascript">
function resizeIframe() {
var height = document.documentElement.clientHeight;
height -= document.getElementById('frame').offsetTop;
// not sure how to get this dynamically
height -= 20; /* whatever you set your body bottom margin/padding to be */
document.getElementById('frame').style.height = height +"px";
};
document.getElementById('frame').onload = resizeIframe;
window.onresize = resizeIframe;
</script>
Hopefully this may help someone in the same situation.. your mileage may vary.
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!