Frag's Writings :: Notes
Notes. A necessary evil to compensate for limited greymatter that a human has. Notes become even more necessary when one is juggling too many things at a time. A simple paper and pen system is often a good start, as compared to keeping everything locked in the noggin, but in this digital age, one cannot help but wonder if there are better ways to deal with the problem of keeping notes and quickly finding them when the need arises.
There are plenty of note-taking applications, often with fancy interfaces and cloud sync capabilities. The problem with these though, is that they do not lend themselves to use in a locked down environment such as a college/work environment where the machine being used has a specific configuration and the user is not granted superuser privileges or the permission to install additional software. Sync is also meaningless in such settings as such computers are often not connected to the internet for "security reasons". How then can one keep and find notes quickly and reliably in such an environment? By (ab)using existing tools and making up some weird conventions of course, aka jugaad.
A simple plain-text based note-taking setup with support for rudimentary tags (and search based on these tags) can be built using just two simple tools found in the standard C or C++ programmer's toolbox, viz. a text-editor and cscope
source indexing and browsing utility (alternatively, ctags
, the code tag generation tool can also be used with suitable changes). Here's how yours truly built and used a system for notes while working thru' various lab exercises from a restricted local user account on college computers:
$HOME
dir for general/catch-all notes or a sub-dir within a specific project (eg: the doc
or misc
folder) for the project/workspace specific stufftouch $(date +"%Y%m%d%H%M)
, for example. This command itself can be alias
ed to something like new_note
for convenience)const int
as the datatype and no initializers, eg: const int meta, mid_term_prj, lab02;
The purpose of declaring tags as variables is to (ab)use cscope
and its capability to quickly jump to definition of variables. To get cscope
to work its magic, the following ritual preparations are necessary:
ls > cscope.files
or similar. Run cscope
over these with cscope -b -q -k
. This will index all the tags (global variable declaration)cscope
in standalone mode with cscope -d
(or from within your editor) and use the Find this C symbol:
or equivalent to search by taggrep
or similarObviously this is an improvised system and has lots of limitations compared to a real note-taking program, some important ones are:
cscope
DB in your editorextern int _tag_to_xref;
or something similar along with Find All References
)I still employ this system on a day-to-day basis (mostly out of habit) along with simple checklists to keep track of what needs to be done and how to go about doing it.