This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#IMPORTANT: RUN IN ADMIN MODE | |
Write-Host "`Press [ENTER] to see all past WiFi networks your device has connected to: " -NoNewLine | |
$Host.UI.ReadLine() | |
Write-Host "`nALL PAST WIFI NETWORKS:`n====================================================`n" | |
$past_wifis = @() | |
#Put all wifi names in a list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <stdexcept> | |
using namespace std; | |
vector < vector <int> > addMatrices (vector < vector <int> > matrix1, vector < vector <int> > matrix2); | |
vector < vector <int> > subtractMatrices (vector < vector <int> > matrix1, vector < vector <int> > matrix2); | |
void printMatrix(vector < vector <int> > matrix); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1: include the iostream part of the standard library | |
#include <iostream> | |
//2: Add function forward declaration | |
float distance(float velocity, float elapsedtime, float acceleration); | |
// Leave the main function as is | |
int main() { | |
// TODO: The following are examples you can use to test your code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-----HELPER FUNCTIONS-----# | |
#Scalar multiplication | |
def multiply_scalar(matrix, scalar): | |
num_rows = len(matrix) | |
num_columns = len(matrix[0]) | |
result = [] | |
for row_i in range(num_rows): | |
row = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#for matrix A, AI = IA = A | |
def identity_matrix(n): | |
identity = [] | |
for i_row in range(n): | |
row = [] | |
for i_col in range(n): | |
is_diagonal = (i_row == i_col) | |
row.append(1 * is_diagonal) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dot_product(vector_one, vector_two): | |
if len(vector_one) == len(vector_two): | |
sum_vectors = 0 | |
for i in range(len(vector_one)): | |
sum_vectors += vector_one[i] * vector_two[i] | |
return sum_vectors | |
return -1 | |
#[A^T]_i,j = A_j,i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Matrix-Matrix multiplication | |
def get_row(matrix, row): | |
return matrix[row] | |
def get_column(matrix, column_number): | |
column_vals = [] | |
for i in range(len(matrix)): | |
column_vals.append(matrix[i][column_number]) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Matrix addition | |
def add_matrices(matrixA, matrixB): | |
num_rows = len(matrixA) | |
num_cols = len(matrixA[0]) | |
# initialize matrix to hold the results | |
matrixSum = [] | |
for i_row in range(num_rows): | |
row = [] | |
for i_col in range(num_cols): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Vector Addition | |
def add(vector_1, vector_2): | |
if len(vector_1) != len(vector_2): | |
print("error! vectors must be same size to add") | |
return | |
new_vector = [] | |
for i in range(len(vector_1)): | |
new_vector.append(vector_1[i] + vector_2[i]) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#state = initial state, [intial_x_pos, velocity] | |
#dt = change in time | |
#predicted_state = change in state. | |
#constant velocity model, displacement | |
def predict_state_mtx(state, dt): | |
const_vel_matrix = matrix.Matrix([ [1, dt], | |
[0, 1] ]) | |
predicted_state = const_vel_matrix * state | |
return predicted_state |
NewerOlder