(CS50) FINANCE - PROBLEM SET 9 | SOLUTION

Поділитися
Вставка
  • Опубліковано 10 лис 2024

КОМЕНТАРІ • 257

  • @DorsCodingSchool
    @DorsCodingSchool  Рік тому

    👨‍💻 Learn How to Code with Private Classes - www.dorscodingschool.com/coachingplans
    ❓Having a hard time with CS50, FreeCodeCamp or Odin Project? Practice with our exclusive free coding platform: www.codingdors.com/
    🎯 Are You A Coding Expert? Take Our Free Quiz and Find Out - www.dorscodingschool.com/quiz

  • @vitorsiqueira3257
    @vitorsiqueira3257 2 роки тому +14

    I'm just here to comment that, in my case, everything you did worked in my codes. Thanks for the video, it helps me a lot!!!

  • @420sakura1
    @420sakura1 2 роки тому +18

    Quote: 32:25
    Sell : 1:10:07
    History: 1:23:52

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому +1

      Thank you for adding the timestamp, we appreciate it!

    • @MohammedSalah2405
      @MohammedSalah2405 2 роки тому +8

      @@DorsCodingSchool Please add chapters , it's a crucial thing in a very long video like this. Sometimes we miss something in the code and it's ultimately difficult to check it's place in the video. Appreciate it

  • @LK90512
    @LK90512 2 роки тому +15

    I think there might be an issue with the index function. In your implementation you retrieve the price of the stocks from the transactions table, but that's the fixed price at which the stock was traded. You should instead send api request to the provider to retrieve the current prices for your stocks to keep the value of the portfolio up to date.
    Apart from that the tutorial is very useful and beginner friendly, thank you very much!

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому +6

      Thank you for the message! We'll take a look!
      By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 2 hours of group coaching every week!
      Check www.dorscodingschool.com/products

    • @Pablin6114
      @Pablin6114 2 роки тому +1

      @@DorsCodingSchool How can I join the telegram group? I would be very interested in that

    • @jamarwilson3592
      @jamarwilson3592 2 роки тому +3

      I see this and am trying to understand how to request the provider to get current prices. Do you have the solution by anychance?

  • @qianwang8639
    @qianwang8639 2 роки тому +5

    At your index page, the PRICE is the prices of the stocks when you made the purchase, but I think it should be the current price of the stocks, so you shouldn't pull out the price from transaction table.

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому +2

      Thank you for the hint. We will take a look!
      By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 2 hours of group coaching every week!
      Check www.dorscodingschool.com/products

    • @jamarwilson3592
      @jamarwilson3592 2 роки тому +2

      So what do you actually do?

    • @penteronto
      @penteronto Рік тому +3

      @@jamarwilson3592You can make a dictionary in index() that has key of the stock symbol and value of the lookup function for that symbol(you can use dict comprehension to achieve this easily). It will work because lookup(symbol) will always return a current price since it connects with the stocks website via given API. After you completed the dictionary of prices you can use it in jinja for loop. There are probably better ways to do this but this works as promised but it's kinda slow. Hope that helps for your or anybody interested.

  • @chandlercampbell6389
    @chandlercampbell6389 Рік тому +6

    Thanks for these videos! I watched other youtubers but your videos are the best!

  • @kevinli2144
    @kevinli2144 2 роки тому +12

    clearest explanations on youtube, and the animations are amazing! keep it up!

  • @bogdankikriev3120
    @bogdankikriev3120 Рік тому +4

    I don't understand where you got the phpLiteAdmin. The cs50 codespace where you're supposed to code doesn't allow that nor is there anything resembling that. Do I have to have that or no?

    • @Fighter-ls8lt
      @Fighter-ls8lt Рік тому

      did you find a way how to use that?

    • @mikeymcdoo1778
      @mikeymcdoo1778 11 місяців тому +4

      You need to click on the database and click ‘load anyway’ phplite admin is one of the options

  • @FranklynAgbeko
    @FranklynAgbeko 3 місяці тому +2

    just a quick question why do you choose to use "Get" instead of "Post" as the specification was explicit to Submit the user’s input via POST to /register. in any case, your videos are very much on point thanks for sharing

    • @DorsCodingSchool
      @DorsCodingSchool  3 місяці тому

      You should use GET to display the register form in the screen and POST to handle the data from the form and insert in the database

    • @ercarltz2737
      @ercarltz2737 2 місяці тому

      Man can you help me with the IEX Cloud registration, how can i registrer there

  • @ahmedfernandez4695
    @ahmedfernandez4695 11 місяців тому +1

    Thank you so much Giovanna. Helped me a lot to get through the different requirements. This was a tough one.

  • @avarmauk
    @avarmauk Рік тому +1

    For the index page. I belive you are supposed to
    a) use current prices of the stock
    b) calculate the grand total (cash + sum of all the in order to calculate the portfolio value.
    I was able to do a). But I just could not get b) to work.

  • @Seefight111
    @Seefight111 2 роки тому +2

    Best programming channel I've ever seen

  • @aylinhajiyeva1406
    @aylinhajiyeva1406 Рік тому +2

    Thank you for this amazing video, have been stuck in this task for days going crazy over the errors. This was very helpful thank you very much, saved my life fr. Keep it going love your videos!!!!! :))))

  • @ercarltz2737
    @ercarltz2737 2 місяці тому +2

    2024. I have a problem with the API key. The register page of IEX cloud simply dont load!!!

  • @fazliddinfayziev-qg1vg
    @fazliddinfayziev-qg1vg 10 місяців тому +1

    Thank you dear sister, it is so amazing tutorial. I liked it so much. Everything is smooth and easy to understand. Thank you. )

  • @momenTheDev
    @momenTheDev Рік тому +2

    Great video and explanation. How did you use phpliteadmin inside vscode?

  • @faariswheel5673
    @faariswheel5673 4 місяці тому +1

    When I run check it says
    :( buy handles valid purchase
    application raised an exception (see the log for more details)
    Do you know where I went wrong?

  • @meronmichael3682
    @meronmichael3682 Рік тому +3

    thank you so much for the content sister. everything is so smooth and clear. i encourage you to do this stuff more.

  • @shaikhshaji
    @shaikhshaji Рік тому +2

    Thanks a lot, there were many things that was not getting clear to me, but your tutorial really helped me. I wish you bright future ahead as you have developed really good skills . and thanks once again.

  • @abbhilashsimanchalam7058
    @abbhilashsimanchalam7058 7 місяців тому +1

    Thank you❤️…You’re God Sent🎊🙏🏽

  • @anujvishwakarma4897
    @anujvishwakarma4897 11 місяців тому

    thank you very much this assignment was very challenging but you explained it in a very easy way

  • @markmeredith2039
    @markmeredith2039 Рік тому

    Great explanations. I am not seeing the $ before the dollar amounts. What am I missing in the code?

  • @jk-fy8on
    @jk-fy8on Рік тому +1

    Thank you so much!

  • @kartikyadav5704
    @kartikyadav5704 Рік тому +4

    39:46 Is it necessary to create the table like you have done, as this is not like that in VS Code...

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому +5

      You can create the same way. Just need to double click the file finance.db and click the hyperlink

    • @tanaysethi18
      @tanaysethi18 Місяць тому

      @@DorsCodingSchool it doesnt work for me

    • @A-Karim2003
      @A-Karim2003 Місяць тому

      @@tanaysethi18 i just typed the sql querie inside the command line.
      you don't need to use the website.

  • @mohammed2005-m1h
    @mohammed2005-m1h Рік тому +1

    I realy like your exeplanation

  • @gregoryeng7449
    @gregoryeng7449 Рік тому +1

    Does this code actually update the stock values after they've been bought?

  • @botanicear64511
    @botanicear64511 3 місяці тому +1

    Do we not need an API key anymore? Could you please explain why im kinda confused. Much thanks

    • @armyforever9607
      @armyforever9607 18 днів тому

      Same, but do we need to use the API key in 2024?

  • @DorsCodingSchool
    @DorsCodingSchool  2 роки тому +24

    In the SQL at 1:21:00, it should be "SELECT SUM(shares) AS shares FROM transactions WHERE user_id=:id AND symbol = :symbol" instead of "SELECT shares FROM transactions WHERE user_id=:id AND symbol = :symbol GROUP BY symbol"

    • @GigglingGumba
      @GigglingGumba 2 роки тому +5

      But
      ("SELECT SUM(shares) AS shares FROM transactions WHERE user_id = ? AND symbol = ?", user_id, symbol)
      is correct, too? I am not quite sure with user_id = [...] user_id.

    • @RavenTech1
      @RavenTech1 2 роки тому

      Thank you

  • @smokeybacon8308
    @smokeybacon8308 Рік тому +2

    What is phpliteadmin and do you need it to pass the pset??

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      It's the file where you store your database. You need it to pass :)
      We’d love to help you more. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @NuraUmaAnnisa
    @NuraUmaAnnisa Рік тому +1

    you're so amazing. I failed at finance..

  • @delyanakirilova515
    @delyanakirilova515 Рік тому +1

    Hi! This may be a silly question, but can you please tell me where you implement the value of the symbol in the table that shows Netflix? Thanks

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      To display the value of a variable in HTML, you should use:
      {{ var }}
      If you want our help, you can join our Free Discord Community: www.dorscodingschool.com/discord

  • @SirMika9
    @SirMika9 Рік тому +3

    In the register section, how does your try except prevent to encode multiple times the same username ? There is nothing that block encoding multiple times the same username as you don't check for an already existing one in the database. You can encode lot of same username if you want.

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      We’d love to help you more. Did you know you can join our Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

    • @SirMika9
      @SirMika9 Рік тому +3

      @@DorsCodingSchool why would I join anything if you don't answer when I point an error ?

    • @A-Karim2003
      @A-Karim2003 Місяць тому

      @@SirMika9 lol. what did you end up doing after cs50

    • @SirMika9
      @SirMika9 Місяць тому

      @@A-Karim2003 Oh a lot ! I did a one year course IRL on web development, and then after I specialized in C#/.NET, and now I quit programming cause there is no hope to find a job as as a junior. Almost 2 years lost, cool.

  • @Nikolaospts
    @Nikolaospts 8 місяців тому

    Thank you Gio for this video, great job keep it up!
    Your video was very helpful to me!😁

  • @needmango
    @needmango 2 роки тому +1

    Quick question: How did you get user_id in the transactions table to match id in the users table?

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      You should use the sessions["user_id"].
      By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month!
      Check www.dorscodingschool.com/products

  • @mitchellmunar5189
    @mitchellmunar5189 Рік тому +1

    I have an error trying to get a quote. Any symbol I enter outputs none and so it shows as invalid

  • @hikmataudi
    @hikmataudi 8 місяців тому +1

    best in the west
    thank you

  • @isabelamotta4702
    @isabelamotta4702 2 роки тому +3

    Thank you for your video! It's great!
    I have a problem when I'm testing with CS50 buy fails to pass the fractions, negative and non-numeric check.
    Can anyone help me?

    • @novedekne
      @novedekne Рік тому

      I had the same issue. I tried doing the basic "if shares < 0 approach", and when checking the log for the error it said "exception raised in application: ValueError: invalid literal for int() with base 10: '1.5'"
      I think this is because of how int treats special characters, in this case the decimal point. I ended up getting past the issue with a try catch. It tries to run the the function with shares but if it catches anything funky it throws a 404. It's probably too late for you, but hopefully this comment helps someone else in our position.

    • @MohMoh-mo9ys
      @MohMoh-mo9ys 10 місяців тому

      @@novedekne Thanks for this comment. I stack with this errors for days and your comments finally help me.

  • @lucasbraga1230
    @lucasbraga1230 18 днів тому

    thank you so much!

  • @janicevilela2062
    @janicevilela2062 6 місяців тому +1

    Muito obrigada!!!! Ajudou demais!

  • @alaatarek3983
    @alaatarek3983 Рік тому

    hi, thank you for the great explaining , but when i run flask run in my turminal window it give me a bug says that it is in use with another program i tried to close the web-page and clear my window and run again with the same bug, how can ifix this bug?

  • @ChengHorn9
    @ChengHorn9 2 роки тому +1

    Maybe I missed it, but shouldn't /index show the current value of each holding = shares * price? I didn't see this implemented in the video.

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      Yes, you're right! We added a fixed comment on how you can solve it :)

    • @ChengHorn9
      @ChengHorn9 2 роки тому +1

      @@DorsCodingSchool where is this comment?

  • @youssefsadiki2504
    @youssefsadiki2504 Рік тому +1

    i have a problem with the lookup function. it keep showing me (symbol does not exists ) when i quote NFLX. any help ?

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      We’d love to help you more. Did you know you can join our Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @omarbarba4634
    @omarbarba4634 Рік тому

    very complete, very well explained, i thank you so much !

  • @bryanvbomba1725
    @bryanvbomba1725 Рік тому +1

    how do i get the name of the stock/symbol in portfolio, for example under symbol we get NFLX and i want a row with name that gives Netflix Inc? and how do i add the cash in portfolio cus for now we have only total.

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      We’d love to help you more, I believe in here it might be complicated to help because your question is a bit complex. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @abdullahabdel-khalek8356
    @abdullahabdel-khalek8356 2 роки тому +2

    One of the best videos out there, surely helped a lot. But I have a big problem!! The sell actually makes me buy more shares :( can anyone help?

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      Are you subtracting the number of shares in your sell route? By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month!
      Check www.dorscodingschool.com/products

  • @Denise_travel
    @Denise_travel Рік тому +1

    THANK YOU SO MUCH!!!!

  • @lucyjohns8694
    @lucyjohns8694 Рік тому +2

    Everything seem to be working fine but when I try to check with check50, it says "exception raised in application: ValueError: invalid literal for int() with base 10: '1.5' ", do you know how I should fix this?

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      The problem is that you need to convert your shares into an int and check if that's not an integer before you continue your code.
      We’d love to help you more. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

    • @lucyjohns8694
      @lucyjohns8694 Рік тому

      @@DorsCodingSchool I did set "shares = int(request.form.get("shares"))". Also I tried to enter 1.5 on the buy page, it will have a little notification say "Enter a valid value" just like the sample page CS50 provided. Really confused on what could be the issue here.

    • @DarkkneZPanda
      @DarkkneZPanda Рік тому +2

      @@lucyjohns8694 Hey yo, I also just had this error and was able to fix it. The thing when inserting nothing in an integer it takes it as a Value Error , in this case when leaving blank the shares in either buy or sell, therefore what you can do is a try and except method and doing what you want afterwards.

    • @lucyjohns8694
      @lucyjohns8694 Рік тому

      @@DarkkneZPanda Thank you for sharing!

  • @mlungisimcira2170
    @mlungisimcira2170 Рік тому +2

    Getting error message under quote, code is unable to pick up symbols, getting 400 "Must provide Symbol" error message, please help

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      Are you getting the symbol from html and checking if exists in your app.py?
      We’d love to help you more. Did you know you can join our Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @ericzheng4815
    @ericzheng4815 2 роки тому +1

    But the index page should print out current_price, insead of the price recorded in transaction.db right?

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      You're right. It should print out the current price. By the time we didn't notice that :/
      Thank you for your message!

    • @ericzheng4815
      @ericzheng4815 2 роки тому

      @@DorsCodingSchool Good to know. Thanks!

  • @Iliketotry
    @Iliketotry Рік тому +1

    Hi! I have a question 🙋 when executing the flask run it gives me this error "WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead." what should I do?

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому +1

      If you want, you can join our Free Discord Community: www.dorscodingschool.com/discord

  • @davidwds
    @davidwds Рік тому +1

    how do you open phpliteadmin?

  • @erfan_devsol2002
    @erfan_devsol2002 Рік тому +1

    Thank you for this video, it's so useful.🙏🙏🙏

  • @hv6411
    @hv6411 Рік тому +1

    TY So much Gio, this was so helpful for me.

  • @sarathabeysirigunawardena977

    when click "Register" I get a massage "internal error" instead " TODO 405" saying "jinja2 exemption template not found:Register. html. So I cannot proceed as i do not get screen "sell buy ...." "log out" How can I correct this please.

  • @studioinfinitys
    @studioinfinitys 2 роки тому +1

    at 41:47 , can u pls explain how you have got user id just by sessions[" user_id "]--- but in /login route they have got user id by executing db command. so are you using this " sessions[" user_id "] ".

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому +1

      We are using sessions, that was set in the login route

  • @zaheer25
    @zaheer25 2 роки тому +1

    Thank you so much for all of this effort. Your explanations and videos have been getting better with each pset.
    Can you please explain the purpose of line 242
    user_shares_real = user_shares[0][“shares”]
    Thanks

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому +2

      To get exactly the number of shares, because the db will return you a dictionary with key "shares" and value of how many shares you have

    • @zaheer25
      @zaheer25 2 роки тому

      @@DorsCodingSchool I think I understand. Would you get the same answer by changing your SQL code to: ("SELECT SUM(shares) FROM transactions WHERE user_id=? AND symbol=?", user_id, symbol) and then eliminating the second line? I understand that there are many ways to solve the same problem but if the answer is the same then I think I understand the code. Thanks for replying

    • @zaheer25
      @zaheer25 2 роки тому

      oh wait, i ran it in sqlite3 and i get the answer like this:
      ________
      shares
      ________
      4
      ________
      So are we saying that I need the first result of this (0) where the title is "shares"?

  • @onyedikachiobileke4435
    @onyedikachiobileke4435 Рік тому +1

    Hi after i was done implementing the buy route, i get an error saying jsonify is not defined...why that?

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому +1

      You should import the jsonify library at the top of your code. You can do that by adding:
      from flask import jsonify

    • @onyedikachiobileke4435
      @onyedikachiobileke4435 Рік тому

      @@DorsCodingSchool Thanks

  • @tubaaqeel7389
    @tubaaqeel7389 2 роки тому +2

    Why in this problem we got an error after check50
    Which is excepted to find 112.00 in page but it wasn't found
    What's that mean and how to solve this 🤔

    • @DarkkneZPanda
      @DarkkneZPanda Рік тому

      hey yo, I'm having the same problem. Were you able to find the solution?

    • @gerardbrouwer2581
      @gerardbrouwer2581 Рік тому

      @@DarkkneZPanda did you find it?

  • @anviagrawal5754
    @anviagrawal5754 Рік тому +2

    hi, for /buy. I keep getting an error
    exception raised in application: TypeError: 'int' object is not subscriptable
    but I don't know what this means or how to solve it. Can someone help? Thank you!!

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому +1

      If you check our solution on GitHub we fixed this issue! You have to do a try/except block ☺️

    • @onyedikachiobileke4435
      @onyedikachiobileke4435 Рік тому +2

      @@DorsCodingSchool how do i get the solution on github?

  • @nirvana7827
    @nirvana7827 2 роки тому +2

    Thank you so much, this was a great video

  • @aandresriera7927
    @aandresriera7927 2 роки тому +1

    greatly explained great content!!

  • @GuguG47
    @GuguG47 2 роки тому

    In this video you are not returning apology when user does not select symbol in sell section?

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      Yes, you should return apology if the user doesn't select a symbol

  • @kermicherofaida4742
    @kermicherofaida4742 Рік тому +1

    in the index section how to do the total not the total of the table I mean the total = cash + totals

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      We’d love to help you more. Did you know you can join our Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @aaronjpark
    @aaronjpark 2 роки тому +2

    how do i open the phpadmin tab

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      You should click the DB file and it will open up the phpadmin for you (:
      By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 2 hours of group coaching every week!
      Check www.dorscodingschool.com/products

  • @conservativestrawman9837
    @conservativestrawman9837 2 роки тому +1

    Deleted the project at the very end for the 3rd time now. please explain how you implemented the two places past the decimal where it shows monetary value on any part of the webpage.

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      You should implement USD() every time you're adding prices to your transactions table. Don't use the USD() when adding cash to your users table. For example, price=usd(price).

    • @dire8955
      @dire8955 2 роки тому

      did you figure it out?

  • @pouyakhosravi1995
    @pouyakhosravi1995 Рік тому +1

    CREATE TABLE transactions (user_id AUTOINCREMENT NOT NULL, symbol TEXT, shares INTEGER, price INTEGER, date DATE);
    What is the problem in this query?

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      We’d love to help you more. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @GabrielRodriguez-du7bn
    @GabrielRodriguez-du7bn 2 роки тому +1

    why are you using GET method in sell?

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      Because you have to display the screen that the user will sell his items. Otherwise, you're not able to show the form in your page.

  • @vitorsiqueira3257
    @vitorsiqueira3257 2 роки тому +3

    Are u from Brazil?

  • @builder481
    @builder481 2 роки тому +1

    Any advice on how can i become an amazing programmer like you? How many years did it took you to be this good?

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому +1

      Thank you! I recommend you to do CS50 and CS50 Web to learn how to code. I started to learn how to code in 2020 and I feel pretty familiar with the concepts because of these two courses (:
      By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month!
      Check www.dorscodingschool.com/products

  • @bruno-d2r
    @bruno-d2r 4 місяці тому

    oi Geovana tudo bem?, por favor me ajude, nao estou conseguindo solucionar esse problema

  • @Zeyz607
    @Zeyz607 2 роки тому +1

    In my database, the date shows hours, minutes, and seconds also, how can I ignore them and just show the date?

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      It depends on what type you're using to store date and how are you receiving the current date.

  • @jonassos4049
    @jonassos4049 2 роки тому +1

    What am i supposed to do in 40:04 ? I am in the new environment in VS Code and i cant code a new table

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому +1

      You should double-click your finance.db and then you're able to create a new table. By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month!
      Check www.dorscodingschool.com/products

  • @mohitsharma-ep9iy
    @mohitsharma-ep9iy 2 роки тому +1

    why you multiplied (-1) to shares in the sql statement

  • @5194rodrigo
    @5194rodrigo 2 роки тому +1

    "exception raised in application: TypeError: unsupported format string passed to Undefined.__format__ "
    I get this error and can't find out whta is causing it!!! any help?

    • @5194rodrigo
      @5194rodrigo 2 роки тому +1

      it's in the buy part

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      This error message is too open. We are able to help you if we see your code and what you did.
      If you want, you can join our Discord Community :)
      Check out: www.dorscodingschool.com/discord

  • @ЛюбовьБосикова-с6р

    is it possible to download a phpliteadmin in ps code???

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      We’d love to help you more. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @vlogs_by_matthew
    @vlogs_by_matthew Рік тому

    When I compile the code I have this error showing like buy handles valid purchase expected to find ‘112.00’ in page but it wasn’t found any idea??

    • @vlogs_by_matthew
      @vlogs_by_matthew Рік тому

      I got it now it’s asking me to include placeholder for shares and symbol and price in flask both bought and sold

    • @emilmedzhidov2884
      @emilmedzhidov2884 Рік тому

      @@vlogs_by_matthew how did you resolve the 112.00 problem?

  • @ismailsevimli6424
    @ismailsevimli6424 Рік тому +1

    Why am I getting Error Forwarding port :(( when I flask run the code

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      We’d love to help you more. Did you know you can join our Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

  • @CodingWithShou
    @CodingWithShou 2 роки тому +1

    this video is good but should remain it is need to use inside usd() function

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      Thanks for your message, we will fix this problem!

    • @dire8955
      @dire8955 2 роки тому +1

      can you explain?

  • @pakteam1304
    @pakteam1304 Рік тому +1

    i am facing a problem login it show error what part should i fix

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      If you want our help, you can join our Free Discord Community: www.dorscodingschool.com/discord

  • @alaatarek3983
    @alaatarek3983 Рік тому

    can any one help i tried my account and it always show the message of the username or password is invalid

  • @mustafejama7491
    @mustafejama7491 2 роки тому +1

    Tried to run mine but there's "Attributes Error: SQL object has no attributes execute" in 55:00 . Any help would be appreciated 🙂

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      Do you have "db = SQL("sqlite:///finance.db")" in your code? It should be around line 37.

    • @mustafejama7491
      @mustafejama7491 2 роки тому

      @@DorsCodingSchool I have that in line 27

  • @artur2.043
    @artur2.043 2 роки тому +3

    at 42:27 gio says you can do id = ? or id = :id. I received a runtime error when I used id = ? so for future reference use the :id to avoid bugs :) hope this helps someone!

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому +2

      Did you add the variable that holds the id after the sql command?

    • @jqts6490
      @jqts6490 Рік тому

      Same here. Said I had more values that ? for that was here is my code:
      userCashDb = db.execute("SELECT cash FROM users WHERE id = (?)", id=user_id)

  • @sarahcruz7352
    @sarahcruz7352 Рік тому +1

    At 32:50 does anyone else have a > appear after each line as well? Does anyone know why that is and how it can be fixed?
    Edit: Does anyone else fail about half of the tasks when running check50?

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому +1

      Our GitHub contains the correct implementation to pass all the tests :) You can find it at dorscodingschool.com/ebook

    • @sarahcruz7352
      @sarahcruz7352 Рік тому

      @Dors Coding School I tried doing that last week, but I never received a confirmation email.

  • @alaatarek3983
    @alaatarek3983 Рік тому

    shall I login with my real account

  • @onyedikachiobileke4435
    @onyedikachiobileke4435 Рік тому

    Any idea why this happened when i ran check50......😦 quote handles valid ticker symbol
    expected to find "28.00" in page, but it wasn't found

  • @JacobMcDaniels-j4y
    @JacobMcDaniels-j4y 10 місяців тому

    Can someone help me understand why uptd_cash was used and then not defined later?

  • @onyedikachiobileke4435
    @onyedikachiobileke4435 Рік тому

    How can this bug be fixed? :( buy handles fractional, negative, and non-numeric shares
    application raised an exception (see the log for more details)

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      We’d love to help you more. Did you know you can join our Free Discord Group and get help from me and from people around the world that are also learning how to code? dorscodingschool.com/discord

    • @onyedikachiobileke4435
      @onyedikachiobileke4435 Рік тому +1

      @@DorsCodingSchool You could just put me through right here lol

  • @Daniel_Li_777
    @Daniel_Li_777 Рік тому +1

    Can you send the solution for the helpers.py and styles.css? I don't see it

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому

      We didn't change helpers.py and styles.css when we were coding ;)

  • @HaiNguyen-tg5nk
    @HaiNguyen-tg5nk 2 роки тому +1

    I dont know what the syntax id = :id mean what is that different from "?" 1:21:23

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому +1

      Both syntax are the same ;) You can select what you prefer!
      By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month!
      Check www.dorscodingschool.com/products

  • @dhruvrastogi4717
    @dhruvrastogi4717 8 місяців тому

    check50 is not getting through

  • @glauberamdg
    @glauberamdg Рік тому +1

    You’re from Brazil, right? Your accent reminds me of brazillans’.

  • @jqts6490
    @jqts6490 Рік тому +1

    jsonify() does not work for me:
    NameError: name 'jsonify' is not defined
    So I just printed it and checked that way

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому +1

      Great. If you want to use jsonify you need to import at the top of the code :)

  • @eswar-fq6ru
    @eswar-fq6ru 5 місяців тому

    hlo please help me i am stuck at week 9 finance only due to non availability of api keys the iex site is removed in 2024 due to the major update in course and dont know how to get an api key please help @ Dors Coding School

    • @DorsCodingSchool
      @DorsCodingSchool  5 місяців тому +1

      You don’t need the API key anymore. In their requirements they explain all the steps you should take :)

    • @eswar-fq6ru
      @eswar-fq6ru 5 місяців тому

      @@DorsCodingSchool please i couldnt find myself please do help me

  • @code-with-marcus
    @code-with-marcus Рік тому +1

    Hello, pls i don't know if anyone can help me with this. On 1:16:34 when i entered "flask run" it's telling me "API_KEY not set". please what should i do ?

    • @DorsCodingSchool
      @DorsCodingSchool  Рік тому +1

      Every time you're working with your project you have to put your api key before running flask. You should follow the "Background" section at cs50.harvard.edu/x/2023/psets/9/finance/

    • @code-with-marcus
      @code-with-marcus Рік тому

      @@DorsCodingSchool thanks so much 😊, I was just focused on getting it done and I’ve forgotten about getting the API Token. Thanks so much

  • @Vanessa-pf6eu
    @Vanessa-pf6eu 2 роки тому +1

    Can anyone help me? I got an error message with the db.execute("INSERT INTO transactions (user_id, symbol, shares, price, date) VALUES (?, ?, ?, ?, ?)", user_id, symbol, shares, price, date) the error says: "price" is not defined
    I created a table in the database and all the other values seem to be working just fine. I tried to change the data type to Numeric, Float, and Real but this error keeps showing up

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      Do you have a variable in app.py called price?
      By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month!
      Check www.dorscodingschool.com/products

    • @Vanessa-pf6eu
      @Vanessa-pf6eu 2 роки тому

      @@DorsCodingSchool I do not. I also tried using another name for the DB column, but the problem persists

  • @giulianaambrosino7944
    @giulianaambrosino7944 2 роки тому +1

    The code gives me two errors :(
    "registering user succeeds
    application raised an exception (see the log for more details)"
    "registration rejects duplicate username
    application raised an exception (see the log for more details)"
    idk what to do :((

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      This error is too open. You should check the log for more details. There are some problems that we can only help you if we see your code and understand what you thought about when solving :/

    • @GuguG47
      @GuguG47 2 роки тому

      Hello there! I hope this message find you. I was struggling with the same problem. Here is the solution:
      username = request.form.get('username')
      database = db.execute("SELECT * FROM users WHERE username = ?", username)
      if len(database) != 0:
      return apology("username already exists")

    • @giulianaambrosino7944
      @giulianaambrosino7944 2 роки тому

      @@GuguG47 It doesn't work :( ¿could I send u the hole code so u can help me better? I really need help with this :((. ¿By your email maybe?

    • @kadenstilling4963
      @kadenstilling4963 Рік тому

      @@giulianaambrosino7944 were you able to figure this out? I have the same thing occurring

  • @somanshv8464
    @somanshv8464 4 місяці тому

    please provide source

  • @marlib7
    @marlib7 2 роки тому +2

    Tried to input the code exactly the way you did, but I get a syntax error under the "register" part. Anyone know what's going on?

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      Let's take a look and get back to you explaining (:

    • @marlib7
      @marlib7 2 роки тому

      @@DorsCodingSchool Thank you!

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      ​@@marlib7 Do you know what line do you get the syntax error?

    • @marlib7
      @marlib7 2 роки тому

      @@DorsCodingSchool No I don't, I will test everything again and let you know if I find the source of the problem

    • @CkOficial
      @CkOficial 2 роки тому

      @@marlib7 I've got the same problem, did you end up finding what was the problem ?

  • @estherhozy9475
    @estherhozy9475 Рік тому +1

    I just want to sya thank you

  • @hexohydraheretic4697
    @hexohydraheretic4697 2 роки тому +1

    session["user_id"] = new_user
    I'm trying to figure out what value the new user variable has from being assign insert sql query, works I just don't know why can anyone help 21:12

    • @DorsCodingSchool
      @DorsCodingSchool  2 роки тому

      You're adding all the data about the user in your session. All data you have about the user is the username, password (hash), id, and cash.
      The session["user_id"] will give you the id of the user when you're logged in.
      By the way, we have a Telegram Group to help people learn how to code and where you can connect with learners from all over the world. Over there you can ask any question about programming and you can easily get your questions answered within 24 hours.
      Besides that, you will have access to our membership with more than 400 problems made by us to ease your learning curve and 1 hour of group coaching every month!
      Check www.dorscodingschool.com/products