Skip to content

Instantly share code, notes, and snippets.

@aeglon97
aeglon97 / grab_password_from_past_networks.psi
Last active September 17, 2023 02:14
Grab passwords from all WiFi networks your Windows device has connected to in the past.
#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
#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);
//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.
#-----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 = []
#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)
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
@aeglon97
aeglon97 / matrix_multiplication.py
Last active November 1, 2021 02:49
matrix_multiplication.py
#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])
#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):
#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])
#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