-
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…
-
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…
-
Phonetic Alphabet
A–> Alpha B–> Bravo C–> Charlie D–> Delta E–> Echo F–> Foxtrot G–> Golf H–> Hotel I–> India J–> Juliett K–> Kilo L–> Lima M–> Mike N–> November O–> Oscar P–> Papa Q–> Quebec R–> Romeo S–> Sierra T–> Tango U–> Uniform V–> Victor W–> Whiskey Y–> Yankee Z–> Zulu
-
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…
-
More Notes!!! [Ruby Programming Language Notes]
Global Variables–Variable References Lecture $–Use this sign to create a global variable in Ruby. Ex: def say_hello $message = “hello globe” end say_hello p $message # => “hello globe” More Methods! object_id can be used to see what memory location a particular variable points to . ex: variable.object_id => 7018903, or whatever number the computer assigned. Initializing an Array! *(Variable References Lecture) So we know that ‘arr = [ ]‘ will create a new empty array. We can use ‘arr = Array.new()‘ to initialize an array of a certain length by passing the length we want into the parameter (argument). ex: Array.new(3) #a new array with 3 elements => [nil,…
-
Sorting &Swapping Elements, & Bubble Sort Algorithms!!! [Ruby Programming Language Notes]
Sorting & Swapping Elements, & Bubble Sort Algorithms!!! Algorithm a sequence of actions to take! Sorting Algorithms Swapping Elements Operation: array = [“a”, “b”, “c”, “d”] #let’s swap “a” & “b” temp = array[0]; #save a copy of the first ele array[0] = array[1]; #overwrite the 1st ele with the 2nd ele array[1] = temp; #overwrite the 2nd ele with the 1st ele copy p array # => [“b”, “a”, “c”, “d”] This works but is a bit messy. Ruby has a clean shortcut (that also works in Python!)! array = [“a”, “b”, “c”, “d”] #let’s swap “a” & “b” array[0], array[1] = array[1], array[0] p array # => [“b”,…