angel_of_death's blog

By angel_of_death, 4 years ago, In English

Hello all, I'd like to share with you a google chrome extension called Sample Case Tester.

Like the name says, it helps you in easily testing your code against the given sample cases for any problem, both in a contest and in practice. It adds an editor to the problem page where you need to just paste your code and run it to see if your code passes the given sample cases for that problem or not.

If your program is giving wrong output for one or more of the sample cases, it'll show you that case along with your program's output and also the expected output. If there are any compilation or runtime errors, it'll show those as well. And ofcourse, if your program gives the right output for all the cases, it'll tell you that your code passed!

It can be very helpful to save time during contests and also when a problem has multiple sample cases and/or very long inputs and outputs.

Currently it supports C, C++, Java, Python, Ruby and Perl. This is the very first version of the extension which I released just yesterday. More languages will be added soon along with a lot more useful functionality in the upcoming versions and the extension will update itself whenever a new version is released.

Another thing I want to mention is that the extension currently does not check your program for TLE. This is one of the things in my to-do list for the coming future. There's a fixed amount of common execution time limit however which I've set in case the code has things like infinite loops.

I'm aware of other tools like hightail but this is just my own addition to the community which is extremely convenient to install and use in a way that you don't even need to switch tabs or switch to a different program and everything you need will be right there on the problem page in the browser itself.

So do check it out, rate it on the webstore and let me know if you guys find any bugs. And if you like it, please consider sharing it with your friends. Thank you! LINK HERE

EDIT: For problems which have multiple correct outputs, it'll say your code failed unless it gets the same output as the sample one. So watch out for that.

UPDATE: I've chosen to DISCONTINUE this extension. It will be unpublished from the chrome store so no new users can install it & will no longer work for existing users either. The reason I chose to do this is because I had built this extension purely out of passion & I'd been spending 20$/month out of my own pocket for the past year to keep the extension running. I was not making any money from the extension & neither did I intend to. My only goal was to make something that'd be helpful to people. When my remote compiler gets overloaded especially during a contest when there are multiple submissions, it's natural that the compiler takes too long to execute your code & might fail with various errors. I was expecting people to understand this & be forgiving which they clearly were not. Also, not only were the users not thankful for something I'd been providing for free at the expense of my own money, some of them were downvoting my replies here when I try to explain my situation, leaving bad reviews & ratings on the chrome store & demanding that the extension should always work for them 24/7 as if they'd paid me for this service. Considering all the above points I'm no longer going to support this extension.

 
 
 
 
  • Vote: I like it
  • +128
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

dose it work if there's not internet connection ??

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Unfortunately no. It needs internet connection.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      so it might be slow if there are many users use it !!

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it +4 Vote: I do not like it

        We'll have to see. I mean the compiler it's using is pretty efficient and the server it's running on can always be upgraded if it really does slow down due to too many users.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

This is really good extension

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

nice

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    Can add a submit button to it ? ... i guess (Amooo :) ) mike can help in this ... U need tokens :?csrf_token=b76cc71a99d1fe01e0c6bc17783830b5 ...

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      That's a great idea! It's on my list :) Will be adding it in the next few days.

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        but one may submit by mistake instead of Teste Code

        • »
          »
          »
          »
          »
          4 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it

          I was thinking of giving the option to submit only if the code passes.

          • »
            »
            »
            »
            »
            »
            4 years ago, # ^ |
              Vote: I like it +7 Vote: I do not like it

            This wouldn't work for problems with multiple correct outputs.

            • »
              »
              »
              »
              »
              »
              »
              4 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              Yes you're right. I forgot to mention it earlier. In case of problems with multiple correct outputs it will say your code failed unless you get the same output as the sample.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Very nice extension, thank you.
Can you make the editor appear under the "notes" section? So that no one misses it

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

if there is #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);

else

// online submission

endif

in code

