Noob Coding
This is the repo of my notes. Now live on https://www.noobcoding.com/!

Goal

    Teach: Try to develop a fast-learning process to help others grasp programming as quickly as possible. Focuses on speedrun so it does not guarantee insightful knowledge and is by no means comprehensive. However, some interesting stuff would be provided marked optional.
    Teach Myself: Should be able to review or preview many important topics in our industry.
    Improve: Since we are working in a fast-changing industry, the ability of fast-learning, or revolutionizing ourselves, is the most valuable asset in ourselves. Hopefully, a system of fast-learning could be established within this project.

Method

Pick any topic you want. But I would recommend (with bias):
    For data scientists or anyone who wishes to learn AI (Trending): Python -> Big Data -> Machine Learning
    For those who want to build a website: LNMP
    For those who want to have some fun and see immediate feedback: Frontend
    For students or those who wish to find jobs: Java -> LeetCode
    For architects: PowerPoint
    For architects who want to write some real code besides PowerPoints: C++/Java -> Search Engine/Distributed Systems

Basic

Effectiveness

A few tips and tools to boost development effectiveness.
    Environment: Instead of working as root with too much privilege and too many folders, I prefer creating several linux users to seperately manage projects when I get my hands on a new machine.
    1
    sudo adduser ocean
    2
    sudo passwd ocean
    3
    # Then add line `ocean ALL=(ALL) ALL` in `/etc/sudoers` to enable `sudo` command
    Copied!
    Next time log in as 'ocean' and start messing around.
    Command Line: The simplest way to improve command line usability is to modify the ~/.bashrc file. Always add your working directory as aliases or use bashmarks.
    .bashrc PS1 generator is a good site to create useful bash prompt style. My favourite:
    1
    function git-branch-name {
    2
    git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3
    3
    }
    4
    5
    function git-branch-prompt {
    6
    local branch=`git-branch-name`
    7
    if [ $branch ]; then printf " [%s]" $branch; fi
    8
    }
    9
    export PS1="\[\033[38;5;11m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\h:\[$(tput sgr0)\]\[\033[38;5;6m\]\w\[$(tput sgr0)\]\[\033[38;5;2m\]\$(git-branch-prompt)\[$(tput sgr0)\]\[\033[38;5;14m\]:\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
    Copied!
    And some useful aliases:
    1
    alias psgrep='ps -eo pid,lstart,cmd | grep -v grep | grep --color'
    2
    alias grep='grep --color'
    3
    alias zhcn='export LANG=zh_CN.GBK;export LC_ALL=zh_CN.GBK;export LC_CTYPE=zh_CN.GBK'
    4
    alias enus='export LANG=en_US.UTF-8;export LC_ALL=en_US.UTF-8;export LC_CTYPE=en_US.UTF-8'
    5
    alias ..='cd ..'
    6
    alias ...='cd ..; cd ..'
    7
    alias ....='cd ..; cd ..; cd ..'
    8
    alias l.='ls -d .* --color=auto'
    9
    alias ll='ls -l --color=auto'
    10
    alias ls='ls --color=auto'
    11
    12
    # This pull or push from master branch. You might need to change this.
    13
    alias pull='git pull origin master'
    14
    alias push='git push origin master'
    15
    alias cm='git commit -m '
    Copied!
    Vim: I use The Ultimate vimrc with some personal settings in ~/.vim_runtime/vimrcs/my_configs.vim:
    1
    set gcr=a:blinkon0
    2
    set cursorline
    3
    set cuc
    Copied!
    Samba/FTP
    Useful Commands
    1
    df -h # Machine overall disk usage
    2
    du -sh * # File and folder size at current folder
    Copied!

