×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Six Degrees of CmdrTaco

red5 (51324) writes | more than 11 years ago

Slashdot.org 41

Tonight the guys from work went out partying at the strip club. I opted to stay home for reasons I've already shared in a previous JE. In my massive amount of free time I decided to make a script to breakdown the six degrees of separation between CmdrTaco and the users of this blog. Code is here. The Results are here.Tonight the guys from work went out partying at the strip club. I opted to stay home for reasons I've already shared in a previous JE. In my massive amount of free time I decided to make a script to breakdown the six degrees of separation between CmdrTaco and the users of this blog. Code is here. The Results are here.

The code well not the greatest I've made can easily be modified to break down the N degrees of separation for any user. Enjoy. :)

Update Friday Sept 6th
This morning I went to read /. and my IP was banned. I didn't realize that my script would cause that much trouble. Don't run it or you will be banned too. You have been warned.

41 comments

Wow. (1)

Some Woman (250267) | more than 11 years ago | (#4199428)

I'm level 4. Pretty good, but I've got to get to work on decreasing that. I mean, it is a measure of my worth, isn't it? :)

Re:Wow. (1)

turg (19864) | more than 11 years ago | (#4199469)

I'm level 4 too. But I don't remember playing the first three levels.

Re:Wow. (2)

Xerithane (13482) | more than 11 years ago | (#4199856)

I'm level 4 too. But I don't remember playing the first three levels.

I'm level 4, but I remember the first two.

Level 1 was being here in September of 1997, before it actually became live.

Level 2 was being one of the first 100 to have a user account (How many people remember /. pre-User account?), and contributing quite a bit.

Level 3 I think has something to do with the Troll Investigation thread. I finally got my $rtbl lifted (or at least I can meta-mod again)

Re:Wow. (2)

red5 (51324) | more than 11 years ago | (#4201563)

Level 2 was being one of the first 100 to have a user account (How many people remember /. pre-User account?), and contributing quite a bit.

If you were among the first 100 then why is your UID 13482. Thats a little > 100 doncha think?

Re:Wow. (1)

Some Woman (250267) | more than 11 years ago | (#4201656)

If I recall correctly, from the "old-timers" talking, the user accounts were wiped out once upon a time, long, long ago.

Re:Wow. (2)

red5 (51324) | more than 11 years ago | (#4201754)

That splains it. They probably just reimported in alphabetical order and his username starts with an X...

What ever happened with those ... err "pictures" I sent you. ;)

Re:Wow. (2)

Xerithane (13482) | more than 11 years ago | (#4202261)

Nah - I was just lazy. I don't think I created my user account till mid 1998, but I don't remember. It was around the time that moderation started happening, so that I could save filtered settings. Before then I had no desire to maintain an account because I didn't post all that often.

This comment is #1432 :)

Re:Wow. (1)

Some Woman (250267) | more than 11 years ago | (#4202987)

What ever happened with those ... err "pictures" I sent you. ;)

After 6 hours of downloading, there was an error in decompressing. :( I'll try again when I get home tonight. You know, it would take awfully high resolution pictures to actually consume that much of my poor little hard drive. :)

Re:Wow. (2)

Xerithane (13482) | more than 11 years ago | (#4202213)

Yes -- they were. That was still in 1997 in the very beginning of the user accounts. I was just too lazy to create one. I didn't start posting for a while after. Slashdot turns 5 soon. I didn't really start reading Slashdot until January of 1998, when I had a job that warranted me sitting in front of a computer with network access all day though :)

I'm a level 3... (2)

TechnoLust (528463) | more than 11 years ago | (#4199430)

...so what spells will that let me cast? :-)

Re:I'm a level 3... (1)

heliocentric (74613) | more than 11 years ago | (#4200065)

I'm also a level 3. Here are some spells that I've been working on:

Summon Troll

Flame of Flamer

Wave of Irrelevency

I've heard from a level 1 mage that when you hit level 2 you can get Karma Gain. I have also seen some people cast Spirit of Cowboy Neil so I know that must be coming in a near level.

Re:I'm a level 3... (2)

red5 (51324) | more than 11 years ago | (#4202053)

Apparently once you hit level 0 you get "powers. Secret powers." :)

Re:I'm a level 3... (2)

Safety Cap (253500) | more than 11 years ago | (#4234769)

...so what spells will that let me cast?
More than that, if you defeat a level'er above you in combat, then you should get to swap with his/hers/its place!

Think of the implications!
Think of the contests!
Think of the glory!!!

Any robots make the list? What if you were a lower level than a robot? Would it be better to just start posting randomly?!

Cool idea. (2)

Xerithane (13482) | more than 11 years ago | (#4199866)

Kudos for the idea and setting it up. I'm thinking of setting that up to nightly capture everyone on my fans list and allowing a db search, but I Think that may piss off Taco :)

Re:Cool idea. (2)

red5 (51324) | more than 11 years ago | (#4201009)

Grabbing the first 4 levels isn't all that bad since you only had to download about 200 friends lists. The difference between 4 and 6 is huge compared to the difference between 2 and 4.

If you wan't to make a 6 degrees of Xerithane script. You can capture the first 4 levels. Then when a user puts in his name you can grab upto two levels in reverse and try to match it up. :)

Re:Cool idea. (2)

Xerithane (13482) | more than 11 years ago | (#4201095)

Maybe we could just ask Taco and crew to release a database dump of the friend/foe lists, and the user_id => login map. Make life a lot easier :)

Re:Cool idea. (2)

red5 (51324) | more than 11 years ago | (#4201142)

Maybe we could just ask Taco and crew to release a database dump of the friend/foe lists, and the user_id => login map. Make life a lot easier.

I fail to see how getting laughed at will help anything. :)

Re:Cool idea. (2)

Xerithane (13482) | more than 11 years ago | (#4201285)

I fail to see how getting laughed at will help anything. :)

Give us the list, or we'll get it ourselves with wget scripts! *Bwahahahaha*

Re:Cool idea. (2)

Com2Kid (142006) | more than 11 years ago | (#4201052)

I'm thinking of setting that up to nightly capture everyone on my fans list and allowing a db search, but I Think that may piss off Taco :)


I would just be happy if the lists (fans / freaks) could periodically be checked and have compares done on them to detect any changes. ^_^

(or alternatively if /. just sent a message when ever somebody changed their status in regards to you)

Re:Cool idea. (2)

Xerithane (13482) | more than 11 years ago | (#4201140)

(or alternatively if /. just sent a message when ever somebody changed their status in regards to you)
This has already been suggested many times :)

I'm level 5... (1)

Dthoma (593797) | more than 11 years ago | (#4209460)

Few! I'm almost a lowly maggot, but not quite!

Re:I'm level 5... (2)

red5 (51324) | more than 11 years ago | (#4209750)

At least you have cool number. Five is the cooliest number known to man. As for you sig and my most moderated comment... I've had a few but this the first that comes to mind [slashdot.org]

Oh and don't run the script. It put's a lot of load on /.
You posted right before I added the disclamer to my JE I thought I aught to warn you.

At least sleep between accesses (2)

jamie (78724) | more than 11 years ago | (#4215550)

Please put a "sleep 10" or something before the request() call, so you don't flood Slashdot. Not to sleep at all is really rude.

Nice use of tail recursion but wouldn't it be just as easy to do a for loop? :)

Re:At least sleep between accesses (2)

red5 (51324) | more than 11 years ago | (#4215690)

Please put a "sleep 10" or something before the request() call, so you don't flood Slashdot. Not to sleep at all is really rude.

Done. Sorry about the flood.

Nice use of tail recursion but wouldn't it be just as easy to do a for loop? :)

I suppose I should, but where's the fun in that. I had it doing a left most branch search at first (till I realized thats not what I wanted). When I restructured it to do one level at a time I forgot to switch.

Re:At least sleep between accesses (2)

jamie (78724) | more than 11 years ago | (#4217623)

Cool. Thanks!
"I had it doing a left most branch search at first (till I realized thats not what I wanted). When I restructured it to do one level at a time I forgot to switch."

The really clever thing would be to scan backward from /~destuser/fans/, interleaved with your scanning forward from /~srcuser/friends/. I believe it's more DB-intensive for us to generate the /fans/ list (correct me if I'm wrong, Brian :) but unless I miss my guess, this should find the connections roughly twice as fast.

Also, if the destination user has never been marked as anyone's friend, you will know to terminate the search. :)

Re:At least sleep between accesses (2)

red5 (51324) | more than 11 years ago | (#4217765)

The really clever thing would be to scan backward from /~destuser/fans/, interleaved with your scanning forward from /~srcuser/friends/. I believe it's more DB-intensive for us to generate the /fans/ list (correct me if I'm wrong, Brian :) but unless I miss my guess, this should find the connections roughly twice as fast.

Yes I mentioned something like that in the thread with Xerithane. The thing is this was never meant to be an iteractive script going from user a to user b. It's more of a batch going from user a to the all of /.

I'd imagine it would be a little more than twice as fast on average as you deal with half the recursion and recursion adds users exponential.

Also, if the destination user has never been marked as anyone's friend, you will know to terminate the search. :)

If I ever make an interactive script it's so going to do that. If for nothing else It would be fun to display an error like "You're a loser and nobody likes you." Okay maybe thats just mean. :)

I downloaded the CVS for slash. If I were to clean up the code and apply the same conventions would you guy consider adding it to slash?

On second thought that sounds like a bad idea. I figure way too many people would sit there trying to connect Micheal to FortKnox or Seth. All the while thinking how funny and original they are. Though it would be fun to post in the middle of a flame thread something like: "User a is friends with User x Who is friends With User y Who in turn is friends with User b. So shake and make up you guys are practicaly brothers."

XML::RSS (2)

krow (129804) | more than 11 years ago | (#4216254)

If you used XML::RSS you could get the data out of the page a little bit easier (aka simplify this task a bit). I would also just mine the entire thing to a public DB if you want to make people's lives a little safer for mining the data.

A nice little GD graph would be pretty cool too.

Re:XML::RSS (2)

red5 (51324) | more than 11 years ago | (#4217156)

If you used XML::RSS you could get the data out of the page a little bit easier (aka simplify this task a bit). I would also just mine the entire thing to a public DB if you want to make people's lives a little safer for mining the data.

Thanks. I tried XML::Parser at first but It looked way to complicated. Granted it was 4:30 in the morning and I was a bit tired. I kept looking for an XML module that would just give me a structure. I didn't know about XML::RSS. Though in hiensight I should have searched for RSS.

A nice little GD graph would be pretty cool too.

I was thinking of making a table breakdown with nested <UL> that way people could easliy find thier path.

Re:XML::RSS (2)

red5 (51324) | more than 11 years ago | (#4242548)

This is completely OT but since this is my journal I can do this with out fear of moderation. Mo Ha Ha!

I just noticed the changes to zoo.pl. Very nice. I like them a lot.

Well that's it. Thanks.

Re:XML::RSS (2)

krow (129804) | more than 11 years ago | (#4242922)

Its your journal you can do whatever you want, that was the point :)

Thanks, there are a couple of more features I am going to add over the next couple of weeks. Like I have the code done to let you compare yourself to someone else (aka see how many of you friends and such match). Not sure what else I will add to it.

Re:XML::RSS (2)

red5 (51324) | more than 11 years ago | (#4243112)

Thanks, there are a couple of more features I am going to add over the next couple of weeks. Like I have the code done to let you compare yourself to someone else (aka see how many of you friends and such match).

Your Welcome. I'll look forward to them.

Not sure what else I will add to it.

Well now that you mention it. :)
I'm not sure if this counts as a bug or not. I noticed that in coments.pl the blue and green dots get clobbered by the pills. Like when I look at a comment by freaq(friend|fan) I get the two dot's but when I look at a comment by Xerethane(friend|fan|fof) I get the green pill. Shouldn't that be the other way around? Shouldn't first level relationships (friends/fans foes/freaks) take precedence over second level ones(fof/eof)?

Anyhow thats probably a comments.pl thing and thus not your code and not your problem. :)

Re:XML::RSS (2)

krow (129804) | more than 11 years ago | (#4245639)

Turns out that the comments one was an older bug (just found it). It will probably get patched this evening.

The one thing I may do is the "how many steps does it take till I am connected to another person". Just need to come up with a way to do it that doesn't kill the database in the process (or kill one other then the main DB like the search one). The code for just comparing your to another user is done, I have just yet to decide where it will go.

Re:XML::RSS (2)

red5 (51324) | more than 11 years ago | (#4246690)

Turns out that the comments one was an older bug (just found it). It will probably get patched this evening.

Now was that because of little old me or the bugreport FortKnox submitted this morning?

The one thing I may do is the "how many steps does it take till I am connected to another person". Just need to come up with a way to do it that doesn't kill the database in the process (or kill one other then the main DB like the search one). The code for just comparing your to another user is done, I have just yet to decide where it will go.

That'll be way rad. Well if I were you I'd put it on it's own server called bacon.slashdot.org as a nod to the oracle of bacon [virginia.edu] .

Also if you still looking for ideas. Wouldn't it be cool if when you clicked the pills it showed the users that link you. For example if I were to click on the green pill next to mekkab I'd get Em Emalb and forged. It just seems logical as the first thing I think of when I see the pills is "cool how do I know this guy?". You probably thought of that already though.

Anyhow the friends/foes system just rocks in general. I think slashdot wouldn't be nearly as much fun without it. So mad props to you sir!

Re:XML::RSS (1)

sllort (442574) | more than 11 years ago | (#4276312)

Ref: Dijksta's algorithm

Singe Source Shortest Path [rochester.edu] . You're dealing with a directed graph in this case, and it's segmented, so you're not assured to find a solution. That said if a solution exists it can be found at best in less that N^2 but no better than O(|E| log N), but I'm sure you already knew that.

-s.

Re:XML::RSS (1)

jamie (78724) | more than 11 years ago | (#4286051)

Dijkstra's algorithm is useful when edges have differing weights, does not work well when accessing the list of edges attached to each node has significant cost, and as you note is designed to find a solution known to exist. That makes it completely unhelpful for this problem.

Re:XML::RSS (0)

Anonymous Coward | more than 11 years ago | (#4290687)

I mentioned it under the assumption that it would provide a reference for the minimum cost of doing business for this problem. It was my assumption that you wouldn't consider doing anything dynamically if it got close to nLog(n), so mentioning this as a minimum would be enough to prohibit it, without me having to do anything hard, like think.

when accessing the list of edges attached to each node has significant cost.

I'm guessing that you're referring here to the cost of retrieving the "edge list" from the DB - which requires a database hit, which may have its own computational cost to be included. I started trying to solve this problem for the number of table lookups required and got frustrated because I didn't have The White Book in front of me, so I quit. That said you could probably solve it on your own if so inclined, and I could if I ever bothered to remember at home.

If you're actually seriously considering providing advanced meta information for the Zoo graph, then that poses some interesting problems. You'd probably only be able to run this at intervals and serve it as static content, and it would probably also be useful to sweep the DB once for all the edge lists and cache them before starting any of your post processing. It would be neat to see how many connected graphs exist, and a histogram of them by edge density and population (the Zoo system at any given time is a disconnected graph composed of connected graphs and individual nodes), a Kruskal's-generated spanning tree per graph, and the foe vs. friend count per graph.

I can't for the life of me remember ever having to solve the problem of identifying all the connected graphs in a given set of nodes. Once you've identified that information, you can use Djikstra's per connected graph to determine least cost path(s). For all I know, the identify-all-connected-graphs problem is NP complete.

If you know the answer you could prevent me from having to revisit textbooks tonight by replying. Which is probably enough reason for you not to reply... (-;

-Posting Anonymously because You Know Who I Am Anyway.

How do you find your path? (2)

Galvatron (115029) | more than 11 years ago | (#4216463)

Okay, I'm level 4, that's pretty cool. But how do I find out what my path is, like you did?

Re:How do you find your path? (2)

red5 (51324) | more than 11 years ago | (#4217091)

Look at your fans list and see who on there is a level 3. Look at their fans list and see who's level 2 and so on.

Re:How do you find your path? (1)

Galvatron (115029) | more than 11 years ago | (#4225672)

Ah, got it, very cool. (friend/foe/fan/freak could really use more obvious buttons, like maybe when one is editing one's preferences)


Anyway, looks like I'm CmdrTaco - Robogoatgruff - caferace - Hadlock - Galvatron

Re:How do you find your path? (2)

red5 (51324) | more than 11 years ago | (#4226269)

Ah, got it, very cool. (friend/foe/fan/freak could really use more obvious buttons, like maybe when one is editing one's preferences)

Yeah there's no way to get there without typing in the location bar. A link somewhere would be nice.

Well anyway. I'm glad you liked my script and thanks for posting. :)
Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...