-
Functions, & O.O.P.–C++ Notes (C Plus Plus Notes)
Functions Performing a task in a program requires a function! The function hides from its user the complex tasks that it performs. C++ Functions–A function is a block of code which only runs when it is called. Data, known as parameters, can be passed into a function. Functions are used to perform certain tasks, or actions, and they are important for reusing code: Define the code once, and use it many times. C++ provides some pre-defined functions, such as ‘main()‘ which is used to execute code. But you can also create your own functions to perform certain actions. C++ Functions consist of two parts: Declaration–the functions name, return type, and…
-
What is a “Function” in Programming?, & What is “Object Oriented Programming” (OOP)–Notes
Functions Function–a block of code packaged together with a name. Functions are a core feature of all programming languages. aka–sub-routines, methods, or some other name. a way to break up your code. a key benefit of functions is that they help us avoid writing the same lines of code again & again. Once you create a function, you can call it by using its name followed by a set of parenthesis( ). Functions can change their behavior depending on the parameters and arguments given. To have a function return a value, use the “return” statement. Ex: ‘return my_value’ Being able to return values from functions is a cornerstone of programming.…
-
Some Quick Notes On Python Syntax…
Some Quick Notes On Python Syntax: Python was designed for readability, and has some similarities to the English language with influence from mathematics. Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses. Python relies on indentation (using whitespace), to define scope; such as the scope of loops, functions, & classes. Other programming languages often use curly-brackets for this purpose. Python uses the colon symbol (:) and indentation for showing where blocks of code begin and end. That is, blocks in Python, such as functions, loops, ‘if’ clauses and other constructs, have no ending identifiers (other than the start of…
-
A Comment on Comments In Programming Languages…
A Comment on Comments: One of the most important of programming tools is comments! Comments are just lines in the programs which describe what’s going on. Comments can tell the programmer what’s going on and more importantly why! Good comments are important if the programmer reading the code isn’t the one who wrote it, or, it’s been a long time since they wrote it. Another way of thinking about comments is that, “comments are Code!“, and rather than comments explaining code to other programmers, CODE explains the comments to the computer! Either way comments are useful and important and every language has a way of indicating comments. Python uses a…
-
Arithmetic Operators Notes
Arithmetic Operators Notes Operator Example Description M + N Addition of M and N M – N Subtraction of N from M M * N Multiplication of M and N M / N Division of M by N (The result will be a real number.) M // N Integer division of M by N (The result will be an integer.) M % N Modulo: find the remainder of M divided by N M ** N Exponentiation: M to the power of N (e.g., 2 ** 4 results in 16. 2*2*2*2=16 Arithmetic Operators Note: Python also has the math module that contains common math functions (such as sin, cos, etc.) Shortcut…
-
Raw Materials–Data, Variables, & Data Types–Notes…
Raw Materials Data, Variables, & Data Types The ‘materials‘ we use in programming are the data that we can manipulate. Data is the “stuff“, the raw information, that our program manipulates. Programs manipulate data in many ways, often depending on the type of data. Data comes in the form of many types, and each data type has a number of operations–things that we can do to it. So, the things that we can do, or perform on the data, depends on what type of data we have at our disposal. Variables refer to data and (depending on the programming language) may need to be declared before being defined, or used.…
-
What is a program?–Notes…
What is a program? A program is a sequence of instructions that specifies how to perform a computation. A few basic instructions appear in just about every language: input–get data from a keyboard, a file, or some other device. output–display data on the screen or send data to a file or other device. maths–perform basic mathematical operations like addition & multiplication. conditional execution–check for certain conditions and execute the appropriate sequence of statements. repetition–perform some action repeatedly, usually with some variation. That’s pretty much all there is to it! Every program is made up of instructions that look more or less like these! We can describe programming as the process…
-
Notes to Self 11/05/2020
Notes to Self 11/05/2020 “Hack everything but harm none.” OSSTMM (www.osstmm.org); Pronounced “aw-stem”. Open Source Security Testing Methodology Manual Interactions–Trust interactions are between people & things that are familiar with each other. Access interactions happen between unknown people or systems. (You can use an ‘access‘ to take what you want yourself, or you can trick someone who has a ‘trust’ with the target to take what you want for you and give it to you.) Visibility interaction– ‘opportunity’; knowing if there’s something to interact with or not. “Privacy is the opposite of ‘Visibility’ and it’s a powerful way to avoid being a target. Whether its on dangerous streets, in the…
-
HTML & CSS Notes
HTML HTML is the way a webpage is STRUCTURED! It is the markup language that contains all the actual stuff that a web page has. For example, all the text on a page lives inside HTML tags that tell the browser how to order (structure) the content on the page. Note: you can right-click any element on a web page & choose “Inspect Element” to open up your browsers Developer Tools, & it will show you the structure of the page. CSS CSS is the way a webpage LOOKS visually. CSS tells the browser if you want to display any of those tags a particular way, for example, turning a…
-
What is GIT? GIT–Version Control System
What is GIT? Git is a popular Version Control System. The aim of Git is to manage software development projects, and its files, as they are changing over time. Git stores this information in a data structure called a repository! A git repository is a central place where developers store, share, test and collaborate on web projects. A repository is kind of like an enhanced Unix directory, or folder, but with the additional ability to track changes to every file and subdirectory. The way to create a new repository with Git is with the “init” command (short for “initialize”_, which creates a special hidden directory called “.git”, where Git stores…