User talk:Dave Younce

Hey, thanks for the welcome! :D
Having great fun noodling around the generators here. Just a question, though -- would it be possible for us to put the iterated sgdisplay results as an ordered list? I tried doing it directly by adding the pound signs in sgdisplay and in the sgtable table definition, but it didn't seem to work... -- T-Boy 20:15, 17 September 2007 (PDT)
 * So I figured out one way of solving it, at any rate: by manually adding list tags into the source code, like so:

A Title
 [foo] 


 * foo


 * Sadly, this leaves a rather unsightly "&lt;/li&gt;" at the end of each list entry. Removing the  tag looks like it'll fix it, but it just leaves those list entries without a closing tag. Argh! Back to the drawing board... -- T-Boy 22:13, 17 September 2007 (PDT)

SGTable info
Dave, is there a way to leave a comment inside an SGTable? I'd like to do something like: ;Monkeys 0,This table is for monkeys only, no apes! 10,spider monkey 3,green monkey ... Would a zero work, is there an escape character, or does the MediaWiki comment tag work? Also, is the generator what's responsible for the slow site load times? Thanks! --Xcorvis 12:02, 8 December 2007 (PST)


 * I think the mediawiki comment tag will work within tables. The slow load times are b/c I have a crappy host - that's probably changing this month. You'll know it because I lock the database for a bit and it may take a day to fix DNS issues. --Dave
 * Looks like the mediawiki style comment works fine. So does the "0" entry, for that matter. --Xcorvis 16:43, 13 December 2007 (PST)

Category cleanup
I am willing to clean up the categories and get things in order, I just don't know where to go if I feel one needs deleting. Also, where does one go if a non-generator page needs deleting? Lady Aleena 19:53, 17 December 2007 (PST)


 * Do the categories and templates meet with your approval? :) Lady Aleena 22:28, 18 December 2007 (PST)

if:then
Dave, can you set it up so that there are logical operators?

I'm thinking you've got a "name" table that sorts into "male" and "female", but later wording is gendered "he/she" based on which subtable it comes form. --JMstar

Periods in titles?
I just created U.S. Cities, and referenced it like this: in Dossiers, but it does not render. Do the periods in the title confuse it? --JM
 * Location of Birth:|| [U.S. Cities.main]

Subtables listings
Hello Dave;

The reason that I started listing the subtables was to give a place for the external subtables. If you look to the left of the screen when you are looking at a page, you will see the "toolbox." In the "toolbox" are two very useful links, "What links here" and "Related changes." Without the links to the external subtables used on the main page, editors won't know what has changed on related pages. Also, if an editor is changing a base page, "What links here" will show the editor how many pages may be affected by the changes.

What I would suggest for people who want to print out the results is to copy and paste the results into a text editor. If you really want to make sure that Abulafia is on the print outs, you may want to go into the general style sheet of the wiki and put a style that looks something like the following. @media print{ .noprint {display:none;} } That would create a class that could then be used in divs, spans, and other tags which could be wrapped around certain elements of a page like the subtables section. An editor could then put the following around material that should not get printed. A big block of stuff that shouldn't get printed. A little string of stuff that shouldn't get printed. I could even write to little templates to cover that. Stuff that shouldn't get printed.

And speaking of code, every generator result ends with a  whether we want it to or not. Could you possibly remove that from the end of the results so that some wikicode would work, like lists. If the editor wants a new line started, it would have to be included in the generator, not automatically generated.

I see that you are editing the Roman numerals generators, and thank you. I made them, but I don't think I have the patience to edit them like you are.

I also created a new administrative folder Category:Categories for renaming and a template to accompany it. '' She wonders if there is a sysop application somewhere. ''

It is hoped that you do not think that I am nuts or anything with everything that I have been doing lately. — LA 11:53, 23 January 2008 (PST)

PS. All of the redlinked categories are now gone or created. Uncategorized pages are giving me headaches since I don't know where to put the last 14 or so. — LA 11:55, 23 January 2008 (PST)

PPS. I thought I had gotten all of the calls to Utility.Color. I am sorry that I missed some, but that shows just how necessary links are to parent and child pages. — LA 12:07, 23 January 2008 (PST)

Generator creation template
Hello Dave;

Do you think that users would be interested in a template to create generators? The template would have the sg tags already in place so that they wouldn't be forgotten and various sections ready to go. If you think that would be something people would want, let me know; and I will get on it. — LA 13:49, 29 January 2008 (PST)

Absolutely. Go for it. Excited to see it! --Dave Younce


 * Dave, I need to be able to use if. Could you please find it and add it here? — LA 18:53, 29 January 2008 (PST)

You got it. Let me know if it gives you any trouble. --Dave Younce

Its done!
Here is your newest template! Spread the word. :) — LA 00:29, 30 January 2008 (PST)

SGNP sixties america
I can't access that generator. I keep getting an internal system error. — LA 11:47, 31 January 2008 (PST)

