This file contains hidden or 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
"""Example of barrier implementation using TensorFlow shared variables. | |
All workers synchronize on barrier, copy global parameters to local versions | |
and increment global parameter variable asynchronously. Should see something | |
like this: | |
bash> killall python | |
bash> python simple_barrier.py --num_workers=4 | |
worker 0, local_param 4 global_param 5 | |
worker 2, local_param 4 global_param 7 |
This file contains hidden or 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
# Install ARCH Linux with encrypted file-system and UEFI | |
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
# Download the archiso image from https://www.archlinux.org/ | |
# Copy to a usb-drive | |
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
# Set swiss-french keymap |
This file contains hidden or 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
extern crate crypto; | |
use crypto::bcrypt::bcrypt; | |
static CRYPT_B64: &'static str = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
fn crypt_decode(enc: &str, decbuf: &mut [u8]) -> Option<()> { | |
let mut cbuild = 0u8; | |
let mut cpos = 0; | |
let mut dec_idx = 0; |
This file contains hidden or 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
#![feature(plugin_registrar)] | |
extern crate syntax; | |
extern crate rustc; | |
use syntax::ast; | |
use syntax::codemap::Span; | |
use syntax::ext::base; | |
use syntax::ext::base::{ExtCtxt, MacExpr}; | |
use syntax::ext::build::AstBuilder; | |
use syntax::parse::token; |
This file contains hidden or 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 genS_jl(I) | |
s0 = 600.0 | |
r = 0.02 | |
sigma = 2.0 | |
T = 1.0 | |
M = 100 | |
dt = T/M | |
a = (r - 0.5*sigma^2)*dt | |
b = sigma*sqrt(dt) |
This file contains hidden or 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
var BatchStream = require('batch-stream2') | |
var gulp = require('gulp') | |
var coffee = require('gulp-coffee') | |
var uglify = require('gulp-uglify') | |
var cssmin = require('gulp-minify-css') | |
var bower = require('gulp-bower-files') | |
var stylus = require('gulp-stylus') | |
var livereload = require('gulp-livereload') | |
var include = require('gulp-include') | |
var concat = require('gulp-concat') |
This file contains hidden or 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
# Install ARCH Linux with encrypted file-system and UEFI | |
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
# Download the archiso image from https://www.archlinux.org/ | |
# Copy to a usb-drive | |
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
# Set swedish keymap |
This file contains hidden or 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
/** | |
* This file/module contains all configuration for the build process. | |
*/ | |
/** | |
* Load requires and directory resources | |
*/ | |
var join = require('path').join, | |
bowerrc = JSON.parse(require('fs').readFileSync('./.bowerrc', {encoding: 'utf8'})), | |
bowerJSON = bowerrc.json.replace(/^\.?\/?/, './'), |
This file contains hidden or 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
#![feature(macro_rules)] | |
extern crate collections; | |
use collections::HashMap; | |
// A macro to easily create and populate hash maps | |
macro_rules! hashmap( | |
{ $($key:expr => $value:expr),+ } => { | |
{ |
This file contains hidden or 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 laplace_idiomatic (del_x::Array{Float64, 3}, x::Array{Float64, 3}) | |
n1, n2, n3 = size (x) | |
for i3 = 2:n3-1, i2 = 2:n2-1, i1 = 2:n1-1 | |
del_x[i1,i2,i3] = | |
x[i1+1,i2,i3] + x[i1-1,i2,i3] + | |
x[i1,i2+1,i3] + x[i1,i2-1,i3] + | |
x[i1,i2,i3+1] + x[i1,i2,i3-1] - | |
6.0 * x[i1,i2,i3] |
NewerOlder