Issue in configuring eslint to express project - node.js

I have been referring https://www.npmjs.com/package/eslint to configure eslint to my express project and when i'm installing eslint package i'm getting an error as following
npm ERR! Unexpected end of JSON input while parsing near '.../ajv-1.4.2.tgz"}},"1.'
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\Ramitha\AppData\Roaming\npm-cache_logs\2018-07-17T06_22_50_551Z-debug.log
package.json
{
"name": "name",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "nodemon index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.3",
"nodemon": "^1.18.2"
}
}
2018-07-17T06_22_50_551Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'eslint',
1 verbose cli '-g' ]
2 info using npm#5.6.0
3 info using node#v8.11.3
4 verbose npm-session 54a68bf0918c64f2
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/eslint 42ms (from cache)
8 silly pacote tag manifest for eslint#latest fetched in 123ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly install loadAllDepsIntoIdealTree
13 silly resolveWithNewModule eslint#5.1.0 checking installable status
14 http fetch GET 200 https://registry.npmjs.org/ajv 185ms (from cache)
15 http fetch GET 200 https://registry.npmjs.org/babel-code-frame 180ms (from cache)
16 http fetch GET 200 https://registry.npmjs.org/debug 179ms (from cache)
17 http fetch GET 200 https://registry.npmjs.org/eslint-scope 178ms (from cache)
18 http fetch GET 200 https://registry.npmjs.org/doctrine 179ms (from cache)
19 http fetch GET 200 https://registry.npmjs.org/cross-spawn 181ms (from cache)
20 silly fetchPackageMetaData error for ajv#^6.5.0 Unexpected end of JSON input while parsing near '.../ajv-1.4.2.tgz"}},"1.'
21 http fetch GET 200 https://registry.npmjs.org/eslint-utils 194ms (from cache)
22 silly pacote range manifest for debug#^3.1.0 fetched in 198ms
23 silly resolveWithNewModule debug#3.1.0 checking installable status
24 silly pacote range manifest for babel-code-frame#^6.26.0 fetched in 207ms
25 silly resolveWithNewModule babel-code-frame#6.26.0 checking installable status
26 silly pacote range manifest for eslint-scope#^4.0.0 fetched in 200ms
27 silly resolveWithNewModule eslint-scope#4.0.0 checking installable status
28 silly pacote range manifest for doctrine#^2.1.0 fetched in 201ms
29 silly resolveWithNewModule doctrine#2.1.0 checking installable status
30 silly pacote range manifest for cross-spawn#^6.0.5 fetched in 205ms
31 silly resolveWithNewModule cross-spawn#6.0.5 checking installable status
32 http fetch GET 200 https://registry.npmjs.org/eslint-visitor-keys 254ms (from cache)
33 http fetch GET 200 https://registry.npmjs.org/espree 254ms (from cache)
34 silly pacote range manifest for eslint-utils#^1.3.1 fetched in 259ms
35 silly resolveWithNewModule eslint-utils#1.3.1 checking installable status
36 silly pacote range manifest for eslint-visitor-keys#^1.0.0 fetched in 320ms
37 silly resolveWithNewModule eslint-visitor-keys#1.0.0 checking installable status
38 silly pacote range manifest for espree#^4.0.0 fetched in 323ms
39 silly resolveWithNewModule espree#4.0.0 checking installable status
40 http fetch GET 200 https://registry.npmjs.org/esquery 236ms (from cache)
41 http fetch GET 200 https://registry.npmjs.org/file-entry-cache 223ms (from cache)
42 http fetch GET 200 https://registry.npmjs.org/glob 222ms (from cache)
43 http fetch GET 200 https://registry.npmjs.org/functional-red-black-tree 223ms (from cache)
44 http fetch GET 200 https://registry.npmjs.org/esutils 228ms (from cache)
45 http fetch GET 200 https://registry.npmjs.org/globals 228ms (from cache)
46 silly pacote range manifest for esquery#^1.0.1 fetched in 248ms
47 silly resolveWithNewModule esquery#1.0.1 checking installable status
48 http fetch GET 200 https://registry.npmjs.org/ignore 172ms (from cache)
49 silly pacote range manifest for file-entry-cache#^2.0.0 fetched in 236ms
50 silly resolveWithNewModule file-entry-cache#2.0.0 checking installable status
51 silly pacote range manifest for functional-red-black-tree#^1.0.1 fetched in 237ms
52 silly resolveWithNewModule functional-red-black-tree#1.0.1 checking installable status
53 silly pacote range manifest for glob#^7.1.2 fetched in 238ms
54 silly resolveWithNewModule glob#7.1.2 checking installable status
55 silly pacote range manifest for esutils#^2.0.2 fetched in 242ms
56 silly resolveWithNewModule esutils#2.0.2 checking installable status
57 silly pacote range manifest for globals#^11.7.0 fetched in 242ms
58 silly resolveWithNewModule globals#11.7.0 checking installable status
59 http fetch GET 200 https://registry.npmjs.org/inquirer 117ms (from cache)
60 silly fetchPackageMetaData error for inquirer#^5.2.0 Unexpected end of JSON input while parsing near '...":"^2.1.0","gulp-plum'
61 silly pacote range manifest for ignore#^3.3.3 fetched in 189ms
62 silly resolveWithNewModule ignore#3.3.10 checking installable status
63 http fetch GET 200 https://registry.npmjs.org/is-resolvable 31ms (from cache)
64 http fetch GET 200 https://registry.npmjs.org/js-yaml 30ms (from cache)
65 http fetch GET 200 https://registry.npmjs.org/json-stable-stringify-without-jsonify 29ms (from cache)
66 http fetch GET 200 https://registry.npmjs.org/lodash 27ms (from cache)
67 http fetch GET 200 https://registry.npmjs.org/levn 29ms (from cache)
68 http fetch GET 200 https://registry.npmjs.org/mkdirp 24ms (from cache)
69 silly pacote range manifest for is-resolvable#^1.1.0 fetched in 40ms
70 silly resolveWithNewModule is-resolvable#1.1.0 checking installable status
71 silly pacote range manifest for js-yaml#^3.11.0 fetched in 38ms
72 silly resolveWithNewModule js-yaml#3.12.0 checking installable status
73 http fetch GET 200 https://registry.npmjs.org/natural-compare 25ms (from cache)
74 silly pacote range manifest for json-stable-stringify-without-jsonify#^1.0.1 fetched in 35ms
75 silly resolveWithNewModule json-stable-stringify-without-jsonify#1.0.1 checking installable status
76 silly pacote range manifest for lodash#^4.17.5 fetched in 34ms
77 silly resolveWithNewModule lodash#4.17.10 checking installable status
78 silly pacote range manifest for levn#^0.3.0 fetched in 38ms
79 silly resolveWithNewModule levn#0.3.0 checking installable status
80 silly pacote range manifest for mkdirp#^0.5.1 fetched in 34ms
81 silly resolveWithNewModule mkdirp#0.5.1 checking installable status
82 silly pacote range manifest for natural-compare#^1.4.0 fetched in 36ms
83 silly resolveWithNewModule natural-compare#1.4.0 checking installable status
84 http fetch GET 200 https://registry.npmjs.org/optionator 21ms (from cache)
85 http fetch GET 200 https://registry.npmjs.org/pluralize 24ms (from cache)
86 http fetch GET 200 https://registry.npmjs.org/progress 24ms (from cache)
87 http fetch GET 200 https://registry.npmjs.org/regexpp 21ms (from cache)
88 silly pacote range manifest for optionator#^0.8.2 fetched in 29ms
89 silly resolveWithNewModule optionator#0.8.2 checking installable status
90 silly pacote range manifest for pluralize#^7.0.0 fetched in 28ms
91 silly resolveWithNewModule pluralize#7.0.0 checking installable status
92 http fetch GET 200 https://registry.npmjs.org/require-uncached 21ms (from cache)
93 silly pacote range manifest for regexpp#^1.1.0 fetched in 27ms
94 silly resolveWithNewModule regexpp#1.1.0 checking installable status
95 silly pacote range manifest for progress#^2.0.0 fetched in 32ms
96 silly resolveWithNewModule progress#2.0.0 checking installable status
97 silly pacote range manifest for require-uncached#^1.0.3 fetched in 29ms
98 silly resolveWithNewModule require-uncached#1.0.3 checking installable status
99 http fetch GET 200 https://registry.npmjs.org/string.prototype.matchall 37ms (from cache)
100 http fetch GET 200 https://registry.npmjs.org/table 39ms (from cache)
101 silly pacote range manifest for string.prototype.matchall#^2.0.0 fetched in 47ms
102 silly resolveWithNewModule string.prototype.matchall#2.0.0 checking installable status
103 silly fetchPackageMetaData error for table#^4.0.3 Unexpected end of JSON input while parsing near '...8eba","tarball":"http'
104 http fetch GET 200 https://registry.npmjs.org/text-table 48ms (from cache)
105 silly pacote range manifest for text-table#^0.2.0 fetched in 50ms
106 silly resolveWithNewModule text-table#0.2.0 checking installable status
107 http fetch GET 304 https://registry.npmjs.org/chalk 578ms (from cache)
108 silly pacote range manifest for chalk#^2.1.0 fetched in 586ms
109 silly resolveWithNewModule chalk#2.4.1 checking installable status
110 http fetch GET 304 https://registry.npmjs.org/imurmurhash 320ms (from cache)
111 http fetch GET 304 https://registry.npmjs.org/semver 160ms (from cache)
112 silly pacote range manifest for imurmurhash#^0.1.4 fetched in 325ms
113 silly resolveWithNewModule imurmurhash#0.1.4 checking installable status
114 silly pacote range manifest for semver#^5.5.0 fetched in 166ms
115 silly resolveWithNewModule semver#5.5.0 checking installable status
116 http fetch GET 304 https://registry.npmjs.org/path-is-inside 185ms (from cache)
117 silly pacote range manifest for path-is-inside#^1.0.2 fetched in 191ms
118 silly resolveWithNewModule path-is-inside#1.0.2 checking installable status
119 http fetch GET 304 https://registry.npmjs.org/strip-ansi 168ms (from cache)
120 http fetch GET 304 https://registry.npmjs.org/minimatch 229ms (from cache)
121 silly pacote range manifest for strip-ansi#^4.0.0 fetched in 174ms
122 silly resolveWithNewModule strip-ansi#4.0.0 checking installable status
123 silly pacote range manifest for minimatch#^3.0.4 fetched in 238ms
124 silly resolveWithNewModule minimatch#3.0.4 checking installable status
125 http fetch GET 304 https://registry.npmjs.org/strip-json-comments 178ms (from cache)
126 silly pacote range manifest for strip-json-comments#^2.0.1 fetched in 183ms
127 silly resolveWithNewModule strip-json-comments#2.0.1 checking installable status
128 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '.../ajv-1.4.2.tgz"}},"1.'
128 verbose stack at JSON.parse (<anonymous>)
128 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17)
128 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
128 verbose stack at <anonymous>
128 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)
129 verbose cwd C:\Users\Ramitha\Desktop\Projects\backend
130 verbose Windows_NT 10.0.15063
131 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "eslint" "-g"
132 verbose node v8.11.3
133 verbose npm v5.6.0
134 error Unexpected end of JSON input while parsing near '.../ajv-1.4.2.tgz"}},"1.'
135 verbose exit [ 1, true ]
How can I accomplish this ? Please help me out

