Home | Community | Message Board

Cannabis Seeds UK
This site includes paid links. Please support our sponsors.


Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Shop: Unfolding Nature Unfolding Nature: Being in the Implicate Order   Kraken Kratom Red Vein Kratom   PhytoExtractum Maeng Da Thai Kratom Leaf Powder

Jump to first unread post Pages: 1 | 2  [ show all ]
Invisiblesui
I love you.
Male User Gallery


Registered: 08/20/04
Posts: 31,853
Loc: Cali, Contra Costa Co. Flag
the random thread button.
    #7959026 - 01/31/08 02:36 AM (16 years, 1 day ago)

how about a button that pulls up a thread at random from the database. A different thread everytime.

what yall think.?


--------------------

"There is never a wrong note, bend it."
Jimi Hendrix



Extras: Filter Print Post Top
OfflineSneezingPenis
ACHOOOOOOOOO!!!!!111!
 User Gallery
Registered: 01/15/05
Posts: 15,427
Last seen: 6 years, 8 months
Re: the random thread button. [Re: sui]
    #7959035 - 01/31/08 02:45 AM (16 years, 1 day ago)

and like the google "im feeling lucky" button, it can say "Im feeling shroomy!".


Extras: Filter Print Post Top
Invisiblesui
I love you.
Male User Gallery


Registered: 08/20/04
Posts: 31,853
Loc: Cali, Contra Costa Co. Flag
Re: the random thread button. [Re: SneezingPenis]
    #7959047 - 01/31/08 02:54 AM (16 years, 1 day ago)

:awesome:


--------------------

"There is never a wrong note, bend it."
Jimi Hendrix



Extras: Filter Print Post Top
InvisibleWhiskeyClone
Not here
Male User Gallery

Registered: 06/25/01
Posts: 16,509
Loc: Longitudinal Center of Canada ...
Re: the random thread button. [Re: sui]
    #7959345 - 01/31/08 07:50 AM (16 years, 1 day ago)

Awesome! StumbleShroomery FTW

There might be an epidemic of asinine, irrelevant posts though.

OTDers stumbling across MRP threads... will be interesting.


--------------------
Welcome evermore to gods and men is the self-helping man.  For him all doors are flung wide: him all tongues greet, all honors crown, all eyes follow with desire.  Our love goes out to him and embraces him, because he did not need it.

~ R.W. Emerson, "Self-Reliance"

:heartpump:


Extras: Filter Print Post Top
OfflineYthanA
ᕕ( ᐛ )ᕗ
Male User Gallery


Registered: 08/08/97
Posts: 18,774
Loc: NY/MA/VT Borderlands Flag
Last seen: 2 hours, 14 minutes
Re: the random thread button. [Re: sui]
    #7960737 - 01/31/08 03:38 PM (16 years, 1 day ago)



Extras: Filter Print Post Top
InvisibledrSE
Pseudo Reality
Male User Gallery


Folding@home Statistics
Registered: 12/19/03
Posts: 4,432
Loc: Twighlight Zone
Re: the random thread button. [Re: Ythan]
    #7960746 - 01/31/08 03:41 PM (16 years, 1 day ago)

yay. that didn't take long.

/me starts randomizing.


--------------------
Grow Room



Extras: Filter Print Post Top
Invisiblesui
I love you.
Male User Gallery


Registered: 08/20/04
Posts: 31,853
Loc: Cali, Contra Costa Co. Flag
Re: the random thread button. [Re: Ythan]
    #7961018 - 01/31/08 04:47 PM (16 years, 1 day ago)

Quote:

Ythan said:
Here ya go. :smile:

http://www.shroomery.org/forums/random.html





Awesome Thanx ythan!!!


--------------------

"There is never a wrong note, bend it."
Jimi Hendrix



Extras: Filter Print Post Top
OfflineSneezingPenis
ACHOOOOOOOOO!!!!!111!
 User Gallery
Registered: 01/15/05
Posts: 15,427
Last seen: 6 years, 8 months
Re: the random thread button. [Re: sui]
    #7961171 - 01/31/08 05:23 PM (16 years, 1 day ago)

why is it only in mush cult?


Extras: Filter Print Post Top
Invisiblesui
I love you.
Male User Gallery


