<jayjo>
I'm working with a rails application and I'm struggling to whitelist IPs correctly - I think it's because of how rails is assigning the remote IP address
<bonhoeffer>
i remember a selenium enabled web automation capability where I could view and troubleshoot the browser while the script ran
<bonhoeffer>
but all i can figure out how to do now is run save_and_open_screenshot -- is there something more interactive
sameerynho has quit [Ping timeout: 248 seconds]
bonhoeffer has quit [Ping timeout: 252 seconds]
bonhoeffer has joined #ruby
cagomez_ has quit [Remote host closed the connection]
cagomez has joined #ruby
cagomez has quit [Ping timeout: 260 seconds]
<zenspider>
dviola: I think it is a bit more complicated than it needs to be... but also, it seems like it's a bit too narrowly focused? Why would you have a string of JUST brackets to check if it is balanced or not?
<zenspider>
pairs.keys.include? -> pairs.has_key?
<zenspider>
each_with_object isn't necessary at all.
<zenspider>
I'd push the pairs hash up to a constant
bonhoeffer has quit [Quit: bonhoeffer]
<dviola>
zenspider: yep
<Radar>
dviola: What is the result of balanced?("((()") ?
<zenspider>
I don't like the check on line 11 for the same reason as line 9... but I think I'd just push the check from 12 to be your check for 11
<dviola>
Radar: false
<Radar>
dviola: Are you certain?
<zenspider>
heh
bonhoeffer_ has joined #ruby
<zenspider>
yeah. I should say: I'm ONLY evaluating the ruby itself... not the validity of it :P
<Radar>
TL;DR: check for open brackets, and then only check that there are equivalent closing brackets.
<dviola>
very nice
wildermind has quit [Quit: Connection closed for inactivity]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<dviola>
interesting
bonhoeffer has joined #ruby
nickjj has quit [Read error: Connection reset by peer]
bonhoeffer has quit [Client Quit]
<desnudopenguino>
jayjo: i'm messing around with setting up an AWS EC2 instance with some ruby stuff, and with sinatra running thin, somehow my local ip is showing up in the log, not my ISP provided ip
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
drbrain has quit [Quit: Goodbye]
drbrain has joined #ruby
s2013 has joined #ruby
ur5us has joined #ruby
bonhoeffer has joined #ruby
hays_ has joined #ruby
<hays_>
bear with me--i have made a gem, and I get whining when I install it that my dependencies dont have versions
<hays_>
but--when I add versions it complains about something else
<hays_>
how should I be specifying versions in gem dependency lists
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Casstorm has joined #ruby
jtdowney has quit [Quit: jtdowney]
r3m has quit [Remote host closed the connection]
jtdowney has joined #ruby
Casstorm has quit [Client Quit]
r3m has joined #ruby
<desnudopenguino>
hays_: give us more info concerning what it is complaining about.
<hays_>
yeah, sorry. hit a hiccup. I made an s.executables = Dir["{bin}/*"] and it doesnt like the bin/ in that so i need to fix that to reproduce the error
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
chouhoulis has quit [Ping timeout: 256 seconds]
<hays_>
desnudopenguino: WARNING: open-ended dependency on gserver (>= 0) is not recommended
<hays_>
WARNING: open-ended dependency on activerecord (>= 0)
reber has quit [Remote host closed the connection]
<Radar>
hays_: It'd be helpful if we could see this problem happening on our machine.
redlegion has quit [Remote host closed the connection]
redlegion has joined #ruby
redlegion has quit [Excess Flood]
redlegion has joined #ruby
lxsameer has joined #ruby
<hays_>
am I misunderstanding bundle? I am running bundle install and it doesn't seem like some of the gems are installing
<hays_>
it seem slike it is "using" the gem from a github repo, but not installing it somehow
Rootsudo has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
<hays_>
crazy enough, bundle exec irb shows the gem installed, but straight irb does not.
moei has quit [Quit: Leaving...]
<Radar>
hays_: just curious: do you want help with this or not?
<hays_>
yes, but I don't really know how to help with your request
<Radar>
hays_: Give us some code that goes "boom" on your machine and we'll see if it goes "boom" on our machine.
<Radar>
" it doesn't seem like some of the gems are installing" <- or at least _some_ information about how you came to such a conclusion
<Radar>
"but not installing it somehow" <- proof? details?
<hays_>
ok. well I have a Gemfile. it has a list of gems. one of them is to a private github repository
<hays_>
that one does not show up in gem list, but it shows up if I do bundle exec irb
<hays_>
however, the gems that are public. those seem to install in system/rbenv ruby
<Radar>
RubyGems "gem list" command has no idea about GitHub gems. Only Bundler knows that.
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<hays_>
so if its a rubygem it installs it in the system, but if its a github gem it somehow keeps it isolated within the bundle tool?
<Radar>
Bundler will install it to a different path iirc.
<hays_>
curious. ok
<Radar>
My local Rails is installed at: /usr/local/opt/asdf/installs/ruby/2.4.2/lib/ruby/gems/2.4.0/gems/rails-5.2.0
<hays_>
with the other problem, I took a guess at it, and seemed to get it to build/install the gem without warnings
<Radar>
A GH gem that I have installed is: /usr/local/opt/asdf/installs/ruby/2.4.2/lib/ruby/gems/2.4.0/bundler/gems/gem-name-goes-here-0c799877560f
<Radar>
what do you mean "without warnings"? Were you expecting warnings?
<hays_>
i was getting warnings when I ran gem build foo-1.0.gemspec
<hays_>
erm thats a garbage gemspec name. I meant foo.gemspec
<hays_>
it didn't seem to like unversioned gem depedencies
<Radar>
Can you show us the warnings?
<hays_>
WARNING: open-ended dependency on gserver (>= 0) is not recommended
<hays_>
so for that one I added '~>0' and it seems to be OK now
<Radar>
Right. So that's because you've not specified a gem version dependency so it's going to install _any_ version of that gem, which is probably not what you want.
<hays_>
but I was getting the same warning for nokogiri, activerecord, and mysql2
<Radar>
maybe 2.0 will work with your app, but would 1.0? You should lock it down like ~> 1.0
<hays_>
i made activerecord ~> 5.2
<hays_>
not sure if that's reasonable
<hays_>
mysql ~> 0.5
<Radar>
[12:51:37] <Radar>maybe 2.0 will work with your app, but would 1.0? You should lock it down like ~> 1.0
<Radar>
Up to you to decide.
ur5us has quit [Remote host closed the connection]
kapil___ has joined #ruby
synbyte has quit [Quit: WeeChat 1.9.1]
bonhoeffer_ has joined #ruby
bonhoeffer has quit [Ping timeout: 272 seconds]
bonhoeffer_ is now known as bonhoeffer
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
DTZUZU has joined #ruby
akaiiro has quit [Remote host closed the connection]
bonhoeffer has quit [Quit: bonhoeffer]
ryu- has joined #ruby
_whitelogger has joined #ruby
Rootsudo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gnufied has quit [Ping timeout: 272 seconds]
gnufied has joined #ruby
xall has joined #ruby
dviola has quit [Ping timeout: 240 seconds]
diego1 has joined #ruby
s2013 has joined #ruby
lytol_ has quit [Remote host closed the connection]
ur5us has joined #ruby
gnufied has quit [Ping timeout: 260 seconds]
lxsameer has joined #ruby
diego1 is now known as dviola
memo1 has joined #ruby
lxsameer has quit [Ping timeout: 272 seconds]
tolerablyjake has joined #ruby
Eiam has quit [Ping timeout: 265 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blood has joined #ruby
xall has quit [Ping timeout: 248 seconds]
<blood>
Anyway to copy xml namespaces -> remove namespaces -> do some xpath queries -> copy back namespaces?
<blood>
using Nokogiri
samort7 has joined #ruby
sleetdrop has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
ur5us has quit [Remote host closed the connection]
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xall has joined #ruby
xall has quit [Client Quit]
sauvin has joined #ruby
sauvin has quit [Max SendQ exceeded]
blood has quit [Quit: Page closed]
armyriad has joined #ruby
t0x has quit [Quit: Connection closed for inactivity]
memo1 has quit [Ping timeout: 244 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
mojtaba has joined #ruby
mike11 has joined #ruby
kevinsjoberg has joined #ruby
sauvin has joined #ruby
jayjo has quit [Quit: Lost terminal]
t0x has joined #ruby
Freshnuts has joined #ruby
dionysus69 has joined #ruby
Tempesta has quit [Quit: See ya!]
t0x is now known as t0xik
mojtaba has quit [Remote host closed the connection]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
iMadper has joined #ruby
samort7 has quit [Quit: Leaving]
iMadper has quit [Ping timeout: 268 seconds]
dviola has quit [Quit: WeeChat 2.2]
clemens3 has joined #ruby
LiftLeft has joined #ruby
ur5us has joined #ruby
ur5us has quit [Ping timeout: 248 seconds]
Dbugger has joined #ruby
alex`` has joined #ruby
mihael_k33hl has joined #ruby
<mihael_k33hl>
It's my first time creating a gem, is it acceptable to name it like john-ruby? https://guides.rubygems.org/name-your-gem/ Cause I'm gonna be creating this gem and future gems under the namespace john?
<mihael_k33hl>
john-rsymc*
cats has quit [Ping timeout: 268 seconds]
cats has joined #ruby
Sina has joined #ruby
ferhaty has joined #ruby
<apeiros>
mihael_k33hl: yes, it's acceptable. it's then expected to have `require 'john/rsymc'` and provide a constant John::Rsymc (though I guess you meant rsync)
kevinsjoberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mihael_k33hl>
apeiros: Yeah, it's rsync, sorry about that. Thanks man. I don't think the rsync gem is being actively updated though so I'll just create my own. :)
<t0xik>
maybe it doesnt need to be updated
<mihael_k33hl>
t0xik: Oh yeah, the owner said it's on a stable state. But a lot of people are trying to add some features/functionalities that they need for it.
redlegion has quit [Remote host closed the connection]
jottr has joined #ruby
redlegion has joined #ruby
klaas has joined #ruby
mihael_k33hl has quit [Quit: Page closed]
dbugger_ has joined #ruby
Dbugger has quit [Ping timeout: 240 seconds]
Beams has joined #ruby
mojtaba has joined #ruby
Samian has quit []
dhollin3 has joined #ruby
tristanp has joined #ruby
dhollinger has quit [Ping timeout: 240 seconds]
tristanp has quit [Ping timeout: 272 seconds]
lxsameer has joined #ruby
canton7 has quit [Ping timeout: 240 seconds]
zipkid_ has joined #ruby
bove_ has joined #ruby
codepete_ has joined #ruby
strmpnk has quit [Ping timeout: 245 seconds]
codepete has quit [Ping timeout: 245 seconds]
kireevco has quit [Ping timeout: 245 seconds]
barq has quit [Ping timeout: 245 seconds]
zipkid has quit [Read error: Connection reset by peer]
cjs226 has quit [Read error: Connection reset by peer]
Iambchop_ has quit [Read error: Connection reset by peer]
mattwc has quit [Read error: Connection reset by peer]
bove has quit [Read error: Connection reset by peer]
raggi has quit [Read error: Connection reset by peer]
zipkid_ is now known as zipkid
codepete_ is now known as codepete
strmpnk has joined #ruby
bove_ is now known as bove
canton7 has joined #ruby
barq has joined #ruby
khomesh24 has quit [Ping timeout: 240 seconds]
Dabo has quit [Ping timeout: 260 seconds]
Dabo has joined #ruby
khomesh24 has joined #ruby
kevinsjoberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mike11 has quit [Ping timeout: 272 seconds]
amelliaa has quit [Quit: -]
Freshnuts has quit [Quit: Leaving]
Emmanuel_Chanel has quit [Ping timeout: 248 seconds]
Blaguvest has joined #ruby
mike111 has joined #ruby
Rootsudo has joined #ruby
DTZUZU has quit [Ping timeout: 256 seconds]
p4p0l0 has joined #ruby
mikecmpbll has quit [Remote host closed the connection]
gensym has joined #ruby
<gensym>
hi, I want evertime I call YAML.load_file(filename) to print the filename for debugging purpose. How can I register a "before" hook or something similar?
<Radar>
gensym: puts filename
<Radar>
?next
<ruby[bot]>
Next question, please!
<gensym>
@Radar i dont want to change all places where YAML.load_file(filename) is called, hence the the "before" hook
<Radar>
gensym: how many places out of curiosity?
<gensym>
many, but that doesnt really matter. Its for DRY
p4p0l0 has quit [Remote host closed the connection]
MuffinPimp has quit [Quit: Goodbye.]
MuffinPimp has joined #ruby
blackmesa has joined #ruby
gnufied has joined #ruby
blackmesa has quit [Ping timeout: 256 seconds]
p4p0l0 has joined #ruby
conta has joined #ruby
tristanp has joined #ruby
blackmesa has joined #ruby
tristanp has quit [Ping timeout: 272 seconds]
p4p0l0 has quit [Ping timeout: 272 seconds]
bonhoeffer has joined #ruby
cadillac_ has joined #ruby
gray_-_wolf has joined #ruby
tfitts has quit [Quit: Connection closed for inactivity]
bonhoeffer_ has joined #ruby
conta has quit [Quit: conta]
bonhoeffer has quit [Ping timeout: 240 seconds]
bonhoeffer_ is now known as bonhoeffer
blood has joined #ruby
<blood>
Is there a way to ignore namespaces while querying xpath using Nokogiri? I cannot remove all namespaces from the document as it breaks the application that I am using.
<blood>
hrmm seems like setting default_namespace on root node works
blackmesa1 has joined #ruby
blackmesa has quit [Ping timeout: 245 seconds]
GodFather has joined #ruby
Alina-malina has quit [Ping timeout: 240 seconds]
wildermind has quit [Quit: Connection closed for inactivity]
blackmesa1 has quit [Quit: WeeChat 2.2]
kinduff has joined #ruby
DTZUZU has joined #ruby
kinduff has quit [Client Quit]
kinduff has joined #ruby
snickers has joined #ruby
nopolitica has quit [Quit: WeeChat 2.2]
raggi has joined #ruby
Emmanuel_Chanel has joined #ruby
LiftLeft has quit [Ping timeout: 240 seconds]
ged has quit [Quit: WeeChat 2.0.1]
VladGh has quit [Remote host closed the connection]
VladGh has joined #ruby
<darix>
blood: if you only have one namespace ... yes
<darix>
then you can do that
discopatrick has joined #ruby
<bonhoeffer>
is there a smart “with” block
ged has joined #ruby
<bonhoeffer>
so if I have @myobject i don’t have to do @myobject.start @myobject.next_thing @myobject.another_thing
imhajes has joined #ruby
<imhajes>
hi
<blood>
darix: yea I tried storing all namespace definitions then resetting them before write and nokogiri crashes =)
<bonhoeffer>
want something like “with @myobject { .start .next_thing .stop}
<blood>
would be nice to just say ignore namespace during a xpath query
<bonhoeffer>
like all things, i’m probably approaching the design pattern wrong
Alina-malina has joined #ruby
<imhajes>
any one help me cinch irc bot?
<imhajes>
msg me
ferhaty has quit [Quit: ferhaty]
<darix>
blood: but you can have thins like <foo:bar><foobar:bar /></foo:bar> ... now you do //bar ... which one do you refer to?
<blood>
however I'm now getting rid of remove_namespace call as it breaks things
jottr has quit [Ping timeout: 248 seconds]
Inline has joined #ruby
dbugger_ is now known as Dbugger
mroutis has joined #ruby
akaiiro has joined #ruby
mojtaba has joined #ruby
bijan_ has joined #ruby
snuz has joined #ruby
<blood>
darix: solved issues by switching to css instead of xpath
<blood>
well not all =)
<blood>
filter[filter-name='psfilter'] Can I do something similar with css?
s2013 has joined #ruby
maufart__ has quit [Quit: Leaving]
aufi has joined #ruby
r29v has joined #ruby
ryu- has quit [Quit: leaving]
mroutis has quit [Ping timeout: 240 seconds]
memo1 has joined #ruby
Eiam has joined #ruby
dellavg has joined #ruby
za1b1tsu has joined #ruby
sameerynho has joined #ruby
fmcgeough has joined #ruby
[Butch] has joined #ruby
Zaab1t has joined #ruby
mike11 has joined #ruby
vondruch has quit [Ping timeout: 272 seconds]
drale2k_ has joined #ruby
vondruch has joined #ruby
aufi has quit [Quit: Leaving]
tolerablyjake has joined #ruby
polishdub has joined #ruby
clemens3 has quit [Ping timeout: 244 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dminuoso has joined #ruby
sonOfRa has quit [Remote host closed the connection]
<dminuoso>
Is there a way to have bundler only build a specific dependency from a Gemfile?
<dminuoso>
In particular I want to use build the dependencies in multiple docker layers as to not screw myself too much when I decide to add a dependency.
cagomez has joined #ruby
sonOfRa has joined #ruby
lxsameer has quit [Ping timeout: 272 seconds]
bmurt has joined #ruby
blood has quit [Quit: Page closed]
wildermind has joined #ruby
beeman has joined #ruby
jcarl43 has joined #ruby
bijan_ has quit [Remote host closed the connection]
bijan_ has joined #ruby
lxsameer has joined #ruby
<havenwood>
dminuoso: I can't think of a nicer way than giving the gem a group and using the --with=GROUP flag.
<dminuoso>
havenwood: I suppose I could at least toss the native extensions into a group..
<dminuoso>
That would rid me of most the pain.
al2o3-cr has quit [Quit: WeeChat 2.2]
gr33n7007h has joined #ruby
gr33n7007h is now known as al2o3-cr
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 260 seconds]
mike11 has quit [Quit: Leaving.]
cats has quit [Ping timeout: 244 seconds]
cats has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
lxsameer has joined #ruby
Beams has quit [Quit: .]
mojtaba has quit [Quit: Leaving.]
gray_-_wolf has quit [Quit: WeeChat 2.2]
mikecmpbll has quit [Ping timeout: 240 seconds]
memo1 has quit [Ping timeout: 272 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
bijan_ has quit [Remote host closed the connection]
kinduff has quit [Quit: Quit]
lxsameer has joined #ruby
orbyt_ has joined #ruby
mroutis has joined #ruby
bijan_ has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
<dminuoso>
invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /usr/local/bundle/cache/ruby-oci8-2.2.5.1.gem
* dminuoso
kicks back
* dminuoso
breathes
bijan_ has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
za1b1tsu has quit [Ping timeout: 240 seconds]
eckhardt_ has joined #ruby
<havenwood>
dminuoso: Does nuking the cache from orbit improve the outlook?
lxsameer has quit [Ping timeout: 272 seconds]
<dminuoso>
havenwood: Better yet, running it *again*
<dminuoso>
So now I have a non-determistic bug fucking with my docker container.
* dminuoso
sighs
<dminuoso>
Probably should valgrind bundler.
<dminuoso>
Who knows what goes on there.
bijan_ has joined #ruby
mroutis has quit [Ping timeout: 256 seconds]
lxsameer has joined #ruby
bonhoeffer has joined #ruby
<bonhoeffer>
i’m still wondering the ideal ruby design pattern when an object is repeatedly called: want something like “with @myobject { .start .next_thing .stop}
<apeiros>
also, as of 2.4 I think, you can provide a `base: "some/dir"` which is stripped from the yielded value. useful for requires as they should be relative to a path in $LOAD_PATH (aka $:)
<havenwood>
apeiros: Indeed!!
<havenwood>
Love that.
<apeiros>
same
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros>
I have *so* *fucking* *many* Dir.glob loops where I do: `base = "some path"; Dir.glob(base+"/whatever/*") do |path| rel = path[base.size..-1]; …` (or similar, might be off by one :D)
bijan_ has joined #ruby
lxsameer has joined #ruby
<bonhoeffer>
thanks
drale2k_ has joined #ruby
bijan__ has joined #ruby
bijan_ has quit [Ping timeout: 256 seconds]
lxsameer has quit [Ping timeout: 268 seconds]
bijan__ has quit [Ping timeout: 245 seconds]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
graphene has quit [Remote host closed the connection]
lxsameer has joined #ruby
graphene has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
bijan_ has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
lxsameer has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
wildermind has quit [Quit: Connection closed for inactivity]
Zaab1t has quit [Quit: Zaab1t]
s2013 has joined #ruby
orbyt_ has joined #ruby
s2013 has quit [Client Quit]
dellavg has quit [Ping timeout: 256 seconds]
bmurt has joined #ruby
t0xik has joined #ruby
alex`` has quit [Quit: WeeChat 2.2]
alex`` has joined #ruby
bsamorim has joined #ruby
<bsamorim>
Hi, folks! I'm having a tough time understanding YARV's garbage collection dynamics
<havenwood>
bsamorim: Say more about what part you're trying to understand?
nowhere_man has joined #ruby
<bsamorim>
If I start up a irb session and fire up a method that takes ~1 min to complete and consumes ~4.5% of my memory, at the end of it, the memory consumption from the method persists
<havenwood>
bsamorim: Does it go down if you manually run?: GC.start
<bsamorim>
havenwood: I tried that, but it didn't have any effect
<havenwood>
bsamorim: Is there no garbage to collect?
<bsamorim>
If I fire up the method once again, the memory eventually goes down, and then back up again
<havenwood>
bsamorim: Show your `GC.stat` before and after?
<bsamorim>
havenwood: k, wait a minute
<bsamorim>
before and after the first method invocation, or the second?
<havenwood>
both
<bsamorim>
k, just a sec
<havenwood>
bsamorim: If it's shareable, code to reproduce might help someone spot the issue as well.
<zenspider>
why are you assuming this has to do with GC?
<bsamorim>
havenwood: sure, I'll share
<zenspider>
can we back up? what have you done to investigate why a single method takes a minute?
<zenspider>
memory might have nothing to do with this. memory "persisting" is normal for a lot of code
<bsamorim>
zenspider: because the code is really just performing a 'rest-client' request
lxsameer has joined #ruby
<zenspider>
so? what have you done to isolate this to memory?
LiftLeft has quit [Ping timeout: 265 seconds]
<zenspider>
rest-client is networking. that has lots of external dependencies that might time out
<zenspider>
does 1 + 1 take a minute?
<zenspider>
is it JUST irb?
<havenwood>
RestClient and HTTParty can also take a huge amount of memory compared to other HTTP clients in Ruby.
<bsamorim>
zenspider: You're absolutely right - I haven't done a thorough investigation. I just assumed that ruby's most popular http client wouldn't have such weird memory cost
<bsamorim>
havenwood: so this most likely has nothing to do with GC? haha thank god!
<zenspider>
that's horrific for restclient
lxsameer has quit [Ping timeout: 240 seconds]
<havenwood>
zenspider: srsly
<zenspider>
I don't understand this line tho "using native parsers and a clean, lightweight implementation, http.rb achieves the best performance of any Ruby HTTP library which implements the HTTP protocol in Ruby instead of C:"
<zenspider>
oh. n/m. I understand how I misread it.
<zenspider>
I have to say... I hate the name of this gem.
<zenspider>
I also highly suspect the methodology of this benchmark as being slightly bogus... but not when the numbers are an order of magnitude different
<zenspider>
"DISCLAIMER: Most benchmarks you find in READMEs are crap, including this one. These are out-of-date. If you care about performance, benchmark for yourself for your own use cases!" hah! fair
<bsamorim>
havenwood, zenspider: thank you guys very much for the help!
Dbugger has quit [Ping timeout: 240 seconds]
<zenspider>
yup yup. no prob. good luck
LiftLeft has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdsampayo has joined #ruby
r29v has joined #ruby
<jdsampayo>
Hello, how can I pack an Array of bytes (from Java) like the BigInteger Java constructor, in Java with [-75, 78, 103, -51, 31, -56, 80, -22] you can get the BigInteger 13064493699747565802. In Ruby, I have tested all the pack (c, v, l, i, C, c*, cccc, etc) without any success
jottr has quit [Ping timeout: 272 seconds]
jim80net has joined #ruby
<zenspider>
packing an array gives you a binary string. IS that what you want? or do you want the bigint?
<jdsampayo>
Maybe my question was bad, I would want to create the BigInteger from the array, like in Java: BigInteger big = new BigInteger(1, new byte[]{ -75,78,103,-51,31,-56,80,-22 });
jottr has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider>
translation: big endian unsigned long long
<apeiros>
BigInteger in Java is a 64bit int?
<apeiros>
or arbitrarily large like ruby's Bignum (now just Integer)?
<jdsampayo>
Java sources has this description: "The magnitude is a byte array in <i>big-endian</i> byte-order: the most significant byte is in the zeroth element."
<zenspider>
iirc it's arbitrary... it happens to fit in this case
<apeiros>
zenspider: btw., this error still means that eval.in failed, tho. but the message is crap.
<apeiros>
Q is only long long (64bit)
<zenspider>
I don't think this code will work with all input... but I don't think there IS a way to make it work with all input. bigint is not explicitly supported since it is internal to ruby
<apeiros>
I think if you want to convert arbitrarily large, you have to roll your own. not too difficult, though.
<zenspider>
unsigned long long
<jdsampayo>
guess I can use .unpack1("Q>") for this purpose to avoid the Array
<zenspider>
yeah. I think if you did "Q>*" you can then math them up with a fold