I got to fix the error by deleting the contents of the npm-cache_logs folder which is in C:\Users\Ramitha\AppData\Roaming\npm-cache_logs and re-installing the eslint module

npm cache clean --force
solved the problem for me

Related

React failed create react app module not found [duplicate]

This question already has answers here:
Cannot find module coa/compile.js
(6 answers)
Closed 1 year ago.
I bought a new pc today.
I installed the latest reccomanded version of NodeJS, installed npm.
I checked if they are installed correctly using the node -v and npm -v and i can see
Node:
v16.13.0
npm:
8.1.0
Then tried to build a new react app with the command npx create-react-app test-app. I tried this, then tried to install it globally but i had the same feedback from the error.
So the problem is:
When i lunch the command create-react-app, it crashes giving me this error back. Anyone can explain me what is happening?
The error starts at row 111
Thanks everyone!
0 verbose cli [
0 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'install',
0 verbose cli '-g',
0 verbose cli 'coa'
0 verbose cli ]
1 info using npm#8.1.0
2 info using node#v16.13.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 4ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 4ms
6 timing config:load:builtin Completed in 5ms
7 timing config:load:cli Completed in 3ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\Luca\Desktop\Progetti\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\Amministratore\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\Amministratore\AppData\Roaming\npm\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 18ms
19 timing npm:load:configload Completed in 18ms
20 timing npm:load:setTitle Completed in 1ms
21 timing npm:load:setupLog Completed in 0ms
22 timing config:load:flatten Completed in 5ms
23 timing npm:load:cleanupLog Completed in 3ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 0ms
26 timing npm:load Completed in 30ms
27 timing arborist:ctor Completed in 2ms
28 timing idealTree:init Completed in 9ms
29 timing idealTree:userRequests Completed in 4ms
30 silly idealTree buildDeps
31 silly fetch manifest coa#*
32 http fetch GET 200 https://registry.npmjs.org/coa 76ms (cache hit)
33 silly placeDep ROOT coa#3.1.3 OK for: want: *
34 silly fetch manifest #types/q#^1.5.1
35 silly fetch manifest chalk#^2.4.1
36 silly fetch manifest q#^1.1.2
37 http fetch GET 200 https://registry.npmjs.org/#types%2fq 24ms (cache hit)
38 http fetch GET 200 https://registry.npmjs.org/chalk 24ms (cache hit)
39 http fetch GET 200 https://registry.npmjs.org/q 28ms (cache hit)
40 timing idealTree:#root Completed in 130ms
41 silly placeDep node_modules/coa #types/q#1.5.5 OK for: coa#3.1.3 want: ^1.5.1
42 silly placeDep node_modules/coa chalk#2.4.2 OK for: coa#3.1.3 want: ^2.4.1
43 silly placeDep node_modules/coa q#1.5.1 OK for: coa#3.1.3 want: ^1.1.2
44 silly fetch manifest ansi-styles#^3.2.1
45 silly fetch manifest escape-string-regexp#^1.0.5
46 silly fetch manifest supports-color#^5.3.0
47 http fetch GET 200 https://registry.npmjs.org/ansi-styles 24ms (cache hit)
48 http fetch GET 200 https://registry.npmjs.org/supports-color 24ms (cache hit)
49 http fetch GET 200 https://registry.npmjs.org/escape-string-regexp 28ms (cache hit)
50 timing idealTree:node_modules/coa Completed in 44ms
51 timing idealTree:node_modules/coa/node_modules/#types/q Completed in 0ms
52 silly placeDep node_modules/coa ansi-styles#3.2.1 OK for: chalk#2.4.2 want: ^3.2.1
53 silly placeDep node_modules/coa escape-string-regexp#1.0.5 OK for: chalk#2.4.2 want: ^1.0.5
54 silly placeDep node_modules/coa supports-color#5.5.0 OK for: chalk#2.4.2 want: ^5.3.0
55 silly fetch manifest color-convert#^1.9.0
56 silly fetch manifest has-flag#^3.0.0
57 http fetch GET 200 https://registry.npmjs.org/color-convert 21ms (cache hit)
58 http fetch GET 200 https://registry.npmjs.org/has-flag 23ms (cache hit)
59 timing idealTree:node_modules/coa/node_modules/chalk Completed in 44ms
60 silly placeDep node_modules/coa color-convert#1.9.3 OK for: ansi-styles#3.2.1 want: ^1.9.0
61 silly fetch manifest color-name#1.1.3
62 http fetch GET 200 https://registry.npmjs.org/color-name 12ms (cache hit)
63 timing idealTree:node_modules/coa/node_modules/ansi-styles Completed in 18ms
64 silly placeDep node_modules/coa color-name#1.1.3 OK for: color-convert#1.9.3 want: 1.1.3
65 timing idealTree:node_modules/coa/node_modules/color-convert Completed in 3ms
66 timing idealTree:node_modules/coa/node_modules/color-name Completed in 1ms
67 timing idealTree:node_modules/coa/node_modules/escape-string-regexp Completed in 0ms
68 timing idealTree:node_modules/coa/node_modules/q Completed in 0ms
69 silly placeDep node_modules/coa has-flag#3.0.0 OK for: supports-color#5.5.0 want: ^3.0.0
70 timing idealTree:node_modules/coa/node_modules/supports-color Completed in 2ms
71 timing idealTree:node_modules/coa/node_modules/has-flag Completed in 0ms
72 timing idealTree:buildDeps Completed in 245ms
73 timing idealTree:fixDepFlags Completed in 2ms
74 timing idealTree Completed in 262ms
75 timing reify:loadTrees Completed in 269ms
76 timing reify:diffTrees Completed in 3ms
77 silly reify moves {}
78 timing reify:retireShallow Completed in 1ms
79 timing reify:createSparse Completed in 9ms
80 timing reify:loadBundles Completed in 0ms
81 silly audit bulk request {
81 silly audit coa: [ '3.1.3' ],
81 silly audit '#types/q': [ '1.5.5' ],
81 silly audit chalk: [ '2.4.2' ],
81 silly audit q: [ '1.5.1' ],
81 silly audit 'ansi-styles': [ '3.2.1' ],
81 silly audit 'escape-string-regexp': [ '1.0.5' ],
81 silly audit 'supports-color': [ '5.5.0' ],
81 silly audit 'color-convert': [ '1.9.3' ],
81 silly audit 'color-name': [ '1.1.3' ],
81 silly audit 'has-flag': [ '3.0.0' ]
81 silly audit }
82 silly tarball no local data for coa#https://registry.npmjs.org/coa/-/coa-3.1.3.tgz. Extracting by manifest.
83 timing reifyNode:node_modules/coa/node_modules/escape-string-regexp Completed in 188ms
84 timing reifyNode:node_modules/coa/node_modules/ansi-styles Completed in 189ms
85 timing reifyNode:node_modules/coa/node_modules/has-flag Completed in 191ms
86 timing reifyNode:node_modules/coa/node_modules/supports-color Completed in 192ms
87 timing reifyNode:node_modules/coa/node_modules/#types/q Completed in 194ms
88 timing reifyNode:node_modules/coa/node_modules/color-name Completed in 198ms
89 timing reifyNode:node_modules/coa/node_modules/q Completed in 199ms
90 timing reifyNode:node_modules/coa/node_modules/chalk Completed in 199ms
91 timing reifyNode:node_modules/coa/node_modules/color-convert Completed in 200ms
92 http fetch GET 200 https://registry.npmjs.org/coa/-/coa-3.1.3.tgz 223ms (cache miss)
93 timing reifyNode:node_modules/coa Completed in 287ms
94 timing reify:unpack Completed in 287ms
95 timing reify:unretire Completed in 0ms
96 timing build:queue Completed in 6ms
97 info run coa#3.1.3 preinstall node_modules/coa start /B node compile.js & node compile.js
98 info run coa#3.1.3 preinstall { code: 1, signal: null }
99 timing reify:rollback:createSparse Completed in 27ms
100 timing reify:rollback:retireShallow Completed in 0ms
101 timing command:install Completed in 762ms
102 verbose stack Error: command failed
102 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\promise-spawn\index.js:64:27)
102 verbose stack at ChildProcess.emit (node:events:390:28)
102 verbose stack at maybeClose (node:internal/child_process:1064:16)
102 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
103 verbose pkgid coa#3.1.3
104 verbose cwd C:\Users\Luca\Desktop\Progetti
105 verbose Windows_NT 10.0.19042
106 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "coa"
107 verbose node v16.13.0
108 verbose npm v8.1.0
109 error code 1
110 error path C:\Users\Amministratore\AppData\Roaming\npm\node_modules\coa
111 error command failed
112 error command C:\Windows\system32\cmd.exe /d /s /c start /B node compile.js & node compile.js
113 error node:internal/modules/cjs/loader:936
113 error throw err;
113 error ^
113 error
113 error Error: Cannot find module 'C:\Users\Amministratore\AppData\Roaming\npm\node_modules\coa\compile.js'
113 error at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
113 error at Function.Module._load (node:internal/modules/cjs/loader:778:27)
113 error at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
113 error at node:internal/main/run_main_module:17:47 {
113 error code: 'MODULE_NOT_FOUND',
113 error requireStack: []
113 error }
113 error node:internal/modules/cjs/loader:936
113 error throw err;
113 error ^
113 error
113 error Error: Cannot find module 'C:\Users\Amministratore\AppData\Roaming\npm\node_modules\coa\compile.js'
113 error at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
113 error at Function.Module._load (node:internal/modules/cjs/loader:778:27)
113 error at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
113 error at node:internal/main/run_main_module:17:47 {
113 error code: 'MODULE_NOT_FOUND',
113 error requireStack: []
113 error }
114 verbose exit 1
It's working now!
COA got compromised but is now back up again without the malicious code inside.
Check https://github.com/veged/coa/issues/99 for more info.

