a standard way a group of programmers will follow for their identifiers, often languages will have an associated naming convention because the programmers all follow similar, but it isn’t typically restricted to that convention Snake-casee.g. linked_list, is_sorted Pascal-casee.g. LinkedList, IsSorted Camel-casee.g. linkedList, isSorted juxtapositione.g. linkedlist, issorted
Category Archives: Notes
Literal data
numbers, characters, and text that are hard-coded and appear in a computer program, more specifically: Characters (letters, numbers, punctuation, like in ASCII)StringsIntegersFloating-point numbersBoolean For more details on above, see common data types
Delimiters
a reserved symbol(s) that denote a separation/grouping in data or expressions field delimiter: a type of delimiter to mark start/end of datae.g. commas delimit data in a csv file matching delimiter: a pair of delimiters that group data/expressionse.g. ( ), [ ], { } to group mathematical expressions
Program make-up
a computer program is generally made up of a combination of the below items: Pre-processor directivesLiteral dataIdentifiersOperatorsDelimiters
Language Implementation Types
Code that is not in binary (i.e. not machine code) cannot be read by machines, and therefore must be translated to a series of instructions that a computer can understand and execute The machine code is specific to the target machine (e.g. code compiled for Windows can’t run on Mac), and the language implementation typesContinueContinue reading “Language Implementation Types”
Code Types
The are multiple ways to categorize code: source vs machine codehigh level vs low level code Source code: human-readable code, which is the majority of code written by developers which needs to be translated to machine code for executionMachine code: binary code read directly by the machine, specific to the target machine (e.g. machine codeContinueContinue reading “Code Types”
Memory & Storage
Memory is for temporary usage, storage is for long or permanent usage Many types of memory and storage on a computer, all with different speeds, persistence (e.g. temporary vs persistent data), and therefore typical uses Memory Type Outside CPUTypical Physical LocationMemory / Storage & PersistenceSpeedCost & Typical Storage SizeTypical UseCPU RegistersInside CPUMemory(Temporary)FastestVery smallData in CPUContinueContinue reading “Memory & Storage”
General computer hardware parts
Almost all modern day computer hardware is set up to follow stored program computer architecture, and more specifically von Newmann architecture CPU (Central Processing Unit)Brain of computer, executes instructions and programs and performs computationsGPU (Graphics Processing Unit)Similar to CPU, but specialised to process graphicsMemory & StorageCacheMost temporary memory outside CPU, often storing data that isContinueContinue reading “General computer hardware parts”
Common Data Types
Data types are declared (implicitly or explicitly) when assigning memory to a variable The data type will tell the computer how much memory to allocate and how to interpret the data Characters (Char) Char: stores a single character with ASCIIRequires single byte (8 bits) in most compiliers in C in C++, character literals are encapsulatedContinueContinue reading “Common Data Types”
Operator Types
Many types of operators used to manipulate data Arithmetic operatorsWhat we most commonly see with everyday mathe.g. +, -, /, *Relational operatorsUsed to make decisions by comparing values to determine if one is greater than, less than, equal to, or not equal to anothere.g. >, <, >=, <=, ==, !=Assignment operatorsUsed to assign a newContinueContinue reading “Operator Types”
ASCII: Bits as Characters
ASCII (American Standard Code for Information Interchange) is a notation which uses 7 bits to represent characters, often denoted as char 7 bits in binary means up to 2⁶ + 2⁵ + 2⁴ + 2³ + 2² + 2¹ + 2⁰ = 127 different values that can be represented with 7 bits Extended ASCII usesContinueContinue reading “ASCII: Bits as Characters”
Data Notations
ways to represent data (numbers) which have a specific way to interpret them Since we can interpret data in many different ways based on the notation, we need to remember the notation for each piece of data we store to interpret it correctly later!(e.g. storing data “10” can mean 10 if originally was a decimal,ContinueContinue reading “Data Notations”
Data Types: unsigned vs signed
many data types, these are two simple types used to define further how to interpret data represented in notations such as binary (nibbles, bytes, integers), hexadecimal, etc Unsigned every character represents a whole number to be added to other characters at the corresponding bases, with right to left index starting at power 0 increasing byContinueContinue reading “Data Types: unsigned vs signed”
Conversion of Unsigned Decimals to Binary to Hex
Many notations can be used to represent the same number, conversion table below for unsigned decimal to unsigned binary to unsigned hexadecimal Decimal is base of 10Binary base of 2Hexadecimal base of 16 (Base of x means one character can represent up to x different valuese.g. in everyday math, we typically use decimal notation, baseContinueContinue reading “Conversion of Unsigned Decimals to Binary to Hex”
Common Programming Paradigms
Programming paradigm is a style or way of programming describing the general thought process or way of thinking about the programming method Languages can be used with multiple paradigms, e.g. Javascript has implemented Lambdas more suiting functional paradigm vs it’s traditionally OOP paradigm structure imperative (also called procedural): a paradigm that uses statements that change a program’s state,ContinueContinue reading “Common Programming Paradigms”
Tips for Conservation of Energy Problems
See examples of conservation of energy problems Define the isolated system, and interaction of objects withinDefine a common datum elevation “zero” level to relate potential energy due to elevationAssociate the applied forces to the different conversion of energy (work-energy theorem) while maintaining conservation of energy
Hooke’s Law
calculates the force exerted by a spring at any given length relative to neutral length (e.g. stretched longer or compressed shorter than neutral length of spring)The force is proportional to the distance away from neutral state $latex \vec{F}_{spring} = -kx\\ \\ \mbox{Where}\\ \vec{F}_{spring} \mbox{: Force exerted by stretched/compressed spring (Newtons)}\\ k \mbox{: spring constant (N/mContinueContinue reading “Hooke’s Law”
Work-Energy Theorem
the work done by the sum of all forces acting on a body equals the change in the kinetic energy of the particle (conversion of energy through work) $latex W = \Delta E\\ \\ \mbox{Where} \\ W \mbox{: Work done (Joules = Newtons * meters)}\\ \Delta E \mbox{: change in energy (J)} $
Conservation of energy
the total energy of an isolated system remains constant (energy is conserved over time), with conversion to energy types through the work-energy theorem $latex \Sigma E_{before} = \Sigma E_{after} \mbox{ (}+E_{friction,thermal}) $ Thermal Energy, Friction & Conservation of EnergyTypically, when we see conversion of energy to low-level thermal energy (e.g. heat generated through friction), we consider itContinueContinue reading “Conservation of energy”
Thermal Energy (Et)
a form of energy related to the heat of an object/system, measured in Joules = Newtons * metersSince an increase in heat is increasing the speed of the material at a molecular level, this is considered a type of kinetic energy Thermal Energy, Friction & Conservation of EnergyTypically, when we see conversion of energy toContinueContinue reading “Thermal Energy (Et)”