(CS50) FINANCE - PROBLEM SET 9 | SOLUTION

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии • 259

  • @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 года назад +20

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

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад +2

      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?

  • @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!

  • @ahmedfernandez4695
    @ahmedfernandez4695 Год назад +1

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

  • @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.

  • @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!!!!! :))))

  • @Sandeepkr-gd6ln
    @Sandeepkr-gd6ln 4 часа назад

    22:47 Quote
    32:58 Buy
    52:37 Index

  • @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.

  • @Seefight111
    @Seefight111 2 года назад +2

    Best programming channel I've ever seen

  • @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.

  • @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.

  • @fazliddinfayziev-qg1vg
    @fazliddinfayziev-qg1vg 11 месяцев назад +1

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

  • @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 3 месяца назад

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

  • @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

  • @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 Год назад +4

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

  • @abbhilashsimanchalam7058
    @abbhilashsimanchalam7058 8 месяцев назад +1

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

  • @faariswheel5673
    @faariswheel5673 5 месяцев назад +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?

  • @anujvishwakarma4897
    @anujvishwakarma4897 Год назад

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

  • @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 11 месяцев назад

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

  • @Nikolaospts
    @Nikolaospts 9 месяцев назад

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

  • @mohammed2005-m1h
    @mohammed2005-m1h Год назад +1

    I realy like your exeplanation

  • @momenTheDev
    @momenTheDev Год назад +2

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

  • @jk-fy8on
    @jk-fy8on Год назад +1

    Thank you so much!

  • @ercarltz2737
    @ercarltz2737 3 месяца назад +2

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

    • @alileo047
      @alileo047 3 дня назад +1

      i think we don't need to use API key any more.!

  • @botanicear64511
    @botanicear64511 3 месяца назад +1

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

    • @armyforever9607
      @armyforever9607 Месяц назад

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

  • @mitchellmunar5189
    @mitchellmunar5189 Год назад +1

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

  • @lucasbraga1230
    @lucasbraga1230 Месяц назад

    thank you so much!

  • @markmeredith2039
    @markmeredith2039 Год назад

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

  • @hikmataudi
    @hikmataudi 8 месяцев назад +1

    best in the west
    thank you

  • @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.

  • @janicevilela2062
    @janicevilela2062 7 месяцев назад +1

    Muito obrigada!!!! Ajudou demais!

  • @NuraUmaAnnisa
    @NuraUmaAnnisa Год назад +1

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

  • @omarbarba4634
    @omarbarba4634 Год назад

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

  • @kartikyadav5704
    @kartikyadav5704 2 года назад +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  2 года назад +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.

  • @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

  • @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

  • @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

  • @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

  • @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

  • @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

  • @gregoryeng7449
    @gregoryeng7449 Год назад +1

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

  • @delyanakirilova515
    @delyanakirilova515 2 года назад +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  2 года назад

      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

  • @Iliketotry
    @Iliketotry 2 года назад +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  2 года назад +1

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

  • @Denise_travel
    @Denise_travel Год назад +1

    THANK YOU SO MUCH!!!!

  • @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?

  • @hv6411
    @hv6411 2 года назад +1

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

  • @erfan_devsol2002
    @erfan_devsol2002 Год назад +1

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

  • @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!

  • @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

  • @bruno-d2r
    @bruno-d2r 5 месяцев назад

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

  • @lucyjohns8694
    @lucyjohns8694 2 года назад +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  2 года назад

      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 2 года назад

      @@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!

  • @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?

  • @davidwds
    @davidwds Год назад +1

    how do you open phpliteadmin?

  • @nirvana7827
    @nirvana7827 2 года назад +2

    Thank you so much, this was a great video

  • @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

  • @sarathabeysirigunawardena977
    @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.

  • @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"?

  • @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?

  • @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

  • @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.

  • @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

  • @aandresriera7927
    @aandresriera7927 2 года назад +1

    greatly explained great content!!

  • @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.

  • @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 :)

  • @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

  • @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?

  • @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?

  • @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

  • @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

  • @mohitsharma-ep9iy
    @mohitsharma-ep9iy 2 года назад +1

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

  • @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.

  • @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

  • @JacobMcDaniels-j4y
    @JacobMcDaniels-j4y 10 месяцев назад

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

  • @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

  • @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

  • @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

  • @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)

  • @pakteam1304
    @pakteam1304 2 года назад +1

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

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

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

  • @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

  • @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

  • @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

  • @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

  • @ЛюбовьБосикова-с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

  • @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

  • @alaatarek3983
    @alaatarek3983 Год назад

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

  • @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

  • @somanshv8464
    @somanshv8464 5 месяцев назад

    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 ?

  • @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

  • @alaatarek3983
    @alaatarek3983 Год назад

    shall I login with my real account

  • @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

  • @user-oi3xy5ye6n
    @user-oi3xy5ye6n 2 года назад

    52:00

  • @vitorsiqueira3257
    @vitorsiqueira3257 2 года назад +3

    Are u from Brazil?

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад +1

      Yes haha

    • @gabrielbarros8543
      @gabrielbarros8543 2 года назад

      @@DorsCodingSchool Reconheci pelo sotaque kkkkk muito bom encontrar br pelos cursos cs50

  • @Daniel_Li_777
    @Daniel_Li_777 2 года назад +1

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

    • @DorsCodingSchool
      @DorsCodingSchool  2 года назад

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

  • @dhruvrastogi4717
    @dhruvrastogi4717 9 месяцев назад

    check50 is not getting through

  • @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?