The default Go implementation of
sync.RWMutex does not scale well
to multiple cores, as all readers contend on the same memory location
when they all try to atomically increment it. This gist explores an
n
-way RWMutex, also known as a "big reader" lock, which gives each
CPU core its own RWMutex. Readers take only a read lock local to their
core, whereas writers must take all locks in order.
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
$('#main_div').width(800).height(500).split({ | |
orientation: 'vertical', | |
limit: 3, | |
position: '67%' | |
}); | |
$('#left_pane').width($('#left_pane').width()).height(500).split({ | |
orientation: 'vertical', | |
limit: 3, | |
position: '50%' | |
}); |
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
<div id="main_div"> | |
<div id="left_pane"> | |
<div id="first_left_pane"> | |
<!-- your left content goes here --> | |
</div> | |
<div id="second_left_pane"> | |
<!-- your middle content goes here --> | |
</div> | |
</div> | |
<div id="right_pane"> |
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
DB_CONFIG = YAML.load(File.open('config/database.yml')) | |
EXCEPTIONS = ['[email protected]', '[email protected]'] | |
LDAP = Ldap.setup | |
set :public_folder, 'public' | |
db_config = <<END | |
mysql2://#{DB_CONFIG['username']}:\ | |
#{DB_CONFIG['password']}@#{DB_CONFIG['host']}:\ | |
#{DB_CONFIG['port']}/#{DB_CONFIG['database']} | |
END |
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
{ | |
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 13, | |
"hot_exit": false, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
"remember_open_files": false, |
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
# github.com/GeertJohan/go.rice/rice | |
../../../../_work/gocode/src/github.com/GeertJohan/go.rice/rice/append.go:15: import /home/budhram/_work/gocode/pkg/linux_amd64/github.com/daaku/go.zipexe.a: object is [linux amd64 go1.3.1 X:precisestack] expected [linux amd64 go1.4.1 X:precisestack] |
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
agrant@atlantis-aquarium-vm:~/repos/atlantis-supervisor$ time make build | |
Installing Dependencies... | |
# github.com/docker/docker/pkg/pools | |
vendor/src/github.com/docker/docker/pkg/pools/pools.go:30: undefined: sync.Pool | |
make: *** [install-deps] Error 2 | |
real 31m5.002s | |
user 1m58.691s | |
sys 11m41.219s |
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
cd ./data/supervisor; make -C /home/vagrant/repos/atlantis-supervisor/ clean deb | |
make: Entering directory `/home/vagrant/repos/atlantis-supervisor' | |
rm -rf bin pkg /home/vagrant/repos/atlantis-supervisor/lib/atlantis/src/atlantis/crypto/key.go | |
rm -f example/supervisor example/client example/monitor | |
Installing Dependencies... | |
done check | |
done toml | |
done gocheck | |
done aws | |
done s3 |
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
cases = gets.chomp.to_i | |
def valid_numeric_input?(input) | |
input.zero? | |
end | |
def reverse_num(num) | |
num.to_s.reverse.to_i | |
end |
by alexander white ©