Teh Social Netswork!
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(10) NOT NULL
);
INSERT into users VALUES
require "bmg" | |
require "benchmark" | |
a_domain = (0..10_000).to_a | |
b_domain = %w[a b c d e f g h i j k l m n o p q] | |
puts "Generate relations..." | |
rels = (0..1_000).map do |n| | |
n_tuples = n == 0 ? 100_000 : 100 |
/Applications/Xcode.app/Contents/Developer/usr/bin/make config 2>&1 | tee -a make.log | |
cd scripts && /Applications/Xcode.app/Contents/Developer/usr/bin/make all | |
/Applications/Xcode.app/Contents/Developer/usr/bin/make /Users/felix/code/pakcs-2.0.1/bin/pakcs /Users/felix/code/pakcs-2.0.1/bin/pakcs-makecgi /Users/felix/code/pakcs-2.0.1/bin/cleancurry /Users/felix/code/pakcs-2.0.1/bin/pakcs-fcypp | |
mkdir -p /Users/felix/code/pakcs-2.0.1/bin | |
cat pakcs.sh | sed "s|^PAKCSBUILDDIR=.*$|PAKCSBUILDDIR=/Users/felix/code/pakcs-2.0.1|" | \ | |
sed "s|^PAKCSINSTALLDIR=.*$|PAKCSINSTALLDIR=|" > /Users/felix/code/pakcs-2.0.1/bin/pakcs | |
chmod 755 /Users/felix/code/pakcs-2.0.1/bin/pakcs | |
mkdir -p /Users/felix/code/pakcs-2.0.1/bin | |
cat pakcs-makecgi.sh | sed "s|^PAKCSBUILDDIR=.*$|PAKCSBUILDDIR=/Users/felix/code/pakcs-2.0.1|" | \ | |
sed "s|^PAKCSINSTALLDIR=.*$|PAKCSINSTALLDIR=|" > /Users/felix/code/pakcs-2.0.1/bin/pakcs-makecgi |
% Impuzzable | |
% https://nrich.maths.org/1388 | |
import cp. | |
import util. | |
main => | |
puzzle(Pieces), | |
time2(Arrangements = find_all_arrangements(Pieces)), |
module DryJsonSchema | |
# Transforms a dry-validation form to json-schema-compatible objects (hash or array) | |
# Usage: | |
# DryJsonSchema::Converter.(my_form) | |
# => { :type => :object, | |
# :properties => { :abc => { :type => :integer }, | |
# :xyz => { :type => :integer } | |
# }, | |
# :required => [:abc]} | |
class Converter |
``` | |
commit | |
[#world tick: 0] | |
[#time #system/timer resolution: 1000] | |
[#thing value: 1 delta: 1] | |
``` | |
Update | |
~~~ | |
search |
server { | |
listen [::]:80; | |
listen 80; | |
server_name $NOSSL_SERVER_NAME; | |
location / { | |
proxy_pass http://$APP; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade \$http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header Host \$http_host; |
$ ./flora2/runflora | |
% Specialising partially instantiated calls to flora_assert_directories/1 | |
[Compiling Foreign Module /Users/felix/Documents/code/flora2/flora2bundle/flora2/cc/prolog2hilog (Prolog compiler options are ignored)] | |
[prolog2hilog compiled, cpu time used: 0.0010 seconds] | |
[Compiling C file /Users/felix/Documents/code/flora2/flora2bundle/flora2/cc/prolog2hilog.c using gcc] | |
/Users/felix/Documents/code/flora2/flora2bundle/flora2/cc/prolog2hilog.c:365:9: warning: comparison of 0 > unsigned expression is always false [-Wtautological-compare] | |
if (0 > length_diff) return FALSE; | |
~ ^ ~~~~~~~~~~~ | |
1 warning generated. | |
gcc -dynamiclib -undefined dynamic_lookup -fPIC -o /Users/felix/Documents/code/flora2/flora2bundle/flora2/cc/prolog2hilog.dylib /Users/felix/Documents/code/flora2/flora2bundle/flora2/cc/prolog2hilog.c -Wall -fPIC -I/Users/felix/Documents/code/flora2/flora2bundle/XSB/emu -I/Users/felix/Documents/code/flora2/flora2bundle/XSB/config/i386-apple-darwin13.2.0 -O3 -fno-strict-aliasing - |
Teh Social Netswork!
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(10) NOT NULL
);
INSERT into users VALUES
require 'spec_helper' | |
require 'sidekiq' | |
require 'sidekiq/middleware/chain' | |
require 'sidekiq/fetch' | |
require 'sidekiq/processor' | |
require 'redis/namespace' | |
redis_url = 'redis://localhost/15' | |
client = Redis.connect(:url => redis_url) |
require 'benchmark' | |
def insert_then_sort(results, missing_items) | |
missing_items.each do |id| | |
results << {id: id, val: nil} | |
end | |
results.sort_by!{|item| item[:id] } | |
results | |
end |