…in mathematics you don’t understand things, you just get used to them.
Yearly Archives: 2007
Get a random del.icio.us link
I use del.icio.us a lot. I have one tag topost to save those things I find on the Internet which I want to write about later, but I have around 100 right now, so I was interested in picking random links from that list.
Bad news you can’t do that neither from the del.icio.us interface nor the API provided, so I took a different approach. I downloaded MySQLicious, a set of PHP scripts to mirror your delicious links into a local MySQL database. Once you edit your connection parameters, it’s quite easy to use:
$ ./mirrorlog.php
Update may be needed. Checking now.
Updated http://members.ebay.com/ws/eBayISAPI.dll?ViewUserPage&userid=*starlightstarbright*
Deleted eacb873e503b1b407c2ec69e541b8838
1 updated.
1 deleted.
You can also put that command into a cron task to update regularly.
Then to get a random link, you can use the following script:
#!/usr/bin/php -q
<?php
// mirror.php MySQLicious implementation
// Mirrors del.icio.us bookmarks.
// v1.01 - 8/6/2006
// MySQL configuration
$MySQL_Host = "127.0.0.1";
$MySQL_Database = "delicious";
$MySQL_Table = "posts";
$MySQL_Username = "root";
$MySQL_Password = "";
// import the MySQLicious code
$currentDir = dirname(__FILE__)."/";
require $currentDir."MySQLicious.php";
$dbh = mysql_connect($MySQL_Host , $MySQL_Username, $MySQL_Password)
or die("Could not connect to database server.");
mysql_select_db($MySQL_Database, $dbh) or die("Could not use database.");
$res = mysql_query("SELECT url,description
FROM $MySQL_Table
WHERE tags LIKE '%topost%'
ORDER BY RAND() LIMIT 1");
$row = mysql_fetch_array($res);
printf("%s\n%s\n", $row["url"], $row["description"]);
?>
or the following command:
$ mysql -e 'SELECT url,description FROM posts WHERE tags
LIKE "%topost%" ORDER BY RAND() LIMIT 1\G' delicious
*************************** 1. row ***************************
url: http://www.lifehacker.com/software/podcasts/search-audio-with-pluggd-223280.php
description: Search audio with Pluggd - Lifehacker
L337 advertising

Advertising is evolving in strange ways. It took some time to recognize the language (looks like C, but the this suggest OO, so C++ was a candidate), but it runs when compiled as C++.
#include "stdio.h"
#include "string.h"
struct cool {
char p1, p2, p[5];
cool(int c) : p2(c++), p1(c) {
strcpy(p, "v_ga");
p[1]=p2; p2=p[3]; p[3]=c;
printf("www.%s.com/feladvany", this);
}
} leet('n');
int main (int argc, char const* argv[])
{
return 0;
}
[via: coolz0r]
Serendipity
A weird thing just happened to me while waiting for the bus. I was listening to the audiobook from Larry King How to talk to anyone, anytime, anywhere when some man approached me asking for a lighter. I was wearing a long black coat which might be the reason why this man was convinced I was some kind of sarge of the army, or even a higher officer. Maybe he was just crazy.
He starts telling me something I couldn’t hear very well and then spends five minutes telling me in detail some ranks of the Spanish Army, and how each soldier has to approach their superiors when talking. After listening carefully to this bizarre speech, he just leaves and I plug my headphones and hit Play again.
Just a few seconds of audiobook later, Larry is explaining how to approach your boss and colleagues properly, using army ranks as an example, and telling the exact same thing than this anonymous man just have told me. The only different is that the first man sounded like a crazy one while Larry King sounds like an expert.
That was my dose of confusion for today
Goodbye Typo
An engineer is born
http://www.mytoons.com/flash/MyToons_RemotePlayer.swf
Does this video ring a bell for you?
Boss/employee relationships
Nacho writes about a nice article at Note from boss to employees. If you follow through the original article, you can find a comment reversing the meaning of the letter (from employee to boss).
I guess both are true. And I guess there are two conclusions to extract from the letter and the replay:
- We are all human. We all make mistakes
- Since we all fail, fluent communication is vital for the health of a company (or any other kind of organization)
So I think you can ask an employee some level of empathy if you arenât offering the same, and viceversa. Itâs not so difficult. Remember, just be nice. Thereâs always a story behind.
Update: via Lifehacker I found an article called A Managerâs Guide to Growing Happy Employees. The key points in this case are:
- Manage people first, do your own work second.
- Delegate your best work.
- Help people get recognized.
- Make projects relevant to people, not companies.
- Align yourself with your boss.
- Work reasonable hours.
And I think the last paragraphs summarize all the previous steps quite well
The best way to think about management is to treat everyone like an unpaid intern.
Each day, your employees ask themselves, âAm I getting enough out of this job to keep doing it?â? And each day, you need to give them a reason to say, âYes.â?
Economics for dummies
http://www.youtube.com/v/VVp8UGjECt4
Principles of economics, translated for non-economists. Real fun
Net neutrality: a big issue
Well, I’m used to the term tech neutrality maybe because is one of the current open fights here in Spain, but not so much about net neutrality. Two very different concepts but similar consequences. The opposite of neutrality here would be control. Control by an oligopoly (in the best case) which kills diversity, so killing innovation and slowing progress. Not a good idea.
I’ve found a short documentary (11 min) about this topic, quite well explained. Also, the video is open source and AFAIK, all the material has been extracted from the net (I recognised several clips from youtube)
http://www.youtube.com/v/8rNg_FVaPek
The site: Humanity Lobotomy. There you can watch the video in Quicktime or download in some other formats.
Via: Creative video presentations
Update: sorry, but I couldn´t resist. This other explanation may not be so detailed, but it´s really funny. Brought to you by Ask a Ninja
apt-get install pizza
Well, not so easy but really close this time. I don’t remember how I got there, but I found a perl script to order pizza from the command line. Bad news is that only works for Domino’s in the US, but I bet it’s a matter of time. Envy is a great motivator (check out Bluetooth Remote for reference).
The site: Pizza Party
[Via: Digg]