Registered: 08/20/04
Posts: 31,853
Loc: Cali, Contra Costa Co. Flag
Re: the random thread button. [Re: SneezingPenis]
    #7961186 - 01/31/08 05:29 PM (16 years, 1 day ago)

its not. Ive had threads pop up from all over.


Its awesome. Ive come accross threads i would have never seen had the button not been there!


--------------------

"There is never a wrong note, bend it."
Jimi Hendrix



Extras: Filter Print Post Top
OfflineSneezingPenis
ACHOOOOOOOOO!!!!!111!
 User Gallery
Registered: 01/15/05
Posts: 15,427
Last seen: 6 years, 8 months
Re: the random thread button. [Re: sui]
    #7961207 - 01/31/08 05:34 PM (16 years, 1 day ago)

i clicked it like 5 times and it was all mush cult.

and is this link the only way to have the button?

I mean it is awesome to get this, and i am programming illiterate, but would it be so hard just to incorporate it into the actual GUI?


Extras: Filter Print Post Top
InvisibleWhiskeyClone
Not here
Male User Gallery

Registered: 06/25/01
Posts: 16,509
Loc: Longitudinal Center of Canada ...
Re: the random thread button. [Re: SneezingPenis]
    #7961208 - 01/31/08 05:35 PM (16 years, 1 day ago)

Quote:

YawningAnus said:
why is it only in mush cult?




I'm getting a variety.


Thanks Y -- this is cool.


--------------------
Welcome evermore to gods and men is the self-helping man.  For him all doors are flung wide: him all tongues greet, all honors crown, all eyes follow with desire.  Our love goes out to him and embraces him, because he did not need it.

~ R.W. Emerson, "Self-Reliance"

:heartpump:


Extras: Filter Print Post Top
Invisiblesui
I love you.
Male User Gallery


Registered: 08/20/04
Posts: 31,853
Loc: Cali, Contra Costa Co. Flag
Re: the random thread button. [Re: SneezingPenis]
    #7961210 - 01/31/08 05:36 PM (16 years, 1 day ago)

Theres a link at the top of the page under the 'invite' button. it has a single die as the icon.


--------------------

"There is never a wrong note, bend it."
Jimi Hendrix



Edited by sui (01/31/08 05:36 PM)


Extras: Filter Print Post Top
InvisibleLeftyBurnz
Mr. I Eat Butthole
Male User Gallery


Registered: 06/21/05
Posts: 24,570
Loc: FL
Re: the random thread button. [Re: sui]
    #7961628 - 01/31/08 07:02 PM (16 years, 1 day ago)

love it!


--------------------


Extras: Filter Print Post Top
InvisibleWhiskeyClone
Not here
Male User Gallery

Registered: 06/25/01
Posts: 16,509
Loc: Longitudinal Center of Canada ...
Re: the random thread button. [Re: WhiskeyClone]
    #7962017 - 01/31/08 08:34 PM (16 years, 1 day ago)

:strokebeard:

It doesn't seem to be entirely random...

For example, this thread has popped up four times in twenty or so clicks.

http://www.shroomery.org/forums/showflat.php/Number/264823#Post264823


--------------------
Welcome evermore to gods and men is the self-helping man.  For him all doors are flung wide: him all tongues greet, all honors crown, all eyes follow with desire.  Our love goes out to him and embraces him, because he did not need it.

~ R.W. Emerson, "Self-Reliance"

:heartpump:


Extras: Filter Print Post Top
OfflineYthanA
ᕕ( ᐛ )ᕗ
Male User Gallery


Registered: 08/08/97
Posts: 18,774
Loc: NY/MA/VT Borderlands Flag
Last seen: 2 hours, 14 minutes
Re: the random thread button. [Re: WhiskeyClone]
    #7962279 - 01/31/08 09:39 PM (16 years, 1 day ago)

It's as random as I can make it, but it's not truly random because I had to cheat to get acceptable performance. We have so many posts that I can't just ask MySQL to return a random row. It takes over 5 seconds and locks the database. This is especially problematic because I expect people who are using the 'Random Thread' button to keep hitting it in fairly rapid succession.

