Comments (12)
"http error [500]" means leetcode.com response a 500 HTTP error, you can run leetcode show command again with "-vv" to enable trace log to see what happens in the HTTP traffic.
e.g.
leetcode show 1 -gxl java -vv
from leetcode-cli.
I guess it might be due to the api change on leetcode side that the "show" command no longer gives the problem descriptions. Would you mind checking it? Cuz without the descriptions, the leetcode-cli is almost useless. And here's what I got for running the code:
$ leetcode submit 576.out-of-boundary-paths.java -vv
[TRACE] REQUEST %s { url: 'https://leetcode.com/api/problems/algorithms/',
headers:
{ Cookie: 'LEETCODE_SESSION=;csrftoken=;',
'X-CSRFToken': '',
'X-Requested-With': 'XMLHttpRequest' },
expectedStatus: 200,
retry: 0,
callback: [Function] }
[TRACE] REQUEST %s make request https://leetcode.com/api/problems/algorithms/
[TRACE] REQUEST %s onRequestResponse https://leetcode.com/api/problems/algorithms/ 200 { server: 'nginx',
date: 'Fri, 09 Jun 2017 03:27:53 GMT',
'content-type': 'text/html; charset=utf-8',
'transfer-encoding': 'chunked',
connection: 'close',
vary: 'Accept-Encoding, Accept, Cookie',
'x-frame-options': 'SAMEORIGIN',
allow: 'GET, HEAD, OPTIONS' }
[TRACE] REQUEST %s reading response's body
[TRACE] REQUEST %s finish init function https://leetcode.com/api/problems/algorithms/
[TRACE] REQUEST %s response end https://leetcode.com/api/problems/algorithms/ 200 { server: 'nginx',
date: 'Fri, 09 Jun 2017 03:27:53 GMT',
'content-type': 'text/html; charset=utf-8',
'transfer-encoding': 'chunked',
connection: 'close',
vary: 'Accept-Encoding, Accept, Cookie',
'x-frame-options': 'SAMEORIGIN',
allow: 'GET, HEAD, OPTIONS' }
[TRACE] REQUEST %s end event https://leetcode.com/api/problems/algorithms/
[TRACE] REQUEST %s has body https://leetcode.com/api/problems/algorithms/ 240505
[TRACE] REQUEST %s emitting complete https://leetcode.com/api/problems/algorithms/
[TRACE] REQUEST %s { url: 'https://leetcode.com/problems/out-of-boundary-paths/submit/',
headers:
{ Cookie: ;',
'X-CSRFToken': '',
'X-Requested-With': 'XMLHttpRequest',
Origin: 'https://leetcode.com',
Referer: 'https://leetcode.com/problems/out-of-boundary-paths' },
expectedStatus: 200,
retry: 0,
body:
{ judge_type: 'large',
lang: 'java',
question_id: 576,
test_mode: false,
typed_code: '/*\r\n * [576] Out of Boundary Paths\r\n *\r\n * https://leetcode.com/problems/out-of-boundary-paths\r\n *\r\n * Hard (33.35%)\r\n * Total Accepted: \r\n * Total Submissions: \r\n * Testcase Example: '2\n2\n2\n0\n0'\r\n *\r\n * Can you solve this problem? 🤔\r\n */\r\npublic class Solution {\r\n public int findPaths(int m, int n, int N, int i, int j) {\r\n\t\treturn 0;\r\n }\r\n}\r\n' },
method: 'POST',
json: true,
_delay: 1,
callback: [Function] }
[TRACE] REQUEST %s make request https://leetcode.com/problems/out-of-boundary-paths/submit/
[TRACE] REQUEST %s onRequestResponse https://leetcode.com/problems/out-of-boundary-paths/submit/ 500 { server: 'nginx',
date: 'Fri, 09 Jun 2017 03:27:55 GMT',
'content-type': 'text/html; charset=utf-8',
'transfer-encoding': 'chunked',
connection: 'close',
vary: 'Cookie',
'x-frame-options': 'SAMEORIGIN' }
[TRACE] REQUEST %s reading response's body
[TRACE] REQUEST %s finish init function https://leetcode.com/problems/out-of-boundary-paths/submit/
[TRACE] REQUEST %s response end https://leetcode.com/problems/out-of-boundary-paths/submit/ 500 { server: 'nginx',
date: 'Fri, 09 Jun 2017 03:27:55 GMT',
'content-type': 'text/html; charset=utf-8',
'transfer-encoding': 'chunked',
connection: 'close',
vary: 'Cookie',
'x-frame-options': 'SAMEORIGIN' }
[TRACE] REQUEST %s end event https://leetcode.com/problems/out-of-boundary-paths/submit/
[TRACE] REQUEST %s has body https://leetcode.com/problems/out-of-boundary-paths/submit/ 27
[TRACE] REQUEST %s invalid JSON received https://leetcode.com/problems/out-of-boundary-paths/submit/
[TRACE] REQUEST %s emitting complete https://leetcode.com/problems/out-of-boundary-paths/submit/
from leetcode-cli.
Seems there are at least 2 issues:
- the description is missing because leetcode.com doesn't provide info as before, we already have fixed for #39 , so you can update leetcode-cli again to have the fix.
- the submit failed with 500 error, I guess it might because there is a special unicode char "🤔" in the request that leetcode.com doesn't handle it well. I would dig this later, but you can try to delete that char in your java file to see if it works as I guessed.
from leetcode-cli.
I know what was going on. Guess my terminal doesn't have the right font or encoding to display some symbols as you just pointed out, and it went in the java file as squares which causes the problem. By deleting those squares solves the problem.
I think this issue is good to be closed.
from leetcode-cli.
After you updated leetcode-cli, you can remove the cache (~/.lc/out-of-boundary-paths.json), and it will show the right description as expected:
$ leetcode show 576
[576] Out of Boundary Paths
https://leetcode.com/problems/out-of-boundary-paths
* Hard (33.34%)
* Total Accepted: 2279
* Total Submissions: 6836
* Testcase Example: '2\n2\n2\n0\n0'
There is an m by n grid with a ball. Given the start coordinate (i,j) of the ball, you can move the ball to adjacent cell or cross the grid boundary in four directions (up, down, left, right). However, you can at most move N times. Find out the number of paths to move the ball out of grid boundary. The answer may be very large, return it after mod 109 + 7.
Example 1:
Input:m = 2, n = 2, N = 2, i = 0, j = 0
Output: 6
Explanation:
Example 2:
Input:m = 1, n = 3, N = 3, i = 0, j = 1
Output: 12
Explanation:
Note:
Once you move the ball out of boundary, you cannot move it back.
The length and height of the grid is in range [1,50].
N is in range [0,50].
from leetcode-cli.
Has new version updated on npm yet? It seems it is still 0.10.0 and nothing changed.
from leetcode-cli.
not published to npm yet, while you can install from github directly
$ npm install -g skygragon/leetcode-cli
More info: https://skygragon.github.io/leetcode-cli/install
from leetcode-cli.
I have permission issues of npm installing from private repo though there are some ways to work around, but no real solutions. I guess I'll just stick with official npm version and try installing it later when it's updated. Thanks a lot!
from leetcode-cli.
Are you saying the npm permission issue when trying to install it globally?
from leetcode-cli.
I have no issues installing it globally with sudo command, but have issues installing it from private GitHub repo. I saw the version on npm has bumped to 0.10.1, and after updating to it seems everything works again. Thanks!
from leetcode-cli.
[ERROR] Error: connect ECONNREFUSED 104.27.161.90:443 [0]
why I had the issue in ubuntu 16.04 OS ?
from leetcode-cli.
@Pyboon most time this connection refused error is due to a bad networking, it's too complex since every hop (e.g. routers, firewalls) might be the reason...
from leetcode-cli.
Related Issues (20)
- Could not login with both 'leetcode user -l' and 'leetcode user -c' HOT 8
- Stuck on missing plugin install HOT 3
- submit error
- Is providing proxy function on schedule?
- Winston which is dep of prompt will make node 14 fail HOT 1
- Error: Cannot find module 'underscore' HOT 1
- is this repo abandoned? HOT 1
- [ERROR] http error [code=400] HOT 3
- ERROR:leetcode.client.auth:Cannot get cookies from chrome
- [ERROR] failed to load locked problem! HOT 1
- show question by url HOT 2
- **区登录问题 HOT 5
- Can't login! HOT 12
- [ERROR] TypeError: The header content contains invalid characters [0] HOT 1
- `leetcode show 561` returns `[ERROR] failed to load problem!` HOT 1
- template wrong with the problem ID HOT 1
- The first installation on termux can run, after I uninstalled and reinstalled vim as well as installed this plug-in, I couldn't log in later. HOT 1
- Error: getaddrinfo ENOTFOUND leetcode.com HOT 1
- enable scripted submission workflow HOT 2
- Unable to show with ID HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leetcode-cli.