<craysiii>
so im trying to create a gem to be used in another project, i created .gemspec, built the gem, and installed it successfully, but i can't seem to require it?
<craysiii>
also im trying to require it in a irb session
hutch34 has quit [Ping timeout: 255 seconds]
im0nde has quit [Read error: Connection reset by peer]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
boombox_ has joined #ruby
<havenwood>
craysiii: You tried?: require 'roleplayagent'
<havenwood>
craysiii: You ran?: gem install roleplayagent-0.0.1.gem
<havenwood>
craysiii: Sanity check that it's installed: gem which roleplayagent
<craysiii>
yes, i must give backstory. I actually got it to work before by doing require cinch then require roleplayagent, then I changed the gemspec file to include the dependencies when i do require roleplayagent, now it wont work
<stormbytes>
it works, but.. i thought the whole point of capture3 was to avoid stuff like #{}
<stormbytes>
what's '**opts' in your example?
<stormbytes>
i guess i'm wondering if theres some way of passing a hash or an array with options.. i dunno
<stormbytes>
if its all about building up the :stdin_data string I can do that too
troys is now known as troys_
<quazimodo>
hi all
jrafanie has joined #ruby
<quazimodo>
Curious to know, is it possible to build ruby gems via bundler into a /path/to/bundle directory (including using native extensions) then copy the directory into another identical machine/vm minus all the build time packages like make, etc. and have it run?
<quazimodo>
essentially, i'm tired of my rails docker image being 1.4gigs
<quazimodo>
i'd like to build everything in one image, once it's done building just copy it all over into another image and be done with it
<quazimodo>
any thought?
jrafanie has quit [Client Quit]
oschub is now known as DenSchub
roamingdog has joined #ruby
<zenspider>
quazimodo: if it is docker, you could build one image with your stuff and then declare that your base image, no?
<quazimodo>
zenspider: still makes everything huge
<zenspider>
and as far as build time dependencies go... you can either remove the build deps in the same cmd that added them so they don't take up space, or you can use the new experimental --squash option
<quazimodo>
so, for example, a change in gems needed would mean the base image changes, and once again i'm pushing huge diffs up
<quazimodo>
didn't see squash
<zenspider>
the former is something like: CMD pkg add x y z && bundle && pkg del y z
<quazimodo>
yeah I get that
<quazimodo>
but it means doing a _lot_ in one command
<zenspider>
I'm working for a client that is using a very old version of node so they have to build their own... the CMD is probably 30 lines long (formatted well)
<zenspider>
a newer version would be ~30 CMDS and the docker build cmd would use --squash
<quazimodo>
i have to understand squash first
<zenspider>
it's basically the same thing... later deletes are able to affect the final image
<quazimodo>
right
<zenspider>
the intermediates will be fat tho
<quazimodo>
so my build machine will hold the huge images, but the final image pushed into registry will be minimal
<zenspider>
should be, yeah
<stormbytes>
zenspider what kind of arguments does capture3 take? I get the first one is the command, but what is :stdin_data => string? is that a hash ?
<stormbytes>
without braces
jusa has joined #ruby
HoierM has quit [Ping timeout: 240 seconds]
Bhootrk_ has joined #ruby
Bhootrk_ has quit [Max SendQ exceeded]
kies has joined #ruby
rohitpaulk has quit [Ping timeout: 260 seconds]
demio has quit [Quit: Computer has gone to sleep.]
Guest69 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<zenspider>
stormbytes: it's literally named as to what it takes. I really don't get your confusion... To the point where I had to ask others if you were a troll given this and our interactions this weekend.
jusa has quit [Ping timeout: 272 seconds]
demio has joined #ruby
<quazimodo>
lol
agent_white has joined #ruby
<stormbytes>
ok nevermind
<zenspider>
just in case: "stdin" translates to "standard input"
demio has quit [Client Quit]
<quazimodo>
that's amazing
<quazimodo>
seriously
<quazimodo>
what kind of arguments does capture3 take?...it's literally named as to what it takes.
demio has joined #ruby
rohitpaulk has joined #ruby
* zenspider
shrugs
<stormbytes>
seriously dude, what is up with the ad hominem attacks? This is a ruby channel. i'm asking questions about Ruby. its in't my fault if you are just oh-so-smart that you find my questions "trolling"
demio has quit [Client Quit]
railswebdev has joined #ruby
yottanami_ has joined #ruby
dlitvak has joined #ruby
<stormbytes>
I'm not as "gifted" as you must be, and I would appreciate if you would quit it with the abusive language and the bullying
<zenspider>
0) ad hominem: (of an argument or reaction) directed against a person rather than the position they are maintaining.... 1) there are no attacks above. 2) you don't seem to have a position that you're maintaining 3) the only person who's attacking at this point is you.
mitt3ns has quit [Ping timeout: 240 seconds]
marxarelli is now known as marxarelli|afk
<stormbytes>
zenspider moving forward, either offer assistance of kindly move along and feel free to ignore my questions. I'm not looking to be the object of your abusive remarks.
<zenspider>
again... the only person attacking right now... is YOU
* baweaver
sighs
<baweaver>
enough
<zenspider>
I pointed out, again, that the arguments are literally named as to what they take and you claimed abuse.
<baweaver>
stormbytes: you need to read through the documentation, slowly
<stormbytes>
I don't know what 'attacks' you perceive. Im' not attacking you I'm pointing out that I've had it with your rude, condescending and downright abusive treatment.
roamingdog has quit [Ping timeout: 260 seconds]
<zenspider>
stop conflating abuse with shit you don't like
<baweaver>
you've not been abused.
<stormbytes>
Its your call if you want to contribute an answer to anyones question, but finding a question silly or simplistic does NOT give you the right to abuse the person and call them names as you've been doing repeatedly to me
<baweaver>
and I've not seen any name calling either.
yottanami_ has quit [Ping timeout: 240 seconds]
<stormbytes>
so like i said, feel free to ignore my questions. I have just as much right to be here and I don't deserve to be called names or otherwise mistreated. You've been warned.
<zenspider>
strike 2...
<baweaver>
stormbytes: enough
<baweaver>
No one has abused you or called you names
<stormbytes>
scroll up
<baweaver>
I did
<stormbytes>
not far enough
<stormbytes>
he's been calling me a troll and implied that he's included others in discussing this, for no reason other than my asking simple questions relating to ruby
<stormbytes>
feel free to search through the channel logs, you'll see it
<baweaver>
He discussed it with me
<stormbytes>
frankly i'm floored that this sort of thing is tolerated
<baweaver>
and I simply said you had difficulty understanding things.
<baweaver>
I can look up past logs later, but at this moment you're the one that's out of line
<baweaver>
and it stops now
<stormbytes>
what exactly is "out of line"
<stormbytes>
what *specifically* stops now?
<zenspider>
conflating abuse with shit you don't like is "out of line". I'm literally reading a book right now titled "Conflict is not Abuse"... good timing
<stormbytes>
i've no interest in discussing this any further. I'm here to learn ruby and engage with others in that effort. Either address me respectfully or please ignore my questions altogether. The end.
<zenspider>
and I'd say what specifically stops is your tirade. BS like you line above with "You've been warned"
<stormbytes>
baweaver as for my question, I don't entirely understand the arguments that open3.capture3 takes
<stormbytes>
I get the first parameter is the command to be executed. Whats the next one?
belmoussaoui has quit [Quit: belmoussaoui]
belmoussaoui has joined #ruby
<havenwood>
stormbytes: The Open3#capture3 docs point to Open3#popen3 which say "If the last parameter, opts, is a Hash, it is recognized as an option for Process.spawn."
<havenwood>
stormbytes: I'd suggest the Process::spawn docs.
<havenwood>
stormbytes: Link ^ above.
<zenspider>
of course the cafe network goes dead mid-argument... :P
<stormbytes>
I did see that
<stormbytes>
this is greek to me
normie1 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<stormbytes>
i want to know how to convert a regular bash command into a format that open3.capture3 takes
charliesome has joined #ruby
<stormbytes>
so somecommand --port 3 -u me -p mypwd /some/file.txt
<stormbytes>
with back ticks or system() its straight forward but apparently open3 is the way to go
oliv_____ has quit [Remote host closed the connection]
<havenwood>
stormbytes: stdout, stderr, status = Open3.capture3("somecommand --port 3 -u me -p mypwd /some/file.txt")
olivi____ has joined #ruby
<stormbytes>
havenwood i got that.. but i thought there was some way to pass the arguments and options as some data structure (array, hash, etc)
<stormbytes>
so.. my bad, i guess i'm not approaching this correctly
<stormbytes>
because its going to end up as stdout, stderr, status = Open3.capture3("somecommand --port #{port} -u #{user} -p #{mypwd} #{file} ")
<zenspider>
FUCK... the cafe network is terrible. went home.
<zenspider>
havenwood: I'm not sure I would... the spawn docs are really thick
<stormbytes>
and I've read pretty much everywhere that this is bad practice
<stormbytes>
the other way that works is this stdout, stderr, status = Open3.capture3("rd ports", :stdin_data => "-i #{options[:index]}")
<stormbytes>
but i'm just geussing
olivi____ has quit [Ping timeout: 240 seconds]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider>
guaranteed that doesn't work
<zenspider>
oooh I didn't even notice the dramatic #ops maneuver :P
gix has quit [Ping timeout: 268 seconds]
raspado has joined #ruby
rohitpaulk has quit [Ping timeout: 246 seconds]
ace05 has quit [Remote host closed the connection]
<zenspider>
stormbytes: what is bad practice specifically?
gix has joined #ruby
<stormbytes>
as I understand it, allowing variable interpolation inside command line arguments
<zenspider>
why?
<stormbytes>
eg. ls #{directory}
<stormbytes>
my guess is it opens things up to malicious code?
<zenspider>
are you in charge of the value in `directory`?
jgt has joined #ruby
<stormbytes>
well, yeah.. which is kind of how I saw it, but I thought it would be best to learn how to conform to best practices
<stormbytes>
this has been a 3+ hour pita now.. I'm not looking for the adventure
<stormbytes>
i'm going to keep it simple for now and possibly revisit/refactor this once I have a better handle on things
<zenspider>
malicious code doesn't just appear. it has to have a vector.
<stormbytes>
right, and i'm not sure my little script warrants all this footwork, but I saw it as a learning experience
<zenspider>
you might want to ri Process.spawn and look at the different forms that the command can have
<stormbytes>
I bookmarked it in the docs, will look that over when I've got more brain power
<stormbytes>
btw, the other day.. your Number() example was spot on
<stormbytes>
I looked it over the following morning, tested a bit and used the suggestion. I was initially thrown off by the use of being/rescue but read up on it
<stormbytes>
*begin, not being
raspado has quit [Remote host closed the connection]
jgt has quit [Ping timeout: 268 seconds]
DaniG2k has joined #ruby
theunraveler has joined #ruby
theunraveler has quit [Remote host closed the connection]
uZiel has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #ruby
safetypin has joined #ruby
donald has quit [Quit: Leaving.]
alveric1 has quit [Quit: WeeChat 1.8]
jusa has joined #ruby
troys_ is now known as troys
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
postmodern has quit [Quit: Leaving]
mim1k has joined #ruby
Guest69 has joined #ruby
railswebdev has joined #ruby
mim1k has quit [Ping timeout: 246 seconds]
DaniG2k has quit [Quit: leaving]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
ace05 has joined #ruby
hutch34 has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rohitpaulk has quit [Ping timeout: 246 seconds]
hutch34 has quit [Ping timeout: 268 seconds]
Guest69 has joined #ruby
railswebdev has joined #ruby
mim1k has joined #ruby
mitt3ns has joined #ruby
safetypin has quit [Quit: ZZZzzz…]
jenrzzz has quit [Ping timeout: 240 seconds]
agent_white has quit [Ping timeout: 246 seconds]
mim1k has quit [Ping timeout: 240 seconds]
agent_white has joined #ruby
mitt3ns has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
GinoMan2440 has quit [Ping timeout: 255 seconds]
GinoMan2440 has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
mitt3ns has joined #ruby
meshsmith has joined #ruby
renchan has joined #ruby
meshsmith has quit [Read error: Connection reset by peer]
agent_white has quit [Ping timeout: 246 seconds]
ascarter has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
meshsmith has joined #ruby
roamingdog has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
roamingdog has quit [Ping timeout: 240 seconds]
* dminuoso
wants Kernel#malloc
jenrzzz has joined #ruby
dionysus69 has joined #ruby
uZiel has joined #ruby
rohitpaulk has joined #ruby
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
<matthewd>
dminuoso: Not much you could do with it without ffi
<dminuoso>
matthewd: But I am using fiddle left and right. :S
DTZUZU has quit [Quit: WeeChat 1.5]
<dminuoso>
Trying to write C code in Ruby..
AnoHito_ has joined #ruby
<matthewd>
`Kernel.send :include, Fiddle`, problem solved :P
nadir has quit [Quit: Connection closed for inactivity]
<dminuoso>
Hehe.
dionysus69 has quit [Remote host closed the connection]
dc2 has joined #ruby
<matthewd>
Oh, except for the module-inclusion-order thing. So `Object.include Fiddle` (why did I think include was private?)
AnoHito has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
<dminuoso>
matthewd: Interestingly I keep making that same assumption.
<dminuoso>
I mean it kind of makes sense, you shouldnt be able to mutate the inheritance chain *that* easily..
muelleme has joined #ruby
cfec0b8d has joined #ruby
<matthewd>
I think it'd because define_method trips me up
<matthewd>
Especially when Object#define_singleton_method is public :|
<dminuoso>
:o
jenrzzz has quit [Ping timeout: 246 seconds]
ur5us has quit [Remote host closed the connection]
gothicsouth has joined #ruby
hanmac1 has left #ruby [#ruby]
hanmac has joined #ruby
JoshS has joined #ruby
meshsmith has quit [Remote host closed the connection]
dionysus69 has quit [Remote host closed the connection]
Bock has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
jgt has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
ascarter has joined #ruby
ascarter_ has joined #ruby
jameser has quit [Read error: Connection reset by peer]
jameser has joined #ruby
jusa has quit [Ping timeout: 240 seconds]
muelleme has quit [Ping timeout: 268 seconds]
xall has joined #ruby
xall has quit [Client Quit]
aupadhye has joined #ruby
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
anisha has joined #ruby
anisha has quit [Remote host closed the connection]
roamingdog has joined #ruby
anisha has joined #ruby
oleo has quit [Quit: irc client terminated!]
ben__ has quit [Ping timeout: 268 seconds]
BSAlb has joined #ruby
BSAlb has quit [Max SendQ exceeded]
uZiel has quit [Ping timeout: 248 seconds]
BSAlb has joined #ruby
BSAlb has quit [Max SendQ exceeded]
ben__ has joined #ruby
BSaboia has quit [Ping timeout: 240 seconds]
BSAlb has joined #ruby
BSAlb has quit [Max SendQ exceeded]
BSAlb has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #ruby
muelleme has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
uZiel has joined #ruby
byte512_ has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
troys is now known as troys_
ace05 has quit [Remote host closed the connection]
ace05 has joined #ruby
byte512 has quit [Ping timeout: 240 seconds]
ace05 has quit [Remote host closed the connection]
BSaboia has joined #ruby
BSaboia has quit [Max SendQ exceeded]
Burgestrand has joined #ruby
BSAlb has quit [Ping timeout: 246 seconds]
BSaboia has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
ltem has joined #ruby
jameser has joined #ruby
jaruga_________ has joined #ruby
jamesaxl has joined #ruby
Cohedrin has joined #ruby
psmolen has quit [Ping timeout: 245 seconds]
lel has quit [Ping timeout: 240 seconds]
duderonomy has quit [Ping timeout: 240 seconds]
AnoHito_ has quit [Ping timeout: 240 seconds]
cyphase has quit [Ping timeout: 245 seconds]
ByronJohnson has quit [Ping timeout: 245 seconds]
duderonomy has joined #ruby
nuck has quit [Ping timeout: 240 seconds]
cyphase has joined #ruby
psmolen has joined #ruby
Mortomes|Work has joined #ruby
ByronJohnson has joined #ruby
AnoHito has joined #ruby
enterprisey has quit [Remote host closed the connection]
muelleme has quit [Ping timeout: 260 seconds]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<zenspider>
Seenox: `ri Net::HTTP` and look at the Attributes section
nobitanobi has joined #ruby
last_staff has quit [Client Quit]
saschavoid has joined #ruby
<zenspider>
and/or `ri Net::HTTP.start`
olivi____ has quit [Ping timeout: 240 seconds]
<zenspider>
and since you're still just doing a get, I'd seriously consider doing open-uri instead
<Seenox>
zenspider: Thanks, I will need to change it to PUT and DELETE, etc. soon. I'm just testing it.
<Seenox>
zenspider: Hmm, seems like I need to add some attr in req_options section.
<zenspider>
kk... well, you can always read open-uri.rb for hints
<zenspider>
ie, emacs $(gem which open-uri)
<zenspider>
looks like it creates an x509 store and puts everything in there instead
<Seenox>
Yeah... I've changed my code a little bit and got this: `initialize': wrong argument (String)! (Expected kind of OpenSSL::X509::Certificate) (TypeError)
Silthias has joined #ruby
jgnagy has quit [Remote host closed the connection]
gizmore has joined #ruby
<zenspider>
go read open-uri and look at what it does
ur5us has quit [Remote host closed the connection]
<apeiros>
alternatively, you can read the whole file into memory. not advisable for big files, or files of unknown size.
patarr has joined #ruby
<conta>
I see there is also #reopen, I guess I am going to use it
<conta>
thanks guys
<apeiros>
seek is probably better, but sure.
<elomatreb>
You probably want #rewind not #reopen?
mim1k has quit [Ping timeout: 240 seconds]
<conta>
so what I do is: check number of lines that user wants, if that is bigger than file, use real count of lines
pandaant has quit [Quit: Lost terminal]
rgr has quit [Ping timeout: 240 seconds]
xall has joined #ruby
<apeiros>
oh right, rewind exists too.
* apeiros
too rarely has to move to the start of a file - more often to a specific location (and that's rare too actually)
patarr has quit [Ping timeout: 258 seconds]
fusta has joined #ruby
<dminuoso>
apeiros: Hah! I had to use rewind for the first time.
<dminuoso>
Just a week ago.
* apeiros
will use unwind, just 2 days from now
<dminuoso>
I see what you did there.
<apeiros>
but I haven't even done it yet?!?
<apeiros>
we can rewind to what you just said in 2 days
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
apeiros: Stop violating causality. Didn't your mother teach you to not exceed the speed of light?
<apeiros>
I don't. I only bend some dimensions. can't help if they warp around.
dionysus69 has quit [Read error: Connection reset by peer]
mim1k has joined #ruby
xall has quit [Quit: xall]
tomphp has joined #ruby
tomphp has quit [Client Quit]
stormbytes has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
ace05 has quit [Read error: Connection reset by peer]
ace05 has joined #ruby
jackrandom has joined #ruby
tomphp has joined #ruby
SuperTaz has joined #ruby
rohitpaulk has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
Mortomes|Work has quit [Ping timeout: 260 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Silthias has quit [Ping timeout: 240 seconds]
arquebus has quit [Quit: konversation disconnects]
Silthias has joined #ruby
marr has joined #ruby
yottanami has joined #ruby
<yottanami>
How can I write this code more clear in Ruby style `product_counts = @products.each_with_object(Hash.new(0)) { |p, count| count[p.code] += 1 }.keep_if { |_k, v| v >= 2 }`
ferr1 has joined #ruby
SesMan has joined #ruby
statikowsky has joined #ruby
tfitts has joined #ruby
<dminuoso>
yottanami: By using variables.
<dminuoso>
yottanami: Or you could use a single map.
<dminuoso>
Or actually mm yeah.
<yottanami>
dminuoso, Using single map? how?
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
elomatreb: I thought about it, but each_with_object is just more expressive (and faster)
<elomatreb>
Also, I failed. That just gets you the counts, nevermind
<yottanami>
elomatreb, What about using reduce?
<dminuoso>
yottanami: each_with_object is the same, except you dont have to use "next"
<dminuoso>
(Since you can mutate it instead)
<elomatreb>
Yep, reduce/inject are just fancy functional programming versions of each_with_object
dc2 has quit [Ping timeout: 240 seconds]
<dminuoso>
yottanami: Personally I might actually use each.with_object (for consistencies sake) instead of each_with_object
jaruga_________ has quit [Ping timeout: 240 seconds]
jaruga_________ has joined #ruby
andikr has quit [Ping timeout: 260 seconds]
tomphp has joined #ruby
GodFather has joined #ruby
last_staff has joined #ruby
morfin has joined #ruby
ur5us has joined #ruby
jrafanie has joined #ruby
<morfin>
Array.sample use Random right?
tomphp has quit [Client Quit]
last_staff has quit [Client Quit]
rgr has joined #ruby
<dminuoso>
morfin: By default yes, but you can supply a different random engine if you want.
<dminuoso>
Actually.
tomphp has joined #ruby
<dminuoso>
morfin: Yes. VALUE opts, randgen = rb_cRandom;
<morfin>
hmm rb_cRandom?
<elomatreb>
That's from the C source of sample
<dminuoso>
morfin: That's the C name for the class Random.
tomphp has quit [Client Quit]
<dminuoso>
morfin: And it's overriden if you supply the kwarg random.
<morfin>
i was looking how it choose random index, since it's Random then probably MT
jgnagy has joined #ruby
<dminuoso>
morfin: Correct.
<dminuoso>
morfin: MT19937 to be to exact.
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apparition has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yottanami_ has joined #ruby
yottanami has quit [Read error: Connection reset by peer]
andikr has joined #ruby
<dminuoso>
morfin: But you could do [1,2].sample(random: OpenSSL::Random) if you needed a cryptographically secure sample.
t-recx has joined #ruby
<conta>
guys, [1,2,3,4,5][-1..-2] should return [] ?
jgnagy has quit [Ping timeout: 255 seconds]
last_staff has joined #ruby
<dminuoso>
conta: Yeah.
<conta>
ah, should be -2..-1
<conta>
my bad
<elomatreb>
Wouldn't using SecureRandom be easier (and possibly better should Ruby finally decide to use system RNGs)?
belmoussaoui_ has joined #ruby
tomphp has joined #ruby
devyn has quit [Ping timeout: 246 seconds]
Burgestrand has joined #ruby
last_staff has quit [Client Quit]
Qchmqs__ has joined #ruby
Qchmqs__ is now known as Qchmqs
devyn has joined #ruby
belmoussaoui has quit [Ping timeout: 260 seconds]
last_staff has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<morfin>
MT is faster i think
last_staff has quit [Client Quit]
<elomatreb>
Speed of RNGs should rarely be of any concern
<morfin>
since system RNG use /dev/urandom or CryptGenRandom or something else
<morfin>
no, that's not true )
<elomatreb>
Generating a new batch of /dev/urandom data should just be a few rounds of whatever stream cipher the implementation uses, it won't take long
<morfin>
as example i use RNG to generate world in other project(on C++) and use std::mt19937 and fast generation is concerning me
<morfin>
i don't need secure random numbers, just random
<elomatreb>
Maybe one of the valid cases then, but these differences will not matter in Ruby code
<morfin>
well, maybe
charliesome has joined #ruby
charliesome has quit [Client Quit]
<duper>
When writing a method such as a Class initialize, what's the difference between passing &block as a parameter and using `block.call(x) if block` VS. `yield x if block_given?`
<elomatreb>
duper: The latter saves you execution time since Ruby doesn't have to convert the block to a Proc object
robouk has quit [Quit: Konversation terminated!]
<morfin>
i prefer yield thing
<elomatreb>
You should, if you don't need to pass the block around
<morfin>
well, i had such situaltion
rgr has quit [Quit: rgr]
<morfin>
when wanted to pass block or symbol representing method name and call later
Larahero has joined #ruby
<morfin>
btw OpenSSL as i remember use several sources including /dev/urandom hmm
mfaeh has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
belmoussaoui has joined #ruby
belmoussaoui_ has quit [Ping timeout: 268 seconds]
<apeiros>
assuming @alerts responds to to_a or to_ary, yes
<apeiros>
in the worst case, @alerts.each.to_a
<duper>
@alerts is an array
<apeiros>
then… you could have just read the link above instead of asked ><
brent__ has quit [Ping timeout: 240 seconds]
yottanami_ has quit [Ping timeout: 255 seconds]
yottanami has joined #ruby
pupsicle has joined #ruby
apparition has joined #ruby
jackrandom has quit [Remote host closed the connection]
antgel has joined #ruby
belmoussaoui has joined #ruby
Burgestrand has joined #ruby
belmoussaoui_ has quit [Ping timeout: 255 seconds]
bkxd has joined #ruby
<dminuoso>
I regularly coerce arrays into arrays using [].each.to_a
<dminuoso>
just to be sure it's really an array.
<dminuoso>
MRI can be sneaky.
mim1k has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
jackrandom has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
anisha_ has quit [Quit: This computer has gone to sleep]
jamesaxl has quit [Read error: Connection reset by peer]
<apeiros>
dminuoso: don't laugh. I've had classes (not mine) with #each but no Enumerable, so .each.to_a was the way to go
<apeiros>
I think back then it was even enum_for(:each).to_a
jamesaxl has joined #ruby
BSab has quit [Read error: Connection reset by peer]
<apeiros>
actually - feel free to laugh. it's surreal enough, and I wasn't the perpetrator :D
devyn has quit [Ping timeout: 246 seconds]
nowhereman has joined #ruby
roshanavand has joined #ruby
rohitpaulk has joined #ruby
safetypin has joined #ruby
safetypin has quit [Client Quit]
<dminuoso>
apeiros: I think stupid.class.include.Enumerable; would have been easier.
andikr has quit [Remote host closed the connection]
<dminuoso>
stupid.class.include(Enumerable) I mean
quazimodo has joined #ruby
devyn has joined #ruby
mim1k has quit [Read error: Connection reset by peer]
dga has quit [Ping timeout: 260 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
dc2 has joined #ruby
cdg has joined #ruby
dc2 has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
nowhere_man has joined #ruby
nowhereman has quit [Read error: Connection reset by peer]
<apeiros>
dminuoso: I don't touch classes I don't own
<apeiros>
ok, not fully true, but still, I try to resist :D
devyn has quit [Ping timeout: 246 seconds]
<dminuoso>
apeiros: Sometimes I can't resist.
<dminuoso>
Why bother with all that immutable crap and responsible development.
yottanami has quit [Ping timeout: 246 seconds]
robouk has joined #ruby
mim1k has joined #ruby
jaruga________ has quit [Quit: jaruga________]
bkxd has quit [Ping timeout: 245 seconds]
devyn has joined #ruby
bkxd has joined #ruby
mfaeh has quit [Remote host closed the connection]
mfaeh has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
howdoi_ has quit [Quit: Connection closed for inactivity]
xall has joined #ruby
mfaeh has quit [Remote host closed the connection]
mfaeh_ has joined #ruby
Burgestrand has quit [Quit: Closing time!]
quazimodo has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 240 seconds]
ldnunes has quit [Ping timeout: 240 seconds]
Kug3lis has joined #ruby
mfaeh_ has quit [Remote host closed the connection]
shinnya has joined #ruby
mfaeh has joined #ruby
quazimodo has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
olivi____ has joined #ruby
ldnunes has joined #ruby
t-recx has quit [Quit: t-recx]
meshsmith has joined #ruby
olivi____ has quit [Ping timeout: 240 seconds]
GodFather has quit [Ping timeout: 260 seconds]
LastWhisper____ has joined #ruby
hutch34 has joined #ruby
mfaeh has quit [Remote host closed the connection]
mfaeh has joined #ruby
jolamb_ is now known as jolamb
mim1k has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chalkmonster has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oleo has joined #ruby
olivi____ has joined #ruby
GodFather has joined #ruby
olivi____ has quit [Remote host closed the connection]
oliv_____ has joined #ruby
Bish has quit [Ping timeout: 268 seconds]
dc2 has joined #ruby
Guest69 has joined #ruby
oliv_____ has quit [Remote host closed the connection]
ace05 has quit [Ping timeout: 260 seconds]
railswebdev has joined #ruby
olivi____ has joined #ruby
meshsmith has quit [Remote host closed the connection]
Bish has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
fedruantine has quit [Remote host closed the connection]
chouhoulis has joined #ruby
roshanavand has quit [Quit: roshanavand]
dc2 has quit [Ping timeout: 245 seconds]
chalkmonster has quit [Remote host closed the connection]
roshanavand has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
ur5us has joined #ruby
ace05 has joined #ruby
HoierM has joined #ruby
im0nde has joined #ruby
HoierM has quit [Max SendQ exceeded]
LastWhisper____ has joined #ruby
ur5us has quit [Ping timeout: 245 seconds]
__Yiota has joined #ruby
alibby has joined #ruby
jusa has joined #ruby
ace05 has quit [Ping timeout: 240 seconds]
<ule>
Hey guys.. how can I catch an exception happening inside a custom converter? I have something like this: CSV.parse(data, {headers: true, converters: MY_CUSTOM_CONVERTER}) do |row|
<ljarvis>
ule: wrap the whole block in a rescue
<ule>
ljarvis: I want to specify which row is throwing error
<ule>
so I would love to catch this exception inside the row loop
<ljarvis>
ule: you should probably use CSV.foreach(filename, options) instead. CSV.parse will just pull in all of your data and not parse it row-by-row like each_row does
<ljarvis>
foreach does*
<ule>
foreach.. ok.. let me read about it
ferr1 has quit [Ping timeout: 268 seconds]
_joes__ has joined #ruby
Dwarf-br has joined #ruby
MarkBilk has quit [Ping timeout: 255 seconds]
yottanami has joined #ruby
tomphp has joined #ruby
aupadhye has quit [Ping timeout: 240 seconds]
majuk has joined #ruby
Qchmqs has quit [Quit: Konversation terminated!]
sepp2k has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
ferr1 has joined #ruby
hutch34 has quit [Ping timeout: 272 seconds]
MarkBilk has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has joined #ruby
jusa has quit [Ping timeout: 268 seconds]
jusa has joined #ruby
jrafanie has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ule>
I'm planning to instantiate some models isnide a loop and hit .save outside only after another event
<ule>
so..
<ule>
loop { new_foo = foo.new(attributes) }
<ule>
then something like new_foo.save
mim1k has joined #ruby
yottanami_ has quit [Ping timeout: 255 seconds]
<ule>
but of course on all the created attributes
hobodave has quit [Quit: Computer has gone to sleep.]
<ule>
so I guess I need to pusth that to an array? new_foo[] ?
ledestin has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dviola has quit [Quit: WeeChat 1.8]
TomyLobo has joined #ruby
<chalkmonster>
ule, I'm assuming you're talking about activerecord?
<ule>
yeah
cdg_ has quit [Ping timeout: 260 seconds]
<ule>
sorry forgot I was on #ruby channel
<chalkmonster>
The straightforward way of doing this is to stick each record in an array, and then array.map { |record| record.save }
<chalkmonster>
That will create one INSERT query / record though
<ule>
chalkmonster: thank you
<chalkmonster>
not a great idea
dopecanoe has joined #ruby
<chalkmonster>
why are you creating them in a loop?
mim1k has quit [Ping timeout: 260 seconds]
polysics_ has quit [Remote host closed the connection]
<chalkmonster>
if you're doing something like Create Object -> Then do something else to it, you might at least want to wrap it in a single transaction
<Maxels>
I'm trying to execute the command: rake db:create db:migrate db:seed, and getting an error NoMethodError: undefined method `last_comment' for #<Rake::Application:0x00000000f3ce60>
<chalkmonster>
did you generate a lot of migrations at once?
ledestin has quit [Ping timeout: 260 seconds]
<apeiros>
?rails Maxels
<ruby[bot]>
Maxels: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<Maxels>
ah, sorry didn't know that was a rails thing. thanks
bernd27 has quit [Remote host closed the connection]
<chalkmonster>
^ the tragedy of Ruby in a nutshell
<ule>
chalkmonster: trying to fix some legacy code
<ule>
chalkmonster: :/ but that worked!! thank you very much!
<chalkmonster>
ule, you should look into Ruby Enumerators
jackrandom has joined #ruby
<chalkmonster>
records.map(&:save) will also work
<ule>
ohh thats even better
PaulCapestany has joined #ruby
<chalkmonster>
but if you can, try using the .create() method. That can create multiple records at oncep
<ule>
chalkmonster: I just need to confirm if my ruby 2.1 has this syntax available
<chalkmonster>
ule, it does.
<chalkmonster>
wait.. 2.1?
<chalkmonster>
k I'm sleeping bye
<ule>
chalkmonster: bye!
chalkmonster has quit [Quit: Daddy's flown, 'cross the ocean.]
<havenwood>
ule: It's a 1.9 thing, 2.1 is fine!
hobodave has joined #ruby
<ule>
havenwood: yep, thank you.. Just did the test here.. worked
ecuanaso has joined #ruby
_joes_ has joined #ruby
dviola has joined #ruby
ecuanaso has quit [Client Quit]
__Yiota has joined #ruby
ecuanaso has joined #ruby
mikecmpbll has joined #ruby
User458764 has joined #ruby
chouhoulis has joined #ruby
ujjain has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
pankaj has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roamingdog has joined #ruby
dc2 has joined #ruby
oleo has quit [Quit: irc client terminated!]
roamingdog has quit [Ping timeout: 258 seconds]
ur5us has joined #ruby
pankaj has quit [Quit: Leaving]
dc2 has quit [Ping timeout: 255 seconds]
pankaj has joined #ruby
ducklobster has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
ur5us has quit [Ping timeout: 268 seconds]
Dwarf-br has left #ruby ["Leaving"]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
spheric has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
roshanavand has quit [Quit: roshanavand]
oleo has joined #ruby
Bock has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
KeyJoo has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
ascarter has joined #ruby
dionysus69 has joined #ruby
meshsmith has quit [Ping timeout: 255 seconds]
Silthias has quit [Ping timeout: 246 seconds]
Silthias has joined #ruby
CacoS has quit [Ping timeout: 240 seconds]
jackrandom has quit [Remote host closed the connection]
CacoS has joined #ruby
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
haylon has joined #ruby
<SeepingN>
Any big gotchas going from 2.0 to 2.1 or latest?
<SeepingN>
I found that going from 1.8.6 to 2.0, lots of things like date/time and timeout and exceptions in general got better, which broke old code which had to look for ... "less correct" exceptions (compared to what is thrown in 2.0).
<havenwood>
SeepingN: 2.0 to 2.4 may require updated gems and give you some deprecation warnings but it's worth trying.
<havenwood>
SeepingN: 2.0 to 2.1 should be painless.
<havenwood>
SeepingN: I'd suggest trying 2.3.4 or 2.4.1.
<SeepingN>
some of this was really not a result of ruby but of the libraries jumping up for ssh and such
<SeepingN>
hm ok. yeah our needs are slow, so starting with 2.1 might be good if it's smoother
<lostapathy>
I would try 2.4.1 and if that seems too ugly, go to 2.3.4. I have upgraded some pretty nasty stuff to 2.3 without incident, but 2.4 has had issues with a couple gems I used
<havenwood>
SeepingN: You might try jumping straight to 2.3.4 and if it works, great!
<lostapathy>
2.1 is already EOL, might as well go at least 2.2
<SeepingN>
ah, yeah I don't think I'd go for that new anyway, given we aren't doing anything that "fancy" and don't have time to "fix everything" again
<havenwood>
2.2 doesn't get bugfixes anymore but at least it gets security fixes.
<SeepingN>
ah. so we're still behind, even with our much-updated centos 7 :\
<havenwood>
2.3.4 or 2.4.1 is best!
<lostapathy>
if you're on 2.0, 2.3.4 shouldn't be too bad
<havenwood>
^ +1
<SeepingN>
k thx. have to look into this soon!
muelleme has joined #ruby
patarr_ has joined #ruby
arthurl has joined #ruby
ResidentBiscuit has quit [Ping timeout: 255 seconds]
davidmichaelkarr has joined #ruby
patarr has quit [Ping timeout: 268 seconds]
<arthurl>
hi guys what does it mean if a jruby service bombs out with this error 'LoadError: no such file to load -- bundler/setup' but when i invoke the logic in the service definition file manually it works without issue?
dc2 has joined #ruby
morfin has quit []
dc2 has quit [Ping timeout: 260 seconds]
Cohedrin has joined #ruby
oncall-pokemon has joined #ruby
patarr_ has quit [Ping timeout: 240 seconds]
ResidentBiscuit has joined #ruby
maringouin has joined #ruby
cdg has joined #ruby
polysics has joined #ruby
rgr_ has quit [Ping timeout: 245 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
moei has joined #ruby
gnufied has quit [Ping timeout: 258 seconds]
hutch34 has quit [Ping timeout: 240 seconds]
jusa has quit [Ping timeout: 240 seconds]
truenito has quit [Ping timeout: 255 seconds]
gnufied has joined #ruby
sp4rrow has joined #ruby
ResidentBiscuit has quit [Ping timeout: 245 seconds]
ecuanaso has joined #ruby
ur5us has joined #ruby
patarr has joined #ruby
<havenwood>
arthurl: It likely means that the Bundler gem is not installed.
<havenwood>
arthurl: (There's also a #jruby channel but feel free to ask here as well.)
<havenwood>
arthurl: gem install bundler
<havenwood>
arthurl: Sanity check?: gem which bundler
<havenwood>
arthurl: which bundle
jgt1 has quit [Ping timeout: 245 seconds]
DLSteve has joined #ruby
milardovich has joined #ruby
ltem has quit [Quit: Leaving]
jrafanie has joined #ruby
<arthurl>
havenwood bundler is definitely installed- as i said the app runs fine when invoke it directly (as opposed to using the service to start it)
<arthurl>
to me it seems like some kind of scope issue
<havenwood>
arthurl: Is the service using the same Ruby? It seems the gem is not installed on the Ruby being used.
<havenwood>
arthurl: Maybe env is being dropped?
<lostapathy>
yes, that. Either different ruby, or setup with different envs so it's not getting the same gems
<arthurl>
if i run the code there manually it seems to work
<arthurl>
when i invoke via /etc/init.d/service start that's when i get that strange bundler/setup error
<havenwood>
arthurl: Is it in your PATH when running it manually and not via the service?
<havenwood>
Oh, I guess you're running it directly.
<havenwood>
But the GEM_PATH?
<havenwood>
`echo $GEM_PATH` in both?
<havenwood>
Or is --user-local flag for RubyGems only set in one?
<havenwood>
arthurl: Sanity check that the same Ruby and Gem env are being used in both.
<havenwood>
See: gem env
<havenwood>
Or at least: gem env gempath
<havenwood>
If it's looking in the same place for gems, it'll find em.
quazimodo has quit [Ping timeout: 260 seconds]
pjaspers has quit [Remote host closed the connection]
<arthurl>
havenwood i think you might be right about the GEM_PATH- i just added that echo line to the service definition and i see it was blank when i attempted to start the service
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
ResidentBiscuit has joined #ruby
ur5us has quit [Remote host closed the connection]
<arthurl>
havenwood even after i explicitly defiined the GEM_PATH in the service definition it still fails with the same error (i see the echo statement is indeed outputting the correct GEM_PATH right before the daemon line is called)
<havenwood>
arthurl: Is it the same Ruby?
<havenwood>
arthurl: Is this the same?: gem env gempath
jrafanie_ has joined #ruby
<havenwood>
arthurl: Or from inside Ruby: Gem.path
<arthurl>
havenwood the jruby_path is hardcoded in the service if you look so yes that should be ok
<arthurl>
let me look into gem env and gempath
<havenwood>
arthurl: It's to sanity check the Ruby and Gem match up to the right versions. I'd suggest printing out as much as you can.
<havenwood>
arthurl: That's probably a system Ruby 1.8.
milardovich has quit [Remote host closed the connection]
nofxxx has quit [Ping timeout: 246 seconds]
lele has joined #ruby
nofxxx has joined #ruby
Guest69 has joined #ruby
railswebdev has joined #ruby
bast has joined #ruby
bast has joined #ruby
bast has quit [Changing host]
gothicsouth has joined #ruby
polysics has quit [Remote host closed the connection]
milardovich has joined #ruby
polysics has joined #ruby
<arthurl>
gotcha
<arthurl>
now i just need to figure out how to set it properly in the context of that service
ascarter has joined #ruby
<havenwood>
arthurl: You might want to set PATH to include Ruby bin/ dir and RubyGems bin/ dir. And consider setting GEM_HOME, GEM_PATH, GEM_ROOT and RUBY_ROOT.
<arthurl>
havenwood it seems that my path already has that
<arthurl>
havenwood what's strange is that this is an ec2 instance, production, which also has a clone which we use for staging- and in staging it works
<havenwood>
arthurl: your service isn't the same environment
<havenwood>
arthurl: sudo drops env
<havenwood>
arthurl: RVM solves this with wrappers.
JoshS has quit [Ping timeout: 255 seconds]
<havenwood>
arthurl: or the `rvmsudo` command in place of `sudo`
<arthurl>
havenwood so i see the hardcoded jruby path we have in the service definition might actually NOT be the rvm one "JRUBY_PATH=/home/deploy/jruby-1.7.16/bin"
<havenwood>
The standard recommendation is to use a Ruby version switcher in dev but not in prod.
<havenwood>
Typically you only need one Ruby in prod.
<havenwood>
arthurl: Yeah, that's what made me think the JRuby was not RVM-related.
<havenwood>
arthurl: If you have RVM on a production server not using RVM, that is a recipe for headache.
<arthurl>
right, although i do also see 'jruby-1.7.15' listed when i run rvm list
<havenwood>
arthurl: rvm implode --force
<havenwood>
arthurl: Pick the way you'd like to deploy and remove the cruft.
<havenwood>
You have too many Rubies.
<arthurl>
well what's also interesting is that other server gem env gempath outputs what i want from inside the service
<arthurl>
and everything looks identical
dc2 has quit [Ping timeout: 272 seconds]
<havenwood>
Why do these have RVM installed?
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<havenwood>
If you're not using it, uninstall it.
<arthurl>
because we have other apps
<arthurl>
that use it
konsolebox has quit [Quit: Leaving]
<havenwood>
Ah, so you do need multiple Rubies on the same prod server?
hutch34 has joined #ruby
<arthurl>
yes, unfortunately
<havenwood>
If you're using RVM for some of them, you might want to use it for all of them.
<havenwood>
Or rethink the whole thing.
<havenwood>
It's best to not switch Ruby versions in prod. If you must switch Ruby versions in prod, use only one Ruby version switcher or do it manually.
<havenwood>
But don't do it manually and have one or more Ruby version switchers. It's too crazy.
<havenwood>
arthurl: Since such an old Ruby is involved, I'd suggest looking into RVM wrappers and install and configure JRuby with RVM.
<havenwood>
Or pay down some technical debt and update things or split them out so Rubies aren't so comingled in prod.
donald has left #ruby [#ruby]
<havenwood>
arthurl: Good luck!
<arthurl>
havenwood i appreciate the recommendation i think it was done this way for a reason- due to these old versions there was probably difficulty getting the jruby to play nice with rvm or something hence that standalone install
mjuszczak has joined #ruby
brent__ has quit [Remote host closed the connection]
<havenwood>
arthurl: JRuby should play just fine with RVM.
<zenspider_>
yeah. that sounds like a mess. Unify.
<havenwood>
arthurl: Wrappers work well with JRuby.
mjuszczak has quit [Client Quit]
zenspider_ is now known as zenspider
brent__ has joined #ruby
zenspider has quit [Changing host]
zenspider has joined #ruby
<havenwood>
It might be they just didn't know how to do it with RVM. There seems to be much confusion in that regard.
<havenwood>
Simple is good.
<havenwood>
As simple as can possibly work is a nice level of simplicity.
<zenspider>
agreed. simple is good. that's why I don't use RVM. :P
<havenwood>
Tens of thousands of lines of shell tends to not be simple.
<havenwood>
A hundred lines of shell is scary enough. ;-)
<zenspider>
I got tired of filing patches to fix usage of unset variables only to have them regress over and over
<zenspider>
but yeah. over time it's tried to be everything
bruce_lee has quit [Write error: Broken pipe]
eregon has quit [Write error: Broken pipe]
oleo has quit [Excess Flood]
hlmjr has quit [Write error: Broken pipe]
<zenspider>
(except emacs)
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
<apeiros>
maybe we should use emacs instead of rvm
eregon has joined #ruby
<havenwood>
chruby support even ships wtih RVM, called MRVM
hlmjr has joined #ruby
<havenwood>
It's the version changer that ate another version changer.
<zenspider>
wait... what? I thought chruby was even smaller than rbenv ?
ascarter has joined #ruby
<havenwood>
zenspider: It is, way smaller. I said that badly.
<havenwood>
zenspider: RVM has chruby support, not the other way around.
<zenspider>
(chruby ALSO has unset variable usage... gets old)
<sonOfRa>
slowslice has the same result, but is, well, slow
adrianvalenz has joined #ruby
<baweaver>
Hacker's Delight probably has some recipe for this
Rodya_ has quit [Ping timeout: 245 seconds]
<sonOfRa>
Yup, I found it there (though for 8 and 16 bit matrices)
mim1k has quit [Ping timeout: 240 seconds]
<dminuoso>
sonOfRa, you should be shot.
<dminuoso>
sonOfRa, static inline is silly.
<sonOfRa>
dminuoso: it was for a silly competition that used rtdsc to count cycles
<dminuoso>
sonOfRa, so?
<sonOfRa>
This shaved off *very few* but barely noticeable cycles
<dminuoso>
sonOfRa, no it did no.
* baweaver
does not know C
<dminuoso>
sonOfRa, inline is a stupid modifier that has to do with definition rules
* baweaver
backs away slowly
polysics has quit [Ping timeout: 260 seconds]
<dminuoso>
Though in C the rules are kind of silly and complicated. It's a bit simpler in C++
<sonOfRa>
dminuoso: I dunno, I looked at the assembly I got for the forced inlining and the non-forced-inlining, and it didn't inline the function, allocating a new stack frame. MIght have been bad measurement, but it was measurable in the context of the contest
<dminuoso>
sonOfRa, Im not talking about __attribute((always_inline))
<sonOfRa>
But what's wrong with giving an inline function static linkage?
adrianvalenz has quit [Quit: leaving]
BSaboia has joined #ruby
<dminuoso>
sonOfRa, the rationale behind inline is to provide the definition to the call site to enable optimizations (note that this is not about function call inlining)
<dminuoso>
sonOfRa, by also making it static, you essentially imply that the definition is scoped to the TU, which prevents linkers from being smart.
quazimodo has joined #ruby
<sonOfRa>
Oh, I guess that makes sense if you have more than a single TU
<dminuoso>
and if not, you dont need either.
<dminuoso>
sonOfRa, essentially inline is the trick that allows you to put definitions into headers without running into multiple definition errors
<sonOfRa>
I'd say being shot is a harsh punishment for placing a useless classifier ;)