Google Reader (finally) gets search-within-subscriptions

Back in April 2007, when I decided to switch over from Bloglines to Google Reader for my RSS reading pleasure, I made a point to complain about the fact that Google Reader had no easy way to search for entries within your subscriptions. The good news is apparently that all changed, yesterday: Google Reader now has a search box!

Google Reader gets a Search box!

This is good news, since that was pretty much the only feature I’d actually missed when I gave up Bloglines. It’s good timing on Google’s part, since the latest Bloglines beta UI improvements have really closed the gap–although I’m not happy enough with them to consider switching back, yet.

Tags: , ,

Planet AOLserver, aggregating AOLserver-related feeds

In the grand scheme of “why does Dossy go off and do things without asking people first” … I’ve set up Planet AOLserver:

http://dev.aolserver.com/planet/

The current subscriptions list is populated with the feeds of blogs I’ve been able to find over the years of people who have blogged about or use AOLserver in one way or another. I’m betting the list is incomplete: if you’d like your feed added to the subscriptions list, please email the URL to me. Similarly, if your feed appears on the list and you’d like it removed, just ask me to remove it.

I’m using a simple regexp filter to pick out (hopefully) only the relevant entries:

filter = (?i)(AOLserver|Tcl|OpenACS|MySQL|PostgreS(QL)?)

Think something should be added to the filter? Is there an entry in your feed that you think should be included in the Planet but isn’t? Again, let me know and I’ll try to fix it.

Tags: ,

del.icio.us/dossy links since August 27, 2007 at 09:00 AM

del.icio.us/dossy (RSS) links since August 27, 2007 at 09:00 AM:

tcl-mysql-udf 0.2 and Win32 DLL binary

Last week, I released some code that would enable MySQL to evaluate Tcl scripts as a stored function, which I called tcl-mysql-udf. My friend Steve asked if I could prepare a Win32 DLL binary for him, so I worked on that tonight and am releasing version 0.2, along with the DLL:

In order to play with this, you’ll need the following prerequisites installed:

  • MySQL (I’m testing on 5.1.21-beta)
  • Tcl (I’m testing on 8.4.15.0)

Inside the tcl-mysql-udf-0.2-dll.zip will be the file tcl-mysql-udf.dll. On MySQL 5.0.x, it expects it to reside in the Program Files\MySQL\MySQL Server 5.0\bin directory, so copy it there. On MySQL 5.1.x, however, it expects it to be in the Program Files\MySQL\MySQL Server 5.1\lib directory. Pay close attention to what version of MySQL you’re using and the correct directory to copy the DLL into.

Once you’ve got everything installed and copied to the right locations so far, connect to your MySQL database with your favorite MySQL client, and issue the following command (you only type what’s in bold):

mysql> CREATE FUNCTION TCL RETURNS STRING SONAME 'tcl-mysql-udf.dll';
Query OK, 0 rows affected (0.10 sec)

We can check what version of Tcl we’ve loaded this way:

mysql> SELECT TCL('info patchlevel') AS script;
+--------+
| script |
+--------+
| 8.4.15 |
+--------+
1 row in set (0.04 sec)

Here’s a goofy example of storing Tcl scripts in the database and having MySQL evaluate them:

mysql> CREATE TABLE code (
n INT NOT NULL AUTO_INCREMENT,
script TEXT NOT NULL,
PRIMARY KEY pk_code (n)
) ENGINE=MyISAM;

Query OK, 0 rows affected (0.20 sec)

mysql> INSERT INTO code (script) VALUES
('set x 123'),
('expr {$x + 432}'),
('clock format [clock seconds]'),
('incr x [clock seconds]'),
('expr {$x * rand()}');

Query OK, 5 rows affected (0.04 sec)
Records: 5  Duplicates: 0  Warnings: 0

So, we now have a table with five rows in it, each row containing a Tcl script. We can have MySQL evaluate those Tcl scripts like this:

mysql> SELECT n, TCL(script)
FROM code
ORDER BY n;

+---+---------------------------------------------------+
| n | TCL(script)                                       |
+---+---------------------------------------------------+
| 1 | 123                                               |
| 2 | 555                                               |
| 3 | Fri Aug 31 12:41:25 AM Eastern Daylight Time 2007 |
| 4 | 1188535408                                        |
| 5 | 6935485.39171                                     |
+---+---------------------------------------------------+
5 rows in set (0.05 sec)

So what, right? How about fetching HTML documents via HTTP, right from within MySQL?

mysql> CREATE TABLE urls (
n INT NOT NULL AUTO_INCREMENT,
url VARCHAR(255) NOT NULL,
PRIMARY KEY pk_urls (n)
) ENGINE=MyISAM;

Query OK, 0 rows affected (0.03 sec)

