Skip to content

Instantly share code, notes, and snippets.

public class IntArray {
final int DEFAULT_SIZE = 10;
int[] _int_array;
public IntArray() {
_int_array = new int[DEFAULT_SIZE];
}
public IntArray(int size) {
<-> @test_herml_htmlizer:emit_tuple()
{ok, admin} ->
#admin
.name
Admin
{error, none} ->
#error
You are not an admin.
{ok, _} ->
#other
# Publishes a set of pages, allows eventmachine/amqp to send them
# then restarts the process with another set of pages.
modulus = calc_modulus(number_of_pages)
number_of_pages.paged_collect(modulus).each_value do |pages|
AMQP.start do
pages.each do |page|
lclients = Legacy::Client.all(:limit => 100, :offset => page*100)
topic = MQ.new.topic('conversion')
lclients.map do |lclient|
#!/usr/bin/ruby
# Core
require 'date'
# Gems
require 'rubygems'
require 'mq'
# Helper
require 'rubygems'
require 'mq'
require 'benchmark'
class Integer
def paged_collect(mod)
acc = Hash.new
self.times do |num|
index = num % mod
acc[index] = Array.new unless acc[index]