So instead, I generate a random number between MIN_POST_NUM and MAX_POST_NUM and then select the first post that's greater than or equal to that number. This only takes a fraction of a second and doesn't adversely affect the server. However, there's a problem with this method which is clear from a simple example: if the post numbers in the database are 1, 3, 4 and 5, then '3' is greater then or equal to both 2 and 3, so it will come up twice as often. Restrictions due to forum permissions and the varying number of replies for each thread create additional 'holes' in the consecutive numbering scheme which further detract from the randomness.

Still, the sheer number of posts should make this effect significantly less noticeable. Having a post come up 20% of the time sounds like a fluke to me, even with all the cheating going on behind the scenes.

(And I bet you thought this was a simple feature. :wink:)


Extras: Filter Print Post Top
Invisiblejewunit
Brutal!
Male User Gallery
Registered: 01/11/07
Posts: 34,264
Loc: Ohio Flag
Re: the random thread button. [Re: WhiskeyClone]
    #7962671 - 01/31/08 10:57 PM (16 years, 1 day ago)

Hey, that thread came up for me too.


--------------------
!


Extras: Filter Print Post Top
InvisibleWhiskeyClone
Not here
Male User Gallery

Registered: 06/25/01
Posts: 16,509
Loc: Longitudinal Center of Canada ...
Re: the random thread button. [Re: Ythan]
    #7963671 - 02/01/08 06:59 AM (16 years, 19 hours ago)

Ok, cool :thumbup:


--------------------
Welcome evermore to gods and men is the self-helping man.  For him all doors are flung wide: him all tongues greet, all honors crown, all eyes follow with desire.  Our love goes out to him and embraces him, because he did not need it.

~ R.W. Emerson, "Self-Reliance"

:heartpump:


Extras: Filter Print Post Top
InvisibleCowgold
Bullshit

Folding@home Statistics
Registered: 04/04/05
Posts: 12,486
Loc: .
Re: the random thread button. [Re: Ythan]
    #7989563 - 02/06/08 10:26 PM (15 years, 11 months ago)

What do you think about a random button for active threads? Or newer than a week?

Cool feature either way.  :thumbup:


Extras: Filter Print Post Top
OfflineYthanA
ᕕ( ᐛ )ᕗ
Male User Gallery


Registered: 08/08/97
Posts: 18,774
Loc: NY/MA/VT Borderlands Flag
Last seen: 2 hours, 14 minutes
Re: the random thread button. [Re: Cowgold]
    #7990073 - 02/07/08 01:04 AM (15 years, 11 months ago)

I had a bunch of idea for improving the random thread button, including being able to limit it to new threads, specific forums and certain posters. I wanted to see if it was popular first though. It seems to be getting some use so I'll add that stuff to my to-do list, although not as high priority I'm afraid.


Extras: Filter Print Post Top
Offlineimplee
Cyber Hippie
Male User Gallery

Registered: 07/27/06
Posts: 5,833
Loc: Houston, Texas. Flag
Last seen: 5 months, 19 days
Re: the random thread button. [Re: Ythan]
    #7990105 - 02/07/08 01:18 AM (15 years, 11 months ago)

thanks ythan  three cocks for you :penis::penis::penis:


Extras: Filter Print Post Top
InvisibleCowgold
Bullshit

Folding@home Statistics
Registered: 04/04/05
Posts: 12,486
Loc: .
Re: the random thread button. [Re: Ythan]
    #7990817 - 02/07/08 08:50 AM (15 years, 11 months ago)

Thanks!


Extras: Filter Print Post Top
Offline2end4
Fuckin Immortal
Male User Gallery


Registered: 02/15/07
Posts: 774
Loc: Aristonda
Last seen: 11 years, 8 months
Re: the random thread button. [Re: implee]
    #7990933 - 02/07/08 09:45 AM (15 years, 11 months ago)

:borat:


--------------------
Praise Bob!


Extras: Filter Print Post Top
InvisibleSenor_Doobie
Snake Pit Champion
 User Gallery


Registered: 08/11/99
Posts: 22,678
Loc: Trump Train
Re: the random thread button. [Re: Ythan]
    #7990964 - 02/07/08 09:55 AM (15 years, 11 months ago)

>if the post numbers in the database are 1, 3, 4 and 5, then '3' is greater then or equal to both 2 and 3, so it will come up twice as often.

