This file contains 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
/* | |
Author: Abdullah Khan | |
Purpose: Show off C++14 automatic return type deduction. | |
Build: g++ -std=c++14 automatic_return_type_deduction.cpp -o create_pair | |
Run: Invoke create_pair with two parameters: words or numbers work best. | |
*/ | |
#include <iostream> | |
#include <utility> |
This file contains 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
// File: progress_bar_example.cpp | |
// Modified from https://stackoverflow.com/questions/14539867/how-to-display-a-progress-indicator-in-pure-c-c-cout-printf | |
// Compile with: | |
// g++ -std=c++14 -o prog progress_bar_example.cpp -Werror -pedantic | |
#include <iostream> | |
#include <chrono> // for literals | |
#include <thread> // for cross-platform sleep | |
int main() | |
{ |
This file contains 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
// Compile with g++ -std=c++14 reverse.cpp | |
#include <iostream> // std::cout | |
#include <string> // std::string | |
#include <utility> // std::swap | |
using namespace std; | |
string reverse(string & s) { | |
// Ternary conditional | |
// If string is of even length, n = string length |
This file contains 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
// Abdullah Khan | |
// Compile with: g++ -std=c++14 k-th_smallest_element.cpp | |
// Second smallest value in unsorted array/vector/list | |
#include <iostream> | |
#include <vector> | |
#include <utility> | |
#include <random> | |
using Generator = std::mt19937; |
This file contains 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
extern crate rand; // rand crate for generating random numbers | |
use std::io; // io library from standard library | |
use std::io::Write; // Needed for flushing stdout after print. | |
use std::cmp::Ordering; // For comparing values | |
use rand::Rng; // from rand crate | |
fn main() { | |
println!("Guess the number, from 0 to 100."); // Greet user | |
let secret_number = rand::thread_rng().gen_range(0, 101); |
This file contains 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
#!/usr/bin/env python3 | |
""" | |
This script creates a macOS High Sierra bootable ISO. | |
Requires Python 3.6, macOS, and macOS High Sierra app installed. | |
Created using info gathered from here: https://gist.github.com/agentsim/00cc38c693e7d0e1b36a2080870d955b | |
Purpose: I just wanted to try out the subprocess library. | |
""" |
This file contains 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
UVLY+3xs9LIslFFJL9zz9ZX/E8tch0h1gXBEL4FgoejQ9yQ/0abH8BYtlJeU1ADc3SFuE3wL+QT3GNZJWHAGbuEdinxloggMORGnbuQ6SZSa31gNy0HO2ze7bd0TLJa3BNtmzN/u40gehGsXFn3/Ve | |
ZjkII9ANA26kQnxsGo1dnnUUMkMT9XrDIfj9Xb+6TZNiJYl7+qD6xqQRdac61izYNQcOxIa7xwxdXqjWnEMUmBDBE7R1wxNRTSLvMAo6itab8yZnjF1OAzsesXfeWIFgz/yrHNsgeQ5JhFuitUsa9n | |
GtBLVrYpJaqnEQQtHdg2Uez09d89YDa3tq+afeVxC9Bgul6ga1W5FrwnZLgNmeaj+bOnLU3y/za1L6dwuUh6IqakNyx3vTrb0DDnb2fw7w== | |
F6ny/x7M/S/F1fu0oS2K41aR1n8URVQQ+ipS4NMLIkQoWhR5YEQMq2Tq5SP+RdIHK9blfFEBFZNJ9hcJkBt+9QJprvq+g0Gm3owr8jGfZ85yh8s+ChwENKeJRiQgs/Wr5n6JOH9b3EEAIUxPzTQ2/W | |
zFvpDR28TN9BqCUn0QUts1lnKX3+FfOC4J4lZhnsLfTKAkGxeNSaZ/2jtwMeX1VRVY8dyu3l8hVfogXC3sVxD5qwjaOd0i3moJWwbyDWQspunIY2GAONcgkH+6u87UPjHMuZcfCGPyu/YKpcEZg8FP | |
DLw58uU0o4Upbtq3aGaaOOV475tZ7Gi3zXJRBnfi+A== | |
1G2JyAkrPgv/ueMVOOIxM04Oqx1yXoXoCv99KNN0AqhDacpn6iaXn6wmdfDooqxV7oThGMzwPuFrtYSzyfq6xE6WsLuMnBwxjlKvfTr7/JQus3ALYXD05D+XjRIP2EHKo19rLUmtkk+hfGeuh/OSEc | |
V1+pZ9fSpkkS7+KvVF4Q2HkJRjLnWxqoRapd++vGXFaIOGKlF61VjIUNWo0RWRDINJExW3ONMVXatrNwIvW20zgB05STnpz9fMYGq4oCKUHU0AhXZ8s |
This file contains 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
#!/usr/bin/env python3 | |
""" | |
This script creates a macOS Mojave bootable ISO. | |
Requires Python 3.6, macOS, and macOS Mojave app installed. | |
Created using info gathered from here: https://gist.github.com/agentsim/00cc38c693e7d0e1b36a2080870d955b | |
Purpose: I just wanted to try out the subprocess library. | |
""" |
This file contains 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
@ECHO OFF | |
ECHO Reset Volume Mixer Settings... | |
NET STOP Audiosrv | |
NET STOP AudioEndpointBuilder | |
REG DELETE "HKCU\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" /F | |
REG ADD "HKCU\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" |
This file contains 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
from csv import reader | |
from collections import namedtuple | |
import logging | |
import subprocess | |
# TODO: In the future this script should also possibly generate the data so that no other steps are required. | |
# E.g.: | |
# gam all users show filelist id alternateLink query "'[email protected]' in readers" > file.csv | |
# gam all users show filelist id alternateLink query "'[email protected]' in writers" > file.csv |
OlderNewer