05/02/2015 par Mario Loriedo & Vincent Demeester
C'est une intro, prochaine session dans 1 mois
- outil pour partager env de dev et env de prod (sysadmin) #devops: "build, ship and run" via conteneurs => + rapide, automatisation
| // array | |
| var myArray = [1, 2, 3]; | |
| // set | |
| var mySet = { "foo": true, "bar": true, "baz": true }; | |
| set.foo // true | |
| set.notExists // false | |
| var object = { id: 126878, name: "ZALTRAP 25 mg/ml sol diluer p perf", sid: "vidal://product/126878", title: "ZALTRAP 25 mg/ml sol diluer p perf" }; |
| Part 3 | |
| Introduction to Ruby { | |
| Our focus { | |
| Pure Object-Oriented | |
| no primitives (even numbers) | |
| Class-based | |
| Every object has a class that determines behavior (like Java) |
| ( Introduction to Racket: | |
| Racket: | |
| - functional focus | |
| - with imperative features | |
| - dynamically-types | |
| - minimalist syntax | |
| - advanced features: modules, macros, etc... | |
| (note: we will not use pattern matching, but it exists) |
| Programming languages | |
| (* Emacs tips : | |
| open file: ctr-c ctr-f | |
| copy: M-w, paste: ctr+y | |
| save file: ctr+x ctr+s, | |
| next/previous buffer: ctr+x left/right: | |
| start REPL: ctr+c ctr+s sml, stop REPL: ctr+c ctr+d | |
| stop command interpreter: ctr-g | |
| split window vertically: C-x 2 |
| -- http://learnyouahaskell.com | |
| -- Starting out | |
| ----------------------------------------------------------------------------------- | |
| -- baby's first functions http://learnyouahaskell.com/starting-out#babys-first-functions | |
| doubleMe x = x + x | |
| doubleUs x y = doubleMe x + doubleMe y | |
| doubleSmallNumber x = if x > 100 | |
| then x |
| ### BRANCHES | |
| git checkout -b <branch name> # Create a branch | |
| git branch -r # List remote branches | |
| git checkout <branch name> # Switch to branch (deprecated) | |
| git switch <branch name> # Switch to branch | |
| git checkout <commit ID> # Locally retrieve an old revision | |
| git fetch # retrieve remote changes (commits) without changing local repo ; can be used to fix sync issue | |
| git branch -D branchName # delete local branch | |
| git branch -m <newname> # rename current local branch | |
| git push origin --delete <branchName> # delete remote branch |
| Notes from Coursera course 'Functional Programming Principles in Scala": | |
| https://class.coursera.org/progfun-004 | |
| ✔ Week 1: Functions & Evaluations @done (14-05-01 17:20) | |
| ✔ Lecture 1.1 - Programming Paradigms (14:32) @done (14-04-27 17:54) | |
| 3 paradigms: imperative, functional, logic | |
| OO: orthogonal | |
| imperative: |
| # R code that generates graph for collinear detection, week 3 assigment from Coursera MOOC "Algoritms, part I" (https://www.coursera.org/course/algs4partI). N.B.: input CSV file contains this kind of data: "n,time,algo\n10,0.497,brute\n10,0.006,fast\n# etc...". | |
| library(ggplot2) | |
| d <- read.csv("collinear-timings-brute-vs-fast.csv") | |
| d$algo <- factor(d$algo) | |
| levels(d$algo)[levels(d$algo)=="brute"] <- "Brute force" | |
| levels(d$algo)[levels(d$algo)=="fast"] <- "Fast" |