Skip to content

Latest commit

 

History

History
262 lines (197 loc) · 11.6 KB

computer-science.md

File metadata and controls

262 lines (197 loc) · 11.6 KB

Computer Sciences

Some notes on computer science, mostly online sources.

Programming Languages

Racket

Load racket package, when #lang sicp is used

  • load a whole package
    (#%require <racket package name>)
    
    ;; e.g.
    (#%require racket/base)   ; load racket base
    (#%require sicp-pict)     ; load sicp picture package
  • load selected identifiers from package
    (#%require (only <racket package name>
                     <identifiers, space seperated>))
    
    ;; e.g.
    ; load `provide` and `all-defined-out` from racket base,
    ; and load these two only
    (#%require (racket/base provide all-defined-out))

Load sub file, when #lang sicp is used

  1. export identifiers in the included sub file
    ;; sub file
    ; export selected identifiers
    (provide <identifiers, space seperated>)
    
    ; export all defined identifiers in the current file
    (provide (all-defined-out))
    
    ;; e.g. 1
    (#%require (only racket/base provide))
    
    (provide square double)
    (define (square x) (* x x))
    (define (double x) (+ x x))
    
    ;; e.g. 2
    (#%require (only racket/base provide all-defined-out))
    (provide (all-defined-out))
    
    (define (square x) (* x x))
    (define (double x) (+ x x))
    (define (halve x)
      (if (even? x)
          (/ x 2)
          (error "ERROR: invalid input, not even")))
  2. load sub file in the main file
    ;; main file
    (#%require "<path to sub file>")
    
    ;; e.g.
    ; load file with relative path
    (#%require "exercise_1.43.rkt")
    (#%require "../chapter02/exercise_2.20.rkt")

Run code only when current file is not required as a module

#lang sicp

(#%require (only racket/base module+))
(module+ main
  ...)  ; the body accumulates
        ; and `main` is executed at the end of current module

Scheme

C

Textbook

The C Programming Language, 2nd Edition, by Kernighan and Ritchie (K&R2)

  • Solutions provided by clc-wiki, an offshoot of the comp.lang.c newsgroup

Discussion

Other Languages, mostly markup ones

Markdown

HTML

  • Default link colors (ref to HTML Spec, answer)
    :link { color: #0000EE; }
    :visited { color: #551A8B; }
    :link:active, :visited:active { color: #FF0000; }
    :link, :visited { text-decoration: underline; cursor: pointer; }

JSON (JavaScript Object Notation)

ABNF (Augmented BNF)

EBNF (Extended BNF)

General Books

Introduction to Computation and Programming Using Python, Second Edition

How to Design Programs (2e)

  • Online full-text, both 1st (with full solutions) and 2nd editions.
  • From slides of talk Matthias Felleisen gave at RacketCon 2011, there is a four-books plan with HtDP and How to Design Components (now called Classes, see webpage of HtDC) the first two.

Structure and Interpretation of Computer Programs (SICP)

Algorithms in a Nutshell (2e)

Category Theory for Programmers, by Bartosz Milewski

Parsing Techniques - A Practical Guide, by Dick Grune and Ceriel J.H. Jacobs

Pattern Recognition and Machine Learning, by Christopher Bishop

Dive into Deep Learning

  • Authors: Aston Zhang, Zack C. Lipton, Mu Li, and Alex J. Smola
  • Introduction: A free and interactive deep learning book for students, engineers, and researchers.
  • Online version: en, zh-cn

Advanced Programming in the UNIX Environment

http://www.apuebook.com/

Tools

SSH

MySql

When SHOW DATABASES; showing

ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist

after updating the mysql, run

mysql_upgrade --force -uroot -p

to upgrade tables.

Related links: