Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to the "codepal" extension will be documented in this file.

## [1.3.0]
## [1.4.0]
- Fix window presentation error while adding new testcases.
- Add AtCoder Library support for C++

Expand Down
49 changes: 30 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# CodePal
<!-- ![Build Status](https://github.com/IEEE-NITK/codepal/actions/workflows/lint.yml/badge.svg) -->
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.png)](https://www.gnu.org/licenses/gpl-3.0)
[![Downloads](https://img.shields.io/visual-studio-marketplace/d/IEEE-NITK.codepal)](https://marketplace.visualstudio.com/items?itemName=IEEE-NITK.codepal)
[![](https://img.shields.io/visual-studio-marketplace/v/IEEE-NITK.codepal.png?color=green)](https://marketplace.visualstudio.com/items?itemName=IEEE-NITK.codepal)
Expand All @@ -9,16 +8,19 @@ A Visual Studio Code Extension to help **Codeforces** Users ***Code with Conveni
# Demo

### Enter Handle in settings and view problems, contests and profile with submission status on each problem
![Promo1](res/GIFS/Demo0.gif)
![Promo1](https://i.ibb.co/F5y4bXb/Demo0.gif)

### Create Problem/Contest Folders inclusive of all sample tests, compile and run automatically, get comprehensive verdicts and view problem statement and submission webpages.
![Promo2](res/GIFS/Demo1.gif)
![Promo2](https://i.ibb.co/5jMz4g3/Demo1.gif)

### Filter through problems
![Promo2](res/GIFS/Demo2.gif)
![Promo3](https://i.ibb.co/xmMpczF/Demo2.gif)

### Stress Testing your code
![Promo2](res/GIFS/Demo3.gif)
![Promo4](https://i.ibb.co/zFQKf0G/Demo3.gif)

### Use the Atcoder Library
![Promo5](https://i.ibb.co/99Pyy9f/Demo4.gif)

# Features of this Extension

Expand All @@ -35,7 +37,7 @@ A Visual Studio Code Extension to help **Codeforces** Users ***Code with Conveni
- Compiler may be selected and compilation flags can be set through the codepal settings.
- Perform Stress testing to find a counter test case for your code.
- Get a personalized experience of viewing details of your Codeforces profile and the status of problem submissions made, by entering your Codeforces handle in the codepal settings.

- Use the [Atcoder Library](https://codeforces.com/blog/entry/82400) in C++ without any extra setup.

# Languages Supported

Expand Down Expand Up @@ -64,21 +66,30 @@ A Visual Studio Code Extension to help **Codeforces** Users ***Code with Conveni
<a id="labels"></a>
Below are the various clickable icons used in our extension.

<img src="res/svg/IconLabels.png"/>
<!-- <img src="res/svg/IconLabels.png"/> -->
<img src="https://i.ibb.co/gRrpCYc/demo.png">

## Key to Icons:
1. Reload Contest List
2. Future Contest Registration on Codeforces
3. Contest Folder Creation
4. Reload Problem List
5. Problem Filter Based on Rating and Tags
6. Problem Folder Creation
7. Add Manual Test Cases
8. Create Stress Testing Files
9. Open Problem Statement on Codeforces
10. Run Test Cases on Solution File
11. Perform Stress Testing
12. Open Problem Submission Page on Codeforces
1. Custom Contest Folder Creation
2. Reload Contest List
3. Future Contest Registration on Codeforces
4. Copy link to Contest
5. Contest Folder creation with all problems of contest
6. Open Contest link on Codeforces
7. Problem Filter Based on Rating and Tags
8. Custom Problem Folder Creation
9. Reload Problem list
10. Copy link to Problem
11. Problem folder creation with testcases
12. Open Problem link on Codeforces
13. Add Manual Test Cases
14. Create ACL combined file (only C++)
15. Create Stress Testing Files
16. Open ACL documentation (enable in settings)
17. Open Problem Statement on Codeforces
18. Run Test Cases on Solution File
19. Perform Stress Testing
20. Open Problem Submission Page on Codeforces

## Keyboard Shortcuts
- *Ctrl + Alt + A* (*Cmd + Alt + A* for Mac) : Add Manual Test Cases
Expand Down
Binary file removed res/GIFS/Demo0.gif
Binary file not shown.
Binary file removed res/GIFS/Demo1.gif
Binary file not shown.
Binary file removed res/GIFS/Demo2.gif
Binary file not shown.
Binary file removed res/GIFS/Demo3.gif
Binary file not shown.
18 changes: 1 addition & 17 deletions src/classes/contest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const cheerio = require('cheerio');
const axios = require('axios');
const fs = require("fs").promises;
import { assert } from 'console';
import { isRCPCTokenRequired,getCookie } from '../utils/scraper';

import {ProblemClass} from "./problem";

Expand All @@ -28,25 +27,10 @@ export class ContestClass{
}

async init(){
let rcpcValue = "";
try{
const response = await axios.get("https://codeforces.com");
let [_,a,b,c] = isRCPCTokenRequired(response);
rcpcValue = getCookie(a,b,c);
console.log(rcpcValue);
// somehow get rcpc_value
} catch(err) {
console.log(err);
}
try{
assert(this.type !== "FUTURE");
// const rcpcValue = "6164ef00544d3b5266657b2349cea803";
const { data } = await axios.get(this.contestLink,{
headers: {
// eslint-disable-next-line @typescript-eslint/naming-convention
Cookie: `RCPC=${rcpcValue}; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/`,
}
});
const { data } = await axios.get(this.contestLink);

const $ = cheerio.load(data);

Expand Down
21 changes: 1 addition & 20 deletions src/features/folder_creation/test_cases_fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,11 @@ const axios = require('axios');
const fs = require("fs").promises;
import * as vscode from "vscode";
import { ProblemClass } from '../../classes/problem';
import { isRCPCTokenRequired,getCookie } from '../../utils/scraper';


const getInputOutput = async (problem: ProblemClass) => {
let rcpcValue = "";
try{
const response = await axios.get("https://codeforces.com");
let [_,a,b,c] = isRCPCTokenRequired(response);
rcpcValue = getCookie(a,b,c);
console.log(rcpcValue);
// somehow get rcpc_value
} catch(err) {
console.log(err);
}
try {
// const rcpcValue = "6164ef00544d3b5266657b2349cea803";
const { data } = await axios.get(
`https://codeforces.com/contest/${problem.contestID}/problem/${problem.index}`,
{
headers: {
// eslint-disable-next-line @typescript-eslint/naming-convention
Cookie: `RCPC=${rcpcValue}; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/`,
}
}
`https://codeforces.com/contest/${problem.contestID}/problem/${problem.index}`
);
const $ = cheerio.load(data);
const postTitleInput = $('div > div.input > pre');
Expand Down
30 changes: 0 additions & 30 deletions src/utils/scraper.ts

This file was deleted.

Loading