... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
#!/usr/bin/tarantool | |
local log = require 'log' | |
local digest = require 'digest' | |
local fiber = require 'fiber' | |
box.cfg{ slab_alloc_arena = 1.2, wal_mode = 'fsync' } | |
local id = 0 | |
function next_id() | |
id = tonumber64(id) + tonumber64(1) |
# build result | |
/bin | |
# bootstrap result | |
/bin/gb | |
/bin/gb-vendor | |
# build result | |
/bin/BINARY_NAME |
<powershell> | |
write-output "Running User Data Script" | |
write-host "(host) Running User Data Script" | |
cmd.exe /c net user /add vagrant FooBar@123 | |
cmd.exe /c net localgroup administrators vagrant /add | |
Set-ExecutionPolicy -ExecutionPolicy bypass -Force | |
# RDP |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
package com.liveperson.lpbt.research.hadoop.examples | |
import scala.annotation.tailrec | |
/** | |
* User: mishaelr | |
* Date: 7/11/13 | |
* Time: 10:33 AM | |
*/ | |
object FCBF extends App{ |
#!/bin/sh | |
# | |
# Build a chroot with a CentOS 6.5 base install. | |
# | |
CHROOT=/tmp/chroot | |
mkdir -p $CHROOT | |
mkdir -p $CHROOT/var/lib/rpm |
file_to_disk = './tmp/large_disk.vdi' | |
Vagrant::Config.run do |config| | |
config.vm.box = 'base' | |
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
end |
# Note that target_env.login and target_env.password is global variables | |
# Maybe I should add this into Fabric project (http://docs.fabfile.org/en/1.4.2/index.html). | |
# This is complicated task for sure but it would be nice if Fabric could use ssh under Linux and PowerShell Remoting under Windows. | |
def remote_sh(target_host, command_text, ignore_error=False): | |
print('run PowerShell script block at {0}: {1}'.format(target_host, command_text)) | |
command_text = command_text.replace('"', '\'') |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php) | |
; which can be found in the file CPL.TXT at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
;As shown in the presentation: http://blip.tv/clojure/clojure-concurrency-819147 |