Forums

Help › Forums

Nerdy thread

Wed, Jun 5 2024 8:53 AM (97 replies)
  • ScottHope
    10,440 Posts
    Wed, Sep 18 2019 6:49 AM
     craigswan :

    It'll fall out though Craig if you stand like that for long, hehe.

  • ScottHope
    10,440 Posts
    Mon, Nov 21 2022 4:50 AM
    Bookmarklets

    Here's something I never knew about before... bookmarklets. It's the same as a browser bookmark, but instead of having a URL, it has Javascript.

    If you have a bookmark that brings you to WGT, if you edit it, you should see a URL field that contains something starting with https://www.wgt.com

    But if you changed that to something like...

    java-script:(function(){al-ert("Scott says hello!")})()

    you might get a pop-up box with 'Hello' in it instead of being taken to WGT. I don't know if this will work in all browsers but in Chrome & Edge it does.

    I'm not sure how useful this is but I did make one that takes away the wallpaper on my profile page. If you want to try it, just make yourself a new browser bookmark. You can make one for this page if you like because it won't be using the URL anyway. Edit your new bookmark and replace the URL with this...

    java-script:(function(){document.querySelector(".COVER").style.display="none"})()

    ...then save your bookmark. Might be a good idea to give it a memorable name so it stands out from your other bookmarks.
    Letter case is important when typing out or copying the code.

    Then simply go to my profile page and click on your new bookmark, hopefully my wallpaper will vanish. Don't click on the bookmark thinking it will take you to my profile page because it won't, as it has no URL anymore.

    IMPORTANT : In my code examples above, the words 'javascript' and 'alert' should not have a hypen '-' in them, so make sure to remove it when using the code. This message wouldn't post without the hypens because WGT's security software thought I was trying to post a script, which isn't allowed.

    Have fun!  : )


    EDIT : You can select and drag my examples into the browser address bar to see what they do, but make sure to remove the hypens as I stated previously, and the second example only works on my profile page.

  • ScottHope
    10,440 Posts
    Tue, Oct 10 2023 1:54 AM

    Here's a nice little teaser for those of you who are good at solving maths problems.

    If I have two pictures that I can resize (A & B), that I wish to place side by side in an area that has a certain width (C), and the two pictures each have a different aspect ratio. How do I work out what width each picture must be, for their heights to be the same and the width of the area where they are, to be filled. The aspect ratio of each picture must be maintained.


    I think I might have it...

    Picture width A = C / (aspect ratio (A) + aspect ratio (B)) * aspect ratio (A)

    Picture width B = C / (aspect ratio (A) + aspect ratio (B)) * aspect ratio (B)

    Of course you only need to work out the width of one picture, as subtracting that width from C will give you the width of the other picture.

    I'll do an example as proof...

    As I want to fill the entire width of where my pictures are going, then that width is 100%, so C is 100%...

    and picture A has an aspect ratio of 0.75. (750px wide, 1000px high)...

    and picture B has an aspect ratio of 3. (1000px wide, 333px high).

    Picture width A = 100% / (aspect ratio (A) + aspect ratio (B)) * aspect ratio (A)

    100 / (0.75 + 3) * 0.75 = 20

    Picture A width = 20%

    To get the width required for picture B, just subtract the width of picture A (20%) from the area width C (100%), or run the formula...

    Picture width B = C / (aspect ratio (A) + aspect ratio (B)) * aspect ratio (B)

    100 / (0.75 + 3) * 3 = 80

    that gives us 80% for picture B.

    Width for picture A = 20%
    Width for picture B = 80%

    Ta-da!

    Here is the final formula...

    Anyone for aspirin?  8 )

  • callaghan159
    6,359 Posts
    Tue, Oct 10 2023 2:20 PM

    ^^^^^^^Yikes^^^^^^^.......🤣🤣🤣

  • ScottHope
    10,440 Posts
    Tue, Oct 10 2023 3:22 PM

    Haha! Don't let it bother you Brian, it's just a place for me to jot down some thoughts so I can come back to them when I forget. I don't expect anyone else to take any notice of it, but if they do, I hope it makes sense.

  • craigswan
    31,819 Posts
    Thu, Oct 12 2023 12:00 PM

    Aw jings scott .

    You told us the answer . I have been looking for my book on logarithm's up my attic since yesterday .

    Image result for pie puns | Pie puns, Bakery puns, Dessert puns

  • ScottHope
    10,440 Posts
    Thu, Oct 12 2023 12:57 PM

    Haha!

    Sorry Craig, I guess I got a bit over excited about solving it myself and just couldn't refrain from posting.  : )

  • ScottHope
    10,440 Posts
    Thu, Oct 26 2023 9:32 AM

    Ignore this post, just looking into Chrome overrides and needed to post something to see if Chrome would use my local Javascript file instead of a WGT one.

    Result : I don't think it did.  : (

  • HamdenPro
    2,486 Posts
    Thu, Oct 26 2023 1:38 PM

    ScottHope:
    Ignore this post, just looking into Chrome overrides and needed to post something to see if Chrome would use my local Javascript file instead of a WGT one.

    It is stuff that like this that really diminishes super hero status!!

    Just sayin'

    Next Hoperman will be wearing glasses and a pocket protector.

  • ScottHope
    10,440 Posts
    Fri, Oct 27 2023 1:12 AM

    It works for Clark. 

RSS