Some tips for effective computing
Imagine what a harmonious world it could be if every single person, both young and old shared a little of what he is good at doing. -- Quincy Jones
My preferences
I use Windows for most of my work related stuff! I use Ubuntu linux and a macbook for most of my personal stuff.
These are the software tools/packages (emphasized ones more frequently than alternatives) that I use most frequently:
- vim/gvim and emacs.
- R my R related notes, NumPy/SciPy, J, Julia, and Factor.
- NetLogo, and GAMA.
- Python, OCaml, Haskell, Scala, Lua, CLisp, ruby, Clojure, and sometimes Perl.
- PostgreSQL+PostGIS, SQLite, Duckdb, Spark-SQL.
- ENVI, ERDAS Imagine, MultiSpec, Maptitude, QGIS, and ArcGIS/ArcGIS Pro.
- JabRef, and
EndNoteZotero (for bibliography management). - Markdown (pandoc), LaTeX (MikTeX), and MS Office whenever I cannot get away with it!
- Git.
- Paint.NET, Inkscape.
NOTE: I'm willing to answer questions about any of these tools (provided I know the answer)!
General guidelines
- All dates/times should be in ISO-8601 format. I.e., dates should be represented as
YYYY.MM.DD,YYYYMMDD, orYYYY/MM/DDand time should be represented asHHMMSSorHH:MM:SS. - If there is a possibility of confusion of timezone, the time should be, preferably, in UTC timezone or include the local time zone offset. See the explanation on the ISO page.
- Filenames should comprise of alphanumeric characters and underscores. Try to avoid special characters, spaces, and punctuation as a part of filename.
- Filenames should contain enough context information that is independent of folder structure.
- Use version control software!
- Comment your code.
- Pick any coding guideline that you like and stick with it. Be consistent.
- Learn to use a plain text editor efficiently.
- Learn
grep/awk/sed! - Use
make/antor create batch scripts.
- All tables should have PRIMARY KEY.
- Create a schema, named as the username used to login, after a
createdb. Command (assuming username is 'vijay'):CREATE SCHEMA vijay;This makes porting data (during update/migration) much easier. - Default
DateStyleis set toISO, MDY. Change it toISO, YMD. Command:SET DateStyle = 'ISO, YMD'; - Always store
timestamp with time zone(ortimestamptz). This internally stores timestamp in UTC which gets displayed based on current session timezone setting! - PostgreSQL allows DDL in
BEGIN-COMMIT/ROLLBACKtransaction blocks. ALWAYS USE TRANSACTIONS! - Use
ASwhen defining column/table aliases even though it is optional. This simplifies writing queries. - Try to save the schema/table creation commands in a separate SQL script. This will be useful in the future when you need to create the tables without the data. Also, you can version control this script!
- Set the configuration variables
plpgsql.extra_warningsandplgpgsql.extra_errorsto 'all'. Command:SET plpgsql.extra_warnings TO 'all'; SET plpgsql.extra_errors TO 'all';
- If you are joining features to an external Excel (xls[x]/csv) file ensure that there is no space in the column titles! Especially at the end of column titles!
- Always make changes in an edit session! This is the closest thing to transactions(in database parlance).
Solutions to some pesky computer issues
LaTeX: Symbols not available!
I tried to use rhd and Diamond symbols for a LaTeX document and kept on getting the error: LaTeX Error: Command \rhd not provided in base LaTeX2e. This is because we need an extra package. Put \usepackage{latexsym} to get many more symbols in LaTeX.
I found this solution here. Apparently there are many packages that provide all kind of symbols for use in LaTeX. See the comprehensive listing here.
MS Word: Cannot figure out what's causing this issue?
Use MS word in draft/outline view. Set the "Style area pane width..." to some practical value and solve many annoying problems. Shauna Kelly's page at http://www.shaunakelly.com/ under the "Making the most of Word in your business" title lists solutions and best practices for common MS Word issues!