Skip to content
This repository was archived by the owner on Jun 25, 2021. It is now read-only.

tutorial programming

Tianshu Huang edited this page Oct 3, 2018 · 3 revisions

Programming Environments, Version Control, and Unix

To start, make sure [Rasware] is installed and configured on Linux or OSX.

If you're on a Windows system, you can dual boot Linux, run a Linux VM, or install the Windows Subsystem for Linux.

Unix

The Unix terminal extremely powerful (not to be confused with windows' CMD, which is absolute garbage). Since OSX is Unix-based, these commands will also work on OSX.

  • ls: list current directory
  • cd "folder": Change directory to a target folder. If the folder starts with '/', then the folder to switch to is an absolute filepath relative to the root folder of the machine. Otherwise, the folder is relative to the current folder.
  • cd ..: Change to the parent directory of the current working directory.
  • mkdir "folder": create a new folder
  • rm "file": Remove a file
  • rmdir "directory": Remove a directory
  • rm -r "file": Remove a file or directory recursively - removes all contents of the file

Text Editors

In order to write code, check out a text editor, such as (in order of difficulty):

  • Sublime Text - Has point-and-click operation. This is my personal recommendation since it has a python API and a large collection of plugins that can add the extensive keyboard shortcuts used by more sophisticated editors (sublime-emacs)
  • Emacs (sudo apt-get install emacs)
  • Vi/Vim (sudo apt-get install vim; should come pre-installed on most distributions of Linux)

Git/GitHub and Version Control

Version control is a process in which changes to a code base are tracked.

We recommend that you use Git and GitHub to organize your Robotathon code. Git is the name of the version control software; GitHub (where Rasware is hosted!) is a service that runs a git server, and a web front end.

Fork and Clone Rasware

First, one member of your team should fork Rasware by clicking the 'Fork' button at the top right of the Rasware repository. This repository should then be available at github.com/<your_username>/Rasware.

Then, clone the repository:

git clone https://github.com/<your_username>/Rasware

Make changes and commit

Once you make changes to a repository, the changes are initially stored on your local filesystem.

Local files <-add-> Staging area <-commit-> Local Git <-push-> Remote Git (GitHub)

Add changes/files to the local staging area with

git add --all

Remove changes/files from the staging area with

git reset

"Commit" files from the staging area to the local git server

git commit

"Push" files from the local git server to the remote git server (GitHub):

git push
Clone this wiki locally