Version Control

    Install git: sudo yum install git If you are using CentOS, other checkout git download page
    Setting up git:
    1
    # remove --global if you are configuring different user for different project.
    2
    git config --global user.name "Your Name"
    3
    git config --global user.email "[email protected]"
    4
    git config --list
    Copied!
    Github user: There are two kinds of url to clone your project: HTTPS and SSH. I recommend (the SSH way)[https://help.github.com/en/github/using-git/which-remote-url-should-i-use#cloning-with-ssh-urls] since it helps you type your Github password less in the future:
      Get your local SSH keys:
    1
    ls -al ~/.ssh # check if you already have one
    2
    # if not:
    3
    ssh-keygen -t rsa -b 4096 -C "[email protected]" # and hit enter all the way
    Copied!
      Add your private SSH key to the ssh-agent:
    1
    eval "$(ssh-agent -s)"
    2
    ssh-add ~/.ssh/id_rsa
    Copied!
      Add your public SSH key to your Github account:
    1
    cat ~/.ssh/id_rsa.pub
    2
    # Then copy the content
    3
    # and add to Github: Settings -> SSH and GPG keys -> click New SSH key -> put in the 'key' field->click Add SSH key
    Copied!
    For each project, use a .gitignore file to avoid submitting sensitive/large/unwanted files to git: https://github.com/github/gitignore

Github

Java

Grasp Java Programming in a few days with a simple online tutorial.
    Installation
    Download JDK (I would recommend Java SE Development Kit 8) from the Oracle website.
    Java Development Kit > Java Runtime Environment > Java Virtual Machine
    .java -> $javac -> .class -> $java
      byte, short, int, long: 1, 2, 4, 8 byte(s) length integer
      float and double: 4, 8 byte(s) length decimal(6/7 decimal digits, 15 decimal digits). Always suffix float value with the "f" else compiler will consider it as double
      1
      double num1 = 22.4;
      2
      float num2 = 22.4f;
      Copied!
      char: 2 bytes length
      boolean: true and false with lowercase initials
      Non-primitive: Arrays and Strings
    "Unique" Grammer
      Enhanced for loop:
      1
      String arr[]={"hi","hello","bye"};
      2
      for (String str : arr) {
      3
      System.out.println(str);
      4
      }
      Copied!
      do-while loop
    Object-Oriented Programming
      this.
      Inheritance: With extends. Multiple inheritance is not allowed in Java.
      1
      class A extends B
      2
      {
      3
      }
      Copied!
      Polymorphism: Apart from method overriding, Java allowed method overloading within a class using different method signature (same method name, different parameters).
      1
      class DisplayOverloading
      2
      {
      3
      public void disp(char c)
      4
      {
      5
      System.out.println(c);
      6
      }
      7
      public void disp(char c, int num)
      8
      {
      9
      System.out.println(c + " "+num);
      10
      }
      11
      }
      Copied!
      Abstract Method: Method with only signature no body (declared but not defined) or declared using the abstract keyword.
      1
      abstract public void playInstrument();
      Copied!
        The class that inherits must provide the implementation of all the abstract methods of parent class else declare the subclass as abstract.
        These methods cannot be abstract: Constructors, Static methods, Private methods, Methods that are declared "final".
      Abstract Class: An abstract class outlines the methods but not necessarily implements all the methods.
      1
      abstract class A{
      2
      abstract void myMethod();
      3
      void anotherMethod(){
      4
      //Does something
      5
      }
      6
      }
      Copied!
        Cannot be instantiated.
        A class derived from the abstract base class must implement those methods that are not implemented(means they are abstract) in the abstract class.
      Interface: With interface.
      1
      Interface Interface1
      2
      {
      3
      String a;
      4
      void b();
      5
      }
      6
      //...
      7
      class ClassName extends Superclass implements Interface1, Interface2
      Copied!
        Can contain only constants and abstract methods.
        Cannot be instantiated.
        Can only be implemented by classes or extended by other interfaces.
        Java does not support Multiple Inheritance, however a class can implement more than one interfaces.
        All methods in an interface are implicitly public and abstract. Using the keyword abstract before each method is optional.
        An interface may contain final variables.
        When a class implements an interface it has to give the definition of all the abstract methods of interface, else it can be declared as abstract class.
        An interface reference can point to objects of its implementing classes.
      Access Specifiers: public/private/protected/Default(Package Level scope)

C++

Also, start with any tutorial like this one from cplusplus.com. But you should realize that C++ IS HARD, because it's both old and powerful.

Full Stack Dev

    Limit on url length (that affects the lengths of your GET uri and parameters unless you know what you are doing): unbounded. But being less than 2000 char would be most compatible. source.
Last modified 1yr ago