Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am manveru on github.
* I am manveru (https://keybase.io/manveru) on keybase.
* I have a public key whose fingerprint is D7AA 2DA7 69E8 FB70 CA14 AEF4 2934 6DF9 068A 7479
To claim this, I am signing this object:
[ 4%] Built target alice-addon
Linking CXX shared library libalice-addon-shared.so
/usr/bin/ld: CMakeFiles/alice-addon.dir/src/alice/keyvalue.cpp.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
CMakeFiles/alice-addon.dir/src/alice/keyvalue.cpp.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libalice-addon-shared.so] Error 1
make[1]: *** [CMakeFiles/alice-addon-shared.dir/all] Error 2
make: *** [all] Error 2
zsh: exit 2 make
Traceback (most recent call last):
File "entity_counter.py", line 21, in <module>
for match in demo.play():
File "ticker.pyx", line 19, in __iter__ (smoke/replay/ticker.c:1921)
File "dispatch.pyx", line 29, in smoke.replay.dispatch.dispatch (smoke/replay/dispatch.c:2183)
File "dispatch.pyx", line 75, in smoke.replay.dispatch.dispatch (smoke/replay/dispatch.c:2001)
File "svc_updatestringtable.pyx", line 16, in smoke.replay.handler.svc_updatestringtable.handle (smoke/replay/handler/svc_updatestringtable.c:1449)
File "string_table.pyx", line 28, in smoke.replay.decoder.string_table.decode_update (smoke/replay/decoder/string_table.c:1306)
File "string_table.pyx", line 46, in smoke.replay.decoder.string_table._deserialize (smoke/replay/decoder/string_table.c:1452)
File "string_table.pyx", line 77, in smoke.replay.decoder.string_table._deserialize_name (smoke/replay/decoder/string_table.c:1706)
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
at java.util.LinkedList.checkElementIndex(LinkedList.java:553)
at java.util.LinkedList.get(LinkedList.java:474)
at skadistats.clarity.decoder.StringTableDecoder.decode(StringTableDecoder.java:41)
at skadistats.clarity.parser.handler.SvcUpdateStringTableHandler.apply(SvcUpdateStringTableHandler.java:27)
at skadistats.clarity.parser.handler.SvcUpdateStringTableHandler.apply(SvcUpdateStringTableHandler.java:1)
at skadistats.clarity.parser.HandlerRegistry.apply(HandlerRegistry.java:49)
at skadistats.clarity.parser.Peek.apply(Peek.java:87)
at skadistats.clarity.parser.Tick.apply(Tick.java:17)
at skadistats.clarity.examples.simple.Main.main(Main.java:23)
Exception in thread "main" java.lang.RuntimeException: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either than the input has been truncated or that an embedded message misreported its own length.
at skadistats.clarity.parser.TickIterator.getNextPeek(TickIterator.java:25)
at skadistats.clarity.parser.TickIterator.next(TickIterator.java:47)
at skadistats.clarity.examples.simple.Main.main(Main.java:23)
Caused by: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either than the input has been truncated or that an embedded message misreported its own length.
at com.google.protobuf.InvalidProtocolBufferException.truncatedMessage(InvalidProtocolBufferException.java:70)
at com.google.protobuf.CodedInputStream.refillBuffer(CodedInputStream.java:746)
at
require 'strscan'
require 'bacon'
Bacon.summary_on_exit
class PGArrayParser
attr_reader :s
def parse(input)
return [] if input.empty?
xi github/jedi4ever/veewee % ruby -I./lib ./bin/veewee vbox build ubuntu
Downloading vbox guest additions iso v 4.2.12 - http://download.virtualbox.org/virtualbox/4.2.12/VBoxGuestAdditions_4.2.12.iso
Checking if isofile VBoxGuestAdditions_4.2.12.iso already exists.
Full path: /home/manveru/github/jedi4ever/veewee/iso/VBoxGuestAdditions_4.2.12.iso
The isofile VBoxGuestAdditions_4.2.12.iso already exists.
Building Box ubuntu with Definition ubuntu:
- debug : false
- cwd : /home/manveru/github/jedi4ever/veewee
- force : false
@manveru
manveru / thread_sum.rb
Last active December 18, 2015 03:19 — forked from jcoene/gist:5034155
#!/usr/bin/env ruby
threads = 100.times.map do |n|
Thread.new n do |m|
base = 1 + (m * 100)
100.times.map do |i|
base + i
end
end
end
#!/usr/bin/ruby
# This program adds up the numbers 1 through 10,000 using 100 threads.
# Challenge A: Does this solution have any problems? If so, explain.
# Challenge B: Propose an alternate implementation that does not use threads.
require "thread"
mt_result = 0
@manveru
manveru / gist:5716970
Last active December 18, 2015 03:19 — forked from jcoene/gist:5034155
#!/usr/bin/ruby
# This program adds up the numbers 1 through 10,000 using 100 threads.
# Challenge A: Does this solution have any problems? If so, explain.
# Challenge B: Propose an alternate implementation that does not use threads.
n = 10000
p (1..n).reduce(:+) # by iteration