Skip to content

Instantly share code, notes, and snippets.

Jean-Robert jean-robert

View GitHub Profile
View gist:8ee2a4f0345b8388cdd2
Verifying that +jean_robert is my openname (Bitcoin username). https://onename.io/jean_robert
@jean-robert
jean-robert / ttt.py
Created Nov 13, 2014
Tic-tac-toe Reinforcement Learning
View ttt.py
import random
import copy
class TTTGame:
board = [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']
playerX = None
playerO = None
def showBoard(self):
@jean-robert
jean-robert / server.R
Created Nov 11, 2013
Vertical align test for Shiny
View server.R
library(shiny)
shinyServer(function(input, output) {
output$distPlot <- renderPlot({
dist <- rnorm(input$obs)
hist(dist)
})
output$distPlot2 <- renderPlot({
@jean-robert
jean-robert / server.R
Created Nov 20, 2012
Prime Factorization Visualization in R and Shiny
View server.R
library(shiny)
library(gmp)
drawStar <- function(center, length, pts, direction=0, segments=F, colour=F) {
if(length(pts)==0) return()
if(segments & (pts[1]==2)) direction <- direction + pi/2
for(i in 1:pts[1]) {
point <- center +
length*c(cos(direction+pi/2+i*2*pi/pts[1]),
sin(direction+pi/2+i*2*pi/pts[1]))
@jean-robert
jean-robert / ArduinoTemperatureSketch.ino
Created Nov 11, 2012
Temperature recorder with Arduino/Java/R
View ArduinoTemperatureSketch.ino
/* Original code from the Arduino Experimentation Kit Example Code |
* CIRC-10 .: Temperature :. (TMP36 Temperature Sensor) |
* Amended to be used in Java/R
*/
//TMP36 Pin Variables
int temperaturePin = 0;
void setup()
{
@jean-robert
jean-robert / friendscluster.R
Created Jan 22, 2012
Cluster your Facebook friends
View friendscluster.R
require(igraph)
require(RCurl)
require(rjson)
# Insert your own token
access_token <- '****'
# Romain François's function to connect to Facebook Graph API
facebook <- function( path = "me", access_token = token, options) {
if( !missing(options) ){
You can’t perform that action at this time.