Skip to content

Instantly share code, notes, and snippets.

View Zhomart's full-sized avatar
🏠
Working from home

Zhomart Mukhamejanov Zhomart

🏠
Working from home
View GitHub Profile
@Zhomart
Zhomart / rpc.rb
Last active August 29, 2015 14:00
Consumer#cancel doesn't work inside subscribe block
require 'bunny'
require 'json'
puts Bunny::VERSION # => 1.2.1
bunny_config = {
log_level: :debug
}
connection = Bunny.new bunny_config
$ ruby a.rb
1.2.1
D, [2014-04-28T20:03:13.097850 #95992] DEBUG -- #<Bunny::Session:2156599120 guest@127.0.0.1:5672, vhost=/>: Sent protocol preamble
D, [2014-04-28T20:03:13.098368 #95992] DEBUG -- #<Bunny::Session:2156599120 guest@127.0.0.1:5672, vhost=/>: Sent connection.start-ok
D, [2014-04-28T20:03:13.098532 #95992] DEBUG -- #<Bunny::Session:2156599120 guest@127.0.0.1:5672, vhost=/>: Heartbeat interval negotiation: client = server, server = 580, result = 580
I, [2014-04-28T20:03:13.098570 #95992] INFO -- #<Bunny::Session:2156599120 guest@127.0.0.1:5672, vhost=/>: Heartbeat interval used (in seconds): 580
D, [2014-04-28T20:03:13.098809 #95992] DEBUG -- #<Bunny::Session:2156599120 guest@127.0.0.1:5672, vhost=/>: Sent connection.tune-ok with heartbeat interval = 580, frame_max = 131072, channel_max = 65535
D, [2014-04-28T20:03:13.098965 #95992] DEBUG -- #<Bunny::Session:2156599120 guest@127.0.0.1:5672, vhost=/>: Sent connection.open with vhost = /
D, [2014-04-28T20:03:13.099046 #95992] DEBUG -- #<Bunny::Sess
@Zhomart
Zhomart / stacktrace
Created June 17, 2014 00:05
stack trace example
Started GET "/Di%c5%ef%bf%bd-f%c4%b1r%c3%a7as%c4%b1" for 127.0.0.1 at 2014-06-16 17:04:32 -0700
ActionController::RoutingError (No route matches [GET] "/Di%c5%ef%bf%bd-f%c4%b1r%c3%a7as%c4%b1"):
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
MapIt: f797294d: [3, 3, 92, 7, 2, 98, 2, 99, 27, 2, 2, 22, 5, 45, 94, 0, 8, 1, 33, 0, 29] ...
MapIt: bfe2bc45: [85, 74, 91, 24, 22, 83, 62, 25, 99, 99, 59, 27, 4, 48, 59, 59, 43, 4, 85, 18, 0] ...
MapIt: 4e4006af: [28, 37, 94, 7, 4, 57, 11, 8, 99, 51, 65, 91, 16, 12, 17, 61, 64, 33, 16, 34, 53] ...
Analysis 2014-07-03 01:28:45 -0700
= Statsample::Reliability
== Reliability Analisis
Summary for Reliability Analisis
+------------------------------+--------------------+
| Valid Items | 3 |
| Valid cases | 136 |
Fluency Raw
$ ruby cronbach.rb
-- (227)
MapIt: f797294d: [10, 6, 6, 4, 6, 7, 6, 3, 6, 6, 7, 8, 5, 9, 6, 6, 12, 6, 6, 5, 6] ...
MapIt: bfe2bc45: [6, 9, 5, 6, 6, 26, 6, 6, 5, 6, 6, 4, 5, 3, 6, 5, 8, 6, 6, 6, 3] ...
MapIt: 4e4006af: [6, 3, 6, 6, 6, 27, 6, 5, 5, 6, 6, 4, 5, 3, 6, 8, 11, 3, 6, 5, 4] ...
Analysis 2014-07-03 01:41:39 -0700
= Statsample::Reliability
# Batch 3 - fluency_raw
-- (147)
MapIt: 7f8fd219: [9, 7, 3, 6, 6, 3, 8, 7, 6, 6, 6, 4, 6, 3, 4, 6, 51, 33, 6, 16, 3] ...
MapIt: 6ce33413: [8, 6, 2, 6, 6, 3, 6, 7, 6, 6, 6, 5, 6, 3, 4, 6, 7, 37, 6, 18, 3] ...
MapIt: 431a026a: [8, 9, 3, 6, 5, 3, 6, 5, 7, 6, 6, 4, 6, 3, 4, 6, 18, 54, 6, 17, 3] ...
Analysis 2014-07-04 00:59:15 -0700
= Statsample::Reliability
== Reliability Analisis
# Batch 2 - fluency_Raw
-- (179)
MapIt: 1e9b5aa6: [6, 7, 5, 6, 6, 6, 6, 6, 7, 5, 6, 6, 6, 6, 6, 3, 6, 6, 6, 6, 6] ...
MapIt: 1ddafd1e: [9, 8, 6, 6, 7, 6, 6, 6, 8, 4, 6, 6, 6, 4, 5, 3, 6, 6, 5, 7, 6] ...
MapIt: b07694b6: [7, 6, 6, 6, 6, 6, 6, 4, 9, 5, 6, 6, 6, 4, 6, 3, 6, 6, 4, 6, 6] ...
Analysis 2014-07-04 01:02:28 -0700
= Statsample::Reliability
== Reliability Analisis
@Zhomart
Zhomart / gist:b1c811f9c2ae7a51fff2
Last active August 29, 2015 14:03
Parallel Factor Analysis for Batch 1,2,3,4 MapIt originality_raw

Intro

Couldn't do for all batches combined with 12 tasks. Because "horizontal" order is not kept between "Batch n" tests.

Batch 1 - originality_raw

MapIt: place: [0, 0, 100, 8, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 2, 0, 0, 3, 0, 0, 0] ...
MapIt: laugh: [100, 63, 91, 0, 0, 91, 56, 0, 56, 0, 0, 91, 0, 56, 5, 0, 63, 0, 5, 19, 10] ...
MapIt: story: [0, 0, 100, 83, 0, 0, 1, 28, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0] ...
@Zhomart
Zhomart / gist:c625dcd4624875ed1512
Last active August 29, 2015 14:03
PCA for Batch 1,2: inter metrics

Batch 1

Batch 1 - "MapIt: story". originality_raw, fluency_raw, divergency_raw

MapIt: story-originality_raw: [0, 0, 100, 83, 0, 0, 1, 28, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0] ...
MapIt: story-fluency_raw: [1, 3, 3, 4, 1, 2, 4, 3, 1, 3, 1, 3, 1, 2, 1, 1, 4, 2, 1, 2, 1] ...
MapIt: story-divergency_raw: [0, 3, 3, 3, 0, 2, 3, 3, 0, 2, 0, 3, 0, 2, 0, 0, 2, 2, 0, 2, 0] ...

Analysis 2014-07-06 12:34:24 -0700
= Statsample::Factor::ParallelAnalysis
@Zhomart
Zhomart / gist:6b09f0772fdc4a573491
Created July 6, 2014 19:50
Factor Analysis for Mechanical Turk - 4/21/2014 - originality_raw

Mechanical Turk - 4/21/2014 - originality_raw

loop_it: [83, 41, 9, 7, 100, 31, 47, 0, 90, 39, 96, 96, 37, 100, 10, 52, 7, 100, 100, 89, 90] ...
odd_it: [23, 20, 15, 50, 49, 34, 25, 27, 30, 38, 37, 44, 37, 34, 41, 57, 57, 49, 2, 17, 32] ...
pair_it: [4, 1, 0, 0, 1, 1, 8, 8, 1, 1, 0, 4, 15, 0, 0, 3, 8, 3, 14, 0, 1] ...
tie_it: [30, 31, 29, 24, 14, 32, 6, 14, 10, 25, 6, 31, 33, 29, 10, 43, 30, 6, 12, 20, 20] ...
map_it: [44, 21, 58, 32, 87, 61, 95, 99, 99, 82, 89, 82, 99, 72, 66, 98, 35, 100, 19, 54, 23] ...

Analysis 2014-07-06 12:48:17 -0700