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
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm | |
function map() { | |
emit(1, // Or put a GROUP BY key here | |
{sum: this.value, // the field you want stats for | |
min: this.value, | |
max: this.value, | |
count:1, | |
diff: 0, // M2,n: sum((val-mean)^2) | |
}); |
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
GIT | |
remote: git://github.com/seancribbs/webmachine-ruby.git | |
revision: 7ccf8c337d683778bb72eeb3d073f5c57c2be8eb | |
specs: | |
webmachine (1.2.2) | |
as-notifications (~> 1.0) | |
i18n (>= 0.4.0) | |
multi_json | |
GIT |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
class Hash | |
def apply_schema(schema) | |
new_hash = {} | |
schema.each do |el| | |
if Hash === el | |
el.each do |k,v| | |
raise ArgumentError.new("Bad schema on key: #{k}, value: #{v}. Value have to be an array") unless Array === v | |
new_hash[k] = [] | |
next unless self.has_key?(k) |
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
Все проекты имеют роут на эндпоинт, возвращающий "Hello World!" | |
исходные тексты (гитхаб) | |
Оборудование: | |
Model Name: MacBook Pro | |
Model Identifier: MacBookPro8,2 | |
Processor Name: Intel Core i7 | |
Processor Speed: 2.5 GHz | |
Number of Processors: 1 | |
Total Number of Cores: 4 |
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
Check out README.md to get started editing Clojure with Emacs. |
Введение
Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.
http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html
Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.
Ruby
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
# encoding: utf-8 | |
# needs to be installed 7za, pgdbf | |
namespace :kladr do | |
PATH = 'tmp/kladr' | |
def import_options(database=nil) | |
host = ActiveRecord::Base.configurations[Rails.env]['host'] | |
user = ActiveRecord::Base.configurations[Rails.env]['username'] | |
host &&= "--host=#{host}" |
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
source 'https://rubygems.org' | |
gem 'sinatra' | |
gem 'sinatra-contrib', require: 'sinatra/streaming' | |
group :development do | |
gem 'thin' | |
gem 'pry-rails' | |
end |