Skip to content

Instantly share code, notes, and snippets.

@scaomath
Last active Jun 1, 2021
Embed
What would you like to do?
Survive as a grad student in scientific computing

Survive as a grad student in scientific computing

GitHub 101

Git

What is version control? Most jargons in Git have "literal" meanings.

  • pull, commit, push
  • worktree
  • branch, pull request, merge, comments
  • head, stash, pop
  • (intermediate) merging conflict
  • (advanced) submodule
  • (advanced) pull request to others' repo, rebase, incoming vs current change

GUI for git

The best thing about GUI is difference viewer/editor integration:

  • Github desktop
  • SourceTree
  • GitKraken (written in Electron/NodeJS, I recommend this one even it is paid sub, free for Github Edu users)

GitHub

  • Statistics of the repo
  • GitHub website (we can use jekyll to "build" a site)
  • Making friends, expand the network
  • Submit bug report/feature request to other's package

Visual Studio Code

  • We need a good editor, possible candidates: Atom, Sublime Text, JetBrains' bundle (PyCharm, etc).
  • VS Code is an all-in-one package.
  • A pro debugging environment
  • Highly customizable b/c written in Electron/NodeJS
  • Machine-learning driven intelligent code autocompletion
  • Customized snippets
  • Nicely integrated with Git (checkout to branches, resolving conflits)
  • Setting sync across different platforms (YMMV)

Extensions

  • LaTeX workshop
  • GitLens
  • Markdown
  • Python/Jupyter
  • Julia
  • Matlab
  • Docker
  • JS, TypeScript, C/C++, many others

Good coding habit I wish I knew 13 years ago

Here the examples are based on using Dr. Long Chen's iFEM package:

  • Categorize and summarize solutions to common problems, e.g., how to build the incidence matrix based on the topological relation between objects, or even just how to read a pickled file, etc.
  • Write lots of comments even to ourselves.
  • Set up common sandboxes for testing purposes: (example 1) set up explicit procedures (not function calls if in MATLAB) for getting edge related datastructures if we were to code something related to that, instead of directly writing functions. (example 2) set up common test meshes like 8x8 that labeling of the vertices are fixed.
  • To learn advanced vectorization is to come up with a for loop that produces the same thing first.
  • Use Boolean indexing more often, avoid using absolute numerical indexing (more bug prone when concatenating).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment