jpmc-tech-task-3-py3's People
Forkers
zoluu maxgrok toluakin tonyguo0 hamidurrahman1 michelkazi jervvs skimtsg shenoyv arunprakashpj brianw921 imgolash parvd atharvakokatee masters-akt vbhvbot99 shubhamb99 kanchanbhale harsha14gupta pauladugyamfi plashaa rakeshchary2511 nandini2307 dhruvsha256 briansjkim paragpachpute iamlovelesh ayushshri prakharindoria ishika-a imnknavin rishabh9260 ritishtiwari robertvictoreen sumitksingh17 sauravjaiswalsj vani-gupta abhi6299 pratz0499 soummo19 swap18nil iftaqar vishwajeetverma613 shruti2660 kaustuvkaran01 kylemitra vvashu38 phern17 soumyaraj-biswal tomsb1423 anaxagoras7 lina309 sid-149 debosmithoney cameronaaron holliemansfield arundhati2103 chika5105 p3nguin12 madhavjk 0xpeanutbutter amous4822 chrestopher edgarvelazquez perrenwright bryanronnie olphil99 anthonym456 ejupialked aysp-99 sooster910 girlswhocodee rahulreddyp krishna4062 trumanhung mky01 saulmaldonado abishektvs ishwaranandswarup vinlegend1 aleksei-zaichenko nvw1 sarojkumarvivek cctina516 giovanniarcudi blair666 suraj-patro tseringn ashika29 fortune2009 srujana232 abigail6on minajshin cori-peck eszterk hashimsharkh rdtaylorjr arminrstm leo-ryu kpashajpmc-tech-task-3-py3's Issues
Remove/replace deprecated modules
Many modules included in package.json are deprecated. For example, @jpmorganchase/perspective is now @finos/perspective.
Upload patch file size error
315 mb patch size giving error as only 250 mb is allowed . I downloaded the npm zip file externally and replaced in repo .
how to upload?
getting wrong output on webpage
Any help on how should I fix this output?
Code for Graph.tsx
`import React, { Component } from 'react';
import { Table } from '@jpmorganchase/perspective';
import { ServerRespond } from './DataStreamer';
import { DataManipulator } from './DataManipulator';
import './Graph.css';
interface IProps {
data: ServerRespond[],
}
interface PerspectiveViewerElement extends HTMLElement {
load: (table: Table) => void,
}
class Graph extends Component<IProps, {}> {
table: Table | undefined;
render() {
return React.createElement('perspective-viewer');
}
componentDidMount() {
// Get element from the DOM.
const elem = document.getElementsByTagName('perspective-viewer')[0] as unknown as PerspectiveViewerElement;
const schema = {
price_abc: 'float',
price_def: 'float',
ratio: 'float',
timestamp: 'date',
upper_bound: 'float',
lower_bound: 'float',
trigger_alert: 'float',
};
if (window.perspective && window.perspective.worker()) {
this.table = window.perspective.worker().table(schema);
}
if (this.table) {
// Load the `table` in the `<perspective-viewer>` DOM reference.
elem.load(this.table);
elem.setAttribute('view', 'y_line');
elem.setAttribute('column-pivots', '["stock"]');
elem.setAttribute('row-pivots', '["timestamp"]');
elem.setAttribute('columns', '["top_ask_price"]');
elem.setAttribute('aggregates', JSON.stringify({
price_abc: 'avg',
price_def: 'avg',
ratio: 'avg',
timestamp: 'distinct count',
upper_bound: 'avg',
lower_bound: 'avg',
trigger_alert: 'avg',
}));
}
}
componentDidUpdate() {
if (this.table) {
this.table.update([
DataManipulator.generateRow(this.props.data),
]);
}
}
}
export default Graph;
`
Code for Datamanipulator.ts
`import { ServerRespond } from './DataStreamer';
export interface Row {
price_abc: number,
price_def: number,
ratio: number,
timestamp: Date,
upper_bound: number,
lower_bound: number,
trigger_alert: number | undefined,
}
export class DataManipulator {
static generateRow(serverRespond: ServerRespond[]): Row {
const priceABC = (serverRespond[0].top_ask.price + serverRespond[0].top_bid.price)/2;
const priceDEF = (serverRespond[1].top_ask.price + serverRespond[1].top_bid.price)/2;
const ratio = priceABC/priceDEF;
const upperBound = 1+0.05;
const lowerBound = 1-0.05;
return {
price_abc: priceABC,
price_def: priceDEF,
ratio,
timestamp: serverRespond[0].timestamp > serverRespond[1].timestamp ?
serverRespond[0].timestamp : serverRespond[1].timestamp,
upper_bound: upperBound,
lower_bound: lowerBound,
trigger_alert: (ratio > upperBound || ratio < lowerBound) ? ratio : undefined,
};
}
}
`
![image](https://user-images.githubusercontent.com/34468640/81557645-f0630a00-93a9-11ea-91c7-e2b406624a82.png)
Clicking 'Start Streaming Data' shows no data
Hi, so I'm currently running Windows 10 and python 3. I went through the setup process for Task 3 and am now up to starting up the app. I ran npm install
which gave me this:
I then ran npm start
which gave me this:
The app successfully loads. However, when I click the button, no data shows up. The command line that is running the server doesn't output anything when I click the button. Any thoughts? Thanks.
Error while starting npm
[email protected] start C:\Abhi\JPMC-tech-task-3-PY3
react-scripts start
'react-scripts' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Abhishek Singh\AppData\Roaming\npm-cache_logs\2020-04-26T04_23_54_120Z-debug.log
error: 'top_ask_price' does not exist on type 'ServerRespond'
when I write npm start command
C:/Users/Admin/JPMC-tech-task-3/src/Graph.tsx
Type error: Cannot find module '@jpmorganchase/perspective'. TS2307
1 | import React, { Component } from 'react';
2 | import { Table } from '@jpmorganchase/perspective';
| ^
3 | import { ServerRespond } from './DataStreamer';
4 | import { DataManipulator } from './DataManipulator';
5 | import './Graph.css';
Type Error : 'price_abc' does not exist in type 'Row[]'
Patch file size exceeds the permissible limit
Module not found: Can't resolve 'react' in 'C:\Users\*****\JPMC-tech-task-3-PY3\src'
NPM issue
browser page unresponsive
Problem with npm start
Error on the web page: A cross origin error was thrown
It is showing error in the files that I've not even touch
Failed to Compile Type error ( error in price_abc: price ABC)
Task3 error(Start streaming data)
In chrome:
Start streaming data,on clicking showing nothing
In explorer:
on clicking it shows:syntax error :json.parse error: unexpected input at position:0
XMLhttpRequesfailed ERROR
Problem with graph.tsx
I was getting this error , then i changed Row[] to Row
as suggested in the issues of this task
Type '{ price_abc: number; price_def: number; ratio: number; timestamp: Date; upper_bound: number; lower_bound: number; trigger_alert: number | undefined; }' is not assignable to type 'Row[]'.
Object literal may only specify known properties, and 'price_abc' does not exist in type 'Row[]'. TS2322
21 |
22 | return {
23 | price_abc:priceABC,
| ^
24 | price_def:priceDEF,
25 | ratio,
26 | timestamp:serverResponds[0].timestamp>serverResponds[1].timestamp ?
After changing I got this error...........
Type error: Argument of type 'Row' is not assignable to parameter of type 'TableData'.
Type 'Row' is not assignable to type '{ [key: string]: string; }'.
Index signature is missing in type 'Row'. TS2345
57 | if (this.table) {
58 | this.table.update(
59 | DataManipulator.generateRow(this.props.data),
| ^
60 | );
61 | }
62 | }
Clicking 'Start Streaming Data' shows no ratio data
I am facing netwrok error , what does this means?
Issues with Row[]
During the compilation of my program, I was presented with the following error code,
**Type error: Type '{ price_abc: number; price_def: number; ratio: number; timestamp: Date; upper_bound: number; lower_bound: number; trigger_alert: number | undefined; }' is not assignable to type 'Row[]'.
Object literal may only specify known properties, and 'price_abc' does not exist in type 'Row[]'. TS2322
20 | const lowerBound = 1 - 0.05;
21 | return {
22 | price_abc: priceABC,
| ^
23 | price_def: priceDEF,
24 | ratio,
25 | timestamp: serverResponds[0].timestamp > serverResponds[1].timestamp ?
**
Through previous issue posts, I realised this was due to having square brackets after row, and so once they were removed, I ran into another issue within Graph.tsx:
**Type error: Argument of type 'Row' is not assignable to parameter of type 'TableData'.
Type 'Row' is not assignable to type '{ [key: string]: string; }'.
Index signature is missing in type 'Row'. TS2345
52 | if (this.table) {
53 | this.table.update(
54 | DataManipulator.generateRow(this.props.data),
| ^
55 | );
56 | }
57 | }**
I am unable to figure out how to fix this error, any help would be appreciated
Failed to compile. Type error: Cannot find module '@jpmorganchase/perspective'. TS2307
Type error: Cannot find module '@finos/perspective'. TS2307
C:/Users/Vaisakh/JPMC-tech-task-3-PY3/src/App.tsx
Type error: Cannot find module '@finos/perspective'. TS2307
What should I do to solve this issue ?
Wrong Graph
error after clicking button
Anyone SuccessFul getting an Trigger Alert ?
Hello Guys,
Can anyone confirm with me that they have got a triggered alert on data ? I tried, it also depends on incoming data, but if anyone successful, can help me with it ?
Many thanks,
Mihir
JPMC-tech-task-3-PY3/src/DataManipulator.ts Type error: Type 'number' is not assignable to type '"number"'. TS2322 22 | 23 | return { > 24 | price_abc: priceABC, | ^ 25 | price_def: priceDEF, 26 | ratio, 27 | timestamp: serverResponds[0].timestamp > serverResponds[1].timestamp ?
How to remove the timestamp line and from Y-axis.
How to remove the timestamp line and from Y-axis.
Originally posted by @pooja2005 in #48 (comment)
SERVER DID NOT START after datafeed/server3.py + npm errror
TS2322
Type error: Type '{ price_abc: number; price_def: number; ratio: number; timestamp: Date; upper_bound: number; lower_bound: number; trigger_alert: number | undefined; }' is not assignable to type 'Row[]'.
Object literal may only specify known properties, and 'price_abc' does not exist in type 'Row[]'. TS2322
Type error: Property 'top_ask_price' does not exist on type 'ServerRespond'.
Anyone else getting this error? I thought that we were to remove any references to top_ask_price in Graph.tsx.
Issue on Server(graph not getting plotted)
'react-scripts' is not recognized as an internal or external command, operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR!
C:\Users\AppData\Roaming\npm-cache_logs\2020-06-22T23_17_23_719Z-debug.log
Server Misfunction
'Object literal may only specify known properties'
Hello,
I am currently getting the error:
"Type '{ price_abc: number; price_def: number; ratio: number; timestamp: Date; upper_bound: number; lower_bound: number; trigger_alert: number | undefined; }' is not assignable to type 'Row[]'.
Object literal may only specify known properties, and 'price_abc' does not exist in type 'Row[]'.ts(2322)"
in my generateRow() function.
I am not sure as to what could be causing this; my code is exactly the same as the code shown in the supplied pdf:
import { ServerRespond } from './DataStreamer';
export interface Row { // Match new schema
price_abc: number,
price_def: number,
ratio: number,
timestamp: Date,
upper_bound: number,
lower_bound: number,
trigger_alert: number | undefined,
}
export class DataManipulator { // Process raw data; define necessary return information
static generateRow(serverRespond: ServerRespond[]): Row[] {
const priceABC = (serverRespond[0].top_ask.price + serverRespond[0].top_bid.price) / 2;
const priceDEF = (serverRespond[1].top_ask.price + serverRespond[1].top_bid.price) / 2;
const ratio = priceABC / priceDEF;
const upperBound = 1 + 0.1;
const lowerBound = 1 - 0.1;
return {
price_abc: priceABC,
price_def: priceDEF,
ratio,
timestamp: serverRespond[0].timestamp > serverRespond[1].timestamp ?
serverRespond[0].timestamp : serverRespond[1].timestamp,
upper_bound: upperBound,
lower_bound: lowerBound,
trigger_alert: (ratio > upperBound || ratio < lowerBound) ? ratio: undefined,
};
}
}
ts 2322
C:/Users/GLOBAL/JPMC-tech-task-3-PY3/src/DataManipulator.ts
Type error: Type 'number | undefined' is not assignable to type 'number'.
Type 'undefined' is not assignable to type 'number'. TS2322
27 | upper_bound: upperBound,
28 | lower_bound: lowerBound,
29 | trigger_alert: (ratio > upperBound || ratio < lowerBound) ? ratio : undefined,
| ^
30 | };
31 | }
32 | }
Compiled Successful, but browser displays "The site can't be reached".
This is Task 3 of the JP Chase Virtual Internship. I have completed the tasks on my Windows OS. The command prompt window shows "Compiled Successfully" but the Chrome Browser display "The site can't be reached". Please help me out.
failed to compile : 'ServerRespond' is not exported from './DataStreamer'
Patch Size
I keep getting told my patch file is too large, but I only have what was asked of us. Does anyone have a solution?
npm start error
I get ratio in form of red line and no trigger occurs
Error when doing 'npm install' ... any ideas?
npm WARN tar ENOENT: no such file or directory, lstat '/home/andrew/Projects/JPMC-tech-task-3-PY3/node_modules/.staging/chalk-e3bf26b7/types'
npm WARN tar ENOENT: no such file or directory, open '/home/andrew/Projects/JPMC-tech-task-3-PY3/node_modules/.staging/postcss-18e8c038/lib/postcss.d.ts'
npm ERR! path /home/andrew/Projects/JPMC-tech-task-3-PY3/node_modules/.staging/supports-color-e4630f0b
npm ERR! code ENOSPC
npm ERR! errno -28
npm ERR! syscall mkdir
npm ERR! nospc ENOSPC: no space left on device, mkdir '/home/andrew/Projects/JPMC-tech-task-3-PY3/node_modules/.staging/supports-color-e4630f0b'
npm ERR! nospc There appears to be insufficient space on your system to finish.
npm ERR! nospc Clear up some disk space and try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/andrew/.npm/_logs/2020-07-04T06_00_36_071Z-debug.log
Sounds like a disk space problem but I am running a virtual machine (Xubuntu on Oracle VM VirtualBox) and have hardly any disk space used up.
npm not module not found
the npm is not getting installed .even checked for npm -v it also throws an error and the other commands-npm install and npm start also throw error.
Error in DataMaipulator.ts
After running the Node application after making all the changes this is the error I get:
./src/DataManipulator.ts
Attempted import error: 'ServerRespond' is not exported from './DataStreamer'.
Start streaming shows no data after making changes
client app failing to start in task 3
I have node v11.0.0 and npm v6.4.1.
when I tried to launch client app I am getting the following errors. I have also attached the log file
**'react-scripts' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\fatim\AppData\Roaming\npm-cache_logs\2019-11-05T18_01_07_085Z-debug.log
2019-11-05T18_01_07_085Z-debug.log
**
Type error: Cannot find name 'DataManipulator'. TS2304
Type error: Cannot find name 'DataManipulator'. TS2304
76 | if (this.table) {
77 | this.table.update([
78 | DataManipulator.generateRow(this.props.data),
| ^
79 | ]);
80 | }
81 | }
Can anyone help with this issue?
I really appreciate it!
Can we really add this to our resume?
Hi everyone I have completed all the tasks just want to ask that can we really add this to our resume?
Operator '+' cannot be applied to types 'Number' and 'Number'. TS2365
I have written this code on VSCode:
`import { ServerRespond } from './DataStreamer';
export interface Row {
price_abc: number,
price_def: number,
ratio: number,
timestamp: Date,
upper_bound: number,
lower_bound: number,
trigger_alert: number | undefined,
}
export class DataManipulator {
static generateRow(serverRespond: ServerRespond[]): Row {
const priceABC = (serverRespond[0].top_ask.price + serverRespond[0].top_bid.price) / 2;
const priceDEF = (serverRespond[1].top_ask.price + serverRespond[1].top_bid.price) / 2;
const ratio = priceABC / priceDEF;
const upperBound = 1 + 0.05;
const lowerBound = 1 - 0.05;
return {
price_abc: priceABC,
price_def: priceDEF,
ratio,
timestamp: serverRespond[0].timestamp > serverRespond[1].timestamp ?
serverRespond[0].timestamp : serverRespond[1].timestamp,
upper_bound: upperBound,
lower_bound: lowerBound,
trigger_alert: (ratio > upperBound || ratio < lowerBound) ? ratio : undefined,
}
}
}`
But the error comes out and saying this on the chrome browser:
Type error: Operator '+' cannot be applied to types 'Number' and 'Number'. TS2365
` 13 | export class DataManipulator {
14 | static generateRow(serverRespond: ServerRespond[]): Row {
15 | const priceABC = (serverRespond[0].top_ask.price + serverRespond[0].top_bid.price) / 2;
| ^
16 | const priceDEF = (serverRespond[1].top_ask.price + serverRespond[1].top_bid.price) / 2;
17 | const ratio = priceABC / priceDEF;
18 | const upperBound = 1 + 0.05;`
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.