Peter's Web Site

Hardcore Tech Archives

Cool Unix reference site

Unix, Mac OS, Linux info: http://aplawrence.com/

Posted by Peter on April 30, 2004

Memenet, part 2

My very first entry on this blog was about a "meme net" and a distributed, friend-based rating system that automatically bubbled news up or down and allowed comments and threaded discussion.

A few of the open items from the first memenet entry:
1. fundamental message format
2. auto-propagation of messages (for "neuron-like" behavior)
3. channels and zones
4. comments, replies, and threads

I've figured out a nice framework that handles all of the above!

1. I think RSS is the perfect "atom" of information to be throwing around the meme net. It allows any web page to be a source of information, and makes no distinction between news sites, blogs, fark links, etc. (If you're not using RSS to read stuff like slashdot, theregister, and various blogs, then you should!) I haven't read the detailed RSS spec to see whether or not there is a nice way to wedge in comments to links, but that can be handled otherwise (see #3 later). Using RSS as the primary unit of information across the meme net simplifies a great deal of implementation, and also automatically brings in a TON of nicely-formatted content for the meme net.

Every memenet server (described below) will not only automatically download feeds from a variety of sources and split these up into channels, but it also allows for unchanneled and unfed (aka "orphan") RSS entries. The advantage of this is that don't have to add a feed for JoeBlow's Blog when all you really want is a particularly amusing entry.

2. Much of the previous thinking I had done about the meme net concerned the question of how the actual network would work, and how memes would propagate through it. I now realize that this is trying too hard to make the meme net resemble a neural net at the implementation level, and I feel it is entirely possible to achieve similar results without building an actual p2p network.

Although this system is meant to have p2p characteristics, a much larger percentage of syndication reading happens at work than other p2p things (like downloading copyrighted music). Thus, it will simply not work to require people to directly connect to one another. The implementation of the memenet will have to be traditional client-server at layer 2/3 and will appear "peer-to-peer" only at layer 4. I'll illustrate how I see the meme net working using RSS and a client-server architecture:
A user will connect his memenet client to the server and upload his ID and various information about the news he is viewing. (This is all configurable at the client end, of course, and the rest of the description assumes the user has authorized the server to track various things.) His client displays the various channels available on the server (which in its basic form resembles an RSS aggregator), and he can choose to sort the channels by date or by rating. In either view, when he launches the primary link of an entry, that entry's viewcount on the server is incremented. When he is done reading the link, he can come back and moderate the link with up to +10 or down to -5.

What the server does with this information is central to the operation of the meme net. A classical system would just add these mod points to the running global average of the particular RSS item, and when clients download the latest RSS data or refresh their views, they get the updated scores of each entry and their client can sort by that field. In the memenet, the server does all this, but adds a local moderation field to each user's view of each entry. Every user on the server has a unique ID (something of the form "Your Name@server"). You've configured your buddy list on the server to have your friends' IDs, and they have done the same for you. Each time you rate an entry up or down, it not only affects the global rating of the entry on the server, but it also propagates a change to the "local rating" of the entry for each of your friends' accounts. If configured to do so, the server can choose to then further propagage an attenuated rating change to each of their friends. To see the effects of this (and to see what your friends think is cool) on the client side, when you sort a channel by rating, you can choose between global rating or local rating.

Now, in the long term, I would imagine that the "global" rating system would go away, and all moderation would be local. Inter-server rating transfers would be developed so that you can add friends who use a different memenet aggregator.

There are a lot of details that I'm omitting for brevity's sake.

3. Channels and Rooms: Most RSS aggregators implement the idea of "channels", i.e. "Tech News" or "World News". These are global and absolutely necessary. However, there should be a way to localize the concept without running the server out of resources - hence the idea of "rooms". A room is essentially a private channel namespace that is not visible to all users by default and can be made "private" if the server admin allows. The friends in a room can add channels, create their own, add entries/blogs just for that room, etc. (The server admin also gets to set a limit on how many new feeds are allowed for a room, etc.)

4. Comments, replies, and threads: I had pondered for a long time about how to do this effectively, when it occurred to me that the problem has already been solved! Basically, the memenet server, on the backend, has an NNTP (Usenet) server running that automatically creates a newsgroups for each global channel and for each channel in a room. As soon as someone replies or comments on an entry, a thread is created in that channel's newsgroup, and as people reply, replies are added to that thread. Cross-posting would allow commenting across rooms, etc. A nice thing to have is StructuredText support as well as RTF support (or some basic markup) and limited image- and sound- support. The really nice thing about using NNTP is that inter-server commenting and threading is automagically solved, as well! (There is that ever-nagging problem of a global namespace, but... it's an imperfect world.)

Other miscellaneous ideas:
- auto-propagation: feedback control, asshole filtering, etc.
- "bumps" or special magic mod points that raise an entry to being the top-rated for a short period of time and for only

Posted by Peter on February 05, 2004 | Comments (1)

Build your own Segway

... for a fraction of the cost of a real one. And best yet, the control software is written in Python! link

Posted by Peter on January 16, 2004

Special Mac Keys

DoctorMac has an awesome list of special Mac keystrokes. (The one that saved my day today was Command+F1.)

Posted by Peter on January 12, 2004 | Comments (1)

Neat Python FAQ

Or IAQ (Infrequently Asked Questions). Includes some nifty gems, like a one-liner to create a dictionary of literals and a trick to do C-style abstract methods.

Posted by Peter on December 29, 2003

APG

Need a cool way to generate random passwords for people that are easy to remember and dict-crack proof? Try the Automatic Password Generator. Nifty.

Posted by Peter on November 29, 2003

Plug for Python

O'Reilly has an interview with the developers of NeL, an open source MMORPG engine. On page 2 of the interview, about half way down, there is a good plug for Python:

When you wrap your low-level and "fast" C++ code into Python classes, you're encouraged to make the simplest interface for both the C++ wrapper's and Python coder's sakes. The other point is that it's easier to convert existing Python code into C++ native implementation than the other way around. And a Python development cycle is many orders faster than C++'s; compile times just get insane at 500,000 lines, even with high-end hardware.

The same reasoning above works with other high-level, interpreted languages. Python has a wide audience, is free, small, fast, well-designed, and ultra portable.

Posted by Peter on November 29, 2003

Open Source PKI

Always been curious about keys, certs, certificate authorities, X.509, and the like, but have been afraid to ask? I stumbled across this site - it's very comprehensive and thorough. (Plus 10 points to Gryffindor for linking to several python crypto packages.)

Posted by Peter on July 25, 2003

Perl CGI holes

Here is a doc with some awesome and hilarious ways to exploit Perl code. I'd like to hit Movable Type with some of the hacks in here!

Posted by Peter on July 07, 2003 | Comments (1)

Declarative languages

This is a nice brief introduction to declarative languages and gives a tutorial on how to create one on top of the Python interpreter.

Posted by Peter on March 12, 2003

Serialization

This is the sort of cool stuff that should be on Slashdot every day.

Posted by Peter on March 03, 2003