mysql> INSERT INTO urls (url) VALUES
('http://dossy.org/'),
('http://aolserver.com/'),
('http://njgeeks.org/');

Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> SELECT n, url, TCL(
'package require http;'
'set url [lindex $args 0];'
'set token [http::geturl $url];'
'set data [http::data $token];'
'http::cleanup $token;'
'regexp -all -inline {<title>.*?</title>} $data',
url) AS script
FROM urls
ORDER BY n \G

*************************** 1. row ***************************
     n: 1
   url: http://dossy.org/
script: {<title>Dossy's Blog</title>}
*************************** 2. row ***************************
     n: 2
   url: http://aolserver.com/
script: <title>AOLserver</title>
*************************** 3. row ***************************
     n: 3
   url: http://njgeeks.org/
script: {<title>NJ Geeks | - New Jersey's IT Community</title>}
3 rows in set (1.54 sec)

This query uses the Tcl “http” package to fetch the documents specified by the url column and plucks out the <title> tag using a regular expression. The TCL() stored function takes a variable number of arguments, the first being the Tcl script to evaluate, followed by zero or more arguments that are placed into the $args Tcl variable. In this case, we pass in “url” so that on each row, we execute our Tcl script with the value from that row.

Be aware that this stored function is a security issue: allowing database users to execute arbitrary code has obvious risks, especially since that code will be executed as the user that the MySQL server is running as.

Hopefully this is enough to get you started and might even give you an idea as to how this could be useful to you in some way. If you have any questions, just leave them in the comments below.

Tags: , , ,

libpurple patch to extend the purple::cmd Tcl command

As of Pidgin 2.1.1, the Tcl plugin can only register and unregister commands using the purple::cmd Tcl command. However, without the ability to execute commands, it’s pretty pointless. So, here’s a patch to add the subcommands “do”, “help” and “list” to purple::cmd. I’ve submitted this as Ticket 2873.

If you’d like to try this out, here’s a Win32 build of tcl.dll for Pidgin 2.1.1 after applying this patch:

Just extract that into your Program Files\Pidgin\plugins directory, after making a backup copy of your old tcl.dll, of course.

If you have any questions about or concerns with this patch, let me know in the comments below. Thanks!

Tags: , ,

Pidgin IM patch for IRC 352 (who) parsing

Pidgin is a multi-protocol IM client (formerly known as “Gaim”) that is available on various platforms (Linux, Win32).

Recently, someone asked in #pidgin about a feature request to make libpurple parse the IRC 352 messages, which are returned in response to a WHO command. I said I could throw together a quick patch to make this happen and I’ve got something working now.

Currently, this is what a IRC chat in Pidgin might look like:

Pidgin IRC chat, before patch

After the patch, you can issue a “/quote who #channel” which will send the literal command “who #channel” to the IRC server, to which it will send the 352 response messages. My patch makes libpurple parse these messages and set the PURPLE_CBFLAGS_AWAY flag on the appropriate user’s PuprleConvChatBuddyFlags record. The result looks like this:

Pidgin IRC chat, after patch

You can now see user “Dossy_” is set away by the status icon (the clock, cirlcled in green in the screenshot).

Of course, there’s a few big caveats with this patch:

  • Only users set “away” who have no other meaningful PurpleConvChatBuddyFlags (i.e., chan op, voiced) will display the away status icon, as it has lowest precedence, since only one buddy status icon is displayed at a time. (See pidgin/gtkconv.c:get_chat_buddy_status_icon() to see what I mean.)
  • The server does not send regular status update notifications with 352 messages. It only sends them in response to a “who” command. Therefore, if you want the status data to be updated, you’ll need to periodically poll the server by issuing a “who” command. This is inefficient and for large IRC channels it can be quite resource intensive. If you want periodic updates, you’ll need to issue the “who” command manually, or write a Pidgin plugin that periodically polls by issuing the command for you.

Here’s the patch against the Pidgin 2.1.1 source tarball:

If you have any questions about or issues with the patch, leave them in the comments below.

Tags: , ,

August 27th NJ Hackfest

Five of us came out for this week’s Hackfest:

NJ Hackfest Meetup 2007-08-27

Left to right: Glenn M., Mike G., Steve G., Robbie the Geek

Tags: , ,

LOLduke says, “I CAN HAS VALUATION NOW?”

Jonathan Schwartz blogs that Sun is changing their trading symbol from SUNW to JAVA. This leaves me with only one thought …

OH HAI! I CAN HAS VALUATION NOW?

(In case you didn’t know, that’s Duke, Java’s mascot.)

Tags: , ,

del.icio.us/dossy links since August 20, 2007 at 09:00 AM

del.icio.us/dossy (RSS) links since August 20, 2007 at 09:00 AM:

Happy campers!

There aren’t many pictures up from MySQL Camp II yet, but Ronald uploaded one so here it is:

Drinks with the MySQL Campers

Do we have goofy grins on our faces? That’s because we had such a great time geeking out for two days straight, followed by beers!

Tags: , ,