I remembered a truth I once knew, but lost track of.
Your well-being and happiness is never someone else’s responsibility. It’s an active role you fulfil for yourself.
Go in whichever direction you’d like, but 1) take charge and 2) be deliberate.
You are the management:
- make smart decisions based on trade-offs (e.g. getting enough sleep),
- apply hacks & tricks (e.g. writing down things you are grateful for),
- stay resourceful (e.g. engage social support),
- compromise pragmatically (e.g. focus on what you can change).
Hello and welcome! This post organizes the Google Docs links to lecture notes for ENGL 109 (Winter 2013, taught by Professor Andrew Stubbs). Feel free to bookmark it and/or share it.
- Lecture #1
- Tutorial #1
- Lecture #2
- Tutorial #2 (Away for CUSEC)
- Lecture #3
- Tutorial #3
- Lecture #4
- Tutorial #4
- Lecture #5
- Tutorial #5
- Lecture #6
- Tutorial #6
- Lecture #7
- Tutorial #7
- Lecture #8
Do you like to take lecture notes? I’m looking for a collaborator: e-mail me at sam [at] sampsonchen.com
When I first started using Vim in Ubuntu, I noticed that while editing a file, title bar of the terminal window would display something like this:
which falls just short of being helpful because it omits the most important part: which file exactly is being edited. It is not realistic (and indeed wasteful of mental resources) to keep track of this information especially when often several files are open simultaneously across 5-6 terminal sessions. The problem is yet more pronounced when these files happen to reside in the same directory.
After a bit of digging, I found a solution. Add the following to your ~/.vimrc:
let &titlestring = expand("%:p") if &term == "screen" set t_ts=^[k set t_fs=^[ endif if &term == "screen" || &term == "xterm" set title endif
(Modified from the example at http://vim.wikia.com/wiki/Automatically_set_screen_title – To create ^[, which is escape, you need to enter CTRL+V <Esc>)
This gives you the full path in the title bar:
which worked well enough for about a week, until I came across a simpler (and better) solution. Add the following to your ~/.vimrc instead:
And it will give you the file name first, then the prefixing path, and then “VIM”:
base.py (~/src/reviewboard/reviewboard/reviews/ui) - VIM
TL;DR – add “set title” to your ~/.vimrc
Google search result derped grammar just now.
I recently uncovered a blunder of mine: conflating serialization with serializability in common CS usage.
Serialization is the process of converting data structures / objects (e.g. in memory) into a format suitable for storage or transmission, such that it can be reconstructed later (e.g. Converting each node from a doubly-linked list in memory into JSON, where each serialized object has URI pointers identifying who its neighbours are, or where it belongs in the sequence.)
Serializability has to do with DBMS concurrency control: whether a series of concurrent transactions can be ordered and executed in parallel such that the end result is guaranteed to be the same as if they were executed in sequence.
Also, the definition of Serialize in common English usage:
1. Publish or broadcast (a story or play) in regular installments.
2. Arrange (something) in a series
The idea of serialization wasn’t new to me, but it’s good to finally put a name to it.
This post will be a mix of links to notes and flashcards, among other things. I’ll add new links to here periodically as I find and backdate through archives, or as I make new ones.
===== Flashcards =====
I find self / peer-quizzing with flash cards & doing sample exams to be the most effective ways to study. Memory retrieval exercises work much better than just reading material over and over (not much retention that way).
How to study the decks on QuizLet:
- Uncheck “Both Sides”
- Check “Term First”
- Click to flip the card
- Use left / right arrow keys to move between cards
Alternatively, you can download these study decks from QuizLet.com with iOS apps, just search for “CS 458 UWaterloo”, I found it helpful to quiz myself during commute / in between classes:
===== CS 458 – Computer Security and Privacy =====
===== CS 349 – User Interface =====
===== CS 446 – Software Design & Architecture =====
(These are arranged by slide numbers, but the course content vary from prof to prof:)
(If you really wanted the flashcards for slides #1-3: the online version got deleted – I can upload a local copy, just ask)
===== PHIL 215 – Professional and Business Ethics =====
===== ENGL 109 – Introduction to Academic Writing =====
===== SMF 204 – Introduction to Human Sexuality =====
While working on projects in Linux, I often have to navigate through long directory paths with cd to arrive at the working directory where the most-accessed files are kept. For example:
slc@linux:~$ cd SmileForward/smileforward-backend/sfsite/smileforward/
Smart auto-complete with tab helps, but it’s still rather inefficient, especially when you have to repeat this sequence across multiple terminals (and again every time you restart the OS).
My initial reaction was to write a script with a short name:
slc@linux:~$ vim sf
#!/bin/bash cd SmileForward/smileforward-backend/sfsite/smileforward/
But this apparently doesn’t work, as the shell stays at the same directory after executing the script:
slc@linux:~$ chmod +x sf slc@linux:~$ ./sf slc@linux:~$
After a bit of digging, I discover the problem:
Each time a script is run with dot slash “./”, a brand-new subshell is spawned from the current shell to run whatever is in the script, and then it terminates without affecting the parent shell. So the new shell does change to the specified directory, but then it terminates and control is returned to the parent shell.
To remedy this, here are three different shortcuts:
1. Run the script with . or source:
slc@linux:~$ . sf slc@linux:~/SmileForward/smileforward-backend/sfsite/smileforward$ slc@linux:~/SmileForward/smileforward-backend/sfsite/smileforward$ cd slc@linux:~$ source sf slc@linux:~/SmileForward/smileforward-backend/sfsite/smileforward$
Running a script with . or source executes it within the current shell (without spawning a subshell).
2. Name the shortcut as an environment variable and save it in ~/.bashrc (so bash shell loads it every time a new bash shell spawns):
slc@linux:~$ vim ~/.bashrc
export sf=~/SmileForward/smileforward-backend/sfsite/smileforward slc@linux:~$ cd $sf slc@linux:~/SmileForward/smileforward-backend/sfsite/smileforward$
3. Make an alias for the cd script (best solution)
slc@linux:~$ vim ~/.bashrc
# run the command closed by single quotes when sf is encountered alias sf='cd ~/SmileForward/smileforward-backend/sfsite/smileforward' slc@linux:~$ sf slc@linux:~/SmileForward/smileforward-backend/sfsite/smileforward$
Alternatively, the alias can be:
# Run the sf script from option 1 alias sf='. ~/sf'
# cd to the sf environment variable from option 2 alias sf='cd $sf'
Hopefully this saves you some time when navigating between commonly visited directories in Linux.
Another very popular solution for changing directories is z (https://github.com/rupa/z). I’m new to z, so it’s left up to the reader to explore.
(P.S. you can also symlink to the directory: ~/SmileForward/smileforward-backend/sfsite/smileforward/, but this leads to a less versatile result as there’s no easy way to move up to a parent directory)