Would you mind explaining that a little further? I do not understand and am currently training myself in MYSQL and would like to understand this problem. I would really appreciate it.

Perhaps if you could explain how threads are numbered on the server, that would help me to follow the logic of what you are saying here?

I'd appreciate any more info on that part. Thanks


--------------------
"America: Fuck yeah!" -- Alexthegreat

“Nothing can now be believed which is seen in a newspaper. Truth itself becomes suspicious by being put into that polluted vehicle. The real extent of this state of misinformation is known only to those who are in situations to confront facts within their knowledge with the lies of the day.”  -- Thomas Jefferson

The greatest sin of mankind is ignorance.

The press takes [Trump] literally, but not seriously; his supporters take him seriously, but not literally. --Salena Zeto (9/23/16)


Extras: Filter Print Post Top
OfflineYthanA
ᕕ( ᐛ )ᕗ
Male User Gallery


Registered: 08/08/97
Posts: 18,774
Loc: NY/MA/VT Borderlands Flag
Last seen: 2 hours, 14 minutes
Re: the random thread button. [Re: Senor_Doobie]
    #7993011 - 02/07/08 06:29 PM (15 years, 11 months ago)

I'm happy to elaborate but I'm not sure exactly what you don't understand. Post numbers are stored in an AUTO_INCREMENT INT field. With auto increment, int values aren't reused, so if post number 666 is deleted, it leaves a permanent 'hole' between posts 665 and 667. Here's an example.

4 posts have been made. They are assigned ids 1, 2, 3 and 4 by the auto increment column.

Post #3 is deleted. The ids are now 1, 2, 4.

A new post is made. It's assigned id 5 by auto increment. The ids are now 1, 2, 4, 5.

To get a truly random record you'd do "SELECT * FROM Posts ORDER BY RAND(id) LIMIT 1". But ORDER BY RAND is extremely slow when you have a lot of records. So to approximate a random selection, I first get the id range: "SELECT MIN(id), MAX(id) FROM Posts". Then I generate a random number in PHP: $rand = mt_rand($min, $max). Finally I select the first post with an id greater than or equal to the random number: "SELECT * FROM Posts WHERE id >= $rand ORDER BY id ASC LIMIT 1".

So using the post numbers above for example (1, 2, 4, 5), the results of the first query will be 1 for MIN(id) and 5 for MAX(id). Thus the random number generated by PHP will be between 1 and 5 inclusive. It should gives the following results with equal probability:

Query: SELECT * FROM Posts WHERE id >= 1 ORDER BY id ASC LIMIT 1
Returns: Post #1

Query: SELECT * FROM Posts WHERE id >= 2 ORDER BY id ASC LIMIT 1
Returns: Post #2

Query: SELECT * FROM Posts WHERE id >= 3 ORDER BY id ASC LIMIT 1
Returns: Post #4

Query: SELECT * FROM Posts WHERE id >= 4 ORDER BY id ASC LIMIT 1
Returns: Post #4

Query: SELECT * FROM Posts WHERE id >= 5 ORDER BY id ASC LIMIT 1
Returns: Post #5

As you can see, post #4 is twice as likely to show up as any other post.

Now, all posts are assigned an id, whether they're a main post or a reply. But for selecting a random post I only consider main posts, not replies. So if the breakdown is like this:

1: Main post
2: Reply
4: Reply
5: Main post

for all practical purposes ids 2 and 4 don't exist. Now you get these results:

Query: SELECT * FROM Posts WHERE id >= 1 AND main = 'true' ORDER BY id ASC LIMIT 1
Returns: Post #1

Query: SELECT * FROM Posts WHERE id >= 2 AND main = 'true' ORDER BY id ASC LIMIT 1
Returns: Post #5

Query: SELECT * FROM Posts WHERE id >= 3 AND main = 'true' ORDER BY id ASC LIMIT 1
Returns: Post #5

Query: SELECT * FROM Posts WHERE id >= 4 AND main = 'true' ORDER BY id ASC LIMIT 1
Returns: Post #5

Query: SELECT * FROM Posts WHERE id >= 5 AND main = 'true' ORDER BY id ASC LIMIT 1
Returns: Post #5

So although there are two main posts, #1 and #5, #5 is four times as likely to show up.

