Clear ALL trailing whitespaces in sheets dir

Recursively.
pull/117/head
terminalforlife 4 years ago
parent 4e5d24464c
commit 907c3cad09

@ -1,6 +1,6 @@
// In C++11 you can do the following, but most people use vector instead of arrays
// In C++11 you can do the following, but most people use vector instead of arrays
a.size(); // Returns the size of array a
int a[10]; // Declare an int array with length 10.
int a[10]; // Declare an int array with length 10.
a[0] = 420; // Set the value 420 to index 0 of array a
int b = a[0] // Set variable b to 420 by accessing index 0 of array a.

@ -1,20 +1,20 @@
int main() {
// Basic
int main() {
// Basic
if(x > 0) {
return x;
return x;
}
else {
return -x;
else {
return -x;
}
// if else
if(x > 0) {
return x;
// if else
if(x > 0) {
return x;
}
else if(x == 0) {
return 420;
else if(x == 0) {
return 420;
}
else {
else {
return -x;
}
}

@ -1,19 +1,19 @@
// There are only 'for', 'while', and 'do while'
// For loop - Outputs "0 1 2 3 4 5 6 7 8 9"
// For loop - Outputs "0 1 2 3 4 5 6 7 8 9"
for( int i=0; i<10; i++ ) {
std::cout << i << " ";
std::cout << i << " ";
}
// While loop - Outputs "0 1 2 3 4 5 6 7 8 9"
int i = 0;
while( i < 10 ) {
// While loop - Outputs "0 1 2 3 4 5 6 7 8 9"
int i = 0;
while( i < 10 ) {
std::cout << i << " ";
i++;
}
// While loop - Outputs "0 "
int i = 0;
do {
std::cout << i << " ";
// While loop - Outputs "0 "
int i = 0;
do {
std::cout << i << " ";
}while( i<0 );

@ -1,21 +1,21 @@
// ## Built-in Types
bool
// ## Built-in Types
bool
char
char
string
string
// Assume signed, prepend unsigned to make it unsigned
short
short
int
int
long
long
// C++ 11
long long
// C++ 11
long long
// Floating Points
float
double
long double
// Floating Points
float
double
long double

@ -1,10 +1,10 @@
// Vectors are sequence containers representing arrays that can change in size.
// Library to include
#include <vector>
// Library to include
#include <vector>
vector<int> a; // Declare an empty vector, a.
a.push_back(1); // Appends/Adds an element whose value is 1 to vector a.
std::cout << a.at(0) << std::endl; // Accessing index 0 of vector a.
a.push_back(1); // Appends/Adds an element whose value is 1 to vector a.
std::cout << a.at(0) << std::endl; // Accessing index 0 of vector a.
a.size(); // Returns the size of the vector
a.at(0) = 420; // Changing the value at index 0 to 420.
a.at(0) = 420; // Changing the value at index 0 to 420.

@ -12,7 +12,7 @@
// |`&^` |bit clear (and not)|
// |`<<` |left shift |
// |`>>` |right shift|
//
//
// ### Comparison
// |Operator|Description|
// |--------|-----------|
@ -22,14 +22,14 @@
// |`<=` |less than or equal|
// |`>` |greater than|
// |`>=` |greater than or equal|
//
//
// ### Logical
// |Operator|Description|
// |--------|-----------|
// |`&&` |logical and|
// |`||` |logical or |
// |`!` |logical not|
//
//
// ### Other
// |Operator|Description|
// |--------|-----------|

@ -1,5 +1,5 @@
// There are no classes, only structs. Structs can have methods.
// A struct is a type. It's also a collection of fields
// A struct is a type. It's also a collection of fields
// Declaration
type Vertex struct {
@ -8,7 +8,7 @@ type Vertex struct {
// Creating
var v = Vertex{1, 2}
var v = Vertex{X: 1, Y: 2} // Creates a struct by defining values with keys
var v = Vertex{X: 1, Y: 2} // Creates a struct by defining values with keys
var v = []Vertex{{1,2},{5,2},{5,5}} // Initialize a slice of structs
// Accessing members
@ -31,7 +31,7 @@ func (v *Vertex) add(n float64) {
v.Y += n
}
// **Anonymous structs:**
// **Anonymous structs:**
// Cheaper and safer than using `map[string]interface{}`.
point := struct {
X, Y int

@ -1,8 +1,8 @@
// ## Packages
// ## Packages
// * Package declaration at top of every source file
// * Executables are in package `main`
// * Convention: package name == last name of import path (import path `math/rand` => package `rand`)
// * Upper case identifier: exported (visible from other packages)
// * Lower case identifier: private (not visible from other packages)
// * Lower case identifier: private (not visible from other packages)

@ -1,5 +1,5 @@
// Nothing is weird here, if you think a little bit more about it
// but it seems to be
// but it seems to be
// Null is an Object
typeof null // => 'object'
@ -22,7 +22,7 @@ new Array() == false // -> true
// big integer numbers
9999999999999999 // -> 10000000000000000
//
//
[]+[] // -> ""
[]+{} // -> "[object Object]"
{}+[] // -> "{}+[]"

@ -1,11 +1,11 @@
-- to install:
-- to install:
-- (Debian/Ubuntu) apt-get install lua
-- (Fedora/CentOS) yum install lua
-- (source code) curl -R -O http://www.lua.org/ftp/lua-5.3.4.tar.gz | tar xz -
-- (source code) curl -R -O http://www.lua.org/ftp/lua-5.3.4.tar.gz | tar xz -
-- cd lua-5.3.4
-- make linux
--
-- to execute:
-- to execute:
-- lua hello.lua
io.write("Hello world, from ",_VERSION,"!\n")

@ -1,15 +1,15 @@
# For what Recursion is, please check theory/recursion
# For what Recursion is, please check theory/recursion
# Simple Factorial Python Recursion
def factorial(n) :
if n == 0 :
return 1
else :
# Simple Factorial Python Recursion
def factorial(n) :
if n == 0 :
return 1
else :
return n * factorial(n-1)
# Simple Greatest Common Divisor Recursion
def gcd(x, y) :
if y == 0 :
return x
else :
return gcd(y, x%y)
# Simple Greatest Common Divisor Recursion
def gcd(x, y) :
if y == 0 :
return x
else :
return gcd(y, x%y)

@ -8,7 +8,7 @@
async fn do_work() -> String { ... }
fn do_work() -> impl Future<Output = String> { ... }
// To run a future, we can add a package that provides an async runtime, since Rust does
// To run a future, we can add a package that provides an async runtime, since Rust does
// not come with one in the standard library. An asynchronous runtime schedules futures
// and continuously polls them to completion. Here, we'll use tokio, a mature and
// battle-tested library.

@ -1,6 +1,6 @@
// to install rust:
// to install rust:
// curl https://sh.rustup.rs -sSf | sh
// to compile:
// to compile:
// rustc main.rs
fn main() {
println!("Hello, world!");

@ -3,7 +3,7 @@ if (check) happy else sad
// conditional sugar
if (check) happy // same as
if (check) happy else ()
if (check) happy else ()
// multiple conditions
if (check) happy else if(secondCheck) lessHappy else ()
@ -57,7 +57,7 @@ for (i <- 1 until 5) {
// recursion
// can yield a "java.lang.StackOverflowError" with large lists
// this is because each recursive call of the function is waiting for the evaluation of the next
def sum(ints: List[Int]): Int = ints match {
def sum(ints: List[Int]): Int = ints match {
case Nil => 0
case x :: tail => x + sum(tail)
}

@ -1,7 +1,7 @@
// define function
// GOOD
// GOOD
def f(x: Int) = { x*x }
// BAD
// BAD
// hidden error: without = its a Unit-returning procedure; causes havoc
def f(x: Int) { x*x }
@ -21,7 +21,7 @@ def f(x: R)
def f(x: => R)
// anonymous function
(x:R) => x*x
(x:R) => x*x
// anonymous function: underscore is positionally matched arg.
(1 to 5).map(_*2) // vs.
@ -31,7 +31,7 @@ def f(x: => R)
(1 to 5).map( x => x*x )
// anonymous function: bound infix method. Use 2*_ for sanitys sake instead.
// GOOD
// GOOD
(1 to 5).map(2*)
// BAD
(1 to 5).map(*2)

@ -1,11 +1,11 @@
# Recursion
# Recursion
# Def: "...is a method where the solution to a problem depends on solutions to smaller instance of the same problem.." - wiki
# TL;DR: a function that calls itself inside its body.
# TL;DR: a function that calls itself inside its body.
# Recursive programs - Pseduocode
function factorial:
# Recursive programs - Pseduocode
function factorial:
input: integer n such that n >= 0
output: n * (n-1) * (n-2) * ... * 1 = n!
1. if n is 0, return 1
1. if n is 0, return 1
2. else, return ( n * factorial(n-1) )

@ -1,15 +1,15 @@
# C++
#
#
# C++ is an object-oriented programming language which provides facilities for low-level memory manipulation.
# It is widely used by big tech companies, such as, Amazon, Facebook, Google, and SpaceX
#
# To Compile: g++ my_script.cpp
# To Execute: ./a.out
#
# See also
# See also
# C++ language cheat sheet at /c++/
# list of pages: /c++/:list
# learn C++: /c++/:learn
# C++ one-liners: /c++/:1line
# C++ weirdness: /c++/weirdness
# C++ weirdness: /c++/weirdness
# search in pages: /c++/~keyword

@ -5,22 +5,22 @@
dumpe2fs /dev/sdb1 | less
# Print the blocks which are reserved as bad in the filesystem
dumpe2fs -b /dev/sda2
dumpe2fs -b /dev/sda2
# Use the block superblock when examining the filesystem
dumpe2fs -o superblock=superblock /dev/sda1
dumpe2fs -o superblock=superblock /dev/sda1
# Use blocks of blocksize bytes when examining the filesystem.
dumpe2fs -o blocksize=blocksize /dev/sda1
dumpe2fs -o blocksize=blocksize /dev/sda1
# Force dumpe2fs to display a filesystem
dumpe2fs -f /dev/sda1
dumpe2fs -f /dev/sda1
# Only display the superblock information
dumpe2fs -h
dumpe2fs -h
# Display the filesystem data from an image file created by e2image
dumpe2fs -i
dumpe2fs -i
# Print the detailed group information block numbers in hexadecimal format
dumpe2fs -x
dumpe2fs -x

@ -1,10 +1,10 @@
# Elm
# Domain-specific programming language for declaratively creating web browser-based graphical user interfaces.
# Domain-specific programming language for declaratively creating web browser-based graphical user interfaces.
# Start Elm REPL
elm repl
# Default compilation
# Default compilation
elm make HelloWorld.elm -> index.html
# Custom name

@ -52,7 +52,7 @@
C-x u undo previous action
M-x revert-buffer RETURN
(insert like this) undo all changes since last save
M-x recover-file RETURN
M-x recover-file RETURN
Recover text from an autosave-file
M-x recover-session RETURN
if you edited several files
@ -101,7 +101,7 @@
C-s repeat incremental search
M C-r incremental search backwards
C-r repeat backwards
M-x query-replace-regexp
M-x query-replace-regexp
search and replace
# Window-Commands
@ -110,7 +110,7 @@
C-x 0 delete window
C-x 1 close all windows except the one the cursors in
C-x ^ enlarge window
M-x shrink-window
M-x shrink-window
command says it ;-)
M C-v scroll other window
C-x 4 f find file in other window
@ -176,14 +176,14 @@
C-c C-u go to beginning of this preprocessor statement
C-c C-c comment out marked area
# More general
M-x outline-minor-mode
M-x outline-minor-mode
collapses function definitions in a file to a mere {...}
M-x show-subtree
M-x show-subtree
If you are in one of the collapsed functions, this un-collapses it
# In order to achieve some of the feats coming up now you have to run etags *.c *.h *.cpp
# (or what ever ending you source files have) in the source directory
M-. (Meta dot) If you are in a function call, this will take you to it\'s definition
M-x tags-search ENTER
M-x tags-search ENTER
Searches through all you etaged
M-, (Meta comma) jumps to the next occurence for tags-search
M-x tags-query-replace yum.

@ -36,7 +36,7 @@ ipython --profile=${profile_name}
%logoff
%logstate
# (to change directories, manipulate directory stacks, and create directory "bookmarks")
# (to change directories, manipulate directory stacks, and create directory "bookmarks")
%cd
%pushd
%popd
@ -46,7 +46,7 @@ ipython --profile=${profile_name}
%reset
# Allows you to see any part of your input history
%hist
%hist
# Search ("grep") through your history by typing
%hist -g somestring

@ -112,7 +112,7 @@ jq 'unique_by(length)'
# Reverse an array
jq 'reverse'
#
#
# ## jq in shell scripts ##
#
@ -128,7 +128,7 @@ jq -n --arg foobaz "$FOOBAZ" '{"foobaz":$foobaz}'
export $(jq -r '@sh "FOO=\(.foo) BAZ=\(.baz)"')
#
#
# ## Input/output formats ##
#

@ -1,6 +1,6 @@
# jshint
#
# JSHint is a fork of JSLint. The reasons for the fork is basically that
#
# JSHint is a fork of JSLint. The reasons for the fork is basically that
# the author disagrees in some points withDouglas Crockford on JavaScript coding style.
#
# If you're looking for a very high standard for yourself or team, JSLint (by Doug Crockford)

@ -4,7 +4,7 @@ lame input.wav output.mp3
# Re-encode existing MP3 to 64 kbps MP3
lame -b 64 original.mp3 new.mp3
# Encode with variable bitrate (quality=2)
# Encode with variable bitrate (quality=2)
# 0 <= quality <= 9 (default = 4). 0 = highest quality
lame -V2 original.wav compressed.mp3
@ -13,11 +13,11 @@ lame -V2 original.wav compressed.mp3
# -m s: save as stereo
# -m j: save as joint stereo (exploits inter-channel correlation
# more than regular stereo)
# -q 2: quality tweaking: the lower the value, the better the
# -q 2: quality tweaking: the lower the value, the better the
# quality, but the slower the algorithm. Default is 5.
#
# By default, lame uses constant bit rate (CBR) encoding.
# You can also use average bit rate (ABR) encoding,
# By default, lame uses constant bit rate (CBR) encoding.
# You can also use average bit rate (ABR) encoding,
# e.g. for an average bit rate of 123 kbps:
lame --abr 123 input.wav output.mp3
@ -25,4 +25,4 @@ lame --abr 123 input.wav output.mp3
lame -v -b 32 -B 192 input.wav output.mp3
# Recode all wav files in all subdirectories
find . -type d -exec sh -c '(cd {} && for i in *.wav; do lame -h -b 128 "$i" "`basename "$i" .wav`".mp3; done)' ';'
find . -type d -exec sh -c '(cd {} && for i in *.wav; do lame -h -b 128 "$i" "`basename "$i" .wav`".mp3; done)' ';'

@ -1,5 +1,5 @@
# pg_top
# Display and update information about the top cpu PostgreSQL processes
# Display and update information about the top cpu PostgreSQL processes
# connect to port 5432 using user postgres, and database, ask for password
pg_top -p 5432 -U postgres -d database -W
@ -15,4 +15,4 @@ pg_top -p 5432 -U postgres -d database -W
# Q
# Display the currently running query of a backend process
# X
# Display user index statistics.
# Display user index statistics.

@ -1,12 +1,12 @@
# ranlib
#
# generates an index to the contents of an archive and stores it in the archive.
# The index lists each symbol defined by a member of an archive that is a relocatable object file.
# The index lists each symbol defined by a member of an archive that is a relocatable object file.
# This creates an index of the contents of fruits.a and stores the index in fruits.a
# This is useful for linking and in case the objects call each other.
ranlib fruits.a
# after
# after
# ar r fruits.a apple.o orange.o pineapple.o
# is called

@ -10,20 +10,20 @@ cd slsc*/
make
# Inside slsc:
#
#
# / Menu cursor to move, return to select
# OR select by first letter
# ? Help (for further help see section help below)
# First letters of a topic+Enter are enough
# Enter to go back
#
#
# CTRL+G mark region ends with CTRL+G
#
#
# Start a text/Enter in a field:
#
#
# < or > to align a text field to left or right
# = to enter a number or a formula
# TAB to edit the text of a cell
# Backspace (<-) do delete the cell content
#
#
# The config file is ~/.slscrc

@ -1,4 +1,4 @@
# tmate - Instant terminal sharing
# tmate - Instant terminal sharing
# tmux fork for screen sharing - https://tmate.io/
tmate
@ -6,7 +6,7 @@ tmate
tmate show-messages
# Launch tmate in a detached state
tmate -S /tmp/tmate.sock new-session -d
tmate -S /tmp/tmate.sock new-session -d
# Blocks until the SSH connection is established
tmate -S /tmp/tmate.sock wait tmate-ready

@ -3,7 +3,7 @@
# https://github.com/tmux/tmux
#
# toc:
# ~window
# ~window
# ~pane
# ~misc
# ~copymode
@ -25,7 +25,7 @@ tmux attach-session
tmux attach-session -t name
# windows (tabs)
# ---
# ---
# c create window
# w list windows
# n next window
@ -38,7 +38,7 @@ tmux attach-session -t name
# ---
# % vertical split
# " horizontal split
#
#
# → go to the left (right, top, bottom) panel
# C-→ resize panel to the left (right, top, bottom) panel
# o swap panes
@ -60,7 +60,7 @@ tmux attach-session -t name
# copy mode (copymode)
# ---
# [ go into copy mode
# [ go into copy mode
# ] paste into the current window
#
# setw -g mode-keys vi # to switch into vi mode

Loading…
Cancel
Save