Git Product home page Git Product logo

jpmc-tech-task-1's People

Contributors

andrewforage avatar insidesherpa avatar jbf-insidesherpa avatar juliusarden avatar pennie-forage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jpmc-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

I fixed the indentation in the main in client.py but it is still giving me the same error. I am pretty sure I fixed the indentation and I followed the instructions, so I am not sure what the issue is. Thank you!

jpmorganphase1

npm install error

there is no pakage.json to run " npm install " ? Am I missing something ?

server3.py , client3.py errors

I was in the middle of doing client_test.py then I got disconnected due to poor internet connection. After reloading the page, I did the initialization steps (the one that you set up your email/name etc.) and I don't know what's the next thing to do.

image

Windows

I am using Windows 10, after downloading python 3.8 and pip for python 3, i get this message in the final steps
22
33

Patch file not in zip file

Hi,
I completed task 1 (with the bonus) and after downloading the zip file and unzipping it, I couldn't find the patch file... any ideas on how I can fix this / where they might be? I looked in the jpm_module_1 folder and it wasn't there either
Some images below
displaying_in_repl
Folder_created

inside_folder

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

PatchIssue

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

Hi, I'm getting this error when I get to the "git add -A" step of creating a patch file.

I did the setup and initializing steps at the beginning, and I'm using a Repl.it via Firefox on a Windows 10 PC.
Screenshot 1

Error message in main "KeyError: 'ABC'"

I am using the Repl.it platform for task one and am on chrome (Windows OS). When I try to run the program by clicking the 'start' button, I see the following error on the console. I am not sure why this is giving me an error as I followed the instructions on the docs. Thank you!

Capture

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

Attempting to run the python server.py, but there is a syntax error. I followed all of the previous steps and even tried to install pip, but had trouble with the easy_install. (Some screenshots below)
Screen Shot 2019-10-21 at 7 29 11 PM
Screen Shot 2019-10-21 at 7 32 23 PM

Please help!

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?

issue in creating the patch file (task-1)

When I run the mv 001-Create-Patch-File.patch ../. I do not see the patch file in my files
sidebar, instead there is a folder named 'git' created in my files sidebar. There is no error in the code. I don't know where to find the patch file, please help.
jp

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.

Screen Shot 2019-10-28 at 12 26 00 PM

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'])

Error

Unable to import izip from intertools

I have already set up the environment with cmd and git bash(app), but I couldn't run the server.py file. first issue was missing parenthesis which I fix it and the second one is unable to import izip from intertools.
I attached the screenshots. Thank you
1
2

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'

FairUnripeAcrobat.zip

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.
Screenshot (108)

Indentation error in task 1 (in #Main)

Img1

The above link contains the screenshot.
OS is Windows 10, Browser is Google Chrome. The task is being done online on Repl.it
I am unable to proceed due to the indentation error

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'])))

image

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

Everytime I try to alter the code under getRatio I get indentation errors. I've checked and rechecked and have no clue what I'm doing wrong. See screen shot.
10-22-2019 3-24-04 PM

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!

Screen Shot 2020-04-12 at 4 13 25 PM

Screen Shot 2020-04-12 at 4 13 30 PM

Screen Shot 2020-04-12 at 4 13 38 PM

Screen Shot 2020-04-12 at 4 13 48 PM

Screen Shot 2020-04-12 at 4 14 23 PM

Screen Shot 2020-04-12 at 4 14 55 PM

Screen Shot 2020-04-12 at 4 20 58 PM

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'

JPMCT1

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

I'm trying to create a patch file for problem 1 but keep getting this fatal message when I type the git add -A. Can I get some help please.

git jpmorgan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.