Wikia

Mathmagician Wiki

Mathmagician

Founder
2,332 Edits since joining this wiki
April 10, 2012
  • I live in West Coast USA
  • My occupation is Student
  • I am A Genius, also not female
50.19.155.235
  Loading editor
  • Hi! I came across your posts/pages on collapsible elements. I was playing around with them and was wondering if you there was a way to float/position the show/hide toggle, so that the toggle is beside some text or next to a section heading.

    An example is shown here, where the toggle is next to the word "Notes". I "cheated" though, by putting it in a table. However, the toggle moves back to float right, when the hidden content is expanded (and the table expanded), which is not what I want (I want the toggle fixed in place next to "Notes").

    I know about the custom toggle class (from reading Help:Collapsing, but would ideally like to retain the original toggle, where the wording can change from "Expand" to "Collapse". I also prefer the "link-style" rather than the "button-style".

    Oh, and I don't want to change this for the whole wiki, just one instance on a page.

    Hope you can offer some advice on this. Maybe to use templates or change/create some CSS. Sorry for the long post. Thanks in advance!

    P.S. Oh! You are also the one who replied to my question on community central. Thanks! :)

    P.P.S. For the example, the toggle floated right when I pasted the code from the above link here. So I just linked to the site instead.

      Loading editor
    • View all 6 replies
    • Hi! I like the second solution much better. xD
      I think that's exactly what I'll use. Thanks so much!

        Loading editor
    • No problem, glad that works for you :)

        Loading editor
    • 50.19.155.235
        Loading editor
  • I'm trying to make something to help with breeding monsters. Is it possible to make a page where a person would select 2 monsters and then it would show all possible outcomes? Or is that a kind of scripting that doesn't work on wikia?

    Thanks in advance!

      Loading editor
    • View all 15 replies
    • Can you explain the picture a bit so I know what you're trying accomplish? This looks a lot different from your original question, which was about picking 2 monsters and seeing what new monster you can get by breeding those 2.

        Loading editor
    • Oh sorry, this was a different idea from the 2 monsters thing but I'm not sure how well it would work so might scrap the idea and just stick to the original one you made.

        Loading editor
    • 50.19.155.235
        Loading editor
  • Hey, that crafting thingy is pretty neat. I made a template out of it on Minecraft Fan Fiction Wiki and it seems to be working fine. Although if I leave a square empty without an image, it shows the lines of code from the template. Can you help me fix that? Here's the link And the test page - Here.

    P.S. I'm not that good with temlates.

      Loading editor
  • I'm making a pub/sub script like jquery.callbacks except a billion times awesomer :P... but seriously it let's you do a lot of cool stuff like set priorities for your pub/subs so when you "publish" an event, the "subscriber" with the highest priority will receive that action first. Not only that but it let's you lock and disable certain subscriptions only and a bunch of other stuff I don't remember off the top of my head. I have one question though... should I include jquery.deferred like functionality?

      Loading editor
  • It's all working!! but not the PortableCSS?

      Loading editor
    • Original Authority wrote: Hi, Math, if you look at my history, I had your import and others like chat hacks but then it wouldn't work so i borrowed Pecoes to see if it would work but it never....And yes you have my permission

      I have removed PortableCSSPad from your JavaScript (again, there are problems with it, please don't use it until I can fix those problems)

      Everything in your global.jsshould be working now. If chat hacks aren't working for you, erase the code I put in there and replace it with the old chat hacks code you had, which was this:

      /*  Monchomans chat hacks */
      importScriptPage('User:Monchoman45/ChatHacks.js', 'c');
        Loading editor
    • Hey, I have now finished working out some bugs in the CSS Pad script you were asking about. If you want, you can now find the script at http://dev.wikia.com/wiki/PortableCSSPad and install it by following the instructions there

        Loading editor
    • Will do, Thanks!!

        Loading editor
    • 50.19.155.235
        Loading editor
  • Seems a new wikia is starting up and this person is pretty much copying my code. Is there a way to prevent this?

      Loading editor
    • View all 37 replies
    • Did you try using padding on the table itself? E.g.

      {| style="padding: 100px; border: 2px dashed blue;"
      |-
      | style="border: 1px solid red;" | But there is a 100px padding
      |}
      
      But there is a 100px padding
        Loading editor
    • wow didn't even think of that. thanks, looks much better.

        Loading editor
    • 50.19.155.235
        Loading editor
  • Hey Math. I'm currently in the process of making a javascript anti-vandal program. The UI is just about done and I'm about to start the actual coding. Interested?

      Loading editor
    • Sounds interesting, I wouldn't mind helping out in a small way, maybe like with testing / giving feedback. I'm not sure I have enough free time to help with actual development though, sorry :(

        Loading editor
    • It's all good. Btw, congrats on the CC adminship.... I'll have to watch out now with Math on my tail :P. Also, what exactly are you working on right now for development? And if you don't mind me asking, I saw your userpage about your friend who works at amazon so I was wondering where you work now (this is completely optional to answer)

        Loading editor
      1. Thanks, now you have one more person to bug when the spam needs cleaning up :P - otherwise I'll just keep editing the forums and commenting on the staff blogs like usual.
      2. Development projects, well, Railgun, although I don't always have much time for that, as I'm busy at work, studying, filling out job applications, and watching like... *counts on fingers* ... 7? different anime currently airing this season + a couple older ones. I'm getting closer and closer to the point where I need Pecoes' preferences to be stable in order to continue working on Railgun.
      3. I work at a community college in a tutoring center.. not exactly the career I had in mind. Trying to poke my head into the developers community in the Seattle area (I'd love to be an Android developer... or even Windows 8 would be cool, C# is basically Java without coffee creamer, so no problems there).

        Had a couple interviews, but still having trouble getting past recruiters in general without good contacts. Tech leads know that mathematics is a perfectly good STEM degree, but sadly most recruiters don't, and will just toss your resume into the "no" pile if you don't have the computer engineering degree / experience listed on the job posting. Puts me at a bit of a disadvantage. Fallback plan is to go back to school, grab a teacher's certificate and/or master's degree and go into teaching. I'd much rather be an engineer though...
        Loading editor
    • Google appreciates mathematicians. Just sayin ;)

        Loading editor
    • 50.19.155.235
        Loading editor
  • That's an impressive sounding thread title, isn't it? So let me come right out and say: I don't know what it means. I looked at the Wikipedia page for all of five minutes and decided I don't need to know the details...

    I found the link to that Wikipedia page in the jshint documentation under the "maxcomplexity" setting. That setting seems to be a new addition. Either that or I didn't notice it before.

    I found this setting to be uniquely useful. The theory that higher cyclomatic complexity correlates to more errors seems true to me. I also notice that this setting alerts me to passages I end up rewriting anyway. The magic number seems to be 5. Anything up until 4 is fine. 5 is usually okay. But 6 needs to be edited. Badly. Even if there are no errors in it. Because reading that code gives me headaches.

    Have you tinkered with this stuff?

      Loading editor
    • I've tinkered a bit, though not too much. My usage of JSHint revolves around copy/pasting my code into the text box at http://www.jshint.com/, clicking a few checkboxes, and pressing the Lint button. I've looked at the documentation maybe once or twice just to see what the checkbox I'm clicking actually does.

      Unfortunately, the web form doesn't have checkboxes for all the different options, it just has some of the most popular ones. You can set maxcomplexity with a comment though (and I presume you can do all this from the console using the global JSHINT function). To use the Wikipedia example:

      (function () {
      	/*jshint maxcomplexity:2 */
       
      	// will throw a JSHint error because
      	// Cyclomatic Complexity is 3 > 2
       
      	function c1() {}
      	function c2() {}
      	function f1() {}
      	function f2() {}
      	function f3() {}
      	function f4() {}
       
      	if (c1()) {
      		f1();
      	} else {
      		f2();
      	}
       
      	if (c2()) {
      		f3();
      	} else {
      		f4();
      	}
      }());

      In the wikipedia article, the only particularly interesting part is the Implications for Software Testing section. Before that is just a description of what a Control Flow Graph is (it's a graph data structure) and a semi-formal mathematical definition / proof of the Cyclomatic Complexity formula using vector spaces and topology... mathmaticians might find that interesting but computer scientists don't really need to know...

      Brief summary:

      1. You have a Control Flow Graph of a program
      2. Cyclomatic Complexity is a fancy name for a number that is derived from the graph via a formula.
      3. Cyclomatic Complexity is an upper bound (maximum) for the number of test cases needed to cover all branches of the program.
      4. Cyclomatic Complexity is a lower bound (minimum) for the number of test cases needed to cover all paths through the program.
        • Note: in practice, some paths may be impossible (e.g. if you have an if statement whose condition is known to always evaluate to true), so the number of actual paths could be smaller.
        Loading editor
    • Oh. Wow! Thanks for reading all of that :) You shouldn't have. Really. You shouldn't have. The reason I haven't read that entire article was not that it may have been too complicated. I just skimmed it to find out if the idea in general makes sense.

      It's kinda like in computer games. There's probably a formula governing how much taking out that one guard will raise the awareness of all the other guards. But you don't want that formula. You want that formula to make sense on an intuitive level and get a feel for how you should behave for optimal results.

      It does look to me like cyclomatic complexity is one of those formulas that make sense on an intuitive level. It did find the passages in my code that made me feel a little queasy.

      I'm not so sure about the right number though. Five may be overly aggressive. I seem to be okay with certain sixes. I've removed the eights though and good riddance. The article suggests tens are okay. I haven't seen tens yet...

      That comment thing is easy btw:

      /*jshint maxcomplexity:6 */

      My full comment is this:

      /*jshint jquery:true, browser:true, es5:true, devel:true, camelcase:true, curly:false, undef:true, unused:true, bitwise:true, eqeqeq:true, forin:true, immed:true, latedef:true, newcap:true, noarg:true, unused:true, regexp:true, strict:true, trailing:true, maxcomplexity:6 */
      /*global mediaWiki:true*/

      That's a bit over the top I suppose. :)

      Whatever the options, I do very much like jshint! There are quite a few gnarly errors that jshint found immediately and that may have taken me a long time to detect. It's quite the shortcut!

        Loading editor
    • The reason I read more of the article was because I needed to in order to understand what the point of it all was :)

      Yeah, JSHint has helped me find quite a few errors too. Adding maxcomplexity to my comment list is probably a good idea. While I'm at it, I think I'll also steal some others from your list too. I'm not sure exactly if I want to let Cyclomatic Complexity shape how I write code. For now, I think I'll just set it to 1 and let it count the complexity of my code so I can get a feel for what the complexity of most of the code I'm writing actually is.

      P.S. your comment has unused:true appearing twice. I guess you reeeeally want to make sure you don't have unused variables :)

        Loading editor
    • 50.19.155.235
        Loading editor
  • <pre><html><head></head><body></body></html></pre>

      Loading editor
    • 50.19.155.235
        Loading editor
    • This is just a test version to debug something, please don't use this version at all.

      The real version is at w:c:dev:RevealAnonIP.

      I'd rather you not make any immediate changes to it, because both Lunarity and I have been tweaking it a lot over the past day or two and are currently involved in a discussion on the talk page over on the dev wiki.

      If you could wait a couple more days until we're done actively tweaking things, that would be great, as it's not good to have too many people working on it all at once.

        Loading editor
    • what are you changing?

        Loading editor
    • Well, the script has a "permissions" configuration option so that admins can make it so that the script only works for users with specific rights.

      However, the script should also be able to be used in global.js.

      In the case where a wiki has set permissions to block a user, but the user ALSO has the script in their global.js, here's what should happen:

      1. The script should run once for MediaWiki:Common.js, and fail because the user doesn't have permission
      2. The script should run a 2nd time when loaded from global.js and succeed always.

      The problem is that importScriptURI internally tracks all scripts that have loaded via the loadedScripts global variable. So if you try to load a script a 2nd time, it won't work. Lunarity is basically working on a monkey patch to get around that problem, and I just tested it here on my test wiki and it doesn't appear to be working.

      Full conversation on the talk page at w:c:dev:Talk:RevealAnonIP

        Loading editor
    • ahh ok

        Loading editor
    • 50.19.155.235
        Loading editor
See archived talk page
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Advertisement | Your ad here

Mathmagician's Earned Badges (27)

1,090 Achievement
points

Ranked #1
on this wiki

  • Opinionator

    Awarded for writing a comment
    on 3 different blog posts!

    This badge has been earned by
    1 person.

    Opinionator
  • Wiki Expert

    Awarded for making 500 edits
    on articles!

    This badge has been earned by
    1 person.

    Wiki Expert
  • Navigator

    Awarded for adding 50 articles
    to categories!

    This badge has been earned by
    1 person.

    Navigator
  • Tour Guide

    Awarded for adding 25 articles
    to categories!

    This badge has been earned by
    1 person.

    Tour Guide
  • Lucky Edit

    Awarded for making the Lucky 4,000th Edit on the wiki!

    This badge has been earned by
    1 person.

    Lucky Edit
  • Two Weeks on the Wiki

    Awarded for contributing to the wiki every day for 14 days!

    This badge has been earned by
    1 person.

    Two Weeks on the Wiki
  • Wiki Leader

    Awarded for making 250 edits
    on articles!

    This badge has been earned by
    1 person.

    Wiki Leader
  • Collector

    Awarded for adding 25 pictures
    to articles!

    This badge has been earned by
    1 person.

    Collector
  • Stopping By to Say Hi

    Awarded for leaving a message
    on someone else's talk page!

    This badge has been earned by
    8 people.

    Stopping By to Say Hi
Previous Next

Around Wikia's network

Random Wiki