Yeah, that's odd all right. You can get to it if you add "&action=edit" onto the end of the url, but even putting the old content in a new page results in what you were seeing. I'm away from home, so I can't debug it this weekend - I'll take a look and see what I can figure out on it sometime this next week. --Dave Younce 15:50, 1 February 2008 (PST)


 * Fixed it...see the history. — LA 10:05, 3 February 2008 (PST)

Ah, right. Infinite recursion is now fixed - you'll get an error notice now if you try to go more than 150 calls deep. Seems a reasonable upper limit, doesn't it? --Dave Younce 19:12, 3 February 2008 (PST)

Online meeting
Hello Dave...Is there any way that we could have a real time chat sometime? I use Trillian, so I have four big IMs programs and IRC at my disposal. There is a lot that I would like to chat with you about. — LA 22:06, 4 February 2008 (PST)

Kudos!
Wow, amazing Wiki; I've been wanting to have something like this for a while now, and had started coming up with my own means of creating a wiki-like system based on the TableSmith syntax, but this added on to MediaWiki is amazing! As I was working on my own instance of the same thing, a few features that I'd like to see (that I was hoping to integrate into my own, but I'll share with you) are:


 * Integrated Die Rolling: I know there's a random generator for die rolls over at Dice, but that doesn't cover all options, and doesn't allow for +/- modifiers on the rolls. I'm an administrator of the d20 NPCs Wikia Wiki, and we integrated a die-rolling system right into MediaWiki, without an extension. All you need is a template, like the DieRoll template, which stores the dice information in the "class" attribute of a span around the text, and an addition to the MediaWiki:Common.js of the following script:

/* Dice Roller */ window.onload = init; function init { array = document.getElementsByTagName('span'); for(var i=0,len=array.length; i -1) { array[i].onclick = rollhandler; }	} }

function rollhandler { var res = /dice_([^_]*)_([0-9a+-x]*)/.exec(this.className); if (res) { rollValue(res[1],res[2]); } else { alert('Res failed'); } }

function rollDie(size) { var result = size * Math.random if (result == 0) { result = 0.5 } result = Math.ceil(result) return result }

function rollDice(number, size) { var dice = '' var result = '' var roll = 0 var total = 0 for (count = 0; count < number; count++) { roll = rollDie(size) total += roll if (dice == '') { dice = roll } else { dice = dice + ', ' + roll } }  result = total + ':' + dice return result; }

function getValue(data) { var element_array = data.split('d') var result = '' if (element_array[1] > 0) { result = rollDice(element_array[0], element_array[1]) } else { result = element_array[0] + ':'; } return result; }

function addcommas (sValue) { var X= "", S = String(sValue), L;	while (S != "") { L = S.length-3 X = S.substr(L, 3) + (X > "" ? "," + X : ""); S = S.substr(0, L); }	return X; }

function rollValue(label, data) { var original_data = data; data = data.replace(/ /g, '+') data = data.replace(/\-/g, '+-') data = data.replace(/x/g, '+x') data = data.replace(/\++/g, '+') var element_array = data.split('+') var dice = '' var result = '' var total = 0 var value = 0 var array_size = element_array.length for (loop = 0; loop < array_size; loop++) { value = getValue(element_array[loop]) var result_array = value.split(':') if (result_array[0].charAt(0) == "x") { var multiplier = result_array[0].substring(1); total = total * multiplier; } else { total = total + parseInt(result_array[0]); }   if (result_array[1] != '') { if (dice == '') { dice = result_array[1]; } else { dice = dice + ' : ' + result_array[1]; }   }  }  if (total < 1) { total = 1; } if (total.length >= 3) { total = addcommas(total); } data = original_data; if (dice != '') { alert(label + ' rolled: ' + total + "\n(" + data + ")\n(Rolls: " + dice + ')') } else { alert(label + ' rolled: ' + total + "\n(" + data + ')') } return false; }

Which turns the spans into a click-able area that gives a javascript popup with the result.


 * Capitalization tools
 * Article word tools
 * Pluralization tools

These are similar, and solve the problem of phrasing. Like if you have the entry "You are attacked by a [Animal]. [Animal] are deadly." You want the "a" to be either an "a" or an "an" depending on the start of the animal's name. Also, the second instance of [Animal] would ideally be the same random result as the first, and would be capitalized, while the first was not. Finally, the second [Animal] would want to be plural rather than singular. Since this is MediaWiki, and from an earlier post, I see you've got the "if" template, these may be able to be done with templates, if you're able to call a template from within your random generator extension. Then something like  You are attacked by. are deadly.  would be the result, which is not bad, as far as end users having to write code is concerned. If you can make the extension call the templates from within a "sgdisplay" block, I could write those templates pretty easily.

Thanks for the site!

--MidnightLightning 09:40, 24 April 2008 (PDT)


 * I realized that MediaWiki has the "uppercase" functions by default as a Parser function, so that's available already (and changed my pseudo-code above to reflect that). But for the others, I realize that an installation of the String Parser Functions (to use the #sub function to pull the first letter off a word to determine if "a" or "an" is appropriate), and the Extended Parser Functions to get the #ifeq and other extended comparisons to make the transaction complete. Could we get those installed on this wiki?
 * --MidnightLightning 10:03, 24 April 2008 (PDT)