GithubHelp home page GithubHelp logo

cs50's People

Contributors

azarashin avatar ikeay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cs50's Issues

テンプレートに従う

テンプレートが存在していることに気づいたので、テンプレートに沿っていないコードを修正する。

Should be rollback if failed

# TODO: Should be rollback if failed
db.execute("INSERT INTO histories(user_id, symbol, name, shares, price) VALUES (:user_id, :symbol, :name, :shares, :price)",
user_id=session["user_id"], symbol=info["symbol"], name=info["name"], shares=num, price=info["price"])
owned_shares = db.execute("SELECT * FROM owned_shares WHERE symbol = :symbol AND user_id = :user_id",
symbol=info["symbol"], user_id=session["user_id"])


This issue was generated by todo based on a TODO comment in 2e1de93. It's been assigned to @ikeay because they committed the code.

Consider better validation logic

if (atoi(&str[i]) == 0 && strcmp(&str[i], "0") != 0)

I am guessing you'd want to check if any non-digit character is contained in the specified string when atoi() returns a zero. I'd suggest to simply check if (str[i] < '0' || str[i] > '9') instead.

It will return -1 if a negative number is specified, but it should be ok since your code doesn't expect any negative number. Also the previous issue that I raised (#2) will be automatically resolved.

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.