Cours langage GO - annotation - Anthony Le Goff
#INTRO ALGORITHME SOUS GO De l'écriture du premier programme à la logique informatique golang
Premier programme et présentation de "hello world"
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib | |
# in an Alpine based Docker image. | |
FROM alpine:3.4 | |
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories | |
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev | |
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h | |
RUN pip install numpy scipy pandas matplotlib | |
package main | |
// Generate RSA signing files via shell (adjust as needed): | |
// | |
// $ openssl genrsa -out app.rsa 1024 | |
// $ openssl rsa -in app.rsa -pubout > app.rsa.pub | |
// | |
// Code borrowed and modified from the following sources: | |
// https://www.youtube.com/watch?v=dgJFeqeXVKw | |
// https://goo.gl/ofVjK4 |
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"strings" | |
"net/http" | |
"encoding/json" | |
"fmt" | |
"time" |
/* rewritten example of JsonWebToken example | |
* from https://gist.github.com/thealexcons/4ecc09d50e6b9b3ff4e2408e910beb22 | |
* Keys are generated and packed to PEM-format at server start | |
* Plus some fixes and refactors | |
* | |
* My respect to thealexcons | |
*/ | |
package main | |
import ( |
package main | |
import ( | |
"bytes" | |
"code.google.com/p/go.crypto/ssh" | |
"fmt" | |
"io/ioutil" | |
"os" | |
) |
package main | |
import ( | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
"strconv" | |
_ "github.com/go-sql-driver/mysql" |
package main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
// Allocate two-dimensioanl array. | |
a := make([][]uint8, dy) | |
for i := 0; i < dy; i++ { | |
a[i] = make([]uint8, dx) | |
} |
Cours langage GO - annotation - Anthony Le Goff
#INTRO ALGORITHME SOUS GO De l'écriture du premier programme à la logique informatique golang
Premier programme et présentation de "hello world"
{ | |
"heat_template_version": "2014-10-16", | |
"description": "A simple server to run wordpress", | |
"parameters": { | |
"key_name": { | |
"type": "string", | |
"description": "Name of an existing key pair to enable SSH access to the instance." | |
}, | |
"NetID": { | |
"type": "string", |
heat_template_version: 2014-10-16 | |
description: A simple server to run wordpress | |
parameters: | |
key_name: | |
type: string | |
description: Name of an existing key pair to enable SSH access to the instance. | |
default: honey | |
NetID: | |
type: string |