Gnuplot fit error - singular matrix in Givens()

So I want to fit a function with a dataset using gnuplot. In the file "cn20x2012", at the lines [1:300] I have this data:
1 -7.576723949519277e-06
2 4.738414366971162e-05
3 2.5908117324519247e-05
4 7.233786749999952e-06
5 4.94720225240387e-06
6 -1.857620375000113e-06
7 5.697280584855734e-06
8 -1.867760712716345e-05
9 6.64096591257211e-05
10 2.756199717307687e-05
11 4.7755705550480866e-05
12 6.590865376225963e-05
13 4.1522206877403805e-05
14 3.145294946394234e-05
15 5.9346948090625035e-05
16 5.405458204471163e-05
17 0.0001484469089218749
18 0.00011236895265264405
19 0.00010798644697620197
20 8.656723035552881e-05
21 0.00019917737876442313
22 0.00022625750686778835
23 0.00023183354141658626
24 0.0003373178915148073
25 0.00032313619574999994
26 0.0003451188893915866
27 0.0003303809005983172
28 0.0003534148565745192
29 0.00039690566743750015
30 0.0004182810016802884
31 0.00045198626877403865
32 0.00047311462195192373
33 0.0004962054400408655
34 0.0004969566757524037
35 0.0005561838221274039
36 0.0005353567324539659
37 0.00052834133201923
38 0.0005980226227637016
39 0.0005446277144831731
40 0.0005960780049278846
41 0.0006076488594567314
42 0.000710219997610289
43 0.0006714079307259616
44 0.0006990041531870184
45 0.000694646402266827
46 0.0006910307645889419
47 0.0007918124250492787
48 0.0007699669760728367
49 0.0007850042712259613
50 0.0007735240355776444
51 0.0008333605652980768
52 0.0007914544977620185
53 0.0008254284036610573
54 0.0008578590784536057
55 0.0008597165395913466
56 0.0009350752655120189
57 0.0009355867078822116
58 0.0009413161534519229
59 0.001003045837043269
60 0.0009530084342740383
61 0.000981287851927885
62 0.000986143934318509
63 0.00096895140692548
64 0.0010671633388319713
65 0.0010884129846995196
66 0.0010974424039567304
67 0.0011198829067163459
68 0.0010649422789374995
69 0.0010909547135769227
70 0.0010858300892451934
71 0.00114890178018774
72 0.0011503018930817308
73 0.0012209814370937495
74 0.001264080502711538
75 0.0012453762294132222
76 0.0012725116258625
77 0.0012649334953990384
78 0.0012195748153341352
79 0.0013151443892213466
80 0.0013003322635283651
81 0.0013099768888799042
82 0.0013227992394807694
83 0.0013325137669168274
84 0.001356943212587259
85 0.0014541924819278852
86 0.0014094004314177883
87 0.0014273633669975969
88 0.0014393176087403859
89 0.0014372794673365393
90 0.0015051545220959143
91 0.0015432813234807683
92 0.0015832276965293275
93 0.001540622433288461
94 0.0016007491118125
95 0.0016195978358533654
96 0.0016447077023067317
97 0.0016350138695504803
98 0.0017352804136629807
99 0.001731106189370192
100 0.0017407015898704323
101 0.0017367582300937506
102 0.0018164239404875008
103 0.0017829769448653838
104 0.0018303930988165871
105 0.0017893320000211548
106 0.0018727349292259614
107 0.0018745909637668267
108 0.0018425366172147846
109 0.0019053739892581727
110 0.0018849885474855762
111 0.0018689524590103368
112 0.0019431807910961535
113 0.001951890517350962
114 0.0019308973497776446
115 0.0019990349471177894
116 0.002009245176572116
117 0.0020004240575882213
118 0.002020795320423557
119 0.0020148423748725963
120 0.002070277553975961
121 0.002112121992170673
122 0.002081609846093749
123 0.0020899822853341346
124 0.002214996736841347
125 0.002210968677028846
126 0.002204230691923077
127 0.0022059340675168264
128 0.002244672249610577
129 0.002243725570633895
130 0.002198417606970913
131 0.002326686848007212
132 0.002298981945014423
133 0.002412905193465384
134 0.0023317473012668287
135 0.0023255737818221145
136 0.0024042900543605767
137 0.0023814333208341345
138 0.002414946342495192
139 0.002451134140336538
140 0.002435468088014424
141 0.002541540709086779
142 0.0024759180712812523
143 0.002562872725209133
144 0.002554363054353367
145 0.002525350243064904
146 0.0026228594448966342
147 0.002640361090600963
148 0.0026968734518557683
149 0.002687729582449518
150 0.0026799173813848555
151 0.002751626483175481
152 0.0026916526068317286
153 0.002682602742860577
154 0.0027658840884567304
155 0.0028385319315024035
156 0.002733288245524039
157 0.002805041072350961
158 0.002798724552451201
159 0.00284738398885577
160 0.002833892571264423
161 0.0028506943730673084
162 0.0028578405825413463
163 0.0028141271324870197
164 0.0029047532288887
165 0.002916689246838943
166 0.003006111659274039
167 0.0030388357088942325
168 0.0030117903270181707
169 0.003023639132084136
170 0.0030182642660336535
171 0.0029788478969250015
172 0.003086049268993511
173 0.0030530940010240377
174 0.00309287048297596
175 0.0030892688902187473
176 0.0032070964353437493
177 0.0031308958387163454
178 0.003262165689711538
179 0.0032348496648947093
180 0.003334092027257212
181 0.0032702121678230764
182 0.0032887867663149036
183 0.00333782536743269
184 0.0033132179587812513
185 0.003400563164048078
186 0.003322215536028365
187 0.0033691419445264436
188 0.00340692471343654
189 0.003370118822997599
190 0.003414042435545674
191 0.003460621729710913
192 0.003487680921019232
193 0.0034814484875360595
194 0.003528280852358173
195 0.0035260558732403864
196 0.0035947047098653846
197 0.003583761358336538
198 0.003589446784643749
199 0.0035488957604610572
200 0.0036106514596322115
201 0.003633161542855769
202 0.003596668943564904
203 0.003621647520017789
204 0.0037260161142259616
205 0.0036873544761057684
206 0.003693311409786057
207 0.0037485618958747594
208 0.0037277801700697126
209 0.003731768419286058
210 0.0037200943660144225
211 0.0037368698886754786
212 0.0038266932486634626
213 0.003786905602120193
214 0.0038484308669038464
215 0.003837662506102065
216 0.003877989966946875
217 0.0038711451977908673
218 0.0039796825709810125
219 0.003955763375971154
220 0.003983664920576924
221 0.004019112007471154
222 0.003996646585913461
223 0.004061509550884613
224 0.004015245551199519
225 0.004009779120920672
226 0.004148229009661058
227 0.0040645974335312505
228 0.0041522345293678545
229 0.004216267765944711
230 0.004191517977733654
231 0.004280319721466346
232 0.004210795761447114
233 0.004258393462563462
234 0.004267925011272355
235 0.00427713419340625
236 0.004323331966394231
237 0.004361159201735935
238 0.004351708975694715
239 0.004359997178644953
240 0.00437384325853894
241 0.004375188742463941
242 0.004424559629495192
243 0.004461955226487498
244 0.004489655863850963
245 0.0045503420149230756
246 0.0045185560829999975
247 0.004506067166336778
248 0.004585396025798076
249 0.004530840472406252
250 0.0045934151490120215
251 0.004602146584228363
252 0.004643262102497593
253 0.004707265035608172
254 0.004766505116052884
255 0.004744165929896635
256 0.0047756718030625015
257 0.004802170611427885
258 0.004896239463478368
259 0.0048845448341901425
260 0.004845213594302884
261 0.004915008781204327
262 0.004838528640802884
263 0.0048121374747617796
264 0.004895357859576925
265 0.0048793476575266816
266 0.004958465852682693
267 0.005007965180538941
268 0.0049839032653341345
269 0.005068383734646637
270 0.00498556504900495
271 0.005014623260019232
272 0.005066327855785335
273 0.0050290740743365375
274 0.005152934708140861
275 0.005174238921781968
276 0.005123581464772355
277 0.005155969777822114
278 0.005169396608004327
279 0.00516497090489663
280 0.005145110646115385
281 0.005209611399110575
282 0.005163211771749997
283 0.005181044847507209
284 0.005281641245183894
285 0.005323840847189907
286 0.005230924322329326
287 0.005256136984014422
288 0.005374876757439424
289 0.0053137727444009615
290 0.005468482116127402
291 0.005453857539401205
292 0.005417081656274039
293 0.005393994523838937
294 0.005506909240446873
295 0.005449365350307692
296 0.005551215606367787
297 0.005505932791992786
298 0.0055918512302572145
299 0.005663100163579326
300 0.0056382443690432705
When I do
f(x) = a/b*(1-exp(-b*x))
fit[1:300] f(x) "cn20x2012" using 1:2 via a,b
The curve fits perfectly. But when I try to fit the curve with
a/b*(1-exp(-b*x/(3e-26))
I get the error message. Note that I've only added a constant to the exponential part of the function.
What can I do to fit the function with the constant 3e-26?
I'm using gnuplot 5.2 patchlevel 8 on linux
Adding that constant makes the values of exp(-b*x/(3.e-26) so close to zero that the term (1-exp(-b*x/(3e-26)) differs from 1 by less than the precision available for IEEE double precision floating point numbers. So you are essentially fitting the function g(x) = a/b, which is a very poor fit to your data.
Since you already have a good fit using your original function f(x), perhaps you can explain what your goal is to change the function to something else? What question are you trying to answer?

jquery interaction with svg path to create specific clickable area

I am trying to get an svg path to be 'clickable' when put into an file rather than put in-line in the document.
Basically I just want to be able to click on the filled elements of an image, not any empty areas.
I have converted my PNG image to svg and got this working, so that when I click on the filled areas the code executes as I need to, but not when clicking on any empty areas.
To do this, I have only had to put in a 'class' to the 'path' tag to make the filled areas interactive via the code.
However, if I now put this svg code into a file and load it into an element, as seems to be the way to do it from what I've read, then it won't working.
I have already added the jquery add on files below, and while these have allowed other svg functions to work it hasn't allowed for this one.
<link rel="stylesheet" type="text/css" href="assets/js/jquery.svg.css">
I am unable to interact with the internal svg path within the file even with some simple css. if I put the css into the file directly in a 'style' tag then the css is applied.
I am not sure where to go with this. I have several thousand images that need to have this functionality and each one has a lot of coding to create the path for the svg image so I really don't want to have to put all of these into the html document as it will be a nightmare to deal with.
I've seen people acheieving similar interactions but as yet I've not found one applying jquery or java or even a solution that will get the ability to vary css working.
here is the code for the svg, which is just using a test image rather than one of my own but works the same.
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0
300.000000 300.000000" preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,300.000000) scale(0.050000,-0.050000)" fill="#00000" stroke="none">
<!-- The <a> tag we've added -->
<path class="imageSelector" style="cursor: pointer;" d="M4390 5952 c-113 -53 -289 -221 -427
-409 -84 -114 -98 -125 -153
-117 -171 27 -523 -80 -714 -217 l-98 -71 -97 71 c-186 137 -427 215 -661 215
l-115 0 -91 123 c-228 310 -551 543 -524 378 5 -30 19 -167 31 -305 12 -137
30 -281 40 -318 17 -66 13 -74 -119 -213 -336 -354 -415 -830 -210 -1265 l50
-106 -38 -104 c-235 -632 -120 -1587 226 -1874 64 -53 11 -59 -607 -64 l-636
-6 -79 -55 c-242 -167 -208 -515 61 -637 75 -34 153 -37 1058 -38 l977 0 -13
-75 c-25 -132 -109 -254 -295 -425 -213 -197 -351 -454 -221 -414 553 173 689
197 799 139 298 -158 287 -155 466 -155 179 0 168 -3 466 155 110 58 246 34
799 -139 130 -40 -8 217 -221 414 -186 171 -270 293 -295 425 l-13 75 977 0
c905 1 983 4 1058 38 269 122 303 470 61 637 l-79 55 -636 6 c-618 5 -671 11
-607 64 346 287 461 1244 225 1877 l-39 107 51 103 c208 416 127 909 -208
1262 -135 141 -136 144 -120 222 10 43 27 178 39 299 13 121 27 258 32 305 5
47 7 85 5 85 -3 0 -50 -22 -105 -48z m-1960 -899 c250 -67 549 -348 550 -518
0 -19 9 -35 20 -35 11 0 20 16 20 35 1 170 300 451 550 518 734 196 1249 -740
706 -1280 -233 -231 -581 -286 -874 -138 -71 36 -130 63 -132 60 -2 -3 -61
-115 -132 -250 -70 -135 -132 -245 -138 -245 -6 0 -68 110 -138 245 -71 135
-130 247 -132 250 -2 3 -61 -24 -132 -60 -297 -151 -682 -79 -905 167 -500
553 23 1441 737 1251z m-55 -3239 c25 -23 45 -55 45 -72 0 -19 25 -1 61 43 78
95 190 105 270 26 47 -47 49 -60 49 -311 0 -251 -2 -264 -49 -311 -80 -79
-192 -69 -270 26 -40 49 -61 63 -61 41 0 -104 -198 -150 -294 -68 l-56 49 0
260 c0 246 3 262 47 310 75 79 175 82 258 7z m1146 -31 c36 -44 59 -60 59 -41
0 114 205 162 298 70 51 -52 52 -59 52 -314 l0 -261 -56 -49 c-93 -80 -294
-37 -294 63 0 16 -9 29 -20 29 -11 0 -20 -11 -20 -24 0 -108 -203 -155 -291
-67 -54 55 -75 504 -27 594 57 108 210 108 299 0z" />
<path d="M2090 4647 c-352 -186 -235 -697 160 -697 391 0 514 514 166 692 -91
46 -243 48 -326 5z" />
<path d="M3590 4647 c-352 -186 -235 -697 160 -697 391 0 514 514 166 692 -91
46 -243 48 -326 5z" />
</g>
</svg>
If I put this into the document, it works fine. If I load it from a file, the image renders but I can't interact with the class for the path
this is the code for the flie load option:
<object class="imageClass" type="image/svg+xml" data="ImageFile.svg"></object>
thanks for any help on this
Update:
I have tried several ways to get this to work looking at options online and the help from suggestions below but I haven't had any success in getting the svg to be clickable at all when loaded from a file.
The only way I have been able to even access the inner elements of the svg file is using the following method with jquery.svg:
(document).ready(function() {
$("#divforSVG").svg(
{
onLoad: function() { var svg = $("#divforSVG").svg('get');
svg.load('svgFile.svg', {addTo: true, changeSize: false});
},
settings: {}} );
$('#Button').click(function(e) {
var rect = $('#ImagePath');
rect.css('fill','green');
rect.attrib('fill','green');
});
});
This i found from the following link:
Modify a svg file using jQuery
This loads the svg file into an element, rather than placing the svg file within an object element in the html page, as seems to be the way suggested. This works, changing the colour by clicking on the button, and can apply this to any inner part of the svg file. However, I cannot find a way to bind a click event to the inner elements of the svg file.
The main method of accessing inner elements of the svg file using the object method, as set out in this link, I can't get to work at all to access any part of the svg element.
How to access SVG elements with Javascript
this seems to be the way to do it with normal javascript but I've not made any progress with it. If anyone has any suggestions on how I may be able to bind a click event using the jquery.svg method as set out above, or how to get the object element method working, I'd greatly appreciate it
If you reference a file in another file, that file is no longer part of the document object model, and Javascript can no longer interact with it. The file has its own, separate DOM.
You were right to use an <object> tag, because that gives you the possibility to bridge the gap between the two DOMs (something that would be impossible with an <img> tag). Basically, with
var childDocument = $('object.imageClass').prop('contentDocument')
you get access to the document interface of the SVG content - but only provided the linked file fullfills the same-origin policy.
Note carefully the role that jQuery plays in this. jQuery has been loaded into the parent document and is not present in the child document. So instead of selecting the SVG root element in the child document with $('svg'), you must use $(childDocument).find('svg'). You cannot traverse from one document to the other with .parent(), .children() or other traversal functions. You cannot delegate events from the child document to elements in the parent document.
The jquery-svg plugin would have to work with
var svg = $(childDocument).find('svg').svg('get')

CA stack service failed to start

I'm having this error while deploying stack of CA.
Error: Failed to find private key for certificate in
'/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem':
Could not find matching private key for SKI: Failed getting key for
SKI [[21 208 34 108 92 98 114 142 23 136 0 189 188 55 155 135 23 90
147 173 157 62 155 19 173 212 128 3 175 212 121 41]]: Key with SKI
15d0226c5c62728e178800bdbc379b87175a93ad9d3e9b13add48003afd47929 not
found in /etc/hyperledger/fabric-ca-server/msp/keystore
I have made sure that key is same as "crypto-config/peerOrganizations/org1.example.com/ca" in yml file. But still its throwing error.. Any idea about this?
Within the docker run command, are you placing the secret key inside curly brackets such as this?
FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/{15d0226c5c62728e178800bdbc379b87175a93ad9d3e9b13add48003afd47929}
If so, the cause of your error is that this isn't the correct path. Remove the brackets to make the path complete.

Gnuplot log plot y-axis

I have have a .txt file with some values as a function of iteration count. And I am trying to log plot it. I have managed to do this with the following code plot 'solchange.txt' using 1:(log($2)) with lines
The x axis is perfect and the shape is perfect, but my y axis is weird. I want it to be say 10^-2 and 10^-3 and so on how can this be done?
What does -16 even mean? My value stops at 10^-7
solchange.txt
1 0.20870164249629861
2 3.0540936828943599E-002
3 2.1622388854567132E-002
4 1.7070994407582529E-002
5 1.4155375579083168E-002
6 1.2069370098131457E-002
7 1.0482626276465484E-002
8 9.2258609277672127E-003
9 8.2010529631910967E-003
10 7.3466561929682317E-003
11 6.6216556909214075E-003
12 5.9973025525987822E-003
13 5.4526144028317000E-003
14 4.9718850942694140E-003
15 4.5432279303643033E-003
16 4.1576291151408026E-003
17 3.8082604242292567E-003
18 3.4899438987894341E-003
19 3.1987266873885617E-003
20 2.9315478643644408E-003
21 2.6859845807917955E-003
22 2.4600648490906499E-003
23 2.2521338021345080E-003
24 2.0607609516045851E-003
25 1.8846776035151558E-003
26 1.7227356558349102E-003
27 1.5738810584753488E-003
28 1.4371370123238449E-003
29 1.3115934299711522E-003
30 1.1964002798033561E-003
31 1.0907632352794312E-003
32 9.9394061400687704E-004
33 9.0524097544450455E-004
34 8.2402100116123200E-004
35 7.4968344624489966E-004
36 6.8167505353953529E-004
37 6.1948438470904935E-004
38 5.6263955830880997E-004
39 5.1070590513836635E-004
40 4.6328356186664012E-004
41 4.2000502958110253E-004
42 3.8053272709547871E-004
43 3.4455657088288370E-004
44 3.1179161480603731E-004
45 2.8197578322736866E-004
46 2.5486773011298286E-004
47 2.3024485386036100E-004
48 2.0790149243582034E-004
49 1.8764731601648640E-004
50 1.6930592515617369E-004
51 1.5271365239171797E-004
52 1.3771855529436799E-004
53 1.2417958039480804E-004
54 1.1196587112561468E-004
55 1.0095618950593192E-004
56 9.1038420860557225E-005
57 8.2109133101636398E-005
58 7.4073166362883126E-005
59 6.6843234255131376E-005
60 6.0339523889261799E-005
61 5.4489287395236962E-005
62 4.9226422450250433E-005
63 4.4491043040285547E-005
64 4.0229044229763214E-005
65 3.6391666180476002E-005
66 3.2935063208632334E-005
67 2.9819883516037614E-005
68 2.7010864597994382E-005
69 2.4476448415957416E-005
70 2.2188419389643915E-005
71 2.0121567231942521E-005
72 1.8253375701611941E-005
73 1.6563737530794070E-005
74 1.5034695117064744E-005
75 1.3650206056065907E-005
76 1.2395932219765905E-005
77 1.1259050839256858E-005
78 1.0228085910393529E-005
79 9.2927581834059692E-006
80 8.4438520049430650E-006
81 7.6730973352498108E-006
82 6.9730653504927742E-006
83 6.3370761471119759E-006
84 5.7591171842940984E-006
85 5.2337712233988323E-006
86 4.7561526453150822E-006
87 4.3218511441380815E-006
88 3.9268819066553586E-006
89 3.5676414890935086E-006
90 3.2408686962536598E-006
91 2.9436098531714777E-006
92 2.6731879338693330E-006
93 2.4271750801384794E-006
94 2.2033681015580162E-006
95 1.9997666008135691E-006
96 1.8145534130165238E-006
97 1.6460770886038423E-006
98 1.4928361827763054E-006
99 1.3534651455843205E-006
100 1.2267216317977253E-006
101 1.1114750729309016E-006
102 1.0066963732594143E-006
103 9.1144860808961906E-007
104 8.2487861805891419E-007
105 7.4620940497668528E-007
106 6.7473324671810456E-007
107 6.0980545750098300E-007
108 5.5083872884395882E-007
109 4.9729799312444450E-007
110 4.4869575892107771E-007
111 4.0458787177585429E-007
112 3.6456965996078949E-007
113 3.2827242845258689E-007
114 2.9536026832557155E-007
115 2.6552715221570336E-007
116 2.3849428917172011E-007
117 2.1400771520012352E-007
118 1.9183609798172768E-007
119 1.7176873612963911E-007
120 1.5361373552607444E-007
121 1.3719634701231387E-007
122 1.2235745044898369E-007
123 1.0895217281928909E-007
log(x) is natural log. You need to use log10(x) if you want base 10.
Another, probably better way would be to use a logarithmic y axis like so:
set format y '%g'
set logscale y
plot 'solchange.txt' using 1:2 with lines
Use help set format to figure out how to change the y-axis tics.

Resources