blog
blog copied to clipboard
My Blog
Reference: Book: *Starting Out with C++ from Control Structures to Objects, byTony Gaddis, ninth edition* # 1. getline() Using `cin` with the `>>` operator to input strings can cause problems:...
# 1. Common C++ Naming Conventions > https://github.com/cpp-best-practices/cppbestpractices/blob/master/03-Style.md - **Projects** and **Files** start with upper case (UpperCamelCase / PascalCase): ``` MyProject ``` ``` HelloWorld.cpp ``` - **Types** start with upper...
References: - https://reactjs.org/docs/add-react-to-a-website.html - https://babeljs.io/docs/en/babel-cli # 1. React Component with HTML `./index.html`: ```html Add React in One Minute Add React in One Minute This page demonstrates using React with no...
References: - Book: Grokking Algorithms - https://github.com/egonschiele/grokking_algorithms Sometimes all you need is an algorithm that solves the problem pretty well. And that’s where **greedy algorithms** shine, because they’re simple to...
References: - Book: *Grokking Algorithms* - https://github.com/egonschiele/grokking_algorithms - https://pythontutor.com How many **steps** are there to find the shortest route to a place? This type of problem is called a ***shortest-path...
> Python3 六个标准的数据类型。 > 四种数据结构:元组、列表、集合、字典。 通过 type() 函数查看数据类型: ```python >>> print(type(1)) >>> import math >>> print(type(math.pi)) >>> print(type(True and False)) >>> print(type(complex(1, 2))) ``` ```python >>> print(type('1')) ``` ```python >>>...
# 1. Function arguments Arguments to functions are passed by object reference, a concept known in Python as **pass-by-assignment**. **When a function is called, new local variables are created** in...
References: - https://docs.python.org/3/tutorial/inputoutput.html#fancier-output-formatting - https://realpython.com/python-string-formatting/ - https://realpython.com/python-f-strings/ # 1. Old String Formatting: % Operator [printf-style String Formatting](https://docs.python.org/3/library/stdtypes.html#old-string-formatting) The `%` operator (modulo) can also be used for string formatting. Given `'string'...
References: - https://students.yourlearning.ibm.com/activity/ILB-PZXXWZEREVVQ28K2  # Artificial intelligence **Artificial intelligence** describes machines that exercise capabilities usually associated with human intelligence. Current research in AI focuses on learning, reasoning, problem solving, perceiving,...
## Precedence Rules The order in which operators are evaluated in an expression is known as ***precedence rules***. Precedence rules for arithmetic, relational and logical operators: | Operator/Convention | Description...