Have you ever wondered about the least amount of memory a C or Go program will use on a 64bit Linux machine? Kr & I have, here is the results of our curiosity:
A simple C program:
void
main()
{
for (;;) {
}
// see build.gradle for imports | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import ch.qos.logback.classic.LoggerContext; | |
import ch.qos.logback.core.util.StatusPrinter; | |
... | |
public abstract class Utilities { | |
public static final Logger logger = LoggerFactory.getLogger( "AnyUniqueStringHere" ); | |
... | |
public static void printLoggerState() { |
] wc -l domains.txt | |
783 domains.txt | |
] time go run domain_lookup_parallel.go | |
real 0m5.743s | |
user 0m0.359s | |
sys 0m0.355s | |
] time go run domain_lookup_sequential.go |
$VERBOSE = nil | |
require File.expand_path('../rooby', __FILE__) | |
Person = Rooby::Class.new 'Person' do | |
define :initialize do |name| | |
@name = name | |
end | |
define :name do |
app.filter('bytes', function() { | |
return function(bytes, precision) { | |
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-'; | |
if (typeof precision === 'undefined') precision = 1; | |
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'], | |
number = Math.floor(Math.log(bytes) / Math.log(1024)); | |
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number]; | |
} | |
}); |
module Settings | |
def self.included(source) | |
source.class_eval do | |
def self.setting(*args) | |
args.each do |setting| | |
attr_accessor setting | |
define_method "#{setting}_on" do | |
self.send("#{setting}=", true) | |
end |
// get a Casper object. | |
// See http://casperjs.org/ | |
var casper = require('casper').create(); | |
// this will be evaluated inside the context of the window. | |
// See http://casperjs.org/api.html#casper.evaluate for notes on | |
// the difference between casper's running environment and the | |
// DOM environment of the loaded page. | |
function testReporter(){ | |
// casper is webkit, so we have good DOM methods. You're |
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# It's assumed that wget and a C/C++ compiler are installed. | |
# exit on error | |
set -e | |
TMUX_VERSION=1.8 |
require 'em-synchrony/em-mongo' | |
require 'mongoid' | |
mongoid_conn = Mongo::Connection.new 'localhost', 27017, :pool_size => 10 | |
Mongoid.configure do |config| | |
begin | |
config.master = mongoid_conn.db('dbname') | |
rescue Exception=>err | |
abort "An error occurred while creating the mongoid connection pool: #{err}" | |
end |
class ListView extends Backbone.View | |
constructor: (options) -> | |
super | |
@view = options.view if options.view? | |
@collection.on 'add', @addRow, @ | |
@collection.on 'remove', @removeRow, @ | |
@collection.on 'reset', @render, @ | |
@ |