And finally, permissions create additional holes. For instance, threads in the admin forum are ignored (unless you're an admin). With the above explanation you can hopefully understand how this further impacts the randomness of the results.

But this is kind of a special case, you shouldn't need to select a random record too often. And if you only have a few thousand records, you can use ORDER BY RAND with no problems. It's only once you have many hundreds of thousands or millions of records that you'll start running into performance issues.


Extras: Filter Print Post Top
Offlineimplee
Cyber Hippie
Male User Gallery

Registered: 07/27/06
Posts: 5,833
Loc: Houston, Texas. Flag
Last seen: 5 months, 19 days
Re: the random thread button. [Re: Ythan]
    #7994120 - 02/07/08 09:56 PM (15 years, 11 months ago)

Ythan do you have a part of shroomery with all the crazy features you added? Cause i cant find half of the old ones i knew about...

Like the most ignored user/highest rated user/other info page... I dont know where to find all the badass features at :frown:


Extras: Filter Print Post Top
OfflineYthanA
ᕕ( ᐛ )ᕗ
Male User Gallery


Registered: 08/08/97
Posts: 18,774
Loc: NY/MA/VT Borderlands Flag
Last seen: 2 hours, 14 minutes
Re: the random thread button. [Re: implee]
    #7994562 - 02/08/08 12:17 AM (15 years, 11 months ago)



Extras: Filter Print Post Top
Offlineimplee
Cyber Hippie
Male User Gallery

Registered: 07/27/06
Posts: 5,833
Loc: Houston, Texas. Flag
Last seen: 5 months, 19 days
Re: the random thread button. [Re: Ythan]
    #7994784 - 02/08/08 02:40 AM (15 years, 11 months ago)

I appreciate it, you should make a http://www.shroomery.org/forums/features.php with plain links to all of them, ill mail you a dollar -=/


Extras: Filter Print Post Top
InvisibleSenor_Doobie
Snake Pit Champion
 User Gallery


Registered: 08/11/99
Posts: 22,678
Loc: Trump Train
Re: the random thread button. [Re: Ythan]
    #7995335 - 02/08/08 09:05 AM (15 years, 11 months ago)

Thanks for that explanation man!

Its all a lot clearer now.


--------------------
"America: Fuck yeah!" -- Alexthegreat

“Nothing can now be believed which is seen in a newspaper. Truth itself becomes suspicious by being put into that polluted vehicle. The real extent of this state of misinformation is known only to those who are in situations to confront facts within their knowledge with the lies of the day.”  -- Thomas Jefferson

The greatest sin of mankind is ignorance.

The press takes [Trump] literally, but not seriously; his supporters take him seriously, but not literally. --Salena Zeto (9/23/16)


Extras: Filter Print Post Top
Jump to top Pages: 1 | 2  [ show all ]

Shop: Unfolding Nature Unfolding Nature: Being in the Implicate Order   Kraken Kratom Red Vein Kratom   PhytoExtractum Maeng Da Thai Kratom Leaf Powder


Similar ThreadsPosterViewsRepliesLast post
* Alert button Karen 1,091 2 08/24/01 04:06 PM
by Karen
* ignore button
( 1 2 3 all )
Dobie 6,464 44 09/25/02 09:49 AM
by WhiskeyClone
* Warn The Mods Button shellacct 1,095 4 10/15/01 05:36 PM
by Anonymous
* clicking on posts/threads = no matches eric_the_redS 1,132 4 07/20/03 08:13 PM
by eric_the_red
* thread ratings - waste of space? shirley knott 1,249 5 02/19/03 12:46 AM
by Asante
* That damned escape button! SeussA 1,125 2 09/03/03 06:31 AM
by Seuss
* Rating System v. Thread
( 1 2 3 all )
Joshua 7,925 57 07/05/03 10:42 AM
by Anonymous
* Random Forum! GringoLoco 1,903 6 02/26/02 12:45 AM
by Ulysees

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: Ythan, Thor, Seuss, geokills
2,604 topic views. 0 members, 5 guests and 0 web crawlers are browsing this forum.
[ Show Images Only | Sort by Score | Print Topic ]
Search this thread:

Copyright 1997-2024 Mind Media. Some rights reserved.

Generated in 0.042 seconds spending 0.01 seconds on 14 queries.