Skip to content

Instantly share code, notes, and snippets.

View oraclewalid's full-sized avatar
🐄

Walid Chergui oraclewalid

🐄
View GitHub Profile
trait Tag[+TAG]{}
type Intersection[+TYPE,+TAG] = TYPE with Tag[TAG]
type Intersection3[+TYPE, +TAG1, +TAG2] = TYPE with Tag[TAG1] with Tag[TAG2]
type ::[+TYPE,+TAG] = Intersection[TYPE,TAG]
implicit class Tagger[TYPE](val t: TYPE) extends AnyVal {
def taggedWith[U]: TYPE :: U = t.asInstanceOf[TYPE :: U]
def ::[U]: TYPE :: U = t.asInstanceOf[TYPE :: U]
}

Keybase proof

I hereby claim:

  • I am oraclewalid on github.
  • I am walidchergui (https://keybase.io/walidchergui) on keybase.
  • I have a public key ASDBlORDstuDQRJAFTwF9Zos9VY0slc67nAKjnRNBmRCGwo

To claim this, I am signing this object:

# put the file in /etc/systemd/user or /etc/systemd/system with name myapp.service
# then you can start the application with :
# systemctl start myapp.service
#to see the logs : journalctl -u myapp.service
[Unit]
Description=myapp
After=network.target
[Service]
EnvironmentFile=/etc/myapp/env.prop
import org.slf4j.LoggerFactory
/**
* A wrapper class to make Slf4j more Scala friendly
* with lazy evaluation of parameters
*
* use:
* val logger = LoggerFactory.getLogger(this.getClass)
* logger.info("Hello log with parameter : {}", parameter)
*
public static void main(String[] args) throws Exception {
int outputNum = 10;
int batchSize = 128;
int iterations = 1;
int seed = 123;
CifarDataSetIterator cifarTrain = new CifarDataSetIterator(batchSize, CifarLoader.NUM_TRAIN_IMAGES, true);
MultiLayerConfiguration.Builder builder = new NeuralNetConfiguration.Builder()
import numpy as np
from lasagne.nonlinearities import softmax
from lasagne import layers
from lasagne.updates import nesterov_momentum
from nolearn.lasagne import NeuralNet
N = 1000
def load_dataset():