Skip to content

Instantly share code, notes, and snippets.

View hackolite's full-sized avatar

hackolite hackolite

  • Lamaaz
  • France:Aulnay-sous-Bois
View GitHub Profile
@hackolite
hackolite / webcam.py
Created April 30, 2012 11:59
Visualisation toolkit
import pygame
import Image
from pygame.locals import *
import sys
import opencv
#this is important for capturing/displaying images
from opencv import highgui
@hackolite
hackolite / OOB : python toolbox for bioreactor management
Last active October 13, 2015 20:28
OOB : python toolbox for bioreactor management
import smtplib
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
import os
import Image
from PIL import Image
import random
import time
import pylab
import time
@hackolite
hackolite / bench.py
Created March 1, 2013 14:07
This script use the brian module (neuroscience), to benchmark cpu(s) from a computer.
'''
Model fitting example using several machines.
Before running this example, you must start the Playdoh server on the remote machines.
'''
from brian import loadtxt, ms, Equations
#!/usr/bin/python
#*****************************************************************************
#
# Copyright (c) 2013 Andrea Bonomi <[email protected]>
#
# Published under the terms of the MIT license.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
@hackolite
hackolite / worm.py
Last active August 17, 2025 17:47
worm.py
#!/usr/bin/env python
"""
Author: [email protected]
Mister Smith:
Mobility :
Sens :
Neural network
"""
#include <OneWire.h>
// OneWire DS18S20, DS18B20, DS1822 Temperature Example
//
// http://www.pjrc.com/teensy/td_libs_OneWire.html
//
// The DallasTemperature library can do all this work for you!
// http://milesburton.com/Dallas_Temperature_Control_Library
OneWire ds(2); // on pin 10 (a 4.7K resistor is necessary)
char NOMBRE[10] = "SENS01"; // le nom du module
char BPS = '4'; // 1=1200 , 2=2400, 3=4800, 4=9600, 5=19200, 6=38400, 7=57600, 8=115200
char PASS[10] = "1234"; // le mot de passe
void setup()
{
Serial.begin(9600);
pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
delay(10000);
# simple inquiry example
# votre module bluetooth doit etre connecte au prealable
import bluetooth
import sys
nearby_devices = bluetooth.discover_devices(lookup_names=True)
print("found %d devices" % len(nearby_devices))
for addr, name in nearby_devices:
print(" %s - %s" % (addr, name))
char val; // variable to receive data from the serial port
void setup() {
Serial.begin(9600); // start serial communication at 9600bps
}
void loop() {
# Heavily based on the XML-RPC implementation in python.
# Based on the json-rpc specs: http://json-rpc.org/wiki/specification
# The main deviation is on the error treatment. The official spec
# would set the 'error' attribute to a string. This implementation
# sets it to a dictionary with keys: message/traceback/type
import cjson
import SocketServer
import sys
import traceback