CPCWiki forum

General Category => CPCWiki Discussion => Topic started by: steve on 12:18, 13 October 12

Title: Never judge a book by it's cover
Post by: steve on 12:18, 13 October 12
It is difficult to see the large amount of information contained within the CPCWiki because all you can see is the front page (cover), if I were in a book shop I could flick through the pages of a book to get an idea of the quality of its contents.

Would it be possible to flick through the pages of the CPCWiki at a rate of perhaps 1page per second?, or could someone create a video that shows a few hundred pages?, if the video was then hosted on youtube it would help to publicise the CPCWiki and maybe encourage more people to contribute to its contents.
Title: Re: Never judge a book by it's cover
Post by: ced64k on 16:50, 13 October 12
Scribd (http://www.scribd.com/doc/8945901/Commodore-World-Issue-02) ?
Title: Re: Never judge a book by it's cover
Post by: Gryzor on 10:51, 14 October 12
What about Scribd? This is an online pdf viewer of sorts...

Well, I'm not sure there'd be a practical way to use a system like that. I mean, how many would hit a button and then just stare at the screen till a new page comes up or hurry to read through lots of text before it does?

There *is* the Random Page extension though, you can find it in the sidebar on the wiki, it will fetch a random page every time. I can (well, I could, don't know if the code would be compatible by now) also create a box on the front page to display the beginning of a random page (x first words), but now we're beginning to clutter the home page :(

Well, what if one of our great video review makers could make a CPCWiki review then? ;)

Other than that, I find it helpful when people share things from the wiki on the Facebook or Twitter etc...

Also, *its :D

PS I think it's the YS site that posts a random page every day on Twitter, but I don't know how they do it, maybe I should look into it?
Title: Re: Never judge a book by it's cover
Post by: steve on 12:00, 14 October 12
I thought a 2 minuite video could show 120 pages from the wiki for one second each, people could pause, fast forward or go back to get a real feel for the depth and quality of information in the wiki.

@Gryzor. could a button be given to send a random page every second until it is click on again?
Title: Re: Never judge a book by it's cover
Post by: Gryzor on 14:06, 14 October 12
Well, we could build a page with two frames, one having control buttons (back/pause/fwd) and the other loading the contents of http://cpcwiki.eu/index.php/Special:Random . Anyone interested in it?
Title: Re: Never judge a book by it's cover
Post by: AMSDOS on 11:21, 29 October 12
Quote from: steve on 12:18, 13 October 12
It is difficult to see the large amount of information contained within the CPCWiki because all you can see is the front page (cover), if I were in a book shop I could flick through the pages of a book to get an idea of the quality of its contents.

Would it be possible to flick through the pages of the CPCWiki at a rate of perhaps 1page per second?<snip>


Unsure if this is a solution, though I use the contents for a book (which shows every page), as a portal to the other pages. By Right Clicking or "whatever" on a Mac on that page and selecting the New Tab option, it will allow you to view that page without taking you away from the page you were on.
Title: Re: Never judge a book by it's cover
Post by: arnoldemu on 11:42, 29 October 12
Quote from: Gryzor on 14:06, 14 October 12
Well, we could build a page with two frames, one having control buttons (back/pause/fwd) and the other loading the contents of Programming:Digiblaster - CPCWiki (http://cpcwiki.eu/index.php/Special:Random) . Anyone interested in it?
Using "Random Page" results in quite a few repetitions. It will not show the true depth of the wiki, at least it didn't in my experience.
Title: Re: Never judge a book by it's cover
Post by: Gryzor on 13:05, 29 October 12
Quote from: arnoldemuQuote from: Gryzor on 14 October 2012, 16:06:20Well, we could build a page with two frames, one having control buttons (back/pause/fwd) and the other loading the contents of Programming:Digiblaster - CPCWiki . Anyone interested in it?
Using "Random Page" results in quite a few repetitions. It will not show the true depth of the wiki, at least it didn't in my experience.
Never got a repetition myself, are you sure? :D
Title: Re: Never judge a book by it's cover
Post by: arnoldemu on 14:50, 29 October 12
Quote from: Gryzor on 13:05, 29 October 12
Never got a repetition myself, are you sure? :D
A couple of things to try to see similar results to me:

1. startup firefox and do "random page" 20 times. shut it down. start it up again and repeat.
Often similar pages are shown.

2. starup firefox and "do random page" 100 times. notice how it eventually shows one it has shown already.

so the random page doesn't exclude ones it has shown, and also it seems to favour a few pages and so doesn't give a true representation of what the wiki shows :(


At the weekend while I was waiting for something to build at work, I did just the above, and edited a few pages while I was at it, to improve the English on a few.



Title: Re: Never judge a book by it's cover
Post by: Bryce on 15:34, 29 October 12
Quote from: arnoldemu on 14:50, 29 October 12
At the weekend while I was waiting for something to build at work, I did just the above, and edited a few pages while I was at it, to improve the English on a few.

Well this does at least prove that your company needs to get faster machines for compiling on :D

Bryce.
Title: Re: Never judge a book by it's cover
Post by: arnoldemu on 19:02, 29 October 12
Quote from: Bryce on 15:34, 29 October 12
Well this does at least prove that your company needs to get faster machines for compiling on :D

Bryce.
it used to be a fast machine, I think I've upset it.
Title: Re: Never judge a book by it's cover
Post by: AMSDOS on 09:11, 31 October 12
Quote from: arnoldemu on 11:42, 29 October 12
Using "Random Page" results in quite a few repetitions. It will not show the true depth of the wiki, at least it didn't in my experience.


Sounds like a Random Number Routine in BASIC, without a RANDOMIZE TIME.  ;D
Title: Re: Never judge a book by it's cover
Post by: Gryzor on 11:33, 31 October 12
Maybe the algorithm is at fault indeed, though as I said I haven't experienced something of the sort. I just did a test, clicking 50 or 60 times on the thing and it gave me an equal number of unique results. Can anyone else confirm if it's biased or not? Since this is a built-in platform function I kind of doubt other users wouldn't have noticed if it's not working well...  (but yes, it doesn't exclude previously shown pages; in that regards it's really random, for every time).

I found an extension, will have to install it and see if it works any better. Here's the code in case you want to review it and assert how well it works :)



<?php
/* 
 * RandomPages, an extension to MediaWiki that provides a way to fetch 
 * a number of random wiki pages
 *
 * Copyright (C) 2007, 2008  Aurelian Oancea
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <[url=http://www.gnu.org/licenses/&gt]http://www.gnu.org/licenses/&gt[/url];.
 */

if(!defined('MEDIAWIKI')) {
  die(
"This file is an extension to the MediaWiki software and cannot be used standalone.");
}

$wgExtensionFunctions[] = 'aoRandomPages';
$wgExtensionCredits['parserhook'][] = array(
  
'name' => 'RandomPages',
  
'author' => 'Aurelian Oancea',
  
'url' => '[url=http://www.locknet.ro/projects/mediawiki-random-pages&#039]http://www.locknet.ro/projects/mediawiki-random-pages&#039[/url];,
  '
description' => 'Provides a random list of pages using <tt>&lt;randompages /&gt;</tt>',
);

/**
 * Setups the mediawiki hook
 */ 
function aoRandomPages() {
  global $wgParser;
  $wgParser->setHook('
randompages', 'aoRandomPagesHook');
}

/**
 * Callback that replaces &lt;randompages /&gt; wiki tag with a list of links to random wiki pages
 *
 * Available options:
 *
 * * limit int, to control how many links should be fetched randomly from the database, defaults to 150
 * * namespace bool, true to restrict only to the global namspace, defaults to false
 * * levels int, levels of CSS applyed to each entry, defaluts to 5
 *
 * Sample Usage:
 *
 * <code>
 *  &lt;randompages limit="10" namespace="true" levels="10" /&gt;
 * </code>
 *
 * Gets 10 random pages from the global namespace with 10 levels of style
 *
 * @param $text string, it should be null
 * @param $params array, additional parameters passed as attributes to randompages tag
 * @param $parser Parser, the Wiki Parser Object
 */ 
function aoRandomPagesHook($text, $params, $parser) {
  global $wgDBprefix;
  // prevent caching for this wiki page
  $parser->disableCache();
  // get parameters
  $limit = isset($params['
limit']) ? (int)$params['limit'] : 150;
  $namespaced = isset($params['
namespace']) ? $params['namespace'] == 'true' : false;
  $levels = isset($params['
levels']) ? (int)$params['levels'] : 5;
  // build sql query
  $sql = sprintf('
select from %spage where', $wgDBprefix);
  $sql .= $namespaced ? ' 
page_namespace ' : ' 1=';
  $sql .= sprintf('
order by rand() limit %d', $limit);
  // execute that.
  $dbr = wfGetDB( DB_SLAVE );
  $rs  = $dbr->query( $sql );
  $buff = '
<div class="randomPages">';
  while( $row = $rs->fetchObject( $rs ) ) {
    $buff .= '
<span class="randomPages_level'.rand(1,$levels).'">';
    $title = Title::makeTitleSafe($row->page_namespace, $row->page_title);
    // manually call __toString for php < 5.2
    $buff .= sprintf('
<a href="%s" title="%s">%s</a>', $title->escapeLocalURL(), $title->__toString(), $title->__toString());
    $buff .= '
</span>';
  }
  return $buff . '
</div>';
}


Title: Re: Never judge a book by it's cover
Post by: AMSDOS on 06:02, 01 November 12
Quote from: Gryzor on 11:33, 31 October 12
[snip]... Can anyone else confirm if it's biased or not? Since this is a built-in platform function I kind of doubt other users wouldn't have noticed if it's not working well...  (but yes, it doesn't exclude previously shown pages; in that regards it's really random, for every time).


To be honest I just tried Random Page option just now and the results I was getting seem to be random. I'm using Safari 5.x. Could it be a browser issue?
Title: Re: Never judge a book by it's cover
Post by: Gryzor on 12:48, 01 November 12
Thanks for the feedback. Got in mind to try the extension when I find some time, but good to know...
Powered by SMFPacks Menu Editor Mod