aryaching has quit [Read error: Connection reset by peer]
Kug3lis is now known as Kug3lis_off
jenrzzz has quit [Ping timeout: 240 seconds]
aufi has joined #ruby
milardovich has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
youch has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
anisha_ has quit [Quit: This computer has gone to sleep]
youch has quit [Ping timeout: 255 seconds]
jshjsh is now known as JoshS
bocaneri has joined #ruby
qba73 has quit [Remote host closed the connection]
anisha_ has joined #ruby
teclator has quit [Ping timeout: 240 seconds]
qba73 has joined #ruby
milardovich has quit [Ping timeout: 245 seconds]
gigetoo has joined #ruby
herbmillerjr has quit [Ping timeout: 240 seconds]
qba73 has quit [Ping timeout: 240 seconds]
andikr has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
aganov has joined #ruby
JeanCarloMachado has quit [Ping timeout: 255 seconds]
last_staff has joined #ruby
Xentil has quit [Ping timeout: 240 seconds]
kassav_ has joined #ruby
milardovich has quit [Ping timeout: 245 seconds]
bkxd has joined #ruby
dnewkerk has quit [Quit: dnewkerk]
gigetoo has quit [Ping timeout: 264 seconds]
Mia has joined #ruby
herbmillerjr has joined #ruby
gigetoo has joined #ruby
harai has quit [Ping timeout: 255 seconds]
Axy has quit [Ping timeout: 248 seconds]
bkxd has quit [Ping timeout: 240 seconds]
grh has joined #ruby
gigetoo has quit [Ping timeout: 264 seconds]
ifctj has quit [Ping timeout: 240 seconds]
frozengeek__ has joined #ruby
larcara has joined #ruby
Rich_Morin1 has joined #ruby
artoftheselfless has joined #ruby
blaxter has joined #ruby
artoftheselfless has quit [Client Quit]
conta has joined #ruby
despai has joined #ruby
qba73 has joined #ruby
ur5us has joined #ruby
<Rich_Morin1>
I'm using Sinatra with thin and having a problem when a page tries to bring in subsidiary pages. Basically, it invokes my get() block more than once, confusing my (non-reentrant) code. Suggestions?
qba73 has quit [Ping timeout: 260 seconds]
sebd has quit [Ping timeout: 248 seconds]
mikecmpbll has joined #ruby
qba73 has joined #ruby
e1z0_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
harai has joined #ruby
sebd has joined #ruby
brendan- has quit [Ping timeout: 248 seconds]
nankyokusei has joined #ruby
csk157 has joined #ruby
qba73 has quit [Ping timeout: 240 seconds]
yottanami has joined #ruby
<yottanami>
Is any method to check if a variable is not nil and is not false?
zacts has quit [Ping timeout: 258 seconds]
qba73 has joined #ruby
<yottanami>
can I check by !variable_name ?
Mortomes|Work has joined #ruby
nankyokusei has quit [Ping timeout: 256 seconds]
gigetoo has joined #ruby
<Rich_Morin1>
that will work
ddffg has quit [Ping timeout: 240 seconds]
yottanami has left #ruby ["Leaving"]
TomyWork has joined #ruby
Cohedrin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
brendan- has joined #ruby
qba73 has quit [Ping timeout: 256 seconds]
lxsameer has quit [Ping timeout: 240 seconds]
cgibsonmm has joined #ruby
SesMan has joined #ruby
frozengeek__ has quit [Quit: frozengeek__]
qba73 has joined #ruby
tvw has joined #ruby
mark_66 has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
teclator has joined #ruby
Burgestrand has joined #ruby
antgel has joined #ruby
ledestin has joined #ruby
Burgestrand has quit [Read error: Connection reset by peer]
gigetoo has joined #ruby
Burgestrand has joined #ruby
qba73 has quit [Ping timeout: 255 seconds]
squ_ has quit [Remote host closed the connection]
haxrbyte has joined #ruby
aupadhye has joined #ruby
haraoka has quit [Remote host closed the connection]
Gayathri_ has joined #ruby
hutch34 has joined #ruby
matp has quit [Quit: ZZzzzZz...]
gigetoo has quit [Ping timeout: 240 seconds]
futabachannel has joined #ruby
ddffg has joined #ruby
Tharbakim has quit [Ping timeout: 258 seconds]
Guest93450 has quit [Ping timeout: 276 seconds]
Burgestr_ has joined #ruby
hutch34 has quit [Ping timeout: 256 seconds]
haxrbyte has quit [Quit: Leaving...]
Burgestrand has quit [Ping timeout: 260 seconds]
bkxd has joined #ruby
gigetoo has joined #ruby
ivanskie_work has joined #ruby
Burgestr_ has quit [Ping timeout: 255 seconds]
ur5us has quit [Remote host closed the connection]
ivanskie has quit [Read error: Connection reset by peer]
Burgestrand has joined #ruby
ivanskie_work is now known as ivanskie
bkxd has quit [Ping timeout: 255 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
biberu has joined #ruby
qba73 has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
Cohedrin_ has joined #ruby
govg has joined #ruby
Burgestrand has quit [Ping timeout: 245 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
qba73_ has joined #ruby
zacts has joined #ruby
qba73 has quit [Ping timeout: 248 seconds]
gigetoo has joined #ruby
ddffg has quit [Ping timeout: 252 seconds]
senayar has joined #ruby
senayar has joined #ruby
senayar has quit [Changing host]
frozengeek__ has joined #ruby
dionysus69 has joined #ruby
LoneHerm_ has joined #ruby
kassav_ has quit [Read error: No route to host]
qba73_ has quit [Ping timeout: 240 seconds]
kassav_ has joined #ruby
cyberik has joined #ruby
cyberik has quit [Read error: Connection reset by peer]
Burgestrand has joined #ruby
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
patarr has joined #ruby
gigetoo has quit [Ping timeout: 255 seconds]
blackbombay has quit [Ping timeout: 252 seconds]
aupadhye has quit [Ping timeout: 255 seconds]
patarr has quit [Ping timeout: 245 seconds]
danguita has quit [Remote host closed the connection]
Silthias has joined #ruby
mikecmpbll has joined #ruby
Silthias2 has quit [Ping timeout: 245 seconds]
qba73 has joined #ruby
CloCkWeRX has quit [Ping timeout: 255 seconds]
e1z0_ has joined #ruby
cgibsonmm has quit [Remote host closed the connection]
<okmark>
normal load ruby code, and one function to run it
Guest93450 has joined #ruby
koldbrutality has quit [Ping timeout: 240 seconds]
Shashikant86 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
matp has joined #ruby
<okmark>
reverse situation. not making library in C but how running one function from ruby but put to this function arg. and get returnet values
<okmark>
Bish, how put arg. to ruby function from C?
Shashikant86 has joined #ruby
gigetoo has quit [Ping timeout: 255 seconds]
jeyraof has quit [Quit: This computer has gone to sleep]
hutch34 has quit [Ping timeout: 276 seconds]
dc4 has joined #ruby
<Bish>
listen, to "run a c function", you will need to have the machine code of that function in ram
JeanCarloMachado has quit [Ping timeout: 255 seconds]
<Bish>
so, you can, compile your c code into a ruby-extension, call it from there
<Bish>
b) spawn a process, use debug tools to jump to the function ( and hope it doesn't have some state flying around
psychicist__ has quit [Quit: Reconnecting]
<Bish>
your ruby script does not have that code anywhere, so how could it?
psychicist__ has joined #ruby
Guest39170 is now known as olspookishmagus
<okmark>
not "run c function" but "run from C , ruby function"
grh has joined #ruby
<okmark>
Bish, how run "ruby function"
bkxd has joined #ruby
nowhereman has quit [Ping timeout: 245 seconds]
<Bish>
so you want to have ruby code in your c binary?
dionysus69 has joined #ruby
<Bish>
always understood it the other way around
Burgestr_ has quit [Read error: Connection reset by peer]
Burgestrand has joined #ruby
LuMint has joined #ruby
shortCircuit__ has joined #ruby
<shortCircuit__>
HEY
jenrzzz has quit [Ping timeout: 248 seconds]
agit0 has quit [Quit: zzzZZZ….]
<Bish>
shortCircuit__: HO
<okmark>
Bish, yes i need ruby code inside my C program.
<okmark>
how running it?
nowhereman has joined #ruby
<shortCircuit__>
request = Net::HTTP::Post.new('/') for this request object, how to add headers to it, I want to send a request with headers and body . and both the headers and body need to be a hash :P
Cohedrin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Bish>
okmark: no clue, sorry, i don't think that's how ruby is supposed to be used
gigetoo has joined #ruby
<herwin>
okmark: did you look at the link I posted?
JeanCarloMachado has joined #ruby
jaiks has joined #ruby
bkxd has quit [Ping timeout: 248 seconds]
<okmark>
Bish, ruby code in file t.rb: def add(a,b) return a+b end C code in file c.c main(){ for(i=0;i<1000;i++) printf("%d\n",<run_add_from_ruby_code>(i,1)); };
aupadhye has quit [Ping timeout: 248 seconds]
leitz has joined #ruby
<okmark>
herwin, yes, but not undestood. this run whole program not one function
<okmark>
herwin, I'm wrong?
<Bish>
okmark: yeah i get it now, but i've never seen something like that
cgibsonmm has quit [Remote host closed the connection]
<okmark>
in ruby and mruby is call function. call("name of ruby object function" ... etc. How using this
<shortCircuit__>
I can do a to_query .. gih
nadir has quit [Quit: Connection closed for inactivity]
<okmark>
any examples? working examples?
dbugger has joined #ruby
<dbugger>
Hello everyone
<dbugger>
I have a question. What is the name of this notation? "doSomething if true"
koneko has joined #ruby
<dbugger>
I think this notation where the IF was at the end of the line had a certain name, but I can not remember it
<leah2>
postfix conditional?
<dbugger>
postfix?
<dbugger>
Was that it?
gigetoo has quit [Ping timeout: 258 seconds]
<leah2>
postfix means to write something after something
<dbugger>
Because I thought so.. but when I google it, I just see stuff about some mailing protocol or something
<Bish>
shortCircuit__: you can just use request[name] = value
<Bish>
for settings headers
<Bish>
>> requite 'net/http';Net::HTTP::Post.new('http://google.de').each {|k,v| p k,v}
<ruby[bot]>
Bish: # => undefined method `requite' for main:Object ...check link for more (https://eval.in/729009)
<Bish>
>> require 'net/http';Net::HTTP::Post.new('http://google.de').each {|k,v| p k,v}
qba73 has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 240 seconds]
okmark has quit [Ping timeout: 255 seconds]
gigetoo has joined #ruby
JeanCarloMachado has quit [Ping timeout: 255 seconds]
xen0fon has quit [Ping timeout: 248 seconds]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has joined #ruby
JeanCarloMachado has joined #ruby
marr has joined #ruby
aupadhye has joined #ruby
FrankD has joined #ruby
Beams has quit [Quit: .]
gigetoo has quit [Ping timeout: 240 seconds]
<FrankD>
Hi, I've been writing some software in Ruby that utilizes a bunch of threads (and threads that spawn threads -- ie reading the directories in a filesystem, the thread for a given directory will read each file and spawn a thread for each sub-directory).. but the GIL stops this from really working as well as it should, right?
patarr has quit [Ping timeout: 260 seconds]
<FrankD>
Is there a way around that? I don't understand why there's mutexes and threads if the GIL doesn't really let you thread..
cgibsonmm has joined #ruby
<leitz>
On CentOS I've installed the rubygem-nokogiri, and the $LOAD_PATH has a nokogiri.so file. Newbie question, I thought gems were Ruby code, not compiled.
<okmark_>
meybe using mrb_funcall() ? meybe this is answer? How running ruby function from C
cgibsonmm has quit [Ping timeout: 252 seconds]
ur5us has quit [Remote host closed the connection]
<apeiros>
FrankD: use jruby
raiden_0x117 has quit [Ping timeout: 248 seconds]
Gayathri_ has quit [Quit: Connection closed for inactivity]
<apeiros>
ruby's threads help you with I/O bound performance and with organisation of code execution. they don't help with CPU bound performance.
raiden_0x71 has joined #ruby
ruby551 has joined #ruby
<apeiros>
FrankD: if you can't use jruby, then forking can be a way
czechy has joined #ruby
ur5us has joined #ruby
<FrankD>
apeiros, is there a place where I can find a comparison of jruby vs ruby.. ie if there's a reason I can't/shouldn't use it?
<leitz>
apeiros, sorry. I try to learn people's names the long way.
<apeiros>
I think they're in phase 2
<apeiros>
leitz: well, it's only my nick, not really my name ;-)
<FrankD>
damn i chose Ruby for this project because I thought I could really do threaded stuff :P
<FrankD>
are there any other scripting languages with good thread support -- as in actual concurrency?
<leitz>
apeiros, true, but it's the name I know you by. My ex-wife knows me by a few others. :)
<leitz>
FrankD, have you looked at Go? Not scripting, but supposedly as expressive as Ruby.
<Bish>
FrankD: yeah ruby is the best language there is, but there is this concurrency issue
<Bish>
there always needs to be a thing that breaks everything :d
<Bish>
jruby,rbx give you concurrency in ruby, but i only have experience with rbx
<FrankD>
is that rubinius?
<Bish>
and it's true, it uses all your cores IT FUKIN BURNS THEM, but is still slower than MRI ( personal experience, might not be the case for special cases )
<Bish>
FrankD: yes
<Bish>
ruby: 10% cpu on one core finishes in one minute, rbx: 100% on 8 cores, takes 10 minutes
<Bish>
:D
<FrankD>
cool, well I guess I'll try jruby/rubinius out and see what happens :D
<FrankD>
Bish, ouch :P
<Bish>
that's just numbers out of my head.. not a real benchmark.. but sums up what i experienced
<FrankD>
i wish Ruby had a good GUI Gem so I could atleast prototype gui apps that weren't web based :D
<Bish>
the holy grail in programming has yet to be found
frmendes has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
brent__ has joined #ruby
<Bish>
(or isn't there)
<FrankD>
well.. I could always do C/C++, but obviously thats a lot more annoying hehe
frmendes has joined #ruby
<Bish>
you have other problems there, that are as mindfukin
frmendes has quit [Client Quit]
koneko has quit [Ping timeout: 248 seconds]
<apeiros>
note: native extensions aren't guarded by the gil
<apeiros>
so you could have ruby and put a bit of C in for the parallel stuff
<FrankD>
hmm interesting
<okmark_>
how convert 'int' into ruby value? for example mrb_value
<okmark_>
without creating new object, and allocating memory
<FrankD>
is there any way to force GC on certain objects in Ruby?
<FrankD>
or does the GC not have support for anything like that?
<dminuoso>
FrankD: Yes but you shouldn't.
<FrankD>
dminuoso, ok.. why not?
bkxd has joined #ruby
<FrankD>
forks() are slow as molasses, so that's not really an option for what I'm doing.. they're relatively short lived threads :\
gigetoo has joined #ruby
<apeiros>
that's when you pool
brent__ has quit [Ping timeout: 260 seconds]
<dminuoso>
FrankD: I remember that banisterfiend implemented a forced free library a while ago. If memory serves right, it didn't perform quite well, this might very well be due to the fact that you cause unnecessary overhead by forcing to do things that Ruby tries to manage itself already
<apeiros>
for CPU bound problems, there's no point in having more processes than cores anyway
blackmesa has joined #ruby
<dminuoso>
FrankD: Anyway. From the pure ruby world you can't do it.
c355e3b has joined #ruby
<apeiros>
so get your pool of 4, 8 or 16 processes, queue the work out. or gather the jobs prior to forking.
<dminuoso>
That will automatically close the file at the end of a block, even if an exception is thrown.
Tharbakim has quit [Ping timeout: 258 seconds]
milardovich has quit [Ping timeout: 245 seconds]
ryan_notabot has quit [Remote host closed the connection]
ryan_notabot has joined #ruby
<scootaloo>
clean code ftw
<Cymew>
I agree.
<Cymew>
I open a file conditionally within a function, and then close in an ENSURE. The problem occurs if the condition returns false, as it seems like it will try to close() regardless.
<Cymew>
I wish I could do that cleanly.
bkxd has joined #ruby
nadir has joined #ruby
<scootaloo>
You could move the File.open() block inside the if, no ?
<scootaloo>
Or, if all you do is work with your file in the function, do an early return in the case you don't need the file
Burgestr_ has joined #ruby
Burgestrand has quit [Ping timeout: 264 seconds]
<scootaloo>
Can you maybe show us what the function looks like?
<Cymew>
Yeah, maybe it's time to clean the whole mess up.
<dminuoso>
Cymew: Just use it like that. No ensure handler is needed, File#open in block form will do it for you.
<dminuoso>
13:37 < dminuoso> That will automatically close the file at the end of a block, even if an exception is thrown.
<dminuoso>
Do not close it afterwards yourself.
gigetoo has joined #ruby
<dminuoso>
It's basically scope based resource management.
<dminuoso>
Ruby will provide the file object inside the block, and ensure it gets cleaned up when the block is left through any means.
Tharbakim has joined #ruby
<Cymew>
The thing is this is a big kludge that tries to do multiple things at the same time, which probably should be refactored to use threads or something. It's very dependant on execution order and a lot of messiness.
<scootaloo>
dminuoso: i don't have my ssh key at work, so can't do it right now. I'll try to remember to do it, but you can also bother me if I'm logged in during (West europe) night
qba73 has quit [Read error: Connection reset by peer]
<xcesariox>
scootaloo : could you help me out with my issue?
qba73 has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
gigetoo has joined #ruby
msmith has joined #ruby
ramortegui has joined #ruby
<scootaloo>
xcesariox: given it's rails, give a try in #RubyOnRails
<xcesariox>
scootaloo : tried , waiting for reply.
<scootaloo>
In that case, next time don't forget to indicate that you posted in multiple channels, so we know
jrafanie has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
araujo has quit [Read error: Connection timed out]
blackbombay has quit [Ping timeout: 255 seconds]
araujo has joined #ruby
bmurt has joined #ruby
araujo has quit [Max SendQ exceeded]
araujo has joined #ruby
araujo has quit [Max SendQ exceeded]
<scootaloo>
xcesariox: mmh, does `ruby -ropenssl` outputs the same thing?
<xcesariox>
scootaloo : hmm let me try.
<xcesariox>
scootaloo : 1 sec
gigetoo has joined #ruby
araujo has joined #ruby
schickung has joined #ruby
millerti has joined #ruby
houhoulis has joined #ruby
<xcesariox>
scootaloo : seems to take a long time to process
araujo has quit [Max SendQ exceeded]
<scootaloo>
Try Ctrl-D
<scootaloo>
It may just be waiting for input :>
agit0 has joined #ruby
araujo has joined #ruby
<scootaloo>
Then, can you check with `which` the path for the following commands: ruby, bundle, rails
<xcesariox>
scootaloo : all behind here /Users/shaunstanislaus/.rbenv/shims/<<----
IvanSuftin has joined #ruby
<IvanSuftin>
I can't seem to find anywhere that specifies proper Ruby documentation standards. Is there a good source for that?
<apeiros>
I'd assume rdoc documents itself
<apeiros>
the two most popular ruby doc tools are rdoc (stdlib) and yard (gem)
<scootaloo>
xcesariox: Can you try `bundle exec rails s` instead of `rails s`?
gigetoo has quit [Ping timeout: 240 seconds]
<xcesariox>
scootaloo : same output
dc4 has quit [Ping timeout: 240 seconds]
<apeiros>
yard itself I know is pretty well documented: http://yardoc.org
<xcesariox>
scootaloo : it has the stupid openssl.bundle: warning: already initialized constant OpenSSL::VERSION
mostlybadfly has quit [Quit: Connection closed for inactivity]
ifctj has joined #ruby
kies has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ifctj has quit [Ping timeout: 240 seconds]
qba73 has quit [Read error: Connection reset by peer]
qba73 has joined #ruby
UserJosh has joined #ruby
houhoulis has quit [Remote host closed the connection]
Xeago has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
patarr has joined #ruby
gigetoo has joined #ruby
shinnya has quit [Ping timeout: 245 seconds]
jshjsh has quit [Ping timeout: 245 seconds]
grh has quit [Ping timeout: 260 seconds]
pancakebreakfast has joined #ruby
minn has joined #ruby
minimalism has quit [Quit: minimalism]
gigetoo has quit [Ping timeout: 245 seconds]
prestorium has joined #ruby
ferr1 has quit [Quit: WeeChat 1.6]
xall has joined #ruby
Mia has quit [Ping timeout: 248 seconds]
gigetoo has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
blackwind_123 has joined #ruby
cdg_ has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
saneax is now known as saneax-_-|AFK
gigetoo has quit [Ping timeout: 260 seconds]
cdg has quit [Ping timeout: 255 seconds]
Jamdaman_ has joined #ruby
Mia has quit [Ping timeout: 240 seconds]
dc4 has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
fuzzyhorns has joined #ruby
DTZUZU has quit [Read error: Connection reset by peer]
gigetoo has joined #ruby
csk157_ has joined #ruby
Sammichmaker has quit [Read error: Connection reset by peer]
AnoHito_ has joined #ruby
Burgestr_ has quit [Quit: Closing time!]
xcesariox has quit [Remote host closed the connection]
csk157 has quit [Ping timeout: 252 seconds]
xall has quit [Ping timeout: 240 seconds]
gigetoo has quit [Ping timeout: 240 seconds]
AnoHito has quit [Ping timeout: 252 seconds]
clauswitt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdump has joined #ruby
xall has joined #ruby
polishdub has joined #ruby
Bish has quit [Quit: Lost terminal]
<tdump>
Hello. I was working on a power set/permutation problem where I was generating 0/1, on/off 'switches' by converting strings to binary, and while googling I found that someone had solved the problem in one line using ruby's built in array permutations method! That's pretty cool, but being new to ruby I didn't understand the syntax which was used and was hoping someone here could shed light on it.
gigetoo has joined #ruby
aganov has quit [Remote host closed the connection]
<tdump>
this was the code: puts [*0..9].permutation.to_a[ 1_000_000 - 1 ].join
minn has quit [Ping timeout: 248 seconds]
<tdump>
so first the [*0..9] looks like a range to me, but I thought ranges were created with parenthesis, not square brackets. Also what does the * before the 0 do?
__Yiota has joined #ruby
ifctj has joined #ruby
harai has joined #ruby
truenito has quit [Ping timeout: 240 seconds]
<tdump>
then there's the bracket after the array type casting which to me also looks like a range. I wasn't aware that to_a could take na argument. Is that what's occuring?
xall has quit [Ping timeout: 240 seconds]
gigetoo has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
toogley has quit [Quit: toogley]
<tdump>
i misspoke earlier. I was converting integers to binary strings. Not exactly relevant to my question, but thought I'd clarify.
<tdump>
toretore: ok I guess that was kind of a silly of me to miss. Just wasn't looking at it right. So that's not a range, it's an array, but why the *?
bkxd has quit [Ping timeout: 258 seconds]
Snickers has quit [Ping timeout: 260 seconds]
devon21 has joined #ruby
<toretore>
it's jsut a stupid way of writing (0..9).to_a, you shouldn't use it
<toretore>
to_a in your example is not taking argument; it returns an array, and then [] is called on it to retrieve an element at the index given
dionysus69 has joined #ruby
<tdump>
toretore: no shit
dionysus69 has quit [Client Quit]
<tdump>
toretore: okay okay. that's cool. gotta get used to reading this code :-)
chouhoulis has joined #ruby
OTORelic has joined #ruby
xen0fon has quit [Quit: xen0fon]
boombox_ has joined #ruby
boombox_ has quit [Read error: Connection reset by peer]
boombox_ has joined #ruby
gigetoo has joined #ruby
tdy has quit [Quit: WeeChat 1.7]
tuelz has quit [Ping timeout: 240 seconds]
msmith has quit [Remote host closed the connection]
vuoto has joined #ruby
FMan has joined #ruby
agent_white has joined #ruby
hofssle has joined #ruby
csk157_ has quit [Ping timeout: 240 seconds]
qba73 has quit [Remote host closed the connection]
boombox_ has quit [Remote host closed the connection]
<hofssle>
I need to communicate with soap api written in java. I want to make a simple status page (send a request, receive and validate response, display changes). How good is ruby at communicating with SOAP ?
gigetoo has quit [Ping timeout: 256 seconds]
MrBusiness has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Derperperd has joined #ruby
govg has quit [Ping timeout: 264 seconds]
<apeiros>
hofssle: if you go full manual - fairly good
nankyokusei has joined #ruby
dbugger has quit [Remote host closed the connection]
<hofssle>
apeiros: doh..by manual you mean what exactly ? :-)
<apeiros>
if you want code generators, then no idea. last time I looked there were some good dynamic libraries but most of them had issues which made them ineligible for us
<apeiros>
by manual I mean: you use nokogiri (xml parser) + net/http and glue it together.
dhollinger has quit [Ping timeout: 260 seconds]
cgdub has quit [Remote host closed the connection]
despai has joined #ruby
<hofssle>
apeiros: oh ok thanks
dhollinger has joined #ruby
<hofssle>
apeiros: so java and c# are the only one with first class support ?
dc4 has quit [Ping timeout: 260 seconds]
nankyokusei has quit [Ping timeout: 256 seconds]
<tdump>
hey just curious. What IRC clients do you guys use?
fder2 has joined #ruby
despai has quit [Client Quit]
<apeiros>
hofssle: define "first clas support". java and C# have code generators. that may be good or bad. don't know your measure.
blaxter has quit [Quit: foo]
youch has quit [Ping timeout: 258 seconds]
Fernando-Basso has joined #ruby
<apeiros>
last time I checked (~4y ago) ruby iirc didn't have code generators, but ruby is much more dynamic than java/c#, so instead of generating code, the ruby libraries would build stuff dynamically at runtime.
Xentil has joined #ruby
ddffg has joined #ruby
<apeiros>
and the problems we had may very well not apply to you, or been solved in the last 4y.
<agent_white>
Mornin' folks
blackbombay has joined #ruby
<apeiros>
moin agent_white
<agent_white>
\o
brendan- has quit [Read error: Connection reset by peer]
gigetoo has joined #ruby
synthroid has quit [Remote host closed the connection]
dopamean_ has joined #ruby
brendan- has joined #ruby
cajone has joined #ruby
<fder2>
is ruby great for my math, and science application? Or
choke has joined #ruby
dopamean_ has quit [Client Quit]
<fder2>
shall I just stick to python ?
<fder2>
Why would I want to learn ruby from pythoon ?
bmurt has joined #ruby
<fder2>
Will I get any advantages ? If so, what ?
matp_ has quit [Remote host closed the connection]
<baweaver>
What have you already found?
<fder2>
what?
<baweaver>
As in what have you found to be the case when searching on Google?
msmith has joined #ruby
<fder2>
nothing ? I am just starting, but don't know. I know python
<fder2>
baweaver: nothing, not much
<baweaver>
I don't want to rehash what you've already found
<baweaver>
hence the question
<fder2>
It says that python is better, than ruby for science , but don't know
<baweaver>
Python has SciPi, Pandas, and a lot of other scientifically geared libraries to its name. Granted SciRuby is a thing as well
<baweaver>
What it comes down to are libraries
matp has joined #ruby
<fder2>
Why should i learn ruby ? If i know python
<baweaver>
Both Python and Ruby are equally capable languages
<baweaver>
Ruby tends to find its niche in Web Development and System Administration
<fuzzyhorns>
i think ruby has a stronger foothold in building web stuff
<baweaver>
though I see no reason it can't be used in Math / Science
<baweaver>
Really though you're going to end up in R if you're really into that
<baweaver>
R is a language described as a poor man's Matlab
<baweaver>
Both Python and Ruby have interfaces to R though
<fder2>
I use numpy,scipy, matplotlib, so I was wondering as a science student is ruby the right choice for me. No sagemath is sufficient for all that not R . stats models I guess, but I am not into stats anyway. I am in math, and science
vondruch has quit [Ping timeout: 258 seconds]
<baweaver>
It comes down to a few factors: libraries, community support, and then preference
<baweaver>
If you were to ask about Web programming, it's a no contest to Ruby for me
<baweaver>
System administration, devops, and its ilk are strong leans towards Ruby as well.
<baweaver>
but Math and Science? That's Python's bread and butter.
GinoManWorks has joined #ruby
<baweaver>
Short version: Ruby _can_ do those things and _does_ have libraries that support it, but Python has a headstart and far more community buyin
swills_ has joined #ruby
brent__ has joined #ruby
gigetoo has quit [Ping timeout: 248 seconds]
swills has quit [Read error: Connection reset by peer]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brent__ has quit [Remote host closed the connection]
duderonomy has joined #ruby
Ishido has joined #ruby
<tdump>
hey again
montanonic has joined #ruby
<tdump>
let's say I have a large array of ints and I want to put every 20 entries into a subarray, what's the best way to go about it
<tdump>
?
minn has joined #ruby
gusrub has joined #ruby
synthroi_ has joined #ruby
<centrx>
tdump: Check out the Array#each_slice method ?
<tdump>
centrx: on it. thank you.
gigetoo has quit [Ping timeout: 256 seconds]
infernix has joined #ruby
duderonomy has quit [Ping timeout: 255 seconds]
ginetom_ has joined #ruby
synthroid has quit [Ping timeout: 240 seconds]
<tdump>
centrx: that looks perfect. Another newbie question. How is there a quick way, maybe irb or ri, that will let me know if there is a bang version of a method? e.g. is there an each_slice! that modifies in place?
gigetoo has joined #ruby
<centrx>
tdump: Personally I just use the website documentation, but I have seen people using ri commands. If a method name is documented, it must exist
gloscombe_ has joined #ruby
<tdump>
centrx: thanks again
<tdump>
this chatroom is awesome
<tdump>
really appreciate all the help
<tdump>
hopefully I can be the one doing some helping once I get more comfortable with the language
tom335 has quit [Ping timeout: 245 seconds]
nobitanobi has quit [Remote host closed the connection]
<centrx>
Some day soon!
fder2 has left #ruby [#ruby]
pancakebreakfast has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<benlieb>
in irb is there a method on a Class that can tell me what file it’s defined in?
ifctj has quit [Quit: Konversation terminated!]
brent__ has joined #ruby
synthroi_ has quit [Ping timeout: 276 seconds]
nobitanobi has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
nobitanobi has quit [Remote host closed the connection]
Jackneill has joined #ruby
ramfjord has joined #ruby
SeepingN has joined #ruby
jenrzzz has joined #ruby
<tobiasvl>
benlieb: hm, I thought there was, but looks like maybe not? here's a small module someone made to do it though https://gist.github.com/wtaysom/1236979
brent__ has quit [Ping timeout: 276 seconds]
milardovich has joined #ruby
last_staff has quit [Quit: last_staff]
sneakerhax has joined #ruby
Cohedrin_ has joined #ruby
msg31 has joined #ruby
gigetoo has quit [Read error: Connection reset by peer]
gigetoo has joined #ruby
msmith has quit [Remote host closed the connection]
<tobiasvl>
msg31: sorry, mistyped. but you can do something like {'json' => ServerspecTaskJSON, 'documentation' => ServerspecTaskDoc}.each { |k, v| v.new(k) do |t| ..... etc?
tdump has quit [Remote host closed the connection]
msmith has quit [Ping timeout: 255 seconds]
<msg31>
Yep, I think that might work. That makes sense now that I see it, the brain was going to come up with that. Thanks!
Pumukel has joined #ruby
agit0 has joined #ruby
dhollinger has quit [Ping timeout: 240 seconds]
gigetoo has joined #ruby
bkxd has joined #ruby
loechel has joined #ruby
ruby727 has quit [Ping timeout: 260 seconds]
kith has quit [Ping timeout: 260 seconds]
ur5us has quit [Remote host closed the connection]
dhollinger has joined #ruby
loechel has quit [Remote host closed the connection]
loechel has joined #ruby
last_staff has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
Pumukel has quit [Ping timeout: 245 seconds]
pancakebreakfast has joined #ruby
tlahtoani has quit [Quit: Connection closed for inactivity]
jshjsh has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
JoshS has quit [Ping timeout: 245 seconds]
jshjsh has quit [Remote host closed the connection]
loechel has quit [Ping timeout: 256 seconds]
brent__ has joined #ruby
d^sh has quit [Ping timeout: 240 seconds]
msmith has joined #ruby
d^sh has joined #ruby
gigetoo has joined #ruby
qba73 has quit [Read error: Connection reset by peer]
qba73 has joined #ruby
Synthead has joined #ruby
gigetoo has quit [Ping timeout: 276 seconds]
truenito has quit [Ping timeout: 252 seconds]
Fernando-Basso has quit [Quit: WeeChat 1.5]
r__rios has joined #ruby
r__rios has joined #ruby
r__rios has quit [Changing host]
psychicist__ has quit [Ping timeout: 252 seconds]
skweek has quit [Ping timeout: 255 seconds]
last_staff has quit [Quit: last_staff]
ur5us has joined #ruby
rrios has quit [Ping timeout: 248 seconds]
JeanCarloMachado has quit [Ping timeout: 258 seconds]
<manveru>
tobiasvl: that works, as long as your class has methods :)
pawnbox has joined #ruby
vuoto has quit [Remote host closed the connection]
afterburned6387 has joined #ruby
nankyokusei has joined #ruby
<manveru>
and btw for vim it's system("vim", file, "+#{line}") and i don't think you need to use ``, you don't care about the returned stdout
anisha_ has quit [Quit: This computer has gone to sleep]
<manveru>
and i should probably edit the gist, since you didn't write it anyway :P
gigetoo has joined #ruby
ifctj has joined #ruby
<tobiasvl>
manveru: yeah good point
nankyokusei has quit [Ping timeout: 240 seconds]
youch has quit [Ping timeout: 240 seconds]
pancakebreakfast has quit [Quit: Textual IRC Client: www.textualapp.com]
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
username_ has quit [Ping timeout: 245 seconds]
[Butch] has quit [Quit: I'm out . . .]
jaruga_____ has quit [Quit: jaruga_____]
kirun has joined #ruby
gigetoo has quit [Ping timeout: 256 seconds]
GarouDan has quit [Ping timeout: 240 seconds]
gigetoo has joined #ruby
lanc has quit [Quit: zzZZZZzzZZZZzzZZzzZZZZzzzzzzzzz]
whathappens has quit [Ping timeout: 258 seconds]
cb has quit [Read error: Connection reset by peer]
<manveru>
yeah... i don't think there is any if you want to only run each match once
quick has joined #ruby
ginetom_ has joined #ruby
qba73 has quit [Read error: Connection reset by peer]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
qba73 has joined #ruby
izaac has quit [Ping timeout: 255 seconds]
grh has quit [Ping timeout: 240 seconds]
simmib_ has joined #ruby
username_ has joined #ruby
Pumukel has joined #ruby
izaac has joined #ruby
gigetoo has joined #ruby
ta has joined #ruby
skweek has joined #ruby
mikecmpbll has joined #ruby
ta has quit [Remote host closed the connection]
mikecmpbll has quit [Client Quit]
tlahtoani has joined #ruby
simmib_ has quit [Ping timeout: 276 seconds]
dviola has joined #ruby
gigetoo has quit [Ping timeout: 256 seconds]
tildes has quit [Ping timeout: 252 seconds]
lenwood has quit [Ping timeout: 255 seconds]
lenwood has joined #ruby
loechel has joined #ruby
loechel has quit [Remote host closed the connection]
Derperperd has quit [Ping timeout: 240 seconds]
whathappens has joined #ruby
Pumukel has quit [Ping timeout: 252 seconds]
gigetoo has joined #ruby
blackbom1 has joined #ruby
ta has joined #ruby
<TomyLobo>
i have a bunch of servers that send me logs via udp. i have a rather dated program that catches and analyzes them. A few of the log messages now have a new format and I wanted to supplement the logs with some data acquired on a secondary channel.
lenwood has quit [Ping timeout: 240 seconds]
<TomyLobo>
my plan was to send packets to that old program, spoofed to appear to come from one of the servers
<TomyLobo>
i found the https://rubygems.org/gems/racket library, but it seems rather old and i'm getting strange exceptions from its guts
<TomyLobo>
but i just noticed one of the dependencies is newer than the library itself, so that might cause it...
ddffg has joined #ruby
harai_ has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
raul782 has joined #ruby
harai has quit [Ping timeout: 256 seconds]
<TomyLobo>
nope, same error with a version of bit-struct that is older than racket: $HOME/.gem/ruby/gems/bit-struct-0.13.6/lib/bit-struct/bit-struct.rb:169:in `add_field': Field length is already defined as a method. (BitStruct::FieldNameError)
qba73 has quit [Remote host closed the connection]
<TomyLobo>
eww, one post from 2011 suggests going back to ruby 1.8.7
qba73 has joined #ruby
qba73 has quit [Remote host closed the connection]
wilbert has quit [Read error: Connection reset by peer]
wilbert_ has joined #ruby
blackbom1 has quit [Ping timeout: 240 seconds]
nobitanobi has joined #ruby
squarebracket has left #ruby ["WeeChat 1.4"]
sharon_so has joined #ruby
<sharon_so>
Hi, I developed an app and i'd like to test its stability, from the OS, so i am thinking of tests like 'sigterm', process restart...etc, any suggestions on where i can get a list of test cases that would cover these 'stability' kind of tests ?
<sharon_so>
.join #cpp
gigetoo has quit [Ping timeout: 240 seconds]
harai_ has quit [Ping timeout: 252 seconds]
Burgestrand has joined #ruby
ecuanaso has joined #ruby
harai has joined #ruby
Xeago has quit [Ping timeout: 245 seconds]
nobitanobi has quit [Ping timeout: 255 seconds]
<eam>
sharon_so: what does "stability" mean?
<sharon_so>
I'm new to development, so i was just thinking of 'common' tests that are related to OS issues, not exactly issues related to my App.
lenwood has joined #ruby
<sharon_so>
eam: so my first thought was terminating it with sigterm, or a kill -9.
AnoHito_ has quit [Read error: Connection reset by peer]
<elomatreb>
Why would you worry about such things? Esp. with drastic measures like that you can't really do anything about them in your app
AnoHito_ has joined #ruby
<sharon_so>
elomatreb: i want to find out how the app will behave and if it will be able to recover.
gigetoo has joined #ruby
<baweaver>
"I'm new to development" - don't worry about that
<baweaver>
it's a bit of a time drain for very little gain
dionysus70 has joined #ruby
<baweaver>
Stability is essentially having a logging program on it and using something like Monit to say if RAM use goes over X or CPU use goes over Y then restart
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus70 is now known as dionysus69
<baweaver>
or if program down, start again
last_staff has joined #ruby
<sharon_so>
baweaver: any thoughts on where i might be able to get a list of common tests related to external factors, i can only think of a few (sigterm, sigkill, disk space, network impediment)
<baweaver>
don't worry about them
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver>
you're microoptimizing.
<baweaver>
that's what other monitoring tools are for
gigetoo has quit [Ping timeout: 240 seconds]
brendan- has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
harai_ has joined #ruby
<baweaver>
your program should only be concerned with what it does
harai has quit [Ping timeout: 252 seconds]
<baweaver>
leave the rest to something like Sensu or Monit
brendan- has joined #ruby
lanc has quit [Quit: zzZZZZzzZZZZzzZZzzZZZZzzzzzzzzz]
ur5us has quit [Ping timeout: 252 seconds]
<baweaver>
Monit is used to monitor external process conditions on the server and influence programs as needed (restart, reload conf, start, etc)
<baweaver>
Sensu is used to check the condition of a group of servers
<elomatreb>
And since things like Out Of Memory or a process kill can happen at almost any point during your apps execution, it doesn't make sense to worry about them since you can't predict the effects
<baweaver>
You want to do two things when that happens:
<baweaver>
1) Alert via email or etc
<baweaver>
2) try to recover automatically
synthroid has quit []
tomphp has joined #ruby
<elomatreb>
3) All of the above
minn has quit [Ping timeout: 248 seconds]
cevett has quit [Read error: Connection reset by peer]
bkxd has quit [Ping timeout: 252 seconds]
cevett has joined #ruby
ur5us has joined #ruby
<baweaver>
sharon_so: does that all make sense?
gigetoo has joined #ruby
wilbert_ has quit [Quit: WeeChat 1.7]
wilbert has joined #ruby
<sharon_so>
thanks baweaver , it does
hahuang61 has joined #ruby
gusrub has quit [Remote host closed the connection]
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
qba73 has quit [Remote host closed the connection]
ecuanaso has joined #ruby
qba73 has joined #ruby
gigetoo has quit [Ping timeout: 248 seconds]
tomphp_ has joined #ruby
qba73 has quit [Read error: Connection reset by peer]
cagomez has quit [Remote host closed the connection]
qba73 has joined #ruby
pawnbox has quit [Remote host closed the connection]
tomphp has quit [Ping timeout: 245 seconds]
ramfjord has quit [Ping timeout: 252 seconds]
centrx has quit [Remote host closed the connection]
centrx has joined #ruby
centrx has joined #ruby
centrx has quit [Changing host]
GinoManWorks has quit [Quit: Leaving]
ramfjord has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
brendan- has quit [Ping timeout: 252 seconds]
whathappens has quit [Remote host closed the connection]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
malconis has quit [Read error: Connection reset by peer]
raul782 has quit [Remote host closed the connection]
whathappens has joined #ruby
Burgestrand has quit [Quit: Closing time!]
raul782 has joined #ruby
whathappens has quit [Remote host closed the connection]
nankyokusei has joined #ruby
whathappens has joined #ruby
msmith has quit [Remote host closed the connection]
centrx has quit []
afterburned6387 has quit []
renchan has quit [Ping timeout: 255 seconds]
brendan- has joined #ruby
nankyokusei has quit [Ping timeout: 252 seconds]
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
ur5us has quit [Remote host closed the connection]
harai_ has quit [Ping timeout: 240 seconds]
qba73 has quit []
harai_ has joined #ruby
<masterasia>
fuzzyhorns, thank you
gigetoo has joined #ruby
tomphp_ has quit [Read error: Connection reset by peer]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lanc has joined #ruby
dmtd has quit [Quit: Connection closed for inactivity]
tomphp has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
cajone has left #ruby [#ruby]
c355e3b has quit [Quit: Connection closed for inactivity]
wilbert has quit [Ping timeout: 245 seconds]
Xeago has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
gigetoo has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
Xeago_ is now known as Xeago
agit0 has quit [Quit: zzzZZZ….]
benlieb has quit [Quit: benlieb]
lanc has quit [Quit: zzZZZZzzZZZZzzZZzzZZZZzzzzzzzzz]
<baweaver>
Is that first line supposed to be `data = {...}` instead of `{...}` ?
<baweaver>
and are you dead sure your code has that value filled in every hash?
<baweaver>
chances are it's blank in one of them
bkxd has joined #ruby
Burgestrand has quit [Ping timeout: 255 seconds]
polishdub has quit [Quit: Leaving]
<MrPunkin>
baweaver: Sorry, it’s an already set hash, I was just giving the output of it for context as to exactly what the inspect looks like.
<MrPunkin>
baweaver: you’re probably right though, it’s likely in a different reference to this hash that existists in a loop than the one I’m focusing on. Thanks for the reminder.
<baweaver>
surround it in a rescue
<baweaver>
then see what that error is when it hits
bkxd has quit [Ping timeout: 276 seconds]
dogweather has joined #ruby
OTORelic has quit [Ping timeout: 245 seconds]
tomphp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Jackneill has quit [Remote host closed the connection]
harai_ has joined #ruby
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
brent__ has quit [Read error: Connection reset by peer]
mostlybadfly has joined #ruby
agent_white has quit [Quit: baibai]
wsk has quit [Quit: Leaving]
sebd has quit [Ping timeout: 240 seconds]
sebd has joined #ruby
toretore has quit [Ping timeout: 240 seconds]
ddffg has quit [Quit: Leaving]
agit0 has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
<elomatreb>
It didn't even have the `symbol: "value"` syntax
<baweaver>
It's called technical debt and you're going to drown in it
gigetoo has joined #ruby
<baweaver>
take it from someone who runs sites with tens of thousands of servers, upgrade
<havenwood>
leitz: Using software that no longer receives security updates for publicly disclosed vulnerabilities isn't a good idea.
<baweaver>
A sysadmin that cannot be trusted to upgrade known vulnerabilities is a hazard to their company
<baweaver>
A simple NMAP scan is all it takes to expose a laundry list of vulnerabilites
alex`` has joined #ruby
<baweaver>
Tenable Nessus would do the same
<baweaver>
The word negligence comes to mind quickly, and justifying it only makes it worse
<leitz>
havenwood, the RH supported rpms do get some security backports. So it's not pure 1.8.7, but RH's patched version of it.
saslam has quit [Ping timeout: 240 seconds]
<elomatreb>
Ruby switched infrastructure with the version change from 1.8 to 1.9. Is there even anything to backport?
<havenwood>
leitz: Yes, there are some unofficial security backports. I'm more accepting the premise that "It is insecure."
gigetoo has quit [Ping timeout: 240 seconds]
<leitz>
havenwood, I don't understnad the "more accepting" part of that last sentence.
<leitz>
elomatreb, RH backports security stuff, not architecture. Trust me, I have to keep notes on what's 1.8 specific as 1.9 changed a bunch of stuff. When I was working on Puppet based servers I cheated and used the Puppet packaged 1.9 where I could.
<elomatreb>
With Ruby 1.9, the default interpreter was replaced by a completely different project (YARV)
nahra has joined #ruby
<leitz>
Yeah, and even RHEL 7 only had Ruby 2.0.x, I think.
<leitz>
had/has
<elomatreb>
Anyway, you're probably better off not caring about ancient Ruby versions. We can't really help you more than that
<leitz>
Sadly, it chokes on 2.4.0 too. Same issue.