it`s not working

hope to fix it

  • »
    »
    4 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    The first line would give an error since in.txt does not exist on the server where it compiles the code.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it +15 Vote: I do not like it

      I think the point here is to include -DONLINE_JUDGE in your compilation command in the server, to make it the same as Codeforces grader since Codeforces also define ONLINE_JUDGE in the compilation command.

      Therefore, any part within #ifndef ONLINE_JUDGE will not be executed

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

It is good. But it is not working for me. Too slow

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can you tell me which language you're using please?

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      С++

      • »
        »
        »
        »
        4 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        Cool. I just found that CPU usage on the server was reaching 100%! I'm upgrading the server currently so it will be down for 20-30 minutes and then it should run smoothly.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I tried running a code in Java and it's very slow.

»
4 years ago, # |
Rev. 4   Vote: I like it +4 Vote: I do not like it

As the code compiles server-side, will it run a risk of having my solutions skipped?

(I trust you that you will neither public nor plagiarise the users' solutions during a contest, but you know... I have to play safe in a contest)

  • »
    »
    4 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    It did come to my mind that users might have this concern but you have nothing to worry about since it doesn't store the user's solutions on the server. All the source files are automatically deleted once it finishes executing the code. Also, the extension sends only the source code, inputs and outputs to the server but not which particular problem that code is for. So, even if I have the code, I won't know which problem it's for :)

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Sumbit button can also be added so that we can directly submit code from here. BTW its a good extension.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

This is amazing.... :)

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Obviously it's not working with questions that accepts multiple answers, which is quite normal, but just be careful.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

The precision needs to be fixed BTW great plugin.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Oops forgot about that. Will add it to the list of things for the future.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

It didn't work for me during contest (however I tried only once). I got Compilation Time Exceeded. I guess it is a result of not testing it under heavy load.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes sorry about that. I observed that during the contest as well that some users were getting that error. I made the necessary changes on the server-side. You shouldn't be having that problem next time. This was the first contest after i launched the extension. I'm studying it and modifying stuff as needed on the go. It should be pretty stable soon. Please bear with it.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

fix plz

Spoiler
  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks for letting me know. Working on it.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Fixed it. Your extension will update itself within a few hours and it should work fine after that. I wasn't able to figure out what was causing the button to do that though, so that might continue being like that.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I think it broke when i zoomed out page to make screenshot

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

fix strange multiple line cursor

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Where is button submit after checking code?

»
3 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

When I use my template code which contains header <bits/stdc++.h>, it gives following error:

"Compilation Error Compilation took too long. Maximum compilation time limit reached."

Also, it gives the same error, if I use many headers.

Please fix it soon.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks for letting me know. If you don't mind, can you share your code and the exact language you chose? It will help me debug. I don't need to know which problem the code is for.

    • »
      »
      »
      3 years ago, # ^ |
      Rev. 3   Vote: I like it 0 Vote: I do not like it
      This is my c++ Code for problem 545D:
    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      same happening to me too.. c++11 c++14

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      same problem. using c++11 or c++14 Compilation Error Compilation took too long. Maximum compilation time limit reached.1. -

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

not working.

»
3 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Hi. compilation time limit is very bad. my PC have low speed then compilation time is higher than normal and don't tell correct response to me. how i can change compilation time limit ?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It's compiled on a remote server so your PC speed shouldn't matter. I'll see what I can do to speed it up. I'm not able to find any free time because of my full-time job so please bear with it until then. Thanks for installing the extension btw.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

c++11 and c++14 giving took a lot of time too compile error.. while same code runs for c++

»
3 years ago, # |
  Vote: I like it +4 Vote: I do not like it

Please, fix it. It is the best etension I've ever used.

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it 0 Vote: I do not like it

    I tried but i'm not able to reproduce any bugs which might be causing issues for the users. The problems others reported worked just fine when I tried them. So I don't know what exactly it is that needs to be fixed. Another thing is, compilation & execution becomes slow on the remote server when there are a lot of people submitting simultaneously and it might give the TLE error. The only solution for this would be to get a better server but I'm already paying 20$ per month out of my own pocket for the current server. I made this extension purely out of passion & I don't make any money from it. All this and I have a full-time job giving me barely any free time at all to work on this extension.

»
3 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

I've chosen to DISCONTINUE this extension. It will be unpublished from the chrome store so no new users can install it & will no longer work for existing users either. The reason I chose to do this is because I had built this extension purely out of passion & I'd been spending 20$/month out of my own pocket for the past year to keep the extension running. I was not making any money from the extension & neither did I intend to. My only goal was to make something that'd be helpful to people. When my remote compiler gets overloaded especially during a contest when there are multiple submissions, it's natural that the compiler takes too long to execute your code & might fail with various errors. I was expecting people to understand this & be forgiving which they clearly were not. Also, not only were the users not thankful for something I'd been providing for free at the expense of my own money, some of them were downvoting my replies here when I try to explain my situation, leaving bad reviews & ratings on the chrome store & demanding that the extension should always work for them 24/7 as if they'd paid me for this service. Considering all the above points I'm no longer going to support this extension. Go ahead & downvote this reply too. I don't care.

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it +4 Vote: I do not like it

    I have recently formatted my Hard Disk and the first thing I did on chrome after installing was looking for your extension, just to find it missing from chrome store. I have just seen your comment and I'm really sorry for your decision.

    All the people I know who used your extension found it as a great help (we even began to sometimes code problem A inside it and check the samples before submitting, which made us solve problem A in almost no time). I'm sorry for people who down-voted you, I know most people were silently thanking you for it (including me for example). Hope one day you decide to bring the extension back!

»
23 months ago, # |
  Vote: I like it +3 Vote: I do not like it

This would be great if you make this project as Open Source, for further development.

»
22 months ago, # |
  Vote: I like it 0 Vote: I do not like it

the link isn't working

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Please bring back this extension, it must have been really really helpful!!!! Please please please.

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

your idea is very good!!!

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

WTF is this