Блог пользователя yak_ex

Автор yak_ex, 14 лет назад, По-английски

This is my second user.js script for Codeforces. If you install this script (Updated: 1.6: 2015/05/05), you can see standings like as follows:

You need to wait for seconds until standings are colorized. The order and decoration are set by my arbitrary feeling. If you want to change them, please edit the script directly. It is quite easy. The latest code is also at github.

On my environment, the user.js script works with the following browser:

  • Firefox 3.6.17 with Greasemonkey 0.9.2
  • Opera 11.10
  • Chrome 12.0 (This is a development version but I think stable versions also work as well.)

Updated (0.02):

Now this script is applicable for division-specific standings and room standings. For room standings, I would be glad if you make some comments...

New feature is added. If you click a colored cell, tiny red triangles appear at the top-left corners of the cells colored in the same way. The following example is the case for clicking "Java". Clicking a marked cell, the marks disappears. It is not necessary to click cells in the top table. Cells in the actual standings table are also clickable. To clear mark, it is not necessary to click the same cell when marking. To click a marked cell is enough.

 

Updated (1.1):

Added OCaml and Scala support. This is just an updated thing. The reason why version jumps up is because Chrome recognizes version 0.0x as 1.0 and rejects update prior to 1.1.

Updated (1.2: 2012/06/05):

Record marked languages into cookie. So, they are persistent, at least, between reloads. The configuration is shared by all standings in a domain (e.g. www.codeforces.com). Thanks to suggestion by iTwin.

Updated (1.3: 2012/06/05):

I didn't notice the comments that Java 6, Java 7 and Perl are not highlighted. Now, they are highlighted.

Updated (1.4: 2013/05/07):

Add new languages (Python -> Python 2 and Python 3, C# -> Mono C# and MS C#, D, and Go).

Updated (1.5: 2014/06/01):

Add new languages (Java 8 and JavaScript).

Updated (1.6: 2015/05/05):

Add new languages (GNU C++11 (unified with GNU C++0x), GNU C11 and PyPy (unified with 2 and 3)).

  • Проголосовать: нравится
  • +90
  • Проголосовать: не нравится

14 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится
Amazing! Both idea and implementation are superb! The only thing I am thinking about: it's very easy to edit your script so that it works in rooms as well. Wouldn't it be considered as a cheat in competitions because you can, for example, just ignore all java solutions if you don't know java?
  • 14 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    Yes, It's very easy. :)
    You should add working addresses:
    http://codeforces.me/contest/*/room/*
    http://codeforces.me/contest/*/room/*
    in settings.

    OR
    lines
    // @include        http://codeforces.me/contest/*/room/*
    // @include        http://codeforces.me/contest/*/room/*
    in script
14 лет назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится
Can you modify script so that it colors opened solutions? This feature would be useful when somebody consequently views room's programs for challenge. Thanks.
14 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится
If I rigth understand, Click highlight all cells with this language.

Is it possible to mark only one ceil and don't reset it after page refresh?(It can be separate exception because sombody (for example,me) need not colorizing but need clcik2highlight)

  • 14 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    I agree, current behavior doesn't make any sense for me, all languages are already easy distinguishable from each other. What RiaD-WaW suggests sounds good. 
14 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Thank you for comments, mmaxio, pank.dm and freopen.

Though I can't remember the actual representation of the room standing table during a contest, it is likely that this script is usable during contest. It might be considered as a cheat. I, however, keep to present this script at this point for the following reasons.

  • This script just emphasizes information already included in the standings table.
    • Hovering cursor on cells pop-up such information. 
  • What I can do is anyone can do.
    • To withdraw this script is not so meaningful.
    • To keep public here, others can discuss and judge this kind of stuffs.

>freopen

Again, I can't remember the actual representation of the room standing table during a contest. Therefore, I can't modify this script for your request right now, even from technical point of view. 

13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
two new languges were added, OCaml and Scala.
Can you update your userscript? For the color of these two languages, I suggest to use the same as Hasell.
  • 13 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится +5 Проголосовать: не нравится

    Thank you for the suggestion.

    I agree on the colors with you because they are functional programming languages.

    The script is updated. The version number jumps up to 1.1 because Chrome recognizes version 0.0x as 1.0.   Only the update is that OCaml and Scala are added.

    The script and images on my server have been already updated but this blog entry has not been updated yet because editing the entry causes errors, right now. If the errors are fixed, this entry itself will be updated, also. You can obtain the script also from https://github.com/yak1ex/cf_userjs

»
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Perl isn't highlighted

»
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Has problem with Java solutions Maybe "Java 6" and "Java 7" are different ?

  • »
    »
    13 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Previous Java solutions are labeled by "Java 6" in their cells. Add this line in the source file. ~~~~~ [ 'Java 6', 'l-java-6', 'background-color: #ffccff !important; border: dashed #6666ff;' ] ~~~~~

»
12 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Who can I disable this script without removing it from chromium? Is there any checkbox for this purpose?

  • »
    »
    12 лет назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

    Tools -> Extensions -> toggle the «Enabled» checkbox // Chromium 18.0.1025.151

»
12 лет назад, # |
Rev. 6   Проголосовать: нравится 0 Проголосовать: не нравится

How can I install a script on MozFirefox 4.0 ?

UPD: If it is not too long please tell me how? Cause I hate googling in some cases , for example in this case I didn't even know that I could intall scripts on my browser.

UPD: now MozFirefox 11.0 .

»
6 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

can you update the script for the new c++ versions?

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How can we build this app? I can't do it. Please help me?

  • »
    »
    4 года назад, # ^ |
    Rev. 3   Проголосовать: нравится +3 Проголосовать: не нравится

    I know it's too late but if anybody struggling to use this.

    Firefox:

    1. Install violentmonkey firefox addon

    2. click on addon and '+' icon

    3. paste the code and save

    Chrome: Install tampermonkey extension for chrome

    Rest is the same

    PS: You need to change the code a little bit to make it work

    change

    // @include        http://www.codeforces.com/contest/*/standings*
    

    to

    // @match          https://codeforces.me/contest/*/standings*
    

    UPD: (only firefox)

    In case you don't want to do that you can install an extension( read more about this here)

    Link to addon

    Hope it helps :)