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 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 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. int b = a[0] // Set variable b to 420 by accessing index 0 of array a.

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

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

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

@ -1,10 +1,10 @@
// Vectors are sequence containers representing arrays that can change in size. // Vectors are sequence containers representing arrays that can change in size.
// Library to include // Library to include
#include <vector> #include <vector>
vector<int> a; // Declare an empty vector, a. vector<int> a; // Declare an empty vector, a.
a.push_back(1); // Appends/Adds an element whose value is 1 to 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. std::cout << a.at(0) << std::endl; // Accessing index 0 of vector a.
a.size(); // Returns the size of the vector 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)| // |`&^` |bit clear (and not)|
// |`<<` |left shift | // |`<<` |left shift |
// |`>>` |right shift| // |`>>` |right shift|
// //
// ### Comparison // ### Comparison
// |Operator|Description| // |Operator|Description|
// |--------|-----------| // |--------|-----------|
@ -22,14 +22,14 @@
// |`<=` |less than or equal| // |`<=` |less than or equal|
// |`>` |greater than| // |`>` |greater than|
// |`>=` |greater than or equal| // |`>=` |greater than or equal|
// //
// ### Logical // ### Logical
// |Operator|Description| // |Operator|Description|
// |--------|-----------| // |--------|-----------|
// |`&&` |logical and| // |`&&` |logical and|
// |`||` |logical or | // |`||` |logical or |
// |`!` |logical not| // |`!` |logical not|
// //
// ### Other // ### Other
// |Operator|Description| // |Operator|Description|
// |--------|-----------| // |--------|-----------|

