jhass changed the topic of #ruby to: Welcome new users migrating from #ruby-lang! || Rules & more: http://ruby-community.com || Ruby 2.2.2; 2.1.6; 2.0.0-p645: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || log @ http://irclog.whitequark.org/ruby/
christiandsg has quit [Ping timeout: 265 seconds]
blackmesa has quit [Ping timeout: 264 seconds]
DLSteve has quit [Quit: Leaving]
leonardoajim has quit [Read error: Connection reset by peer]
dgutierrez1287 has joined #ruby
Channel6 has quit [Remote host closed the connection]
leonardoajim has joined #ruby
OrbitalKitten has joined #ruby
n1x has joined #ruby
blackmesa has joined #ruby
OrbitalKitten has quit [Client Quit]
leonardoajim has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: zzz]
mengu has quit [Ping timeout: 250 seconds]
leonardoajim has joined #ruby
charliesome has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kobain has joined #ruby
AlphaAtom has joined #ruby
Igorshp has joined #ruby
Rixius has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AlphaAtom has quit [Max SendQ exceeded]
Igorshp has quit [Remote host closed the connection]
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Aswebb_ has joined #ruby
AlphaAtom has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
charliesome has quit [Ping timeout: 244 seconds]
CloCkWeRX has joined #ruby
bricker has joined #ruby
phutchins2 has quit [Ping timeout: 256 seconds]
AlphaAtom has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
IanV0rn2341 has joined #ruby
Aswebb_ has quit [Ping timeout: 264 seconds]
mistermocha has joined #ruby
AlphaAtom has quit [Read error: Connection reset by peer]
hotpancakes has joined #ruby
havenwood has quit [Ping timeout: 246 seconds]
Musashi007 has joined #ruby
dudo has joined #ruby
baweaver has joined #ruby
sharpmachine has joined #ruby
millerti has joined #ruby
IanV0rn2341 has quit []
16WABGS0F has joined #ruby
<16WABGS0F> I have this problem with name spacing
16WABGS0F is now known as quazimodo
hotpancakes has quit [Ping timeout: 264 seconds]
Musashi007 has quit [Client Quit]
dgutierrez1287 has quit [Remote host closed the connection]
MichaelGG_ has joined #ruby
<quazimodo> I didn't know the calling environment would mess up my usage of name spaces inside
silkfox has joined #ruby
fgo has joined #ruby
AlphaAtom has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
yosafbridge has quit [Ping timeout: 248 seconds]
AlphaAtom has joined #ruby
MichaelGG has quit [Ping timeout: 276 seconds]
arturmartins has joined #ruby
AlphaAtom has quit [Client Quit]
Blaguvest has quit [Ping timeout: 244 seconds]
bruno- has joined #ruby
mistermocha has quit [Ping timeout: 264 seconds]
fgo has quit [Ping timeout: 240 seconds]
AlphaAtom has joined #ruby
hotpancakes has joined #ruby
yfeldblum has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 255 seconds]
dgutierrez1287 has joined #ruby
yfeldblum has joined #ruby
zacstewart has quit [Remote host closed the connection]
sharpmachine has quit [Remote host closed the connection]
hfp has quit [Ping timeout: 256 seconds]
hfp_work has quit [Ping timeout: 264 seconds]
dgutierrez1287 has quit [Remote host closed the connection]
yizr has quit [Ping timeout: 255 seconds]
simplyianm has joined #ruby
dgutierrez1287 has joined #ruby
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
mleung has quit [Quit: mleung]
hotpancakes has quit [Ping timeout: 264 seconds]
dgutierrez1287 has quit [Remote host closed the connection]
dgutierrez1287 has joined #ruby
nathanstitt has joined #ruby
baweaver has quit [Remote host closed the connection]
yizr has joined #ruby
hfp_work has joined #ruby
rushed has joined #ruby
tmtwd_ has joined #ruby
hfp has joined #ruby
oo_ has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
mclee has quit [Ping timeout: 264 seconds]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
shazaum_ has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
<toretore> quazimodo: did you try restarting the server?
<quazimodo> toretore: no, should that help?
<quazimodo> why would that help??
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<quazimodo> oh ok apparently we did
lolmaus has quit [Ping timeout: 256 seconds]
keen__________16 has joined #ruby
Pumukel has quit [Remote host closed the connection]
simplyianm has quit [Read error: Connection reset by peer]
<shevy> lol
bahar has joined #ruby
<shevy> conversations on #ruby are sometimes funny to read
Rollabunna has quit [Remote host closed the connection]
sevenseacat has joined #ruby
simplyianm has joined #ruby
arescorpio has joined #ruby
keen__________15 has quit [Ping timeout: 276 seconds]
v0n has quit [Ping timeout: 264 seconds]
<quazimodo> shevy: you're smart
<quazimodo> namespace weird!?
<shevy> ack
<shevy> would this work?
<quazimodo> there's no logic to figure out in that exapmle, only the namespace issue
surs has joined #ruby
<shevy> module Couriers::Base::Api.get_quote(params)
surs4 has quit [Ping timeout: 244 seconds]
Rollabunna has joined #ruby
<shevy> I forgot a def
<shevy> hmmm I guess the namespace has to exist
<shevy> >> def Foo.bar; puts 'hi'; end; Foo.bar
<ruboto> shevy # => uninitialized constant Foo (NameError) ...check link for more (https://eval.in/395919)
<shevy> >> module Foo; end; def Foo.bar; puts 'hi'; end; Foo.bar
<ruboto> shevy # => hi ...check link for more (https://eval.in/395920)
<shevy> yeah
Limix has quit [Quit: Limix]
yizr has quit [Ping timeout: 246 seconds]
<shevy> do you have more than one constant called Api?
dgutierrez1287 has joined #ruby
<quazimodo> Yeah
<quazimodo> I have
<quazimodo> Couriers::Base::Api <- used to do an api call to the courier that it's specialised for
<quazimodo> and
tno has quit [Remote host closed the connection]
<quazimodo> Api::V2::WhateverController <- Rocketpants controllers
<shevy> I have had weird results with same-named things
mjuszczak has quit []
<shevy> class Colour # topnamespace; and also: module Foo; module Colour, then I have to use either Colour or ::Colour
<shevy> or I also did this: module Foo; class Foo
Jamal has joined #ruby
Pupeno has joined #ruby
dfockler has joined #ruby
<shevy> quazimodo is the wrong Api class invoked?
Aderium has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Aderium has joined #ruby
<quazimodo> shevy: yep
<quazimodo> the ::Api module is called (the one used for rocket pants)
<quazimodo> but that's very weird for me
Pupeno_ has quit [Ping timeout: 250 seconds]
<quazimodo> Module.nesting shows that I'm looking for Api in all the right places
jordanm has quit [Remote host closed the connection]
<shevy> yeah confusion through same names :)
wldcordeiro has joined #ruby
snockerton has quit [Quit: Leaving.]
JMoir has quit [Ping timeout: 265 seconds]
mclee has joined #ruby
duderonomy has joined #ruby
<shevy> I just realized something else...
<shevy> def Foo.bla
duderonomy has quit [Client Quit]
<shevy> ruby would not know whether Foo is a class or a module
<shevy> unless it was defined prior to doing that
<shevy> but now that I used it... I'd love to be able to do that!
dfockler has quit [Ping timeout: 256 seconds]
tvw has quit [Ping timeout: 256 seconds]
wldcordeiro has quit [Client Quit]
<shevy> if only we could have a third type
<shevy> a Morph
blackmesa has quit [Ping timeout: 265 seconds]
<shevy> in the above, Foo would be a morph... it could be a class... or it could be a module... but at that time, it would not matter!
Aderium has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Aderium has joined #ruby
<Ox0dea> >> Class.new.is_a?(Module)
<ruboto> Ox0dea # => true (https://eval.in/395921)
tvw has joined #ruby
n1x has quit [Ping timeout: 256 seconds]
<ankur> senjai: can you suggest me some open source project, ?
jtdoncas has quit [Ping timeout: 244 seconds]
segfalt has quit [Quit: segfalt]
<shevy> >> Class.new.is_a?(Class)
<ruboto> shevy # => true (https://eval.in/395922)
<shevy> Ox0dea it's both! a schroedinger cat
<quazimodo> anyway
<quazimodo> backto the weird namespacing
<quazimodo> what?
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> cats are dogs
<shevy> classes are modules
<quazimodo> wheres workmad
<shevy> shaving his beard
<shevy> should be 02:00 in the UK right now, if he has to go to work, he has to sleep!
<quazimodo> oh
arturmartins has quit [Quit: Leaving...]
<quazimodo> Facking constant lookup
<shevy> simplify!
rushed has quit [Quit: rushed]
tkuchiki has joined #ruby
oo_ has quit [Remote host closed the connection]
Spami has quit [Quit: This computer has gone to sleep]
<quazimodo> shevy: i don't get it though
<quazimodo> it shouldn't be deing that retarded stuff
<shevy> yeah, I have had funny error messages due to that
Aderium has quit [Quit: Textual IRC Client: www.textualapp.com]
<quazimodo> YA
<quazimodo> but we needt o feex
mclee has quit [Ping timeout: 246 seconds]
leonardoajim has quit [Quit: Be back later ...]
dseitz has joined #ruby
ankur has quit [Ping timeout: 246 seconds]
c355E3B has quit [Quit: Connection closed for inactivity]
oo_ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
mclee has joined #ruby
tvw has quit [Ping timeout: 256 seconds]
shazaum_ has quit [Quit: Leaving]
lolmaus has joined #ruby
<toretore> quazimodo: gist all the relevant files, in their entirety
duderonomy has joined #ruby
duderonomy has quit [Read error: Connection reset by peer]
lkba_ has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
charliesome has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
Lucky___ has joined #ruby
goodcodeguy has joined #ruby
leonardoajim has joined #ruby
benlieb has quit [Quit: benlieb]
mmasaki_ has joined #ruby
n1x has joined #ruby
stantonnet has joined #ruby
leonardoajim has quit [Read error: Connection reset by peer]
leonardoajim has joined #ruby
<quazimodo> ok
<quazimodo> let me get a coffee, i'll bbl
ivanskie has joined #ruby
paulcsmith has joined #ruby
eggoez has quit [Ping timeout: 248 seconds]
paulcsmith has quit [Client Quit]
kev12123 has joined #ruby
<kev12123> i can't get action mailer to actually send emails :/
frem has quit [Quit: Connection closed for inactivity]
<kev12123> I've tried using every solution i've found online, yet nothing works
<Ox0dea> kev12123: You've provided ample information for us to meaningfully assist you. Just a second.
FernandoBasso has quit [Ping timeout: 244 seconds]
Channel6 has joined #ruby
pr0ton has quit [Ping timeout: 256 seconds]
christiandsg has joined #ruby
mistermocha has joined #ruby
eggoez has joined #ruby
fabrice31 has joined #ruby
reset has quit [Quit: Leaving...]
blue_deref has quit [Ping timeout: 250 seconds]
jesterfraud has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Limix has joined #ruby
christiandsg has quit [Ping timeout: 265 seconds]
eggoez has quit [Ping timeout: 240 seconds]
dgutierrez1287 has joined #ruby
fabrice31 has quit [Ping timeout: 256 seconds]
pr0ton has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
tubuliferous_ has quit [Ping timeout: 240 seconds]
mistermocha has joined #ruby
RobertBirnie has quit [Ping timeout: 246 seconds]
sharpmachine has joined #ruby
dgutierrez1287 has quit [Ping timeout: 246 seconds]
segy has quit [Quit: ZNC - http://znc.in]
jhack has quit [Ping timeout: 244 seconds]
segy has joined #ruby
n1x has quit [Ping timeout: 264 seconds]
charliesome has quit [Quit: zzz]
pr0ton has quit [Ping timeout: 256 seconds]
dudo has quit [Remote host closed the connection]
n1x has joined #ruby
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Metus has quit [Read error: Connection reset by peer]
sharpmachine has quit [Ping timeout: 250 seconds]
tmtwd_ has quit [Ping timeout: 264 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Limix has quit [Quit: Limix]
jgpawletko has quit [Quit: jgpawletko]
Agoldfish has quit [Quit: G'Bye]
howdoicomputer has quit [Quit: WeeChat 1.2]
towski_ has quit [Ping timeout: 256 seconds]
eggoez has joined #ruby
towski_ has joined #ruby
rushed has joined #ruby
simplyianm has quit [Remote host closed the connection]
NeverDie_ has joined #ruby
NeverDie has quit [Read error: Connection reset by peer]
maletor_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yossarian has joined #ruby
yihsiaol has quit [Quit: leaving]
bffff_ has joined #ruby
radens is now known as muricula
muricula is now known as radens
it_tard has quit [Quit: yawn]
Ropeney has joined #ruby
woodruffw has quit [Ping timeout: 246 seconds]
fgo has joined #ruby
serivich has quit [Quit: Leaving]
but3k4 has joined #ruby
atan has quit []
Aswebb_ has joined #ruby
dc_ has joined #ruby
dc_ has quit [Client Quit]
hotpancakes has joined #ruby
hotpancakes has quit [Remote host closed the connection]
rbowlby has quit [Remote host closed the connection]
kev12123 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
mistermocha has quit [Ping timeout: 250 seconds]
ybian has quit [Remote host closed the connection]
haltEnigma has joined #ruby
oo_ has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
Aswebb_ has quit [Ping timeout: 264 seconds]
ybian has joined #ruby
oo_ has joined #ruby
jesterfraud has joined #ruby
laurentide has joined #ruby
mando has quit [Ping timeout: 248 seconds]
leonardoajim has quit [Quit: Be back later ...]
jeramyRR has joined #ruby
tubuliferous_ has quit [Ping timeout: 264 seconds]
mmasaki_ has quit [Quit: bye]
ivanskie has joined #ruby
sepp2k has quit [Quit: Leaving.]
cabreraM516 has joined #ruby
n1x has quit [Ping timeout: 252 seconds]
<haltEnigma> Hey , I'm new to Ruby and I've built a simple action mailer , i successfully create the user and the server indicates the email has been sent , however the email goes through.Here is my code
towski_ has quit [Remote host closed the connection]
CloCkWeRX has quit [Quit: Leaving.]
CloCkWeRX has joined #ruby
n1x has joined #ruby
simplyianm has joined #ruby
mmasaki has joined #ruby
davedev2_ has quit [Ping timeout: 256 seconds]
cabreraM516 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
surs1 has joined #ruby
Sehryn has joined #ruby
davedev24_ has joined #ruby
enders has joined #ruby
hotpancakes has joined #ruby
simplyianm has quit [Ping timeout: 256 seconds]
surs has quit [Ping timeout: 256 seconds]
mmasaki has quit [Quit: bye]
devbug has joined #ruby
mmasaki has joined #ruby
symm- has quit [Ping timeout: 244 seconds]
n1x has quit [Ping timeout: 252 seconds]
charliesome has joined #ruby
haltEnigma has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
haltEnigma has joined #ruby
jesterfraud has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yfeldblum has quit [Ping timeout: 265 seconds]
n1x has joined #ruby
white_magic has joined #ruby
hotpancakes has quit [Ping timeout: 256 seconds]
<white_magic> hi, I was wondering if someone could explain a few syntactical aspect of Ruby for me..
<mozzarella> !ask
<mozzarella> .ask
<white_magic> For example, what does the colon before a keyword mean? It's not always a hashmap, right? For example, in this page: http://guides.rubyonrails.org/association_basics.html
<white_magic> "has_many :orders, dependent: :destroy"
prettiestPony11 has joined #ruby
<mozzarella> it's a symbol
<white_magic> seems like ":destroy" is kind of like a function pointer
<zanloy> white_magic, That is a symbol. It is like an immutable string but different.
<mozzarella> >> :test.class
<ruboto> mozzarella # => Symbol (https://eval.in/395928)
luriv_ has joined #ruby
simplyianm has joined #ruby
<zanloy> >> :test.to_s
<ruboto> zanloy # => "test" (https://eval.in/395929)
<zanloy> >> "test".to_sym
<ruboto> zanloy # => :test (https://eval.in/395930)
davedev24_ has quit [Ping timeout: 244 seconds]
christiandsg has joined #ruby
<white_magic> gotcha.. thanks
surs2 has joined #ruby
hotpancakes has joined #ruby
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
luriv has quit [Ping timeout: 264 seconds]
surs1 has quit [Ping timeout: 265 seconds]
davedev24_ has joined #ruby
christiandsg has quit [Ping timeout: 265 seconds]
davedev2_ has joined #ruby
jesterfraud has joined #ruby
evanjs_ has joined #ruby
fgo has quit [Ping timeout: 255 seconds]
simplyianm has quit []
<quazimodo> What in the fuck
n1x has quit [Ping timeout: 244 seconds]
evanjs has quit [Ping timeout: 244 seconds]
<quazimodo> Api => Api; Base::Api => Couriers::Base::Api; Api => Couriers::Base::Api
davedev24_ has quit [Ping timeout: 248 seconds]
<quazimodo> Rails autoloading
<quazimodo> Motherfucker
sharpmachine has joined #ruby
Sehryn has quit [Quit: Leaving]
n1x has joined #ruby
<sevenseacat> swear at all of the things!!
christiandsg has joined #ruby
<quazimodo> hey kitty
baweaver has joined #ruby
n1x has quit [Excess Flood]
sharpmachine has quit [Ping timeout: 246 seconds]
oo_ has quit [Remote host closed the connection]
mclee has quit [Ping timeout: 246 seconds]
oo_ has joined #ruby
<sevenseacat> quazimodo: my name still isnt kitty.
cabreraM516 has joined #ruby
hotpancakes has quit [Remote host closed the connection]
<Ox0dea> #ruby needs a CoC.
surs3 has joined #ruby
jesterfraud has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bronson has quit [Remote host closed the connection]
* Nilium gots an octocat figurine
<Nilium> It is nice.
surs2 has quit [Ping timeout: 246 seconds]
RegulationD has joined #ruby
davedev2_ has quit [Ping timeout: 248 seconds]
Musashi007 has joined #ruby
psy_ has quit [Remote host closed the connection]
jesterfraud has joined #ruby
yizr has joined #ruby
<Ox0dea> Why does the code of conduct explicitly mention gender if it immediately goes on to include "gender identity and expression"? That's either redundant or exclusive.
psy_ has joined #ruby
jimmythehat has joined #ruby
<jimmythehat> is there a way to programmatically do it ' array]
<jimmythehat> sorry
<Ox0dea> jimmythehat: Try again?
davedev24_ has joined #ruby
<jimmythehat> array[3][6][6][2] = 42
RegulationD has quit [Ping timeout: 265 seconds]
mclee has joined #ruby
leonardoajim has joined #ruby
<Ox0dea> jimmythehat: You want to be able to write that?
mary5030 has joined #ruby
<jimmythehat> Ox0dea programmatically do that. So [3][6][6][2] can change to [2][4] or [1][2][3] or whatever. The most efficient way of updating a multidimensional array's entry. Just one of its entries.
davedev24_ has quit [Read error: Connection reset by peer]
chinmay_dd_ has joined #ruby
davedev24_ has joined #ruby
havenwood has joined #ruby
oo_ has quit [Remote host closed the connection]
hahuang65 has joined #ruby
oo_ has joined #ruby
<Ox0dea> You can programmatically *access* an arbitrarily deep element using something like [3, 6, 6, 2].reduce(array, :[]).
kb3ien has joined #ruby
Xoro has joined #ruby
eggoez has quit [Ping timeout: 240 seconds]
chinmay_dd__ has joined #ruby
<Ox0dea> But if you want to be able to cleanly update, you might consider using an autovivifying Hash:
<Ox0dea> >> array = Hash.new { |h, k| h[k] = Hash.new &h.default_proc }; array[3][6][6][2] = 42; array
chinmay_dd has quit [Ping timeout: 265 seconds]
<ruboto> Ox0dea # => {3=>{6=>{6=>{2=>42}}}} (https://eval.in/395931)
mistermocha has joined #ruby
<kb3ien> My `rails generate` hangs forever, the open file handle that it's reading is AF_LOCAL "/tmp/spring/f7d7415c8e2a052c43f10695522d4a16" What's this about ?
<havenwood> ?rails kb3ien
<ruboto> kb3ien, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<jimmythehat> kb3lien actually forever? if you're in a jam just remove the sprinng gem and run bundle install, but if you want to keep spring im not sure :)
GriffinHeart has joined #ruby
Limix has joined #ruby
chinmay_dd_ has quit [Ping timeout: 240 seconds]
haltEnigma has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<jimmythehat> Ox0dea so is that more efficient than running array[x][y]..[n] ?
<Ox0dea> jimmythehat: No, not at all. :)
<jimmythehat> haha :P
<Ox0dea> You'll want to stick with your multi-dimensional array, but the Hash#default_proc trick is fun to show off.
<Ox0dea> indices = [3, 6, 6, 2]; last = indices.pop; indices.reduce(array, :[])[last] = 42
<Ox0dea> That seems like a reasonably clean approach.
unshadow_ has joined #ruby
<jimmythehat> ah yeah
<jimmythehat> that's cool
ruby-lang503 has joined #ruby
<jimmythehat> so what does reduce actually do?
MasterPiece has joined #ruby
braincrash has quit [Quit: bye bye]
hotpancakes has joined #ruby
<jimmythehat> and why the symbol of an empty array?
kb3ien has left #ruby [#ruby]
eggoez has joined #ruby
<Ox0dea> It helps to think of #reduce as sticking the operator between all the elements and calling it one at a time in order to build up a "total".
cabreraM516 has quit [Quit: Textual IRC Client: www.textualapp.com]
<Ox0dea> :[] is just the operator in this case; it represents the Array#[] method.
zacstewart has joined #ruby
unshadow has quit [Ping timeout: 248 seconds]
<Ox0dea> "Fold" is arguably a more illustrative name.
theery has joined #ruby
but3k4 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
prettiestPony11 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea> [1, 2, 3, 4].reduce(:+) becomes, essentially, 1 + 2 + 3 + 4.
ny837 has joined #ruby
oo_ has quit [Remote host closed the connection]
hotpancakes has quit [Ping timeout: 244 seconds]
hahuang65 has quit [Quit: WeeChat 1.2]
chouhoulis has joined #ruby
silkfox has quit [Ping timeout: 256 seconds]
oo_ has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
braincrash has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
mistermocha has joined #ruby
christiandsg has quit [Remote host closed the connection]
hahuang65 has quit [Client Quit]
jeramyRR has quit [Quit: Peace out!]
davedev24_ has quit []
hahuang65 has joined #ruby
bungoman has joined #ruby
<jimmythehat> Ox0dea oohh cool (just watching a video on it) that's useful. werid but useful :P
oo_ has quit [Remote host closed the connection]
<jimmythehat> thanks a loot
<Ox0dea> Sure thing.
<baweaver> That was a fun one that shows some reduce in action
<baweaver> well, map and reduce
<baweaver> read the top post for context
<baweaver> baweaver == lemur
sharpmachine has joined #ruby
prettiestPony11 has joined #ruby
zacstewart has quit [Remote host closed the connection]
zacstewart has joined #ruby
scottschecter has joined #ruby
Pupeno_ has joined #ruby
<baweaver> Ox0dea: You might like the problem on that one.
Pupeno has quit [Ping timeout: 246 seconds]
tchebb has quit [Quit: ZNC - http://znc.in]
wookiehangover has quit [Ping timeout: 248 seconds]
tmtwd has joined #ruby
oo_ has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
hahuang61 has joined #ruby
Xiti has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
oo_ has quit [Remote host closed the connection]
Tuccuay has joined #ruby
wookiehangover has joined #ruby
Tuccuay has quit [Max SendQ exceeded]
alem0lars has quit [Quit: Quit]
heyimwill has quit [Quit: bye]
krasnus has quit [Quit: ZNC - http://znc.in]
mistermocha has quit [Ping timeout: 248 seconds]
fabrice31 has joined #ruby
Ox0dea has quit [Read error: No route to host]
hahuang61 has quit [Ping timeout: 244 seconds]
darkf has joined #ruby
Ox0dea has joined #ruby
christiandsg has joined #ruby
krasnus has joined #ruby
<Ox0dea> baweaver: I'm just thinking of all the little utility functions I'd have to write to do this even remotely cleanly without alphanumerics. :P
urbanmonk has joined #ruby
casadei_ has quit [Remote host closed the connection]
nathanstitt has quit [Quit: I growing sleepy]
alem0lars has joined #ruby
<Ox0dea> Bless you, Alonzo Church, but the lambda calculus : programming :: cave scribblings : human language.
mistermocha has joined #ruby
kobain has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
bronson has joined #ruby
fabrice31 has quit [Ping timeout: 264 seconds]
danielpclark has quit [Ping timeout: 264 seconds]
notthekgb has joined #ruby
axisys has quit [Remote host closed the connection]
gix has quit [Ping timeout: 250 seconds]
darkf_ has joined #ruby
exadeci has quit [Quit: Connection closed for inactivity]
goodcodeguy has quit [Quit: Textual IRC Client: www.textualapp.com]
<notthekgb> Ruby noob: how do I set a value to an array index? This is so I can cycle through the array sequentially each time the function is called, doing x++ and then arr.length = x and x = 0 to reset once all values have been called
WhiteAssCrackers has joined #ruby
<WhiteAssCrackers> hi
<Ox0dea> notthekgb: I think you want Array#each.
<baweaver> !ops
<ruboto> apeiros, fflush, banisterfiend, seanstickle, Mon_Ouie, zzak, Radar, Havenn, jhass, sevenseacat, miah, workmad3, Coraline, drbrain, zenspider, rubyhacker1, slyphon, Aria, ljarvis
<baweaver> bye
<sevenseacat> !ban WhiteAssCrackers !T 1d
WhiteAssCrackers was banned on #ruby by ChanServ [WhiteAssCrackers!*@*]
WhiteAssCrackers was kicked from #ruby by ChanServ [User is banned from this channel]
<notthekgb> I've tried using array.each but that just returns all the values sequentially
<sevenseacat> ty baweaver
<baweaver> >> [1,2,3].each_with_index.to_a
<ruboto> baweaver # => [[1, 0], [2, 1], [3, 2]] (https://eval.in/395933)
<baweaver> np
darkf has quit [Ping timeout: 248 seconds]
darkf_ is now known as darkf
<Ox0dea> baweaver: Isn't it heretical to use methods like #concat in functional Ruby?
<Ox0dea> I realize your usage in this case is referentially transparent, mind.
<baweaver> nope
<baweaver> >> a = [1]; a.concat([2]); a
<ruboto> baweaver # => [1, 2] (https://eval.in/395934)
<baweaver> hm
<baweaver> nevermind
<baweaver> cripes
<Ox0dea> It's still fine, though.
<notthekgb> Is there some way of setting x to the array index value defaulting to 0?
<Ox0dea> You never expose the internal "non-functional" object.
<baweaver> yeah, but still....
<baweaver> I thought concat was pure for some reason
<Ox0dea> You thought it was #push?
hotpancakes has joined #ruby
<Ox0dea> Wait, what am I talking about?
<baweaver> I suppose you can use +
<Ox0dea> So much garbage to collect. :/
poguez_ has quit [Quit: Connection closed for inactivity]
gix has joined #ruby
hakunin has quit [Remote host closed the connection]
krasnus has quit [Remote host closed the connection]
alem0lars has quit [Remote host closed the connection]
mistermocha has quit [Read error: Connection reset by peer]
yosafbridge has joined #ruby
krasnus has joined #ruby
mistermocha has joined #ruby
alem0lars has joined #ruby
luriv_ has quit [Ping timeout: 256 seconds]
a346 has joined #ruby
mistermocha has quit [Remote host closed the connection]
yfeldblum has joined #ruby
Xoro has quit [Read error: Connection reset by peer]
olistik has joined #ruby
Xoro has joined #ruby
<Ox0dea> notthekgb: Would you mind posting example code? It's quite likely there's a better way to do $thing than maintaining an index across calls.
danielpclark has joined #ruby
Aswebb_ has joined #ruby
<notthekgb> I would but it uses an API so the language isn't proper Ruby
<notthekgb> I literally started yesterday :P
<Ox0dea> All right, then. You're probably looking for something like: @index ||= 0; code...; @index += 1
<Ox0dea> But that's really not great.
riskish has joined #ruby
tjohnson has quit [Quit: Connection closed for inactivity]
olistik has quit [Ping timeout: 250 seconds]
tubuliferous_ has joined #ruby
Aswebb_ has quit [Ping timeout: 248 seconds]
iateadonut has joined #ruby
<Ox0dea> baweaver: So, why the objection to an internal #concat, exactly?
xcesariox has joined #ruby
<Ox0dea> Nobody can see the impurity.
sharpmachine has quit [Remote host closed the connection]
<baweaver> I can O_O
sacarlson has joined #ruby
<baweaver> Just that I thought it was a pure version for some off reason
<baweaver> anyways, it doesn't really matter
<baweaver> I just need to remember that one.
<baweaver> either that or flip the order
<sacarlson> I'm looking at this https://github.com/cowboyd/commonjs.rb is this the best method to run node.js inside of ruby? if so I need examples that include require in them
<baweaver> what fresh hell inspired people to go and do that?
<Ox0dea> sacarlson: Try this one: https://github.com/vanruby/javascript
<baweaver> ....nevermind
<baweaver> probably something I don't want answered.
<sacarlson> Ox0dea: ok I'll take a look
<Ox0dea> sacarlson: Note well that it's satirical, and for very good reason.
tubuliferous_ has quit [Ping timeout: 246 seconds]
LucasRim has joined #ruby
Musashi007 has quit [Quit: Musashi007]
LucasRim has left #ruby [#ruby]
casadei_ has joined #ruby
white_magic has quit [Quit: Page closed]
ny837 has quit []
havenwood has joined #ruby
luriv_ has joined #ruby
hotpancakes has quit [Remote host closed the connection]
<sacarlson> Ox0dea: so with this javascript above I can run npm pakages in it also with require?
<sacarlson> I didn't see any example in it that included require
<baweaver> What are you trying to do anyways?
<sacarlson> I'm trying to use the libs of Stellar making a bridge in the protocol to ruby
<sacarlson> stellar libs are writen in node.js
<baweaver> explain that to me like I'm 5
<sacarlson> ha ha
penzur has joined #ruby
lucasr has joined #ruby
<sacarlson> I just need to run javascripts that can also have require in them I guess with an engine that supports all features of node.js
<baweaver> like just using nodejs
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood> sacarlson: Any relation to Ruby?
<baweaver> why do you _need_ to use ruby?
<sacarlson> because my apps are writen in ruby that need access to the stellar payment system
<lucasr> hey can i ask someone on notation for a method? I’m kinda lost…
<sacarlson> my app is a poker accounting system that uses stellar as a payment system for p2p poker play
<baweaver> you can lucasr, it's best to just ask
<baweaver> considering it's not findable on the internet at all
<baweaver> Stellar comes up as a parallax scrolling plugin on google
msnyon has quit [Quit: Textual IRC Client: www.textualapp.com]
tkuchiki has quit [Remote host closed the connection]
<baweaver> lordy they like buzzwords
<lucasr> I’m having trouble understanding the scan method… so I’m looking at this: .scan(/.{1,3}/)
bffff_ has quit [Quit: Connection closed for inactivity]
<baweaver> look into regex
<sacarlson> the new version of stellar doesn't support my old stellar interface api
<baweaver> . is any character
<baweaver> {x,y} is x to y times
rbowlby has joined #ruby
<baweaver> so in this case, one to three characters
<baweaver> Now on Stellar, why does it need to use that
<Aeyrix> god fuck
<Aeyrix> i accidentally installed the documentation
<Ox0dea> >> "\n".scan(/.{1,3}/)
<Aeyrix> for these gems
<ruboto> Ox0dea # => [] (https://eval.in/395937)
<Ox0dea> baweaver: Why you lie?!
<baweaver> newline isn....
<baweaver> nevermind
<baweaver> technically
<baweaver> lucasr: short answer, learn regex
<Ox0dea> Aeyrix: Running low on terabytes?
Feyn has joined #ruby
<Aeyrix> Ox0dea: It takes years.
<lucasr> cool. i’ll look into that!
<Aeyrix> YEARS
<eam> >> "\n".scan(/.{1,3}/m)
<ruboto> eam # => ["\n"] (https://eval.in/395942)
mary5030 has quit [Remote host closed the connection]
<Ox0dea> eam: /m for magic?
scripore has quit [Quit: This computer has gone to sleep]
<eam> as always
<eam> and /sm is secret magic
<baweaver> https://www.stellar.org/blog/stellar-consensus-protocol-proof-code/ - they love being unnecessarily dense
auzty has joined #ruby
xkef has quit [Ping timeout: 265 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
surs4 has joined #ruby
surs3 has quit [Ping timeout: 252 seconds]
howdoicomputer has joined #ruby
<baweaver> sacarlson: best advice is to ditch stellar, seems like a crappy system honestly.
<baweaver> second piece of advice, learn ruby
<baweaver> you have getter and setter methods, returns, and a whole lot of other stuff in there that reads like a java programmer
<sacarlson> baweaver: so you didn't like my program? it work perfectly now on the present system of stellar
pengin has joined #ruby
<sacarlson> it's the upgraded stellar system I'm preparing for
<eam> I wish ruby RE supported (?{})
<sacarlson> Stellar is the future of money tranfer
<baweaver> it's the future of blowing hard
<sacarlson> ha ha
<baweaver> and a lot of hot air
<sacarlson> it works that's all I need say
<sacarlson> and it works today
<baweaver> they don't actually say anything other than a lot of really fast buzzwords that makes apache documentation look readable
bigmac_ has joined #ruby
prettiestPony11 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Musashi007 has joined #ruby
<Ox0dea> > The exact rules for how often (??{}) and (?{}) are executed in a pattern are unspecified.
<Ox0dea> eam: No thanks. :)
bigmac_ is now known as i8igmac
fgo has joined #ruby
<eam> Ox0dea: what's wrong with that? just write good code without side effects :)
hotpancakes has joined #ruby
<eam> it's totally reasonable not to specify the iterative internals of a RE engine
sigurding has joined #ruby
braincra- has joined #ruby
drewo has quit [Ping timeout: 264 seconds]
Ropeney has joined #ruby
i8igmac has quit [Ping timeout: 256 seconds]
fgo has quit [Ping timeout: 246 seconds]
<quazimodo> is mri 2.2.0 limited to around 3000 threads at a time?
arescorpio has quit [Quit: Leaving.]
<quazimodo> or is this a system setting/configuration
braincrash has quit [Ping timeout: 244 seconds]
<eam> quazimodo: probably a system setting of yours
<eam> you might be hitting a memory limit, depending on where you're running that
pengin has quit [Remote host closed the connection]
<quazimodo> eam i'm guessing system setting
<quazimodo> i'd imagine ruby should eb able to have hundreds of thousands of threads
<quazimodo> they aren't that heavy :/
<sevenseacat> unlikely
<eam> they can be (and it's not necessarily ruby's fault
<eam> you'll probably run into pid_max capping the max tid well before 100k
<eam> a lot of systems limit that at 5 digits
<quazimodo> that's my ubuntu setting
<quazimodo> ok
<quazimodo> so how do erlang et al get away with their hundreds of thousands of threads?
MasterPiece has quit [Quit: Leaving]
<eam> and the underlying libc on some platforms can allocate a hell of a lot of address space for tls, like 64MB in some cases
<eam> quazimodo: they're not really threads
bigmac_ has joined #ruby
<quazimodo> oh?
<quazimodo> i thought erlang threads were native threads
choke has joined #ruby
<eam> anyone doing hundreds of thousands is using some kind of concurrency abstraction
Burgestrand has joined #ruby
<quazimodo> well my machine's threads-max is ~63000
<eam> which might at some point map onto a real thread pool, but it'd be an N:M relationship
* sevenseacat spawned a billion processes in elixir for the fun of it once
<eam> quazimodo: same deal for goroutines btw
<quazimodo> eam hrm didn't know htat
surs has joined #ruby
<quazimodo> cool to know
<quazimodo> i guess that's why it's easy to make a lot of fibers
surs4 has quit [Ping timeout: 248 seconds]
<eam> quazimodo: which value are you looking at for threads-max?
<eam> if this is linux, check /proc/sys/kernel/pid_max
<quazimodo> cat /proc/sys/kernel/threads-max
<quazimodo> for my machines threads max
lkba_ has quit [Quit: Bye]
oo_ has joined #ruby
<eam> is it 32k?
<quazimodo> pid_max is process ids right?
lkba has joined #ruby
<eam> yes, but it also limits thread ids
<quazimodo> 32768
<eam> yeah so you're capped at 32k
<quazimodo> 32k threads overall?
<eam> yes system limit
<eam> threads + pids
<quazimodo> so
<eam> tid/pid
bruno- has joined #ruby
<quazimodo> i have 30k full then?
<quazimodo> surely not
<eam> ps -eLf|wc -l
<quazimodo> there's a process specific cap somewhere too
<quazimodo> 854
<eam> quazimodo: if you're looking at max user processes, that one does not apply to threads
<eam> (the rlimit)
<quazimodo> eam: i'm not sure what' im looking at, first time i've explored this space
<eam> oh 854 is how many total threads you had? from ps/wc?
oo_ has quit [Remote host closed the connection]
<eam> ulimit -a will show you the rlimits, the per-user limits
oo_ has joined #ruby
a346 has quit [Quit: a346]
lucasr has quit [Quit: lucasr]
<eam> (sorta per user, sorta per process)
<eam> each thread needs a C stack (in addition to any ruby level resources) so the "stack size" you see -- well that's memory allocated per thread at the libc level. Ruby will use that, plus a bit more per thread
<quazimodo> yep
<eam> on my system that's 10MB/thread for the stack
AyeDubyew has joined #ruby
<quazimodo> max user processes (-u) 31567
<eam> so 100k threads would be around a Tb of RAM just for the C level call stack
<eam> did I math that correctly?
<notthekgb> Ox0dea: @index?
<Ox0dea> eam: Looks properly mathed to me.
bruno- has quit [Ping timeout: 256 seconds]
<Ox0dea> notthekgb: That's an instance variable. You'll have to use a $global instead if you're not using a class.
<quazimodo> stack size (kbytes, -s) 8192
<quazimodo> 8000 odd kb per thread?
<quazimodo> no way
<eam> quazimodo: 8MB
tmtwd has quit [Remote host closed the connection]
<quazimodo> 8mb PER THREAD?
<quazimodo> that's insane?
<eam> quazimodo: well, think of it this way: how many functions can you call before you blow out the stack?
bungoman has quit [Remote host closed the connection]
<notthekgb> hmmm. I'll try writing out the sort of thing I'm looking to achieve, albeit not in Ruby.
<eam> an integer is 8 bytes
<eam> an address is 8 bytes
<Ox0dea> >> require 'objspace'; ObjectSpace.memsize_of(Thread.main)
<ruboto> Ox0dea # => 525104 (https://eval.in/395975)
fgo has joined #ruby
<eam> so int foo(int a, int b, int c) is gonna take a minimum of 32 bytes
<eam> to call
<eam> (and a bit more because reasons
<sphex> quazimodo: that's just virtual memory.. it's won't use any real memory until it is accessed.
<eam> address space yeah
<eam> when you put more stuff on the stack it'll fault and allocate real memory backing it
<eam> quazimodo: you can use the pmap command to inspect the memory layout of a process
<sphex> quazimodo: it reserves a lot of virtual memory just to guarantee that it can have enough that is consecutive (which is required for a thread stack)
<eam> quazimodo: try this in your shell: pmap $$
<eam> that'll show you the memory layout of (probably bash)
NeverDie_ has quit [Quit: I'm off to sleep. ZZZzzz…]
d3v has joined #ruby
<eam> sphex: I don't think it maps the entire thing at once though
jamesaxl|2 has joined #ruby
hotpancakes has quit [Remote host closed the connection]
<notthekgb> This isn't ruby (or anything, really) but this is what I'm looking to achieve, Ox0dea: http://pastebin.com/f6fTTi7V
<ruboto> notthekgb, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/e139526f7a4368740419
<ruboto> pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<eam> the stack grows downward so there's no need to reserve space
darkf_ has joined #ruby
<notthekgb> oops, sorry about the pastebin link.
<quazimodo> hrm
<quazimodo> cool
<quazimodo> so
<sphex> eam: the mapping is known and reserved by the kernel, but yeah I think on most architecture, the CPU page table is updated lazily after page faults.
<quazimodo> i had no idea that a thread would need 8mb reserved
<quazimodo> i thought maybe kernel gives it more space as it needs it
Musashi007 has quit [Quit: Musashi007]
<eam> quazimodo: it doesn't use 8M of real memory
<eam> it does, at another level
sigurding has quit [Quit: sigurding]
<quazimodo> right
<quazimodo> so
neanderslob has quit [Ping timeout: 264 seconds]
<quazimodo> an erlang box would use maybe a couple thousand threads in a pool to manage 100k+ fake threads eh?
frem has joined #ruby
neanderslob has joined #ruby
<quazimodo> i guess that makes each fake thread much cheaper
<eam> quazimodo: /proc/$$/smaps has the same data as pmap, but with more detail about what each region actually represents
ips|malc has joined #ruby
<eam> quazimodo: I imagine probably only around N cpu worth of threads (but I don't know erlang all that well, so)
jamesaxl has quit [Ping timeout: 246 seconds]
<notthekgb> ok, thanks
<eam> you can't run more than one thread per cpu, so it doesn't make a whole lot of sense to have more threads than cpus -- unless you're doing it to be lazy around implementing your state machine
eggoez has quit [Ping timeout: 240 seconds]
darkf has quit [Ping timeout: 248 seconds]
chinmay_dd__ is now known as chinmay_dd
<eam> or because you want the kernel to schedule for you
<eam> eg a thread-per-connection
<eam> quazimodo: this is essentially why the high performance servers are no longer thread-per-connection
zacstewart has quit [Remote host closed the connection]
<eam> why no one uses apache prefork, etc
<eam> cost per thread
zacstewart has joined #ruby
<eam> (and in apache it's worse, because process)
theery has quit [Remote host closed the connection]
<quazimodo> right
<quazimodo> hence the reason actors can be nice
<quazimodo> abstractions on lots of areas, messaging, deadlocking and also the concurrency model
<quazimodo> hrm
<bnagy> that was the highest density of wrong statements per foot I think I have ever seen on IRC
<quazimodo> really?
ips|malc has quit [Ping timeout: 244 seconds]
<eam> bnagy: which one
<quazimodo> I'm new to concurrency, trying to organise my thoughts
<bnagy> everything about memory and the stack
<eam> bnagy: which parts?
notthekgb has left #ruby ["Textual IRC Client: www.textualapp.com"]
<bnagy> all the parts, that's what everything means
<bnagy> 12:35 < eam> when you put more stuff on the stack it'll fault and allocate real memory backing it
<sphex> look! I'm sorry! I wanted to look smert!
<bnagy> 12:37 < eam> the stack grows downward so there's no need to reserve space
<eam> you don't think the stack grows downward?
evanjs_ has quit [Remote host closed the connection]
<bnagy> the stack grows downward
<eam> ok so you were wrong about "everything?"
<eam> what in particular do you disagree with?
<sacarlson> I can make a stack go any way I want I just put my computer upside down
<sphex> haha
<sacarlson> sorry couldn't resist that one
zacstewart has quit [Ping timeout: 256 seconds]
<eam> bnagy: do you disagree that the regions aren't backed by physical memory until a page fault occurs?
theery has joined #ruby
fgo has quit [Ping timeout: 244 seconds]
willywos has joined #ruby
<bnagy> which has nothing to do with the stack
<bnagy> that's just virtual memory
<ght> Question: I have a series of parameters passed from an API where the params are seperated by the string "-_-_-", and the params are confirmed being passed correctly, but when I execute this line, any...
<eam> bnagy: are you saying the stack is somehow outside of virtual memory?
<ght> param with a space in, the data after the space is discarded: params_arr = ARGV[1].split("-_-_-")
<eam> bnagy: are you saying that linux never page faults in the stack region?
<bnagy> eam: please don't put words in my mouth, they're bad enough in yours
<toretore> ght: ?gist your code
<ght> I thought .split() only based on the data provided and didn't also include space?
<toretore> ?gist ght
<ruboto> ght, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<ght> toretore: This is the only relevant code.
<toretore> ur codes
<ght> That single line.
<toretore> no
<eam> bnagy: well I'm asking because you seemed very sure that everything I said was wrong, but now it seems you don't have any complaints at all
<sphex> compilers will generate code to periodically perform "stack probes" (when a lot of space is going to be used in the current frame) so that the kernel can grow the stack mapping incrementally. but that's for "the" process stack.. I don't think this trick is used for the multiple thread stacks.
dellavg has joined #ruby
jesterfraud has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<bnagy> eam: the lines I actually pasted are both wrong
<bnagy> as was a bunch of other wacky stuff being said
<ght> Does .split() not only split strings based on the parameter provided, but also by spaces? I don't see that in the documentation.
<eam> well you've agreed that not all of them are wrong, so what specifically do you think is in correct?
amclain has quit [Quit: Leaving]
eggoez has joined #ruby
<toretore> >> 'foo-_-_-bar-_-_-baz'.split('-_-_-')
<ruboto> toretore # => ["foo", "bar", "baz"] (https://eval.in/395977)
<eam> sphex: there's a stack per thread
<ght> Yes, that works toretore, of course. That's not the issue.
<eam> if there wasn't, you couldn't be calling different functions in each thread
<ght> The issue is there's a parameter with a space in it.
revath has joined #ruby
<ght> And it's splitting on the space. For example, "My user" is a parameter.
<ght> And it's splitting it but the array is only returning "My"
<eam> and I believe that on linux, they must be the same size, which is why all of this is determined up front
<ght> Despite me specifying -_-_- as the split() parameter.
<toretore> let's see an example
Musashi007 has joined #ruby
<bnagy> page faults just aren't relevant to what userland processes see as memory at all
timonv has joined #ruby
<bnagy> if you access unmapped memory you will fault
<sphex> eam: yeah. but "the" process stack and the thread stacks are not handled the same. the process stack has a fixed layout and is mapped lazily. not the thread stacks AFAIK. but they're still virtual memory.
<toretore> >> 'foo-_-_-My user-_-_-baz'.split('-_-_-')
<ruboto> toretore # => ["foo", "My user", "baz"] (https://eval.in/395978)
<eam> bnagy: that's correct, but if you think that contradicts anything I've said then you've misunderstood
chinmay_dd has quit [Quit: Leaving]
<bnagy> you said there's no need to reserve space for the stack, that's wrong
<toretore> ght: do you understand why i want to see the code now? what you're saying is provably wrong
<bnagy> you said that "12:37 < eam> the stack grows downward so there's no need to reserve space" which is wrong
<eam> bnagy: I'm using simplified terms because I'm talking to a newbie, I'm saying "memory" in a lot of cases where sometimes I mean address space and sometimes I mean real memory. Is that the point of confusion?
<bnagy> because allocators know 0 about real memory
<Ox0dea> bnagy: Why irssi?
<bnagy> you're not simplifying, you just don't know what you're talking about
<eam> I submit that you, perhaps, do not know what I'm talking about
<eam> I think that's becoming clear the more I question you
<toretore> how about, instead of just repeating "you're wrong", you enlighten us on how it actually works?
nveselinov has joined #ruby
<ght> Well toretore, I realize you guys always say "dump all your code", but of course some of us work on proprietary applications where you can't dump entire methods or functions without heavy modification.
<ght> So thanks just the same, I'll take care of it.
<eam> toretore: +1
heyimwill has joined #ruby
<Ox0dea> ght: -1
GriffinHeart has quit [Remote host closed the connection]
<toretore> ght: you can still make an example to demonstrate your problem
chinmay_dd has joined #ruby
mike___1234 has joined #ruby
hahuang65 has quit [Quit: WeeChat 1.2]
<eam> bnagy: how about this, I'll continue to explain, but I'll ask you follow along with my examples ok?
<eam> when I said "the stack grows downward so there's no need to reserve space" I am referring to address space
darkf_ is now known as darkf
<eam> because the stack grows downward there is no concern about obtaining contiguous address space
fgo has joined #ruby
<bnagy> why does the direction of the stack affect that?
<i8igmac> has any one tried downloading pandora music?
<eam> here is an example you can run on your own computer to verify. Start irb, enter $$; then run pmap $pid | grep stack
<eam> then in irb run def f(); f(); end; f()
sacarlson has left #ruby [#ruby]
<eam> then run pmap $pid | grep stack again
<bnagy> eam: the stack is mapped, always
<eam> you will see that the *address space* of the stack region has changed
<eam> bnagy: please follow along with my example
<bnagy> eam: no?
<eam> ok, then everyone else can
<sphex> that's just for "the" process stack which has a fixed layout (together with the old text, bss and brk regions, etc. the kernel maps it lazily and the compiler must issue "stack probes" to ensure it works. AFAIK, this is not the case for thread stacks.
lucasr has joined #ruby
eggoez has quit [Ping timeout: 248 seconds]
<eam> sphex: I'm less certain of that, but are you sure? I believe they're implemented identically
<bnagy> stack regions, thread or process, must be mapped. If you try to grow the stack past the limit you will stack overflow
<bnagy> if you somehow modify $sp to be outside of a valid region you will segfault
<bnagy> either way your stack space must "reserved" before you use it
hahuang65 has joined #ruby
<bnagy> in virtual memory, because we're always talking about virtual memory because the whole diversion into page faults was silly
<eam> it's not silly to diverge into page faults when the question is "why is it using that much real memory?"
CloCkWeRX has quit [Ping timeout: 250 seconds]
<eam> (and the answer is: it isn't, addressing it will cause a fault)
<eam> bnagy: you're right that it must be mapped though
snockerton has joined #ruby
charliesome has quit [Quit: zzz]
<sphex> eam: no, not certain. but it still has to be completely reserved within the kernel of course. it could be lazily mapped too since compilers will issue stack probes all the same. I don't think it would be a worthwhile optimization nowadays though.
<bnagy> you're again bringing things into virtual memory that shouldn't be there
<bnagy> userland reserved vs committed memory is a different thing
<eam> bnagy: when the question is "does it really use X memory per thread" I don't see why discussing page faults is irrelevant -- because that's how it doesn't actually use that memory
<bnagy> that's why we have swap
<bnagy> no, it's not
<eam> we do not swap all address space
howdoicomputer has quit [Ping timeout: 265 seconds]
<eam> dude, one one of my systems there's a 64MB/thread address space allocation -- and we have tens of thousands of threads
<bnagy> yes, that's how virtual memory works
<eam> there is neither enough swap nor physical ram for that
<sphex> bnagy: there's a trick that is involved for stack memory only, and I think only for the main process stack. it is not mapped all at once.
<eam> there's simply nothing backing those regions until they're used (and they never are)
<eam> I agree it's not allocated via sbrk btw
<eam> but really, try the demo
<eam> I made it just for you, to head off any further misunderstanding =/
<eam> also, I gotta go watch a tv show with my wife but I'll be back in a bit if anyone wants to chat about how this stuff works
Channel6 has quit [Quit: Leaving]
blue_deref has joined #ruby
eggoez has joined #ruby
jesterfraud has joined #ruby
<bnagy> that will give me time to make popcorn
tkuchiki has joined #ruby
<bnagy> "stack memory" o_0
mleung has joined #ruby
<bnagy> ok I have to do actual work
hahuang65 has quit [Quit: WeeChat 1.2]
CloCkWeRX has joined #ruby
hahuang65 has joined #ruby
DanKnox has joined #ruby
dhjondoh has joined #ruby
GriffinHeart has joined #ruby
fantazo has joined #ruby
Limix has quit [Quit: Limix]
sigurding has joined #ruby
jesterfraud has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<noethics> ya me 2 bnagy
<noethics> what a coincidence
mrconfused has quit [Ping timeout: 244 seconds]
bluOxigen has joined #ruby
grey_beard has quit [Ping timeout: 246 seconds]
grey_beard has joined #ruby
Limix has joined #ruby
jesterfraud has joined #ruby
fabrice31 has joined #ruby
willywos has quit [Remote host closed the connection]
aryaching has joined #ruby
<eam> bnagy: I hope you're not disagreeing that the stack is comprised of memory now :^)
<eam> bnagy: the specific mechanism I was describing, and that sphex hinted at is explained in detail here: http://unix.stackexchange.com/questions/63742/what-is-automatic-stack-expansion
WillAmes has quit [Ping timeout: 256 seconds]
<eam> you can find the implementation in the kernel here: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/mm/mmap.c#n2282
fabrice31 has quit [Ping timeout: 244 seconds]
<eam> don't take my word for it though - try it yourself!
eGGsha has joined #ruby
theery has quit [Remote host closed the connection]
<eam> bummer that this got derailed =/
Aswebb_ has joined #ruby
<lucasr> Hey guys. I’ve been looking at regex for a bit now, and I think I have the jist of it. but I’m still confused about something. https://gist.github.com/lucasrim/250b3b476d08085db4b0
<baweaver> scan puts matches in an array
<baweaver> only 3 characters match
<baweaver> >> '1234'.scan(/\d{3}/)
<ruboto> baweaver # => ["123"] (https://eval.in/395983)
<baweaver> you're saying _only_ groups of 3
devbug_ has joined #ruby
<lucasr> ohh. okay
<baweaver> also, stop using return
tubuliferous_ has joined #ruby
<eam> I like explicit returns =/
<baweaver> ruby infers returnd
<lucasr> ohh
surs1 has joined #ruby
<baweaver> >> def one; 1 end; one
<ruboto> baweaver # => 1 (https://eval.in/395986)
Limix has quit [Quit: Limix]
<baweaver> so no need to set number to anything
<baweaver> just run that transformation
surs has quit [Ping timeout: 244 seconds]
<lucasr> ah. okay so deleted number = and return.
blueOxigen has joined #ruby
<baweaver> yep
Aswebb_ has quit [Ping timeout: 265 seconds]
hashrocket has quit [Quit: Connection closed for inactivity]
<baweaver> also don't use . unless you _mean_ any character
<baweaver> in this case you want \d which is digit
<lucasr> so basically what the regex is saying in .{3} is only give us the things that come in increments of three, and .{1,3} is saying… just once every 3 characters?
bluOxigen has quit [Ping timeout: 252 seconds]
<baweaver> between one and three
<baweaver> but it's greedy
devbug has quit [Ping timeout: 265 seconds]
<baweaver> so it wants the most possible
<baweaver> ...unless there are less than the most
<lucasr> OHHHHHHH
<lucasr> that just made it click.
<baweaver> that's your new best friend in regex
<baweaver> though be warned, regex can make a mess fast
<baweaver> use sparingly
nycjv321 has quit [Read error: Connection reset by peer]
tubuliferous_ has quit [Ping timeout: 255 seconds]
tagrudev has joined #ruby
eGGsha has quit [Quit: Textual IRC Client: www.textualapp.com]
pyro_ has joined #ruby
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
revath has quit [Ping timeout: 246 seconds]
hotpancakes has joined #ruby
<lucasr> hey thanks so much
<lucasr> that makes a lot of sens
<lucasr> e
riskish has quit [Quit: Textual IRC Client: www.textualapp.com]
<baweaver> best way to learn ruby is to go through the documentation for Enumerable, String, Array, and Hash
howdoicomputer has joined #ruby
<lucasr> is there a resource you like the most?
acke has joined #ruby
acke has quit [Remote host closed the connection]
hotpancakes has quit [Ping timeout: 264 seconds]
<baweaver> standard ruby docs cover most of it
acke has joined #ruby
<baweaver> past that, consider Eloquent Ruby (book)
aleshgo has quit [Remote host closed the connection]
GitGud has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
casadei_ has quit [Remote host closed the connection]
genpaku has quit [Ping timeout: 252 seconds]
genpaku has joined #ruby
roolo has joined #ruby
revath has joined #ruby
olistik has joined #ruby
konsolebox has joined #ruby
devbug has joined #ruby
andikr has joined #ruby
kies^ has quit [Ping timeout: 264 seconds]
ivanskie has joined #ruby
olistik has quit [Remote host closed the connection]
howdoicomputer has quit [Ping timeout: 255 seconds]
grey_beard has quit [Ping timeout: 250 seconds]
grey_beard has joined #ruby
devbug_ has quit [Ping timeout: 244 seconds]
GitGud has quit [Quit: My name is your name]
<ght> Question: Is there any way to force Ruby to take a parameter that has spaces in it and force it to be ARGV[1]?
<konsolebox> Synchronization in threads is kind of different in concept from the actual meaning of being synchronized (simultaneous) isn't it? It confuses me every time. (Points out to Mutex#synchronize).
techietrash has joined #ruby
arup_r has joined #ruby
<eam> ght: yes, but you're probably asking a shell question rather than a ruby question. As in your_script.rb "arg with spaces"
<eam> the shell tokenizes the args before ruby starts up
hahuang65 has quit [Ping timeout: 246 seconds]
<konsolebox> ght: The arguments passed to Ruby is a finite array of null-terminated strings. Try to realize that the concept of a shell's environment does not apply to the binaries it executes.
troulouliou_dev has quit [Quit: Leaving]
<eam> konsolebox: I think the idea is that the lock contention is synchronous
<konsolebox> eam: umm, please elaborate "lock contention"
t_ has quit [Ping timeout: 256 seconds]
<konsolebox> eam: from https://en.wikipedia.org/wiki/Synchronization: Computer science (In computer science, especially parallel computing, synchronization refers to the coordination of simultaneous threads or processes to complete a task with correct runtime order and no unexpected race conditions.)
<konsolebox> eam: this time it's about the "order". and probably most computer scientists think like that.
<eam> konsolebox: yeah, so one thread is running the block and other threads interacting with the semaphore synchronize by blocking on it
dfockler has joined #ruby
<eam> you could say they're "not doing anything" but you could also say the thing they're doing is contending on the semaphore
<eam> (while the block is running, synchronously)
GriffinHeart has joined #ruby
timonv has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
arturaz has joined #ruby
snockerton has quit [Quit: Leaving.]
lucasr has quit [Quit: lucasr]
<eam> like, traffic at an intersection is synchronous because the north-south cars pause while the east-west cars drive and vice versa
eGGsha has joined #ruby
casadei_ has joined #ruby
dfockler has quit [Ping timeout: 265 seconds]
<toretore> roundabouts are cooperatively scheduled
<konsolebox> eam: i understand what you try to imply, however i think a mutex is not the best fit example for trying to execute things to become or appear simultaneous. time, or an atomic variable would be better. mutex actually allow things to go more asynchronous.
<eam> konsolebox: I don't disagree with you :)
peter_paule has joined #ruby
devbug_ has joined #ruby
hahuang65 has joined #ruby
mleung has quit [Quit: mleung]
arturmartins has joined #ruby
podman has quit [Quit: Connection closed for inactivity]
devbug has quit [Ping timeout: 256 seconds]
KnownSyntax has quit []
solars has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
<baweaver> the goal is to minimize critical sections as much as possible, and for the most part that's going to involve immutability until absolutely necessary to break it
t_ has joined #ruby
<toretore> ght: it's not up to ruby, it's up to the shell. usually you use quotes, as in `ruby file.rb -a'foo bar' -bhello`
<baweaver> The less you have to touch mutex the better
allomov has joined #ruby
jenrzzz has joined #ruby
toretore has quit [Quit: This computer has gone to sleep]
casadei_ has quit [Remote host closed the connection]
_ixti_ has quit [Ping timeout: 256 seconds]
hahuang65 has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
chouhoul_ has joined #ruby
luckyruby has joined #ruby
<konsolebox> ok i think it's a little bit forgivable if we interpret or translate @mutex.synchronize{ code } as executing code in synchronization with @mutex. Although the concept of it is a little irritatingly not perfect. Well science allowed it anyway.
aryaching has quit [Ping timeout: 246 seconds]
<konsolebox> the problem is i'm having a problem in choosing the proper term to call or refer to its "state".
Soda has joined #ruby
chouhoulis has quit [Ping timeout: 248 seconds]
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lucasr has joined #ruby
lucasr has quit [Client Quit]
oo_ has quit [Remote host closed the connection]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
roolo has quit [Remote host closed the connection]
allomov has quit [Read error: Connection reset by peer]
A205B064 has quit [Ping timeout: 246 seconds]
roolo has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
GriffinHeart has joined #ruby
allomov has joined #ruby
fabrice31 has joined #ruby
AlphaAtom has joined #ruby
peter_paule has quit [Ping timeout: 256 seconds]
poguez_ has joined #ruby
roolo has quit [Ping timeout: 252 seconds]
eGGsha has joined #ruby
tuor has joined #ruby
techietrash has quit [Quit: Bye! <(^_^<)]
<tuor> hi, i have tried to install a gem on my debian (wheezy), but got this error: http://paste.debian.net/280944/
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tuor> What does this mean?: "`require': cannot load such file"
choke has joined #ruby
nveselinov has quit [Quit: Connection closed for inactivity]
michael_mbp has quit [Excess Flood]
choke has quit [Read error: Connection reset by peer]
<tuor> I mean require is a normal command for including stuff, so what is the problem?
oo_ has joined #ruby
devbug has joined #ruby
devbug_ has quit [Ping timeout: 264 seconds]
<tbuehlmann> tuor, this might help: http://stackoverflow.com/a/17403687/384293
michael_mbp has joined #ruby
rodfersou has joined #ruby
<tuor> tbuehlmann, ah thx. :)
havenwood has quit [Ping timeout: 246 seconds]
<tuor> the ruby1.9.1-dev was not in the recommends, so i didn't install it. works now.
<tbuehlmann> before installing rubies on a new system, I check https://github.com/postmodern/chruby/wiki/Ruby for requirements
yfeldblum has quit [Remote host closed the connection]
RickHull has joined #ruby
Ilyas has joined #ruby
<RickHull> Hi, what's the best way to get ruby structures out of a yaml file with multiple documents?
<RickHull> currently i'm looking at Psych.parse_stream(File.read(filename)) { |doc| # Psych::Nodes::Document }
ta has quit [Remote host closed the connection]
<RickHull> it's not clear how to convert a Psych::Nodes::Document to a ruby structure
C1V0 has joined #ruby
Musashi007 has quit [Quit: Musashi007]
michael_mbp has quit [Excess Flood]
<RickHull> i'd be tempted to look at its superclass for useful methods
<RickHull> is there a link to its superclass on that page?
<RickHull> my general opinion: this documentation style is user-unfriendly
<RickHull> is there a good way to see what methods are available? including superclasses?
<RickHull> as it stands, the methods available are pitiful
codecop has joined #ruby
<sevenseacat> there is a link to its parent class, yes
allomov has quit [Remote host closed the connection]
<sevenseacat> in the big box that says 'parent'
jesterfraud has quit [Quit: Textual IRC Client: www.textualapp.com]
lkba has quit [Quit: Bye]
<RickHull> how big is it, out of how many boxes?
lkba has joined #ruby
<tuor> tbuehlmann, ah thx.
blackmesa has joined #ruby
<RickHull> but indeed #to_ruby is what i was looking for, thanks
<sevenseacat> if i answer you, are you going to change the question again?
<RickHull> the question stands, you answered it
<RickHull> the complaint stands as well
<sevenseacat> 'i didnt bother reading, i just complained because i couldnt see what was right there on the page?'
michael_mbp has joined #ruby
iateadonut has quit [Quit: Leaving.]
<RickHull> please forgive me for not understanding to the totally different UI from e.g. http://ruby-doc.org/stdlib-2.1.0/
aganov has joined #ruby
<sevenseacat> you are forgiven.
luckyruby has quit [Quit: Leaving...]
<sevenseacat> I've never seen that set of docs before
Ox0dea has quit [Ping timeout: 244 seconds]
<RickHull> heh
<sphex> whoa. "()" means nil?
baweaver has quit [Remote host closed the connection]
<sevenseacat> no.
<konsolebox> apeiros: From yesterday's conversation: http://ruby-doc.org/core-2.2.2/Thread.html#method-i-raise: "Raises an exception from the given thread. The caller does not have to be thr." - What do you think "caller" is being referred to?
<sevenseacat> "()" is a string with parentheses in it.
fabrice31 has quit [Remote host closed the connection]
<bnagy> rrrrr rvm returns from the grave to screw me one last time
<RickHull> konsolebox: the object which dispatches to #raise
<sphex> sevenseacat: oookay. `()` then?
<RickHull> ?
fabrice31 has joined #ruby
<bnagy> kind of hilarious bug. I imploded and removed it years ago, but it left rvm.sh in /etc/profile.d...
<sevenseacat> >> ()
<ruboto> sevenseacat # => nil (https://eval.in/396014)
<sevenseacat> its a grouping of nothing.
<bnagy> which adds rvm_dir to your path which is now empty which means you get a :: in your peth
<sevenseacat> so it doesnt mean anything.
<konsolebox> RickHull: ok, can you give an example how that object dispatches it?
<bnagy> which bash treats as the same as having '.'
<bnagy> hilarity ensues o_0
<konsolebox> RickHull: and how would that differ in either threads?
<RickHull> >> p ()
<ruboto> RickHull # => nil ...check link for more (https://eval.in/396015)
<RickHull> >> ().class
<ruboto> RickHull # => NilClass (https://eval.in/396016)
rbowlby has quit [Read error: Connection reset by peer]
<RickHull> konsolebox: what is the problem?
tubuliferous_ has joined #ruby
<RickHull> just understanding the docs? or do you have unexpected code behavior?
krz has joined #ruby
<konsolebox> RickHull: apeiros: konsolebox: callers are objects. objects and threading are orthogonal concepts.
<RickHull> is your problem with the behavior or with doc verbiage?
thiagovsk has quit [Quit: Connection closed for inactivity]
92AABMI76 has quit [Ping timeout: 246 seconds]
quazimodo has quit [Ping timeout: 256 seconds]
<konsolebox> RickHull: no, it's about yesterday's conversation about how "callers" can _only_ be used or interpreted.
<RickHull> oh
dhjondoh has quit [Ping timeout: 252 seconds]
GriffinHeart has quit [Remote host closed the connection]
<sphex> sevenseacat: huh. well, it means the empty argument list when there's no space following the method name (which is what I was trying to do). very confusing.
arturmartins has quit [Quit: Leaving...]
GriffinHeart has joined #ruby
<sphex> and it makes ruby look a bit like lisp yay
<sevenseacat> well yes
<RickHull> sphex: well it's good ruby caught the error early!
<sevenseacat> you didnt provide any context for your question, I could have told you that parentheses also denote a method call
dhjondoh has joined #ruby
<sevenseacat> but by themselves, they dont mean anything
<sphex> RickHull: it doesn't.. it passes a nil argument instead. :/
<sevenseacat> no it doesnt.
<sevenseacat> foo() will not pass a nil to foo.
<sevenseacat> >> def foo(*args); puts args; end; foo()
<ruboto> sevenseacat # => nil (https://eval.in/396017)
<sevenseacat> oh ffs.
edwinvdgraaf has joined #ruby
devbug_ has joined #ruby
<sevenseacat> >> def foo(*args); puts *args; end; foo()
<ruboto> sevenseacat # => ...check link for more (https://eval.in/396018)
<sevenseacat> you suck ruboto.
livathinos has joined #ruby
tubuliferous_ has quit [Ping timeout: 248 seconds]
<sphex> sevenseacat: yeah, not a question.. just a confusion I guess. :p and I'm always wondering if there's more to it.
<RickHull> >> def foo(*args); p args; end; foo()
<ruboto> RickHull # => [] ...check link for more (https://eval.in/396019)
<sevenseacat> oh yeah. puts vs p. derp.
gix has quit [Ping timeout: 256 seconds]
<RickHull> >> def foo(*args); args; end; foo() # better
<ruboto> RickHull # => [] (https://eval.in/396020)
devbug has quit [Ping timeout: 246 seconds]
<sphex> >> def foo(*args); args; end; foo ()
edwinvdgraaf has quit [Remote host closed the connection]
<ruboto> sphex # => [nil] (https://eval.in/396021)
oo_ has quit [Remote host closed the connection]
devbug has joined #ruby
skade has joined #ruby
<RickHull> sphex: yep, ruby didn't catch the error
Soda has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
<sphex> it's a lisp easter egg!
<RickHull> if lisp is your surprise-baseline, expect to continue to be surprised
oo_ has joined #ruby
rdark has joined #ruby
haxrbyte has quit [Read error: Connection reset by peer]
edwinvdg_ has joined #ruby
<sphex> oh don't I wish there were more. but not this one.. it's syntactically confusing. :/
devbug_ has quit [Ping timeout: 264 seconds]
haxrbyte has joined #ruby
<sevenseacat> I dont see how
<RickHull> eliminate the confusion with the rule: method parens are always attached to the method
<sevenseacat> they are. the behaviour of the `foo ()` one is undefined.
GPrime has joined #ruby
<RickHull> if you give a method name and then a space, then that method name might not be interpreted as a method
<RickHull> e.g. if a local var exists
<sevenseacat> or rather, it passes the group () (which means nothing) as the first argument to foo
<sevenseacat> which is where the nil comes from
<sevenseacat> it gets a meaningless 'nothing' argument which it translates to nil
<RickHull> >> def foo(*args); args; end; foo = :bar; foo ()
<ruboto> RickHull # => [] (https://eval.in/396025)
mkarnebeek has joined #ruby
<RickHull> >> def foo(*args); args; end; foo = :bar; foo
<ruboto> RickHull # => :bar (https://eval.in/396026)
hotpancakes has joined #ruby
<sphex> sevenseacat: oh ok. yeah I figured it looked like just an implementation side-effect too.
mkarnebeek has quit [Client Quit]
hololeap has quit [Ping timeout: 252 seconds]
edwinvdgraaf has quit [Ping timeout: 264 seconds]
<RickHull> sphex: note particularly that assigining the value `:bar` to the var `foo` does not affect our method definition of `foo`
<RickHull> we can disambiguate the method call with: foo()
white_bear has joined #ruby
<RickHull> but certainly not with: foo ()
<RickHull> >> def foo(*args); args; end; foo = :bar; foo()
<ruboto> RickHull # => [] (https://eval.in/396036)
Aswebb_ has joined #ruby
<tuor> hi, how can i get autocompletion like in the shell for irb? I'm very new in ruby and don't know so much stuff, so just "search" with <tab><tab> is very nice.
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
<RickHull> tuor: try `pry` instead of irb
<RickHull> if needed, `gem install pry # sudo as nec`
<tuor> RickHull, ok thx.
polysics has joined #ruby
<RickHull> pry is irb on steroids
<sphex> RickHull: interesting.. lemme reread that a bit.
<RickHull> both are REPLs. irb hasn't seen any meaningful features in like 10 years
<RickHull> pry gives an amazing amount of introspection
fullofcaffeine has quit [Remote host closed the connection]
<RickHull> you can show method definitions etc.
arturmartins has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hotpancakes has quit [Ping timeout: 246 seconds]
<tuor> ah ok. :)
<sphex> RickHull: so it seems to interpret it as a method call whenever there are arguments, or directly followed by "()" right?
<RickHull> sphex: yes
<RickHull> ruby is very context sensitive in this respect
<RickHull> it wants to be ambigous about object.property
<konsolebox> What's the safest way to stop a thread that gets to long-wait access a semaphore from time to time? Using Thread#raise?
<RickHull> is object.property an attr / ivar?
<RickHull> or is it a method that returns a value?
<RickHull> konsolebox: i hate to say this, but it sounds like a deeper problem
jaygen_ has joined #ruby
<RickHull> that said, you can use Timeout.timeout, but there are blog posts that say you shouldn't
<sphex> I was wondering about that... these method/local-variable situations can be disambiguated at parse-time (based on assignments seen thus far, etc)?
mkarnebeek has joined #ruby
<RickHull> >> Timeout.timeout(5) { `sleep 6` }
<ruboto> RickHull # => uninitialized constant Timeout (NameError) ...check link for more (https://eval.in/396040)
penzur has quit [Quit: quit]
<RickHull> >> require 'timeout'; Timeout.timeout(2) { `sleep 1` }
<ruboto> RickHull # => (https://eval.in/396041)
<RickHull> oops
<RickHull> >> require 'timeout'; Timeout.timeout(1) { `sleep 2` }
<ruboto> RickHull # => (https://eval.in/396042)
<RickHull> anyway, ruboto sanely disallowed it
hanmac1 has joined #ruby
Scroff has joined #ruby
ndrei has joined #ruby
<RickHull> sphex: yes, closures come into play as well
jaygen has quit [Ping timeout: 248 seconds]
<apeiros> konsolebox: IMO badly worded. should be "calling thread does not have to be the current thread"
<mkarnebeek> I would like to bring https://bugs.ruby-lang.org/issues/10533 to attention
<mkarnebeek> Anybody who might be able to help me with this?
<RickHull> mkarnebeek: hasn't loaded yet
<apeiros> if only the docs for that method alone are looked at, it's not clear that `thr` is a reference to `currently executed thread`
<RickHull> but at best you can expect discussion here, i think
<sevenseacat> mkarnebeek: what can we do about it?
<RickHull> mkarnebeek: reported by drbrain, that is a good sign as far as relevance. not sure about resolution timeline
<sevenseacat> looks like you've put a patch together for it
<RickHull> mkarnebeek: Status:Closed
<sevenseacat> no-one here is ruby core
<sphex> huh. why can't ruboto allow the full MRI by spawning a freshly installed sandboxed VM with ruby packages for each command it gets. :p
<Burgestrand> Don't use timeout if you can help it, it can raise in very odd situations and cause even more odd bugs.
<RickHull> Burgestrand: that's in line with the "blog posts" i referenced
<mkarnebeek> Yes, i've also mailed two core developers and sent a mail to the mailing list, but no responses so far
<RickHull> got a specific link to bad behavior?
Musashi007 has joined #ruby
<RickHull> mkarnebeek: so is it fixed on a new version?
<Burgestrand> RickHull: how about exceptions being raised in ensure-blocks, causing the ensure-clause to fail?
<mkarnebeek> RickHull: No, the previous patch did not fix it
<mkarnebeek> it's incorrectly set at closed
<apeiros> sphex: "why can't" - you seem to have a solution? I suggest you implement it and provide it for ruboto to use :)
<sevenseacat> mkarnebeek: I don't think anyone here can really help
<RickHull> Burgestrand: not doubting you, just looking for specifics
<Burgestrand> RickHull: you have a link to those blog posts? I don't think I've read anything about this
<RickHull> i use Timeout.timeout a lot
<RickHull> with no issue
joonty has joined #ruby
<RickHull> "a lot" in various contexts, historically, without issue
giuseppesolinas has joined #ruby
<apeiros> "I use it a lot" != "it is not a problem"
<RickHull> totally agreed
<Burgestrand> Empirically proven safe
<Burgestrand> ;)
<RickHull> i'm looking for specific issues here
<RickHull> so far we're all just hand-waving
<sphex> apeiros: "<ruboto> please hold..."
<mkarnebeek> sevenseacat: i was hoping to poke around and get somebody with permissions to apply the patch
<Burgestrand> I'll see if I can make an example work.
<sevenseacat> mkarnebeek: no-one here can do it, sorry.
<RickHull> mkarnebeek: not gonna happen here
olistik has joined #ruby
<Burgestrand> It's going to have to be slightly littered with sleeps though, since the issue is inherently racy.
<mkarnebeek> Ok, any tips on what i can to to get this moving?
<RickHull> Burgestrand: heh, no need to actually demonstrate
<RickHull> Burgestrand: I have read the prior complaints, and I don't doubt them
<Burgestrand> RickHull: so what's the issue?
<RickHull> they didn't apply in my situation
<RickHull> i just don't recall what the exact complaints are
AyeDubyew has quit [Ping timeout: 256 seconds]
<RickHull> my issue would be: feel free to use Timeout.timeout except in these {...} situations
<RickHull> i'm not sure what those situations are
ndrei has quit [Ping timeout: 252 seconds]
<apeiros> I think it's more like: don't use Timeout.timeout
<mkarnebeek> sevenseacat: Ok, tnx, any tips on what i can do to get this moving?
ta has joined #ruby
<RickHull> i think that a blanket "Timeout.timeout considered harmful" is incorrect
<RickHull> apeiros: ^
<apeiros> then you're mistaken
<sevenseacat> mkarnebeek: nope.
<RickHull> apeiros: duel!
<Antiarc> I just sat down and if we're talking about timeout.rb it is the devil and you should avoid it like the plague
<flughafen> oh oh oh!
<mkarnebeek> RickHull: Ok, tnx, any tips on what i can do to get this moving?
<flughafen> g'day mate
<apeiros> RickHull: at noon?
<sevenseacat> I trust Antiarc on this matter, he knows his shit.
<Antiarc> Seriously it is an amazing way to break your code and the code of anyone that uses your code in spectacular and indeterminate ways
<Antiarc> It's like Netflix's Chaos Monkey for your Ruby code
<RickHull> sure, halfway between cali and CH?
<sevenseacat> also you've been gone a while Antiarc, wb
<apeiros> RickHull: the problem with timeout is that it will interrupt your code *in any possible place*
<Antiarc> sevenseacat: Howdy, thanks. I've been around, just not in #ruby :)
<apeiros> RickHull: sounds good. where's that? atlantic?
<sevenseacat> ah I see
<Antiarc> (I've been lurking in elixir-lang for a while :)
<RickHull> apeiros: i suggest that this is desirable in many cases
<sevenseacat> I haven't seen you there either :P
DoubleMalt has joined #ruby
<RickHull> apeiros: SF bay area
<Antiarc> RickHull: It's not because it can interrupt in places that you wouldn't want it to. Like in ensure blocks, which are designed to check resources back into resource pools.
<apeiros> RickHull: cali or the middle between cali & ch?
edwinvdg_ has quit [Remote host closed the connection]
mkarnebeek has quit [Quit: Page closed]
<RickHull> apeiros: ah, good point
exadeci has joined #ruby
<RickHull> cape hatteras maybe
hololeap has joined #ruby
<RickHull> bermuda?
tomphp has joined #ruby
<RickHull> porto mallorca?
<Antiarc> There was an issue in the mongodb driver where you could, if the stars aligned, have a timeout occur in the ensure block of a pool check-in, and that connection would then never get checked in and would leak
krz has quit [Read error: Connection reset by peer]
<Antiarc> And the connection would be pinned to that thread
<apeiros> ok, bermuda triangle at noon. it is settled. we shall duel :D
allomov has joined #ruby
<Antiarc> So the connection could never be acquired again, and that thread could never talk to mongodb again for the duration of that process' lifetime
<RickHull> Antiarc: i don't disagree. maybe avoid it in libs
<Antiarc> That was a fun one.
<RickHull> where you don't know who's calling in what context
<Antiarc> RickHull: You don't have to use it in libs to break stuff though
<apeiros> RickHull: your timeout block may span a single method
<RickHull> "generally harmful" sure
<apeiros> RickHull: but that single method is not a single line of code itself
djbkd has quit [Quit: My people need me...]
<Antiarc> If you wrap a call in a Timeout block, and anything in that call - a library 26 calls down the stack maybe - is vulnerable to this kind of disruption, you can break it
<apeiros> and unless you inspected and basically mentally inlined all code and considered *every single point* in that code, you can't be sure it's not harmful.
<RickHull> hm, ok
lee-jon has joined #ruby
<Antiarc> The insidious thing about timeout is that you can inject exceptions into the code in places that it has no way of knowing it should handle the exception
arturmartins has quit [Quit: Leaving...]
<apeiros> you had File.open in your code? -> possible fh leak
<apeiros> you had a DB connection open in your code? -> potentially broken session
<Antiarc> So rather than the code saying "I know this exception can happen, and should handle it or pass it", you are injecting an exception from another thread at an arbitrary point into your "main" thread; it completely bypasses the normal stack-based guarantees
<apeiros> you access some shared state -> potentially corrupt data
<Antiarc> It's just...you're eventually going to break something with it. It's bad.
<sevenseacat> class is now in session
<apeiros> and there's so, sooo, sooooo many subtle ways it may break your stuff…
<RickHull> sure but my processes are short lived... and it works for me...
<RickHull> j/k j/k
<Antiarc> And when something does break it'll be super weird and unobvious and you won't be able to reproduce it until it happens in production 3 weeks later at 4 AM
<sevenseacat> this is much more interesting that trying to figure out this elixir scheduling thing
<Burgestrand> I wonder if there's a way to break a Mutex using Timeout, or if the implementation details of MRI prevents that from happening.
<Antiarc> (I have an irrationally strong hatred of timeout.rb)
<RickHull> Burgestrand: i like that idea. how bad can we break shit?
<Burgestrand> (Break as in cause it to be forever locked without anybody to unlock it)
<RickHull> Antiarc: can you imagine a better impl?
<RickHull> it sure seems useful
t_ has quit [Ping timeout: 265 seconds]
<Antiarc> RickHull: Use IO.select for socket-based timeouts
zacstewart has joined #ruby
surs2 has joined #ruby
<Antiarc> Use good old fashioned manual timings for CPU loops in a single thread
<Burgestrand> The tricky part is that Ruby C methods might/might not be susceptible to these kind of raise timing issues.
<Antiarc> I think Mutex should be safe if you're using the block form
<Burgestrand> Antiarc: my thesis is that it's not necessarily so!
<Burgestrand> Antiarc: granted, synchtonize is implemented in C, but maybe there's a point in the call stack where the mutex won't be unlocked. :)
<apeiros> RickHull: anyway, bottom line is: timeout is always bad. there's situations you can get away with it. but that doesn't mean it's not bad :)
<Antiarc> Burgestrand: The thing timeout does is that it can raise an exception during execution *any* line of your Ruby code (or any single bytecode op, to be more specific)
<RickHull> i believe it now
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<RickHull> i kind of believed it before
<apeiros> examples of where you might get away with it: workers in separate processes which are built to restart any task, regardless of how broken the data is
<RickHull> it still has remained useful and non-broken in my experience
<Burgestrand> If Mutex#synchronize was implemented in Ruby using begin; mutex.lock; yield; ensure; mutex.unlock; end this would be easy to break with enough tries.
<Antiarc> It won't be able to interrupt the Ruby VM while it's in C-land, AFAIK
<apeiros> manual shell script which if it times out it'll terminate anyway
<apeiros> Antiarc: C-land can yield
<Antiarc> (If you want to read more about this, read up on Java's Thread.stop and why it was deprecated. Exact same stuff.)
<Burgestrand> Antiarc: if I remember correctly Ruby will check the thread interrupt flag quite a few times even in C-land.
<apeiros> as in: tell the scheduler to continue
xcesariox has quit [Max SendQ exceeded]
surs1 has quit [Ping timeout: 248 seconds]
<RickHull> btw, confession: i can count the number ofensure blocks that have made it to production on one finger, maybe less
<apeiros> also C land now afaik runs in a separate thread, so even if the C code blocks, ruby code can still be scheduled. not sure about that, though.
<apeiros> RickHull: you have many many more hidden in methods you call
<RickHull> yeah, that i very much believe
<Antiarc> Right, it'll yield, but a thrown exception is going to pop the Ruby stack, right? Bah, I'm going to have to go look at the VM
<RickHull> but i'm a minimalist
<Burgestrand> apeiros: that is news to me, previously the API was very explicit to allow parallell execution during C functions.
<Burgestrand> apeiros: at least for Ruby 2.0, not sure about 2.1 and 2.2
<apeiros> Antiarc: no idea. I should probably one day expand my knowledge in that regard :)
<Antiarc> (I've spent most of my time lately in the jruby source, which is really good for thinking about concurrency stuff!)
bronson has quit [Remote host closed the connection]
<Antiarc> Things get really interesting when Ruby operations that are accidentally atomic because of the GVL are no longer so :)
<apeiros> Burgestrand: hm, I thought "C in separate thread" had been introduced in 2.0. but I only skimmed those news. maybe I misunderstood something.
<RickHull> Antiarc: oh, interesting
<RickHull> Antiarc: i'm a ruby guy in a java shop, and i think there is a huge jruby opportunity
<apeiros> Antiarc: yeah, assumed atomicity considered harmful
<Antiarc> RickHull: JRuby is awesome and you should use it :D
zacstewart has quit [Ping timeout: 244 seconds]
<Burgestrand> apeiros: there was an API in 1.9 that was "experimental, might go away" which allowed you to unlock the GVL during e.g. a blocking C call, but I believe it was considered "will stay" in 2.0
rbowlby has joined #ruby
<RickHull> Antiarc: but I see very little in terms of Jruby for java guys, or jruby for ruby guys that want to integrate with java guys
<Antiarc> If for no other reason than being able to call Java packages directly from Ruby is baller as hell
<RickHull> Antiarc: like i literally have no idea how the integration works
<RickHull> and i've googled a fair bit
<RickHull> and I know headius etc
<RickHull> and i'm sure i could ping him and he would tell me
<Antiarc> RickHull: There are two ways to do it. The first is that you can run JRuby as a replacement for MRI, except you can load JARs and call Java code from JRuby
<Antiarc> The second is that you can actually embed the JRuby runtime in a Java project and then call Ruby code from Java. But I've done much less of that.
<Burgestrand> apeiros: it's kind of hard to use for very similar reasons, it's a ruby API function that you pass 1) a "blocking" function to call, 2) arguments to said function, 3) a function to unblock #1, 4) arguments to unblock function.
<Antiarc> I find it really helpful to just use Ruby as a business logic driver on top of Java stuff.
<RickHull> Antiarc: do you have any comprehensive, go-to blog posts or docs?
<RickHull> i feel like there was a lot more 5 years ago
<RickHull> or even 10, when jruby was starting
<Antiarc> RickHull: For calling Java from JRuby: https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby
<RickHull> but now, there are no more introductory posts
<RickHull> that looks familiar, not purple however
<Antiarc> And that's the other way
<RickHull> ok, go to the first link
<RickHull> ctrl-f classpath
<RickHull> what does it mean, for a ruby guy, for my "jar file to be on the classpath"
<Antiarc> RickHull: The classpath is basically the JVM's equivalent to Ruby's loadpath
<RickHull> no need to answer that question specifically
<RickHull> and yeah, i get that
eGGsha has joined #ruby
krz has joined #ruby
<Antiarc> Look at jbundler - it manages all the classpath shenanigans for you
<RickHull> ok, hm, that's new
<Antiarc> You just specify dependent JARs and it will download them with maven and mangle the classpath for you
<RickHull> for me particularly, i've got 10y of ruby dev, and only getting deep into java in the last few months with $new_job
axl_ has joined #ruby
<Burgestrand> apeiros: https://github.com/ruby/ruby/blob/ruby_2_2/thread.c#L1289 — it's a mouthful to read, but quite interesting.
<RickHull> i'd love to be all productive with jruby and integrate with my java bros
<Antiarc> I'm more of a Ruby dev than a Java dev, but my current projecte required Actual Concurrency, so I built it on JRuby and have had a total blast with it
Musashi007 has quit [Quit: Musashi007]
<RickHull> but the big picture is not clear
<Antiarc> I've gotten to the point that I'm actually contributing stuff back to jruby, which is a ton of fun
<Antiarc> Java's a lot easier to hack on than C, IMO
<Antiarc> And the JRuby source is about four billion times more comprehensible than MRI's
<RickHull> inneresting
<RickHull> from when i've dived into MRI, i was surprised by ruby-like it "seemed"
<RickHull> R_VALUE and such
<RickHull> not sure how much of that is macros
<Antiarc> It's macros all the way down :)
<RickHull> and i'm not claiming to have understood it
<RickHull> but it "looked familiar"
t_ has joined #ruby
<Antiarc> But yeah, all you have to do to start integrating with your team's Java code is to load a jar or class file from Ruby and start calling Java objects as though they were Ruby objects
blackmesa has quit [Ping timeout: 250 seconds]
<RickHull> makes sense
<Antiarc> That's a Ruby object that implements a couple of Java interfaces directly
djbkd has joined #ruby
<apeiros> Burgestrand: i should change my workplace to one where I can just read such stuff because it's a good idea to know that shit
<Antiarc> And you can pass it to a Java Executor as a Callable, even though it's a Ruby class!
i8igmac has quit [Ping timeout: 256 seconds]
<RickHull> Antiarc: i guess what i'm missing, particularly given the manticore example, is how to get started
<RickHull> i'm guessing response.rb doesn't "work" without a lot of other infra / setup / config
<Burgestrand> apeiros: :)
<Antiarc> Well, it's part of a bigger project, but there's not a ton to it
<RickHull> which is fine. but a walkthru / tutorial is what i'm looking for
<RickHull> like let's say we have Proprietary.jar
<Antiarc> Right
<RickHull> and how do we make use of it from jruby
<Antiarc> Put it in the same place as proprietary.rb
fabrice31_ has joined #ruby
<Antiarc> require_relative "./Proprietary.jar"
<Antiarc> And then you can say my_java_obj = Java::CompanyNamePropriertary::Object.new
<yorickpeterse> morning
chouhoul_ has quit [Remote host closed the connection]
<Antiarc> And that'll instantiate a company.name.proprietary.Object instance
<ljarvis> isn't that java.XXX
<Antiarc> Yup
Rickmasta has quit [Ping timeout: 256 seconds]
<Antiarc> The form is Java::CamelCastUriPath::Object
<RickHull> Antiarc: cool, that seems pretty straightforward. my googling was not as enlightening
Zai00 has joined #ruby
<Burgestrand> RickHull: have you looked at https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby?
<Antiarc> Java::OrgApacheHttp::NoHttpResponseException maps to org.apache.http.NoHttpResponseException
<Antiarc> It's reeeeally easy.
CloCkWeRX has left #ruby [#ruby]
<RickHull> Burgestrand: heh, yep, already linked
<Burgestrand> RickHull: :)
rushed has quit [Quit: rushed]
<Antiarc> You could also java_import that object, or include_package the package
<Antiarc> so include_package "org.company.proprietary" would make that package visible in the current module scope
<Antiarc> So then you could just foo = ProprietaryObject.new
sevin has joined #ruby
iateadonut has joined #ruby
fabrice31 has quit [Ping timeout: 255 seconds]
<konsolebox> RickHull: i try to avoid Timeout as well, but i guess I'll just use Mutex#sleep and a thread flag to stop the thread.
<RickHull> what if a feature request comes in to the java guys
<Antiarc> Or java_import "org.company.proprietary.ProprietaryObject", if you don't want to include the whole package
<RickHull> and i'm all "hey i can do that in jruby"
<RickHull> can we get that functionality into the jar?
leonardoajim has quit [Quit: Be back later ...]
<Antiarc> It depends on how the project is being deployed, really. To ship that you would have to ship the jruby-complete jar with your deliverable (as a POM dependency or whatever) and set up a Ruby VM that exposes your execution environment
<RickHull> i'm sure the answer is yes, but this the other question i had trouble ansewring
<RickHull> in my case we are using maven
<Antiarc> https://github.com/jruby/jruby/wiki/RedBridge describes that sort of thing
sivoais has quit [Ping timeout: 252 seconds]
<RickHull> ok, that is a new link :)
<RickHull> pasted before, yes. but i didn't click on it then :)
olistik has quit [Remote host closed the connection]
Rickmasta has joined #ruby
<Antiarc> That would be more useful for adding Ruby scripting to an existing Java project
<RickHull> konsolebox: are you waiting on socket comms?
<konsolebox> RickHull: no..
<Antiarc> But the Ruby-Java crosstalk still works. You can still call Java code from Ruby that's called from Java
<RickHull> ok
sivoais has joined #ruby
<Antiarc> RickHull: #jruby is super helpful if you're interested in dipping your toes in, FWIW
oo_ has quit [Remote host closed the connection]
<RickHull> I'm sure. i got frustrated by the jruby web content (docs, tutorials)
oo_ has joined #ruby
<RickHull> and #jruby was probably my next step, but i gave up
arturmartins has joined #ruby
<RickHull> until you prompted me :)
<Antiarc> TBH it may not be a bad idea to document the places you have issues, and then file those as a ticket. The JRuby leads have been wanting to improve its visibility and make it easier for Ruby devs to pick it up and experiment with it
<RickHull> cool, i'm super happy to help out in that area
<Antiarc> So noting the places where a newcomer has issues or concerns would be valuable!
livathinos has quit []
jamesaxl|2 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
yeticry has quit [Ping timeout: 264 seconds]
Scrofff has joined #ruby
<sphex> hey. I'm trying to do something but I'm not sure I understand what it is... you know when you pass a block to :define_method, it does a thing to it which associates it with the class (and allows it to access instance variables, etc). can I get the same thing done to an anonymous proc (which I could then call with #call)?
yeticry has joined #ruby
<Antiarc> You could just bind the proc as a block, no?
<Antiarc> define_method :foo, &my_proc
olistik_ has joined #ruby
i8igmac has joined #ruby
olistik_ has quit [Remote host closed the connection]
Scroff has quit [Ping timeout: 256 seconds]
<sphex> yeah, but then I don't have it as a first-class value (which I can put in data structures, etc). unless I get it back from #method I guess.
sevin has quit [Quit: byebye]
<Antiarc> I guess I don't quite grok what you're doing
MagePsycho has joined #ruby
<ljarvis> ?code
<ruboto> We can't help you without your code, please post it to https://gist.github.com
<sphex> oh wait.. maybe it's when you actually call something through an object that it gets its association with it..
chinmay_dd has quit [Ping timeout: 244 seconds]
<Burgestrand> We're not javascript.
<Burgestrand> :)
bruno- has joined #ruby
<Antiarc> I'm not 100% sure on this, but I think that define_method :foo, &proc will behave similarly to @instance.instance_exec(&proc)
<sphex> my code is all garbled and confused. I'm trying to make a test DSL to learn metaprogramming and it's not happening. :/
<Burgestrand> sphex: http://ideone.com/7yXSCv
lxsameer has joined #ruby
<Burgestrand> Unfortunately the &block passed to wrapped will get lost because of this. :(
<Burgestrand> Can probably get around that by using define_method instead if you really want to. :)
senayar has joined #ruby
sevin has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
GPrime has quit [Quit: Textual IRC Client: www.textualapp.com]
white_bear has quit [Ping timeout: 256 seconds]
dumdedum has joined #ruby
bruno- has quit [Ping timeout: 265 seconds]
nahtnam has quit [Quit: Connection closed for inactivity]
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
Feyn has quit [Quit: Leaving]
chinmay_dd has joined #ruby
blackmesa has joined #ruby
sevin has quit [Quit: byebye]
<sphex> Antiarc, Burgestrand: it works! not sure why, my brains are fried at this point. I guess it makes sense though. I was really searching for somekind of built-in wrapper just like that and forgot about instance_exec completely.
Scrofff has quit [Ping timeout: 246 seconds]
Scroff has joined #ruby
<sphex> Burgestrand: thanks for the example!
hahuang65 has joined #ruby
krz has quit [Read error: Connection reset by peer]
<Burgestrand> sphex: https://eval.in/396073 — made another one!
devbug_ has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
<Antiarc> Ooh, refine. Fancy.
arup_r has quit [Remote host closed the connection]
fabrice31 has joined #ruby
<Burgestrand> The downside is that the arguments will be strict once you define it as a method (i.e. it becomes a lambda)
<sphex> holy s**t
djbkd has quit [Remote host closed the connection]
<Burgestrand> The upside is that you can now pass blocks to wrapped.call!
livathinos has joined #ruby
msgodf has joined #ruby
edwinvdgraaf has joined #ruby
krz has joined #ruby
lessless has joined #ruby
devbug has quit [Ping timeout: 255 seconds]
<sphex> Burgestrand: awesome. Proc#bind would be exactly what I was thinking of... thanks!
<sphex> I'm gonna have to reread this for a while...
<Burgestrand> :)
yfeldblum has joined #ruby
xkef has joined #ruby
yfeldblu_ has joined #ruby
<Antiarc> That does the same thing, though it has to use send to call #define_method
dumdedum has quit [Ping timeout: 246 seconds]
quimrstorres has joined #ruby
<Burgestrand> I'm not sure how thse things will behave regarding the ruby method caching.
lkba has quit [Ping timeout: 248 seconds]
quimrstorres has quit [Remote host closed the connection]
<Antiarc> define_method will invalidate the cache
ruby-lang867 has joined #ruby
<Antiarc> as should define_singleton_method
<Burgestrand> Indeed, I'm just not sure of the repercussions.
hahuang65 has quit [Quit: WeeChat 1.2]
<Antiarc> Well, if you're calling it in a loop in production code, Bad Things. :)
<Antiarc> (though ostruct is really the only place where that tends to happen on any kind of regular basis, IME)
<Burgestrand> Because the method cache is not just One Global Cache anymore, is it?
<Antiarc> Right, I think it's per inheritance tree as of 2.2?
surs3 has joined #ruby
yfeldblum has quit [Ping timeout: 265 seconds]
<Burgestrand> Found some claims that starting with 2.1, altering a class will only invalidate the caches for that class and its subclasses. Wonder how altering the singleton class pans out…
oo_ has quit [Remote host closed the connection]
<RickHull> fuck, cache invalidation, naming things, and off by one errors
araujo has quit [Quit: Leaving]
<Antiarc> Burgestrand: That's a good question, actually. instance.extend(ExtraFunctionalityModule) is something I used to see but generally got patched out because of method cache churn. I wonder if it's viable now.
<RickHull> there are only 2 hard problems in programming: determining when to go bed, and doing so
surs2 has quit [Ping timeout: 255 seconds]
sevin has joined #ruby
<Burgestrand> Antiarc: looks like accessing the singleton class does cause some kind of cache invalidation.
<ddv> lol
<Burgestrand> Antiarc: https://eval.in/396079
olistik has joined #ruby
livathinos has quit []
senayar has quit [Remote host closed the connection]
<sphex> in my case, this would all be done only when defining the class. looks like the define_method/method/remove_method trick will do fine and I won't have any instance_exec either. but instance_exec isn't (as much of) a performance problem I guess?
senayar has joined #ruby
<Antiarc> Burgestrand: Hrm. That's unfortunateish.
anisha has joined #ruby
<Burgestrand> sphex: it's only a performance problem if you do a lot of my_proc.bind(object)
<Antiarc> sphex: It's not particularly a performance problem, no.
<sphex> okay
<Burgestrand> sphex: and it's kind of isolated, so I would say don't mind it at all unless you run into performance problems
<Antiarc> Rule of thumb is that you don't want to be extending objects or defining new methods at runtime after all your initial setup
<RickHull> rule #2 is always be profilin
sevenseacat has quit [Ping timeout: 248 seconds]
<Burgestrand> Rule #3 is you don't need performance until you need it
<RickHull> and when you do, she is a fickle strumpet
ndrei has joined #ruby
<sphex> Burgestrand: ok. I'll be doing those during class definition only (and then save the "bound" procs).
<Burgestrand> :)
araujo has joined #ruby
araujo has quit [Max SendQ exceeded]
<Antiarc> You probably shouldn't worry about method cache stuff too much right now. Just keep the term in mind so that when someone yells at you for cache thrash you'll know what to look at :)
<Burgestrand> sphex: ^
tchebb has joined #ruby
MichaelGG_ has quit [Remote host closed the connection]
<RickHull> rule #1 is don't worry about stuff too much right now
oo_ has joined #ruby
<Burgestrand> Now that the method cache busting mostly isn't global I don't really care either way… and I didn't even before I knew there was a global method cache that could be busted either.
sevin has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<RickHull> rule #0 is MRI is a black box and you don't want to open the lid
araujo has joined #ruby
<Antiarc> heh, back in the day eliminating ostruct usage produced a measuable improvement in my Rails app performance
<RickHull> and then things were improved, and your optimization wasn't?
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Antiarc> I still don't recommend the use of ostruct.
marr has joined #ruby
<RickHull> Hashie::Mash for everyone!
edwinvdgraaf has quit [Remote host closed the connection]
<Burgestrand> Accessing a random undefined method? SURE, HERE'S A NIL!
senayar has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
senayar has joined #ruby
<bnagy> I never understood ostruct. Like.. just use a hash o_0
<bnagy> struct at least has some uses
chinmay_dd has quit [Quit: See ya!]
<RickHull> the siren song for ostruct was foo.bar and foo['bar']
<RickHull> right?
<RickHull> let alone foo[:bar]
chinmay_dd has joined #ruby
quimrstorres has joined #ruby
<RickHull> (at the code level, leaving aside C nerds)
dumdedum has joined #ruby
quimrstorres has quit [Remote host closed the connection]
susmus has left #ruby [#ruby]
sevin has joined #ruby
<bnagy> I guess, but I still don't get it :)
<RickHull> god forbid you wanted a key named :delete
<RickHull> i get it, from a caller / user / convenience angle
<RickHull> the "symbol vs string" hash key problem
<RickHull> and also wanting to use methods instead of key access on hashes
<bnagy> it's like finding candy on the ground and eating it
bronson has joined #ruby
<RickHull> just blame it on "loljs" and move on :)
ralku has joined #ruby
chinmay_dd has quit [Read error: Connection reset by peer]
lkba has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
rbowlby has quit [Remote host closed the connection]
<RickHull> beety dubs https://code.google.com/p/loljs/
<Antiarc> well that's horrifying
edwinvdgraaf has joined #ruby
<RickHull> i know, google code, right?
chinmay_dd has joined #ruby
edwinvdg_ has joined #ruby
Scrofff has joined #ruby
ruby-lang867 has quit [Ping timeout: 246 seconds]
oo_ has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 265 seconds]
_main_0 has joined #ruby
__main__ has quit [Read error: Connection reset by peer]
tubuliferous_ has joined #ruby
oo_ has joined #ruby
Igorshp has joined #ruby
Scroff has quit [Ping timeout: 256 seconds]
tomphp_ has joined #ruby
quimrstorres has joined #ruby
edwinvdgraaf has quit [Ping timeout: 250 seconds]
arup_r has joined #ruby
tomphp has quit [Ping timeout: 252 seconds]
<konsolebox> On what platform could IO::pipe be not usable?
<RickHull> amiga
<konsolebox> Windows and Mac = ok?
gizmore has joined #ruby
<RickHull> pipes are pretty inherent to unix
_main_0 has quit [Read error: Connection reset by peer]
tubuliferous_ has quit [Ping timeout: 246 seconds]
<RickHull> i would expect mac does ok
<RickHull> windows maybe
<konsolebox> RickHull: DOS does pipes, but i'm not sure if it's the same
<RickHull> right...
<RickHull> as far as hackers in this channel go, they probably use piping OS's and are not fully in tune with non-piping OS's
<Burgestrand> MingW maybe?
_main_ has joined #ruby
polysics has quit []
<Burgestrand> Ruby just calls pipe() in the end, so wherever that is available should be fine
<zenspider> mingw should be fine. pipe is a posix thing
<Burgestrand> Yeah
<Burgestrand> Finding platform support for many things is suprisingly hard…
<RickHull> konsolebox: do you have a specific concern?
<RickHull> or maybe something in the docs?
edwinvdg_ has quit [Remote host closed the connection]
<zenspider> konsolebox: there's a gem win32-pipe
_main_ is now known as __main__
<zenspider> by imperator, of course
kraljev11 has joined #ruby
ralku has quit [Quit: Textual IRC Client: www.textualapp.com]
bodgix_wrk has joined #ruby
<konsolebox> RickHull: seeing "Not available on all platforms." in http://ruby-doc.org/core-2.2.2/IO.html#method-c-pipe just made me ask this.
redcue has joined #ruby
sevin is now known as sevin_
craysiii has quit [Quit: craysiii]
sevin_ is now known as sevin
<RickHull> konsolebox: yeah, ruby has its heart in unix
<konsolebox> RickHull: it probably works well with UN*X, but it just made me wonder about Windows.. it's one of my target platforms after all.
<RickHull> you'll generally do well to assume any non-unix impls approximate the unix impls
<konsolebox> RickHull: i don't care about post-NT windows systems actually. starting Win2k (not really), XP would be fine
<RickHull> and yeah, where you have to support those platforms
<RickHull> it's loads of "fun"
<RickHull> ruby does a good job, generally, imho, in being multi-platform
lee-jon has left #ruby [#ruby]
surs3 has quit [Ping timeout: 246 seconds]
surs4 has joined #ruby
<RickHull> that said, every time i've dealt with ruby headaches on windows, the answer has always been "linux"
<redcue> depends on how you define 'a good job' ^^
<RickHull> redcue: relative to?
<konsolebox> *pre-NT windows
<konsolebox> RickHull: anyway i guess i just have to test. if mingw emulates it well, then it's fine.
<tuor> hi, I have a string object with a xml in it (as a string). I want to write it in a file and make it readable (now it's all one string I want to have a nice readable xml file).
<RickHull> konsolebox: i wish i had better advice
<redcue> Don't get me wrong I think ruby actually does a good job in being multi-platform
<tuor> how can I do it?
<RickHull> konsolebox: but yes, it generally comes down to testing and workarounds for majorly different platforms
<RickHull> tuor: easy peasy
dionysus69 has joined #ruby
aswen has joined #ruby
<tuor> RickHull, thx
<RickHull> File is the api you would use, but it inherits from IO
<zenspider> RickHull: except, of course, the second you mention fork. that's why ruby wound up adding #spawn
<tuor> ok
ndrei has quit [Ping timeout: 256 seconds]
<RickHull> zenspider: yep, good point, resonates here at $new_job
ndrei has joined #ruby
bruno- has joined #ruby
<tbuehlmann> tuor, an easy way is File.write('/path/to/file', 'your xml string')
<RickHull> i am terrible at giving advice to ruby programmers on windows
eGGsha has joined #ruby
<konsolebox> RickHull: it sounds like tuor also wants to prettify the xml.
dANO_ has joined #ruby
<RickHull> readable schmeadable
<tuor> konsolebox, yes.
<tuor> first just write, and when i can do it, "do it readable"
<RickHull> it's a good exercise
<RickHull> separate the operations
<RickHull> one the one hand, inject whitespace to make it readable
<RickHull> on the other hand, write it to the filesystem
<RickHull> note that whitespace on windows implies CRLF
<RickHull> whereas on unix it's just LF
<RickHull> good luck, heading to bed, cheers
<tuor> thx. :)
<RickHull> sorry, not whitespace so much as newlines
<RickHull> outside of newlines, windows and unix generally agree on whitespace
<RickHull> heading to bed ferrealz now
xkef_ has joined #ruby
bruno- has quit [Ping timeout: 240 seconds]
haroldwu has quit [Ping timeout: 252 seconds]
haroldwu has joined #ruby
xkef has quit [Ping timeout: 250 seconds]
Lildirt has quit [Quit: Leb wohl, meine Freunde. Ich wünsche Ihnen das beste von Tagen.]
oo_ has quit [Remote host closed the connection]
Lildirt has joined #ruby
lolmaus has quit [Ping timeout: 256 seconds]
arup_r has quit [Remote host closed the connection]
lolmaus_ has joined #ruby
redcue is now known as redcue[away]
<tuor> RickHull, good night & thx.
<tuor> konsolebox, thx. :)
<RickHull> tuor: cheers, nn
<tuor> (here it's 11:41 ^^ UTC+2)
<adaedra> Hello CEST
<adaedra> ?ugt tuor
<RickHull> in IRC time it's always morning or evening
<adaedra> mh
<adaedra> jhass, apeiros: is there a version of ?ugt for farewells?
<jhass> not yet, but we indeed should make one
<jhass> ideas?
<RickHull> ?uft adaedra
<ruboto> adaedra, I don't know anything about uft
<RickHull> ruboto: get smarter
<adaedra> ?smarter RickHull
<ruboto> RickHull, I don't know anything about smarter
<adaedra> :v
arup_r has joined #ruby
<jhass> ?botsnack
<ruboto> nomnomnomnom
<RickHull> ruboto: RickHull is smarter
oo_ has joined #ruby
<RickHull> ruboto: botsnack
<RickHull> ruboto: usuck
<adaedra> ?botsnack
<ruboto> nomnomnomnom
platzhirsch has joined #ruby
platzhirsch has left #ruby [#ruby]
oo_ has quit [Read error: Connection reset by peer]
<RickHull> ruboto: dwim
<RickHull> ruboto: don't stop not contradicting yourself
<tuor> adaedra, got it thx ;)
oo__ has joined #ruby
livathinos has joined #ruby
revath has quit [Quit: Leaving.]
revath has joined #ruby
Lildirt has quit [Quit: Leb wohl, meine Freunde. Ich wünsche Ihnen das beste von Tagen.]
tkuchiki has quit [Remote host closed the connection]
livathinos has quit [Client Quit]
olistik has quit [Remote host closed the connection]
xlogic has joined #ruby
Lildirt has joined #ruby
shibly has joined #ruby
matp has quit [Ping timeout: 276 seconds]
shibly has left #ruby [#ruby]
shibly has joined #ruby
shibly has left #ruby [#ruby]
shibly has joined #ruby
shibly has left #ruby [#ruby]
GriffinHeart has quit [Remote host closed the connection]
Lildirt has quit [Remote host closed the connection]
tkuchiki has joined #ruby
Lildirt has joined #ruby
edwinvdgraaf has joined #ruby
surs has joined #ruby
jk_scowling has joined #ruby
tkuchiki has quit [Remote host closed the connection]
redcue[away] is now known as redcue
jespada has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
surs4 has quit [Ping timeout: 246 seconds]
hololeap has quit [Ping timeout: 252 seconds]
fabrice31 has quit [Remote host closed the connection]
tkuchiki has joined #ruby
blue_deref has quit [Quit: bbn]
eGGsha has joined #ruby
RickHull has left #ruby [#ruby]
surs1 has joined #ruby
ruby-lang503 has quit [Ping timeout: 246 seconds]
hotpancakes has joined #ruby
redcue has quit [Quit: Textual IRC Client: www.textualapp.com]
surs has quit [Ping timeout: 255 seconds]
matp has joined #ruby
hotpancakes has quit [Ping timeout: 250 seconds]
Axy has quit [Read error: Connection reset by peer]
krz has quit [Read error: Connection reset by peer]
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
blackmes1 has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
Spleeze has quit [Ping timeout: 240 seconds]
aperture has quit [Ping timeout: 246 seconds]
mesamoo has quit [Excess Flood]
mesamoo has joined #ruby
C1V0 has quit [Ping timeout: 256 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
devbug has joined #ruby
devbug_ has quit [Ping timeout: 240 seconds]
lee-jon has joined #ruby
Spleeze has joined #ruby
enders has quit [Remote host closed the connection]
enders has joined #ruby
oo__ has quit [Remote host closed the connection]
oo_ has joined #ruby
blackmes1 has quit [Ping timeout: 265 seconds]
ndrei has quit [Ping timeout: 246 seconds]
lee-jon has quit [Client Quit]
ndrei has joined #ruby
devbug_ has joined #ruby
krz has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
oo_ has quit [Ping timeout: 240 seconds]
senayar has quit [Remote host closed the connection]
devbug has quit [Ping timeout: 256 seconds]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
white_bear has joined #ruby
chipotle has joined #ruby
white_bear_ has joined #ruby
kraljev11 has quit [Ping timeout: 246 seconds]
blackmes1 has joined #ruby
kraljev11 has joined #ruby
iateadonut1 has joined #ruby
iateadonut has quit [Ping timeout: 250 seconds]
white_bear has quit [Ping timeout: 244 seconds]
poguez_ has quit [Quit: Connection closed for inactivity]
chipotle has quit [Ping timeout: 256 seconds]
tmtwd has joined #ruby
bruno- has joined #ruby
zacstewart has joined #ruby
stamina has joined #ruby
lkba_ has joined #ruby
livathinos has joined #ruby
chinmay_dd has quit [Read error: Connection reset by peer]
livathinos is now known as livathinos|away
pyon is now known as magical-imouto
hotpancakes has joined #ruby
chinmay_dd has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
bruno- has quit [Ping timeout: 265 seconds]
livathinos|away is now known as livathinos
grey_beard has left #ruby [#ruby]
devbug has joined #ruby
hotpancakes has quit [Ping timeout: 265 seconds]
sevenseacat has joined #ruby
devbug_ has quit [Ping timeout: 246 seconds]
camilasan has quit [Remote host closed the connection]
quimrstorres has quit [Remote host closed the connection]
camilasan has joined #ruby
fantazo has quit [Ping timeout: 255 seconds]
yfeldblu_ has quit [Ping timeout: 248 seconds]
raddy has joined #ruby
davedev24_ has joined #ruby
<raddy> Hello Everybody
Muhannad has joined #ruby
<raddy> Mod_Passenger always load a ruby app in development environment and not in production
<adaedra> you have an env variable to set, RACK_ENV or RAILS_ENV in you passenger config I think
howdoicomputer has joined #ruby
quimrstorres has joined #ruby
<adaedra> Or maybe passenger has this option directly, don't know it well enough
<kraljev11> i get error: Error:(6, 61) overriding lazy value y in class Nominal of type Seq[Int];
<kraljev11> value y must be declared lazy to override a concrete lazy value
<kraljev11> class NominalBasic(name: Symbol, x: Unlabeled, override val y: Seq[Int], names: Vector[String], loss: Loss[Nominal])
<kraljev11> ^
<kraljev11> but when i declare it lazy I get that lazy cannot be declared there
abuzze_ has joined #ruby
phutchins2 has joined #ruby
Toska has joined #ruby
tmtwd has quit [Ping timeout: 256 seconds]
<adaedra> is that Ruby?
raddy has quit [Read error: Connection reset by peer]
<kraljev11> oh, sorry, wrong subreddit
<adaedra> is that Reddit?
<kraljev11> :)
abuzze has quit [Ping timeout: 256 seconds]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
raddy has joined #ruby
nofxx has quit [Ping timeout: 256 seconds]
abuzze has joined #ruby
ndrei has quit [Ping timeout: 256 seconds]
<sevenseacat> red....dit?
<neanias> Multipass
postmodern has quit [Quit: Leaving]
jmhmccr has quit [Quit: Connection closed for inactivity]
abuzze_ has quit [Ping timeout: 256 seconds]
skade has joined #ruby
chouhoulis has joined #ruby
howdoicomputer has quit [Ping timeout: 256 seconds]
tubuliferous_ has joined #ruby
fabrice31 has joined #ruby
fabrice31 has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
<Burgestrand> raddy: for apache, nginx or standalone?
senayar has joined #ruby
fabrice31 has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
surs2 has joined #ruby
<raddy> Burgestrand : apache.
chouhoulis has quit [Ping timeout: 264 seconds]
<Burgestrand> raddy: I would suggest you ask in #passenger if that doesn't help.
tubuliferous_ has quit [Ping timeout: 264 seconds]
surs1 has quit [Ping timeout: 250 seconds]
bronson has joined #ruby
Scroff has joined #ruby
unshadow has joined #ruby
<adaedra> I'd prefer a Burgerstand.
edwinvdgraaf has quit [Remote host closed the connection]
<neanias> Burger friday
andikr has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
[k- has joined #ruby
<[k-> ello
<adaedra> [k-, here we meet again.
bronson has quit [Ping timeout: 264 seconds]
Scrofff has quit [Ping timeout: 244 seconds]
* [k- bored extravagantly
<[k-> good day to you
Musashi007 has joined #ruby
unshadow_ has quit [Ping timeout: 256 seconds]
<raddy> I have set RACKENV Production, RAILSENV Production already, But it didn't help
edwinvdg_ has joined #ruby
xlogic has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dgutierrez1287 has joined #ruby
dANO_ has quit []
millerti has quit [Ping timeout: 256 seconds]
msgodf has quit [Ping timeout: 264 seconds]
<[k-> oh shit
<[k-> I meant bowed
<[k-> stupid autocorrect
<jhass> raddy: it's RACK_ENV=production and RAILS_ENV=production
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
edwinvdgraaf has quit [Ping timeout: 264 seconds]
bakednotfried has quit [Changing host]
bakednotfried has joined #ruby
<raddy> jhass : Invalid command 'RACK_ENV=production
dgutierrez1287 has quit [Remote host closed the connection]
dgutierrez1287 has joined #ruby
jk_scowling has quit [Ping timeout: 256 seconds]
lessless has joined #ruby
<Burgestrand> raddy: how have you set it?
<jhass> well, the PassengerAppEnv directive takes production only
<jhass> and sets the correct variables
<Burgestrand> raddy: by default, passenger will already have set those variables to production.
<raddy> Then what for my app always starts in development ?
<Burgestrand> raddy: maybe your app doesn't read environment?
<jhass> or maybe you configured that somewhere without realizing
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
edwinvdg_ has quit [Remote host closed the connection]
Scroff has quit []
<shevy> the infamous ghost variables
blackmes1 has quit [Ping timeout: 256 seconds]
okdas has quit [Read error: Connection reset by peer]
okdas has joined #ruby
okdas has joined #ruby
kjkn has joined #ruby
dEPy has joined #ruby
<[k-> set_trace_func!
edwinvdgraaf has joined #ruby
Scroff has joined #ruby
<shevy> set_snoop_[k-!
sdothum has joined #ruby
<[k-> 0000 c_func return
<shevy> [k- do you program in C?
<[k-> no
shadoi has quit [Quit: Leaving.]
chipotle has joined #ruby
Rollabunna has quit [Remote host closed the connection]
edwinvdgraaf has quit [Remote host closed the connection]
auzty has quit [Quit: Leaving]
edwinvdgraaf has joined #ruby
Musashi007 has quit [Quit: Musashi007]
<MagePsycho> how to seek confirmation in ruby? like are you sure you want to continue
urbanmonk has quit [Quit: urbanmonk]
skade has quit [Quit: Computer has gone to sleep.]
chipotle has quit [Ping timeout: 264 seconds]
<[k-> you ask the person
<[k-> you normally use a blocking method
diegoviola has joined #ruby
<[k-> gets, etc
<apeiros> ?context MagePsycho
<ruboto> MagePsycho, Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
<apeiros> hm, maybe that factoid goes slightly in the wrong direction for this case :)
<apeiros> well: "Please add more context to your question". this.
ndrei has joined #ruby
urbanmonk has joined #ruby
El3ktra has quit [Ping timeout: 256 seconds]
urbanmonk has quit [Client Quit]
<MagePsycho> actually before running the script i want to show the variable values and say are you sure you want to continue to run the script with these variables? just to make sure they are passing correct arguments
tkuchiki has quit [Remote host closed the connection]
<shevy> MagePsycho user_input = gets.chomp
<adaedra> Console script?
<shevy> case user_input
<shevy> when 'yes','y'
hotpancakes has joined #ruby
<shevy> @continue = true
<adaedra> ?gist shevy
<ruboto> shevy, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<shevy> ?spam adaedra
<ruboto> adaedra, I don't know anything about spam
urbanmonk has joined #ruby
<MagePsycho> yeah console script
<[k-> ?roode adaedra
<ruboto> adaedra, I don't know anything about roode
<adaedra> look who's talking
<hanmac1> shevy ⁹⁄₉ of all rwx users likes it ;P
<shevy> hanmac1 I am rewriting all my old ruby-gnome scripts again!
<apeiros> MagePsycho: take a look at highline gem
edwinvdgraaf has quit [Remote host closed the connection]
<apeiros> makes user interaction easier
<shevy> finished about 20% so far, doing like one .rb per day
howdoicomputer has joined #ruby
<MagePsycho> it’s just a simple interaction
olistik has joined #ruby
<hanmac1> shevy better help me and then you can rewrite them into rwx ones ;P
luzidco_ is now known as luzidco
<adaedra> MagePsycho: if you don't want to add dependencies, just read a line (gets) and compare it. But yes, highline is good.
hotpancakes has quit [Remote host closed the connection]
<shevy> hanmac1 one thing at a time... first I have to seriously learn C... it feels so boring compared to ruby though
skade has joined #ruby
<MagePsycho> is there a way to pass argument in ruby console script like shell script: runDbRepairTool —url=url-goes-here —db=<db-name> —user=<username> —pass=<password>
edwinvdgraaf has joined #ruby
ldnunes has joined #ruby
<shevy> MagePsycho all commandline arguments passed to a .rb file are available in ARGV
<adaedra> I think it's getopt
<MagePsycho> for now i am passing like: runDbRepairTool arg1 arg2 arg3 arg4 ..
<shevy> all of these args will be in ARGV
<adaedra> MagePsycho: for easy parsing of that: http://www.rubydoc.info/stdlib/optparse/OptionParser
aswen has quit [Quit: WeeChat 1.1.1]
<MagePsycho> shevy: nice explaination
<MagePsycho> adaedra: can be a good option
<shevy> you should test it as soon as possible, the moment you write the code yourself will be the moment you understand it :)
<adaedra> MagePsycho: should make it much more easier than just going through ARGV, it's here for that ;)
AyeDubyew has joined #ruby
<shevy> ARGV is very simple
<shevy> look how complicated optionparser can become!
<shevy> option_parser.on("-v", "--[no-]verbose", "Run verbosely") { |v|
tmtwd has joined #ruby
<adaedra> shevy: when you just pass ordered, non labelled elements, yes. Going through named options, with potentially optionnal or short options quickly becomes a mess.
<diegoviola> I write my ruby code with vim
<diegoviola> what about you
kjkn has quit [Ping timeout: 246 seconds]
<adaedra> I use butterflies.
eGGsha has joined #ruby
<shevy> adaedra yeah, the moment one wants to support all of -, --, and also =, handling ARGV 1:1 is too much work for the gain
<shevy> ruby foobar.rb -v --help -fruit=bananas
<shevy> if it would be a french script, one would use baguette instead :)
<adaedra> also, optparse is stdlib, so everything is good in it.
<adaedra> give me a break with that.
<shevy> eh, stdlib isn't always perfect
<adaedra> I meant it in the way "No need for external deps"
<shevy> there is also GetoptLong in stdlib :)
pyro_ has quit [Remote host closed the connection]
<shevy> strangely enough, I never actually used it
TheHodge has joined #ruby
n008f4g_ has joined #ruby
hanmac1 has left #ruby [#ruby]
<adaedra> You never used stdlib? :o
<shevy> I mean GetoptLong, I don't know when to preferrentially use it over optparse
<shevy> *preferentially
matti has quit [Read error: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number]
fabrice31_ has joined #ruby
howdoicomputer has quit [Ping timeout: 256 seconds]
surs3 has joined #ruby
fantazo has joined #ruby
matti has joined #ruby
matti has quit [Changing host]
matti has joined #ruby
El3ktra has joined #ruby
<[k-> You never used stdlib? :o
surs2 has quit [Ping timeout: 265 seconds]
<shevy> a parrot!
fabrice31 has quit [Ping timeout: 264 seconds]
<[k-> a non-answerer!
nfk has joined #ruby
<MagePsycho> how to parse xml, i am planning to get the db details from .xml file
joonty has quit [Quit: joonty]
<shevy> parsing xml is painful
<[k-> just get a library
<shevy> least painful way may be to install nokogiri: http://www.nokogiri.org/
jbw_ has quit [Ping timeout: 276 seconds]
<[k-> the most painful way would be xslt
<[k-> wait a moment
<[k-> yorickpeterse has a library for that!
frem has quit [Quit: Connection closed for inactivity]
olistik has quit [Remote host closed the connection]
<shevy> yorickpeterse likes pain
<adaedra> MagePsycho: all your options http://awesome-ruby.com/#awesome-ruby-html-xml-parsing
jbw_ has joined #ruby
<adaedra> yorickpeterse would tell you to use oga, of course
<yorickpeterse> I don't do xslt
<yorickpeterse> nevah
<MagePsycho> shevy: mechanize comes with nokogir ight?
<shevy> it has a dependency on it
<shevy> btw MagePsycho you can check on the dependencies via browser too: https://rubygems.org/gems/mechanize
<shevy> then you can click on nokogiri
<shevy> Total downloads: 43,136,874
<[k-> or gem list
<shevy> many people like pain
<diegoviola> why do you guys torture yourself with xml?
<shevy> I don't!
<adaedra> why not?
<[k-> json or dea
<yorickpeterse> I quite like HTML
<shevy> why do you use windows diegoviola :)))
<yorickpeterse> it's quite elegant
<adaedra> Let's all do JSONx
<[k-> jsonx?
surs3 has quit [Quit: WeeChat 0.3.7]
<adaedra> look it up
<diegoviola> shevy: lol... blame my boss
* apeiros prefers jsonb
livathinos has quit [Read error: Connection reset by peer]
<shevy> oh good... there is also jsonc!
<adaedra> JSON is sometimes not enough
<apeiros> aaahaha, jsonx is *precisely* what I assumed it to be
<shevy> we get the whole alphabet covered
<[k-> oh fuck you
<diegoviola> shevy: but I have vbox in fullscreen, so I don't really "use" windows
<shevy> "JSONx is an IBM standard format to represent JSON as XML."
<adaedra> diegoviola: still windows.
<shevy> diegoviola I know you like to say that :)
<yorickpeterse> shevy: > IBM
<yorickpeterse> not surprising
<diegoviola> adaedra: I have Arch in fullscreen
<yorickpeterse> They're crazy enough to even run Node.js on their mainframes
<yorickpeterse> because that's totally going to use all those cores efficiently
<shevy> diegoviola it's like a vegetarian buying dead animals for the cat at home :)
swills has quit [Quit: leaving]
<yorickpeterse> No no no
<adaedra> shevy: no
<diegoviola> I know, I'll get a SATA to USB cable soon and I won't have to boot into windows anymore
<yorickpeterse> For the cat it's natural so it's totally ok
<adaedra> diegoviola: still windows under
<shevy> well my cat can't go shopping yet...
<diegoviola> adaedra: what?
<diegoviola> adaedra: with a sata-over-usb cable I won't have to boot into windows anymore
<diegoviola> adaedra: I will just plug to my SSD and boot arch
<shevy> see adaedra? he is not using windows!!!
<MagePsycho> how to print array in ruby
<adaedra> you're filling my screen with highlights?
<shevy> MagePsycho simplest way is: p array
<adaedra> MagePsycho: for debugging, p or pp
<diegoviola> shevy: I stopped using windows 15 years ago
<shevy> if you wish to output or modify, you can use .each and output then
<shevy> or rather .map for modify then
<MagePsycho> diegoviola: shevy: which OS you guys use
ta has quit [Remote host closed the connection]
<shevy> linux!
<shevy> shevyx
<diegoviola> shevy: write a shevyx in ruby
<shevy> windows gets too much into the way
<shevy> but in principle, ruby files should work just fine
rushed has joined #ruby
<diegoviola> MagePsycho: Linux
<diegoviola> MagePsycho: Arch
<yorickpeterse> oh oh oh
<MagePsycho> Mac OSX
<yorickpeterse> ?guys
<ruboto> we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
<shevy> diegoviola I once wanted, but it's so much work. I think these kind of things can not really be done by a single person... unless he is crazy, like that TempleOS dude
<[k-> yorickpeterse isn't a male :o
howdoicomputer has joined #ruby
<diegoviola> shevy: yeah I was kidding
<adaedra> shevy: there's a lot of custom oses other there
jespada has quit [Ping timeout: 252 seconds]
rbowlby has joined #ruby
<yorickpeterse> I identify as an airplane
<[k-> redstar os best os
surs has joined #ruby
<shevy> redhat?
<[k-> lies, flughafen is the airport here!
<adaedra> redhat != redstar os
<shevy> flughafen is still downed
surs has quit [Changing host]
surs has joined #ruby
<adaedra> shevy: osdev.org
<[k-> adaedra redstar os BEST OS
<shevy> adaedra there is no redstar on that page! :(
<flughafen> shevy: [k- the flughafen lives!!!!
<adaedra> shevy: no, that's for building your own system
<MagePsycho> which ruby editor you prefer everyone
<[k-> \o/!!!
<diegoviola> MagePsycho: vim
urbanmonk has quit [Quit: urbanmonk]
<MagePsycho> why not pycharm?
<flughafen> MagePsycho: vim
<MagePsycho> i love products from jetbrains
<shevy> I am not that experimental anymore... I kind of got lazy with linux
<MagePsycho> intellij phpstorm pycharm
<flughafen> i use eclipse for java
<shevy> "Red Star OS is a North Korean Linux-based operating system."
<flughafen> buyt maybe i should give eclim a try
<adaedra> MagePsycho: because some people prefer a lightweight editor to a full featured IDE
<shevy> [k- you are poking fun at the north korean hacker community here!
senayar has quit [Remote host closed the connection]
<adaedra> shevy: so, 0 people?
tvw has joined #ruby
<[k-> it's totes best os!
<[k-> do you even see a Linux os that looks half add gold
<[k-> as*
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
senayar has joined #ruby
<shevy> dunno, I guess in the capital city they may have some techies too
rbowlby has quit [Ping timeout: 256 seconds]
<shevy> [k- look at that man https://drbenjaminhabib.files.wordpress.com/2012/07/imgp5035.jpg how can Singapore compete here la!
<shevy> it's a PYRAMID
hotpancakes has joined #ruby
<[k-> WE HAVE A DURIAN
<shevy> we could ask ponga when he comes back, he was born in south korea
zeeraw has joined #ruby
bkxd has joined #ruby
<shevy> durian pancakes?
bkxd has quit [Client Quit]
pulgolino has joined #ruby
<shevy> the world wide web is full of craziness
Papierkorb has joined #ruby
<[k-> how dare you insult our great metropolitan city!
<[k-> durian is love!
uber has quit [Ping timeout: 246 seconds]
<[k-> durian is life!
<[k-> is that pyramid even earthquake proof
<shevy> lol
<shevy> [k- I think so, it's damn heavy
yalue has joined #ruby
tkuchiki has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<[k-> heavy != earthquake proof
<shevy> MagePsycho which editor do you use?
<MagePsycho> pycharm
hotpancakes has quit [Ping timeout: 255 seconds]
<shevy> haven't heard that one before
blackmes1 has joined #ruby
<MagePsycho> sorry thats for python
joonty has joined #ruby
<adaedra> it's the rubymine of python, shevy
senayar has quit [Remote host closed the connection]
<[k-> cough, Ruby ide...
senayar has joined #ruby
<MagePsycho> ReSharper
<[k-> avdi just wrote something about Ruby tooling!
<MagePsycho> which ide you use? i heard vim.. what else
joonty has quit [Client Quit]
<shevy> I don't use an IDE in ruby
<shevy> many people here use sublime editor
<shevy> I use bluefish 1.0.7!
<diegoviola> why would anyone use sublime
<[k-> sublime text*
<diegoviola> it's a paid app
<apeiros> because it's a good app, that's why
Toska has quit [Remote host closed the connection]
<diegoviola> apeiros: the thing is that it's not a good app
joonty has joined #ruby
<apeiros> diegoviola: the thing is - that's like your opinion.
<shevy> :)
tens0r has joined #ruby
<[k-> oooooo buuuuuurrrrnnnnnnnn
<shevy> he should stop to use windows!
<diegoviola> shevy: I use arch
* [k- pours apeiros a cup of cold tea
<shevy> although, notepad++ is quite ok
<MagePsycho> how to exit with message if there is any error
<maloik> I didn't even read avdi's post as if it was about tooling, more about the fact that we still work with ruby "despite" what others might see as a reason not to
blackmes1 has quit [Ping timeout: 248 seconds]
<[k-> `fail`
<Burgestrand> Abort.
<MagePsycho> nokogri seems great tool for parsing xml.. now i need to check if it doesn’t find xml to parse.. print error and exit
<[k-> but he wants a message
<maloik> sort of in the same way many people flock to "manual" ways of making coffee, or use record players despite the fact that they're annoying as you have to turn around the record
<MagePsycho> i only started ruby two days ago.. so veryvery new
<[k-> oh abort writes a message to stderr
krz has quit [Ping timeout: 244 seconds]
Muhannad has quit [Ping timeout: 265 seconds]
<[k-> MagePsycho do you want to terminate on error or just raise an error
<tuor> hi, I have a String: import = "<xml>...</xml>" and I do it looking better: nice_imput = Document.new import
<shevy> maloik when you write despite though, what alternatives were given to ruby?
jonathanwallace has joined #ruby
<tuor> this works fine. But how can I do exactly the oposite? I need first to do it readable and then again back into one string (with out any unneeded withe space)
<diegoviola> "Sometimes "pi = 3.14" is (a) infinitely faster than the "correct" answer and (b) the difference between the "correct" and the "wrong" answer is meaningless. And this is why I get upset when somebody dismisses performance issues based on "correctness". The thing is, some specious value of "correctness" is often irrelevant because it doesn't matter. While performance almost always matters. And I absolutely
<diegoviola> detest the fact that people so often dismiss performance concerns so readily." -- Linus Torvalds
<diegoviola> he seems to care more about performance than code readability, what are your thoughts on that?
olistik has joined #ruby
<apeiros> ?ot diegoviola
<ruboto> diegoviola, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<shevy> linus does not use ruby :(
<diegoviola> apeiros: ok sorry
<diegoviola> shevy: you can't write the linux kernel in ruby, can you?
<shevy> yeah
<shevy> there is even assembler code in the kernel
uber has joined #ruby
krz has joined #ruby
<t_> even?
<t_> even?!?!
<t_> ofc there is assembler in the the kernel
<t_> lol
<t_> and you dont want to write linux in ruby and ruby doesnt run natively on the hardware
<t_> so no
<diegoviola> there is also my typo patch merged in the linux kernel
hotpancakes has joined #ruby
<[k-> Linux in Ruby...
<t_> talk about bad ideas lol
<t_> programming is all about the right tool for the job
saintcajetan has quit [Ping timeout: 240 seconds]
<[k-> shevy uses Ruby for all the jobs
devbug has quit [Ping timeout: 244 seconds]
randiman has joined #ruby
saintcajetan has joined #ruby
<raddy> Hello Everybody
zacstewart has quit [Ping timeout: 256 seconds]
<raddy> I hope we can have multiple versions of ruby and passenger,
<raddy> Am i correct ?
<bougyman> we have tons of them
<bougyman> you are correct.
<yorickpeterse> bougyman: no longer running lighttpd?
<shevy> [k- the only valid complaint is that ruby is slow
<bougyman> yorickpeterse: i'm not?
dionysus69 has quit [Ping timeout: 255 seconds]
<[k-> >> $$/$$
<ruboto> [k- # => 1 (https://eval.in/396272)
<yorickpeterse> bougyman: I recall back in the Ramaze days at least everything for the Rubyists was using lighttpd
<[k-> pls
<bougyman> yorickpeterse: I still use lighty for myself.
<yorickpeterse> Ah
<bougyman> dayjob uses nginx
<shevy> I use lighty too!
<shevy> apache's config file change annoyed me so much that I switched
hotpancakes has quit [Ping timeout: 252 seconds]
<shevy> "Unlike in Ruby, using Python you can define instance variables or object attributes on the fly like this. This seems like a bit of interesting magic missing from Ruby."
<shevy> :(
arup_r_ has joined #ruby
stamina has quit [Ping timeout: 256 seconds]
randiman has quit [Quit: (null)]
<diegoviola> what terminal emulators do you guys use?
<shevy> bash in kde konsole
<sevenseacat> iterm
<shevy> roxterm is quite nice too
<bnagy> I am in <3 with iterm2
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<diegoviola> I'm using termite right now
Aderium has joined #ruby
<jhass> ?ot diegoviola
<ruboto> diegoviola, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
Limix has joined #ruby
<diegoviola> move yourself to #ruby-offtopic to keep this channel free of spam, thanks
<shevy> they just want to have more ruby questions!
arup_r has quit [Ping timeout: 265 seconds]
<diegoviola> sorry about that
<diegoviola> :)
<apeiros> wow, that sorry was quite well timed
<apeiros> I already had the !kick written diegoviola.
<sevenseacat> I woulda done it anyway
<[k-> much was anticipated
<shevy> lol
<shevy> this cat is a killer
<apeiros> sevenseacat: it's friday. I'm mellow.
erowlin has joined #ruby
rushed has quit [Quit: rushed]
tubuliferous_ has joined #ruby
<shevy> mice, rabbits, birds and spammers all fall prey
<sevenseacat> good call.
<erowlin> Hi ! is someone good at RSpec here ? I have a very basic question I think since I ‘m new at testing .
<apeiros> ?ask erowlin
<ruboto> erowlin, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
<erowlin> Ok Ruboto, will gist. Thx
lkba_ has quit [Remote host closed the connection]
klaas has quit [Read error: Connection reset by peer]
hashrocket has joined #ruby
<diegoviola> apeiros: why is asking about a terminal emulator not tolerated? I bet I could say that in #python and they won't cry too much
musty has quit [Remote host closed the connection]
<apeiros> diegoviola: if you want to have the discussion, have it in OT
<diegoviola> or do we have to ask about the stdlib only here?
<ljarvis> diegoviola: then go to python to discuss it
<shevy> erowlin ruboto is a bot by the way, just in case you are about to say thank you :)
<sevenseacat> cry? lol
<diegoviola> ljarvis: you go there
<ljarvis> those are the rules
<shevy> huh
<shevy> there is a rule to go to python?
<erowlin> Code here : https://gist.github.com/Erowlin/dc427693374aa75a3d27, Line 34, I’m looking to keep the ID of the DefinedPushMessage just created to check if I can find it on the next block, and if I can delete it properly in the other « it » block
<tuor> shevy, I have one. ;) Still don't know how to do it.
eGGsha has joined #ruby
<diegoviola> ok sorry about that
<sevenseacat> you keep saying that and you keep trolling anyway
<diegoviola> crying as in complaining about offtopic
<diegoviola> I'm not trolling
<apeiros> !kick diegoviola I said if you want to discuss those things, go to OT, I meant it.
diegoviola was kicked from #ruby by ruboto [I said if you want to discuss those things, go to OT, I meant it.]
<apeiros> enough.
<ljarvis> You've apologised a couple of times but continued. If you want to stop..
diegoviola has joined #ruby
<ljarvis> nevermind
<sevenseacat> hear hear.
edwinvdgraaf has quit [Remote host closed the connection]
<diegoviola> 5 hours later someone else will come here and ask a bunch of offtopic questions and nobody will raise a word, you guys are hypocrites
<ljarvis> ?guys
<ruboto> we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
tubuliferous_ has quit [Ping timeout: 256 seconds]
<erowlin> Cmon, why don’t you go in PV, some people like me need some help ;)
<apeiros> !ban diegoviola !T 1d permanently OT
diegoviola was banned on #ruby by ChanServ [diegoviola!*@*]
diegoviola was kicked from #ruby by ChanServ [Banned: permanently OT]
<ljarvis> "ya'll are hypocrites" was what I think you wanted
<ljarvis> erowlin: sorry, having a look
<erowlin> Thanks Ijarvis !
<ljarvis> it's an L, but no worries
<canton7> one day 'guys' will be defined as gender-neutral and everything will be ok...
<erowlin> I was wondering :)
<ljarvis> erowlin: basically, you can't/shouldn't do that.
<Burgestrand> erowlin: you are probably looking for a "before" block.
<ljarvis> erowlin: you should either group them into a new before/context block
<erowlin> What should I do ljarvis ?
<erowlin> ok
<erowlin> I’m looking at the before documentation
<erowlin> Thanks you Burgestrand !
<ljarvis> yeah that's a good start, I think you'll want to scope them with describe or context (whichever makes more sense for your usecase)
<erowlin> Is it a good thing to check if I can .find(id) just after the .save ?
<erowlin> I believe it’s useless no ?
<ljarvis> if you knew the save didn't fail, then probably
<erowlin> Ok
<ljarvis> right it's save! so yes
<erowlin> Except if I want to be sure that the find method is not overrided
<ljarvis> (it'll blow up if it failed to save)
dgutierrez1287 has quit [Remote host closed the connection]
<ljarvis> if the find method is overridden, you have the permission to find and kill whoever overrided it
<ljarvis> overrided
<erowlin> ahah
<ljarvis> works for me
<erowlin> true story
<Burgestrand> erowlin: how detailed you are in your tests is determined by what kind of level of confidence you want.
<erowlin> Yep
<Burgestrand> erowlin: you can test every line, every method, most of the time that's not very useful though, so you test the things that are important and leave the rest.
<erowlin> I just started with testing trying to do some TDD, but it’s hard. I think I take the worst case, I don’t trust other developpers and everything should be tested
<ljarvis> fwiw I think you're tests are looking great for a start. Very succinct
<ljarvis> your*
<ljarvis> but yeah you don't need to overtest
<erowlin> It’s a hard question I ask myself, what should I test and not ?
<erowlin> Thank you ljarvis
howdoicomputer has quit [Ping timeout: 255 seconds]
MichaelGG_ has joined #ruby
<raddy> Hello Everybody
troulouliou_dev has joined #ruby
bmurt has joined #ruby
lkba has joined #ruby
<tuor> I think my question is forgotten (because of some ot), so I repeate it: I have a string with xml in it. I can make it readable with REXML::Document.new "string", but how can i do exactly the oposit? (remove all unececery withespace and linebreaks)
bmurt has quit [Client Quit]
<ljarvis> erowlin: I think your spec would be a good unit test. I don't think it really needs to hit the database. Testing retrieval is probably overkill. Testing validity is good and you're already doing it. Testing delete/find directly is testing something your orm will already cover
a346 has joined #ruby
<ljarvis> ?code tuor
<ruboto> tuor, We can't help you without your code, please post it to https://gist.github.com
<MagePsycho> dbRepairUrl -> db_repair_url
<raddy> PassengerRuby /usr/bin/ruby , But still ruby intrepret shows as /usr/local/rvm/wrappers/ruby-1.9.3-p448/ruby
<raddy> Can anybody help me ?
<Burgestrand> erowlin: personally I usually don't directly test code that isn't mine.
<erowlin> Ok I understand
<ljarvis> raddy: try #passenger
<raddy> which ruby shows /usr/bin/ruby as well
<erowlin> I will just remove find and all ORM related tests
<Burgestrand> erowlin: I will indirectly exercise code that isn't mine, but I don't write explicit tests for them. For example I wouldn't have written the test for.delete.
<raddy> Nobody is responding there
<erowlin> you’re right
<ljarvis> raddy: for a start, changing PassengerRuby isn't going to set the Ruby in your terminal session
<erowlin> Thank you for your indications :).
<erowlin> *all
<ljarvis> raddy: it'll set the interpreter path for the passenger process
<Burgestrand> erowlin: like ljarvis said though, you're doing good.
<erowlin> Thank you !
<erowlin> Want to hire me ?
<erowlin> :P
<Burgestrand> erowlin: just keep in mind that every test you write has a cost in 1) time to run and 2) time to maintain.
<raddy> ljarvis : I know about the command.
<shevy> tuor if you wanna remove all linebreaks you could always do a .gsub(/\n/,' ') or something like that
<erowlin> Yep
<erowlin> We have to setup CI
<Burgestrand> erowlin: hehe, I'm about to start looking for a new place to work myself so no. ;)
<Burgestrand> (changing cities)
<erowlin> I have a good place in Paris if you’re looking for an awesome job
<tuor> shevy, ok. I'll paste the code. One moment please. ;)
<[k-> dat disclosure
<Burgestrand> erowlin: thanks, but not quite that far, I'm moving to Stockholm.
<erowlin> Nice !
<erowlin> BTW, thank you all, have a nice day
bmurt has joined #ruby
<Burgestrand> erowlin: you too.
Rollabunna has joined #ruby
aryaching has joined #ruby
quimrstorres has quit [Remote host closed the connection]
<white_bear_> is it possible to reference variables indirectly, like ${!foo_*} in bash will match all foo_* variables?
joelataylor has quit [Ping timeout: 248 seconds]
<raddy> ljarvis : Can you please check this link ? https://groups.google.com/forum/#!topic/phusion-passenger/38EeHPgKpoo
<bougyman> white_bear_: not that way
<apeiros> white_bear_: no. and don't abuse variables as a hash.
<bougyman> but there is a awy
arup_r_ has quit [Remote host closed the connection]
joelataylor has joined #ruby
<ljarvis> raddy: sorry I don't do passenger so probably won't be able to help much further
<apeiros> white_bear_: the things which exist are in Object, Module and Binding for the various variable types
<[k-> and Kernel#global_variables
<white_bear_> ah yeah
<apeiros> [k-: there are no global variables.
Rollabunna has quit [Ping timeout: 248 seconds]
* apeiros pretends they don't exist
<[k-> buuuuut
<Burgestrand> ?help
<ruboto> You can find an overview of my commands at http://ruby-community.com/ruboto/commands
* ljarvis throws a $_ at apeiros
* apeiros doesn't notice a thing
<[k-> there is trace for globals even!
<shevy> we can trace them!
<Burgestrand> tuor: so you want to minify the XML?
<ljarvis> $apeiros
* apeiros sees nothing
<white_bear_> bougyman: looping through all data types (Object, Module and Binding, as mentioned above) and using reflection?
rodfersou has quit [Quit: leaving]
lavros has joined #ruby
tens0r has quit [Quit: tens0r]
jespada has joined #ruby
mesamoo has quit [Ping timeout: 248 seconds]
chipotle has joined #ruby
bungoman has joined #ruby
<ljarvis> D:
rbennacer has joined #ruby
<tuor> Burgestrand, yes.
whippythellama has joined #ruby
<maloik> "Can you just make sure that X can NEVER EVER happen? And then add a checkbox 'exception' on the form"
<maloik> (tableflip)
rbennacer has quit [Remote host closed the connection]
Limix has quit [Quit: Limix]
zacstewart has joined #ruby
aryaching_ has joined #ruby
rippa has joined #ruby
<MagePsycho> how to get current working directory in ruby
<MagePsycho> mageDir = `$PWD`
<MagePsycho> puts "#{mageDir}/app/etc/local.xml"
<MagePsycho> doesn’t work
<white_bear_> Dir.pwd
<MagePsycho> i am working on ruby console script
riotjone_ has quit [Remote host closed the connection]
chipotle has quit [Ping timeout: 256 seconds]
decoponio has joined #ruby
<apeiros> maloik: business as usual?
<apeiros> I could fill a book which such cases.
<maloik> so could I, that's exactly the problem
mesamoo has joined #ruby
<MagePsycho> whippythellama: thats works :) thanks
<maloik> no matter how much I push back that stuff keeps on coming and they never learn :(
<MagePsycho> white_bear_: thats works thanks man
<apeiros> should they learn?
chouhoulis has joined #ruby
<adaedra> learn what?
<apeiros> I've changed to just explaining the cost
aryaching has quit [Ping timeout: 255 seconds]
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<white_bear_> MagePsycho: np
<apeiros> and if they're ready to pay the price, then well, they can have their edge cases
Toska has joined #ruby
Zinja has joined #ruby
<MagePsycho> loving ruby really.. such a neat and clean compared to php
<apeiros> while it annoys the purist in me - the rest is now "so what? I'm paid to solve their problems"
psy_ has quit [Ping timeout: 250 seconds]
<apeiros> MagePsycho: `pwd` certainly works. but don't forget that it comes with a newline. but as white_bear_ already said, Dir.pwd (or .getwd) is better.
mjuszczak has joined #ruby
<Burgestrand> tuor: I don't think REXML supports XML canonicalization, but Nokogiri does.
blackmes1 has joined #ruby
<Burgestrand> s/supports/implements/
<adaedra> I don't want to work v_v
olistik has quit [Remote host closed the connection]
<MagePsycho> apeiros: yeah i noticed that
failshell has joined #ruby
Limix has joined #ruby
prettiestPony11 has joined #ruby
* [k- gives adaedra a hug
<[k-> there there
<yorickpeterse> REXML is shit
<adaedra> oga is life, oga is love
<yorickpeterse> it's ok
<[k-> so modest :p
mando has joined #ruby
<maloik> apeiros: I dunno, I'm just really annoyed because it makes understanding the entire system so much harder
Rollabunna has joined #ruby
<apeiros> maloik: I fully understand that. I feel the same. exceptions to rules are the death of understandability and maintainability
arup_r has joined #ruby
<apeiros> so that's what I make sure to explain them. and I'm somewhat sure that despite my best efforts, they don't fully understand the cost of their wishes. but so be it.
rbennacer has joined #ruby
<[k-> you mean python?
arup_r_ has joined #ruby
hakunin has joined #ruby
<apeiros> adaedra: it's friday. week-end is coming.
xkef_ has quit [Ping timeout: 265 seconds]
psy_ has joined #ruby
blackmes1 has quit [Ping timeout: 255 seconds]
skade has quit [Quit: Computer has gone to sleep.]
<ljarvis> it's here!
* ljarvis throws beer everywhere
<ljarvis> I have achieved quite little today
<sevenseacat> i've done the exercises from chapter 14 and most of 15 of programming elixir. progress.
eGGsha has quit [Quit: Textual IRC Client: www.textualapp.com]
xkef has joined #ruby
<shevy> this is an elixir-loving cat
<ljarvis> nice one sevenseacat
<ljarvis> I am also enjoying Elixir
paulcsmith has joined #ruby
<[k-> I have somewhat grasp monads
<[k-> do I get an award
<Burgestrand> Maybe.
<shevy> Never.
<[k-> hah.
<adaedra> apeiros: I know! If only it came quicker!
arup_r has quit [Ping timeout: 244 seconds]
<Burgestrand> Just Maybe.
<apeiros> adaedra: it comes with 1s/s!
<[k-> :>
hotpancakes has joined #ruby
<adaedra> apeiros: but relativity!
<[k-> I only remember 1 monad law I think
<sevenseacat> i'm nowhere up to that level yet
<adaedra> it's known, saturday comes after friday way slowler than monday comes after sunday
* sevenseacat has been trying to figure out how to rotate a list
<MagePsycho> p array works great.. i thought one is joking
bungoman has quit [Remote host closed the connection]
<shevy> caturday!
jespada has quit [Ping timeout: 264 seconds]
<[k-> Array#rotate
<shevy> MagePsycho it's just a very short method name
<adaedra> RotationFactory
bungoman has joined #ruby
segfalt has joined #ruby
<shevy> MagePsycho here is the documentation: http://ruby-doc.org/core-2.2.2/Kernel.html#method-i-p
<shevy> apparently it invokes obj.inspect()
mesamoo has quit [Quit: Konversation terminated!]
raddy has left #ruby [#ruby]
<[k-> AbstractCollectionRotationFactory
<tuor> Burgestrand, ah ok. thx.
zeeraw has joined #ruby
JoshL has joined #ruby
<adaedra> MagePsycho: there is also pp, which tries to format a bit (require 'pp'; pp object)
jpfuentes2 has joined #ruby
<[k-> we should omit parentheses!
<Aderium> Ok so
<shevy> [k- you are in such a good mood today
<shevy> lack of homework right?
prettiestPony11 has quit [Quit: Textual IRC Client: www.textualapp.com]
<[k-> :o you are amazingly accurate!
hotpancakes has quit [Ping timeout: 265 seconds]
<[k-> I do have some homework but I'm lazy :p
<Aderium> If someone can give me some pointers :) I have downloaded the ruby source 2.1.6 on Solaris 11.2
<adaedra> void * p
<Toska> Aderium: You won't need to worry about the pointers in ruby.
<shevy> lol
mrconfused has joined #ruby
<Aderium> yesterday when looking at RVM scripts we have discovered that the way RVM looks for the arch hardware is rather inapproriate for Solaris and was always giving back i386
bungoman has quit [Ping timeout: 246 seconds]
Timba-as has joined #ruby
mando has quit [Ping timeout: 256 seconds]
<Aderium> tthat is it was looking at uname instead of isaifno
<shevy> are you sure this is just related to RVM and not the ruby source directly?
xkef has quit [Ping timeout: 244 seconds]
xlogic has joined #ruby
<Aderium> now I am discovering something wimilar with ruby during the configuration phase
fantazo has quit [Ping timeout: 256 seconds]
<Aderium> checking build system type... i386-pc-solaris2.11
<Aderium> checking host system type... i386-pc-solaris2.11
<Aderium> checking target system type... i386-pc-solaris2.11
<[k-> ?gist
<ruboto> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<Aderium> one sec
<shevy> who else is using solaris here!
<MagePsycho> one question.. if function is defined below the caller
<MagePsycho> what happens
<sevenseacat> try it and see.
ta has joined #ruby
<[k-> it doesn't work
<sevenseacat> pretty easy to test!
<shevy> MagePsycho best way is to define everything upfront before calling anthing
<[k-> Ruby is not compiled, it is interpreted
<[k-> it just throws an error when it sees one
<Aderium> the issue is in uname -m = i86pc
<Aderium> it really should check for isainfo -k
sarkyniin has joined #ruby
<shevy> hmm can't you patch this ad-hoc?
<Aderium> yeah where do I do so ?
<MagePsycho> cool
<Aderium> need to know what file to nano
<MagePsycho> can anyone help .. how to wrap this ina function: https://gist.github.com/MagePsycho/d3b13bea24e4d5c5ea1a
<shevy> not entirely sure, I hate those configure.ac* magic thingies :D
<MagePsycho> dpeth is unknow.. so whenever a continue button is found i need to submit the form: form.submit(form.button_with(:id => "button-continue"))
charliesome has joined #ruby
<MagePsycho> how to do this recursively or using some kinda loop
<shevy> Aderium is the wrong "uname" entry in the Makefile?
mrconfused has quit [Ping timeout: 250 seconds]
<Aderium> the issue is that in Solaris 11.2 it is incorrect to use uname to detect the system and the loaded kernel bits
<shevy> aha
<Aderium> isainfo -k should be used
<Aderium> so I am looking in the where in the source I should ad hoc to use correct app
<shevy> yeah let's see
<shevy> I assume that perhaps it comes from: tool/config.guess:# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
jespada has joined #ruby
rbennacer has quit [Remote host closed the connection]
<Aderium> btw how do you clean a previous configure ?
<shevy> configure.in:AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
<shevy> "make distclean" should work or "make clean", but perhaps you may have to re-run autoconf
<Aderium> make: Fatal error: Don't know how to make target `distclean'
<shevy> like sh autogen.sh ... or autoreconf something
<shevy> tried make clean as well?
<Aderium> same thing
<shevy> huh
<shevy> works for me, though I did not have any error during configure so perhaps it did not generate any important files since it broke early for you
<Aderium> k cleaned :)
<MagePsycho> :(
hanyn has joined #ruby
hanynowsky has quit [Read error: Connection reset by peer]
<Aderium> alright so where do I nano ? tool/config.guess ?
<shevy> "autoconf" also could be tried, but first you have to find that weird entry where uname is used rather than isainfo
<shevy> not sure! still looking...
xkef has joined #ruby
haneen has joined #ruby
rbennacer has joined #ruby
<shevy> well
<shevy> I can see several lines here:
<shevy> tool/config.guess:uname -m = `(uname -m) 2>/dev/null || echo unknown`
<shevy> and more uname - entries
<shevy> tool/config.guess:UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
<shevy> so I assume that one seems to be a likely candidate for your 4 uname lines that are all wrong
<shevy> perhaps that file is generic though :\
<Aderium> let me check
<adaedra> er
serivich has joined #ruby
gard has joined #ruby
<adaedra> usually, these kind of things allow to specify architecture manually, if it's your issue
<shevy> hopefully! then he could just replace those uname entries
<shevy> there is some case handling... like line 349 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
<shevy> they definitely want to use UNAME :)
<Aderium> ok so ad hoc 1 UNAME_MACHINE=`(isainfo -n) 2>/dev/null` || UNAME_MACHINE=unknown
eggoez has quit [Ping timeout: 240 seconds]
hanyn has quit [Ping timeout: 252 seconds]
<Aderium> 349 is ok
lolmaus_ has quit [Quit: Konversation terminated!]
silkfox has joined #ruby
drewvanstone has joined #ruby
arturmartins has quit [Quit: Leaving...]
JakFrist has joined #ruby
erowlin has quit [Quit: erowlin]
olistik has joined #ruby
v0n has joined #ruby
eggoez has joined #ruby
devdazed has joined #ruby
livathinos has joined #ruby
mando has joined #ruby
jonathanwallace has quit [Quit: Leaving.]
<MagePsycho> is this fair enough for the function implementation: https://gist.github.com/MagePsycho/d3b13bea24e4d5c5ea1a
<[k-> Logger pls
brotspinne has joined #ruby
livathinos has quit [Client Quit]
<Aderium> checking build system type... tool/config.guess: unable to guess system type
<[k-> ruby convention: snake_case
drewvanstone has quit [Client Quit]
<adaedra> Fix your indent yo
<[k-> indentation pro----
<[k-> I was going to say that!
Igorshp has quit [Remote host closed the connection]
<Aderium> so the UNAME_MACHINE = amd64 is correct but somewhere else its still using uname
<adaedra> `:id => xxx` can be written `id: xxx`
bahar has quit [Changing host]
bahar has joined #ruby
haxrbyte_ has joined #ruby
olistik has quit [Ping timeout: 264 seconds]
<[k-> :id => is backwards compatible!
enebo has joined #ruby
senayar has quit [Remote host closed the connection]
<adaedra> `` is to be used when you want to get output back from process – if your goal is just to run it, there are better ways
olistik has joined #ruby
<adaedra> [k-: Backward compatibility with 1.8 can go meet me in hell
<MagePsycho> just the implementation of function
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
<Burgestrand> TIL NotImplementedError is not a StandardError.
<[k-> ;)
Igorshp has joined #ruby
<[k-> it's a runtimeerror I guess
<[k-> also, your code is not DRY
<Burgestrand> No, RuntimeError is a StandardError.
<[k-> especially the last few lines
<[k-> :o
<Burgestrand> >> raise NotImplementedError rescue nil
<ruboto> Burgestrand # => NotImplementedError (NotImplementedError) ...check link for more (https://eval.in/396314)
revath has quit [Ping timeout: 264 seconds]
senayar has quit [Remote host closed the connection]
<Burgestrand> >> raise "runtime" rescue nil
<ruboto> Burgestrand # => nil (https://eval.in/396315)
senayar has joined #ruby
bungoman has joined #ruby
haxrbyte has quit [Read error: Connection reset by peer]
enebo has quit [Client Quit]
evanjs has joined #ruby
evanjs has quit [Remote host closed the connection]
poguez_ has joined #ruby
skyrocker has joined #ruby
j_mcnally has joined #ruby
skyrocker has left #ruby [#ruby]
<MagePsycho> [k-: was that for me?
MatrixBridge has quit [Read error: Connection reset by peer]
haxrbyte has joined #ruby
<[k-> yes
MatrixBridge has joined #ruby
tagrudev has quit [Remote host closed the connection]
Sehryn has joined #ruby
zacstewart has quit [Remote host closed the connection]
IrishGringo has joined #ruby
senayar has quit [Remote host closed the connection]
erowlin has joined #ruby
senayar has joined #ruby
lxsameer has quit [Quit: Leaving]
mesamoo has joined #ruby
<MagePsycho> so rubby convention is to use snake case for both variable and function?
hinbody has joined #ruby
momomomomo has joined #ruby
<adaedra> yes
but3k4 has joined #ruby
axl__ has joined #ruby
<adaedra> and CamelCase for classes/modules names
haxrbyte_ has quit [Ping timeout: 256 seconds]
<adaedra> and UPPERCASE for constants
jonathanwallace has joined #ruby
<MagePsycho> good to know
<MagePsycho> [k: can you explain when you say: Logger pls
yeticry has quit [Read error: Connection reset by peer]
quimrstorres has joined #ruby
j_mcnally has quit [Ping timeout: 248 seconds]
juanpablo_ has joined #ruby
<[k-> A logger is a dedicated object that will handle outputting messages (information, debug, warnings, errors) to a file/descriptor
<MagePsycho> [k-: any example
but3k4 has quit [Client Quit]
but3k4 has joined #ruby
tkuchiki has joined #ruby
<konsolebox> anyone using camel-case for functions, attributes and variables? (i don't of course)
<[k-> Logger.error "Unexpected value: -3"
quimrstorres has quit [Remote host closed the connection]
<yorickpeterse> konsolebox: Ruby standard is snake_case for methods/variables/etc
quimrstorres has joined #ruby
<konsolebox> yorickpeterse: yes i just wonder if anyone does
<yorickpeterse> and PascalCase for constants
werelivinginthef has joined #ruby
edwinvdgraaf has joined #ruby
but3k4 has quit [Client Quit]
zacstewart has joined #ruby
evanjs has joined #ruby
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
j_mcnally has joined #ruby
duggiefresh has joined #ruby
bruno- has joined #ruby
zeeraw has joined #ruby
arturaz has quit [Ping timeout: 256 seconds]
<MagePsycho> fp = File.new("#{mageDir}/var/dp-repair-tool-#{mageVersion}.html", "a+") -> why the new file is not being created
koos303 has joined #ruby
scripore has joined #ruby
<MagePsycho> puts "#{mageDir}/var/dp-repair-tool-#{mageVersion}.html" -> shows correct value
gard has quit [Ping timeout: 248 seconds]
<[k-> does the file exist before the method call?
charliesome has quit [Quit: zzz]
c355E3B has joined #ruby
arup_r_ has quit []
bungoman has quit [Remote host closed the connection]
zeeraw has quit [Client Quit]
victortyau has joined #ruby
nathanstitt has joined #ruby
<MagePsycho> nope
tkuchiki has quit [Remote host closed the connection]
Toska has quit []
<MagePsycho> should it supposed to create on the fly
bungoman has joined #ruby
NeverDie has joined #ruby
charliesome has joined #ruby
Timba-as has quit [Quit: Be back later ...]
bffff_ has joined #ruby
<MagePsycho> [k-: sorry that works but folder is not beiing created
<MagePsycho> only file is created
edwinvdgraaf has quit [Remote host closed the connection]
<MagePsycho> how to create folder as well if that doesn’t exist
<adaedra> FileUtils.mkdir
surs1 has joined #ruby
edwinvdgraaf has joined #ruby
<[k-> adaedra to the rescue!
Aswebb_ has quit [Remote host closed the connection]
ta has quit [Remote host closed the connection]
edwinvdg_ has joined #ruby
<shevy> MagePsycho make sure to do require 'fileutils' on the top
surs has quit [Ping timeout: 246 seconds]
dopie has joined #ruby
ta has joined #ruby
blackmes1 has joined #ruby
chthon has joined #ruby
<MagePsycho> does order matter? before require mechanize or after?
<[k-> it shouldn't matter
sshuff has joined #ruby
<MagePsycho> didn’t work No such file or directory -
sigurding has quit [Quit: sigurding]
<[k-> (in this case)
<[k-> ?context
<ruboto> Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
<MagePsycho> fp = File.new("#{mageDir}/var/dp-repair-tool/#{mageVersion}-result.html", "a+")
pullphinger has joined #ruby
chipotle has joined #ruby
edwinvdgraaf has quit [Ping timeout: 256 seconds]
<MagePsycho> dp-repair-tool folder doesn’t exist.. i want to create that folder as well and also the file (in case of file only it works)
russellw has joined #ruby
<[k-> ?code
<ruboto> We can't help you without your code, please post it to https://gist.github.com
Soda has joined #ruby
revath has joined #ruby
<brotspinne> MagePsycho: look at FileUtils.mkdir_p and FileUtils.touch
<shevy> MagePsycho put your requires on top of a file usually
randiman has joined #ruby
leonardoajim has joined #ruby
blackmes1 has quit [Ping timeout: 244 seconds]
<shevy> create the directory before creating the file in it
<MagePsycho> i don’t want manual creation of file, i am looking for alternative of mkdir -p /any/path/
<shevy> you can check if a file exists via: if File.exist? file_here; and File.directory? whether a directory exists
<shevy> yeah that is .mkdir_p
<brotspinne> MagePsycho: there is no alternative
<yorickpeterse> hahahah, fucking ActionCable of course has a Base class
blackmes1 has joined #ruby
<yorickpeterse> it's like they never learn
<sevenseacat> :P
allomov has quit [Remote host closed the connection]
<Aderium> can anyone tell me what s iconrrect here ? https://gist.github.com/CirrusThink/51bda73b7e3df66cffd3
erowlin has quit [Quit: erowlin]
<momomomomo> Aderium: !ask
kies^ has joined #ruby
RegulationD has joined #ruby
<momomomomo> Aderium: ?ask
togdon has joined #ruby
<Aderium> ?
<momomomomo> where's this bot
ta has quit [Remote host closed the connection]
<momomomomo> Aderium: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
<adaedra> momomomomo: command first, target after
<adaedra> ?bot momomomomo
<ruboto> momomomomo, I don't know anything about bot
iateadonut1 has quit [Quit: Leaving.]
<momomomomo> ?Aderium ask
<ruboto> ask, I don't know anything about Aderium
<momomomomo> ugh stupid bot
<shevy> lol
<ljarvis> ?ask Aderium
<ruboto> Aderium, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
<shevy> someone is botfailing here!
<brotspinne> Aderium: it says "configure: error: cannot guess build type; you must specify one" this is wrong
<Aderium> I am not a bot, not sure what that means
<shevy> yeah momomomomo he is not a bot!
<momomomomo> still doesn't give the correct response
<ljarvis> momomomomo: ?command [user]
<momomomomo> Aderium: read the link I posted
<momomomomo> right, but it doesn't have one of the most frequently used commands
<Aderium> just trying to detect where to make the correct changes so that ruby can correctly recognize in Solaris 11.2 that it is a amd64 system
<momomomomo> which is a silly oversight
jhn has joined #ruby
<ljarvis> i dont understand what you mean
drewo has joined #ruby
<Aderium> unfortunately the source indicated the miss use of the uname command which is incorrect in Solaris
chipotle has quit [Ping timeout: 264 seconds]
<MagePsycho> shevy: FileUtils.mkdir_p "#{dbRepairLogDir}"
<MagePsycho> fp = File.new("#{dbRepairLogDir}/#{mageVersion}-result.html", "a+")
<shevy> case "${UNAME_SYSTEM}" in
<shevy> the shell script has that
<shevy> what is the value of UNAME_SYSTEM there?
<MagePsycho> shevy: that works :)
<MagePsycho> thanks a ton
Igorshp has quit [Remote host closed the connection]
<shevy> sorry
<shevy> wrong case
Burgestrand has quit [Quit: Burgestrand]
<shevy> I hate shell scripts
<momomomomo> I love them
<shevy> I assume it must be this value:
<shevy> case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}"
jimmythehat has quit [Ping timeout: 248 seconds]
<shevy> so I guess that, whatever it is returning for these, that case is not handled by that gigantic shell case menu
JMoir has joined #ruby
<shevy> that spans around 1000 lines ...
abuzze has quit [Remote host closed the connection]
MichaelGG_ is now known as MichaelGG
momomomomo_ has joined #ruby
msnyon has joined #ruby
<Aderium> Yeah I went thorugh them but I cant seem to see where for a solaris != sparc it uses the uname command which I need to substitute with isainfo
<shevy> hmm
<Aderium> or maybe can I in the ./configure just state it ?
<Aderium> like -- somthing
<shevy> you can try that
mando has quit [Ping timeout: 256 seconds]
<Aderium> whats the correct command ? i dont know
<shevy> nono, I think you can just edit "configure" perhaps
yihsiaol has joined #ruby
<shevy> # Name of the host.
<shevy> ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
fantazo has joined #ruby
tubuliferous_ has joined #ruby
<shevy> awww
<Aderium> in configure ?
<shevy> yeah
<MagePsycho> shevy: why you hate shell scripts, this script is part of my shell script :)
<shevy> it's hardcoded there though
<shevy> uname -m = `(uname -m) 2>/dev/null || echo unknown`
jimmythehat has joined #ruby
<shevy> MagePsycho I find them an unreadable and unbearable mess
neredsenvy has joined #ruby
<MagePsycho> from shell script i will be calling ruby script for web form submisstion
senayar has quit [Remote host closed the connection]
<MagePsycho> shevy: if you follow some boilerplate then it will be interesting
Igorshp has joined #ruby
momomomomo has quit [Ping timeout: 250 seconds]
momomomomo_ is now known as momomomomo
senayar has joined #ruby
pfish has joined #ruby
<shevy> Aderium I think the more sustainable way would be to modify the part wherever that uname creeps into configure, and run autoreconf; it should be either configure.ac or configure.in
<Aderium> already modified line 1393 with uname -m = `(isainfo -n) 2>/dev/null || echo unknown` so its somewhere else
chinmay_dd_ has joined #ruby
<MagePsycho> of course ruby does much more than shell thats why chef cookbooks are there
chinmay_dd has quit [Read error: Connection reset by peer]
<shevy> here is my configure: https://goo.gl/rPw0yu
<shevy> Aderium yeah there are several uname entries
theahindle is now known as THEahindle
chinmay_dd_ is now known as chinmay_dd
<neredsenvy> I run my ruby/json parser script it throws an error in console but since it outputs the contents of json file as well (not by my request) it only shows last two lines of the exception. So I don't know exactly what went wrong.
<neredsenvy> How can I fix this ?
<Aderium> ok did that
<shevy> all those lines here:
<shevy> uname -m = `(uname -m) 2>/dev/null || echo unknown`
senayar has quit [Remote host closed the connection]
<shevy> uname -r = `(uname -r) 2>/dev/null || echo unknown`
<Aderium> configure.in:698: warning: underquoted definition of RUBY_TRY_CFLAGS
<Aderium> configure.in:698: run info '(automake)Extending aclocal'
senayar has joined #ruby
<shevy> well that is just a warning
josh has joined #ruby
josh is now known as brain_shim
<russellw> Does anyone know how to get hold of conftest.c while building Ruby on Windows? http://stackoverflow.com/questions/31321321/building-ruby-on-windows-and-conftest-c
<pfish> anyone know why editing gc.c would stop verconf.h from being created.
A205B064 has joined #ruby
<pfish> alternatly where and how is verconf.h created
<shevy> Aderium, I think the case entry does not handle these four cases:
<shevy> uname -m = amd64, uname -r = 5.11, uname -s = SunOS, uname -v = 11.2
<shevy> right?
tubuliferous_ has quit [Ping timeout: 256 seconds]
<shevy> checking build system type... tool/config.guess: unable to guess system type
<shevy> cat >&2 <<EOF $0: unable to guess system type <--- that is the error you get I assume
mary5030 has joined #ruby
<shevy> you have 4 values: case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
<shevy> can you find out the 4 values of these?
mary5030 has quit [Remote host closed the connection]
zeeraw has joined #ruby
<shevy> especially the second one
<Aderium> those should be correct
mary5030 has joined #ruby
<shevy> ok but what is the value of UNAME_SYSTEM exactly
<Aderium> I think the issue is this one Machine = i86pc
jhn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
joelataylor has quit [Quit: Be back later ...]
<shevy> well there is one handle for that
<shevy> i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
<Aderium> what line number is that ?
<shevy> so it ignores the last entry, but checks on the other 3
jtdoncas has joined #ruby
<Aderium> ah so you are statically putting in i386 ?
<shevy> that's not my code :)
<shevy> but that is how bash should handle case menus
<Aderium> well yeah you as in uby sorry
<shevy> ruby has case/when too
<shevy> I have no idea what is returned on your system sorry, I have never used solaris
i8igmac has quit [Ping timeout: 256 seconds]
mrconfused has joined #ruby
havenwood has joined #ruby
Limix has quit [Quit: Limix]
<shevy> do you have your link to the ruby bug tracker?
<chris2> shevy: replace old config.guess simply with new ones
<Aderium> uname -a
<Aderium> SunOS us02.dollydrive.com 5.11 11.2 i86pc i386 i86pc Solaris
<Aderium> isainfo -v
<Aderium> 64-bit amd64 applications
<Aderium> avx xsave pclmulqdq aes sse4.2 sse4.1 ssse3 popcnt tscp ahf cx16 sse3
<Aderium> sse2 sse fxsr mmx cmov amd_sysc cx8 tsc fpu
<Aderium> 32-bit i386 applications
<Aderium> avx xsave pclmulqdq aes sse4.2 sse4.1 ssse3 popcnt tscp ahf cx16 sse3
<Aderium> sse2 sse fxsr mmx cmov sep cx8 tsc fpu
<MagePsycho> this is my final script: https://gist.github.com/MagePsycho/2d1aec63ece20c654d93
<shevy> uname -a seems to work doesn't it?
<MagePsycho> i am going to write a article
<Aderium> isainfo -n
mando has joined #ruby
skade has joined #ruby
<Aderium> uname -a spits out incorrect info
<Aderium> and ruby then alays compiles in i386
<shevy> MagePsycho now that is better but in ruby it is common to use lowercased method names
<Aderium> isainfo gives the correct info
<shevy> Aderium aha
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<MagePsycho> shevy: yeah .. i am getting used to.. i have noted that
JMoir has quit [Ping timeout: 256 seconds]
<shevy> aha nobu and others replied: https://bugs.ruby-lang.org/issues/11342
IrishGringo has quit [Ping timeout: 248 seconds]
Scroff has quit [Remote host closed the connection]
<Aderium> I started that bug ....
<MagePsycho> shevy: if you have time someday.. i would like to have how you gonna re-factor it and share with me
riotjones has joined #ruby
<Aderium> that is a 2.2.2 issue
<shevy> Aderium yeah and two core devs responded already \o/ :D
JMoir has joined #ruby
<Aderium> yeah tested the solution and no go
<shevy> MagePsycho ack! it's your code!
<MagePsycho> shevy: i think i should add usage :)
<shevy> MagePsycho yes, add --help option
<shevy> "This script supports the following options:"
<MagePsycho> any sample?
unshadow_ has joined #ruby
<havenwood> mm
<MagePsycho> i know how to do in shell
<adaedra> MagePsycho: if you used optparse, it should help you with that
<shevy> Aderium, it seems as if from that script, it returns: UNAME_MACHINE = amd64
<shevy> so amd64 is the first entry right?
<shevy> I don't see many handles for that in the case menu
<shevy> so I assume it falls through, then reports that it can not guess anything
<Aderium> Yeah
<shevy> only amd64 one I see is this one:
<shevy> amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
revath has quit [Ping timeout: 250 seconds]
<shevy> but that can not match because you have no CYGWIN second, you should have SunOS second, or something like that
<adaedra> MagePsycho: look at the documentation, it has an example of handling --help
<shevy> perhaps just try to add the same option, but with a leading amd64 part?
Channel6 has joined #ruby
ddarkpassenger has joined #ruby
Kully3xf has joined #ruby
<shevy> i86pc:SunOS:5.*:* | amd64:SunOS:5.*:* | i86xen:SunOS:5.*:*)
<shevy> can this be right? hmmm
Scroff has joined #ruby
<Aderium> I can try
unshadow has quit [Ping timeout: 255 seconds]
<shevy> btw even if this does not work, give nobu some more feedback, he understands those scripts :)
hotpancakes has joined #ruby
blaines has joined #ruby
<Aderium> thank you let me test it
<Aderium> then irun autoconf ?
revath has joined #ruby
mjuszczak has quit []
<Aderium> ok that worked
erowlin has joined #ruby
<Aderium> we are moving along but still something not right
<shevy> it worked?
<havenwood> shevy: \o/
hotpanca_ has joined #ruby
blaines_ has joined #ruby
omegamike has joined #ruby
<shevy> keep good track of the errors you get Aderium
<shevy> so that nobu can change the build system lateron
<havenwood> nice, new error
ItSANg___ has quit [Read error: Connection reset by peer]
<Aderium> Will do
ItSANgo_ has joined #ruby
<Aderium> ok looks like now its a compiler thing
<Aderium> not sure why its looking for C , should all go gcc
<shevy> havenwood lol
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
erowlin has quit [Client Quit]
tjohnson has joined #ruby
sharpmachine has joined #ruby
hotpancakes has quit [Ping timeout: 248 seconds]
<havenwood> shevy: New error is great here. Got past the socket problem from yesterday! :)
ta has joined #ruby
<shevy> Aderium not sure whether autoreconf can work here, probably one has to modify configure.ac or something...
blaines has quit [Ping timeout: 255 seconds]
theery has joined #ruby
IrishGringo has joined #ruby
<shevy> configure still has those hardcoded uname entries right? and you say that these are wrong so perhaps autoreconf it can not work because of that
<Aderium> I think the issue now is that its looking for a C compiler and not a gcc ?
<shevy> I think that is just a generic error message
<shevy> checking whether the C compiler works... no
<shevy> does not really tell you what the problem is
j_mcnally has joined #ruby
<Aderium> where does it get this from checking build system type... i386-pc-solaris2.11
<shevy> See `config.log' for more details
<Aderium> one sec
<shevy> can you gist config.log
<tuor> hi, why doesn't this write in the file? It creates the file, but it does'nt write "hello" in it. : https://gist.github.com/anonymous/a79b305f7e7c39d57ff6
<shevy> Aderium no idea... I guess it assembles that "i386-pc-solaris2.11" string
<brotspinne> tuor: you forgot file.close
<shevy> echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
<shevy> ah
<shevy> still a hardcoded uname there
<shevy> nobody ever thought that uname could be wrong!
sevenseacat has quit [Quit: Me dun like you no more.]
<Aderium> yeah ...
fullofcaffeine has joined #ruby
<shevy> are you able to assemble the correct string via isainfo?
riotjones has quit [Ping timeout: 256 seconds]
revath has quit [Quit: Leaving.]
<shevy> because if you could, you could put the proper command there
<tuor> brotspinne, ok.. It works, but why do I need it?
olistik has quit [Remote host closed the connection]
<Aderium> yeah via isainfo yes
casadei_ has joined #ruby
<brotspinne> tuor: but it's better to use a block like File.open(...) do ... end because the end will close the file automatically
<shevy> ok good
symm- has joined #ruby
<shevy> so perhaps a new entry should be added to the case menu
<adaedra> Aderium: you know, if your problem is just uname – write a small script that returns correct values, name it uname, and place it higher in $PATH
olistik has joined #ruby
<shevy> and rather than UNAME, some isainfo thing should be used
<tuor> brotspinne, ah ok.
<shevy> aha that is also a solution from adaedra :)
revath has joined #ruby
<Aderium> well except there are 3 times the uname is used that it is correct... I
<shevy> hehe
<adaedra> I'm still thinking there may be a configuration option for that though.
<brotspinne> tuor: the writes will be buffered sometimes. depends on what you write and how much.. only when the file is closed or flushed, everthing will be written. it could also help to do file.puts which adds a line break
<tuor> brotspinne, ah that's the reason.
malconis has joined #ruby
<shevy> brotspinne and flughafen - the two coolest nicks here
<brotspinne> uffjdn
Timba-as has joined #ruby
tkuchiki has joined #ruby
ta has quit [Remote host closed the connection]
dfockler has joined #ruby
<tuor> so, when I close the file, I can't work anymore with this file-object? What do I do, when I want to work multiple times with the same file?
olistik has quit [Ping timeout: 246 seconds]
t0rrieri_ has joined #ruby
yeticry has joined #ruby
<Aderium> I think whet I autoconf it brought everythning back ......
<brotspinne> tuor: you use File.open ... do ... end and within the block you can write how often you like
jriese has quit [Ping timeout: 244 seconds]
<Aderium> let me redo
zdman135 has joined #ruby
jriese has joined #ruby
df has quit [Ping timeout: 264 seconds]
dgutierrez1287 has joined #ruby
<tuor> brotspinne, ah ok. Ah and the filen name can be a string variable and so i can "remember" the file name.
<jhass> tuor: you can also nest, File.open(...) do |filea|; File.open(...) do |fileb| ... end; end;
erowlin has joined #ruby
<shevy> Aderium yeah, best also keep a separate file that has your modifications/patches to it
werelivinginthef has quit [Remote host closed the connection]
dumdedum has quit [Quit: foo]
<tuor> jhass, ah for working with multiple files in the same code block?
<brotspinne> tuor: not sure what you mean. just do like this https://gist.github.com/anonymous/2607d0796ea378a74d84
df has joined #ruby
<jhass> tuor: yeah
<Aderium> just messed up ....
<jhass> like copying parts of a file over into another
<tuor> jhass, ah got it. :)
<Aderium> argh
krz has quit [Ping timeout: 264 seconds]
revath has quit [Quit: Leaving.]
krz has joined #ruby
revath has joined #ruby
dgutierrez1287 has quit [Ping timeout: 250 seconds]
russellw has quit []
xkef has quit [Ping timeout: 264 seconds]
<tuor> brotspinne, ah right ::new is not exactly the same.
olistik has joined #ruby
<tuor> OK thx for your help brotspinne & jhass :)
werelivinginthef has joined #ruby
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has joined #ruby
n008f4g_ has quit [Ping timeout: 264 seconds]
mrconfused has quit [Ping timeout: 240 seconds]
dojobo has joined #ruby
<dojobo> hello
jhack has joined #ruby
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dojobo> i'm getting "no such file or directory" with open-uri (using a local path, not a url) even though i can cat the very same path just fine. ideas?
revath has quit [Ping timeout: 246 seconds]
<dojobo> (also, the script worked fine in windows, now i am trying to run it in linux--with an appropriate filepath of course)
hmnhf has joined #ruby
theery has quit [Remote host closed the connection]
j_mcnally has joined #ruby
erowlin has quit [Quit: erowlin]
aganov has quit [Remote host closed the connection]
n4t3 has joined #ruby
Scroff has quit [Remote host closed the connection]
<adaedra> using file:///... ?
dEPy has quit [Ping timeout: 256 seconds]
ddarkpassenger has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
darkf has quit [Quit: gn]
<shevy> dojobo and File.exist?(path_here) returns true?
<n4t3> Hi, does anybody know if I can create a destructive method for a class of mine?
<shevy> I don't think you can easily destroy objects
<shevy> you could perhaps poke through ObjectSpace and grab the rogue object by its ankles :)
<n4t3> Maybe I meant to say bang method. Can't really tell the difference.
<tuor> it's working :).
revath has joined #ruby
<tuor> good night.
zacstewart has quit [Remote host closed the connection]
erowlin has joined #ruby
<shevy> actually I don't know how to remove an object from ObjectSpace... is that even possible?
tuor has left #ruby ["bye"]
<shevy> well a bang method just has a trailing '!'
surs2 has joined #ruby
Scroff has joined #ruby
<shevy> other than that, it is not special. you can have it do anything
<n4t3> I know, but I want it to modify the object like chomp! or strip! does.
<shevy> yeah ok so you want to modify it in place
<ljarvis> n4t3: what do you want help doing exactly? just modify the object in place. Be sure to provide a non bang version too :)
<shevy> .chomp! and .strip! have it easy, String objects have the replace() method so you can replace the object
<n4t3> And if it's my own class, not a String?
jespada has quit [Quit: WeeChat 1.1.1]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
senayar has quit []
<ljarvis> you just mutate the variables as you normally would
<Aderium> and we are configuring .... !!!!!!!
<ljarvis> maybe we could help if you provided some code, n4t3
<shevy> Aderium really??? how did you manage
<shevy> or rather what files did you have to modify
<Aderium> ill post in a minute, only 4 lines
<Aderium> I did not realize that /bin/arch needed to be /usr/bin/arch
surs1 has quit [Ping timeout: 256 seconds]
<Aderium> that was one of them
<shevy> aha
<n4t3> shevy: I want to replace the entire object in place.
revath has quit [Ping timeout: 252 seconds]
JoshL has quit []
<shevy> n4t3 yeah, if it's a String then it would be easy :)
<dojobo> thanks shevy and adaedra, was afk for a few, will try those
chipotle has joined #ruby
<Aderium> still need to see if it actualy compiles 64
jhn has joined #ruby
<Aderium> the target stated does not seem correct
<Aderium> ill gist in a minute
konsolebox has quit [Quit: Leaving]
<Aderium> error in make :(
zacstewart has joined #ruby
erowlin has quit [Quit: erowlin]
<shevy> !!!
jhn has quit [Client Quit]
rcvalle has joined #ruby
Morrolan has joined #ruby
pdoherty has joined #ruby
Morrolan has quit [Client Quit]
neredsenvy has quit [Ping timeout: 256 seconds]
Morrolan has joined #ruby
bwilson has joined #ruby
aef has quit [Remote host closed the connection]
<Aderium> COLLECT_LTO_WRAPPER is incorrect
<Aderium> can i add this to the configure ?
<shevy> ok well at least it is another error
<dojobo> hrmmm... File.exists? is returning false with both file:// and the bare path
NeverDie has joined #ruby
<shevy> no idea what is COLLECT_LTO_WRAPPER sorry
spider-mario has joined #ruby
<shevy> but you could add new variables like that sure
NeverDie has quit [Client Quit]
<shevy> dojobo so the file does not exist!
n4t3 has quit [Quit: ircII EPIC4-2.10.5 -- Are we there yet?]
chipotle has quit [Ping timeout: 256 seconds]
NeverDie has joined #ruby
Aswebb_ has joined #ruby
blueOxigen has quit [Ping timeout: 246 seconds]
joelataylor has joined #ruby
Aswebb_ has quit [Remote host closed the connection]
<dojobo> shevy: but "cat ~/file/path.rss" prints the file
scripore has quit [Quit: This computer has gone to sleep]
<shevy> ok but that is not the absolute path
<dojobo> ah so maybe that's my problem
<shevy> I think you can use File.expand_path() too before sending this to File.exist?
NeverDie has quit [Max SendQ exceeded]
erowlin has joined #ruby
<dojobo> a-ha, now it returns true
NeverDie has joined #ruby
<dojobo> shevy: yes, that worked for me too
<shevy> \o/
yihsiaol has quit [Ping timeout: 246 seconds]
<dojobo> shevy++
jhn has joined #ruby
<shevy> simple problems are good problems
<shevy> Aderium has a not so simple problem
aryaching has joined #ruby
<dojobo> although since these are just paths i'm throwing in a yaml, i'll do abs paths, but expand_path is good to know
<Aderium> I cant believe nobody caught this so far :)
ddarkpassenger has joined #ruby
<Aderium> I just could not understand why ruby was always i386
unshadow_ has quit [Quit: leaving]
podman has joined #ruby
ddarkpassenger has quit [Client Quit]
erowlin has quit [Client Quit]
joelataylor has quit [Ping timeout: 264 seconds]
yizr has quit [Remote host closed the connection]
scripore has joined #ruby
GitGud has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
<shevy> I think it really is because there are so few solaris users out there
<shevy> I can not even give you a single other example here on #ruby who uses solaris as main OS :)
omegamike has quit []
NeverDie has quit [Client Quit]
yihsiaol has joined #ruby
aryaching_ has quit [Ping timeout: 256 seconds]
omegamike has joined #ruby
bruno- has quit [Quit: Lost terminal]
randiman has quit [Quit: (null)]
NeverDie has joined #ruby
bruno- has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
laurentide has quit [Read error: Connection reset by peer]
amclain has joined #ruby
omegamike has quit [Client Quit]
omegamike has joined #ruby
fabrice31 has joined #ruby
anisha has quit [Quit: Leaving]
joelataylor has joined #ruby
snockerton has joined #ruby
hotpanca_ has quit [Ping timeout: 248 seconds]
white_bear_ has quit [Quit: leaving]
<Aderium> plenty of companies do, this I believe is probably a common issue on other solaris ports to like OmniOS
fabrice31 has quit [Ping timeout: 256 seconds]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<adaedra> The university I attended before used Solaris as main OS.
togdon has left #ruby ["Bye-Bye."]
<shevy> adaedra tell them to join #ruby!
bruno- has quit [Quit: Lost terminal]
<adaedra> nej, du
gambl0re has joined #ruby
jonathanwallace has quit [Quit: Leaving.]
BigRonnieRon has joined #ruby
momomomomo has quit [Quit: momomomomo]
BigRonnieRon has quit [Max SendQ exceeded]
bruno- has joined #ruby
theery has joined #ruby
BigRonnieRon has joined #ruby
zacstewart has quit [Remote host closed the connection]
jespada has joined #ruby
bruno- has quit [Client Quit]
v4n has joined #ruby
bruno- has joined #ruby
theery has quit [Remote host closed the connection]
Hobbyboy has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
bruno- has quit [Client Quit]
bruno- has joined #ruby
brotspinne has quit [Quit: Textual IRC Client: www.textualapp.com]
nateberkopec has joined #ruby
aef has joined #ruby
towski_ has joined #ruby
theery has joined #ruby
tkuchiki has quit [Remote host closed the connection]
joonty has quit [Quit: joonty]
tomphp_ has quit [Ping timeout: 246 seconds]
<radens> What is the ruby Hash equivalent of python's dict.items? It returns a list of (key, value) tuples
Alina-malina has quit [Ping timeout: 264 seconds]
theery has quit [Remote host closed the connection]
<radens> {'a':1, 'b':2} -> [['a',1],['b',2]]
paulcsmith has quit [Quit: Be back later ...]
aef has quit [Remote host closed the connection]
<Darkwater> radens: each
<canton7> >> { a: 1, b: 2 }.to_a
<ruboto> canton7 # => [[:a, 1], [:b, 2]] (https://eval.in/396379)
<Darkwater> or that
<canton7> or if you're looping over it, use #each, yeah
<radens> excellent, thanks
omegamike has quit []
jpfuentes2 has joined #ruby
yihsiaol has quit [Quit: leaving]
[SaM] has quit [Ping timeout: 264 seconds]
tkuchiki has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
peter_paule has joined #ruby
erowlin has joined #ruby
Igorshp has quit [Remote host closed the connection]
bricker has joined #ruby
howdoicomputer has joined #ruby
JoshL has joined #ruby
brain_shim has quit [Ping timeout: 264 seconds]
erowlin has quit [Client Quit]
krz has joined #ruby
RobertBirnie has joined #ruby
gizmore has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
Zai00 has quit [Quit: Zai00]
eGGsha has joined #ruby
bronson has joined #ruby
noname1 has quit [Ping timeout: 264 seconds]
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JMoir has quit [Ping timeout: 255 seconds]
C1V0 has joined #ruby
j_mcnally has joined #ruby
omegahm has quit [Ping timeout: 252 seconds]
revath has joined #ruby
<neanias> !gif the village people
<neanias> Oops
<neanias> >> {'a':1, 'b':2}.to_a
<ruboto> neanias # => [[:a, 1], [:b, 2]] (https://eval.in/396382)
mleung has joined #ruby
<neanias> >> {a: 1, b: 2}.to_a
<ruboto> neanias # => [[:a, 1], [:b, 2]] (https://eval.in/396385)
<radens> >> {'a'=>1, 'b'=>2}
<ruboto> radens # => {"a"=>1, "b"=>2} (https://eval.in/396388)
mrconfused has joined #ruby
<adaedra> neanias: what was that about the village people?
<radens> oh weird. The rocket ship and colon *are* different.
<neanias> Wrong channel, adaedra
maletor_ has joined #ruby
C1V0 has quit [Client Quit]
<adaedra> radens: because a: is :a =>
<neanias> Someone was talking about the YMCA
<radens> okay
<Mon_Ouie> Consider the fact that keys don't have to be symbols, too
<Mon_Ouie> They could be any object that implements #eql? and #hash properly
centrx has joined #ruby
<neanias> Better to use symbols though
JMoir has joined #ruby
<radens> I'd rather them not be.
<Mon_Ouie> No, sometimes symbols are just not appropriate
<neanias> Fair
<Mon_Ouie> e.g. if you want to represent a set of objects, you could use a hash table (which is how the Set class in stdlib works)
[Butch] has joined #ruby
symm- has quit [Ping timeout: 256 seconds]
rdark has quit [Quit: leaving]
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fgo has quit [Ping timeout: 265 seconds]
bronson has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
paulcsmith has joined #ruby
rindolf has joined #ruby
<rindolf> Hi all.
kraljev11 has quit [Ping timeout: 264 seconds]
[H]unt3r has joined #ruby
MagePsycho has quit [Quit: MagePsycho]
jespada has quit [Quit: WeeChat 1.1.1]
momomomomo has joined #ruby
stamina has joined #ruby
<Aderium> Making away .....
<shevy> Aderium is about to succeed!
jtdoncas has quit [Ping timeout: 256 seconds]
<Aderium> not that fast ....
tubuliferous_ has quit [Ping timeout: 250 seconds]
<Aderium> choosing wrng class ...
chipotle has joined #ruby
<shevy> ld: fatal: file dmyext.o: wrong ELF class: ELFCLASS32
<shevy> hmm
pietr0 has joined #ruby
<Aderium> looks like its still choosing a 32 class ..
surs3 has joined #ruby
Scroff has quit [Remote host closed the connection]
<Senjai> Good morning ruby
<apeiros> good morning Senjai
<havenwood> shevy: ELVES!!!
mrconfused_ has joined #ruby
mrconfused has quit [Ping timeout: 246 seconds]
xlogic has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<eam> Aderium: -m64?
Ox0dea has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<Ox0dea> Hey, ?guys, what's the best terminal emulator?
chipotle has quit [Ping timeout: 252 seconds]
<eam> Ox0dea: for what system?
Scroff has joined #ruby
<Ox0dea> I was only poking fun at diegoviola.
<eam> oic
<eam> because I have opinions and such
surs2 has quit [Ping timeout: 264 seconds]
<Ox0dea> st does everything I need and little else.
pengin has joined #ruby
balazs has joined #ruby
IrishGringo has quit [Remote host closed the connection]
jtdoncas has joined #ruby
redjack1964 has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
NeverDie has joined #ruby
mleung has quit [Quit: mleung]
lkba_ has joined #ruby
<eam> Ox0dea: I wish I was running X :)
<Senjai> eam: You have me curious now. I use urxvt
<Ox0dea> eam: Oh? Do you use links, then?
a346 has quit [Quit: a346]
<Senjai> eam: You run wayland or something else? Or nothinh at all
<eam> Senjai: I'm happy with urxvt (or just rxvt) and st sounds nice too. But I'm on osx so I use a hacked up iterm2
<eam> none of my linux boxes have video cards
<Senjai> Ah
RegulationD has quit [Remote host closed the connection]
<eam> I'd love to junk osx and put linux on this thing, but can't for various business reasons
tubuliferous_ has joined #ruby
Lucky___ has joined #ruby
xlogic has joined #ruby
neanderslob has quit [Ping timeout: 250 seconds]
sdothum has joined #ruby
lkba has quit [Ping timeout: 250 seconds]
neanderslob has joined #ruby
bodgix_wrk has left #ruby [#ruby]
Rollabunna has quit [Ping timeout: 248 seconds]
<shevy> haha
<Ox0dea> Is there a better non-alphanumeric source of randomness than $$?
<centrx> Don't put Word 2015 on it
<eam> Ox0dea: non-alphanumeric?
<Ox0dea> No letters or numbers.
<apeiros> +in the code
<eam> I uh, /dev/urandom is just bytes
bb010g has joined #ruby
<centrx> $$ isn't random, it's a process number
<apeiros> eam: they want to write code which does not contain letters or numbers
<eam> oooh I see
Alayde has joined #ruby
<eam> there go all my useful recommendations ;)
chthon has quit [Quit: Ex-Chat]
<Ox0dea> >> _=$$/$$;__=_-_;@_=_+_;$_=@_+_;$__=@_+$_;$-_=$__*$_;@__=''<<$-_*($__+$_)+@_;$___=''<<$-_*$__-$__<<$-_*($__+@_)<<@__<<@__;@___=''<<$-_*$__-$_*$_<<$-_*($__+$_)-$_<<@__<<@__;(___=->____{$.+=_;____<<($.%$-_==__ ?$___+@___:$.%$_==__ ?$___:$.%$__==__ ?@___:$.);$.<($__*@_)**@_?___[____]:____})[[]]
<ruboto> Ox0dea # => [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16, 17, "Fiz ...check link for more (https://eval.in/396389)
<Ox0dea> I do shit like that for giggles. :)
havenwood has quit [Ping timeout: 255 seconds]
<apeiros> Ox0dea: I think most people asking about "non-alphanumeric" have little trouble to understand that it means "no letters or numbers". their problem usually is related to the context where you don't want letter or numbers ;-)
spider-mario has quit [Remote host closed the connection]
<eam> I read that as asking about the data, not the name of the symbol referencing it
<apeiros> eam: yeah, did so too when they asked a similar question and was rather confused as it didn't make sense in the case of that question :)
<Ox0dea> Forgive my ambiguity, then. I had hoped explicitly mentioning $$ might have clarified the matter.
<eam> makes sense with context :)
Rollabunna has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sarkyniin has quit [Quit: Quit]
<dfockler> Ox0dea: I really liked the division to get 1
mleung has joined #ruby
<eam> what's the context of 'random' here, what's it being used for?
<Ox0dea> eam: Randomness.
<Ox0dea> A linear congruential generator's seed, to be more precise.
hotpancakes has joined #ruby
<eam> yeah but, how? It's not a real prng, so
<Ox0dea> An LCG is a PRNG, for what that's worth.
fullofcaffeine has joined #ruby
<eam> you could use the contents of $", they will vary between systems
<apeiros> centrx: hard to use without writing alphanumeric chars in the code ;-)
<Ox0dea> eam: But it'll always be the same.
<eam> Ox0dea: within a system, yes
<Ox0dea> That's not very random.
<eam> well, nothing will be
<Ox0dea> The PID will be "pseudo-random".
<eam> well, kinda, it's just incrementally increasing
<eam> you could use time
<Ox0dea> But how to do so without alphanumerics?
bwilson has quit [Quit: bwilson]
<Ox0dea> There are a few Time instances in ObjectSpace at program start, but they're always the same and I don't think I could get at them besides.
<eam> what primitives have you built so far?
<Ox0dea> Lots and lots.
<eam> got a list?
bsdbofh has joined #ruby
shinnya has joined #ruby
duggiefresh has quit [Remote host closed the connection]
<eam> ok, I know how to do it
krz has quit [Quit: WeeChat 1.0.1]
<eam> you can construct arbitrary characters by using non-alphanumeric unicode literals, then indexing as bytes (you can index with whatever integers you have in non-alphanumeric globals)
krz has joined #ruby
<Ox0dea> That skips over the problem of seeding, no?
rbowlby has joined #ruby
<eam> given that, I think you should be able to build the string "send" and then call arbitrary methods
<eam> never actually using an alnum character
chouhoulis has quit [Remote host closed the connection]
<Ox0dea> CHARS CHR COMPOSE DROP EACH FILTER FLOOR INDEX INDEXED INVERT JOIN KEYS MAP MAP_BANG MAX MERGE MIN ORD PRIME PRINT PRODUCT PUTS RANGE REDUCE REVERSE RSORT SIZE SORT SORT_BY SQRT TAKE TO_I VALUES
Azulinho has joined #ruby
<Ox0dea> It's quite easy to construct any string, but *actually* invoking #send is, I think, not currently possible.
scripore has quit [Quit: This computer has gone to sleep]
<Ox0dea> Non-alphanumeric Ruby is still technically Turing-complete without it, but it would make it much easier to write interesting programs.
rbowlby_ has joined #ruby
mesamoo has quit [Quit: Konversation terminated!]
bungoman has quit [Remote host closed the connection]
<Ox0dea> $$/$$ gets you the 1 from which all other numbers can be derived, and then String#<< is how you build up arbitrary strings, since shoveling actually appends the character at that codepoint.
<Ox0dea> >> '' << 97 << 98 << 99
<ruboto> Ox0dea # => "abc" (https://eval.in/396390)
<eam> you can call map? which means you can pass a symbol: &:"#{$,}"
<eam> assuming you set $, = "method name"
<Ox0dea> No, I've implemented MAP without alphanumerics.
<eam> oh, so not actually map then
JMoir has quit [Ping timeout: 244 seconds]
<Ox0dea> Not Ruby's #map, but it takes a collection and a Proc and applies the latter to every element of the former, so there's no practical difference.
<eam> a real proc?
<Ox0dea> A real Proc.
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea> >> ->{}[]
<ruboto> Ox0dea # => nil (https://eval.in/396391)
bungoman has joined #ruby
zacstewart has joined #ruby
rbowlby has quit [Ping timeout: 265 seconds]
scripore has joined #ruby
snockerton has quit [Quit: Leaving.]
zacstewart has quit [Remote host closed the connection]
zacstewart has joined #ruby
Scroff has quit [Remote host closed the connection]
pepperbreath has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
snockerton has joined #ruby
JakFrist has joined #ruby
mjuszczak has joined #ruby
eGGsha is now known as eGGshke
eGGshke is now known as eGGsha
jnormandeau has quit [Quit: Leaving]
jhack has quit [Ping timeout: 246 seconds]
<eam> this is a fascinating puzzle but I'm gonna get some work done for a bit :D
chinmay_dd has quit [Quit: See ya!]
sgambino has joined #ruby
<Ox0dea> Well, I'm glad you think so. Apologies for the distraction.
<Ox0dea> >> $_=$$/$$;@_=->_,__{_==[]?[]:[__[_[$_-$_]]]+@_[_[$_..-$_],__]}; foo = [1, 2, 3]; @_[foo, -> x { x + 1 }]
<ruboto> Ox0dea # => [2, 3, 4] (https://eval.in/396394)
<Ox0dea> @_ is MAP there.
<eam> Ox0dea: don't apologize this is a great challenge
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sshuff has quit [Quit: Leaving]
<Ox0dea> It's implemented recursively, but it kinda cheats in taking advantage of Ruby's binding semantics.
momomomomo has quit [Quit: momomomomo]
<Mon_Ouie> >> get_block = ->(&b) { b }; send = get_block(&:"send"); send[:anything, "rand"]
<ruboto> Mon_Ouie # => undefined method `get_block' for main:Object (NoMethodError) ...check link for more (https://eval.in/396395)
<Mon_Ouie> >> get_block = ->(&b) { b }; send = get_block[&:"send"]; send[:anything, "rand"]
<ruboto> Mon_Ouie # => 0.9301043372750087 (https://eval.in/396396)
BigRonnieRon has quit [Quit: Textual IRC Client: www.textualapp.com]
<Ox0dea> What?!
<Mon_Ouie> Can't you adapt this to not use any alphanumerical characters?
<Ox0dea> Indeed.
<Ox0dea> Wow.
<eam> oh damn, there's your send
<Ox0dea> Mon_Ouie: That's brilliant.
failshell has quit [Remote host closed the connection]
axl_ has quit [Remote host closed the connection]
t0rrieri_ has quit [Quit: Lingo: www.lingoirc.com]
allcentury has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
mesamoo has joined #ruby
Torrieri has joined #ruby
Torrieri has joined #ruby
axl_ has joined #ruby
t_ has quit [Read error: Connection reset by peer]
axl__ has quit [Ping timeout: 250 seconds]
<allcentury> hi all - I'm trying to understand when variables in a block in ruby need parens, I'm not sure I understand the convention. For example I'm having to do [1, 2, 3].each_with_object(0).with_index do |(num, obj), index| but I don't understand why I need the parens
bruno- has quit [Quit: Lost terminal]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
duggiefresh has joined #ruby
t_ has joined #ruby
bruno- has joined #ruby
mjuszczak has quit []
<Antiarc> You need the parens for deconstructing assignment. https://gist.github.com/cheald/d88f37a5b9f0e5cfcc8e
<Mon_Ouie> [1, 2, 3].each_with_object(0).to_a
Rollabunna has quit [Remote host closed the connection]
<Mon_Ouie> >> [1, 2, 3].each_with_object(0).to_a
<ruboto> Mon_Ouie # => [[1, 0], [2, 0], [3, 0]] (https://eval.in/396397)
Rollabunna has joined #ruby
<Antiarc> In the first case, the first parameter passed is the array [num, obj]. If you want to expand that into individual variables, you pass a paren-delineated list of variables to destructure the array into
<Mon_Ouie> ^ this is the collection seen by with_index, which calls its own block with one element from that collection and the index
thiagovsk has joined #ruby
chussenot has joined #ruby
<Ox0dea> allcentury: This should help clarify things:
<Ox0dea> >> _,(_,_,((_,(foo,_)),_)) = [1, [2, [3, 4], [[5, [:target], 6], [7], 8, [9], 10]]]; foo
<ruboto> Ox0dea # => :target (https://eval.in/396398)
mando has quit [Ping timeout: 252 seconds]
kies^ has quit [Ping timeout: 256 seconds]
gard has joined #ruby
chussenot has quit [Client Quit]
eggoez has quit [Ping timeout: 240 seconds]
<Ox0dea> In allcentury's defense, the parentheses aren't always required, which can be a little confusing.
<Ox0dea> >> foo = [1, 2, 3]; foo.zip(foo).map { |a, b| a + b }
<ruboto> Ox0dea # => [2, 4, 6] (https://eval.in/396400)
JMoir has joined #ruby
JMoir has quit [Remote host closed the connection]
Jackneill has joined #ruby
hotpancakes has quit [Remote host closed the connection]
gregf has quit [Quit: WeeChat 1.1.1]
<jhass> yeah, you get the first level for free, do |x, y| -> do |(x, y)|
<shevy> Ox0dea you write really strange code
fgo has joined #ruby
<Antiarc> Well, the parens are required when the value passed to the block is an array containing an array. When it's just a 1-level array, the array can be destructured with multiple params and no parens
hahuang65 has quit [Quit: WeeChat 1.2]
Rollabunna has quit [Ping timeout: 248 seconds]
Torrieri has quit [Quit: Be back later ...]
tkuchiki has quit [Remote host closed the connection]
<shevy> _,(_,_,((_,(foo,_)),_)) is almost like ASCII art... a spaceship
<Antiarc> >> [[[1, [:a]], false], [[2, [:b]], true]].map {|(num, (sym)), bool| [num, sym, bool] }
<ruboto> Antiarc # => [[1, :a, false], [2, :b, true]] (https://eval.in/396402)
<Antiarc> Each iterated entry contains an array containing an array, and we can destructure even the deep array via the parens in the block params
DoubleMalt has quit [Read error: Connection reset by peer]
<allcentury> Got it, thank you Antiarc
howdoicomputer has quit [Ping timeout: 264 seconds]
Rodya_ has joined #ruby
hahuang61 has joined #ruby
<Mon_Ouie> Also notice how x = 1, 2, 3 is different from x, = 1, 2, 3 and x, y = 1, 2, 3
td has joined #ruby
blackmes1 has quit [Ping timeout: 252 seconds]
eggoez has joined #ruby
balazs has quit [Remote host closed the connection]
postmodern has joined #ruby
fgo has quit [Ping timeout: 252 seconds]
fullofcaffeine has quit [Remote host closed the connection]
jtdoncas has quit [Ping timeout: 250 seconds]
<Ox0dea> Mon_Ouie: Reckon there's a better way to get hold of Kernel than `send[send['', 'class'], 'ancestors'][-2]`?
towski_ has quit [Remote host closed the connection]
dfockler has quit [Remote host closed the connection]
failshell has joined #ruby
<Ox0dea> Or Object even, where that -2 would be a -3, but I suspect I'm missing some cleverer way of getting there.
jhn has quit [Read error: Connection reset by peer]
rbennacer has quit [Remote host closed the connection]
blackmes1 has joined #ruby
<Mon_Ouie> Not sure (nor am I sure what constitutes "better" for your purposes :p), but when you have one of those you can start using const_get instead
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Ox0dea> Right, that was the plan.
<Ox0dea> >> send=->&_{_}[&:"send"]; send[send[send[send['', 'class'], 'ancestors'][-2], 'const_get', 'Time'], 'new']
<ruboto> Ox0dea # => 2015-07-10 17:30:01 +0000 (https://eval.in/396404)
bruno- has quit [Quit: Lost terminal]
dudo has joined #ruby
jtdoncas has joined #ruby
bruno- has joined #ruby
zeeraw has joined #ruby
<polpak> Ox0dea: Why not just Kernel ?
livathinos has joined #ruby
<Ox0dea> polpak: I can't use letters or numbers in the final code.
livathinos has quit [Client Quit]
sdothum has joined #ruby
<Ox0dea> I can replace all of those strings with non-alphanumeric equivalents.
drewo has quit [Ping timeout: 256 seconds]
<Ox0dea> And the -2 as well, of course.
Unknown59167 has joined #ruby
<Ox0dea> >> _=$$/$$;[*?`...?{][_..-_]*''
<ruboto> Ox0dea # => "abcdefghijklmnopqrstuvwxyz" (https://eval.in/396407)
chipotle has joined #ruby
Unknown59167 is now known as [SaM]
zz_Outlastsheep is now known as Outlastsheep
dfockler has joined #ruby
brain_shim has joined #ruby
werelivinginthef has quit [Remote host closed the connection]
bronson has joined #ruby
snockerton has quit [Quit: Leaving.]
werelivinginthef has joined #ruby
mjuszczak has joined #ruby
mjuszczak has quit [Client Quit]
chipotle has quit [Ping timeout: 256 seconds]
lkba has joined #ruby
polpak has quit [Quit: leaving]
hahuang65 has joined #ruby
DoubleMalt has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
lkba_ has quit [Ping timeout: 256 seconds]
snockerton has joined #ruby
RegulationD has joined #ruby
chouhoulis has joined #ruby
fullofcaffeine has joined #ruby
snockerton has quit [Client Quit]
mjuszczak has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
startupality has joined #ruby
revath has quit [Quit: Leaving.]
djbkd has joined #ruby
mjuszczak has quit [Client Quit]
theery has joined #ruby
revath has joined #ruby
omegahm has joined #ruby
peter_paule has quit [Ping timeout: 248 seconds]
werelivinginthef has quit [Ping timeout: 246 seconds]
x1337807x has joined #ruby
fabrice31 has joined #ruby
mjuszczak has joined #ruby
werelivinginthef has joined #ruby
Marsupermammal has joined #ruby
konsolebox has joined #ruby
Channel6 has quit [Quit: Leaving]
konsolebox has quit [Max SendQ exceeded]
serivich has quit [Ping timeout: 248 seconds]
failshell has quit []
konsolebox has joined #ruby
konsolebox has quit [Max SendQ exceeded]
Rollabunna has joined #ruby
bruno- has quit [Ping timeout: 246 seconds]
freerobby has joined #ruby
werelivinginthef has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 256 seconds]
Rollabunna has quit [Remote host closed the connection]
Rollabunna has joined #ruby
jY has joined #ruby
<jY> is there a good way to turn "['foo', 'bar']" that is a string into an array?
paulcsmith has quit [Quit: Be back later ...]
hotpancakes has joined #ruby
<bricker> Ox0dea: what is $$ ?
<Ox0dea> The process ID.
<Ox0dea> >> $$
<bricker> ah
<ruboto> Ox0dea # => 15717 (https://eval.in/396411)
<Ox0dea> It's the only nonzero global variable available at program start.
workmad3 has joined #ruby
<centrx> jY, if it's JSON or YAML yeah
Limix has joined #ruby
pothibo has joined #ruby
<bricker> Ox0dea: so what's the point of dividing it by itself at the beginning? Just to make the script more confusing?
<jY> centrx: its pretty much also valid json
<Ox0dea> bricker: No, I need to be able to construct numbers, and for that I need something nonzero.
Alina-malina has joined #ruby
mujou has quit [Ping timeout: 250 seconds]
<Ox0dea> Well, I need a 1, to be precise, and $$ / $$ gets me there.
mjuszczak has quit []
quazimodo has joined #ruby
<bricker> Ox0dea: right... so the point of $$/$$ is just to look confusing
quazimod1 has joined #ruby
<Ox0dea> No...
revath has quit [Ping timeout: 265 seconds]
<bricker> Ox0dea: so why not just type _=1 ?
jtdoncas has quit [Ping timeout: 246 seconds]
<Ox0dea> Because I can't use numbers or letters...
<centrx> it's some kind of sick joke
<centrx> brainruby
<bricker> Ox0dea: I missed that part of the conversation
snockerton has joined #ruby
jtdoncas has joined #ruby
reset has joined #ruby
revath has joined #ruby
Limix has quit [Ping timeout: 250 seconds]
<bricker> Ox0dea: Can you explain how this works? [*?`...?{]
klaas has joined #ruby
<eam> bricker: it's the range of characters from ` to {
<eam> splat'ed
<Ox0dea> eam: And excluding the end.
autrilla has quit [Quit: Connection closed for inactivity]
<eam> yeah, ... vs ..
<Ox0dea> >> ?a == 'a'
<ruboto> Ox0dea # => true (https://eval.in/396412)
<eam> ` and { are the characters surrounding a-z range in ascii
<bricker> :) It's obvious when it's broken down
<eam> Ox0dea: didn't realize that splat works that way, that's much nicer than ().to_a
<Ox0dea> Oui.
<eam> I'm going to start using that in real code
<Ox0dea> Yay!
a346 has joined #ruby
<Ox0dea> It's not particularly uncommon.
mando has joined #ruby
<eam> the precedence of .. is super frustrating
<eam> Ox0dea: yeah I know *, I just didn't realize its precedence was correct for ..
<Ox0dea> eam: Well, you probably shouldn't have terribly complex expressions on either side.
pothibo has quit [Quit: pothibo]
<eam> I write 1..10.to_a all the time :(
<Ox0dea> Oh, right.
theery has quit []
snockerton has quit [Quit: Leaving.]
<Senjai> Ox0dea: That ? notation needs to go
<Senjai> :(
<Senjai> I remember reading up on that a longgg time ago
<Ox0dea> It might go away for 3.0.
Zai00 has joined #ruby
<eam> noooo
fullofcaffeine has quit [Remote host closed the connection]
<Ox0dea> I'd also prefer it didn't.
jonathanwallace has joined #ruby
startupality has quit [Quit: startupality]
<Ox0dea> >> ?????:?:
<ruboto> Ox0dea # => /tmp/execpad-8e19d5c57214/source-8e19d5c57214:2: warning: string literal in condition ...check link for more (https://eval.in/396413)
<Ox0dea> Rawr.
<pipework> having fun?
startupality has joined #ruby
towski_ has joined #ruby
<eam> >> $VERBOSE=nil or eval "????::??"
startupality has quit [Client Quit]
<ruboto> eam # => ":" (https://eval.in/396414)
PlasmaStar has quit [Ping timeout: 246 seconds]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
jtdoncas has quit [Ping timeout: 244 seconds]
fullofcaffeine has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hotpancakes has quit [Remote host closed the connection]
PlasmaStar has joined #ruby
NeverDie has joined #ruby
Kully3xf_ has joined #ruby
allomov has joined #ruby
Kully3xf has quit [Ping timeout: 244 seconds]
patrick_star has quit [Quit: Leaving]
n008f4g_ has joined #ruby
snockerton has joined #ruby
surs4 has joined #ruby
chouhoul_ has joined #ruby
surs3 has quit [Ping timeout: 246 seconds]
Rodya_ has quit [Remote host closed the connection]
exadeci has quit [Quit: Connection closed for inactivity]
failshell has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
chouhoulis has quit [Ping timeout: 264 seconds]
baweaver has joined #ruby
hotpancakes has joined #ruby
Scroff has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
t_ has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
jbw_ has quit [Ping timeout: 264 seconds]
quimrstorres has quit [Remote host closed the connection]
Rollabunna has quit [Ping timeout: 264 seconds]
stamina has quit [Quit: WeeChat 1.2]
djbkd has joined #ruby
t_ has joined #ruby
sshuff has joined #ruby
xkef has joined #ruby
JoshL has quit [Read error: Connection reset by peer]
JoshL has joined #ruby
Rollabunna has joined #ruby
revath has quit [Ping timeout: 264 seconds]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JakFrist has joined #ruby
<Darkwater> I want to write something similar to attr_accessor, do I really need to use class_eval?
pdoherty has quit [Ping timeout: 255 seconds]
<bricker> Darkwater: no, you can just define a class method
jbw_ has joined #ruby
<Darkwater> how do I do that?
<shevy> well
prestorium has joined #ruby
<Darkwater> oh I see
<Darkwater> but no
workmad3 has quit [Read error: Connection reset by peer]
<shevy> class Foo; def self.attr_bla; end; end
revath has joined #ruby
<Darkwater> well the method name needs to be dinamic
<shevy> k so you can use define_method
aaeron has joined #ruby
td has quit [Ping timeout: 246 seconds]
<Darkwater> oh, so that does exist
<aaeron> I am using fileutils for copying sudo owned files
<Darkwater> coudln't find it on devdocs
<Darkwater> weir
<Darkwater> d
<aaeron> it obviously fails
<aaeron> is there any way i can use file utils with sudo
toretore has joined #ruby
<aaeron> except doing sudo ruby file_name.rb
<aaeron> ?
<Darkwater> note that they're not owned by sudo, they're owned by root
<Darkwater> sudo cmd executes cmd as root
<aaeron> sorry my bad
<Darkwater> if it's for a single use you can just change the owner manually
<Darkwater> ie. sudo chown yourusername:yourgroupname file.txt
scripore has quit [Quit: This computer has gone to sleep]
rbennacer has joined #ruby
<aaeron> That wont be possible as I am running this command on someone elses box
<aaeron> wanted to use the standard. If not do u recommend using mixlib? or sh ?
<Darkwater> other than that it isn't really possible without sudo
<Darkwater> unless you want to get hacky
<aaeron> okay
workmad3 has joined #ruby
<aaeron> nopes
chouhoul_ has quit [Remote host closed the connection]
<aaeron> which is the best command line utility u suggest
<eam> aaeron: why/how does it fail? sudo will work with ruby just fine
<Darkwater> you could do `sudo mv ile.txt file.txt`
<aaeron> i dont want to run the file using sudo
astrobun_ has joined #ruby
<eam> aaeron: you need to provide more details about what you're trying to do
chouhoulis has joined #ruby
vickleton has joined #ruby
<aaeron> eam: changing this to a testable code
<aaeron> `sudo cp #{src} #{dst}`
<aaeron> using fileutils
<Darkwater> testable?
<aaeron> I can use mixlib
<aaeron> yeah.
<eam> aaeron: you will need to use sudo to elevate ruby to root
evanjs has quit [Remote host closed the connection]
<eam> if you want to use FileUtils
<aaeron> Ok
<eam> you can do it in a subprocess if you don't want to do it to the entire ruby program
<eam> fork/exec
<aaeron> okay
gregf has joined #ruby
<aaeron> What about using mixlib?
<aaeron> or sh
drewo has joined #ruby
<eam> aaeron: sure, or you can use system()
<aaeron> I am not able to decide which is better
<aaeron> ok
<eam> system "sudo", "cp", src, dst
<Darkwater> that's nearly the same as `sudo cp #{src} #{dst}`
<aaeron> eam, darkawater: which one do u prefer for executing shell commands.
<eam> Darkwater: sure, but it's invoked from ruby which it seems he wants
evanjs has joined #ruby
<eam> aaeron: system is simple and builtin, it's fine unless you have other needs
<Darkwater> well it's cleaner anyway since it'll work fine if the arguments contain spaces or similar
<eam> Darkwater: yeah
rbennacer has quit [Ping timeout: 255 seconds]
<Darkwater> I usually just use `` or sometimes %x tho
mfp_ has joined #ruby
rbennacer has joined #ruby
<eam> you may get into trouble with those in conjunction with sudo -- often sudo is configured to require stdout to be a terminal
kies^ has joined #ruby
<aaeron> Darkwater
<aaeron> how do u test the output
<eam> system() will use the stdin/out/err of the script, which are probably terminals
aaeron has quit [Quit: Leaving.]
mdarby has joined #ruby
scripore has joined #ruby
<Darkwater> `echo hi` # => "hi\n"
<Darkwater> >> `echo hi`
<ruboto> Darkwater # => (https://eval.in/396418)
<Darkwater> why did I expect that to work
<Ox0dea> Because `echo` is usually a shell builtin?
<Darkwater> (it only breaks because that bot blocks shell commands)
chipotle has joined #ruby
<postmodern> is it really necessary to add rake as a development_dependency? i mean rake comes pre-installed with ruby
Mro95 has joined #ruby
<Darkwater> `` uses $SHELL so no
<Mro95> hello Darkwater
<Darkwater> go away Mro95
<eam> Darkwater: not necessarily
fantazo has quit [Quit: Verlassend]
baweaver has quit [Remote host closed the connection]
<Darkwater> *a* shell anyway
<eam> Darkwater: not necessarily
<Darkwater> when not?
baweaver has joined #ruby
<eam> Darkwater: well, in your case there - no shell
Zai00 has quit [Quit: Zai00]
symbol has joined #ruby
<eam> ruby will examine the string and if it determines it can tokenize it without spawning a shell it will optimize it away
<Darkwater> I'm talking about ruby's standard implementation of Kernel#`
<eam> generally that means "does it have metacharacters"
<eam> Darkwater: me too
<Darkwater> (if that's the correct name)
<eam> we're talking about the same ` or system
<eam> Darkwater: test it :)
symbol has quit [Client Quit]
<Darkwater> how?
baweaver has quit [Remote host closed the connection]
symbol has joined #ruby
<eam> strace -f -eexecve ruby -e'`echo hi`'
<Darkwater> what, even
<Darkwater> ah
hahuang65 has quit [Read error: Connection reset by peer]
<eam> Darkwater: compare with: strace -f -eexecve ruby -e'`echo hi # this comment has a metachar: * `'
duggiefresh has quit [Remote host closed the connection]
<eam> ruby will see the * and determine it can't tokenize the string
rbennacer has quit [Ping timeout: 255 seconds]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Darkwater> ah, I see
<Darkwater> let me correct myself then
aaeron has joined #ruby
<Darkwater> it behaves just like a shell
<eam> ;-)
<Darkwater> as far as the programmer is concerned it's the same anyway
symbol has quit [Client Quit]
mfp_ has quit [Quit: Yikes! Someone hit the wrong switch....]
mfp_ has joined #ruby
chipotle has quit [Ping timeout: 246 seconds]
hahuang65 has joined #ruby
aaeron has quit [Client Quit]
symbol has joined #ruby
<eam> mostly, until it isn't, at which point hair will be pulled
symm- has joined #ruby
<Darkwater> what's the most efficient way to turn :foo into :@foo?
<Darkwater> do I have to turn it into a string and back or is there a better way?
<Mon_Ouie> >> :"@#{:foo}"
<ruboto> Mon_Ouie # => :@foo (https://eval.in/396422)
<Darkwater> oh right you can do that
<Darkwater> thanks
<eam> functionally the same as to_s though, right?
<Ox0dea> Aye.
benlieb has joined #ruby
aaeron has joined #ruby
baweaver has joined #ruby
mdarby has quit [Read error: Connection reset by peer]
seal has joined #ruby
symbol has quit [Client Quit]
symbol has joined #ruby
Spami has joined #ruby
arescorpio has joined #ruby
shadoi has joined #ruby
seal has quit [Client Quit]
<Ox0dea> More precisely, interpolation literally attempts to use the object's #to_s method.
ta has joined #ruby
<Darkwater> I want to make a mixin that provides a method similar to attr_accessor, can someone give me some pointers?
jroith has joined #ruby
<Darkwater> not sure how/where to define attribute
zdman135 has quit [Read error: Connection reset by peer]
olistik has quit [Remote host closed the connection]
Baprath has joined #ruby
duggiefresh has joined #ruby
bruno- has joined #ruby
howdoicomputer has joined #ruby
dseitz has joined #ruby
<jhass> Darkwater: remove the self. in the def and use extend instead of include
keen__________16 has quit [Read error: Connection reset by peer]
<Darkwater> works, thanks
<Darkwater> (that part at least, got other problems)
umgrosscol has joined #ruby
<Ox0dea> Darkwater: You don't technically need to convert name back to a Symbol, for what it's worth.
keen__________16 has joined #ruby
blaines has joined #ruby
<Darkwater> oh
<Darkwater> oh well
<Ox0dea> Also maybe consider using case equality instead of #is_a?.
<Darkwater> ===?
<Ox0dea> Oui.
<Darkwater> thanks
baweaver has quit [Remote host closed the connection]
blaines_ has quit [Ping timeout: 256 seconds]
<Ox0dea> Then you get things like `attribute :foo, /bar/` for free, where `foo` has to match some regular expression.
<symbol> I need a new nick.
umgrosscol has quit [Client Quit]
Kully3xf has joined #ruby
<Darkwater> right, cool
<Darkwater> also how would I initialize @attributes?
<Ox0dea> symbol: I intentionally capitalized there to avoid highlighting you. :/
<Ox0dea> Darkwater: Hook #extended.
<symbol> Ox0dea: Heh, no worries :)
<symbol> It makes me feel important
<Darkwater> uhmm
redteam has joined #ruby
rindolf has quit [Quit: Leaving]
Kully3xf_ has quit [Ping timeout: 252 seconds]
<shevy> lol
<shevy> i hate symbol
evanjs has quit [Remote host closed the connection]
bronson has quit [Remote host closed the connection]
blaines_ has joined #ruby
<ytti> but you also use {}
<Antiarc> symbol: I recommend symboI or symb0l :P
<ytti> so your opinions don't matter
<ytti> you're a bad man
<Darkwater> symbo1
shevy is now known as former_symbol
* ytti loves all the symbols hurt by the shevy
<former_symbol> what the
<symbol> ¯\_(ツ)_/¯
bungoman has quit [Remote host closed the connection]
blaines has quit [Ping timeout: 256 seconds]
<former_symbol> once I was the symbol called Prince
<Darkwater> ah self.extended
<former_symbol> erm sorry, :Prince
symbol is now known as lobmys
<lobmys> woot
former_symbol is now known as shevy
rwilcox has joined #ruby
<shevy> I need to rewrite a ruby project and I don't feel motivated :(
Alina-malina has quit [Read error: Connection reset by peer]
<Darkwater> Ox0dea: do I need to call instance_variable_set on base in extended?
<Ox0dea> Darkwater: That's one way to do it.
<Darkwater> just @foo = bar doesn't work
<Darkwater> still nil
<Ox0dea> Right, as should make sense.
<Darkwater> yeah
Scroff has quit [Remote host closed the connection]
<Ox0dea> Metaprogramming in Ruby can be unpleasantly verbose. :/
ivanskie has joined #ruby
Scroff has joined #ruby
<skyjumper> is it considered good practice to do `ClassName === instance` instead of `instance.is_a? ClassName`?
<ytti> Ox0dea, add DSL to compress it
<ytti> when in doubt, another layer of indirection
<ytti> your coworkers will thank you for the innovative approach
blue_deref has joined #ruby
<Ox0dea> Crystal has macros. :(
havenwood has joined #ruby
<Darkwater> hm, Integer === Integer is false
<Darkwater> how do I use a case statement with types?
<Ox0dea> Darkwater: "Type" on the left.
redteam has quit [Ping timeout: 246 seconds]
<skyjumper> Darkwater: Integer === 5
<ytti> Darkwater, you are asking if Interger's class is Integer
<Ox0dea> Oh, you meant in a `when` clause?
<ytti> Darkwater, it's not, it is class
<skyjumper> right hand side takes an instance
pengin has quit [Remote host closed the connection]
<Darkwater> yeah I know
<toretore> skyjumper: some say.. that it's bad practice
<Darkwater> case input
<Darkwater> when Integer
<skyjumper> is that considered a normal thing to do?
<toretore> that === is only for case
<Darkwater> input coudl be Integer
<skyjumper> it's confusing as hell, when .is_a? is pretty clear
nathanstitt has quit [Quit: I growing sleepy]
<Ox0dea> Darkwater: That branch of your case statement would execute if Integer === input.
<Darkwater> yeah
<Darkwater> so I need to dos omething else
<Ox0dea> No?
<Darkwater> what I want would be this if case used == instead of ===
<jhass> skyjumper: keep .is_a?, only weirdos use === outside case
<Darkwater> because I want to check if input *is* Integer, or String, or whatever
<skyjumper> jhass: thanks. someone changed my is_a? code to use === and it looked a little like alpha coder marking his territory
Scroff has quit [Ping timeout: 256 seconds]
<jimmythehat> does anyone know why attr_accessor_with default was depricated? What would be the easiest way to give an attribute a default value?
<skyjumper> confirmed
<Ox0dea> Darkwater: case input.class, then?
<Darkwater> actually realized I'm gonna used Numeric instead of Integer, but still
<jhass> jimmythehat: set it in your initialize method
<Darkwater> isn't Integer.class == Class?
Outlastsheep is now known as zz_Outlastsheep
j_mcnally has joined #ruby
<jimmythehat> jhass indeed
<toretore> skyjumper: there is no reason for this person to do that
jamesaxl has joined #ruby
<skyjumper> toretore: no technical reason, anyway
<toretore> indeed
<Darkwater> I guess I coudl case Integer.name
<jimmythehat> why was it deprecated? seems nice
blackmes1 has quit [Ping timeout: 255 seconds]
<Darkwater> yeah that works
<jimmythehat> oh its rails anyway
howdoicomputer has quit [Ping timeout: 256 seconds]
robbyoconnor has quit [Quit: Konversation terminated!]
mfp_ has quit [Quit: Yikes! Someone hit the wrong switch....]
finisherr has joined #ruby
Baprath has quit [Quit: ChatZilla 0.9.91.1 [Firefox 39.0/20150629114049]]
sphex_ has joined #ruby
superflat has joined #ruby
maletor_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sarkyniin has joined #ruby
nathanstitt has joined #ruby
evanjs has joined #ruby
davedev24_ has quit []
joelataylor has quit [Quit: Be back later ...]
sphex has quit [Read error: Connection reset by peer]
Pisuke has quit [Ping timeout: 265 seconds]
Scroff has joined #ruby
phutchins2 has quit [Ping timeout: 256 seconds]
mjuszczak has joined #ruby
maletor_ has joined #ruby
shivam_v has joined #ruby
Torrieri has joined #ruby
Torrieri has joined #ruby
jackjackdripper has joined #ruby
<shivam_v> hello people ! i am a newbie to rails.Any good book for a better understanding of rails ?
<jhass> ?rails shivam_v
<ruboto> shivam_v, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xlogic has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shivam_v has quit [Client Quit]
ndrei has quit [Ping timeout: 256 seconds]
revath has quit [Ping timeout: 256 seconds]
ndrei has joined #ruby
Kully3xf_ has joined #ruby
thiago733 has joined #ruby
djbkd has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has joined #ruby
davedev24_ has joined #ruby
Kully3xf has quit [Ping timeout: 246 seconds]
revath has joined #ruby
failshell has quit []
kirun has joined #ruby
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
alexherbo2 has joined #ruby
serivich has joined #ruby
ta has quit [Remote host closed the connection]
jroith has quit [Quit: Linkinus - http://linkinus.com]
lobmys has quit [Quit: WeeChat 1.1]
lavros has quit [Quit: leaving]
hotpancakes has quit [Remote host closed the connection]
momomomomo has joined #ruby
baweaver has joined #ruby
momomomomo has quit [Client Quit]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
hotpancakes has joined #ruby
j_mcnally has joined #ruby
NeverDie has joined #ruby
revath has quit [Quit: Leaving.]
djbkd has joined #ruby
revath has joined #ruby
Rollabunna has quit [Remote host closed the connection]
JoshL has quit []
Rollabunna has joined #ruby
momomomomo has joined #ruby
hotpancakes has quit [Ping timeout: 264 seconds]
mleung has quit [Quit: mleung]
jroith has joined #ruby
superflat has left #ruby [#ruby]
DoubleMalt has joined #ruby
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chipotle has joined #ruby
bruno- has quit [Ping timeout: 255 seconds]
Musashi007 has joined #ruby
Kully3xf has joined #ruby
t_ has quit [Ping timeout: 256 seconds]
Kully3xf_ has quit [Ping timeout: 244 seconds]
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
segfalt has quit [Quit: segfalt]
nathanstitt has quit [Quit: I growing sleepy]
chipotle has quit [Ping timeout: 256 seconds]
leonardoajim has quit [Quit: Be back later ...]
baweaver has quit [Remote host closed the connection]
pdoherty has joined #ruby
icebourg has joined #ruby
benlieb has quit [Quit: benlieb]
zata has joined #ruby
znn has joined #ruby
zata has left #ruby ["Textual IRC Client: www.textualapp.com"]
zata has joined #ruby
<znn> i am considering switching to ruby from js, and i've been depending on this module hashing my passwords: https://github.com/ncb000gt/node.bcrypt.js/
lxsameer has joined #ruby
koos303 has quit [Quit: Connection closed for inactivity]
<znn> how can i make the switch cleanly and check passwords that have been hashed with this module?
dagda1_ has joined #ruby
stardiviner has quit [Ping timeout: 244 seconds]
<znn> jhass: i figured there was a bcrypt gem
<Ox0dea> znn: node.bcrypt.js and bcrypt-ruby both use the OpenBSD implementation under the hood, so your hashes *should* remain valid.
<znn> i don't have a solid undertanding of exactly how bcrypt works, i just know it comes recommended
<bougyman> it's super easy to use.
fabrice31 has joined #ruby
startupality has joined #ruby
astrobun_ has quit [Remote host closed the connection]
t_ has joined #ruby
icebourg has quit []
sharpmachine has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 264 seconds]
senayar has quit [Remote host closed the connection]
hotpancakes has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
atomical has joined #ruby
icebourg has joined #ruby
djbkd has quit [Remote host closed the connection]
silkfox has quit [Ping timeout: 264 seconds]
<shevy> you can do it!
<Antiarc> any valid bcrypt implementation should be able to validate a bcrypt hash
<Antiarc> And they will almost all use openssl :)
Limix has joined #ruby
chrisdpeters has joined #ruby
Marsupermammal has quit [Quit: Textual IRC Client: www.textualapp.com]
silkfox has joined #ruby
<znn> Antiarc: that's really good to know
dc has joined #ruby
hotpancakes has quit [Ping timeout: 244 seconds]
JMoir has joined #ruby
blackmes1 has joined #ruby
chrisdpeters has quit [Client Quit]
<Antiarc> bcrypt hashes are the form ${version}${rounds}${salt}{checksum}, so you always have all the information in the hash necessary to validate an input string against that hash
<Antiarc> (since the rounds and salt are included)
dc has quit [Client Quit]
shadoi has quit [Quit: Leaving.]
<ytti> i still want library which allows me to specify two hsahes and it'll give me xor of the hashes
monod has joined #ruby
<ytti> just insurance against given hash being inherently broken
<ytti> or implementation issues or sometihng
djbkd has joined #ruby
<ytti> so even in worst case, i have plenty of time to change the combo
bronson has joined #ruby
tvw has quit [Ping timeout: 250 seconds]
Limix has quit [Ping timeout: 264 seconds]
<Senjai> znn: bcrypt comes recommended because it's a non reversable algorithm, which is perfect for passwords
pengin has joined #ruby
<Senjai> And it's fairly secure
bungoman has joined #ruby
<JMoir> Hello, probably a stupid question, I'm new to ruby (and sadly testing too!), but how would I test a form that created an entry in a database? I'm testing with Test::Unit and using Sinatra.
nofxx has joined #ruby
<Senjai> JMoir: ?code
<Senjai> ?code JMoir
<ruboto> JMoir, We can't help you without your code, please post it to https://gist.github.com
<Antiarc> ytti: I'm not quite sure what you mean there; you can xor two strings pretty trivially though?
<dudedudeman> JMoir: are you like... me? because i'm sitting here working on the same thing
<Senjai> Bleh, this vs helpa
axl_ has quit [Quit: axl_]
<JMoir> I dont have code for this yet, I don't know what to put, that's the problem. I've looked in all the docs I can and searched high and low but I can't find a method of testing for database additions
shadoi has joined #ruby
<ytti> Antiarc, usuually differnet algos give ifferent otput length
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
multi_io has quit [Ping timeout: 265 seconds]
mujou has joined #ruby
quimrstorres has joined #ruby
<ytti> Antiarc, it's probably ont hard, but with crypto, i'd really want someone clued to do it
<Antiarc> JMoir: The way I think about it is - how would you test it manually?
<JMoir> hah, really dudedudeman?
<dudedudeman> JMoir: here's an example of how i'm testing some of my sinatra stuff right now
<Senjai> JMoir: Write it first, then ask us. Gotta make an attempt for us to help you. A form is a concept that can mean many things
<ytti> 23:00 < Senjai> znn: bcrypt comes recommended because it's a non reversable algorithm, which is perfect for passwords
<ytti> as opppoesd to?
<dudedudeman> no forms in that though, so it might not be helpful
<Antiarc> ytti: Yeah, they give different lengths, but I don't quite understand the goal. What would xoring two hashes together accomplish for you, other than producing a third non-trivially-reversible string?
<ytti> Antiarc, if one of the hashes i ssomehow broken, i don't have hurry to fix my software/platform
<Antiarc> (or producing 0 if the strings are equal, but you can just test string equality in that case)
<Senjai> ytti: Any kind of weak algorithm that allows you to unencrypt a string to get the original value
xkef_ has joined #ruby
multi_io has joined #ruby
<ytti> Antiarc, i'm insuring against broken hash
<JMoir> Antiarc: well if I were to manually test it, I'd take a look in the database and see if it was there... Ah I have an idea, I was heading at it from the wrong direction
djbkd has quit [Remote host closed the connection]
<Antiarc> ytti: So basically just OTP-encrypting your hash?
<ytti> Senjai, i think there is some kind of misunderstanding here
<Antiarc> JMoir: :)
nathanstitt has joined #ruby
<Senjai> ytti: possibly
peter_paule has joined #ruby
<ytti> Senjai, being reversible and being hash does not mean weak and strong
<Antiarc> That's how I generally think about testing - "how would I do this manually?", and then translate that into code
<ytti> Senjai, all hashes are irreversible
<toretore> Senjai: bcrypt is recommended over other hashing algorithms because it takes a longer time to run
<Senjai> Yes, by definition.
<ytti> Senjai, but that does not mean they are 'stronger' than reversible
<ytti> it's just totally different use-case
bronson has quit [Ping timeout: 256 seconds]
<shevy> irreversible is such a strong word
<JMoir> Cheers Antiarc xD Sometimes it helps to have someone phrase the problem in a different way to realise how blind you are, haha
xkef has quit [Ping timeout: 244 seconds]
bungoman has quit [Ping timeout: 255 seconds]
<ytti> Antiarc, otp-encryptiong your hash sounds contrieved, i just want xor of two hashes, to buy insurance :)
<ytti> shevy, i disagree
<dudedudeman> i'd also like to pose a question. I am running the follow test code, and I get a nomethoderror on line 66, where it tells me i have an undefined methods 'destroy!' for nilclass. What the bleep am i missing ? https://gist.github.com/anonymous/97695895483174a84b8d
<Antiarc> JMoir: I find the best way to solve a problem is to ask a question in a public forum and then look foolish when asking the qeustion reveals the answer :D
<shevy> ytti finnish is such a strong language!
howdoicomputer has joined #ruby
<Senjai> dudedudeman: Todo.last is returning nil
<ytti> shevy, if you take arbitrary amount of data and turn it to fixed size of data
<Senjai> dudedudeman: @todo.save may have failed
<Ox0dea> shevy: If I tell you I did some arithmetic and arrived at the number 3, could you tell me what I did to get there?
<Antiarc> ytti: xor'ing one string with another string is effectively just a one-time pad encryption
<ytti> shevy, it's very safe to say it's irreversible
<shevy> i-r-r-e-v-e-r-s-i-b-l-e
<Antiarc> (just make sure your crypttext length matches your plaintext length)
serivich has quit [Ping timeout: 244 seconds]
<shevy> Ox0dea if you mean by code then I am unable to decipher your extremely advanced brainfuck code sorry
<shevy> the _,(_,_,((_,(foo,_)),_)) monad
<ytti> shevy, aah, sorry, i'm slow
<Senjai> Ox0dea: I could tell you -a- solution :P
<ytti> i blame the the rose
<shevy> the the the rose!
<ytti> Antiarc, that is entirely reasonable way to look at it
<JMoir> Antiarc: Very true, unfortunately! haha
momomomomo_ has joined #ruby
<ytti> Antiarc, bottom line is, i wantsies such library, written by people who understand something about crypto, which i a not
<shevy> dudedudeman oops you asked a question... I missed that. lemme see...
<dudedudeman> ok, well that makes sense. i Put a @todo = Todo.new in that mehtod, and it passes no issues. But, I have an entire setup method in the beginning of my test class that defines @todo. Shouldn't that mean that it shouldn't return nil?
<ytti> Antiarc, to me it seems so obviously right way to store your user passwords, why take risk, when insurance costs ~nothing
momomomomo has quit [Ping timeout: 244 seconds]
momomomomo_ is now known as momomomomo
<Senjai> ytti: Todo.last hits the database...
<Senjai> sorry, dudedudeman ^
<Senjai> not ytti
fantazo has joined #ruby
Scroff has quit [Remote host closed the connection]
Scroff has joined #ruby
<dudedudeman> ayy. ok
<shevy> ok so somewhere in your code, @todo becomes nil dudedudeman
<toretore> dudedudeman: are you using ActiveRecord?
<dudedudeman> toretore: yes. not rails
Scroff has quit [Remote host closed the connection]
<toretore> dudedudeman: you should be using save! in your tests
lkba_ has joined #ruby
<dudedudeman> and not just save
<dudedudeman> ?
segfalt has joined #ruby
<toretore> now it will fail silently
<Antiarc> ytti: Well, what does it get you? Can you rely on your crypttext not being compromised? This sounds a lot like the "pepper" argument, which AFAIK, is not really considered to be all that valuable a defnese defense these days
<toretore> and that's why you're having the problem you are right now
<ytti> Antiarc, lets say i do it for bcrypt and scrypt
AndChat-43764 has joined #ruby
<ytti> Antiarc, or bcrpyt and pbkdf2
<ytti> Antiarc, if it turns out one of them is inherently broken
lkba has quit [Read error: Connection reset by peer]
<ytti> Antiarc, or my implementation of it
<Antiarc> Oh, I see, you're hashing two different times then combining the hashes
<ytti> Antiarc, i don't have problem
Scroff has joined #ruby
<ytti> Antiarc, yes, hash1(secret) xor hash2(secret)
<ytti> (with salts, obviously)
<dudedudeman> I... actually think i found my issue. i was defining @Todo.destroy! and @todo_last = Todo.last twice in my code
surs has joined #ruby
<dudedudeman> i removed it from inside my test method, reli9ed on the setup method, and now all tests pass
<toretore> it should be in your test method, not in setup
<dudedudeman> toretore: why's that? (not arguing, genuinely curious and learning)
<Antiarc> ytti: The argument against that is that you're supposed to set the iterations for your hash function to the maximum level tolerable in your environment (ie, how long your users can wait)
<Antiarc> If your user can wait 2 sec for password verification, then you set bcrypt to take roughly 2 seconds worth of rounds on your current hardware
<dojobo> i'm failing to load nokogiri on a cron job
<Antiarc> If you mix bcrypt + scrypt then you have to dilute each to do 1 second's worth of rounds
<dojobo> i'm using rvm with 2.1 so it should work?
lkba_ has quit [Ping timeout: 256 seconds]
<toretore> dudedudeman: setup is only for setting up what's common for all your test methods
<Antiarc> It is a good idea to protect against catastrophic hash failure, but it comes with a pretty big tradeoff
<toretore> destroying the record isn't
<dojobo> thanks havenwood, i did use that
<Antiarc> (If validation speed isn't a substantial concern, then you could certainly have a very strong number of rounds for both hash functions, which would provide excellent insurance)
<havenwood> dojobo: Using wrappers?
znn has quit [Ping timeout: 256 seconds]
surs4 has quit [Ping timeout: 264 seconds]
mjuszczak has quit []
<dojobo> yeah, my rvm path seems to be ~/.rvm
<dojobo> (in crontab i'm using the absolute path though, not ~)
codecop has quit [Remote host closed the connection]
<ytti> Antiarc, i don't think that is fair argument
bsdbofh has quit [Quit: bsdbofh]
<Antiarc> Plus, if someone knows that you're mixing the two hash functions, and they get your hashes DB, then they can literally parallelize the work necessary to break the hash - 1000 rounds of scrypt can run in one thread, while 1000 rounds of bcrypt can run in another thread, then you mix the two results. This would take half the time of running 2000 rounds of either, assuming roughly equal runtime.
<ytti> Antiarc, if your margin is 50% of cpu time, you're fucked :)
<dojobo> i'm gonna try 2.0 in case there's some funkiness with the 2.1/nokogiri install
christiandsg has quit [Read error: Connection reset by peer]
<ytti> Antiarc, if they get my DB
<Antiarc> I'm just regurgitating what I've read on the topic, I'm not a cryptologist :)
<centrx> *gurgle*gurgle*gurgle*
baweaver has joined #ruby
<shevy> lol
christiandsg has joined #ruby
<shevy> thank you for the audio support centrx
<ytti> Antiarc, they dont even know what the hash is for scrypt or bcrypt
jonathanwallace has quit [Quit: Leaving.]
Renich has joined #ruby
<dudedudeman> toretore: ah, thank you. ok i cleaned that up and things aren't being slung around everywhere
<ytti> Antiarc, because they'd need to know one of them, to recover the other
<ytti> Antiarc, so before they can even start bruteforcing they have to know one of the
towski_ has quit [Remote host closed the connection]
kobain has joined #ruby
<Antiarc> Assuming they know the input is scrypt(pw) ^ bcrypt(pw), you don't have to know one or the other - you can compute them in parallel for each attempt
<Antiarc> (And you should never rely on your implementation being secret to ensure security)
aryaching has quit [Ping timeout: 248 seconds]
ta has joined #ruby
<Antiarc> There's also a Huge Freakin Issue with that approach in that you can't progressively upgrade your rounds
eGGsha has joined #ruby
<Antiarc> And I'm not even sure how you'd reverse that outside of storing the salts for each adjacent to the PW
<Antiarc> So you'd have to store the salts and rounds for each hash adjacent to the hash itself if you wanted to validate and progressively upgrade
* dudedudeman raises the roof
<ytti> Antiarc, you raise rounds by asking customer to change password
kobain has quit [Max SendQ exceeded]
<ytti> the margin of hash should be like 'oh it takes age of universe now'
blackmes1 has quit [Ping timeout: 250 seconds]
<ytti> not '50% more cpu and we're dead'
<ytti> i'm not worried of brute force attacks
<centrx> The universe is a figment of your imagination
kobain has joined #ruby
<ytti> i'm worried implementation or algo being inherently broken
frem has joined #ruby
<ytti> i'll gladly make brute force 2x easier (i don't agree it does) to gain insurance for broken algo
_ht has quit [Quit: Konversation terminated!]
s2013 has joined #ruby
leonardoajim has joined #ruby
djbkd has joined #ruby
ta has quit [Remote host closed the connection]
MagePsycho has joined #ruby
<Antiarc> ytti: You can't validate the PW if you don't know how many rounds were used to crypt the hash, and xoring destroys that information unless you store it adjacent
Scroff has quit [Ping timeout: 252 seconds]
Rodya_ has joined #ruby
<ytti> Antiarc, don't worr yabout that
jaycee has joined #ruby
<ytti> Antiarc, you'll add the meta information in the headers
<ytti> Antiarc, $version$salt1$salt2$xor_result
<ytti> from version you know your implementaiton
<ytti> which algos, whihc algo parameters etc
mando has quit [Ping timeout: 255 seconds]
evanjs has quit [Remote host closed the connection]
blackmes1 has joined #ruby
evanjs has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
eggoez has quit [Ping timeout: 256 seconds]
drewo has quit [Ping timeout: 256 seconds]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
revath has quit [Ping timeout: 256 seconds]
pdoherty has quit [Ping timeout: 256 seconds]
djbkd has quit [Remote host closed the connection]
drewo has joined #ruby
sharpmachine has joined #ruby
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chipotle has joined #ruby
hanmac has quit [Ping timeout: 256 seconds]
<Ox0dea> Has it been mathematically verified that salt is the best condiment for hashes?
Rodya_ has quit [Quit: Leaving...]
Kully3xf has quit [Ping timeout: 255 seconds]
Limix has joined #ruby
Rodya_ has joined #ruby
Matadoer has joined #ruby
eggoez has joined #ruby
evanjs has quit [Ping timeout: 244 seconds]
yfeldblum has joined #ruby
momomomomo_ has joined #ruby
jonathanwallace has joined #ruby
<jhass> no, that's trivial
momomomomo has quit [Ping timeout: 264 seconds]
momomomomo_ is now known as momomomomo
blackmes1 has quit [Ping timeout: 240 seconds]
CorySimmons has joined #ruby
mjuszczak has joined #ruby
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gix has joined #ruby
<Ox0dea> Is it? Some cursory research into the matter seems to indicate that cryptologists haven't even tried most of the other options.
aaeron has quit [Quit: Leaving.]
chipotle has quit [Ping timeout: 240 seconds]
krz has quit [Quit: WeeChat 1.0.1]
<jhass> they haven't because it's trivial
yalue has quit [Quit: return 0;]
mary5030 has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
mleung has joined #ruby
qhartman has joined #ruby
mary5030 has quit [Remote host closed the connection]
startupality has quit [Quit: startupality]
rwilcox has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mary5030 has joined #ruby
benlieb has joined #ruby
[Butch] has quit [Remote host closed the connection]
ItSAN____ has joined #ruby
benlieb has quit [Client Quit]
sharpmachine has quit [Remote host closed the connection]
allomov has quit [Remote host closed the connection]
ItSANgo_ has quit [Ping timeout: 246 seconds]
pothibo has joined #ruby
workmad3 has joined #ruby
startupality has joined #ruby
blackmes1 has joined #ruby
startupality has quit [Client Quit]
hanmac has joined #ruby
senayar has joined #ruby
hotpancakes has joined #ruby
sshuff has quit [Quit: Leaving]
bmurt has quit []
sharpmachine has joined #ruby
silkfox has quit [Ping timeout: 240 seconds]
hotpancakes has quit [Ping timeout: 244 seconds]
mesamoo has quit [Quit: Konversation terminated!]
towski_ has joined #ruby
senayar has quit [Ping timeout: 256 seconds]
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> it's trivial because they haven't!
JakFrist has joined #ruby
hotpancakes has joined #ruby
ndrei has quit [Ping timeout: 250 seconds]
workmad3 has quit [Ping timeout: 244 seconds]
Exuma has joined #ruby
[Butch] has joined #ruby
Rollabun_ has joined #ruby
ndrei has joined #ruby
djbkd has joined #ruby
stantonnet has quit [Ping timeout: 248 seconds]
j_mcnally has joined #ruby
Rollabunna has quit [Ping timeout: 264 seconds]
leonardoajim has quit [Quit: Be back later ...]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Jackneill has quit [Remote host closed the connection]
x1337807x has joined #ruby
allcentury has quit [Ping timeout: 244 seconds]
fmcgeough has joined #ruby
CorySimmons has quit [Quit: Bye!]
benlieb has joined #ruby
brain_shim has quit [Ping timeout: 244 seconds]
Exuma has quit []
znn has joined #ruby
d10n-work has joined #ruby
silkfox has joined #ruby
mjuszczak has quit [Ping timeout: 244 seconds]
xkef_ has quit [Ping timeout: 244 seconds]
Nahra has joined #ruby
mjuszczak has joined #ruby
mase-chatter has joined #ruby
dagda1_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Lucky___ has joined #ruby
dellavg has quit [Ping timeout: 264 seconds]
phutchins2 has joined #ruby
aaeron has joined #ruby
Zai00 has joined #ruby
dagda1 has joined #ruby
mando has joined #ruby
ldnunes has quit [Quit: Leaving]
dh64 has joined #ruby
christiandsg has quit [Remote host closed the connection]
casadei_ has quit [Remote host closed the connection]
bungoman has joined #ruby
mleung has quit [Quit: mleung]
OffTheRails has joined #ruby
znn has quit [Quit: Lost terminal]
c355E3B has quit [Quit: Connection closed for inactivity]
blackmesa has joined #ruby
xkef has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmes1 has quit [Ping timeout: 264 seconds]
JMoir has quit [Quit: Lost terminal]
bungoman has quit [Ping timeout: 255 seconds]
olistik has joined #ruby
FernandoBasso has joined #ruby
christiandsg has joined #ruby
beef-wellington has joined #ruby
mando has quit [Quit: “”]
havenwood has quit [Ping timeout: 246 seconds]
bungoman has joined #ruby
silkfox has quit [Ping timeout: 264 seconds]
blackmes1 has joined #ruby
Mon_Ouie has quit [Ping timeout: 256 seconds]
fmcgeough has quit [Quit: fmcgeough]
zanloy has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 255 seconds]
jonathanwallace has quit [Quit: Leaving.]
<shevy> today is sleepy day
jonathanwallace has joined #ruby
willywos has joined #ruby
Limix has quit [Quit: Limix]
bruno- has joined #ruby
segfalt has quit [Quit: segfalt]
pothibo has quit [Quit: pothibo]
surs1 has joined #ruby
allcentury has joined #ruby
<shevy> hmm .index() finds when the match is 100%
<shevy> but is there a way to have it find the index for the most-likely match candidate? for instance, if an array has one entry called 'foobar', and my search term would be 'oba'
<shevy> (in an Array)
duggiefresh has quit []
<shevy> >> array = ['abc','def','foobar']; array.index 'oba'
<ruboto> shevy # => nil (https://eval.in/396434)
surs has quit [Ping timeout: 246 seconds]
nb_bez___ has joined #ruby
<Ox0dea> >> %w[foo bar foobar].index { |x| x[/oba/] }
<ruboto> Ox0dea # => 2 (https://eval.in/396435)
j_mcnally has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bungoman has quit [Remote host closed the connection]
beef-wellington has quit [Ping timeout: 264 seconds]
mary5030 has quit [Remote host closed the connection]
chipotle has joined #ruby
arashb has joined #ruby
davedev24_ has quit []
davedev24_ has joined #ruby
Ilyas has quit [Read error: Connection reset by peer]
bungoman has joined #ruby
<shevy> ah so a regex match
<shevy> okay
a346 has quit [Quit: a346]
nathanstitt has quit [Quit: I growing sleepy]
chipotle has quit [Ping timeout: 246 seconds]
jonathanwallace has quit [Quit: Leaving.]
charliesome has quit [Quit: zzz]
OffTheRails has quit [Ping timeout: 264 seconds]
Timba-as has quit [Quit: Be back later ...]
davedev24_ has quit [Ping timeout: 248 seconds]
olistik has quit [Remote host closed the connection]
ta has joined #ruby
Azure has quit [Excess Flood]
fabrice31 has joined #ruby
olistik has joined #ruby
Papierkorb has joined #ruby
charliesome has joined #ruby
davedev24_ has joined #ruby
MagePsycho has quit [Quit: MagePsycho]
willywos has quit [Ping timeout: 256 seconds]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jroith has quit [Quit: Leaving...]
Azure has joined #ruby
fabrice31 has quit [Ping timeout: 252 seconds]
Rodya_ has quit [Remote host closed the connection]
tomphp has joined #ruby
devdazed has quit [Ping timeout: 264 seconds]
aaeron has quit [Quit: Leaving.]
scripore has quit [Quit: This computer has gone to sleep]
Zai00 has quit [Quit: Zai00]
[H]unt3r has quit []
nathanstitt has joined #ruby
davedev24_ has quit []
axl_ has joined #ruby
hotpancakes has quit [Remote host closed the connection]
charliesome has quit [Quit: zzz]
bubbys has quit [Ping timeout: 255 seconds]
Channel6 has joined #ruby
kadoppe has quit [Ping timeout: 250 seconds]
olistik has quit [Remote host closed the connection]
edwinvdg_ has quit [Remote host closed the connection]
kadoppe has joined #ruby
hotpancakes has joined #ruby
neanderslob has quit [Ping timeout: 265 seconds]
leonardoajim has joined #ruby
aaeron has joined #ruby
dojobo has quit [Quit: Leaving]
decoponio has quit [Read error: Connection reset by peer]
decoponio has joined #ruby
swgillespie has joined #ruby
jordanm has joined #ruby
surs2 has joined #ruby
loc22 has joined #ruby
arescorpio has quit [Quit: Leaving.]
olistik has joined #ruby
bubbys has joined #ruby
aaeron has joined #ruby
charliesome has joined #ruby
monod has quit [Quit: Sto andando via]
mjuszczak has quit []
scripore has joined #ruby
kies^ has quit [Ping timeout: 246 seconds]
surs1 has quit [Ping timeout: 252 seconds]
Rodya_ has joined #ruby
neanderslob has joined #ruby
edwinvdgraaf has joined #ruby
Pupeno has joined #ruby
maletor_ has quit [Max SendQ exceeded]
infinitone has joined #ruby
prestorium has quit [Quit: Konversation terminated!]
ivanf has joined #ruby
Pupeno_ has quit [Ping timeout: 256 seconds]
jbw_ has quit [Ping timeout: 248 seconds]
victortyau has quit [Quit: Leaving]
ivanskie has joined #ruby
Soda has quit [Remote host closed the connection]
djbkd has quit [Quit: My people need me...]
momomomomo_ has joined #ruby
Rodya_ has quit [Ping timeout: 265 seconds]
momomomomo has quit [Ping timeout: 244 seconds]
momomomomo_ is now known as momomomomo
<ex0ns> Hi ! Is there any equivalent to the struct.pack function of Python in ruby ?
nateberkopec has quit [Read error: Connection reset by peer]
jbw_ has joined #ruby
<ex0ns> struct.pack('Q', 0x0406cd) -> '\xcd\x06\x04\x00\x00\x00\x00\x00'
<adaedra> Array#pack?
<dfockler> ahhh the old pack function
<adaedra> `Array#pack`? (Let's remove ambiguity)
<adaedra> >> [ 0x0406cd ].pack 'Q'
<ruboto> adaedra # => "\xCD\x06\x04\x00\x00\x00\x00\x00" (https://eval.in/396436)
Rutux has quit []
<adaedra> ex0ns ^
<ex0ns> Great
<ex0ns> Thank wyou
<adaedra> wyou're welcome
Scroff has joined #ruby
<ex0ns> It's quite strange to use an array to wrap a FixNum
<ex0ns> to "pack" it
Alayde has quit [Quit: WeeChat 1.1.1]
hotpancakes has quit [Remote host closed the connection]
<adaedra> because you can pack multiple things
<Ox0dea> And more often do.
MagePsycho has joined #ruby
<dfockler> it seems a little weird to only pack one thing
surs3 has joined #ruby
<adaedra> >> [ 0xdeadbeef, 0x1337cafe, 0xadaeda ].pack('QQQ')
<ruboto> adaedra # => "\xEF\xBE\xAD\xDE\x00\x00\x00\x00\xFE\xCA7\x13\x00\x00\x00\x00\xDA\xAE\xAD\x00\x00\x00\x00\x00" (https://eval.in/396437)
<Ox0dea> adaedra: Q*?
<adaedra> Ox0dea: I know pack from name, tbh, never really used it :)
surs2 has quit [Ping timeout: 255 seconds]
* yxhuvud have to look up the arguments every single time
<Ox0dea> Some of them have pretty good mnemonic correlation.
<adaedra> Q is a 32-bit int, no?
<ex0ns> adaedra: oh I see, I think I understand the purpose of this function then (and its name too)
<adaedra> Q-word?
<ex0ns> 64
<adaedra> ah
<ex0ns> native endian
MagePsycho has quit [Client Quit]
<adaedra> aaaah
Scroff has quit [Ping timeout: 246 seconds]
<Ox0dea> ex0ns: String#unpack is the complementary function, for reference.
casadei_ has joined #ruby
JakFrist has joined #ruby
<adaedra> hihi, remembers me this function that converted things in little endian from native by calling htons then swapping bytes.
<ex0ns> Ox0dea: useful indeed, thanks
<ex0ns> adaedra: in C ?
<adaedra> yeah
thiago733 has quit [Quit: Leaving]
<adaedra> or C++, maybe, same thing at this level.
<ex0ns> All of these network stuff
<adaedra> I rarely go down to this level in Ruby
<ex0ns> adaedra: I do not make any difference between the two :)
poguez_ has quit [Quit: Connection closed for inactivity]
j_mcnally has joined #ruby
<ex0ns> Probably because I have never written useful stuff in C++
<shevy> who has anyway
<Ox0dea> Mozilla.
bodgix_wrk has joined #ruby
pullphinger has quit []
<adaedra> A lot of people, shevy
<ex0ns> Ox0dea: I hope they will move to Rust
<ex0ns> Game Engine
scottschecter has quit [Quit: Leaving]
<ex0ns> Browser Engine
<Ox0dea> ex0ns: I suspect they're not writing Servo for nothing. :)
<ex0ns> but it's very specific imo
<adaedra> ex0ns: they're doing that, it's servo iirc
SCHAAP137 has joined #ruby
<ex0ns> Ox0dea: I am waiting for it :)
olistik has quit [Remote host closed the connection]
<ex0ns> And for an Rust implementation of OpenSSL
<ex0ns> *a
omegahm has quit [Read error: Connection reset by peer]
<adaedra> I should go back to doing rust, but I don't know what to write with it :/
casadei_ has quit [Ping timeout: 256 seconds]
havenwood has joined #ruby
<ex0ns> I have started writing some real basic program with it few days ago
ljt has joined #ruby
<ex0ns> But I don't have a project to go any further
<dfockler> adaedra: I have the same problem!
<ex0ns> But I quite love it, even if I still have trouble with this ownership and borrowing stuff
<adaedra> Ah yes I found it the other day
<dfockler> I started working on an interpreted language
<adaedra> I wanted to rewrite some basic unix utils
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ex0ns> But it's really amazing to be able to write functionnal programming with low level language
<dfockler> adaedra: You should do them threaded
<shevy> adaedra in which language?
<adaedra> dfockler: baby steps
<adaedra> shevy: rust
ivanf has left #ruby [#ruby]
<adaedra> dfockler: but I have a sudoku solver, maybe I could thread that when I'll be more advanced
<jimmythehat> can the block come first in a method's argument list? e.g. def meth &block, arg1, arg2
giuseppesolinas has quit [Quit: This computer has gone to sleep]
<adaedra> try and see?
anisha has joined #ruby
tsou has joined #ruby
<ytti> adaedra, write throughput, packetlosss, jitter, latency tester
<ytti> i want usable one
<dfockler> that's pretty hard
<ytti> it is
<adaedra> what are you talking about, ytti
<dfockler> probably why it doesn't exist
<shevy> jimmythehat don't think so
<shevy> jimmythehat the & is special
<ytti> adaedra, you wanted rust project
<adaedra> ah
<ytti> dfockler, main reason is, you can't use kernel udp calls
<ytti> dfockler, performance is terribad
<ytti> https://github.com/libpnet/libpnet might help with it
<adaedra> yeah, maybe a bit too much advanced yet, not even sure I could do that in C :p
giuseppesolinas has joined #ruby
<ytti> even in c it'll be terribad if you try to just open udp socket
<ytti> and read/write there
<ytti> you must pretty much bypass the OS
<dfockler> That's why Wireshark is one of the few, it's pretty tough to get to that point
<ytti> wireshark is for completley other case use than what ineed
<ytti> ineed program, which i start in two ends
<ytti> and it'll tell throughput between them
<ytti> packet loss, jitter and lantecy
<ytti> kinda like iperf or thrulay
<ytti> but one which actually works
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
centrx has quit [Remote host closed the connection]
bodgix_wrk has left #ruby [#ruby]
davedev24_ has joined #ruby
<ex0ns> Sounds to be an advanced topic
omegahm has joined #ruby
magical-imouto is now known as ninja-maid-robot
zacstewart has quit [Remote host closed the connection]
mjuszczak has joined #ruby
<adaedra> there will surely be a latencyctl tool to cover that in systemd soon.
[k- has quit [Ping timeout: 256 seconds]
Pupeno has quit [Remote host closed the connection]
zacstewart has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<jhass> adaedra: write cinch for rust ;P
<adaedra> ahah
zacstewart has quit [Read error: Connection reset by peer]
brain_shim has joined #ruby
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
hinbody has quit [Quit: leaving]
scripore has joined #ruby
t_ has quit [Ping timeout: 250 seconds]
lxsameer has quit [Quit: Leaving]
momomomomo has quit [Quit: momomomomo]
MagePsycho has joined #ruby
chipotle has joined #ruby
MagePsycho has quit [Client Quit]
bruno- has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
davedev2_ has joined #ruby
chipotle has quit [Ping timeout: 252 seconds]
davedev24_ has quit [Ping timeout: 248 seconds]
whippythellama has quit [Quit: WeeChat 1.2]
solars has quit [Ping timeout: 246 seconds]
mary5030 has joined #ruby
OffTheRails has joined #ruby
zeeraw has quit [Read error: Connection reset by peer]
freerobby1 has joined #ruby
t_ has joined #ruby
jaycee has quit [Ping timeout: 256 seconds]
PlasmaStar has quit [Ping timeout: 256 seconds]
Thomas-0725 has joined #ruby
Lucky___ has joined #ruby
fgo has joined #ruby
chridal has quit [Ping timeout: 276 seconds]
freerobby has quit [Ping timeout: 264 seconds]
Azure has quit [Excess Flood]
sphex_ has quit [Ping timeout: 240 seconds]
sumark has quit [Ping timeout: 264 seconds]
pengin has quit [Remote host closed the connection]
hfp_work has quit [Ping timeout: 256 seconds]
Trynemjoel has quit [Ping timeout: 256 seconds]
Guest84916 has quit [Ping timeout: 256 seconds]
bankair has quit [Ping timeout: 256 seconds]
hotpancakes has joined #ruby
shaman42 has quit [Ping timeout: 252 seconds]
<Thomas-0725> Hello! When using .reduce on an array that contains arrays as elements, is it necessary to use .flatten first? For example: [1, 2, 3, [4, 3, 2] ].flatten.reduce(:*)
Azure has joined #ruby
<Thomas-0725> Do I need to flatten?
sdothum has quit [Ping timeout: 264 seconds]
armyriad has quit [Ping timeout: 264 seconds]
_5moufl has quit [Ping timeout: 264 seconds]
mduk has quit [Ping timeout: 276 seconds]
LiquidInsect has quit [Ping timeout: 256 seconds]
rikai has quit [Ping timeout: 256 seconds]
sphex has joined #ruby
s00pcan has quit [Ping timeout: 252 seconds]
TTilus has quit [Ping timeout: 252 seconds]
C0deMaver1ck has quit [Ping timeout: 252 seconds]
armyriad has joined #ruby
PlasmaStar has joined #ruby
bankair has joined #ruby
axl_ has quit [Quit: axl_]
mary5030 has quit [Ping timeout: 256 seconds]
ada2358 has quit [Ping timeout: 264 seconds]
Torrieri has quit [Quit: Be back later ...]
rikai has joined #ruby
lele has quit [Ping timeout: 276 seconds]
sts__ has quit [Ping timeout: 252 seconds]
anisha has quit [Ping timeout: 256 seconds]
brandon has joined #ruby
LiquidInsect has joined #ruby
sumark has joined #ruby
shaman42 has joined #ruby
sts_ has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
senayar has joined #ruby
senayar has joined #ruby
brandon is now known as Guest70962
sts_ is now known as Guest97074
<jhass> it always depend on your usecase, but in this case you'd want to, yeah
TTilus has joined #ruby
jenrzzz has joined #ruby
zata has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has joined #ruby
_5moufl has joined #ruby
s00pcan has joined #ruby
Sehryn has quit [Ping timeout: 248 seconds]
zata has joined #ruby
fgo has quit [Ping timeout: 246 seconds]
Trynemjoel has joined #ruby
chridal has joined #ruby
C0deMaver1ck has joined #ruby
lele has joined #ruby
ItSANgo has joined #ruby
peter_paule has quit [Ping timeout: 246 seconds]
hotpancakes has quit [Ping timeout: 246 seconds]
C0deMaver1ck is now known as Guest63957
hfp_work has joined #ruby
mduk has joined #ruby
ItSAN____ has quit [Ping timeout: 265 seconds]
finisherr has quit [Quit: finisherr]
senayar has quit [Ping timeout: 256 seconds]
arooni-mobile has joined #ruby
arooni-mobile has quit [Max SendQ exceeded]
peter_paule has joined #ruby
ada2358 has joined #ruby
arooni-mobile has joined #ruby
xkef has quit [Ping timeout: 264 seconds]
whiteline has quit [Ping timeout: 256 seconds]
Pupeno has quit [Remote host closed the connection]
ItSANgo__ has joined #ruby
ItSANgo has quit [Ping timeout: 244 seconds]
tsvenson has joined #ruby
dgutierrez1287 has joined #ruby
[Keith] has quit [Ping timeout: 244 seconds]
nathanstitt has quit [Ping timeout: 246 seconds]
[Keith] has joined #ruby
pengin has joined #ruby
_blizzy_ has joined #ruby
dfockler has quit [Remote host closed the connection]
peter_paule has quit [Ping timeout: 256 seconds]
<nofxx> Anyone using couchrest ? Can't find where pass some parameters to rest-client. ssl_cert_key or ssl_verify
dgutierrez1287 has quit [Ping timeout: 248 seconds]
arashb has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: zzz]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Thomas-0725> thank you jhass
bungoman_ has joined #ruby
NeverDie has quit [Quit: Textual IRC Client: www.textualapp.com]
AndChat-43764 has quit [Ping timeout: 252 seconds]
NeverDie has joined #ruby
Scroff has joined #ruby
dseitz has joined #ruby
lkba has joined #ruby
Azulinho has quit [Ping timeout: 240 seconds]
bungoman has quit [Ping timeout: 244 seconds]
joelataylor has joined #ruby
bungoman_ has quit [Ping timeout: 244 seconds]
juanpablo_ has quit [Quit: (null)]
randiman has joined #ruby
bubbys has quit [Ping timeout: 252 seconds]
juanpablo_ has joined #ruby
msnyon has quit [Ping timeout: 246 seconds]
zenspider has quit [Remote host closed the connection]
fantazo has quit [Quit: Verlassend]
surs4 has joined #ruby
Torrieri has joined #ruby
Torrieri has joined #ruby
allcentury has quit [Ping timeout: 248 seconds]
Pupeno has joined #ruby
surs3 has quit [Ping timeout: 244 seconds]
Pupeno has quit [Remote host closed the connection]
Pupeno has joined #ruby
Pupeno has joined #ruby
juanpablo_ has quit [Ping timeout: 248 seconds]
icebourg has quit []
allcentury has joined #ruby
Torrieri has quit [Client Quit]
growlove has quit [Quit: Leaving]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
freerobby1 has quit [Quit: Leaving.]
phutchins2 has quit [Ping timeout: 248 seconds]
chouhoulis has quit [Ping timeout: 255 seconds]
zenspider has joined #ruby
rcvalle has quit [Quit: rcvalle]
Scroff has quit [Ping timeout: 264 seconds]
dopie has quit [Quit: This computer has gone to sleep]
Pupeno has quit [Remote host closed the connection]
OffTheRails has quit [Quit: Leaving]
pietr0 has quit [Quit: pietr0]
marr has quit [Ping timeout: 256 seconds]
[Keith] has quit [Changing host]
[Keith] has joined #ruby
hotpancakes has joined #ruby
kies^ has joined #ruby
bubbys has joined #ruby
blue_deref has quit [Quit: bbn]
JakFrist has joined #ruby
Pupeno has joined #ruby
zata has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
atomical_ has joined #ruby
luriv_ has quit [Ping timeout: 246 seconds]
Ox0dea has quit [Quit: WeeChat 1.2]
chipotle has joined #ruby
mjuszczak has quit []
atomical has quit [Ping timeout: 248 seconds]
randiman has quit [Quit: (null)]
pengin has quit [Remote host closed the connection]
stantonnet has joined #ruby
simplyianm has joined #ruby
tkuchiki has joined #ruby
s2013 has joined #ruby
s2013 has quit [Client Quit]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chipotle has quit [Ping timeout: 264 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
x1337807x has joined #ruby
[Butch] has quit [Quit: Linkinus - http://linkinus.com]
RobertBirnie has quit [Ping timeout: 264 seconds]
senayar has joined #ruby
ljt has quit [Read error: Connection reset by peer]
fabrice31 has joined #ruby
kies^ has quit [Remote host closed the connection]
Crazy_Atheist has joined #ruby
quimrstorres has quit [Remote host closed the connection]
mrconfused_ has quit [Ping timeout: 248 seconds]
arooni-mobile has quit [Ping timeout: 248 seconds]
ninja-maid-robot is now known as pyon
kirun has quit [Quit: Client exiting]
Rodya_ has joined #ruby
fabrice31 has quit [Ping timeout: 256 seconds]
eggoez has quit [Ping timeout: 256 seconds]
quimrstorres has joined #ruby
hotpancakes has quit [Remote host closed the connection]
chipotle has joined #ruby
brain_shim has quit [Ping timeout: 264 seconds]
d10n-work has quit [Quit: Connection closed for inactivity]
<zenspider> locked myself out of my own server... good job!
thiagovsk has quit [Quit: Connection closed for inactivity]
ZeeNoodleyGamer has joined #ruby
eggoez has joined #ruby
<bricker> root/hunter2
<bricker> yw
Limix has joined #ruby
Rodya_ has quit [Ping timeout: 256 seconds]
quimrstorres has quit [Ping timeout: 246 seconds]
chipotle has quit [Ping timeout: 255 seconds]
n008f4g_ has quit [Ping timeout: 250 seconds]