jpmc-tech-task-1's People
Forkers
pennie-forage diptochakrabarty danielcarroll1650 jhan17 jamalnazar iasianah hoangdinh2710 wildaces215 andrewforage bcooprider gt3ch05 adeola-oni cedrikgaudreault kingashiru hplvr15 sean-broomfield mcendrd aizhan87 abid-siam mochibot farouk-afolabi sanatnayar xasno collins33 stefanosu mohsinmasrur sumaia45 rafidhossain1995 sharnajh sebastiandelima gaurjin panwalas nikhilnehra123 haardikdharma10 cabeedelhertz paras-jain vedang-t2s imgolash himanshu0404 othozer shaileshvns prabalgupta12 vsujeesh gunakarri dhirensambyal khushboop117 brijeshsos66 vivekgupta2017 codespaint abhinavkumargoswami im-sanyam lionelsamrat10 shubhamgoel90 plashaa akhanish7 jaswantcoder tanishapatil sudhiawasthi chaitanya642000 alankrithashekar pratikghose yashmukaty pradeep4041 briansjkim nakzz gshubham5 sahithi200 nishant1308 nandini2307 fullmetal786 kshitij031998 janunayak barbarajohnsonatx shipcy aashreyj sowmyasathu mtrawinska sauravkadian stephrose310 divyanshasharma tarunj096 chiragrajani rahul0902-ux robertvictoreen ratul-hans venkatnarasimha kumarikhushboo1607 lakshaysharma593 creativeyashi gauravthapa54 dzhai1999 shubhamkumar906 ashwinijha6 sangeetameena580 soummo19 codracker jonathaneugene rkrahulmishra887 skmishra-sys jumairamillerjpmc-tech-task-1's Issues
add -A Error
An error pops up when I am creating the patch file. After adding all the files to the repository it says: fatal: Not a git repository (or any of the parent directories): .git
Fixed the problem, never mind!
Test case is missing
Acceptance Criteria
getRatio function should return the ratio of the two stock prices
getDataPoint function should return correct tuple of stock name, bid_price, ask_price and price. Note: price of a stock = average of bid and ask
All unit tests inside client_tests.py have to pass
Add more unit tests to cover other edge cases
Upload a git patch file as the submission to this task
May I know is that the sample test cases are missing?
Can't create patch file
When i run git format-patch -1 HEAD
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
Phase 1 error
npm install error
there is no pakage.json to run " npm install " ? Am I missing something ?
server3.py , client3.py errors
Windows
Indentation error in task1 in main
Patch file not in zip file
unable to convert to patch file
showing fatal: not a git repository (or any parent up to mount point /home/runner
cant create a patch file
the command line:
git add -A
gives the fatal error below;
fatal: Not a git repository (or any of the parent directories): .git
Troubles Creating Patch File (Task 1)
Hello!
I finished the first task and the bonus as well. However, I followed the instructions on creating the patch file but it simply did not work. I did not get any error messages or anything. I ran the command, press enter, and nothing happened. I am working on a Windows operating system and I'm using Google Chrome. I am aware that after I ran "git commit -m 'Create Patch File'" it prints "Oh branch master nothing to commit, working tree clean". This was my third time trying to create the Patch File. The first time I had something that said "1 file changed, 1 insertion(+), 1 deletion(-)" like the instructions. I am not sure if this helps but I provided all the information I can!
Thank you
Module 1: prices with value 'DEF'
Can't find Patch file after moving it
Good evening. I am currently on Task 1 of the internship, and I just finished all the coding. Everything works, I made the patch file but it does not appear on the left side menu. I followed all the steps, so I don't know what is causing the issue. Help would be most appreciated.
Fatal: Not a git repository
Error message in main "KeyError: 'ABC'"
last line of main
I received this error:
Traceback (most recent call last):
File "client.py", line 50, in
print "Ratio %s" % getRatio(prices['ABC'], prices['DEF'
])
KeyError: 'ABC'
I am not exactly sure what the issue is. Thanks in advance for the help!
IndentationError
prices = {} causes an indentation error although I followed all the instructions properly.
python server.py syntax error
unable to create patch file even after following all instructions in module 1
server.py and client.py issues
While submitting the task,a message comes "overwrite"
As soon as I have completed the task,and I was about to submit the patch file a message comes showing"do you want to replace"and i clicked on replace....so will that cause any issue?and how do I get to know if my task 1 is correct or not?
Server.py Tech-task2
There is no server.py file in the Tech task 2 folder.
No Patch File created in jpm_module_1 folder
issue in creating the patch file (task-1)
Instance of 'ThreadedHTTPServer' has no 'start' and 'waitForThread' members
Hello,
Attached are screenshots of the errors I'm getting. I'm running python 2.7 in VS code editor. I have not added to or edited the code at all, I'm just trying to get the base cord working before starting on that.
I have no issues with the client.py file but its the server.py file causing issues.
Thanks for the help in advance.
Client Server file issues
C:\Users\Desktop\JPMC-tech-task-1>python server.py
File "server.py", line 217
print 'HTTP server started on port 8080'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('HTTP server started on port 8080')?
C:\Users\Desktop\JPMC-tech-task-1>python client.py
File "client.py", line 57
print "Quoted %s at (bid:%s, ask:%s, price:%s)" % (stock, bid_price, ask_price, price)
^
SyntaxError: invalid syntax
C:\Users\Desktop\JPMC-tech-task-1>python client.py
Traceback (most recent call last):
File "client.py", line 21, in
import urllib2
ModuleNotFoundError: No module named 'urllib2'
C:\Users\Mohan Singh Kataria\Desktop\Chetali\JPMC-tech-task-1>python server.py
Traceback (most recent call last):
File "server.py", line 21, in
from itertools import izip
ImportError: cannot import name 'izip' from 'itertools' (unknown location)
got the above errors while first time running the files in admin mode,Please help.
Thanks
using python version 3.7.4
using Windows 10 OS
IndentationError: unindent does not match any outer indentation level
import urllib2
import time
import json
import random
Server API URLs
QUERY = "http://localhost:8080/query?id={}"
500 server request
N = 500
def getDataPoint(quote):
""" Produce all of the needed values to generate a datapoint """
""" ------------- Update this function ------------- """
stock = quote['stock']
bid_price = float(quote['top_bid']['price'])
ask_price = float(quote['top_ask']['price'])
price = (bid_price + ask_price)/2
return stock, bid_price, ask_price, price
def getRatio(price_a, price_b):
if (price_b == 0):
return
return price_a/price_b
Main
if name == "main":
# Query the price once every N seconds.
for _ in xrange(N):
quotes = json.loads(urllib2.urlopen(QUERY.format(random.random())).read())
prices = {}
for quote in quotes:
stock, bid_price, ask_price, price = getDataPoint(quote)
prices[stock] = price
print "Quoted %s at (bid:%s, ask:%s, price:%s)" % (stock, bid_price, ask_price, price0
print "Ratio %s" % getRatio(prices['ABC'], prices['DEF'])
TypeError: 'float' object is not subscriptable
Different App.tsx
Unable to import izip from intertools
Unable to resolve KEY ERROR: 'DEF'
I have tried re-typing this line multiple times but I am unable to resolve the error below. I have exported my files and attached as a zip.
Thank you!
HTTP server started on port 8080
Quoted ABC at (bid:118.13, ask:116.63, price:117.38)
Traceback (most recent call last):
File "client.py", line 41, in
print "Ratio %s" % getRatio(prices['ABC'], prices['DEF'])
KeyError: 'DEF'
issue with 1st module for me: help!
Hope you can help with this. I tried uploading a picture. It said this: https://insidesherpa.s3.amazonaws.com/vinternships/companyassets/Sj7temL583QAYpHXD/repl_mod1_v4.pdf
JP Morgan Virtual Internship Task 1
Good day, I have not been able to run my code on repl because a FileNotFoundError as shown in the attached image keeps interfering. I use windows 10 OS and I am done with the task, I just need to verify the unit testing. I have tried it on Microsoft edge browser and chrome. Please look into this for me.
Cannot see patch file in Zip folder
Indentation error in task 1 (in #Main)
KeyError when running Main
Hey, been facing an issue when coding the last part of task 1, I always end up getting a KeyError: "DEF". I am unsure if I missed a step or if I did something incorrectly. Thanks for the help
I attached the code and the snip of the problem encountered if somebody has any idea where the problem could be? Thanks again
Main
if name == "main":
for _ in range(N):
quotes = json.loads(urllib.request.urlopen(QUERY.format(random.random())).read())
prices = {}
for quote in quotes:
stock, bid_price, ask_price, price = getDataPoint(quote)
prices[stock] = price
print ("Quoted %s at (bid:%s, ask:%s, price:%s)" % (stock, bid_price, ask_price, price))
print ("Ratio %s" % (getRatio(prices['ABC'],prices['DEF'])))
Patch File Folder Move
The first time I accomplished the task I went to match the patch file, the patch file was visible in my folder tab before the mv command. I saw the patch file but I followed the instructions so when I typed the mv command, the patch file disappeared from the file tab and I didn't know where to look for it. I did it again and stopped before that step but can someone explain why this happened? It wasn't in the module file or the git file.
indentationError
for quote in quotes:
is giving me indentation error
indentationerror: unindent does not match any outer indetation level
creating patch file error
Hi
I have complered the JPMC task 1 however when creating my patch file I am frequently met with the same error message fatal: not a git repository (or any parent up to mount point /home/runner)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)
how do I fix this?
Thanks for any help
Indent errors
my final cmd command mv<filename> was executed perfectly with no errors but I did not get a patch folder on the left hand side
Issue
When I entered in the directions for python3 as followed I got the following error
File "client3.py", line 58, in <module>
print ("Ratio %s" % (getRatio(prices['ABC'], prices['DEF'])))
NameError: name 'prices' is not defined ```
I then tried to search for the "prices" method/function and it's not there.
Then I tried to access the price function, I get the following error.
```Traceback (most recent call last):
File "client3.py", line 58, in <module>
print ("Ratio %s" % (getRatio(price['ABC'], price['DEF'])))
TypeError: 'float' object is not subscriptable```
When I try to create a git patch file, it says that it is not a git repository
runner@9400d4b74689:~/JPM-MODULE1-PY3-REPL-2/jpm_module_1$ git add -A
fatal: not a git repository (or any parent up to mount point /home/runner)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).```
Issue creating a Patch File
Hello Support,
My name is Bertram and i am currently in your insidesherpa JP Morgan Virtual Internship Software Engineering program and i am currently having issue with creating a patch file as the last task for module 1. I tried following all the steps to create one but i kept receiving the following error. runner@a302c561e5f6:~$ /jpm_module_1
bash: /jpm_module_1: No such file or directory
Please can you be of assistance in explaining to me me where i went wrong?
Patch file missing information
Hello, my patch file is missing some information. Most of the getDataPoint function is not showing specifically where I coded to get the average price. It then jumps to the getRatio function. When opening the patch file on console it shows missing information about the getDataPoint when I have actually completed it and ran the task with no errors. There is also a section of unknown illegible text in the patch file. I have attached images.
Thanks!
KeyError: 'ABC'
Main
if name == "main":
for _ in range(N):
quotes = json.loads(urllib.request.urlopen(QUERY.format(random.random())).read())
prices = {}
for quote in quotes:
stock, bid_price, ask_price, price = getDataPoint(quote)
print ("Quoted %s at (bid:%s, ask:%s, price:%s)" % (stock, bid_price, ask_price, price))
print ("Ratio %s" % getRatio(prices['ABC'], prices['DEF']))
I'm not sure what the problem is but I run into the KeyError: 'ABC'
Creating patch file Issue
After I create my patch file, I am unable to download as zip. When I click the button, nothing happens
Not a git repository
application not running
Error message when I try to run "python client.py"
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.