@ -1,5 +1,5 @@
// There are no classes, only structs. Structs can have methods. // 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 // Declaration
type Vertex struct { type Vertex struct {
@ -8,7 +8,7 @@ type Vertex struct {
// Creating // Creating
var v = Vertex{1, 2} 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 var v = []Vertex{{1,2},{5,2},{5,5}} // Initialize a slice of structs
// Accessing members // Accessing members
@ -31,7 +31,7 @@ func (v *Vertex) add(n float64) {
v.Y += n v.Y += n
} }
// **Anonymous structs:** // **Anonymous structs:**
// Cheaper and safer than using `map[string]interface{}`. // Cheaper and safer than using `map[string]interface{}`.
point := struct { point := struct {
X, Y int X, Y int

@ -1,8 +1,8 @@
// ## Packages // ## Packages
// * Package declaration at top of every source file // * Package declaration at top of every source file
// * Executables are in package `main` // * Executables are in package `main`
// * Convention: package name == last name of import path (import path `math/rand` => package `rand`) // * Convention: package name == last name of import path (import path `math/rand` => package `rand`)
// * Upper case identifier: exported (visible from other packages) // * 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 // 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 // Null is an Object
typeof null // => 'object' typeof null // => 'object'
@ -22,7 +22,7 @@ new Array() == false // -> true
// big integer numbers // big integer numbers
9999999999999999 // -> 10000000000000000 9999999999999999 // -> 10000000000000000
// //
[]+[] // -> "" []+[] // -> ""
[]+{} // -> "[object Object]" []+{} // -> "[object Object]"
{}+[] // -> "{}+[]" {}+[] // -> "{}+[]"

@ -1,11 +1,11 @@
-- to install: -- to install:
-- (Debian/Ubuntu) apt-get install lua -- (Debian/Ubuntu) apt-get install lua
-- (Fedora/CentOS) yum 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 -- cd lua-5.3.4
-- make linux -- make linux
-- --
-- to execute: -- to execute:
-- lua hello.lua -- lua hello.lua
io.write("Hello world, from ",_VERSION,"!\n") 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 # Simple Factorial Python Recursion
def factorial(n) : def factorial(n) :
if n == 0 : if n == 0 :
return 1 return 1
else : else :
return n * factorial(n-1) return n * factorial(n-1)
# Simple Greatest Common Divisor Recursion # Simple Greatest Common Divisor Recursion
def gcd(x, y) : def gcd(x, y) :
if y == 0 : if y == 0 :
return x return x
else : else :
return gcd(y, x%y) return gcd(y, x%y)

@ -8,7 +8,7 @@
async fn do_work() -> String { ... } async fn do_work() -> String { ... }
fn do_work() -> impl Future<Output = 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 // 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 // and continuously polls them to completion. Here, we'll use tokio, a mature and
// battle-tested library. // battle-tested library.

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

@ -3,7 +3,7 @@ if (check) happy else sad
// conditional sugar // conditional sugar
if (check) happy // same as if (check) happy // same as
if (check) happy else () if (check) happy else ()
// multiple conditions // multiple conditions
if (check) happy else if(secondCheck) lessHappy else () if (check) happy else if(secondCheck) lessHappy else ()
@ -57,7 +57,7 @@ for (i <- 1 until 5) {
// recursion // recursion
// can yield a "java.lang.StackOverflowError" with large lists // 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 // 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 Nil => 0
case x :: tail => x + sum(tail) case x :: tail => x + sum(tail)
} }

@ -1,7 +1,7 @@
// define function // define function
// GOOD // GOOD
def f(x: Int) = { x*x } def f(x: Int) = { x*x }
// BAD // BAD
// hidden error: without = its a Unit-returning procedure; causes havoc // hidden error: without = its a Unit-returning procedure; causes havoc
def f(x: Int) { x*x } def f(x: Int) { x*x }
@ -21,7 +21,7 @@ def f(x: R)
def f(x: => R) def f(x: => R)
// anonymous function // anonymous function
(x:R) => x*x (x:R) => x*x
// anonymous function: underscore is positionally matched arg. // anonymous function: underscore is positionally matched arg.
(1 to 5).map(_*2) // vs. (1 to 5).map(_*2) // vs.
@ -31,7 +31,7 @@ def f(x: => R)
(1 to 5).map( x => x*x ) (1 to 5).map( x => x*x )
// anonymous function: bound infix method. Use 2*_ for sanitys sake instead. // anonymous function: bound infix method. Use 2*_ for sanitys sake instead.
// GOOD // GOOD
(1 to 5).map(2*) (1 to 5).map(2*)
// BAD // BAD
(1 to 5).map(*2) (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 # 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 # Recursive programs - Pseduocode
function factorial: function factorial:
input: integer n such that n >= 0 input: integer n such that n >= 0
output: n * (n-1) * (n-2) * ... * 1 = n! 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) ) 2. else, return ( n * factorial(n-1) )

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

@ -5,22 +5,22 @@
dumpe2fs /dev/sdb1 | less dumpe2fs /dev/sdb1 | less
# Print the blocks which are reserved as bad in the filesystem # 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 # 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. # 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 # Force dumpe2fs to display a filesystem
dumpe2fs -f /dev/sda1 dumpe2fs -f /dev/sda1
# Only display the superblock information # Only display the superblock information
dumpe2fs -h dumpe2fs -h
# Display the filesystem data from an image file created by e2image # 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 # Print the detailed group information block numbers in hexadecimal format
dumpe2fs -x dumpe2fs -x

@ -1,10 +1,10 @@
# Elm # 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 # Start Elm REPL
elm repl elm repl
# Default compilation # Default compilation
elm make HelloWorld.elm -> index.html elm make HelloWorld.elm -> index.html
# Custom name # Custom name

@ -52,7 +52,7 @@
C-x u undo previous action C-x u undo previous action
M-x revert-buffer RETURN M-x revert-buffer RETURN
(insert like this) undo all changes since last save (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 Recover text from an autosave-file
M-x recover-session RETURN M-x recover-session RETURN
if you edited several files if you edited several files
@ -101,7 +101,7 @@
C-s repeat incremental search C-s repeat incremental search
M C-r incremental search backwards M C-r incremental search backwards
C-r repeat backwards C-r repeat backwards
M-x query-replace-regexp M-x query-replace-regexp
search and replace search and replace
# Window-Commands # Window-Commands
@ -110,7 +110,7 @@
C-x 0 delete window C-x 0 delete window
C-x 1 close all windows except the one the cursors in C-x 1 close all windows except the one the cursors in
C-x ^ enlarge window C-x ^ enlarge window
M-x shrink-window M-x shrink-window
command says it ;-) command says it ;-)
M C-v scroll other window M C-v scroll other window
C-x 4 f find file in 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-u go to beginning of this preprocessor statement
C-c C-c comment out marked area C-c C-c comment out marked area
# More general # More general
M-x outline-minor-mode M-x outline-minor-mode
collapses function definitions in a file to a mere {...} 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 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 # 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 # (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-. (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 Searches through all you etaged
M-, (Meta comma) jumps to the next occurence for tags-search M-, (Meta comma) jumps to the next occurence for tags-search
M-x tags-query-replace yum. M-x tags-query-replace yum.

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

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

@ -1,6 +1,6 @@
# jshint # 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. # 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) # 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 # Re-encode existing MP3 to 64 kbps MP3
lame -b 64 original.mp3 new.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 # 0 <= quality <= 9 (default = 4). 0 = highest quality
lame -V2 original.wav compressed.mp3 lame -V2 original.wav compressed.mp3
@ -13,11 +13,11 @@ lame -V2 original.wav compressed.mp3
# -m s: save as stereo # -m s: save as stereo
# -m j: save as joint stereo (exploits inter-channel correlation # -m j: save as joint stereo (exploits inter-channel correlation
# more than regular stereo) # 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. # quality, but the slower the algorithm. Default is 5.
# #
# By default, lame uses constant bit rate (CBR) encoding. # By default, lame uses constant bit rate (CBR) encoding.
# You can also use average bit rate (ABR) encoding, # You can also use average bit rate (ABR) encoding,
# e.g. for an average bit rate of 123 kbps: # e.g. for an average bit rate of 123 kbps:
lame --abr 123 input.wav output.mp3 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 lame -v -b 32 -B 192 input.wav output.mp3
# Recode all wav files in all subdirectories # 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 # 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 # connect to port 5432 using user postgres, and database, ask for password
pg_top -p 5432 -U postgres -d database -W pg_top -p 5432 -U postgres -d database -W
@ -15,4 +15,4 @@ pg_top -p 5432 -U postgres -d database -W
# Q # Q
# Display the currently running query of a backend process # Display the currently running query of a backend process
# X # X
# Display user index statistics. # Display user index statistics.

@ -1,12 +1,12 @@
# ranlib # ranlib
# #
# generates an index to the contents of an archive and stores it in the archive. # 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 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. # This is useful for linking and in case the objects call each other.
ranlib fruits.a ranlib fruits.a
# after # after
# ar r fruits.a apple.o orange.o pineapple.o # ar r fruits.a apple.o orange.o pineapple.o
# is called # is called

@ -10,20 +10,20 @@ cd slsc*/
make make
# Inside slsc: # Inside slsc:
# #
# / Menu cursor to move, return to select # / Menu cursor to move, return to select
# OR select by first letter # OR select by first letter
# ? Help (for further help see section help below) # ? Help (for further help see section help below)
# First letters of a topic+Enter are enough # First letters of a topic+Enter are enough
# Enter to go back # Enter to go back
# #
# CTRL+G mark region ends with CTRL+G # CTRL+G mark region ends with CTRL+G
# #
# Start a text/Enter in a field: # Start a text/Enter in a field:
# #
# < or > to align a text field to left or right # < or > to align a text field to left or right
# = to enter a number or a formula # = to enter a number or a formula
# TAB to edit the text of a cell # TAB to edit the text of a cell
# Backspace (<-) do delete the cell content # Backspace (<-) do delete the cell content
# #
# The config file is ~/.slscrc # 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/ # tmux fork for screen sharing - https://tmate.io/
tmate tmate
@ -6,7 +6,7 @@ tmate
tmate show-messages tmate show-messages
# Launch tmate in a detached state # 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 # Blocks until the SSH connection is established
tmate -S /tmp/tmate.sock wait tmate-ready tmate -S /tmp/tmate.sock wait tmate-ready

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

Loading…
Cancel
Save