Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

[ Create a new account ]

Just Some Guy (3352)

Just Some Guy
  kirk+slashdot@strauser.com
http://honeypot.net/
AOL IM: StrauserGroup (Add Buddy, Send Message)
Jabber: kirk@jabber.honeypot.net

Free Software for everybody, rah-rah.

Fun with software licences

Monday March 17, @10:45AM
User Journal

You are probably out of compliance with your software licences.

Avoid the Ramada

Sunday February 03, @10:31AM
User Journal

This isn't tech-related in the least, but my family just got back from staying at the Ramada Inn in Kearney, Nebraska. It wasn't pretty.

Not that Kearney is a likely destination for Slashdotters, but for those who might find yourselves there: you've been warned.

Tuning Slashdot, part 1: Relationship CSS

Thursday January 17, @01:05PM
User Journal

Refactoring relationships

Right now, relationships are embedded into the comments section of story pages with tags like:

<span class="zooicon"><a href="//science.slashdot.org/zoo.pl?op=check&amp;uid=198669"><img src="//images.slashdot.org/fof.gif" alt="Friend of a Friend" title="Friend of a Friend"></a></span>

This is ugly for a few reasons. First, it's a mess. Second, it means that every visitor has to have their own custom-rendered comments sections so you can't apply aggressive caching to the page-generation code. I would replace this with per-user CSS.

First, create a CSS file for each user like this:

/* Default class */
a.relationship {
background: url(neutral.gif);
width: 12px;
height: 12px;
display: inline-block;
text-decoration: none;
}

/* User-specific values start here: */

/* Friends */
a.user3352,a.user42 { background: url(friend.gif); }

/* Foes */
a.user666 { background: url(foe.gif); }

Next, replace the HTML in the comments section with generic relationship information such as:

<link rel="stylesheet" type="text/css" href="relationships.css">
[...]
<p>by neutral (1234) <a href="bar" class="user1234 relationship">&nbsp;</a> on 2008-01-20</p>
<p>by Just Some Guy (3352) <a href="bar" class="user3352 relationship">&nbsp;</a> on 2008-01-20</p>
<p>by foe (666) <a href="bar" class="user666 relationship">&nbsp;</a> on 2008-01-20</p>

All "a" tags with the "relationship" class get the default CSS values. If there is also a corresponding "user*" selector in the visitor's stylesheet, then the values in that selector override the defaults. For a sad user with no friends, this means that everyone gets the neutral.gif icon. As that user accumulates more specific relationships, those CSS definitions are applied instead.

This benefits Slashdot because suddenly they don't have to generate a brand new comments section for every visitor. The per-user CSS would also be extremely simple to generate. In any case, it would be no more difficult than the current method of embedding all that information directly into the comments section.

Finally, those CSS files could also be cached very easily. Since they would only change whenever a user's relationships are modified, Slashdot would no longer have to query that information every single time it creates a page.

There are two drawbacks to this idea. First, there are no more alt attributes on images, so users don't see a "Friend" popup if they hover over the relationship button. If that's a problem, replace the icons with little smiley or frowny faces as appropriate. Second, it would take slightly more work to support putting users in multiple categories at the same time ("Friend" + "Freak"). The fix is to create a whole set of graphics like "friend_freak.gif" and "foe_friendoffriend.gif" and corresponding CSS classes. There aren't that many categories, though, so it would require only minimal extra work to cover every possible combination.

How 'bout it, Taco - could you use something like that? Less code, less bandwidth, and less processing should be pretty easily reachable goals.

Get over it, UbuntuDupe

Monday January 14, @11:21AM
User Journal

UbuntuDupe screwed up an Ubuntu installation almost two years ago. He still hasn't gotten over it.

UD, let me give you some free advice: move on. Really. You don't even have to admit that you were wrong. Just stop yapping about it and move on.

Do you notice that every time you bring this up, everyone opposes you? It's not because we don't like you, but because even if you were in the right (which you weren't), after two years we simply don't want to hear it anymore. Stop embarrassing yourself and let it die already, OK?

NSFW? Fark off.

Monday January 07, @11:11AM
User Journal

Fark: Is read by your boss.
Slashdot: Is read by the weird guy in the server room.

Fark: Tries to be corporate friendly.
Slashdot: Links to Tubgirl.

Fark: Garfield.
Slashdot: Doonesbury.

Quit whining about "oh noes this is not teh NSFW!" If you want Fark, read Fark. This is Slashdot.