Skip to content

Instantly share code, notes, and snippets.

View ladislas's full-sized avatar
💭
...

Ladislas de Toldi ladislas

💭
...
View GitHub Profile
// ça c'est la partie qui dit à node qu'on va utiliser le module (librairie ou API) 'brain' et donc on crée une instance de ce module dans la variable brain (on prend toujours une variable du nom du module, par concention (ce qui est parfois débile et on comprend plus rien, ce qui est un peu le problème de js mais bon, rien ne nous empêche de le faire plus proprement pour nous!))
var brain = require('brain')
// là je crée une instance de l'objet NeuralNetwork() que j'appelle net.
var net = new brain.NeuralNetwork();
// là je l'entraine, * correspond à une valeur de la variable normalisée entre -1 et 1
net.train(
[
{
var serialport = require("serialport"),
SerialPort = serialport.SerialPort,
myPort;
var Fiber = require('fibers');
// Delay function using fibers
function sleep(ms) {
var fiber = Fiber.current;
setTimeout(function() {
@ladislas
ladislas / ISO690Numerical.XSL
Created August 30, 2013 15:07
ISO 690 bibliographic style for MS Word 2011 for Mac OS X. The needed changes have been made so that the file is recognized by Word. Original file here: http://www.chrisellsworth.com/downloads/ISO690Nmerical.XSL Modifications to be made on line 1 and 8
<!-- <?xml version="1.0" encoding="ISO-8859-1"?> Old Line -->
<?xml version="1.0" encoding="utf-8"?>
<!-- Modified by Christopher Chess Ellsworth on May 2, 2007 -->
<!-- Changed from original version to use brackets instead of parans for citations. -->
<!-- See line numbers 2050, 2067, and 4459 or search for "CCE" without quotes. -->
<!-- These changes were made based on the following channel 9 forum post: http://channel9.msdn.com/ShowPost.aspx?PostID=245923 -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:t="http://www.microsoft.com/temp">
<xsl:output method="html" encoding="UTF-8"/>
<!-- <xsl:output method="html" encoding="us-ascii"/> Old Line -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPEC8w
LjA5ODAzOTIxNzI5IDAuMDk4MDM5MjE3MjkgMC4wOTgwMzkyMTcyOSAwLjgzABABgALS
EBESE1okY2xhc3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRYTlNPYmplY3RfEA9OU0tl
@ladislas
ladislas / ST2_Cloud
Last active December 26, 2015 20:59
Symlink ST2 data from dropbox to mac
cd ~/Library/Application\ Support/Sublime\ Text 2/
rm -r Installed\ Packages
rm -r Packages
rm -r Pristine\ Packages
ln -s /Users/Ladislas/Dropbox/dev/app-data/sublime-mba/Installed\ Packages ./Installed\ Packages
ln -s /Users/Ladislas/Dropbox/dev/app-data/sublime-mba/Packages ./Packages
ln -s /Users/Ladislas/Dropbox/dev/app-data/sublime-mba/Pristine\ Packages ./Pristine\ Packages
@ladislas
ladislas / ST2_Cmd_Line
Last active December 26, 2015 20:59
ST2 command line
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin
@ladislas
ladislas / MAMP Virtual Host Setup
Last active December 26, 2015 23:38
MAMP Virtual Host Setup
cd /Applications/MAMP
rm -rf ./db
ln -s ~/Dropbox/dev/db /Applications/MAMP/db
sub conf/apache/httpd.conf
# search for "Virtual Host"
# and add
@ladislas
ladislas / zlib-1.2.5.patch
Created December 30, 2013 14:58
zlib-1.2.5.patch
diff --git a/Makefile.in b/Makefile.in
index 5b15bd0..6817b94 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -167,8 +167,12 @@ install-libs: $(LIBS)
-@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
- cp $(STATICLIB) $(DESTDIR)$(libdir)
- cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)
@ladislas
ladislas / Terminal Config
Created February 11, 2014 08:48
Terminal Config
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundBlur</key>
<real>0.61689897017045459</real>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPEC8w
@ladislas
ladislas / config
Created April 15, 2014 09:12
keep ssh connection alive
Host *
ServerAliveCountMax 5
ServerAliveInterval 10