This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var _ = {}; | |
_.concat = function(destination, source) { | |
for (var property in source) { | |
if (source.hasOwnProperty(property)) { | |
destination[property] = source[property]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mouse | |
constructor: (el) -> | |
@el = el | |
@x = 0 | |
@y = 0 | |
@click = null | |
@mtime = 0 | |
@loose = null | |
document.addEventListener('mousedown', @onmousedown) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*#--------------------------#*/ | |
/*# CanvasRenderingContext2D #*/ | |
/*#--------------------------#*/ | |
/** TODO : Name & Code & Test | |
* Récupère le bout d'une image à afficher | |
* | |
* @param img {Image} Image à couper | |
* @param width {int} Taille en largeur à couper | |
* @param height {int} Taille en hauteur à couper | |
* @param x {number} Position x à laquelle l'image sera affichée |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
function object_merge(obj1, obj2){ | |
var obj3 = {}; | |
for (var attrname in obj1) | |
obj3[attrname] = obj1[attrname]; | |
for (var attrname in obj2) | |
obj3[attrname] = obj2[attrname]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
function bar_chart(el, datas) { | |
// Récupération de la zone de dessin | |
var can = document.getElementById(el); | |
var ctx = can.getContext('2d'); | |
// Récupération de la valeur maximale | |
var max_of_array = 0; | |
for (var i = 0, nb_datas = datas.length ; i < nb_datas ; i++) { | |
if (datas[i][0] > max_of_array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The base constructor (can be left empty, but a nice boilerplate might look like this) | |
function Class(properties) { | |
if (properties) { | |
// Add properties to the instance | |
Object.getOwnPropertyNames(properties).forEach(function (property_name) { | |
var descriptor = Object.getOwnPropertyDescriptor(properties, property_name); | |
Object.defineProperty(this, property_name, descriptor); | |
}, this); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Two dashes start a one-line comment. | |
--[[ | |
Adding two ['s and ]'s makes it a | |
multi-line comment. | |
--]] | |
---------------------------------------------------- | |
-- 1. Variables and flow control. | |
---------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Contrôle du clavier</title> | |
<style> | |
html, body { | |
background-color: rgb(255, 255, 255); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <winsock2.h> | |
#include <windows.h> | |
#define SERVER_ADDR "192.168.0.50" | |
// #define SERVER_ADDR "127.0.0.1" | |
#define SERVER_PORT 9002 | |
int main (int argc, char *argv[]) { | |
char buff[256]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <time.h> | |
int main (int argc, char *argv[]) { | |
srand(time(NULL)); | |
int nb_rand = rand() % 100; | |
int saisie = -1; | |
int nb_essais = 0; |
OlderNewer