havenwood changed the topic of #ruby to: Rules & more: http://ruby-community.com || Ruby 2.3.0; 2.2.4; 2.1.8; 2.0.0-p648: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || log @ http://irclog.whitequark.org/ruby/
<bnagy> yes
<Cohedrin> why not use array.find
<bnagy> ^^
<Cohedrin> it does it for you
<nfk|laptop> foobar020, fyi, bash already has built-in remote shell, iirc
<foobar020> Actually
<foobar020> Sorry I derped
<foobar020> I'm not looking to do code execution
<Cohedrin> but if you must use break, the keyword is `break`
<foobar020> remotely
jbrhbr has joined #ruby
bronson has joined #ruby
<voidDotClass> Cohedrin, array.find will also loop over the whole array and return all matches
<voidDotClass> whereas i want to break on finding the first match
<Cohedrin> no
<foobar020> I have code running on a remote machine I admin. I want all the http requests made by that code to be proxied through my local machine, which is behind a restrictive firewall
<Cohedrin> array.find_all will loop over them al
<Cohedrin> array.find will break at the first match
<Cohedrin> read the code
<voidDotClass> ah
cschneid_ has quit [Remote host closed the connection]
<voidDotClass> so if i wanted to break in each, what would i do for that?
<foobar020> I figured if I start a reverse tunnel from my local machine to the remote machine, I can bypass the firewall my local machine is behind
<Cohedrin> but if you must use break, the keyword is `break`
<foobar020> Forgive me if my terms are off, learning this as i go
<bnagy> foobar020: do you even need an http proxy?
joonty has quit [Ping timeout: 276 seconds]
<foobar020> well, I want the http requests being made with my local IP
<foobar020> I can't think of another way to do that
<nfk|laptop> foobar020, tunnel a port?
<nfk|laptop> i'm confident ssh can do whatever you need
<nfk|laptop> presumably either -R or -L will do the trick
<nfk|laptop> you just need to figure out which one you need and then apply it to the right port
<foobar020> i mean
<bnagy> if you have inner I and outer O and you do a reverse tunnel from O:12345 to I:80 then why won't that work?
binaryplease has joined #ruby
<bnagy> you'll see the request on I coming from O though
<bnagy> because, like, it does
peeja has quit [Ping timeout: 250 seconds]
crime has joined #ruby
<foobar020> Okay, I'm assuming a lot of my confusion just comes from lack of knowledge of terminology or how to properly use ssh.
<foobar020> I've tried, from local machine, `ssh -R 80:localhost:80 <remote_user>@<remote_ip>
<foobar020> `
ramfjord_ has quit [Ping timeout: 245 seconds]
<foobar020> but I get "Warning: remote port forwarding failed for listen port 80"
<Cohedrin> hold on.
<foobar020> ...probably because it's already being used
<bnagy> seems likely, yeah
<zambini> foobar020: Something is already bound to port 80
<foobar020> i am not incredibly knowledgable about this
dfinninger has quit [Remote host closed the connection]
<crime> jhass: https://gist.github.com/wrq/33f52ac5d087cede6af5 I was bored and wrote this, and it does print out a prime every couple seconds. please advise if this is an acceptable solution
<bnagy> also probably perms
<Cohedrin> foodbar020: Why are you trying to do this? This sounds like a problem with the way of going about it
<zambini> foobar020: Can you make your remote go through something besides port 80?
asthasr_ has joined #ruby
<bnagy> foobar020: I was envisioning O with a webserver on 80 and you want for some requests O to internally use I as a server for those
<bnagy> in which case you want to reverse tunnel O:12345 to I:80 and have O use 127.0.0.1:12345 for those requests
ramfjord has joined #ruby
agent_white has joined #ruby
psyq has quit [Quit: Conversation terminated]
Snowy has quit []
edwinvdgraaf has quit [Remote host closed the connection]
<bnagy> so user hits O:80, does something that makes O want to make a req, which it does using the revtunnel and then responds to user with that info
asthasr has quit [Ping timeout: 250 seconds]
<foobar020> so the server has an app that uses mechanize to parse various info from a secure website
<foobar020> but that secure website is only accessible to the client IP
<fuzzyfuzz> You want an apache proxy?
<foobar020> the client doesn't have the dependencies necessary to run the parser app
<fuzzyfuzz> With a redirect from plain-text to ssl?
<fuzzyfuzz> *clear-text
jgt1 has joined #ruby
<foobar020> Those are just words to me at this particular moment in time. I'll look into them but right now I don't know if that's what I want
<foobar020> Sorry I'm not coming into this as well-equipped as I'd like
<foobar020> or knowledgable
cdg has quit [Remote host closed the connection]
nerfando has joined #ruby
kies^ has joined #ruby
northfurr has quit [Quit: northfurr]
<zambini> Is port 80 listened to on your remote machine?
jgt has quit [Ping timeout: 245 seconds]
pawnbox has joined #ruby
dlitvak_ has quit [Remote host closed the connection]
<foobar020> Yes
<zambini> What about your local machine? It looks like with your current setup it's going to redirect traffic to your local machine:80
tomchapin has joined #ruby
tulak has quit []
<zambini> or, sorry wrong terminology
agent_white has quit [Quit: brb]
<foobar020> well that's the idea (I'm pretty sure anyway). so we have A, B, and C. A is local machine, B is remote machine, C is machine only accessible to A's IP
<zambini> It's going to try opening a tunnel to local machine via port 80
<foobar020> A wants to parse output from C, but doesn't have the dependencies necessary to do so. So I want to open C from B, using A's IP
djbkd has quit [Ping timeout: 265 seconds]
<foobar020> I see where the current command is wrong, I'm trying to figure out how to make it right I guess
<zambini> Okay, cool. Did you run it as sudo? Port 80 is a privileged port
blackmesa has joined #ruby
saneax_AFK is now known as saneax
<fuzzyfuzz> Dude, unless this is for academic purposes, you should check out AMQP.
saneax is now known as Guest42435
pawnbox has quit [Ping timeout: 255 seconds]
<foobar020> googling it now
<fuzzyfuzz> AMQP runs on both your nodes, you send your request across AMQP to a listener and yoru listener does a thing.
ascarter has joined #ruby
<fuzzyfuzz> Check out Ruby's 'bunny' library and RabbitMQ.
ascarter has quit [Client Quit]
dlitvak has joined #ruby
<fuzzyfuzz> You're essentially asking how to build an event bus.
<fuzzyfuzz> And that's what AMQP is.
<zambini> In your setup: B says "A, send this to C and tell me what it says" via requests, not via tunneling
sinkensabe has quit [Remote host closed the connection]
sinkensabe has joined #ruby
nerfando has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
scottschecter has joined #ruby
ascarter_ has joined #ruby
CloCkWeRX has joined #ruby
episplat is now known as epithet
freerobby has joined #ruby
who42 has quit [Quit: Leaving]
superscott has quit []
scoot has quit [Ping timeout: 250 seconds]
Rodya_ has joined #ruby
dlitvak has quit [Ping timeout: 256 seconds]
<foobar020> so it's looking like what i really want to do
blackmesa has quit [Ping timeout: 260 seconds]
<foobar020> is route requests through A
<foobar020> can i send an entire request object over this protocol?
jam_ has joined #ruby
asccigcc has quit [Quit: asccigcc]
sinkensabe has quit [Ping timeout: 260 seconds]
asthasr__ has joined #ruby
felltir has joined #ruby
PERSIAN has quit []
mclong has joined #ruby
janebootydoe has joined #ruby
<zambini> Instead of sending the received request, you'll send a message with parameters to A from B, asking it to talk to C and respond
Rodya_ has quit [Ping timeout: 264 seconds]
asthasr_ has quit [Ping timeout: 265 seconds]
harai54 has joined #ruby
jam_ has quit [Ping timeout: 240 seconds]
<foobar020> That makes sense
kies^ has quit [Ping timeout: 246 seconds]
dlitvak has joined #ruby
davedev2_ has quit []
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dlitvak has quit [Ping timeout: 245 seconds]
chipotle has quit [Quit: cheerio]
krobzaur has quit [Ping timeout: 256 seconds]
jackjackdripper has joined #ruby
lemur has quit [Remote host closed the connection]
jackjackdripper1 has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
kies has quit [Ping timeout: 246 seconds]
Guest83269 has joined #ruby
minimalism has joined #ruby
spider-mario has quit [Remote host closed the connection]
ReK2 has quit [Ping timeout: 240 seconds]
<Guest83269> how much to clone this site, seedr.cc
<Guest83269> node cloud torrent site
<Radar> Guest83269: $25k
<pizzaops> Can somebody remind me of the way to test a gem from source while you're working on it, without having to build it every time first? I seem to remember that there's a way, but I can't remember what it is :/
<pizzaops> E.g. if I have an executable in the bin directory that I want to test.
kies^ has joined #ruby
graffix222 has quit [Ping timeout: 260 seconds]
<Guest83269> 25k jesus thats so much
graffix222 has joined #ruby
pawnbox has joined #ruby
<Darmani> @Radar - Hey boo.
<Radar> Guest83269: $30k now
<Radar> due to inflation
<zambini> pizzaops: pass in `path: /path/to/gem` in your Gemfile (make sure version matches) after building it
<pizzaops> zambini: I'm trying to do the opposite.
<pizzaops> I'm trying to test it *before* building it.
<pizzaops> It looks like you can just bundle exec though.
<Guest83269> Radar seriously ho much to build a clone of that site
<pizzaops> E.g. I don't want to have to build it every time I make a minor change, while I'm developing, to see if it works.
<zambini> Before building it or before 'publishing' it?
<Darmani> I can do it for $12.
felixdd has joined #ruby
<Radar> Guest83269: Pay peanuts get monkeys.
<Darmani> and some food stamps.
<pizzaops> Before running gem build.
<pizzaops> Before building it.
<zambini> ah
<Radar> Guest83269: and I never ever do fixed priced bidding
<pizzaops> zambini: but bundle exec appears to handle it fine
<Radar> Guest83269: It's $250/hr if you want to hire me.
ReK2 has joined #ruby
<Darmani> @Radar holy shit Radar you worth that much
<Darmani> goddamn
<Radar> Darmani: Wrote some books about Rails.
<Radar> Darmani: Kind of a Bigg deal.
<Radar> bbl
<Guest83269> 250 you are drunk
<pizzaops> Darmani: ahah, that's roughly what my company charges for my time.
<Darmani> what the fuuuuck
<pizzaops> (Not as a developer)
<Guest83269> consultant lol
<Darmani> @pizzaops - I'm trying to get there fam
<pizzaops> Darmani: I don't get $250/hr. I'm salaries.
<domgetter> Darmani: notice he said "what my company charges" not "what my company pays me"
<pizzaops> s/salaries/salaried
DLSteve has joined #ruby
<zambini> pizzaops: rspec not cutting it?
<Darmani> @domgetter - :o good point.
moei has quit [Quit: Leaving...]
<pizzaops> zambini: I'm sorry?
crime has quit [Quit: Page closed]
<zambini> To test your gem
<Guest83269> sounds like agency worker
<pizzaops> zambini: oh, no, rspec is fine, but sometimes I'm just trying a bunch of things.
pawnbox has quit [Ping timeout: 276 seconds]
<pizzaops> So I want to run something, drop a binding.pry in, etc. without having to build over and over
yqt has quit [Ping timeout: 272 seconds]
atomical_ has joined #ruby
freerobby has quit [Quit: Leaving.]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
freerobby has joined #ruby
ascarter_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mistermocha has quit [Remote host closed the connection]
atomical has quit [Ping timeout: 240 seconds]
sankaber has joined #ruby
joonty has joined #ruby
northfurr has joined #ruby
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jackjackdripper1 has quit [Quit: Leaving.]
<Radar> Guest83269: I am completely sober. Again: pay peanuts, get monkeys. I am not a monkey, I am expensive.
<Radar> Guest83269: What a monkey does in 10 hours I do in 1.
<Radar> Monkey charges $50/hr
Mr_Pancake has quit [Ping timeout: 264 seconds]
<Radar> Do the math
El3ktra has joined #ruby
El3ktra has quit [Changing host]
El3ktra has joined #ruby
Seich has quit [Ping timeout: 240 seconds]
joonty has quit [Ping timeout: 276 seconds]
<felltir> 10x klaxon
atomical has joined #ruby
<nfk|laptop> Radar, i don't think anyone's hourly rate is above some $160
akem has quit [Quit: Bye]
dorei has quit []
Seich has joined #ruby
<nfk|laptop> anyway, sleep, tomorrow/today will be hellish, probably
baweaver has joined #ruby
nfk|laptop has quit [Quit: yawn]
<eam> $160/hr is annualized $320k/yr?
<Radar> nfk|laptop: Well, you've met someone who charges that.
<eam> assuming 40hrs/week which contractors generally won't hit
zeroDivisible has quit [Quit: WeeChat 1.3]
<Radar> Base rate of $150/hr but I add up to $100 if I think the client is going to be troublesome. it's based on a percentage.
<mg^> reminds me of a conversation when I worked at Big Company. Them: "We can pay for 3 FTEs worth people at Outsourcing Firm for the cost of you" Me: "Go ahead and try that out."
<Radar> So 100% chance of client being difficult == $100
<eam> I know a guy who doesn't write code. All he does is computer work at people's home (think geek squad) and his hourly rate is >$100
atomica__ has joined #ruby
binaryplease has quit [Ping timeout: 245 seconds]
atomical_ has quit [Ping timeout: 276 seconds]
Mr_Pancake has joined #ruby
<eam> I think the shop billing rate for a car mechanic or a plumber is around $150/hr
AlphaAtom has joined #ruby
<mg^> I went and worked for Outsourcing Firm for Big Company so they got to pay for me *and* three people because I was not allowed to bill more than 40 hours a week and they needed my skills.
<eam> mg^: hired the people under you?
<eam> seems to be a pretty standard thing for name-brand contractors
<eam> "we've brought on so-and so and his team" and then the name brand so and so gets a percentage
<mg^> more complicated from an HR/international perspective but essentially that
<eam> and then outsources the crapwork to dudes in eastern EU or whatever
atomical has quit [Ping timeout: 265 seconds]
<mg^> My overseas team was actually pretty good. Definitely several I'd hire in a heartbeat.
baweaver has quit [Ping timeout: 276 seconds]
<eam> oh yeah, I absolutely don't mean to denigrate the quality of that kind of outsourcing
<eam> the idiot in this equation is the company who can't recruit competent talent on their own :)
<diegoviola> Radar: where do you find your clients?
finisherr has quit [Ping timeout: 260 seconds]
<eam> mg^: some of the best international hires we recruited over a decade ago now live and work in my office :)
<mg^> nice
Guest83269 has quit [Quit: Leaving]
<mg^> I wish the startup would finish cranking already, I'd love to get some of my old teammates back.
<eam> ah, well, we all went to the same startup years back sooo :D
<mg^> nice
blackgoat has quit [Quit: WeeChat 1.3]
<mg^> I did the same thing, initially with one other guy and now two from the old Big Company, but we're not bringing enough in yet for us to bring on more
marr has quit [Ping timeout: 245 seconds]
<mg^> but I've got a whole list of potential recruits in my back pocket for when the cash starts rolling in
<eam> sounds about right, thank goodness for CA's employee protections which invalidate noncompetes and non-recruit clauses
Mr_Pancake has quit [Ping timeout: 265 seconds]
kiidbrian has quit [Ping timeout: 256 seconds]
Mr_Pancake has joined #ruby
djbkd has joined #ruby
bitri has joined #ruby
<zambini> ^
mclong has quit [Quit: Leaving]
frem has quit [Quit: Connection closed for inactivity]
sdwrage has quit [Quit: This computer has gone to sleep]
snockerton has quit [Ping timeout: 265 seconds]
Mr_Pancake has quit [Ping timeout: 246 seconds]
pdoherty has joined #ruby
blackmesa has joined #ruby
ledestin has joined #ruby
Mr_Pancake has joined #ruby
nerfando has joined #ruby
nerfando has quit [Max SendQ exceeded]
baweaver has joined #ruby
nerfando has joined #ruby
bricker has quit [Quit: leaving]
nerfando has quit [Max SendQ exceeded]
Rodya_ has joined #ruby
nerfando has joined #ruby
nerfando has quit [Max SendQ exceeded]
oz has quit [Ping timeout: 250 seconds]
nerfando has joined #ruby
nerfando has quit [Client Quit]
Kryptonical has left #ruby ["See ya"]
ajf- has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
oz has joined #ruby
Rodya_ has quit [Ping timeout: 245 seconds]
ico has quit [Remote host closed the connection]
janebootydoe has quit [Remote host closed the connection]
janebootydoe has joined #ruby
gambl0re has quit []
krz has joined #ruby
casadei has joined #ruby
Anderson69s has joined #ruby
davedev24 has joined #ruby
dlitvak has joined #ruby
axsuul has quit [Ping timeout: 250 seconds]
jgt1 has quit [Ping timeout: 260 seconds]
woodruffw has quit [Changing host]
woodruffw has joined #ruby
griffindy has joined #ruby
chipotle has joined #ruby
RobertBirnie has quit [Ping timeout: 272 seconds]
duckpuppy has joined #ruby
dlitvak has quit [Ping timeout: 276 seconds]
sleepee has quit [Quit: Leaving]
iwaffles has joined #ruby
pawnbox has joined #ruby
foobar020 has quit [Quit: Leaving]
n00bdev has joined #ruby
casadei has quit [Remote host closed the connection]
domgetter has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
kt2 has quit [Quit: ...]
DLSteve has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arthurix has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 246 seconds]
Ebok has quit [Read error: Connection reset by peer]
dlitvak has joined #ruby
Ebok has joined #ruby
janebootydoe has quit [Quit: Leaving]
arthurix has joined #ruby
kt2 has joined #ruby
Seich has quit [Ping timeout: 250 seconds]
mistermocha has joined #ruby
casadei has joined #ruby
Seich has joined #ruby
DLSteve has joined #ruby
mostlybadfly has joined #ruby
b2zeldafreak has joined #ruby
lkba_ has joined #ruby
crdpink has quit [Quit: q term]
yeticry_ has joined #ruby
dlitvak has quit [Ping timeout: 276 seconds]
lkba has quit [Ping timeout: 245 seconds]
mistermocha has quit [Ping timeout: 276 seconds]
yfeldblum has quit [Remote host closed the connection]
crdpink has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
podman has quit [Quit: Connection closed for inactivity]
Limix has quit [Quit: Limix]
yeticry has quit [Ping timeout: 240 seconds]
b2zeldafreak has quit [Quit: Leaving]
b2zeldafreak has joined #ruby
casadei has quit [Remote host closed the connection]
n00bdev has quit []
zambini has quit [Quit: Leaving.]
kt2 has quit [Quit: ...]
blackmesa has quit [Quit: WeeChat 1.3]
b2zeldafreak has quit [Client Quit]
b2zeldafreak has joined #ruby
gambl0re has joined #ruby
Yzguy has joined #ruby
kalopsian has joined #ruby
solocshaw has joined #ruby
<b2zeldafreak> Hi, can anyone point me to a good example (or tutorial) for using Hexagonal or Clean architecture with Rails?
<harly> what's that?
kt2 has joined #ruby
Anderson69s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<b2zeldafreak> Decoupling your business logic from the Rails framework essentially
RobertBirnie has joined #ruby
felltir has quit [Remote host closed the connection]
dcunit3d has quit [Ping timeout: 240 seconds]
gbgdev has quit [Remote host closed the connection]
<pizzaops> I don't quite understand why the config.whatever calls inside my hash here return undefined method config. Shouldn't I be able to call a class method anywhere inside the class? E.g. it works outside the initialize method but not inside it. https://gist.github.com/pizzaops/bd0378bfe9ce6795a4cf
pawnbox has joined #ruby
<bnagy> pizzaops: if in doubt `p self`
Yzguy has quit [Quit: Zzz...]
<pizzaops> nil...
fourq is now known as fourq|away
fourq|away is now known as fourq
atomical has joined #ruby
<pizzaops> But self.class is cronenberg::connection
<bnagy> you can call _instance_ methods anywhere because self is the instance inside instance method bodies
<bnagy> if you want to call something on self.class then do that :)
<pizzaops> Oh I see, the instance is not the class.
<pizzaops> That makes sense.
al2o3-cr has quit [Read error: Connection reset by peer]
welovfree has joined #ruby
al2o3-cr has joined #ruby
RobertBirnie has quit [Ping timeout: 256 seconds]
<bnagy> _personally_ I often use self.some_method when I do that just to make it clear
<welovfree> Hello guys, what are the prerequisites to start learning Ruby? and what's Ruby on Rails?
<bnagy> because auto-dispatch to self sometimes makes it look like you're calling some keyword or magic or something
pawnbox has quit [Ping timeout: 246 seconds]
jam_ has joined #ruby
<pizzaops> I changed self to an instance method. It doesn't really matter.
atomica__ has quit [Ping timeout: 264 seconds]
<pizzaops> It will always get the same values since it's reading a config file.
<bnagy> well they're very different, especially for config
kt2 has quit [Quit: ...]
<bnagy> but whatever works :) You could also make the config a class or even a singleton and pass it as an initialize param to stuff
RobertBirnie has joined #ruby
Jardayn has quit [Quit: Leaving]
<pizzaops> Config is a class already, which does some logic around reading env variables or a config file
<pizzaops> Thus Cronenberg::Config.new
<Radar> diegoviola: internet
<Radar> diegoviola: I don't go looking usually. They find me.
|ifei5good has joined #ruby
<diegoviola> Radar: cool
Darmani has quit [Ping timeout: 252 seconds]
|ifei5g00d has quit [Ping timeout: 246 seconds]
stannard has joined #ruby
bronson has quit [Remote host closed the connection]
al2o3-cr has quit [Read error: Connection reset by peer]
houhoulis has joined #ruby
Rodya_ has joined #ruby
welovfree_ has joined #ruby
al2o3-cr has joined #ruby
stannard has quit [Ping timeout: 240 seconds]
bruce_lee has quit [Read error: Connection reset by peer]
welovfree has quit [Ping timeout: 256 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
shinnya has quit [Ping timeout: 246 seconds]
dlitvak has joined #ruby
duckpuppy has quit [Ping timeout: 250 seconds]
Darmani has joined #ruby
domgetter has joined #ruby
jgt1 has joined #ruby
bb010g has joined #ruby
dlitvak has quit [Ping timeout: 264 seconds]
TomPeed has joined #ruby
jgt1 has quit [Ping timeout: 256 seconds]
<b2zeldafreak> What does the ':' operator do?
baweaver has quit [Remote host closed the connection]
diegoviola has quit [Quit: WeeChat 1.3]
duckpuppy has joined #ruby
welovfree_ has quit [Quit: Leaving]
pawnbox has joined #ruby
arescorpio has joined #ruby
<Ox0dea> There's no such thing.
sdwrage has joined #ruby
<Ox0dea> Prefixing an identifier with ':' turns it into a Symbol.
viperman has quit [Read error: Connection reset by peer]
<Ox0dea> And then there's `foo ? if_truthy : if_falsy`, which is a ternary expression.
pawnbox has quit [Ping timeout: 255 seconds]
<Ox0dea> b2zeldafreak: ^
<harly> and the hash alternative. :key => 'value' vs key: 'value'
peeja has joined #ruby
<b2zeldafreak> And what is a symbol?
<Ox0dea> A Symbol is essentially a String, except that it compares by identity rather than character-wise.
dcunit3d has joined #ruby
<Ox0dea> :foo is always the same Object, whereas two separate instances of the String "foo" will be different objects.
<b2zeldafreak> So is :thisstring representing "thisstring" or some other value?
<Ox0dea> >> [:foo, :foo, 'foo', 'foo'].map(&:object_id) # b2zeldafreak
<ruby[bot]> Ox0dea: # => [450738, 450738, 547466630, 547466620] (https://eval.in/502446)
<b2zeldafreak> Can that run a function?
axsuul has joined #ruby
<Ox0dea> Huh?
<harly> they're kinda like constants too.
<harly> >> Symbol.all_symbols.size
<ruby[bot]> harly: # => 2717 (https://eval.in/502447)
<Ox0dea> >> ObjectSpace.each_object(Symbol).count
<ruby[bot]> Ox0dea: # => 0 (https://eval.in/502448)
<Ox0dea> Pop quiz: what happened there?
<harly> >> Symbol.all_symbols[1,5]
<ruby[bot]> harly: # => [:"\"", :"#", :"$", :%, :&] (https://eval.in/502449)
<Ox0dea> >> Symbol.all_symbols.max_by(&:size)
<ruby[bot]> Ox0dea: # => :GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID (https://eval.in/502450)
peeja has quit [Ping timeout: 260 seconds]
Chewy1121 has joined #ruby
nerium has quit [Quit: nerium]
<Chewy1121> Herro
<Chewy1121> Can anyone help me real quick
<Chewy1121> Oh hey Harly
<Chewy1121> Harly, how can I make a method go back to the prevouise method once it is done?
<harly> by calling it from the previous method :)
<Chewy1121> What?
joonty has joined #ruby
B1n4r10 has quit [Ping timeout: 250 seconds]
<Chewy1121> I mean as a new method
<Ox0dea> Chewy1121: That'll "just happen".
<Chewy1121> No no,
<Chewy1121> I mean, method 1 runs, then method 2 is called and is run. I want method 1 to run again
dcunit3d has quit [Ping timeout: 276 seconds]
<Chewy1121> But I do not want to specify method 1 at the end of method 2
<harly> well, for what you're trying to achieve you can either have method 1 as recursive, or loop in method one based on the result of method 2. but thinking "i want method 2 to jump to method 1" is probably the wrong way to think about it.
<Chewy1121> Ok
<Ox0dea> Chewy1121: Do you want method 1 to resume or start over?
B1n4r10 has joined #ruby
<Chewy1121> start over
<Ox0dea> Then you're being crazy.
<Chewy1121> What?
<harly> method1 { while (some condition) { method2; other stuff; } p 'method 1 done' }
<Chewy1121> Well method 2 is not in method 1
<Chewy1121> Lemme post the code
|ifei5g00d has joined #ruby
<Ox0dea> Shield your eyes. This is gonna hurt.
MyMind has joined #ruby
<Chewy1121> Lol what
yfeldblum has joined #ruby
axsuul has quit [Quit: Textual IRC Client: www.textualapp.com]
<Chewy1121> Someone might me in the admin method, alternatively someone might be in the user (cp) method
iwaffles has quit [Quit: iwaffles]
Ebok has quit [Read error: Connection reset by peer]
joonty has quit [Ping timeout: 240 seconds]
<Chewy1121> I want both to be able to access the g99 method, and rerun after wards
atomical_ has joined #ruby
Ebok has joined #ruby
<Chewy1121> do i just return g99?
<Chewy1121> in the admin and cp?
fsapo has quit [Remote host closed the connection]
Sembei has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
<harly> so g99 is a way to ask the user to enter a new pass?
|ifei5good has quit [Ping timeout: 260 seconds]
<Chewy1121> Yes, to update it
<harly> why don't you call it promp_pass
<harly> because g99. that's strange.
<Chewy1121> what is promp?
<Chewy1121> do you mean prompt?
<harly> yeah.
<Chewy1121> Or is promp a thing?
<Chewy1121> Ok, what does that do?
<harly> just a made up name
<Chewy1121> How would that work?
<harly> you could call it prompt_for_pass_and_awkwardly_store_in_globals too
baweaver has joined #ruby
<Chewy1121> Well I need to store it in an array
<Chewy1121> Sorry
<Chewy1121> Hash
<Chewy1121> (brain fart)
<Chewy1121> I could do everything in the control panel
atomica__ has joined #ruby
<Chewy1121> But I am trying to keep everything separate
astrobun_ has joined #ruby
atomical has quit [Ping timeout: 264 seconds]
jbrhbr has quit [Ping timeout: 260 seconds]
_Tariq has joined #ruby
gregf has quit [Ping timeout: 240 seconds]
<harly> well. first. all of that code is a bit kind of messy and hard to read. but to answer your specific question in cp and admin you would just call g99 when you want it.
<Ox0dea> What makes somebody name their variables like this?
<Chewy1121> I love it when u get confused like this
<harly> personally I do that with g99() cos the () makes it clearer it's a function call and not some random variable.
<Ox0dea> I'm not confused, I'm worried.
yfeldblum has quit [Ping timeout: 250 seconds]
<Chewy1121> Hehehe
<harly> but first thing. rename every one of those strange values like e50 b3 b4 with what they *represent*
<Chewy1121> Anways, harly. I want people to be able to access the same panel again
<Chewy1121> Actually
<Chewy1121> I figured out how to do it
baweaver has quit [Ping timeout: 240 seconds]
<harly> figured out *one way* to do it maybe. :)
ss_much has joined #ruby
<harly> there's many. the fun bit is picking the right one that's structured well and readable to other people.
atomical_ has quit [Ping timeout: 272 seconds]
<Chewy1121> Well check it, look at line 32
<harly> seriously though. go and rename all your variables to have names that represent what they are. not random letters and numbers.
<Chewy1121> With the case. if they pick pass I can just call g99, then put cp
<Chewy1121> Else if it is in the admin sections Ill just do g99 and then admin
<Chewy1121> No
<harly> b3 to password. b4 to unecessary_and_unused_copy_as_a_class_variable_of_entered_password, etc.
<Chewy1121> NO
<Chewy1121> No!
<Chewy1121> I luv it like that
<Chewy1121> Plus I don't want to because it would be too long to re write it
peeja has joined #ruby
<harly> woulnd't be long at all.
<Chewy1121> I got about 10,000 lines of code already written using those variables
<harly> now i think you're trolling
<Chewy1121> I am
<Chewy1121> Lol
<Chewy1121> Only like 300
<Chewy1121> But I still don't feel like re writing it
<Chewy1121> Plus they are simple and Easy to understand :D
<Chewy1121> Well for me at least
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 246 seconds]
LMity has joined #ruby
bronson has quit [Remote host closed the connection]
|ifei5good has joined #ruby
dcunit3d has joined #ruby
pawnbox has joined #ruby
<shevy> you are still picking silly-short method names?
<shevy> why not do alphabetical names... def a ... def b ... def c
|ifei5g00d has quit [Ping timeout: 245 seconds]
DrCode has quit [Read error: Connection reset by peer]
Dimik has quit [Ping timeout: 255 seconds]
<harly> or use a password generator for them? CrNJhhWp2CnEGxJgA6fR2h2FXW7XsV is particularly nice.
<shevy> haha
<harly> and with tab completion, you'd only have to enter 2-4 letters probably!
pawnbox has quit [Ping timeout: 265 seconds]
<eam> well, that's a constant
<harly> dang, my method is flawed.
<eam> I mean, you can do it
<harly> stop raining on my parade! *cries*
<eam> AFAIK a method can contain any characters at all
<eam> or none
<shevy> cool
<eam> it just gets a little awkward to use it
<harly> working on my variable name generator vim plugin now. it's going to be a hit!
<shevy> :P
LMity has quit [Ping timeout: 260 seconds]
allcentury has quit [Ping timeout: 265 seconds]
Rodya_ has joined #ruby
blackgoat has joined #ruby
bronson has joined #ruby
vdamewood has joined #ruby
hxegon has quit [Ping timeout: 272 seconds]
citrusfizz has joined #ruby
Rodya_ has quit [Ping timeout: 240 seconds]
ashemark has joined #ruby
<ashemark> Hello!!
arthropododo has joined #ruby
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Radar> hey ashemark
<Radar> How are things today?
Seich has quit [Ping timeout: 260 seconds]
moei has joined #ruby
<citrusfizz> hello, i have a crazy problem, i'm using activerecord to grab a simple value from a database. i'm then taking that and sending it to slacks API to a channel. in slack you can make text have a link. by doing <http://www.whatever.com|clickhere> so in my command in ruby it looks like this message = "<#{q.url}|clickhere> this should just post "click here" in...
<citrusfizz> ...the slack channel. but it outputs <http://www.whatever.com|clickhere> . the furstrating thing is, i tested it with ab = "http://www.whatever.com" then put in message = <#{ab}|click here> it works fine. so for some reason, it doesn't like my active record db call. what could be the issue?
<Radar> citrusfizz: In Slack, <http://whatever.com|clickhere> is not a link.
Seich has joined #ruby
<citrusfizz> if you pass "http://www.whatever.com|click here>" to a slack channel VIA the api, it resolves as "click here" with a link
<Radar> TIL
<Radar> code that is fetching this value from a database please.
<arthropododo> so are people starting to use Ruby in scientific computing yet?
bronson has quit [Remote host closed the connection]
<Radar> helpa is muted here, so I can't !8ball you
freerobby has quit [Quit: Leaving.]
<Radar> [14:46:53] <Radar>!8ball
<Radar> [14:46:54] <helpa>Yes – definitely.
<Radar> But I can run the command in another channel.
<Radar> HELPA HAS SPOKEN.
tomjoro has quit [Remote host closed the connection]
<chipotle> so i use sublime text 3 because the last time i tried atom in the pre 1.x days, it was slow as hell. i read a long thread saying they would fix it for 1.x ... is that true? or is it still maddening slow?
<Radar> ?try chipotle
<ruby[bot]> chipotle: Why don't you try it and see for yourself?
<chipotle> i can't at the moment
<Radar> in my experience it's still slow as molasses and Sublime Text 3 wins
<Radar> even MacVim was terrible
<shevy> hehe
DLSteve has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy> arthropododo I think it depends on how many people will use ruby there, from my experience, the "normal" ruby user is more likely to use ruby for commandline scripting or rails, rather than for science-related stuff
harai54 has quit [Ping timeout: 272 seconds]
<harly> mmm, but is the "normal" science programmer likely to use ruby?
northfurr has quit [Quit: northfurr]
northfurr has joined #ruby
terminalrecluse has joined #ruby
finisherr has joined #ruby
<shevy> more likely to use python!
rodolfowtf has quit [Remote host closed the connection]
sankaber has joined #ruby
bronson has joined #ruby
<ashemark> is there a way I could get autocompletion for imported gems in atom?
<Radar> citrusfizz: checks out for me.
kies has joined #ruby
Guest96374 has joined #ruby
sankaber has quit [Remote host closed the connection]
sankaber has joined #ruby
n00bdev has joined #ruby
<citrusfizz> what do you mean
grassass has quit [Ping timeout: 240 seconds]
<Radar> citrusfizz: Everything you're doing is exactly as I would do it. I don't see what could be wrong.
graphettion has joined #ruby
<citrusfizz> its crazy, if i do output gg.class i get String, q.url.class i get string
<Radar> lowercase s?
<citrusfizz> my bad
<citrusfizz> i meant String
<citrusfizz> is there any trick to getting the value and re-assgining it before i put it in the message? something that not just a pointer
<citrusfizz> i just don't freaking understand this one
<chipotle> arthropododo: my background is a PhD in theoretical physics...we never used ruby. python has a huge headstart on ruby with all its libraries etc for scientific computing. and then there is c/c++
<citrusfizz> maybe something to do with encoding?
<shevy> citrusfizz depends on the encoding, if you have an umlaut then .upcase .downcase may fail depending on your encoding; e. g. I have that sometimes when I use some ISO encoding
<shevy> >> "ü".upcase
graffix222 has quit [Ping timeout: 260 seconds]
braincrash has quit [Quit: bye bye]
<arthropododo> shevy , chipotle thanks
<Guest96374> list
Guest96374 has left #ruby ["WeeChat 0.4.2"]
yfeldblum has joined #ruby
terminalrecluse has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<arthropododo> I'm starting a project and since nobody imposed anything might as well try to mix ruby and C++ and see how that works out
<shevy> arthropododo I usually saw the combination of c++ and python there, for instance relion, but also some projects that require cluster computation via openmpi and such, always C++, and always python :)
baweaver has joined #ruby
<chipotle> shevy: oh and of course, R
<shevy> I dunno, usually R was more of an addon then, mathematica was also used, but I meant for integrated packages, when the author wrote it in C++, the scripting language that followed with it usually was python
braincrash has joined #ruby
B1n4r10 has quit [Ping timeout: 240 seconds]
radgeRayden has quit [Read error: Connection reset by peer]
yfeldblum has quit [Ping timeout: 260 seconds]
<arthropododo> for all those scientific python applications do people generally stick to python 2.x?
zast has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
ashemark has left #ruby ["WeeChat 1.3"]
peeja has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
jgt1 has joined #ruby
<shevy> I think most did
<shevy> I hate the python2 versus python3 split
JohnT has joined #ruby
kp666 has joined #ruby
kp666 has quit [Max SendQ exceeded]
kp666 has joined #ruby
hxegon has joined #ruby
framling has joined #ruby
elnur has left #ruby ["Leaving"]
pawnbox has joined #ruby
jgt1 has quit [Ping timeout: 272 seconds]
voidDotClass has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
<_Tariq> shevy: Is there any attempt to remedy the divide?
<_Tariq> Or is the fork going to stay forever?
<shevy> I don't think they'll will remedy much at all, they will probably go the "more and more people will use python 3 and then this will resolve on its own eventually"
<_Tariq> ok
hxegon has quit [Ping timeout: 264 seconds]
pawnbox has quit [Ping timeout: 240 seconds]
krz has quit [Ping timeout: 245 seconds]
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
emilford has quit [Ping timeout: 272 seconds]
<_Tariq> got it
<Ox0dea> This thing exists to prevent widespread Python 3 adoption.
allcentury has joined #ruby
<_Tariq> I tend to hate change, so I might be rooting for this library
<_Tariq> Maybe Python 2 should turn into its own language
dfinninger has joined #ruby
<_Tariq> with its own unique name
graffix222 has joined #ruby
<Radar> Python 3, you mean?
<Radar> Also: a reminder that #ruby-offtopic exists.
<_Tariq> Oh yeah
<Radar> Thank you.
st0opkid has joined #ruby
kknight has joined #ruby
allcentury has quit [Ping timeout: 245 seconds]
arescorpio has quit [Quit: Leaving.]
Rodya_ has joined #ruby
rippa has joined #ruby
Yzguy has joined #ruby
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has joined #ruby
grassass has joined #ruby
Rodya_ has quit [Ping timeout: 265 seconds]
tvw has joined #ruby
northfurr has quit [Quit: northfurr]
st0opkid has quit [Read error: Connection reset by peer]
govg has quit [Ping timeout: 240 seconds]
st0opkid has joined #ruby
st0opkid has quit [Max SendQ exceeded]
dfinninger has quit [Read error: Connection reset by peer]
dfinninger has joined #ruby
kt2 has joined #ruby
JohnT has joined #ruby
kt2 has quit [Client Quit]
fourq is now known as fourq|away
d0nn1e has quit [Ping timeout: 276 seconds]
arthropododo has quit [Quit: Page closed]
d0nn1e has joined #ruby
solocshaw has quit [Ping timeout: 264 seconds]
asthasr__ has quit [Quit: Leaving]
dcunit3d has quit [Ping timeout: 260 seconds]
kknight has quit [Quit: Leaving]
exadeci has joined #ruby
usershell has joined #ruby
krz has joined #ruby
bitri has quit [Quit: Textual IRC Client: www.textualapp.com]
<Ox0dea> 18>> ? #ruby.users.count(&:active?)
<ruby[bot]> Ox0dea: # => /tmp/execpad-70f0df6590c7/source-70f0df6590c7:2: warning: invalid character syntax; use ?\s ...check link for more (https://eval.in/502477)
<Ox0dea> Worth a shot.
usershell has quit [Remote host closed the connection]
yfeldblum has joined #ruby
northfurr has joined #ruby
gix has quit [Ping timeout: 246 seconds]
duckpuppy has quit [Ping timeout: 260 seconds]
benlieb has quit [Quit: benlieb]
<Ox0dea> I sent a literal ^C; ruby[bot] was supposed to say 3. :<
<shevy> I want ruboto back!
benlieb has joined #ruby
benlieb has quit [Client Quit]
carella has quit [Read error: Connection timed out]
<Ox0dea> ^
northfurr has quit [Client Quit]
kalopsian has quit [Ping timeout: 255 seconds]
carella has joined #ruby
graffix222 has quit [Read error: Connection reset by peer]
graffix222 has joined #ruby
chipotle has quit [Ping timeout: 255 seconds]
arup_r has joined #ruby
gix has joined #ruby
<Darmani> I can't code anymore.
<Darmani> I don't mean ever.
joonty has joined #ruby
<Darmani> Just not anymore today.
<Darmani> Fuck me.
* Darmani cries in a corner
bronson has quit [Remote host closed the connection]
b2zeldafreak has quit [Remote host closed the connection]
<Ox0dea> All I hear is... oh.
northfurr has joined #ruby
<Darmani> What happened to our intellectual conversation? T.T
<Darmani> @Ox0dea - You suck.
<shevy> lol
<Ox0dea> What happened to the P in PM standing for pterodactyl?
iateadonut has joined #ruby
<Darmani> Is that what it stood for?
<shevy> I just read that they showcase the biggest dinosaur in new york soon
<Darmani> I had no idea.
pawnbox has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
cornerma1 has joined #ruby
<Ox0dea> *ptarmigan
<Darmani> @shevy - dam for real? What kinda dinosaur?
<shevy> Darmani dunno, only saw it briefly on a TV teleprompter some minutes ago
chipotle has joined #ruby
_Tariq has quit [Remote host closed the connection]
<Darmani> @shevy - People still watch tv?
<Darmani> What is this 2004?
hxegon has joined #ruby
<shevy> think of the children AND THE ELDERLY PEOPLE!
skcin7 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Darmani> @shevy - NO ONE THINKS OF THEM
Bloomer has joined #ruby
<Darmani> @shevy - lulz
joonty has quit [Ping timeout: 240 seconds]
mistermocha has joined #ruby
guacamole has quit [Quit: Textual IRC Client: www.textualapp.com]
cornerman has quit [Ping timeout: 240 seconds]
pawnbox_ has joined #ruby
cornerma1 is now known as cornerman
lacuna has quit [Remote host closed the connection]
hxegon has quit [Ping timeout: 246 seconds]
pawnbox has quit [Ping timeout: 245 seconds]
mistermocha has quit [Ping timeout: 260 seconds]
hxegon has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea> Darmani: Exercise: find the longest sequence of unique speakers in #ruby history.
<Ox0dea> It's probably 7.
<Radar> [16:00:44] <Darmani>I can't code anymore.
<Radar> Congratulations you have become a programmer.
<Darmani> @Radar - Lmao is that all it took? xD
usershell has joined #ruby
<Radar> Darmani: Programming is really all about... well, put it this way: "Yes, yes... use your hate."
<Darmani> @Ox0dea - The longest sequence of unique speakers being people who have only commented like once or twice? How long does the sequence need to be?
<Ox0dea> Darmani: Like, right now, the sequence is three.
<Darmani> @Radar - You sound like the Dark Lord of the Sith.
<Ox0dea> And now it's two.
<Darmani> @Radar - That's who you really are isn't it?
<Radar> Darmani: Maybe.
harai54 has joined #ruby
<Radar> Darmani: I'd like to think of myself more as a Frank Underwood.
<Darmani> @Radar - Haha ruthless and charming. Good combination lol
<Ox0dea> Did you mean Al Swearengen?
<Darmani> @Ox0dea - I'll get right on it captain.
* Darmani salutes
<Radar> It's because of my shockingly good looks (because I'm Australian)
sankaber has joined #ruby
<Ox0dea> Can confirm Radar is handsome.
<Darmani> @Radar - Crikey mate, don't get ahead of yourself now =P
sankaber has quit [Client Quit]
<Darmani> @Ox0dea - How do you know? Lol
<Ox0dea> Darmani: Lucky guess.
dcunit3d has joined #ruby
<Darmani> @Ox0dea - Riiiiiight =p
<shevy> Darmani it's the looks you get if you have to survive in an alien landscape, the ruggedness
sigurding has joined #ruby
Yzguy has quit [Quit: Zzz...]
<Ox0dea> > Drop bears are carnivorous, tree-dwelling marsupials found throughout Australia.
<Darmani> Lmao I saw a tv show back in the day about Australia, it was a special about all the shit over there that could kill you.
<Darmani> It was like a week long series on NatGeo lmao
finisherr has quit [Quit: finisherr]
<Ox0dea> Well, they must've really pruned the list.
pawnbox_ has quit [Remote host closed the connection]
<Darmani> pruned?
<Darmani> Interesting choice of words.
<Ox0dea> You should learn to English gooder.
finisherr has joined #ruby
<Ox0dea> prune (v.intr.): To remove what is superfluous or undesirable.
finisherr has quit [Client Quit]
<Darmani> @Ox0dea - Thank you for that wonderful definition professor.
<Darmani> Does your astounding vocabulary help you sleep at night?
dfinninger has quit [Remote host closed the connection]
<Ox0dea> Get pruned, mate.
<baweaver> Ox0dea: does whitequark do JSON responses?
<Ox0dea> baweaver: Er, there's an "API".
<baweaver> poking about in the network tab for the endpoints
pawnbox has joined #ruby
<baweaver> well that's not very pretty at all....
kalopsian has joined #ruby
kknight has joined #ruby
<Ox0dea> It's pre-prettied. :<
Yzguy has joined #ruby
<baweaver> Is there an un-pre-pretty?
<Ox0dea> No. :(
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<baweaver> hm. Regex time!
astrobun_ has quit [Remote host closed the connection]
<Ox0dea> http://logs.ryanbigg.com/ruby is only available as HTML as well. :/
Rodya_ has joined #ruby
<Ox0dea> http://logs.ryanbigg.com/ruby?date=2014-01-09 is as far back as it goes.
Yzguy has quit [Client Quit]
kalopsian has quit [Ping timeout: 272 seconds]
M-mistake has quit [Quit: node-irc says goodbye]
yfeldblum has quit [Remote host closed the connection]
M-mistake has joined #ruby
Xeago has joined #ruby
skcin7 has joined #ruby
Limix has joined #ruby
skcin7 has quit [Max SendQ exceeded]
Xeago has quit [Ping timeout: 264 seconds]
govg has joined #ruby
zast has quit [Remote host closed the connection]
skcin7 has joined #ruby
<Chewy1121> I haz another problemo
<Chewy1121> Good sir! Could you help me out?
astrobun_ has joined #ruby
kknight has quit [Read error: Connection reset by peer]
northfurr has quit [Quit: northfurr]
<Chewy1121> Herrrooooo
<Chewy1121> Can someone help me with this code?
northfurr has joined #ruby
<Cohedrin> #1 stop using class variables
<Cohedrin> now that thats out of the way
<Cohedrin> we have no idea what you're trying to do
<Cohedrin> maybe you should explain your problem
jgt1 has joined #ruby
kknight has joined #ruby
<Ox0dea> Cohedrin = Coheed + Excedrin?
<Cohedrin> also, do yourself a favor and get rubocop installed in your editor :+1: https://github.com/bbatsov/rubocop
<Cohedrin> nope, theres litterally no meaning behind it
<Cohedrin> look the name when I was young on a whim, its never taken anywhere so thats my username now
<Cohedrin> lol
<Cohedrin> I mean, there may be a meaning, not one I'm aware of though
jgt1 has quit [Ping timeout: 246 seconds]
<Chewy1121> Test out the code
<Chewy1121> You will see the problem
vikas027_ has joined #ruby
duckpuppy has joined #ruby
kalopsian has joined #ruby
<Cohedrin> You came here asking for help. If you want help, you should tell us what your problem is
<Ox0dea> Chewy1121: Have you come to Ruby from some other language?
n00bdev has quit []
vikas027 has quit [Ping timeout: 252 seconds]
northfurr has quit [Quit: northfurr]
Rodya_ has quit [Remote host closed the connection]
duckpuppy has quit [Ping timeout: 272 seconds]
domgetter has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<pizzaops> Is there a way to test a class instance method without invoking the initialize method? This method should work on its own, and doing the scaffolding to make the initialize method work at that point doesn't feel necessary.
Mackerel has joined #ruby
<Chewy1121> sigh
<Chewy1121> Test out the code
Kneecaps has joined #ruby
<Ox0dea> pizzaops: It shouldn't be an instance method if it's not intended to be invoked on instances.
<Chewy1121> It will show you the probelm 10x faster than explaining it
<Chewy1121> But if you really want me too
<pizzaops> @Ox0dea ah...that's true, this method really only need to ever be invoked once per "run" of the application.
<Chewy1121> The puts at the end, where it prints out username, pin, password and rank print out multiple times
<Chewy1121> I dunno how to fix that
<duoi> hi guys, im the cto of a large company. can i use rubies to make my company cloud-aware?
joonty has joined #ruby
<Ox0dea> !cops
bronson has joined #ruby
vikas027_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nerium has joined #ruby
vikas027 has joined #ruby
pawnbox has quit [Remote host closed the connection]
<Chewy1121> duoi
<Chewy1121> Retard-Alert
<harly> "scaffolding to make the initialize method work" sounds so compliated.
<Cohedrin> duoi gem install skynet
<Cohedrin> should solve the problem for you
<Chewy1121> Lol
<Chewy1121> "Skynet"
<harly> gitlab.com header message: Microsoft Azure is performing maintenance between 13 Jan 16:00 UTC and 16 Jan 16:00 UTC. This may cause up to 15 minutes of outage.
<Chewy1121> Hahahaha
<harly> lol azure.
vikas027 has quit [Read error: Connection reset by peer]
<pizzaops> Ox0dea: this — https://gist.github.com/pizzaops/7349fe150137b7c5a92f — should really just be `@@default_config_location = File.join(Dir.home, '.vcenter.conf')` right? E.g. there's really no need for a method. And it never changes.
<Ox0dea> pizzaops: Make it a constant.
joonty has quit [Ping timeout: 265 seconds]
<Ox0dea> It's right there in the name. :P
<duoi> Cohedrin i am more interested in using the "ruby on rains" method i found in yahoo but i am scared of flooding.
<pizzaops> haha
<Chewy1121> ox0dea Can you help me with da problemo?
<pizzaops> Ox0dea: is it acceptable to have @@CONSTANTS ?
<Ox0dea> pizzaops: Why, though?
sigurding has quit [Quit: sigurding]
bronson has quit [Ping timeout: 265 seconds]
<Ox0dea> Why won't a CONSTANT suffice?
<shevy> he likes the extra @@
<pizzaops> Is CONSTANT accessible inside methods? I thought they weren't for some rason.
<pizzaops> s/rason/reason
<Ox0dea> They are.
<pizzaops> Welp, never mind then.
<pizzaops> Thanks for the advice!
<Ox0dea> Sure thing.
<harly> *submits coding test for job* *feels angst over not spending enough time on it* where to draw the line!
<Cohedrin> duoi Ah I understand. Sounds like what you need is a 10x programmer
djbkd has quit [Ping timeout: 265 seconds]
<Cohedrin> a 9x programmer is never going to be able to stop the flood from happening
<Cohedrin> only a 10x
<shevy> a code monkey!
<shevy> a flood monkey!
<Chewy1121> lol
<harly> a 10x unicorn will solve all your clouds.
<Chewy1121> flood
kknight has quit [Ping timeout: 260 seconds]
<pizzaops> I'm a 10x pizza-eater. What does that get me?
<Cohedrin> 10x unicorn will cause your heroku server to go down
<harly> they're hard to attract. free disgustingly cheapest available pizza every friday is a great way!
<shevy> lol
<duoi> Cohedrin ok i will put the job advert out now for a 10x cloud-aware ruby on rain junior assistant software developing enginnering associate. thank u for ur help.
<harly> duoi: how about intern with a view to full time?
<pizzaops> And presumably testing the value of `DEFAULT_CONFIG_LOCATION = File.join(Dir.home, '.vcenter.conf')` is unnecessary because I'm just testing Ruby functionality at that point?
lyjia has joined #ruby
<duoi> harly don't trust interns with the data (i am cto of a missile defense contractor). we need an experienced 10x programmer with minimum 40 years exp.
<duoi> in ruby on rains.
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pizzaops> Surely you mean boilerstrapjs
<harly> lol
<Cohedrin> what are you using the rains for in your missle
<Ox0dea> H9 put me in mind of HQ9+: https://esolangs.org/wiki/HQ9+
lyjia has quit [Read error: Connection reset by peer]
Limix has quit [Quit: Limix]
<graphettion> Just use this http://code.divshot.com/geo-bootstrap/
nerium has quit [Quit: nerium]
argentdrake has quit [Quit: Leaving]
teoric has joined #ruby
<shevy> 1995ies are back
<graphettion> ^
<graphettion> http://vanilla-js.com/ is a great framework too.
<graphettion> So much great stuff out there.
teoric has quit [Client Quit]
yfeldblum has joined #ruby
<shevy> huh... $stdin.getch for the enter key gives a "\r" ?
<shevy> lol I broke irb... loop { user_input = $stdin.getch; p user_input }
kies^ has quit [Ping timeout: 245 seconds]
joneshf-laptop has joined #ruby
<Ox0dea> SIGKILL it with fire.
Rickmasta has joined #ruby
pawnbox has joined #ruby
ericfreese has joined #ruby
tockitj has quit [Ping timeout: 250 seconds]
<Ox0dea> That's not quite sufficient.
<Ox0dea> The arrow keys are "\e[A".."\e[D", for instance.
<shevy> programming is evil
yfeldblum has quit [Ping timeout: 265 seconds]
arup_r has quit []
allcentury has joined #ruby
bronson has joined #ruby
houhoulis has quit [Remote host closed the connection]
<Chewy1121> Hey guys
<Chewy1121> I have a question about ISPs
stannard has joined #ruby
<Chewy1121> If I have proof that my ISP keeps bottlenecking my connection what do I do
<Chewy1121> I pay for 300 MBPS and I got about 250 and every hour it goes down about 20
<harly> you probably pay for "up to 300 MBPS" :)
<Chewy1121> Hmmmmm
<Chewy1121> That might be it
centrx has quit [Quit: If you meet the Buddha on the road, kill him.]
<Chewy1121> Well it is time warnerm doing this shit
allcentury has quit [Ping timeout: 250 seconds]
agentmeerkat has quit [Ping timeout: 255 seconds]
<Chewy1121> It was up too 300 mbps
ericfreese has quit [Ping timeout: 255 seconds]
stannard has quit [Ping timeout: 250 seconds]
<Cohedrin> pray that google fiber comes to your area
darkf has joined #ruby
aganov has joined #ruby
yfeldblum has joined #ruby
sigurding has joined #ruby
gregf has joined #ruby
claw has quit [Ping timeout: 250 seconds]
yfeldblum has quit [Remote host closed the connection]
tjohnson has quit [Quit: Connection closed for inactivity]
graphettion has quit [Remote host closed the connection]
BTRE has quit [Quit: Leaving]
arup_r has joined #ruby
<shevy> hmm
claw has joined #ruby
<shevy> if I run from ruby something such as "./configure", it may succeed but it may also fail. is there a trivial way to find out if it failed?
<Ox0dea> echo $?
<shevy> from within ruby?
<Ox0dea> Er, no, you'll want Kernel#system, then.
kerunaru has joined #ruby
<Ox0dea> Whose return value you can use, but which also sets $? appropriately.
rodfersou has joined #ruby
BTRE has joined #ruby
<Ox0dea> Backticks and %x (same thing) also set $?.
<shevy> hmm
<shevy> let's have a look at $?
smactive has quit [Remote host closed the connection]
Rodya_ has joined #ruby
<Ox0dea> Can't demo with ruby[bot]. :/
felixdd has quit [Ping timeout: 250 seconds]
DirtyFInn has joined #ruby
Macaveli has joined #ruby
bluOxigen_ has joined #ruby
bluOxigen has quit [Ping timeout: 255 seconds]
Rodya_ has quit [Ping timeout: 250 seconds]
rahult has quit [Quit: Back to the world of zombies]
rodfersou has quit [Ping timeout: 260 seconds]
rodferso1 has joined #ruby
DirtyFInn has left #ruby [#ruby]
djbkd has joined #ruby
<Chewy1121> Hey, can someone tell how to fix this problem?
RandomNickname has joined #ruby
<Chewy1121> Test the code, it posts the accounts multiple times (same account)
tmtwd has joined #ruby
andikr has joined #ruby
kalopsian has quit [Ping timeout: 260 seconds]
dopie has quit [Quit: Lost terminal]
dopie has joined #ruby
Blaguvest has quit []
Dimik has joined #ruby
lurch_ has joined #ruby
dionysus69 has joined #ruby
Chewy1121 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
amclain has quit [Quit: Leaving]
Chewy1121 has joined #ruby
akemrir has joined #ruby
symm- has joined #ruby
bluOxigen has joined #ruby
pawnbox has quit [Remote host closed the connection]
SOLDIERz has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
bluOxigen_ has quit [Ping timeout: 256 seconds]
norc_ has joined #ruby
colegatron has joined #ruby
<shevy> Chewy1121 this is fairly nonsenical really
<shevy> erm
<atmosx> word
<shevy> nonsensical
davedev24 has quit []
<shevy> Chewy1121 do you really need 3 hashes? why not just one that has all the info?
JohnT has quit [Read error: Connection reset by peer]
jackcom has joined #ruby
Nacho_ has joined #ruby
<jackcom> i can’t install gruff, i tryed it over 100 times, but i failed finally :(
Nacho_ has quit []
<Ox0dea> $ xzcat ruby.tsv.xz | cut -f2 | grep -c shevy
<Ox0dea> 172471
<atmosx> jackcom: you need imagemagick
<Ox0dea> You probably didn't want to know that, but there it is. :P
<jackcom> imagemagick
<jackcom> :)
<atmosx> Ox0dea: what is this file?
<Ox0dea> atmosx: The history of #ruby.
<atmosx> Ox0dea: oh
<Ox0dea> Since 2011-11-16, anyway.
<atmosx> cool, irc logs?
<atmosx> I mean from your client
<atmosx> or from the website?
<atmosx> Ox0dea: I wonder, what is the file size? uncompressed
<Ox0dea> The longest sequence of unique speakers that isn't 9/11 spam is 13.
<Ox0dea> atmosx: ~150MB
nanoz has joined #ruby
<Ox0dea> `xz -9` got it down to 35.
<atmosx> isn't lza the one that has the biggest ratio?
<atmosx> lza2 now or something like that
<Ox0dea> lz4c, it seems.
Darmani has quit [Ping timeout: 252 seconds]
<Ox0dea> Er, no, lz4 is for speed.
<jackcom> i failed after installing imagemagick
<Ox0dea> atmosx: lzma is essentially just an alternate xz format.
craysiii has quit [Quit: Leaving.]
<atmosx> jackcom: what system is that?
<jackcom> os X
<atmosx> and imagemagick through brew?
<jackcom> yes
<jackcom> brew install imagemagick
craysiii has joined #ruby
craysiii has quit [Max SendQ exceeded]
<atmosx> hmm
craysiii has joined #ruby
<atmosx> jackcom: sorry, I use macports. Worked for me on macorts after installing imagemagick and freebsd too
<atmosx> jackcom: but the experience was awful.
<atmosx> I didn't manage to create the graff even after installing it.
hxegon has quit [Quit: BRB]
<jackcom> what is macports? i don’t know macports.
<atmosx> another imagemagick error came up and I used gcharts or something.
PedramT has joined #ruby
<atmosx> jackcom: it's a more flexible (and complicated) solution for osx, similar to brew
kalopsian has joined #ruby
<atmosx> macports.org
<jackcom> oh then if use brew, then i don’t need to use macport?
sinkensabe has joined #ruby
joonty has joined #ruby
<atmosx> yes
<atmosx> exactly
<atmosx> try asking the brew channel
<atmosx> homebrew
<atmosx> and #imagemagick
<jackcom> ok i will be back soon
blackms has quit [Quit: Leaving]
ss_much has quit [Quit: Connection closed for inactivity]
<jackcom> i must install rubygems too? atmosx ?
jas02 has joined #ruby
jam_ has quit [Remote host closed the connection]
<norc_> Ox0dea: I am genuinely curious about which country you currently reside in.
<Ox0dea> norc_: They've got tools for that.
<norc_> Indeed they do. The most common tool is a social interaction called a question.
<jackcom> `get_type_metrics': unable to read font `(null)' @ error/annotate.c/RenderFreetype/1152: `(null)' (Magick::ImageMagickError) <—— what’s wrong?
<jackcom> i don’t know
dionysus69 has quit [Ping timeout: 246 seconds]
<Ox0dea> norc_: Judging by my position there, I think I'll probably heed your unspoken suggestion.
<Ox0dea> Who was this benzrf fellow?
dlitvak has joined #ruby
<norc_> Ox0dea: ;-)
<Ox0dea> shevy is dominating!
dn` has joined #ruby
<norc_> You can give him a price, maybe a "Ruby Certified Chat Expert" certificate.
LMity has joined #ruby
jalnt_ has joined #ruby
jgt1 has joined #ruby
<jackcom> atmosx: help me
<norc_> From what I hear these certificates carry a lot of weight in businesses.
tmtwd has quit [Ping timeout: 264 seconds]
firstdayonthejob has joined #ruby
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
pawnbox has joined #ruby
<Ox0dea> words-insane says that "bossship" (three Ss) is a word.
dlitvak has quit [Ping timeout: 246 seconds]
<norc_> Ox0dea: As a German speaker such things are just common to me. Compound words are one of the basic things in our language. :-)
jas02 has quit [Quit: jas02]
<norc_> Schlammmassen, Nussschale, Flanelllappen
<norc_> Just to give random examples.
jgt1 has quit [Ping timeout: 245 seconds]
<Ox0dea> There's no words-insane-de. :/
<norc_> That is because you can just compose them yourself.
<norc_> There are no limits for composition here. :-)
<norc_> Donaudampfschifffahrtsgesellschaftsführerbürostuhlrollenhersteller
gagrio has joined #ruby
<ddv> I don't like Germans. They dress weird.
<norc_> At least we don't smell weird.
solars has quit [Quit: WeeChat 0.4.2]
solars has joined #ruby
aufi has joined #ruby
duckpuppy has joined #ruby
<Ox0dea> $ grep -Eac '(.)\1\1' german.dic
<Ox0dea> 3612
<Ox0dea> norc_: But no quadruples.
<Ox0dea> Welsh has ya there.
<atmosx> jackcom: try installing pkg-config
<norc_> Ox0dea: I do not see a rule that would allow for quadruple consonants.
<norc_> Ox0dea: We have some pretty huge consonant clusters though.
<norc_> Like Borschtsch
<atmosx> jackcom: then: pkg-config --cflags --libs MagickCore
allcentury has joined #ruby
<norc_> Ox0dea: Those town names are fucking crazy.
dionysus69 has joined #ruby
<norc_> Ox0dea: Also you cannot use a dictionary to find such things in German language
<norc_> Because again - composition.
AlphaAtom has quit [Ping timeout: 250 seconds]
<jackcom> pkg-config ok thanks atmosx
<jackcom> :)
<Ox0dea> norc_: There must be some limit to the madness!
<norc_> Ox0dea: There is only convention but no limit.
duckpuppy has quit [Ping timeout: 246 seconds]
<Ox0dea> But, well, it's not as "human-in-the-loop" is considered a word.
<Ox0dea> *as if
<Ox0dea> It matches /^\S+$/, sure, but it's clearly just four words mushed together.
<Ox0dea> I suspect the same "common sense" could well be applied to German.
allcentury has quit [Ping timeout: 260 seconds]
jalnt_ has left #ruby ["Leaving"]
elaptics`away is now known as elaptics
skcin7 has quit [Quit: Textual IRC Client: www.textualapp.com]
kalopsian has quit [Ping timeout: 240 seconds]
ta has quit [Remote host closed the connection]
<atmosx> wow
<atmosx> YCM returns documention when using python, why not do that for ruby :-(
<Ox0dea> Python has docstrings. :/
kalopsian has joined #ruby
<Ox0dea> Clojure too.
<Ox0dea> A function's documentation actually becomes "part" of it.
webus has joined #ruby
yardenbar has quit [Ping timeout: 272 seconds]
jas02 has joined #ruby
sepp2k has joined #ruby
joonty has quit [Ping timeout: 256 seconds]
harly has quit [Quit: Leaving]
bigkevmcd has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
skade has joined #ruby
TomyWork has joined #ruby
lipoqil has quit [Quit: Connection closed for inactivity]
sdwrage has quit [Quit: This computer has gone to sleep]
blaxter has joined #ruby
<norc_> Ox0dea: Well, usually you only compound 2 stems together - 3 is pushing it.
<Ox0dea> norc_: So a dictionary is perfectly reasonable.
<norc_> Ox0dea: Except you need to apply all stemming rules for compounding to each word
<norc_> To get any possible variant.
yfeldblum has joined #ruby
kalopsian has quit [Ping timeout: 260 seconds]
hahuang65 has joined #ruby
<norc_> Ox0dea: Thing is you can also stemmed verbal nouns for compounds.
rdark has joined #ruby
<Ox0dea> $ wc -l < german.dic
<Ox0dea> 1747285
sepp2k has quit [Quit: Leaving.]
<Ox0dea> >> 1747285 ** 3
<ruby[bot]> Ox0dea: # => 5334469616418374125 (https://eval.in/502512)
<Ox0dea> This'll take a while.
Macaveli has joined #ruby
sandstrom has joined #ruby
lurch_ has quit [Quit: lurch_]
<norc_> Ox0dea: No it should be relatively easy as long as you have a separate dictionary for verbs.
<norc_> Stemming verbs is just removing the "en" suffix.
<norc_> And any non-verbal noun can be just used as is from the dictionary.
<norc_> So yeah, should be doable.
yardenbar has joined #ruby
roshanavand has joined #ruby
SCHAAP137 has joined #ruby
<norc_> Nevermind, this is not my topic. :S
<Ox0dea> Linguistics is hard, let's go programming.
pawnbox has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
<norc_> Currently I am busy trying to install this rather expensive piece of API gateway. But it seems the installer is so bugged that it does not work out of the box.
<norc_> Not very reassuring...
tubuliferous_ has joined #ruby
ohaibbq has joined #ruby
roshanavand has quit [Remote host closed the connection]
pawnbox has joined #ruby
roshanavand has joined #ruby
PedramT has quit [Remote host closed the connection]
ur5us has joined #ruby
PedramT has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
tvw has quit [Ping timeout: 255 seconds]
roshanav_ has joined #ruby
pawnbox has joined #ruby
jbrhbr has joined #ruby
carraroj has joined #ruby
<Ox0dea> The pain means it's working. /s
Rodya_ has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
tvw has joined #ruby
arup_r has quit [Remote host closed the connection]
mark1 has joined #ruby
ericfreese has joined #ruby
<ljarvis> moin
PedramT has quit [Remote host closed the connection]
Rodya_ has quit [Ping timeout: 240 seconds]
sigurding has quit [Quit: sigurding]
arup_r has joined #ruby
PedramT has joined #ruby
ericfreese has quit [Ping timeout: 250 seconds]
jas02 has quit [Quit: jas02]
antgel has joined #ruby
LMity has quit [Ping timeout: 240 seconds]
PedramT has quit [Remote host closed the connection]
firstdayonthejob has quit [Ping timeout: 256 seconds]
blackms has joined #ruby
djbkd_ has joined #ruby
PedramT has joined #ruby
kalopsian has joined #ruby
PedramT has quit [Remote host closed the connection]
codecop has joined #ruby
sigurding has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
craysiii has quit [Remote host closed the connection]
sandstrom has joined #ruby
ur5us has quit [Remote host closed the connection]
<jackcom> i think that ruby is graph is more cuty and beautiful, but python have Anaconda. if i use Anaconda, then i can excute graph file easily
<jackcom> :(
<jackcom> so i will use Ana……. :(
zotherstupidguy has joined #ruby
ohaibbq has quit [Quit: Leaving...]
sandstrom has quit [Quit: My computer has gone to sleep.]
craysiii has joined #ruby
craysiii has quit [Max SendQ exceeded]
craysiii has joined #ruby
PedramT has joined #ruby
rippa has joined #ruby
jas02 has joined #ruby
avril14th has joined #ruby
PedramT has quit [Remote host closed the connection]
Kneecaps has quit [Remote host closed the connection]
allcentury has joined #ruby
ta has joined #ruby
kalopsian has quit [Ping timeout: 276 seconds]
djbkd_ has quit [Remote host closed the connection]
joonty has joined #ruby
allcentury has quit [Ping timeout: 240 seconds]
<ljarvis> use whatever works
kiidbrian has joined #ruby
joonty has quit [Client Quit]
mikecmpbll has joined #ruby
joonty has joined #ruby
einarj has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
edwinvdgraaf has joined #ruby
sigurding has quit [Quit: sigurding]
edwinvdgraaf has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
<jackcom> ljarvis: thanks for understanding my situation.
RandomNickname has quit [Read error: Connection reset by peer]
<jackcom> but i will study ruby after 10 days.
Ting_ has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
benjohn has joined #ruby
jgt1 has joined #ruby
sftrabbit has joined #ruby
edwinvdg_ has joined #ruby
Xeago has joined #ruby
arup_r has quit [Remote host closed the connection]
<norc_> Ox0dea: It is not.
<Ox0dea> norc_: Are you sure it's hurting enough?
<norc_> It is hurting so much, that I am about to hurt some people.
haraigo has joined #ruby
framlinqp has joined #ruby
<norc_> If you hear a news story later tonight with the head line "Tech Salesmen Found in 3 Locations Across Town" you will know.
harai54 has quit [Ping timeout: 240 seconds]
minimalism has quit [Ping timeout: 245 seconds]
edwinvdgraaf has quit [Ping timeout: 276 seconds]
framling has quit [Ping timeout: 272 seconds]
absolutejam_ has quit [Ping timeout: 265 seconds]
SOLDIERz has quit [Ping timeout: 276 seconds]
sandstrom has joined #ruby
pandaant has joined #ruby
<Ox0dea> I initially read "Salesman", which made the proposition considerably grimmer.
astrobun_ has quit [Remote host closed the connection]
quaristice has joined #ruby
dpg_ has quit [Ping timeout: 260 seconds]
<norc_> Ox0dea: I meant to write "Salesman". :-S
kalopsian has joined #ruby
<norc_> Blame my hasty typing habit.
<Ox0dea> And also that they're homophones, of course.
c0m0 has joined #ruby
<Ox0dea> Which is a wart.
absolutejam has joined #ruby
<norc_> The added advantage of blaming homophony is that it has nothing to do with me.
<norc_> I like your proposition.
Dimik has quit [Ping timeout: 245 seconds]
allcentury has joined #ruby
carraroj has quit [Ping timeout: 240 seconds]
<Ox0dea> Homophony, synonymy, antonymy.
<Ox0dea> These are great words.
yfeldblum has quit [Ping timeout: 240 seconds]
carraroj has joined #ruby
<Ox0dea> "Homonomy" sounds like "I'm onto me".
<norc_> Ox0dea: Here is a quote from a wikipedia article that I find amusing: "The analysis of synonymy, polysemy, and hyponymy and hypernymy is vital to taxonomy and ontology in the information-science senses of those terms"
<Ox0dea> *Homonymy
<Ox0dea> norc_: Is that really real?
<norc_> Yes it is.
karapetyan has joined #ruby
<Ox0dea> It feels like it was written by a rapper.
<norc_> A rapper with a PHD in linguistics you mean.
<Ox0dea> Just so.
<Ox0dea> There must be some?
<norc_> Evidently so.
allcentury has quit [Ping timeout: 264 seconds]
<Bish> anyone familiar with the aws gem? im trying to get my bounces/complaints of the SES/SNS service of AWS
nettoweb has joined #ruby
<Ox0dea> Bish: I'm not, but I do have something for you if you're still interested in an implicit variable for blocks.
herbst has joined #ruby
<Bish> Ox0dea: hit me
<herbst> When i have a struct in a struct. Can i somehow .to_h and get only a hash without embed struct?
<Ox0dea> Bish: https://eval.in/502543
<Ox0dea> It steals _ globally, which is bad, but it's otherwise fantastic. :)
<Bish> and it uses the hell operator
<Ox0dea> Hm?
<Bish> ->
<Bish> i was told it is the "hell-operator"
karapetyan has quit [Remote host closed the connection]
exadeci has quit [Quit: Connection closed for inactivity]
<Ox0dea> It's "stabby" in my lexicon.
<Ox0dea> herbst: You want the internal Structs to remain Structs, yeah?
<Bish> where did u find this? or did you invent it :D
graffix222 has quit [Ping timeout: 260 seconds]
<Ox0dea> I invented it. :P
Snowy has joined #ruby
<Ox0dea> Some fella named shockone really liked it, and I told him it was fine to make a gem of it.
<herbst> Ox0dea: no actually i really just want a hash to easily use it in tests
<Ox0dea> herbst: I'm not sure I follow.
sigurding has joined #ruby
jbrhbr has quit [Quit: Leaving.]
<herbst> i have structs which may contain structs. and i want them to get a hash
tubuliferous_ has quit [Ping timeout: 255 seconds]
<herbst> one big hash
<Bish> Ox0dea: well, i do like it to, even while not understanding 100% of the code
minimalism has joined #ruby
<Bish> the uberscore will be available everywhere, right?
<Ox0dea> Bish: Yeah, it's defined as an instance method on Kernel.
<Ox0dea> Like #puts.
<Ox0dea> So it won't be available in the context of a BasicObject, but that should be okay.
<Ox0dea> I also took it a little further the other day: https://eval.in/502544
<Bish> i will shit bricks if this gets into ruby 2.x
<Bish> gem inc!
<Ox0dea> Bish: We should've been able to chain from the first. :/
<Bish> wow, that reminds me of erlang / prolog
<Ox0dea> It's more like NumPy.
jam_ has joined #ruby
<Ox0dea> Only a lot better.
<Bish> but you could have this fancy quicksort implementation with it
<Ox0dea> Indeed. :)
<Bish> where [x<pivot]pivot[x>pivot]
<Ox0dea> Well, it absolutely has to be _, but yeah.
benjohn has quit [Killed (Sigyn (Spam is off topic on freenode.))]
<Ox0dea> With NumPy, you say `array[array > 1]`, which looks goofy.
<Bish> but can i remain the father of this idea in the history books? :(
huyderman has joined #ruby
koj has joined #ruby
<Bish> no :(?
Xeago has quit [Remote host closed the connection]
DoubleMalt has joined #ruby
dmolina has joined #ruby
Tempesta has quit [Read error: Connection reset by peer]
jam_ has quit [Ping timeout: 272 seconds]
Tempesta has joined #ruby
herbst has quit [Read error: Connection reset by peer]
chipotle has quit [Read error: Connection reset by peer]
koj has quit [Client Quit]
skade has joined #ruby
chipotle has joined #ruby
<Bish> and it has the same speed as .select if i understand it correctly
solocshaw has joined #ruby
<Ox0dea> Well, you'd say `select { |e| e > 1 && e < 4 }` normally, whereas this builds up a reduction over n filtrations, so it's slower.
<Ox0dea> So much quieter, though.
dwfait has joined #ruby
peeja has joined #ruby
rodferso1 has quit [Ping timeout: 276 seconds]
<Bish> man i hope the AIs are not coming as soon and take all our work/lifes(depends)
<Bish> ruby brought so much fun into my worklife!
<jackcom> ruby chart visual is better than python chart visual?
rodfersou has joined #ruby
<Bish> irc trolls better than twitter trolls?
<adaedra> ?better
<ruby[bot]> "Best" and "better" are subjective. Try to use a different term.
<jackcom> :( i don’t understand you. i don’t decide to use python or ruby. Bish i m not troller
duckpuppy has joined #ruby
shredding has joined #ruby
supergeek has joined #ruby
<Bish> i've read enough of you to know that this is not the case
<Ox0dea> jackcom: You said earlier that Anaconda better suits your needs.
karapetyan has joined #ruby
arup_r has joined #ruby
chussenot has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<jackcom> yeah, but i think that ruby chart is more nice than python
peeja has quit [Ping timeout: 256 seconds]
Xeago has joined #ruby
<adaedra> this means nothing.
FernandoBasso has joined #ruby
f4cl3y has joined #ruby
grasshopper has joined #ruby
supergeek has quit [Client Quit]
<Bish> uhhh those are shiiiny
duckpuppy has quit [Ping timeout: 245 seconds]
<Bish> wish there was a database as good as ruby, i mean sequel is great, but it's still only an interface to a shitty(imho) old database
quaristice has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lkba_ has quit [Ping timeout: 276 seconds]
binaryplease has joined #ruby
The_Phoenix has joined #ruby
<Bish> ofcourse i compare apples and pears.
<adaedra> Bish: what database? Sequel is an interface to multiple backends.
craysiii has quit [Quit: Leaving.]
<Bish> yeah i mean SQL in general and databases that use it
<adaedra> ah.
<Bish> i never felt like there is a general databse you can use for everything, and there might not be one, ofcourse
cpup has quit [Ping timeout: 240 seconds]
<Bish> i loved mongodb, but i have a feeling if i used that in real production, it would f me over
craysiii has joined #ruby
craysiii has quit [Max SendQ exceeded]
<adaedra> MySQL and Postgres are pretty widespread.
craysiii has joined #ruby
yfeldblum has joined #ruby
<Ox0dea> Datomic isn't.
ziyadb has joined #ruby
mclee has quit [Ping timeout: 245 seconds]
ta has quit [Read error: Connection reset by peer]
<Ox0dea> Despite time travel as a feature.
ta_ has joined #ruby
<Bish> yeah but i hate fixed column counts
<adaedra> It's an ongoing debate, but I think that "old database"s as you said is still going strong.
craysiii has quit [Client Quit]
<adaedra> s/is/are/
<Bish> yeah, sure, that's why i use mysql too, it always works it's always fast
craysiii has joined #ruby
craysiii has quit [Max SendQ exceeded]
<ljarvis> "it's always fast" orly
<Ox0dea> Give us more keks!
<Bish> but it doesn't feel as comfortable as it should be, but maybe it has to be this way
* adaedra inserts billions of lines into Bish's database and removes all indexes
craysiii has joined #ruby
<Bish> it always have been fast for me with proper indexing <= better expression?
<adaedra> Database Design is a job, iirc.
<Bish> has*
<Ox0dea> Administration thereof too.
<ljarvis> that just tells me you dont have much data
<ljarvis> :trollface:
<adaedra> :ljarvisface:
graffix222 has joined #ruby
<Ox0dea> :dataface:
mostlybadfly has quit [Quit: Connection closed for inactivity]
chussenot has quit [Quit: chussenot]
<adaedra> (I know I started this, but we may move that into -offtopic )
cpup has joined #ruby
<ljarvis> :)
chussenot has joined #ruby
chussenot has quit [Client Quit]
mclee has joined #ruby
dionysus69 has quit [Quit: dionysus69]
marr has joined #ruby
oz` has joined #ruby
kalopsian has quit [Ping timeout: 245 seconds]
oz has quit [Read error: Connection reset by peer]
oz` is now known as oz
romero has joined #ruby
craysiii has quit [Read error: No route to host]
zapata has quit [Quit: WeeChat 1.3]
chussenot has joined #ruby
platzhirsch has joined #ruby
chussenot has quit [Client Quit]
Chewy1121 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
craysiii has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
Rodya_ has joined #ruby
dlitvak has joined #ruby
chussenot has joined #ruby
hayden_ has joined #ruby
Jackneill has joined #ruby
stannard has joined #ruby
voidDotClass has joined #ruby
DaniG2k has joined #ruby
govg has quit [Ping timeout: 240 seconds]
<voidDotClass> In writing rspec feature tests, how do i check that visiting / redirects to /#login?
<voidDotClass> i'm writing expect(page).to have_current_path "/#login"
<voidDotClass> but that doesn't work
Rodya_ has quit [Ping timeout: 260 seconds]
stannard has quit [Ping timeout: 260 seconds]
ldnunes has joined #ruby
gbgdev_ has joined #ruby
CloCkWeRX has quit [Ping timeout: 256 seconds]
dwfait has quit [Read error: Connection reset by peer]
dwfait has joined #ruby
dlitvak has quit [Remote host closed the connection]
kalopsian has joined #ruby
techsethi has joined #ruby
El3ktra has quit [Ping timeout: 246 seconds]
fluchtreflex has quit [Read error: Connection reset by peer]
KillerFox has quit [Ping timeout: 246 seconds]
zenlot1 is now known as zenlot
dlitvak_ has joined #ruby
PedramT has joined #ruby
valeri_uF0 has joined #ruby
_fumk has joined #ruby
El3ktra has joined #ruby
FooMunki has joined #ruby
edwinvdg_ has quit [Read error: Connection reset by peer]
ta has joined #ruby
Snowy_ has joined #ruby
fumk has quit [Ping timeout: 246 seconds]
KillerFox has joined #ruby
Snowy has quit [Read error: Connection reset by peer]
valeri_ufo has quit [Ping timeout: 272 seconds]
fsapo has joined #ruby
valeri_uF0 is now known as valeri_ufo
Hexter has joined #ruby
PedramT has quit [Remote host closed the connection]
volty has joined #ruby
edwinvdgraaf has joined #ruby
ta_ has quit [Ping timeout: 246 seconds]
felixdd has joined #ruby
usershell has quit [Read error: Connection reset by peer]
PedramT has joined #ruby
edulix_ has joined #ruby
<edulix_> hello people
<ljarvis> voidDotClass: anchors are not visible to the server
<voidDotClass> which server? ljarvis
usershell has joined #ruby
<ljarvis> voidDotClass: i.e in rails, you can't read the anchor since it's not sent to the server, and I believe current_path will use the path that the server sees
toretore has joined #ruby
<ljarvis> so, you probably want to test it in javascript
dlitvak_ has quit [Remote host closed the connection]
quaristice has joined #ruby
agent_white has joined #ruby
<agent_white> Evenin'
<ljarvis> voidDotClass: anyway, you should just assert what's on the page if it's a feature spec
<ljarvis> i.e expect(page).to include("Login")
<voidDotClass> kk
<ljarvis> have_content, or w/e it is
<voidDotClass> ty
PedramT has quit [Remote host closed the connection]
yos7ph has joined #ruby
<edulix_> I ahave opensuse tumbleweed, I have execute sudo gem install bundle, but still the command bundle is not in the path. I know it is in /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.11.2/exe/bundler, but why it's not automatically in the path?
abc has joined #ruby
abc is now known as Guest97516
<Guest97516> Hey, are there equivalents of "puts" and "p" which only print a newline after last argument, instead of after every argument?
_mh_ has quit [Remote host closed the connection]
<Guest97516> E.g. I would want puts 1,2,3 to print "1 2 3\n" instead of "1\n2\n3"
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<volty> >> print 1,2,3; puts
<ruby[bot]> volty: # => 123 ...check link for more (https://eval.in/502576)
<ljarvis> print 1, 2, 3, "\n"
quaristice has quit [Quit: Textual IRC Client: www.textualapp.com]
<Guest97516> Yeah, sure, if I'm gonna say "; puts" i could have said ', "\n"' as well... I meant something as convenient as puts and p
<ljarvis> ..
<Guest97516> (so that \n does not have to be mentioned explicitly)
<ljarvis> how is that less convenient? because yu don't have you type "\n"?
<Guest97516> Right
<ljarvis> eh, no.
<Guest97516> OK, thanks
dlitvak has joined #ruby
<ljarvis> I'd probably use print + puts as volty did too (it's a common pattern). I was just providing another option
<TomyWork> Guest97516 make a myputs function (no pun intended, honest)
<ljarvis> function what even is that
<TomyWork> thingy with def in front
<ljarvis> that's a method
<TomyWork> what do you call it?
<ljarvis> </pedant>
<TomyWork> for me it's a function
PedramT has joined #ruby
<ljarvis> ok
<TomyWork> and if it's in a class, it's a member function
dlitvak has quit [Remote host closed the connection]
<ljarvis> lolwat
<TomyWork> C++ supremacy!
<ljarvis> i feel bad
RandomNi_ has joined #ruby
<ljarvis> for you
<TomyWork> i'm kidding, i dont care about what it's called
<TomyWork> but neither should you :)
<Guest97516> Right, sure. Thanks
Guest97516 has quit [Quit: Leaving]
roshanav_ has quit []
<ljarvis> sure I should, I don't want to teach people the wrong thing
RandomNi_ is now known as RandomNick
PaulCape_ has joined #ruby
<TomyWork> it's only wrong if anyone cares
PaulCapestany has quit [Ping timeout: 250 seconds]
anisha has joined #ruby
kerunaru has joined #ruby
blackgoat has quit [Quit: WeeChat 1.3]
PedramT has quit [Remote host closed the connection]
glenny has quit [Quit: Konversation terminated!]
pawnbox has quit [Remote host closed the connection]
colegatron has quit [Ping timeout: 276 seconds]
agent_white has quit [Quit: leaving]
skade has quit [Quit: Computer has gone to sleep.]
craysiii has quit [Quit: Leaving.]
pawnbox has joined #ruby
craysiii has joined #ruby
<norc_> Ox0dea: Amazing stuff we have. So I just found out about named capture groups.
<Ox0dea> norc_: Hurrah!
zapata has joined #ruby
<norc_> Together with whitespace insensitive regular expressions and regex interpolation
<Ox0dea> And also their ability to introduce locals?
<norc_> These things become so fucking readable.
<norc_> Ox0dea: Wait... what?
tappy has joined #ruby
<Ox0dea> >> /(?<foo>\w+)/ =~ 'omg'; foo # norc_
<ruby[bot]> Ox0dea: # => "omg" (https://eval.in/502585)
<tappy> How do I do a regex match between two variables. So I need interpolation on both sides of the =~ operator
jackcom has quit [Quit: jackcom]
<Ox0dea> tappy: You just... interpolate.
<norc_> Ox0dea: I am no big fan of magically vivified locals :(
astrofog has joined #ruby
<Ox0dea> norc_: Pretty scary.
konsolebox has joined #ruby
<norc_> Ox0dea: I was just going to use match_data[:capture_group]
<tappy> Oh dear god. Yes
<Bish> is there a way to pool threads without any gem?
<tappy> Sorry. Dumbest question ever
<norc_> >> foo = 'bar'; /(?<foo>\w+)/ =~ 'omg'; foo
<ruby[bot]> norc_: # => "omg" (https://eval.in/502586)
<Ox0dea> Yikes.
<norc_> I wonder, does that shadow my old one?
<Ox0dea> Clearly?
sftrabbit has quit [Quit: sftrabbit]
<Bish> i have IO which needs a bit of time, and it blocks the whole main thread, so i would like to start several of them
bronson has quit [Remote host closed the connection]
<norc_> Ox0dea: Not sure whether its shadowed or overridden.
<Ox0dea> Er, no, the old value is definitely gone.
<norc_> Which would be quite relevant because GC.
<Bish> but those are thousands, so if i spawn a thread for every call it would f me over
pawnbox has quit [Ping timeout: 260 seconds]
craysiii has quit [Remote host closed the connection]
<norc_> Ox0dea: Okay that whole feature turned from amazing to disgusting in a matter of seconds.
<Ox0dea> norc_: As is only right and proper.
dlitvak has joined #ruby
<Ox0dea> In its defense, that's the *only* situation in which it works.
<Ox0dea> And the LHS can't have undergone any interpolation either.
DaniG2k has quit [Quit: leaving]
craysiii has joined #ruby
craysiii has quit [Max SendQ exceeded]
<Ox0dea> >> foo = Object.new; id = foo.__id__; /(?<foo>\w+)/ =~ 'omg'; GC.start; ObjectSpace._id2ref(id) rescue $! # norc_
<ruby[bot]> Ox0dea: # => #<RangeError: 0x2066aba0 is recycled object> (https://eval.in/502587)
<norc_> >> foo = 'bar'; -> { /(?<foo>\w+)/ =~ 'omg' }.call; foo
<ruby[bot]> norc_: # => "omg" (https://eval.in/502588)
<norc_> Ox0dea: now that is fucking disgusting.
craysiii has joined #ruby
<Ox0dea> Anyway, it does get collected if possible.
<norc_> Ox0dea: Yeah.
tappy has left #ruby ["Leaving"]
<norc_> I am not entirely sure whether my last snippet is intended behavior.
<Ox0dea> Er, why not?
bruce_lee has joined #ruby
colegatron has joined #ruby
<Ox0dea> >> foo = 1; -> { foo = 2 }.call; foo
<ruby[bot]> Ox0dea: # => 2 (https://eval.in/502589)
<norc_> Ox0dea: When you call a proc a block gets created. For that another stack frame is pushed and the EP moves up
<Ox0dea> That's not true.
<norc_> Huh?
<norc_> Oh this might just be a method call then
<norc_> Wait what is this.
<norc_> Why is this
<Ox0dea> Procs != blocks.
<Ox0dea> Blocks can be reified into Procs, but the reverse isn't true.
<norc_> >> puts RubyVM::InstructionSequence.compile("foo = 1; -> { foo = 2 }.call; foo").disasm
<ruby[bot]> norc_: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502590)
dlitvak has quit [Ping timeout: 245 seconds]
<norc_> Ox0dea: There. It gets compiled into an actual block.
<norc_> So the inner foo is basically a DASGN_CURR
Brando753 has quit [*.net *.split]
<norc_> And I vaguely remember that blocks have their own vtable
<norc_> So this is slightly confusing.
Brando753 has joined #ruby
<norc_> >> puts RubyVM::InstructionSequence.compile("def quux() yield; end; foo = 1; quux { foo = 2 }; foo").disasm
<ruby[bot]> norc_: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502591)
<norc_> That is effectively the same
dlitvak has joined #ruby
rodfersou is now known as rodfersou|afk
prestorium has joined #ruby
<norc_> Ox0dea: So no, procs/lambda turn into blocks in the VM.
Rodya_ has joined #ruby
<Ox0dea> norc_: But they *do* have their own scope.
<norc_> Which is confusing.
craysiii has quit [Quit: Leaving.]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sftrabbit has joined #ruby
<norc_> Ill dig into this tonight after finishing time
dlitvak has quit [Remote host closed the connection]
<Ox0dea> I suspect it's just that "block" is used as a catch-all term.
donnoc has joined #ruby
<norc_> Ox0dea: I dont see how they would be different.
sigurding has quit [Quit: sigurding]
dlitvak has joined #ruby
<Ox0dea> >> def m; end; foo = 1; m { foo = 2 }; foo # norc_
<ruby[bot]> Ox0dea: # => 1 (https://eval.in/502592)
Ting_ has quit [Ping timeout: 256 seconds]
<norc_> The block never gets called.
Ting_ has joined #ruby
<norc_> Ox0dea: It is just easier to invoke a proc than it is to invoke a block.
Mon_Ouie has quit [Ping timeout: 260 seconds]
CloCkWeRX has joined #ruby
webus has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<Ox0dea> Fair enough, but... how even to invoke a block (other than `yield`)?
ericfreese has joined #ruby
<norc_> Turn it into a proc and then use call.
kalopsian has quit [Ping timeout: 255 seconds]
<Ox0dea> That's invoking a Proc. :P
<norc_> Which considering what is happening beneath is super silly.
CloCkWeRX has quit [Read error: Connection reset by peer]
CloCkWeRX has joined #ruby
<norc_> Ox0dea: That was my point though.
<norc_> Ox0dea: You can only yield a block (so it is a bit unelegant)
<norc_> But that is by design because blocks are the only thing in Ruby that are not objects
<norc_> So you have no way to interact with them aside from yield and block_given?
Rodya_ has quit [Ping timeout: 265 seconds]
<norc_> (And binding it via &foo argument)
<Ox0dea> norc_: defined?(yield) :P
<Ox0dea> I think we discussed that one?
<norc_> >> defined?(yield)
<ruby[bot]> norc_: # => nil (https://eval.in/502597)
<Ox0dea> It's an alias for `block_given?`.
<Ox0dea> (I'm serious.)
<norc_> By alias you mean alternate way of obtaining the same information?
<Ox0dea> Aye.
<norc_> Or do you mean alias?
<norc_> Ok.
<Ox0dea> *synonym, then.
Hexter has quit [Quit: Hexter]
<norc_> Fair enough.
volty has left #ruby ["Konversation terminated!"]
<norc_> Im not really surprised. Blocks are hacked deeply into Ruby all over the implementations.
<Ox0dea> Which is a shame; they're quite elegant at the surface.
Ting_ has quit [Ping timeout: 260 seconds]
chussenot has quit [Quit: chussenot]
ericfreese has quit [Ping timeout: 264 seconds]
<norc_> Ox0dea: A pure lambda approach would have been better imho.
<norc_> Ox0dea: That would have been fairly easy to implement.
<Ox0dea> norc_: How do you mean?
<Ox0dea> Procs! Procs everywhere?
<norc_> Ox0dea: Indeed. Lets just ignore that they are costly to use.
<norc_> Ox0dea: Just the fact that you are inside a method, and you have no sensible way of referring to a block other than a random "yield" is so random.
<norc_> Ox0dea: Accepting a proc as an argument, and invoking #call on it - that is clean.
<Ox0dea> You're not wrong, but I do think some of the language's appeal would be lost there.
sftrabbit has quit [Quit: sftrabbit]
cornerman has quit [Remote host closed the connection]
<norc_> Ox0dea: It kind of reminds of one of the worst quirks in JavaScript design regarding "this".
jam_ has joined #ruby
<norc_> Aside from that part, it is actually a wonderful language.
<shevy> omg
<Ox0dea> The thing that most reminds me of JS's `this` is the difference between `self` and the default definee.
Ting_ has joined #ruby
<Ox0dea> Blocks and `yield` are A-okay by my lights.
sftrabbit has joined #ruby
<norc_> Ox0dea: "this" is really the same as the first argument of instance methods in Python.
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<norc_> Its just as bizarre and feels unpolished.
<voidDotClass> I have a site where most of the functionality is behind different login areas, e.g an admin area, a buyer area, a seller area, etc. how can i write rspec feature tests for it it so for all the features in admin area, it logs in as admin first, then logs out and logs back in as buyer for the buyer features, and so on?
Macaveli has joined #ruby
<norc_> Ox0dea: self is quite right, the name can be misleading though.
<Ox0dea> norc_: But the implicit receiver isn't always `self` is the point I meant to make.
<Ox0dea> >> [self, method(define_method(''){}).owner]
<ruby[bot]> Ox0dea: # => [main, Object] (https://eval.in/502598)
<Ox0dea> There `Object` is the "implicit receiver", which in this context is canonically called the default definee.
jam_ has quit [Ping timeout: 240 seconds]
cornerman has joined #ruby
<Ox0dea> It's not even really an asymmetry.
cornerman has quit [Client Quit]
tomjoro has joined #ruby
cornerman has joined #ruby
cornerman has quit [Client Quit]
cornerman has joined #ruby
Ting_ has quit [Quit: leaving]
cornerman has quit [Client Quit]
RandomNick has quit []
cornerman has joined #ruby
<norc_> Ox0dea: That is another random hack, though Im glad about it.
<norc_> Ox0dea: Otherwise Ruby would look an awful lot like Java.
arup_r has quit [Remote host closed the connection]
dlitvak_ has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
<norc_> Ox0dea: Do you know of any simple hack to obtain a new binding?
aryaching has joined #ruby
techsethi has quit [Quit: techsethi]
<Ox0dea> norc_: It's really just that `main` isn't a Class, which is indeed The Right Thing.
<Ox0dea> norc_: Er... grab the current one and clear it?
duckpuppy has joined #ruby
<norc_> That does not sound like I can do this in a single line in under 80 characters. :-)
<Ox0dea> No, likely not.
<Ox0dea> Bringing Fiddle in is 15 characters alone. ;)
astrofog has quit [Ping timeout: 245 seconds]
dlitvak has quit [Ping timeout: 272 seconds]
arup_r has joined #ruby
pawnbox has joined #ruby
sigurding has joined #ruby
kalopsian has joined #ruby
arup_r has quit [Read error: Connection reset by peer]
blackms has quit [Quit: Leaving]
arup_r has joined #ruby
<Ox0dea> norc_: https://eval.in/502608
<Ox0dea> Unless I'm sorely mistaken, you're not the first to ask for such a thing.
sigurding has quit [Client Quit]
duckpuppy has quit [Ping timeout: 260 seconds]
stamina has joined #ruby
<Ox0dea> Never did get to the bottom of why that shouldn't do the trick. :<
atomical has joined #ruby
PaulCape_ has quit [Read error: Connection reset by peer]
djellemah_ has joined #ruby
Ishido has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
atomica__ has quit [Ping timeout: 256 seconds]
skade has joined #ruby
<norc_> Ox0dea: That trick might make named capture groups bearable
yfeldblum has quit [Ping timeout: 250 seconds]
allcentury has joined #ruby
<Ox0dea> norc_: That went well: https://eval.in/502613
PaulCapestany has joined #ruby
<norc_> Heh.
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<norc_> This has become a familiar picture to me.
lucasb has joined #ruby
djellemah_ has quit [Client Quit]
Cohedrin has joined #ruby
rodfersou|afk has quit [Ping timeout: 272 seconds]
tvw has quit [Remote host closed the connection]
<Ox0dea> norc_: There ya go: https://eval.in/502615
carraroj has quit [Ping timeout: 240 seconds]
<Ox0dea> Just don't call #local_variables on it. :P
solocshaw1 has joined #ruby
astrofog has joined #ruby
sinkensabe has joined #ruby
<norc_> Brilliant. Aside from it being completely useless you have still done it! :-)
solocshaw has quit [Ping timeout: 260 seconds]
solocshaw1 is now known as solocshaw
<Ox0dea> > `eval': wrong argument type Binding (expected binding)
rodfersou has joined #ruby
Cohedrin has quit [Ping timeout: 240 seconds]
shredding has quit [Ping timeout: 246 seconds]
howdoi has joined #ruby
hannelita has joined #ruby
scottschecter has quit [Ping timeout: 255 seconds]
bluOxigen has quit [Ping timeout: 255 seconds]
wolfedale has joined #ruby
<wolfedale> Hi
<Ox0dea> wolfedale: Your nick is an anagram of "wall of DEA".
mikecmpbll has quit [Read error: Connection reset by peer]
<Ox0dea> Never mind.
<Ox0dea> *well of DEA
<wolfedale> :)
<Ox0dea> *fellow DEA
<Ox0dea> They're onto us!
FooMunki has quit [Quit: FooMunki]
bronson has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
FooMunki has joined #ruby
ajf- has joined #ruby
ixti has quit [Ping timeout: 246 seconds]
<wolfedale> I'm having a problem with one of my method.
techsethi has joined #ruby
<wolfedale> Open3.popen3("/usr/bin/unzip -o -P pass '#{@rand_dir}#{file}' -d '#{@rand_dir}'") do |stderr ...
karapetyan has quit [Remote host closed the connection]
bluOxigen has joined #ruby
karapetyan has joined #ruby
<wolfedale> It works fine but when the file name has: ' it's saying that there is no such file. So for example: Test File.docx works fine. But Test File's.docx it's not :(
dlitvak has joined #ruby
<shevy> did you try via "File'" quotes?
mondok has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
<wolfedale> I tried "#{@rand_dir}#{file}" and `#{@rand_dir}#{file}` but without the good result.
<lucasb> what about split the string into several arguments?
<Ox0dea> Or just escape the single quotes.
yfeldblum has joined #ruby
AlexRussia has quit [Quit: WeeChat 1.4-dev]
dlitvak_ has quit [Ping timeout: 260 seconds]
ta has quit [Remote host closed the connection]
<wolfedale> Ox0dea: I'm not sure if I understand. How I can escape it?
asmodlol has quit [Ping timeout: 255 seconds]
<Ox0dea> wolfedale: It's just as if you're invoking the command like `/usr/bin/foo 'Alice's Secrets.txt'`.
<Ox0dea> The single quote in "Alice's" is terminating the string prematurely.
<lucasb> filename = "Alice';rm -rf /"
asmodlol has joined #ruby
aswen has joined #ruby
<shevy> haha
Rodya_ has joined #ruby
AlexRussia has joined #ruby
<norc_> Screw this. Im starting to adopt internal ruby function naming. fix_fck_brk_str_from_dtag is a wonderful method name.
<Papierkorb> fsck_dtag
yos7ph has quit [Ping timeout: 260 seconds]
<norc_> ;-)
sonOfRa has quit [Quit: Bye!]
Jackneill has quit [Ping timeout: 265 seconds]
Meow-J has joined #ruby
<wolfedale> Ox0dea: I still don't know how to escape #{file} :(
anisha has quit [Quit: This computer has gone to sleep]
Rodya_ has quit [Ping timeout: 240 seconds]
ajf- has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has joined #ruby
<Ox0dea> >> "Alice's Dog's Results.pdf".gsub("'", "\\'") # wolfedale
<ruby[bot]> Ox0dea: # => "Alices Dog's Results.pdfs Dogs Results.pdfs Results.pdf" (https://eval.in/502629)
<Ox0dea> That *should* have done the trick.
<Ox0dea> As you can see, it has gone terribly awry.
Xeago has quit [Remote host closed the connection]
<Ox0dea> >> "Alice's Dog's Results.pdf".gsub("'", "\\\\'") # wolfedale
<ruby[bot]> Ox0dea: # => "Alice\\'s Dog\\'s Results.pdf" (https://eval.in/502632)
K1MOS has joined #ruby
Xeago has joined #ruby
<Ox0dea> There ya go. Backslashes are cruise control for... something.
karapetyan has quit [Remote host closed the connection]
kalopsian has quit [Ping timeout: 276 seconds]
kalopsian has joined #ruby
myntcake has joined #ruby
dlitvak has quit [Remote host closed the connection]
karapetyan has joined #ruby
nfk has joined #ruby
bweston92 has quit [Ping timeout: 256 seconds]
aupadhye has joined #ruby
<wolfedale> sh: -c: line 0: unexpected EOF while looking for matching `''
dlitvak has joined #ruby
<wolfedale> But maybe it will be more easy to check if the file has ' and then change it's name by File.rename or something?
aryaching has quit []
duckpuppy has joined #ruby
bweston92 has joined #ruby
<lucasb> just saying that if you pass more than one argument to popen* methods, it skips the shell, thus avoiding all the escaping problems
Xeago has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 264 seconds]
karapetyan has quit [Remote host closed the connection]
Jackneill has joined #ruby
<Ox0dea> That's definitely the right way to go.
<jhass> what's wrong with the zip gem?
<jhass> wolfedale: ^
Xeago has joined #ruby
Ishido has quit [Ping timeout: 246 seconds]
aryaching has joined #ruby
freerobby has joined #ruby
krz has quit [Ping timeout: 240 seconds]
skade has quit [Quit: Computer has gone to sleep.]
ajf- has joined #ruby
<Ox0dea> wolfedale: If you're hell-bent on it: gsub("'", "'\\\\''")
<jhass> uhm
<jhass> no.
<Ox0dea> You're right.
ajf- has quit [Client Quit]
<Ox0dea> I mean, it works... for some shells.
<jhass> it's the least proper solution I can imagine, sorry
<Ox0dea> "Hell-bent" connotes negatively, to clarify.
<jhass> honestly, it's the kind of stuff I don't even mention to avoid anybody using it
<jhass> I mean the alternatives are even easier
<jhass> like using the proper interface to spawn the subprocess
<jhass> there's no need to work around a shell here because there's no need to spawn a shell
ponga has joined #ruby
joonty has quit [Ping timeout: 250 seconds]
<Ox0dea> On the bright side, I think I found a bug?
<Ox0dea> >> 'fooXbar'.sub('X', "\\`\\'")
<ruby[bot]> Ox0dea: # => "foofoobarbar" (https://eval.in/502642)
<Ox0dea> It's treating those like $` and $'.
<jhass> gsub and sub are like split, too many quirks are official API by now
Madmanden has joined #ruby
<wolfedale> I think I will go to try rubyzip. I cannot figure out on my method :(
<jhass> great
<Ox0dea> wolfedale: Do mind the caveats regarding passwords and overwriting existing files.
binaryplease has quit [Quit: WeeChat 1.3]
<Ox0dea> Those would be the -P and -o flags in your original approach.
northfurr has joined #ruby
<Ox0dea> > Zip.on_exists_proc = true
<Ox0dea> >> true.is_a? Proc
<ruby[bot]> Ox0dea: # => false (https://eval.in/502644)
emilford has joined #ruby
chussenot has joined #ruby
anisha has joined #ruby
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
<djellemah> >>def meth(arg); arg end; meth()
<ruby[bot]> djellemah: # => wrong number of arguments (given 0, expected 1) (ArgumentError) ...check link for more (https://eval.in/502655)
<djellemah> >>def meth(arg); arg end; meth ()
<ruby[bot]> djellemah: # => nil (https://eval.in/502656)
<djellemah> semi-significant whitespace again
blackwhitejewish has joined #ruby
blackwhitejewish was kicked from #ruby by ChanServ [Banned: Good bye]
nanoz has quit [Quit: <3]
jackjackdripper has joined #ruby
<adaedra> sigh.
decoponio has joined #ruby
Ishido has joined #ruby
aswen has quit [Quit: WeeChat 1.3]
krz has joined #ruby
ponga has quit []
ponga has joined #ruby
Madmanden has quit [Remote host closed the connection]
Madmanden has joined #ruby
<ponga> do we have phpbb equivelant in ruby?
FernandoBasso has quit [Quit: Leaving]
K1MOS has quit [Ping timeout: 260 seconds]
<ddv> ponga: no but something way better: discourse
<shevy> don't think so... best ruby forum is probably this one: https://www.ruby-forum.com/
<yorickpeterse> "best"
<shevy> yeah
joonty has joined #ruby
aswen has joined #ruby
anisha has quit [Quit: Leaving]
<Ox0dea> > Powered by RForum
<Ox0dea> What is that?
<shevy> that strange forum thingy
<ponga> shevy: ddv sorry i wasn't asking for forum to communicate, i was referring if we have a software equivelant of phpbb
DoubleMalt has quit [Ping timeout: 260 seconds]
<ddv> ponga: try discourse
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<Ox0dea> ponga: The markup syntax?
<ponga> ddv: you mean i should try talking to you people?
<ponga> oh wait, there is a thing called discourse?
<Ox0dea> Aye.
Limix has joined #ruby
techsethi has quit [Quit: techsethi]
<ddv> :/
<ponga> god damn it why is everything named to a certain noun to trick me everytime
sdothum has joined #ruby
sdothum has quit [Client Quit]
<ddv> lol
<Ox0dea> "It's written in Python." "Python what? Scales? Python fangs?" "Blood."
arup_r has quit [Remote host closed the connection]
Guest42435 is now known as saneax_AFK
maia has joined #ruby
freerobby has quit [Quit: Leaving.]
sdothum has joined #ruby
mondok has quit [Quit: Leaving]
<maia> Hello. I have a gem that supports 20+ languages, and for each language there are quite a lot of defined constants (arrays and hashes of strings and regexs).
<maia> Is there a way to dynamically require only the languages currently needed, instead of loading all supported languages into memory?
<ponga> wow i never thought of that
<ponga> multilingual gem
blaxter has quit [Quit: foo]
sdothum has quit [Client Quit]
<shevy> maia you could try to use load() and only load when the language is needed (the respective .rb files)
<Ox0dea> For which autoload is a thing.
sdothum has joined #ruby
<shevy> matz does not approve
dlitvak has quit [Ping timeout: 240 seconds]
<ponga> matz does not approve autoload?
<shevy> I dunno, it was changed at one point again
<lucasb> I saw somewhere that autoload would go away in Ruby 3
dwfait has quit [Remote host closed the connection]
<maia> shevy: I thought Kernel#load will load the code on each call, without checking if already loaded?
<shevy> ponga however 4 years ago he said that: https://bugs.ruby-lang.org/issues/5653
<shevy> maia yeah but you can specify which files you need right?
<ponga> maia: can you not deconstruct gem and remove the multilinguals?
aswen has quit [Quit: WeeChat 1.3]
<Papierkorb> Try loading the language specific parts from a configuration-esque file, e.g. a YAML file
usershel_ has joined #ruby
<Papierkorb> (If that is possible in your case)
<maia> ponga: well, I’m trying to improve the gem, not to rip it apart. and I don’t like the fact that it requires all supported languages.
aswen has joined #ruby
ta has joined #ruby
binaryplease has joined #ruby
hanneli has joined #ruby
<Ox0dea> maia: How do you determine which languages are necessary?
<maia> Papierkorb: oh, so its possible to load from yaml on demand, and only once per session?
synthroid has joined #ruby
hannelita has quit [Ping timeout: 255 seconds]
<Papierkorb> maia: it's code afterall. Something like the internationalizing stuff in rails does.
myntcake has quit [Remote host closed the connection]
Rodya_ has joined #ruby
usershell has quit [Ping timeout: 276 seconds]
<maia> Ox0dea: it’s a gem that processes strings. When passing a string to the gem, you pass the language of the string.
aswen has quit [Client Quit]
hannelita has joined #ruby
asmodlol has quit [Ping timeout: 272 seconds]
<maia> So it could happen that all strings are english, but in other use cases the languages could differ.
fourq|away is now known as fourq
aswen has joined #ruby
<Papierkorb> maia: in that case, beware of multi-threading issues you may have when 'autoloading' that configuration. How big is the overhead anyway?
<ponga> shevy: actually, i became curious, can you manually declare what to use inside a gem?
<ponga> I always thought of require 'thingi' and that's it
<Ox0dea> maia: So then just maintain a Set of the currently loaded languages, and only Kernel#require the requisite files if the Set doesn't yet contain that language, and then insert it so you only load once.
<maia> Papierkorb: it’s not bit at the moment, but it might increase in time (the gem is in early development).
<Ox0dea> ponga: That's it.
<Papierkorb> Just require it? Ruby keeps track of what has been required anyway
<shevy> ponga it is just ruby code, with different .rb files, you can do all the magic inside there the moment you pull in these .rb files (which usually happens by require 'name_here')
aswen has quit [Client Quit]
<Ox0dea> Papierkorb: True enough.
<shevy> ponga the author of the did-you-mean gem had a trick
<Ox0dea> Papierkorb: `$LOADED_FEATURES.clear` ;)
<shevy> ponga https://github.com/yuki24/did_you_mean look at the extra features
<ljarvis> D:
techsethi has joined #ruby
<maia> Ox0dea: would your suggestion cause problems when multi-threading?
hanneli has quit [Read error: No route to host]
<Ox0dea> maia: It's overkill. I derped.
aswen has joined #ruby
<ponga> shevy: ok this is becoming stupid of me, but isn't # require 'gem' automatically puts all its codes onto memory right away?
<ponga> :(
ericfreese has joined #ruby
<ponga> i always thought that is what is done behind the curtain
<Ox0dea> It is.
<Papierkorb> maia: Just load everything that could be needed AOT on startup. How much is it? Probably much less than 1MiB of memory?
<shevy> ponga depends on the code, you can have code such as: def foo; require 'bar'; end
<Ox0dea> require('foo') is essentially eval(File.read('foo'))
<ponga> Ox0dea: omg that clarifies so many things sir
<Ox0dea> ponga: Happy to help. ^_^
Rodya_ has quit [Ping timeout: 246 seconds]
asmodlol has joined #ruby
<Papierkorb> maia: That will keep you from hitting interesting multi-threading issues later on. I'd just not load files which you know will never be needed, e.g. because a certain language is not activated for the environment.
<maia> Papierkorb: it could be a few MB. I don’t want to overcomplicate things, but thought there might be a common way to handle localization files, other than requiring them all.
<ponga> so if all 20 languages are included in a single gem, how could he seperate them
<ponga> i wonder
<Papierkorb> maia: What are those 'localization files'? You mentioned regexes - So is it actually some kind of language processing?
certainty has quit [Quit: WeeChat 1.3]
kalopsian has quit [Ping timeout: 250 seconds]
yfeldblum has quit [Ping timeout: 260 seconds]
<ponga> shevy: I looked at it, thnx 'did you mean' looks very helpful
<shevy> he even fixed "def initialize" !
<ponga> Papierkorb: I guess it is, he said its string processing gem
<shevy> nope
<shevy> I meant "def intialize"
<ponga> shevy: i don't get your joke there sir
<maia> Papierkorb: yes. there’s a constant array storing stop words, a hash storing contractions ('can’t’ => 'can not’), and some language specific rules that are stored as regex (e.g. common ways of displaying a date differ between languages).
duckpuppy has quit [Ping timeout: 245 seconds]
<krz> Cant get this quite right. ap ["a", "b", 5, "c", 4, "d", "a1", "a12", 3, 13, 2].sort_by { |x| x.to_s } I want to order the array by int and strings
<shevy> yeah I wanted to mistype it but ended up typing it correctly. But I used to have errors like: class Foo; def intialize and I did not know why this did not work
gbgdev_ has quit [Remote host closed the connection]
ericfreese has quit [Ping timeout: 265 seconds]
jackjackdripper has quit [Quit: Leaving.]
<krz> in this case the output should be [2, 3, 4, 5, 13, "a", "a1", "a12", "b", "c", "d"]
<krz> Any ideas?
<shevy> ponga it's one of those "extra features" part of his gem, that is not enabled by default
dwfait has joined #ruby
<Papierkorb> maia: Then at some point you'll likely have language specific code, so a YML file or something is not a great idea. I wouldn't waste too much thought into this. You could say that users have to require 'the_gem/languages/language_name' themselves for every language they want to support
duckpuppy has joined #ruby
<Papierkorb> maia: That's basically the model gems like 'parser' for different versions of ruby do it. Sounds like a fair model to me, and avoids threading issues. As it will be needed, it's also not wasted memory.
<maia> Papierkorb: I guess that’s a very smart suggestion. Thanks a lot.
<ponga> what? you can do # require 'gem/hello/bonjour' ?
mfb2 has joined #ruby
<ponga> should write this down on my cheatsheet
allcentury has joined #ruby
aswen has quit [Quit: WeeChat 1.3]
<shevy> yeah
<Papierkorb> ponga: mh? all gems are in the lookup path, when you do require 'the_gem' it thus looks into the paths and will eventually get to the_gem/lib/the_gem.rb and load it. So, yes.
jam_ has joined #ruby
<shevy> ponga you can even use it for tricks such as: require 'gem/autoinclude' if you are too lazy to do a include Bla
<ponga> Papierkorb: then isn't his problem easily solved by # require 'gem/english' ?
<ponga> only importing what he needs
<shevy> that would work as well
<Papierkorb> ponga: correct, that's what I suggested above
<ponga> then I wonder what all the fuss is about
<shevy> maia can now be on the way to happiness
<maia> lol.
dlitvak has joined #ruby
<Papierkorb> maia: is that gem OSS?
karapetyan has joined #ruby
<maia> The suggestion above is very helpful, I just initially hoped there’s a way to require files on demand, without running into threading issues.
<ponga> shevy: my prior saying of the need to switch to python was hindered by an unexpected fact
<ponga> looks like I have to carry on with ruby
<shevy> yay!
kp666 has quit [Remote host closed the connection]
<shevy> I thought your whole team consists of snakes
<ponga> shevy: thing was, python is a minority for japanese, ruby is major for them
<maia> Papierkorb: it has a MIT license, so yes.
<shevy> cool, the japanese have got it right
<ponga> and as you know, my target is japanese, so..
griffindy has joined #ruby
jam_ has quit [Ping timeout: 272 seconds]
Xeago has quit [Remote host closed the connection]
arup_r has joined #ruby
<Ox0dea> krz: How did this happen?
<ponga> shevy: I just never liked python's style anyway, ruby code looks more natural to me
<ponga> I still go 'wtf' at using colon for method
<shevy> for me it is the explicit self that is throwing me off
<shevy> especially when it is not called self
<ponga> shevy: can you give me an example
stannard has joined #ruby
sftrabbit has joined #ruby
pdoherty has quit [Ping timeout: 245 seconds]
karapetyan has quit [Ping timeout: 255 seconds]
<shevy> a new hybrid language between ruby and python would be fun
dwfait has quit [Remote host closed the connection]
<ponga> shevy: actually I would want a hybrid between swift and ruby
<Ox0dea> shevy: http://rupy.eu/
<Ox0dea> That idea is kill.
<ponga> legend of zelda afterall?
<Ox0dea> The logo could totally have been a Blue Rupee.
aswen has joined #ruby
<ponga> yeah, we missed the granduer chance
<shevy> hmm
aswen has quit [Client Quit]
dwfait has joined #ruby
sgambino has joined #ruby
lipoqil has joined #ruby
dlitvak_ has joined #ruby
<ponga> shevy: I read it , um i don't quite get it don't we also have self? what is it mean by its explicit?
<ponga> :(
<ponga> im sorry
tomjoro has quit [Remote host closed the connection]
<Ox0dea> >> ["a", "b", 5, "c", 4, "d", "a1", "a12", 3, 13, 2].group_by(&:class).values.reverse.map(&:sort).reduce(:+) # krz
asmodlol has quit [Ping timeout: 260 seconds]
<ruby[bot]> Ox0dea: # => [2, 3, 4, 5, 13, "a", "a1", "a12", "b", "c", "d"] (https://eval.in/502670)
karapetyan has joined #ruby
<Bish> what's good in swift?
<ponga> Bish: its compiled
<Ox0dea> krz: Not nearly as easy as you might've hoped, indicating that your data is too crazy.
aswen has joined #ruby
<Bish> ponga: so you want crystal?
<ponga> Bish: yes I am in that channel
stannard has quit [Remote host closed the connection]
<ponga> oh no this IRC client isn't
<Bish> good for you!
skade has joined #ruby
peeja has joined #ruby
<ponga> Bish: Im a huge fan of crystal :)
<Bish> i tested it, liked it, but they don't have (good) multithreading yet
<Bish> still, super interesting project
Jardayn has joined #ruby
<Bish> llvm is a god sent
asmodlol has joined #ruby
joonty has quit [Quit: Leaving]
<Papierkorb> No threading yet in there, they're working on it though.
atomical has quit [Ping timeout: 250 seconds]
<shevy> ponga yeah we have self too but we don't have to pass it like noobs as part of an argument list
<Bish> yep, as soon as it's ready i will try some stuff with it
<Bish> wait, can you actually write a kernel with crystal :D that'd dope
<ponga> shevy: ah yeah true... It has self as an argument in every line..why would they do that?
K1MOS has joined #ruby
skade has quit [Read error: Connection reset by peer]
<Bish> RubyO™
dlitvak has quit [Ping timeout: 265 seconds]
<ponga> ok fine then a hybrid between C# and ruby
northfurr has quit [Quit: northfurr]
<ponga> actually I really like C#
joonty has joined #ruby
<Bish> shit i made it worse
atomical has joined #ruby
<Bish> :D
K1MOS is now known as moos3
<shevy> ponga I assume because they had no alternative; probably they also did not use @ ... they use @ already for something else, these weird decorator things
Xeago has joined #ruby
<Bish> how is c# any different from ruby?
aswen has quit [Client Quit]
<ljarvis> ...
<ponga> lol
<Bish> i mean.. they both run on the same vm ( ironruby ) so they can do the same stuff?
<Bish> i didn't mean it as i said it
aswen has joined #ruby
<ponga> Bish: what? C# runs on ironruby?
<ljarvis> they both run on ironruby, what?
<Bish> i tried c# because i liked monodevelop ( i hate all other ides )
<Bish> yeah that's what i meant, clearly
duckpuppy has quit [Ping timeout: 245 seconds]
<ljarvis> c# does not run on ironruby
<ponga> what?
<Bish> don't act like you don't know what i mean
peeja has quit [Ping timeout: 255 seconds]
<ponga> no, I don't
p8m has quit [Remote host closed the connection]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ponga> Im the mascot of foolishness in this channel
<Bish> ironruby runs on a vm, c# runs on a vm, hey it's the same vm
<ponga> shevy: aren't I shevo?
<ponga> :\
<ljarvis> ironruby is just a ruby implementation that's integrated with the .NET framework
<ljarvis> that's it
<shevy> ponga I can't remember! you have been gone for too long a time
<ljarvis> yes you can use ironruby code from c#, is that what you meant?
<ljarvis> this question is incredibly ambiguous
<Bish> yep
<ponga> anyway
<ponga> C# to me looks like a whole upgrade from horrible Java
<Bish> i said they have the same vm, so there is a possibility they can interact, that was actually the plan with ironruby and .net itself, isn't it?
<ljarvis> yeah c# is actually really nice
<ponga> its like you had a shit experience with a girl, then you meet a totally better girl
<Bish> i tried c# and hated even more than java
aryaching has quit [Ping timeout: 246 seconds]
<Bish> or should i say
<Bish> HatedItMore()
<ponga> Bish: why?
sftrabbit has quit [Quit: sftrabbit]
<ponga> how can you hate something more than java?
<ponga> that's impossible
* ljarvis kinda likes java
<ponga> omg
<shevy> GRAB THE PITCHFORKS!!!
dionysus69 has joined #ruby
<Bish> i started with sockets, and ended up creating 5 objects until i had a connection
techsethi has quit [Ping timeout: 265 seconds]
<ponga> shevy: I will ask the north to prepare his alledged hydrogen bomb
<Bish> and then i uninstalled it
<ljarvis> luckily i'm happy enough in life to avoid the hate and instead point it towards php and javascript
<shevy> ponga send in ITF Taekwondo, they be more effective
<Bish> i like php and javascript
<Bish> well javascript more than php
<ponga> and we have who likes php ?
kalopsian has joined #ruby
<ponga> shevy: mine got what has this channel turned into?
sftrabbit has joined #ruby
<shevy> ponga it is now moderated with happiness and love!
<ljarvis> ?ot
<ruby[bot]> this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
<Bish> happiness and love is offtipic :(
<ponga> thanks ruby[bot], I didn't know your AI was so impressive
<ponga> does he run on some sort of NLP?
<ponga> or is he man-driven?
<ljarvis> he's op-driven
aryaching has joined #ruby
<ljarvis> s/he/it/
<ponga> ruby[bot]: hello do you run on weak AI consisted of NLP scripts?
<Papierkorb> ponga: [15:05] <ljarvis> ?ot
<ljarvis> spoil sport
<ponga> Papierkorb: what is ?ot
<ponga> ah ?off-topic, sorry
<shevy> :)
<pawnbox> ponga: I think s/he/it just catches instances of other languages. :)
<ponga> so ruby[bot] reads the lines and use NLP to check if its off-topic? impressive!!
<pawnbox> Like javascript maybe.
hannelita has quit [Remote host closed the connection]
<jhass> ponga: don't drink and IRC
<ponga> jhass: Im not pissed, im just uneducated yet
<ponga> for example, I can't understand what 's/he/it/' is
hannelita has joined #ruby
<ponga> s/ is sarcasm righ?
<jhass> it's offtopic at this point
<jhass> don't continue
<ponga> oh ok
<jhass> (here)
kalopsian has quit [Ping timeout: 240 seconds]
peeja has joined #ruby
weckl has joined #ruby
kt2 has joined #ruby
sinkensabe has quit [Remote host closed the connection]
<shevy> see ponga - love and happiness!
<arup_r> ponga: hi.. hw r u ?
kalopsian has joined #ruby
<arup_r> I see u after years.. :)
<ponga> I'm stunned
<ponga> and very sad
nettoweb has joined #ruby
<arup_r> ok, but it is 2016..
kt2 has quit [Client Quit]
<ponga> arup_r: hello I'm very confused of many terminologies that appear here
<arup_r> yeah, channel still belongs to 90's :p
<ponga> arup_r: thing is I was experimenting myself with python, didn't like use of : and many things, came back to ruby
darkf_ has joined #ruby
<arup_r> yeah, like me. My first python program didn't run due to indentation, but my first ruby program ran. So I am still with Ruby..
duckpuppy has joined #ruby
<solars> haha
<ponga> arup_r: and thankfully ruby is more major than python in ruby, at least it seems so to me
<ponga> * i mean in japan
jxs_ has quit [Remote host closed the connection]
dorei has joined #ruby
darkf has quit [Ping timeout: 260 seconds]
chussenot has quit [Quit: chussenot]
<arup_r> hmm
<norc_> What kind of encoding is this? ▯▯▯▯
<norc_> o_o
<norc_> How can I figure this out?
nanoz has joined #ruby
puria has joined #ruby
tvw has joined #ruby
<Bish> norc_: what encoding :o?
kalopsian has quit [Ping timeout: 240 seconds]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dionysus69 has quit [Ping timeout: 240 seconds]
kalopsian has joined #ruby
sdwrage has joined #ruby
bascht has quit [Quit: WeeChat 1.4]
bascht has joined #ruby
chussenot has joined #ruby
dlitvak has joined #ruby
<Papierkorb> norc_: store it in a file and use the 'file' utility
TomPeed has joined #ruby
grill has joined #ruby
rodfersou has quit [Ping timeout: 240 seconds]
<norc_> Papierkorb: It claims UTF-8 Unicode.
<norc_> Then the codepoints would be completely borked though.
|ifei5g00d has joined #ruby
roa is now known as Roa
Snowy_ is now known as Snowy
aswen has quit [Quit: WeeChat 1.3]
dlitvak_ has quit [Ping timeout: 250 seconds]
|ifei5good has quit [Ping timeout: 265 seconds]
<TomyWork> norc_ if you paste it to a file using a text editor chances are your editor saves it as utf-8
<TomyWork> find a better way
B1n4r10 has joined #ruby
Outlastsheep has quit [Ping timeout: 276 seconds]
<shevy> :D
UtkarshRay has joined #ruby
fsapo has quit [Ping timeout: 272 seconds]
dcunit3d has quit [Ping timeout: 272 seconds]
<norc_> TomyWork: Nope.
<TomyWork> wel then not
<norc_> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604] are the codepoints for a string that should be "Beethoven"
<norc_> This is confusing.#
<ponga> norc_: to find out what the letter encoding is, I often just put that onto browser, and do the 'automatic encoding for the webpage'
Rodya_ has joined #ruby
<TomyWork> that looks like it's close to 2^20 if that helps in any way
usershel_ has quit [Read error: Connection reset by peer]
<TomyWork> utf-16be maybe?
rodfersou has joined #ruby
<wolfedale> jhass: https://gist.github.com/wolfedale/fc4da012b1b037381734 , Now it's working (so far) :-)
absolutejam has left #ruby ["WeeChat 1.3"]
<dorei> >> "Beethoven".codepoints
<ruby[bot]> dorei: # => [66, 101, 101, 116, 104, 111, 118, 101, 110] (https://eval.in/502697)
<TomyWork> >> "Beethoven".codepoints.map {|x| x*256}
astrofog has quit [Quit: Quite]
<norc_> ponga: No luck on that.
<TomyWork> bot doesnt like me
tonini has quit [Quit: Connection closed for inactivity]
<norc_> >> "Beethoven".codepoints.map {|x| x*256}
<ruby[bot]> norc_: # => [16896, 25856, 25856, 29696, 26624, 28416, 30208, 25856, 28160] (https://eval.in/502698)
<norc_> Works for me!
<norc_> :-)
peeja has quit [Ping timeout: 264 seconds]
<norc_> TomyWork: Does not look like utf-16be
<TomyWork> no such luck anyway
<norc_> If its any help the source language is German.
<dorei> probably someweird iso then
<TomyWork> iso-8859-15 if anything
usershell has joined #ruby
<TomyWork> and the base latin alphabet exactly maps to utf-8
Rodya_ has quit [Ping timeout: 265 seconds]
<TomyWork> >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map {|x|x-1024**2}
<ruby[bot]> TomyWork: # => [29, 27, 27, 30, 31, 17, 32, 27, 28] (https://eval.in/502702)
<dorei> > [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map {|x| x.to_s(16) }
<dorei> >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map {|x| x.to_s(16) }
<norc_> TomyWork: It will not work like that.
<ruby[bot]> dorei: # => ["10001d", "10001b", "10001b", "10001e", "10001f", "100011", "100020", "10001b", "10001c"] (https://eval.in/502703)
<norc_> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map { |a| a - 1048605 }
<TomyWork> this looks like huffman-encoded or something
<norc_> >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map { |a| a - 1048605 }
<ruby[bot]> norc_: # => [0, -2, -2, 1, 2, -12, 3, -2, -1] (https://eval.in/502704)
<TomyWork> could be worse
<TomyWork> could be ebcdic
<norc_> It definitely does not have the same ASCII order of characters.
<dorei> >> [0x1d, 0x1b, 0x1b, 0x1e, 0x1f, 0x11, 0x20, 0x1b, 0x1c].map(&:chr)
asmodlol has quit [Ping timeout: 250 seconds]
<ruby[bot]> dorei: # => ["\x1D", "\e", "\e", "\x1E", "\x1F", "\x11", " ", "\e", "\x1C"] (https://eval.in/502705)
usershell has quit [Remote host closed the connection]
sinkensabe has joined #ruby
<TomyWork> >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].zip("Beethoven".codepoints).map {|(x,y)|x-y-1024**2}
asmodlol has joined #ruby
<ruby[bot]> TomyWork: # => [-37, -74, -74, -86, -73, -94, -86, -74, -82] (https://eval.in/502709)
casadei has joined #ruby
<TomyWork> (imo that ".map" should be superfluous, but it didnt work on my ruby without it)
<dorei> looks more like a cryptogram, than a encoding issue xD
bithon has quit [Ping timeout: 264 seconds]
<TomyWork> yep
<TomyWork> a crappy substitution cypher though
<dorei> maybe the numbers have the wrong endianess
<norc_> Well... the input comes from just straight copy pasting out of a PDF file...
<TomyWork> t and v have the same offset, hmmmm
<dorei> or maybe they're ebcdic
sankaber has joined #ruby
<dorei> norc_: can you paste that string somewhere in the web?
<TomyWork> >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].zip("beethoven".codepoints).map {|(x,y)|x-y-1024**2}
<ruby[bot]> TomyWork: # => [-69, -74, -74, -86, -73, -94, -86, -74, -82] (https://eval.in/502710)
<norc_> dorei: Let me think of something
<norc_> TomyWork: Mind the capital B at the beginning of Beethoven.
<TomyWork> norc_ yeah i was trying with lowercase b
huyderman has quit [Remote host closed the connection]
asmodlol has quit [Ping timeout: 240 seconds]
<norc_> dorei: Pastie.org seems to timeout when trying to paste this.... :-)))
<norc_> Oh well, usual CloudFlare.
Xeago has quit [Remote host closed the connection]
asmodlol has joined #ruby
jschmid has quit [Quit: Leaving]
<norc_> That is 2 strings there. The line beneath each contains the bizarre encoding.
jaiks has joined #ruby
stannard has joined #ruby
mfb2 has quit [Ping timeout: 260 seconds]
dmonster has quit [Remote host closed the connection]
citrusfizz has quit [Quit: ChatZilla 0.9.92 [Firefox 43.0.4/20160105164030]]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sankaber has quit [Remote host closed the connection]
vikas027 has joined #ruby
sankaber has joined #ruby
aryaching has quit [Ping timeout: 245 seconds]
dmonster has joined #ruby
aryaching has joined #ruby
stannard has quit [Ping timeout: 245 seconds]
hannelita has quit [Remote host closed the connection]
stannard has joined #ruby
hannelita has joined #ruby
mikecmpbll has joined #ruby
kalopsian has quit [Ping timeout: 265 seconds]
<TomyWork> did anyone actually try ebcdic yet?
Xeago has joined #ruby
<norc_> TomyWork: The codepoints make no sense in EBCDIC
dlitvak_ has joined #ruby
dlitvak_ has quit [Remote host closed the connection]
<TomyWork> it still has something like codepoints
<norc_> mmm
<norc_> give me a second
<havenwood> >> Encoding.find 'ebcdic-cp-us'
<ruby[bot]> havenwood: # => #<Encoding:IBM037 (dummy)> (https://eval.in/502712)
maia has quit [Quit: maia]
davedev24 has joined #ruby
dlitvak_ has joined #ruby
bithon has joined #ruby
govg has joined #ruby
duckpuppy has quit [Quit: WeeChat 1.4]
<norc_> TomyWork: I just get Iconv::IllegalSequence for anything so far.
duckpuppy has joined #ruby
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ev_ has joined #ruby
workmad3 has joined #ruby
<TomyWork> me too
<ev_> BigDecimal('-0.5').power(BigDecimal('0.2')) # => Math::DomainError: Zero or negative argument for log
FernandoBasso has joined #ruby
<ev_> WTF?
dlitvak has quit [Ping timeout: 276 seconds]
bMalum has joined #ruby
<norc_> >> Encoding
<ruby[bot]> norc_: # => Encoding (https://eval.in/502713)
<TomyWork> 5th root of -0.5...
<TomyWork> should be fine
<norc_> >> BigDecimal('-0.5').power(BigDecimal('0.2'))
<norc_> >> BigDecimal('-0.5').power(BigDecimal('0.2'))
<TomyWork> but remember, this isnt exact science
cdg has joined #ruby
<ev_> fails
<TomyWork> what does wolframalpha say?
binaryplease has quit [Quit: WeeChat 1.3]
nettoweb has joined #ruby
dionysus69 has joined #ruby
rubyfanfr has left #ruby [#ruby]
<ev_> same as -0.5**0.2 # => -0.8705505632961241
<TomyWork> oh so ** works but power breaks?
<TomyWork> mabye it goes via other types
<ev_> TomyWork, no, floats work, bigdecimal don't
<TomyWork> wat
<TomyWork> i wouldn't expect either of them to work
<TomyWork> since, you know, 0.2 isnt exactly 1/5
willv has joined #ruby
<TomyWork> ...when expressed as floating-point numbers
<norc_> TomyWork: Im starting to get some ideas about this.
<TomyWork> i think it should even be an infinite periodic rational number in base 2...
<norc_> TomyWork: This has to be related to UTF-32 somehow.
<norc_> It fits.
<TomyWork> maybe
lucasb has quit [Quit: leaving]
<TomyWork> wat
<TomyWork> okaaay
chipotle has quit [Quit: cheerio]
aryaching has quit [Ping timeout: 240 seconds]
<norc_> Have not found a way to transform it, but it has to.
<TomyWork> it's infinite and periodic in base 2
chipotle has joined #ruby
<ev_> eh, nice :)
karapetyan has quit [Remote host closed the connection]
<TomyWork> arbitrary precision is still finite :)
hxegon has joined #ruby
momomomomo has joined #ruby
momomomomo has quit [Client Quit]
jackcom has joined #ruby
kiidbrian has quit [Ping timeout: 240 seconds]
<ev_> still looks like a bug, no?
pawnbox has quit [Remote host closed the connection]
gizmore has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
<norc_> TomyWork: Sigh I give up. Every tool keeps telling me this is UTF-8
kiidbrian has joined #ruby
kiidbrian has quit [Max SendQ exceeded]
fl__ has joined #ruby
moos3 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
whippythellama has joined #ruby
pawnbox has joined #ruby
kiidbrian has joined #ruby
carraroj has joined #ruby
voidDotClass has quit [Ping timeout: 246 seconds]
akemrir has quit [Quit: WeeChat 1.3]
rodfersou is now known as rodfersou|lunch
kalopsian has joined #ruby
skade has joined #ruby
bronson has joined #ruby
yardenbar has quit [Ping timeout: 256 seconds]
rodolfowtf has joined #ruby
nerfando has joined #ruby
pawnbox_ has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
st0opkid has joined #ruby
shredding has joined #ruby
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #ruby
dlitvak has joined #ruby
dtordable has quit [Quit: leaving]
sftrabbit has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
ponga has quit [Quit: Leaving...]
dtordable has joined #ruby
Vitor has quit [Ping timeout: 246 seconds]
norc_ has quit [Ping timeout: 252 seconds]
dn5 has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
dlitvak_ has quit [Ping timeout: 240 seconds]
mary5030 has quit [Remote host closed the connection]
Limix has quit [Quit: Limix]
kbni has joined #ruby
<kbni> Hi there.
mrtomme has quit [Ping timeout: 246 seconds]
dwfait_ has joined #ruby
<Bish> kbni: HI
matp_ has joined #ruby
kerunaru has joined #ruby
sonne has quit [Ping timeout: 250 seconds]
mrtomme has joined #ruby
dionysus70 has joined #ruby
dfoolz has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 250 seconds]
dionysus70 is now known as dionysus69
<kbni> I'm very new to Ruby, I am just sort of playing with a bit. I was wondering if someone could help me explain some Ruby behavior for me that I am a little miffed by.
dwfait has quit [Ping timeout: 250 seconds]
abyss has quit [Ping timeout: 250 seconds]
snapcase has quit [Ping timeout: 250 seconds]
Rodya_ has joined #ruby
jinie has quit [Ping timeout: 256 seconds]
dannluciano_ has quit [Ping timeout: 265 seconds]
<kbni> What exactly is the difference between object do |x| stuff end and object stuff
matp has quit [Ping timeout: 276 seconds]
yardenbar has joined #ruby
grassass has quit [Ping timeout: 265 seconds]
pawnbox has quit [Remote host closed the connection]
gbgdev has joined #ruby
veloutin has quit [Ping timeout: 260 seconds]
gilesww has quit [Ping timeout: 245 seconds]
isene has quit [Ping timeout: 265 seconds]
janno has quit [Ping timeout: 240 seconds]
async_prince has quit [Ping timeout: 276 seconds]
dfoolz has joined #ruby
<ev_> kbni, hi! soo in your case `object` must be a method for this to make sense
ruisantos has quit [Ping timeout: 265 seconds]
<ev_> in first case you will be passing a `do ... end` block to it, in second - argument `stuff`
Scient has quit [Ping timeout: 250 seconds]
aryaching has joined #ruby
<kbni> hm
ericfreese has joined #ruby
dlitvak has quit [Remote host closed the connection]
jinie has joined #ruby
<kbni> ev_, I am using Nokogiri::XML::Builder to play with some XML stuff, and from within a block I can do xml.foo and it just creates a foo tag
dfinninger has joined #ruby
Scient has joined #ruby
dlitvak has joined #ruby
<kbni> ev_, however - if I do @cursor = xml.foo to save that location to my class, when I reference it later on (using self.cursor) it behaves completely differently
Rodya_ has quit [Ping timeout: 240 seconds]
<dn5> Is there a way to run a method on any exception/error thrown by script?
async_prince has joined #ruby
aegis3121 has joined #ruby
veloutin has joined #ruby
<dn5> Like instead of crashing and displaying error, the script will continue with particular method called
dannluciano has joined #ruby
isene has joined #ruby
dlitvak has quit [Remote host closed the connection]
sonne has joined #ruby
<ev_> kbni, I think you can't use Nokogiri::XML::Builder like that
gilesww has joined #ruby
<kbni> is there a xml library that would allow me to dynamically build an xml document? maybe something like lxml/etree in Python?
ericfreese has quit [Ping timeout: 256 seconds]
grassass has joined #ruby
usershell has joined #ruby
carraroj has quit [Ping timeout: 260 seconds]
abyss has joined #ruby
ruisantos has joined #ruby
<ddv> kbni: nokogiri?
arup_r has quit []
Madmanden has quit []
snapcase has joined #ruby
janno has joined #ruby
dlitvak has joined #ruby
al2o3-cr has quit [Quit: WeeChat 1.3]
rippa has joined #ruby
cornerman has quit [Read error: Connection reset by peer]
jam_ has joined #ruby
aryaching has quit [Ping timeout: 276 seconds]
cornerman has joined #ruby
usershell has quit [Ping timeout: 240 seconds]
lucasb has joined #ruby
rodfersou|lunch is now known as rodfersou
Mia has quit [Ping timeout: 250 seconds]
dlitvak has quit [Ping timeout: 256 seconds]
<lucasb> >> lambda { block_given? }.call {}
<ruby[bot]> lucasb: # => false (https://eval.in/502737)
bMalum has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
darkf_ is now known as darkf
<lucasb> ^^ I would have expected this to work
<lucasb> lambda {|&b| b }.call {} # <-- this way works O.o
dlitvak has joined #ruby
al2o3-cr has joined #ruby
jam_ has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
A124 has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
tjohnson has joined #ruby
aryaching has joined #ruby
<TomyWork> dn5 ruby code is more of a program than a script in that regard
<TomyWork> catching all exceptions and just continuing would be pretty catastrophic to most programs
pawnbox has quit [Remote host closed the connection]
<Bish> i've seen a lot of those programs ( mine :p )
<kbni> is there a pythondir() equiv
<TomyWork> kbni no idea, but google for load path.
<TomyWork> ruby load path
<Bish> kbni: do you mean pythons "DIR" ?
<Bish> becasue i don't know pythondir()
<kbni> uhm
<kbni> No, dir(object) lists members of an object
<Bish> yeah.. that's what i meant
<Bish> well, you can ready all sorts of metadata of anything in ruby
ev_ has quit [Quit: Leaving]
Melpaws has joined #ruby
asccigcc has joined #ruby
<Bish> >> 1.methods
<ruby[bot]> Bish: # => [:%, :&, :*, :+, :-, :/, :<, :>, :^, :|, :~, :-@, :**, :<=>, :<<, :>>, :<=, :>=, :==, :===, :[], :in ...check link for more (https://eval.in/502738)
<Bish> for example, all methods of the class "Fixnum", meaning everything a number can do
shinnya has joined #ruby
<adaedra> Numeric, rather
<havenwood> kbni: You might like `ls` in the Pry REPL.
<lucasb> kbni: in addition to .methods, there's also local_variables
tvw has quit [Remote host closed the connection]
<havenwood> lucasb: lambda { |&block| block.call; block_given? }.call { puts "Freya's day!" }
dlitvak has quit [Ping timeout: 255 seconds]
SCHAAP137 has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
<lucasb> havenwood: thanks. but when not using a &block parameter, do you think block_given? should have returned true?
scepticulous has joined #ruby
jbrhbr has joined #ruby
<havenwood> lucasb: note it returns false there ^
<lucasb> indeed
<havenwood> so it's false both time
gagrio has quit [Ping timeout: 276 seconds]
<lucasb> indeed again. and maybe... I was expecting true both times
wolfedale has quit []
grasshopper has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<Papierkorb> lucasb: I'd expect yield and block_given? to act in the scope of the current method and not the block..
<Papierkorb> (Which it apparently does)
<kbni> pry looks great, thanks!
aryaching has quit [Ping timeout: 240 seconds]
<lucasb> Papierkorb: ok, this makes sense. thanks
lkba has joined #ruby
dlitvak has joined #ruby
anisha has joined #ruby
Vitor has joined #ruby
pawnbox has joined #ruby
kbni is now known as awox
vikas027 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<aegis3121> so I've anonymized a bunch from this, but can anyone explain how this code would work? https://gist.github.com/jon2992/b4a92d9dd918b5b98bb4
Outlastsheep has joined #ruby
<aegis3121> I'm a bit confused as to how overriding new is...a good plan.
mchu has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
karapetyan has joined #ruby
sftrabbit has joined #ruby
lsmola has quit [Ping timeout: 260 seconds]
El3ktra has quit [Ping timeout: 260 seconds]
chussenot has quit [Quit: chussenot]
<awox> Why does Ruby have so many popular versions?
<jhass> awox: what do you mean?
<jhass> aegis3121: no, it's a quite bad idea
sftrabbit has quit [Client Quit]
bubbys has quit [Ping timeout: 245 seconds]
arup_r has joined #ruby
<aegis3121> jhass: yea. I've never encountered code like that before and it's a bit off-putting.
chussenot has joined #ruby
bubbys has joined #ruby
sftrabbit has joined #ruby
<jhass> aegis3121: do you know what the term singleton class means in the Ruby context and what extend has to do with it?
ljames has joined #ruby
<awox> can I make Ruby use curly braces instead of do/end?
karapetyan has quit [Ping timeout: 240 seconds]
<jhass> awox: what do you mean by make? braces are an almost equal alternative to do/end
<awox> def foo {
<awox> }
<havenwood> awox: When you say "versions" what do you mean?
sinkensabe has quit [Remote host closed the connection]
<jhass> awox: there's no do after def
<jhass> so no
<aegis3121> jhass: Not as well as I should. My use of extend, as far as I know, is to allow a Module's methods to be Class methods rather than instance methods.
<awox> havenwood, like, 1.9/2.0/2.3.. so many cool versions to chose from. so much more choice than Python. :D
<jhass> aegis3121: if you can invest the time, watch https://www.youtube.com/watch?v=by5fFOBhtPQ
<havenwood> awox: Ruby 2.3 is latest stable. Most folk will be using 2.3 or 2.2 (since 2.3 just came out on Christmas day).
<aegis3121> jhass: thanks, I'll do that.
podman has joined #ruby
<jhass> awox: 1.9 is out of official security maintenance, 2.0 will be on 24th February
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
<havenwood> awox: So it's 2.1.8, 2.2.4 or 2.3.0 for stable releases that aren't end-of-life soon.
<jhass> with quite big compatibility between them
<awox> but not completely compatible?
<jhass> it's more like python 3.3, 3.4, 3.5
<havenwood> awox: Semantic versioning.
<jhass> I think completely backwards compatible
<awox> hm okies
B1n4r10 has quit [Ping timeout: 246 seconds]
<awox> is there a way to avoid the @/@@ notation for instance/class variables?
aryaching has joined #ruby
<awox> like - can I just use self.foo?
<ljarvis> awox: yes
<ljarvis> if you add readers/writers
<jhass> just avoid class variables altogether, 95% of the uses I've seen are better solved by class level instance variables
<TomyWork> if i assign an @@ variable at class scope, will it be shared with a sibling class?
<ljarvis> ?try
<ruby[bot]> Why don't you try it and see for yourself?
<jhass> self.foo will be a method call
chipotle has quit [Quit: cheerio]
<TomyWork> i.e. a class that's a subclass of the same superclass?
<havenwood> if sys.version_info[0] == 2: snakes!
bb010g has joined #ruby
<TomyWork> that's neither python nor ruby
<TomyWork> you have created a monster!
ericfreese has joined #ruby
dn5 has quit [Ping timeout: 256 seconds]
mostlybadfly has joined #ruby
<havenwood> Python 2 will be end-of-lifed the year Ruby 3 is released. We welcome the Python 2ers!
felixdd has quit [Ping timeout: 245 seconds]
DaniG2k has joined #ruby
<awox> :(
dfinninger has quit [Remote host closed the connection]
<awox> 2.7 4 lyfe
jas02 has quit [Quit: jas02]
<adaedra> But 2.7 is not out yet!
<adaedra> (Because we're talking ruby, right?)
dfinninger has joined #ruby
<awox> Also, EOL for Python 2.7 is like 2020
domgetter has joined #ruby
chussenot has quit [Quit: chussenot]
<havenwood> awox: Right, the year Ruby 3 is due.
aufi has quit [Quit: Konversation terminated!]
<havenwood> 3x as fast as Ruby 2.
chouhoulis has joined #ruby
mark1 has left #ruby ["PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PONG :asimov.freenode.net"]
st0opkid has quit [Read error: Connection reset by peer]
<Bish> how did those part messages find it's way into his quit message :o
st0opkid has joined #ruby
st0opkid has quit [Max SendQ exceeded]
<awox> Alright, it's like 3 am and I'mnot getting anywhere so It's time for sleep
<awox> thank you for answering my very dumb questions :)
stannard has quit [Remote host closed the connection]
dfinninger has quit [Remote host closed the connection]
synthroid has quit [Remote host closed the connection]
terminalrecluse has joined #ruby
stannard has joined #ruby
stamina has quit [Quit: WeeChat 1.3]
bluOxigen has quit [Ping timeout: 260 seconds]
dfinninger has joined #ruby
dn5 has joined #ruby
Rodya_ has joined #ruby
haraigoshi has joined #ruby
dlitvak has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 240 seconds]
framlinqp has quit [Read error: Connection reset by peer]
frem has joined #ruby
minimalism has quit [Ping timeout: 276 seconds]
haraigo has quit [Ping timeout: 276 seconds]
minimalism has joined #ruby
mary5030 has joined #ruby
Rodya_ has quit [Ping timeout: 260 seconds]
lacuna has quit [Remote host closed the connection]
emilford has quit [Ping timeout: 245 seconds]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
scepticulous has quit [Ping timeout: 240 seconds]
bigkevmcd has quit [Quit: Outta here...]
willv has quit [Quit: Lost terminal]
amclain has joined #ruby
du5tball has joined #ruby
<jackcom> there is a ruby on that package like gruff is preinstalled. like anaconda in python?
zast has joined #ruby
Limix has joined #ruby
konsolebox has quit [Ping timeout: 265 seconds]
<du5tball> hi there. i'm just learning ruby and came across public and private today. how long are those keywoards valid? as in, if i define several private functions, is private valid untill i cancel it?
jaiks has quit [Ping timeout: 250 seconds]
<ghr> du5tball yeah
<bougyman> if I understand your question right: yes.
<jhass> du5tball: depends on whether you pass them an argument or not
<jhass> du5tball: note that def returns a symbol and thus can be an argument
<jhass> they're actually methods btw
<jhass> &ri Module#public Module#private
<du5tball> uh, methods. okay. eh, names
<jackcom> jhass: help me
<du5tball> i'm from python. def -> function
diegoviola has joined #ruby
jackcom was kicked from #ruby by ruby[bot] [http://ruby-community.com/pages/user_rules#rule_2_7]
<du5tball> "subsequently defined methodS", that's what i was looking for. codecademy doesn't clear this up
<du5tball> they just go "make this public, make this private, and make this public again"
pdoherty has joined #ruby
emilford has joined #ruby
<jhass> depends on how you use them
GinoManWorks has joined #ruby
<Ox0dea> >> public == private # Don't use them like this.
<ruby[bot]> Ox0dea: # => true (https://eval.in/502762)
stannard has quit [Remote host closed the connection]
<du5tball> so, methods return a symbol, which would terminate public / private. from what i understand, i can't prevent ruby from returning something, but could define the return myself. would something like 'return "asdf"' prevent that?
<aegis3121> no....
sivoais is now known as sivoais-ms
<aegis3121> so you could define a bunch of methods, then decide you want x, y, and z to be private like so -> private :x, :y, :z
sepp2k has joined #ruby
<aegis3121> the fact that those return symbols is, more or less, what allows that to work like that, I believe.
chipotle has joined #ruby
<du5tball> wait - the methods can be addressed via symbols?
stannard has joined #ruby
stannard has quit [Remote host closed the connection]
<du5tball> ohh, okay
<jhass> and since method definitions return the symbol of their name, you can write things like private def foo these days
<jhass> which is passing the return value of def foo to the method private
<du5tball> okay, that's weird, but it does make sense
<Ox0dea> Using "return" when you mean "evaluate to" is unnecessarily confusing.
<Ox0dea> Especially in the context of method definition.
stannard has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
<jhass> mh, yes I usually say have the value or something, my bad
myntcake has joined #ruby
<Ox0dea> du5tball: Why weird?
rodfersou is now known as rodfersou|lunch
<du5tball> i've never seen "private <method> <method> <method>" somewhere else
lacuna has joined #ruby
lacuna has quit [Changing host]
lacuna has joined #ruby
synthroid has joined #ruby
<Ox0dea> Nor will you see it in Ruby.
<lucasb> yeah, some confusion here. just to clarify: method definition returns their name as a symbol. method execution returns the last value in their bodies.
<Ox0dea> >> def foo; 42; end
<ruby[bot]> Ox0dea: # => :foo (https://eval.in/502764)
<soahccc> Does anyone know how to gracefully shutdown when using daemons gem? I used to trap the signals but now I saw in the source that you are not supposed to overwrite the trap :S
<Ox0dea> That method definition *evaluates to* :foo, but the foo method *returns* 42.
<Ox0dea> soahccc: Traps can stack, for what that's worth.
scottschecter has joined #ruby
hxegon has quit [Read error: Connection reset by peer]
polishdub has joined #ruby
<lucasb> pedantically, I consider an expression *returning* some value or *evaluating to* some values to be synonyms :)
aegis3121 has quit [Ping timeout: 240 seconds]
minimalism has quit [Ping timeout: 264 seconds]
<soahccc> Ox0dea: oh they do? If I untrap my own hook (returning to default behaviour) the other trap is still there? Or do I have to not "untrap"
<Ox0dea> lucasb: And yet that clearly doesn't hold in the case of Ruby method definitions.
einarj has quit [Remote host closed the connection]
<lucasb> Ox0dea: how come? isn't a method definition an expression in itself?
DaniG2k has quit [Quit: leaving]
ruby-lang042 has joined #ruby
<lucasb> I thought everything in ruby was an expression
Jackneill has quit [Ping timeout: 264 seconds]
snockerton has joined #ruby
<Ox0dea> soahccc: The latter.
<shevy> everything in ruby is a cat
baweaver has quit [Remote host closed the connection]
<TomyWork> `cat`
ericfreese has quit [Quit: WeeChat 1.4]
ericfreese has joined #ruby
<Ox0dea> lucasb: It's certainly quite strange to say that `def foo; 42; end` evaluates to 42.
<Ox0dea> And by "strange" I of course mean wrong. :P
<lucasb> because it doesn't evaluate to 42, it evaluates to :foo
<Ox0dea> >> value = def foo; 42; end; value
<ruby[bot]> Ox0dea: # => :foo (https://eval.in/502773)
dhollinger has joined #ruby
babblebre has joined #ruby
ericfreese has quit [Client Quit]
mikecmpbll has quit [Ping timeout: 260 seconds]
<Ox0dea> It does evaluate to :foo, yes, but it would be strange to call that its return value.
<lucasb> but it *is* it's return value :)
webus has joined #ruby
colegatron has quit [Ping timeout: 260 seconds]
<Ox0dea> Its return value is the value the method returns, which is 42.
<Ox0dea> It's totally okay for these to be different things.
zambini has joined #ruby
<TomyWork> I'm installing some gems to .bundle using "rvm 2.2.1 do bundle install" and then i run my app with "rvm 2.2.1 do ./app.rb". It can't find that new gem. it can find a different gem, though that is also under .bundle
centrx has joined #ruby
<TomyWork> i'm a bit confused :)
<TomyWork> "rvm 2.2.1 do bundle exec ./app.rb" works
<TomyWork> but that doesnt work with rerun
<Ox0dea> Way spooky.
<TomyWork> okay, it works if i put rerun outside the bundle exec
<Ox0dea> Try `rvm implode`.
<jhass> TomyWork: make sure to either require "bundler/setup" or bundle exec
centrx has quit [Remote host closed the connection]
blarghlarghl has joined #ruby
<TomyWork> i'll use bundle exec
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
karapetyan has joined #ruby
<blarghlarghl> Hi. I'm stuck in Unicode hell. There is an external library that I'm using which accepts a string, and does ... something ... to it. I think it _assumes_ the string is a UTF-16 variant. Then all it does is spit the string back out - but it does _something_ to it again on the way out. Basically I put in "hi" and get back a bunch of Chinese characters. Treating this as a black box - how can I figure out what it's expecting and what it's givin
Takumo is now known as Jagmill5
Jagmill5 is now known as Takumo
shredding has quit [Ping timeout: 246 seconds]
<blarghlarghl> I've noticed that single character strings work fine - a => a. but "aa" gives me a four-\x-character string back
<soahccc> Ox0dea: hmm I'm afraid thats not how it works :( https://gist.github.com/2called-chaos/4ba85f03853bc88595fd
usershell has joined #ruby
treehug88 has joined #ruby
<Ox0dea> soahccc: That's "undoing" the original, though. There's definitely a way to store the old trap, but I forget the slick approach just now.
lacuna has quit [Remote host closed the connection]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mercerist has joined #ruby
<Ox0dea> soahccc: Oh, duh. #trap returns the previous handler.
karapetyan has quit [Ping timeout: 255 seconds]
hahuang65 has quit [Quit: WeeChat 1.4]
<soahccc> Ox0dea: damn that was to easy :D thanks
<Ox0dea> soahccc: Sure thing. :)
hahuang65 has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
Jackneill has joined #ruby
FernandoBasso has quit [Quit: Leaving]
<Cork> is there a way to specify rvm gemset in Gemfiles?
<diegoviola> why would you want to do that?
<lucasb> strange, 'protected' doesn't work outside of a class definition, but 'private' and 'public' do.
<diegoviola> use chruby/ruby-install
<diegoviola> don't use gemsets
<Cork> why is that?
<diegoviola> bundler takes care of gems for you
<Cork> ya, but we want to keep them in gemsets so it is easier to see what is in use
mchu has quit [Quit: mchu]
atomical has quit [Ping timeout: 255 seconds]
<diegoviola> why not just look at your Gemfile for that
<diegoviola> and Gemfile.lock
jbrhbr has quit [Quit: Leaving.]
atomical has joined #ruby
dlitvak has joined #ruby
mchu has joined #ruby
<Cork> found it, you put it in a comment under ruby 'version'
<Cork> ex #ruby-gemset=
colegatron has joined #ruby
snockerton has quit [Quit: Leaving.]
jxs_ has joined #ruby
dlitvak has quit [Ping timeout: 246 seconds]
saneax_AFK is now known as saneax
Jardayn has quit [Ping timeout: 260 seconds]
saneax is now known as Guest82082
<jhass> blarghlarghl: context would help a lot, what are you using this library for
B1n4r10 has joined #ruby
AlphaAtom has joined #ruby
Jardayn has joined #ruby
dfinninger has quit [Remote host closed the connection]
ur5us has joined #ruby
dionysus69 has quit [Quit: dionysus69]
joonty has quit [Ping timeout: 265 seconds]
agentmeerkat has joined #ruby
RobertBirnie has joined #ruby
domgetter has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
emilford has quit [Ping timeout: 260 seconds]
Rodya_ has joined #ruby
emilford has joined #ruby
avril14th has quit [Remote host closed the connection]
ico has joined #ruby
ur5us has quit [Ping timeout: 265 seconds]
taq has joined #ruby
taq has left #ruby [#ruby]
PedramT has joined #ruby
Rodya_ has quit [Ping timeout: 265 seconds]
weckl has quit [Remote host closed the connection]
mistermocha has joined #ruby
asmodlol has quit [Ping timeout: 265 seconds]
emilford has quit [Ping timeout: 260 seconds]
burbus has joined #ruby
emilford has joined #ruby
asmodlol has joined #ruby
sonOfRa has joined #ruby
mistermocha has quit [Remote host closed the connection]
PedramT has quit [Ping timeout: 260 seconds]
jam_ has joined #ruby
mistermocha has joined #ruby
last_staff has joined #ruby
burbus has quit [Client Quit]
rakm has joined #ruby
f4cl3y has quit [Ping timeout: 256 seconds]
jam_ has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
mistermocha has quit [Ping timeout: 264 seconds]
arup_r has quit [Remote host closed the connection]
sftrabbit has joined #ruby
Dimik has joined #ruby
jxs_ has quit [Ping timeout: 250 seconds]
mistermocha has joined #ruby
jxs_ has joined #ruby
Jardayn has quit [Ping timeout: 260 seconds]
arup_r has joined #ruby
Jardayn has joined #ruby
taq has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
pandaant has quit [Remote host closed the connection]
pskosinski_ has joined #ruby
c0m0 has quit [Ping timeout: 276 seconds]
pskosinski has quit [Ping timeout: 264 seconds]
norc has joined #ruby
Guest66175 is now known as Tristan-Speccy
<taq> hello, channel, long time no see :-)
<Ox0dea> Seems it's been forever: http://logs.ryanbigg.com/p/taq
jbrhbr has joined #ruby
TomyWork has quit [Ping timeout: 246 seconds]
SCHAAP137 has joined #ruby
firstdayonthejob has joined #ruby
aegis3121 has joined #ruby
bronson has joined #ruby
jxs_ has quit [Ping timeout: 240 seconds]
<lucasb> cool, I was not aware of this alternate irc log site
<taq> seems that I'm older than the channel or I'm old enough to forget the channel I used to chat :-D
synthroid has quit [Remote host closed the connection]
<jhass> helpa is not that long in here actually
Guest18948 has quit [Changing host]
Guest18948 has joined #ruby
Guest18948 is now known as paultreny
sftrabbit has quit [Quit: sftrabbit]
<jhass> not that _whitelogger_ catched you either apparently http://irclog.whitequark.org/ruby/search?q=nick%3Ataq
SHyx0rmZ has quit [Remote host closed the connection]
atomical_ has joined #ruby
<taq> jhass, yes :-)
sftrabbit has joined #ruby
lxsameer has joined #ruby
lxsameer has joined #ruby
<taq> jhass, but I used to come here a loooooooong time ago, on a galaxy far, far away :-)
chipotle has quit [Quit: cheerio]
atomical has quit [Ping timeout: 255 seconds]
dwfait_ has quit [Remote host closed the connection]
darkf has quit [Quit: Leaving]
SHyx0rmZ has joined #ruby
dlitvak has joined #ruby
radgeRayden has joined #ruby
cornerman has quit [Ping timeout: 260 seconds]
jxs_ has joined #ruby
dlitvak has quit [Ping timeout: 245 seconds]
konsolebox has joined #ruby
konsolebox has quit [Max SendQ exceeded]
karapetyan has joined #ruby
konsolebox has joined #ruby
konsolebox has quit [Max SendQ exceeded]
iateadonut has left #ruby [#ruby]
mondok has joined #ruby
sinkensabe has joined #ruby
konsolebox has joined #ruby
cornerman has joined #ruby
cornerman has quit [Remote host closed the connection]
_djbkd has joined #ruby
Melpaws1 has joined #ruby
konsolebox has quit [Max SendQ exceeded]
nettoweb has joined #ruby
scottschecter has quit [Quit: Leaving]
konsolebox has joined #ruby
|ifei5good has joined #ruby
konsolebox has quit [Max SendQ exceeded]
konsolebox has joined #ruby
konsolebox has quit [Max SendQ exceeded]
Melpaws has quit [Ping timeout: 240 seconds]
bruce__lee has joined #ruby
konsolebox has joined #ruby
nerfando has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
konsolebox has quit [Max SendQ exceeded]
prestorium has quit [Quit: Leaving]
|ifei5g00d has quit [Ping timeout: 264 seconds]
TheAnachron has joined #ruby
sandstrom has joined #ruby
imperator has joined #ruby
shadoi has joined #ruby
chipotle has joined #ruby
bruce_lee has quit [Ping timeout: 265 seconds]
sonOfRa has quit [Quit: Bye!]
<imperator> what's wrong with this Comparable snippet? I don't get the warning: https://gist.github.com/djberg96/84db06c46ec3e99e7452
|ifei5g00d has joined #ruby
ur5us has joined #ruby
|ifei5good has quit [Read error: Connection reset by peer]
<gizmore> imperator: maybe add a "rescue nil"
rodferso1|lunch has joined #ruby
rodferso1|lunch has quit [Client Quit]
rodfersou has joined #ruby
sonOfRa has joined #ruby
<imperator> oh, I think it has to be: [x,y,z] <=> [other.x, other.y, other.z]
rodfersou|lunch has quit [Ping timeout: 256 seconds]
ramfjord has quit [Ping timeout: 272 seconds]
<norc> imperator: That implementation of <=> is faulty btw
<imperator> norc, what should it be?
<norc> imperator: You need to return -1 / 0 / +1 depending on < = >
arthurix has quit [Read error: Connection reset by peer]
arthurix_ has joined #ruby
myntcake has quit [Quit: Leaving]
cfinley has joined #ruby
arthurix has joined #ruby
braincrash has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
arthurix_ has quit [Ping timeout: 256 seconds]
arthurix has quit [Ping timeout: 255 seconds]
<Ox0dea> norc: Just -/0/+, mind.
<Ox0dea> Such that simple subtraction sometimes suffices.
braincrash has joined #ruby
polishdub has quit [Quit: Leaving]
<norc> Have not looked at that implementation yet.
<norc> But as you know me, I am about to correct that mistake.
solars has quit [Ping timeout: 240 seconds]
arthurix has joined #ruby
Rodya_ has quit [Ping timeout: 240 seconds]
zambini has quit [Quit: Leaving.]
pdoherty has quit [Remote host closed the connection]
zambini has joined #ruby
<norc> Okay good to know. :)
cornerman has joined #ruby
<Ox0dea> It's just a saner semantics, really.
<djellemah> imperator: http://ruby-doc.org/core-2.2.3/Comparable.html#method-i-3E Your (original) <=> returns a boolean, and comparing a boolean with an integer using < raises an exception. Which gets caught in Comparable#< and triggers the warning.
Snowy has quit [Remote host closed the connection]
arthurix has quit [Ping timeout: 246 seconds]
pskosinski_ is now known as pskosinski
arthurix has joined #ruby
djbkd has quit [Ping timeout: 265 seconds]
lucasb has quit [Quit: leaving]
<Ox0dea> norc: Could Fiddle be used to relax the restrictions on unary *, **, and &?
<Ox0dea> Like, just strike the return value type constraint but leave everything else in place?
dwfait has joined #ruby
baweaver has joined #ruby
arthurix has quit [Remote host closed the connection]
arthurix has joined #ruby
<Ox0dea> To clarify: https://eval.in/502790
<Ox0dea> We can define unary +, -, ~, and ! to return whatever.
mistermocha has quit [Remote host closed the connection]
anisha has quit [Quit: Leaving]
treehug88 has quit [Remote host closed the connection]
* djellemah wonders what fresh outrages Ox0dea is planning ;-)
treehug88 has joined #ruby
kith has joined #ruby
<Ox0dea> djellemah: It's just something I've pondered now and again since writing Lollipops.
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kerunaru has joined #ruby
<Ox0dea> I revisited it the other day: https://eval.in/501843
<Ox0dea> (Warning: loud.)
dfinninger has joined #ruby
dfinninger has quit [Remote host closed the connection]
dfinninger has joined #ruby
platzhirsch has left #ruby [#ruby]
<djellemah> Ah. You want moar operators.
mchu has quit [Quit: mchu]
El3ktra has joined #ruby
El3ktra has quit [Changing host]
El3ktra has joined #ruby
<Ox0dea> All teh operators!
<Ox0dea> Mildly surprised that "fresh outrage" appears not to be Shakespearean in origin.
<Ox0dea> djellemah: The operator envy is so stronk: http://www.ozonehouse.com/mark/periodic/
kerunaru has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cdg has quit [Remote host closed the connection]
dwfait has quit [Remote host closed the connection]
pietr0 has joined #ruby
mistermocha has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
framling has joined #ruby
dopie has quit [Quit: Lost terminal]
cpup has quit [Ping timeout: 260 seconds]
dopie has joined #ruby
pdoherty has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
baweaver has quit [Remote host closed the connection]
mchu has joined #ruby
braincrash has quit [Ping timeout: 272 seconds]
mercerist has quit [Ping timeout: 250 seconds]
<djellemah> Andite operators, lol
<grill> yo. are there any methods that check whether if a string is formatted like a file path?
kadoppe has quit [Ping timeout: 276 seconds]
Meow-J has quit [Quit: Connection closed for inactivity]
shadoi has quit [Quit: Leaving.]
<Ox0dea> > whether if
cpup has joined #ruby
voidDotClass has joined #ruby
<grill> yes
<Ox0dea> grill: You can name a file just about anything in *nix.
Vitor has quit [Remote host closed the connection]
<voidDotClass> Trying to get an rspec featue test to pass, when I do 'fill_in '#email', with: 'invalid' , its unable to find the textbox, even though I have it on the page as <input id='email' />
<djellemah> I would be happy with a couple more assignogens in ruby.
<voidDotClass> is my syntax valid?
kadoppe has joined #ruby
<Ox0dea> djellemah: Fingers crossed: https://bugs.ruby-lang.org/issues/11939
baweaver has joined #ruby
Jackneill has quit [Quit: Leaving]
rodfersou has quit [Quit: leaving]
mchu has quit [Ping timeout: 260 seconds]
nb_bez___ has joined #ruby
replay has joined #ruby
zast has quit [Remote host closed the connection]
gizless has joined #ruby
baweaver has quit [Ping timeout: 240 seconds]
gizmore|2 has joined #ruby
mfb2 has joined #ruby
gdrt has joined #ruby
<imperator> grill, require 'pathname'
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
gizmore has quit [Ping timeout: 250 seconds]
gizmore|3 has joined #ruby
ramfjord has joined #ruby
cpup has quit [Ping timeout: 255 seconds]
zotherstupidguy has quit [Ping timeout: 256 seconds]
gizless has quit [Ping timeout: 260 seconds]
dfinninger has quit [Remote host closed the connection]
baweaver has joined #ruby
gizmore|2 has quit [Ping timeout: 260 seconds]
cpup has joined #ruby
gizmore has joined #ruby
dfinninger has joined #ruby
gizmore has quit [Changing host]
gizmore has joined #ruby
zotherstupidguy has joined #ruby
arthurix_ has joined #ruby
arthurix_ has quit [Read error: Connection reset by peer]
arthurix_ has joined #ruby
gizmore|3 has quit [Ping timeout: 256 seconds]
gizless has joined #ruby
arthurix has quit [Ping timeout: 265 seconds]
arthurix_ has quit [Read error: Connection reset by peer]
arthurix has joined #ruby
arthurix has quit [Read error: Connection reset by peer]
d0nn1e has quit [Ping timeout: 272 seconds]
allcentury has joined #ruby
ivanskie has joined #ruby
JohnT has joined #ruby
El3ktra has quit [Ping timeout: 250 seconds]
baweaver has quit [Remote host closed the connection]
bb010g has joined #ruby
atomical has joined #ruby
guacamole has joined #ruby
gizmore has quit [Ping timeout: 260 seconds]
braincrash has joined #ruby
d0nn1e has joined #ruby
UtkarshRay has quit [Ping timeout: 250 seconds]
dfinninger has quit [Read error: Connection reset by peer]
webus has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
dfinninger has joined #ruby
arthurix has joined #ruby
atomical_ has quit [Ping timeout: 256 seconds]
atomical has quit [Client Quit]
dfinninger has quit [Remote host closed the connection]
arthurix_ has joined #ruby
arthurix has quit [Read error: Connection reset by peer]
dfinninger has joined #ruby
dmolina has quit [Quit: Leaving.]
Gadgetoid has quit [Ping timeout: 272 seconds]
Gadgetoid has joined #ruby
who42 has joined #ruby
Joshua__ has joined #ruby
dfinninger has quit [Remote host closed the connection]
<grill> does it make more sense to cenclose methods in context, or to create contexts for each method tested (even if the contexts are the same)
al2o3-cr has quit [Read error: Connection reset by peer]
dfinninger has joined #ruby
taq has quit [Quit: Leaving]
<aegis3121> ? Rspec?
<grill> yes
<grill> i'm reading this now
mary5030 has quit [Remote host closed the connection]
<aegis3121> describe blocks are for what you're testing; context blocks are for setting up the "state of the world" before a test; it blocks are for actual assertions
dfinninger has quit [Remote host closed the connection]
<grill> yes, but can you set up the world and then describe what you're testing?
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
<aegis3121> probably shouldn't
jgpawletko has joined #ruby
<grill> or must you say what you're testing and then set up the world
ur5us has quit [Remote host closed the connection]
arthurix_ has quit [Ping timeout: 250 seconds]
<aegis3121> I believe convention would say "indicate what you're testing" before setting up the scenarios to test it
karapetyan has quit [Remote host closed the connection]
Joshua__ has quit [Client Quit]
<grill> the disadvantage the the latter method is that the world would ostensibly need to be set up very similarly multiple times
<aegis3121> Shared contexts are a thing
choke has joined #ruby
<aegis3121> Also, leveraging let helps with that
Melpaws has joined #ruby
<aegis3121> also, contexts nest
<grill> yes they do
taq has joined #ruby
al2o3-cr has joined #ruby
arthurix has joined #ruby
Melpaws1 has quit [Ping timeout: 240 seconds]
bronson has quit [Remote host closed the connection]
dn5 has quit [Quit: Leaving]
<aegis3121> So I can't imagine the state of the world is THAT shared between methods. And if it is, you can use a shared context. Shared contexts have the disadvantage of being relatively easy to bloat/obfuscate what's happening with your tests, but they do de-clutter it.
<aegis3121> Everyone's use cases are different :)
chipotle_ has joined #ruby
graffix222 has quit [Read error: Connection reset by peer]
Mia has quit [Ping timeout: 250 seconds]
graffix222 has joined #ruby
Rodya_ has joined #ruby
chipotle has quit [Ping timeout: 256 seconds]
Snowy has joined #ruby
Sirithcam has joined #ruby
baweaver has joined #ruby
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
arthurix has quit [Read error: Connection reset by peer]
yqt has joined #ruby
arthurix has joined #ruby
<norc> Ox0dea: Intuitively I would say no. But you know me....
mary5030 has joined #ruby
symm- has quit [Quit: Leaving...]
<norc> Let me give you a correct answer in a moment!
<grill> ok. here's a partial example. I have a bunch of nested contexts that jump off parent contexts. http://hastebin.com/aravolemon.dos
Snowy has quit [Remote host closed the connection]
<grill> i have several methods that can operate in (and should be tested) within these states. how do I describe multiple methods with shared state?
tlaxkit has joined #ruby
arthurix has quit [Read error: Connection reset by peer]
arthurix_ has joined #ruby
Rodya_ has quit [Ping timeout: 276 seconds]
arthurix has joined #ruby
fl__ has quit [Quit: Leaving]
djbkd has joined #ruby
guacamol_ has joined #ruby
dfinninger has joined #ruby
<eam> what's the easiest way to search through all classes to find a method matching /poll/ ?
<norc> >> puts RubyVM::InstructionSequence.compile("p(&:c)").disasm
guacamole has quit [Ping timeout: 272 seconds]
<ruby[bot]> norc: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502795)
<norc> eam: object space.
braincrash has quit [Ping timeout: 260 seconds]
atomical has joined #ruby
arthurix has quit [Read error: Connection reset by peer]
arthurix has joined #ruby
<norc> eam: Just remember you have to include modules too.
jam_ has joined #ruby
arthurix_ has quit [Ping timeout: 272 seconds]
chouhoulis has quit [Remote host closed the connection]
gdrt has left #ruby ["NedaMise"]
arthurix_ has joined #ruby
<norc> eam: So just ObjectSpace.each_object(Class) gives you what you need.
mistermocha has quit [Remote host closed the connection]
arthuri__ has joined #ruby
mistermocha has joined #ruby
mistermocha has quit [Remote host closed the connection]
bweston92 has quit [Ping timeout: 256 seconds]
synthroid has joined #ruby
atomical_ has joined #ruby
<norc> Ox0dea: I would say no.
<eam> well, ObjectSpace.each_object(Class).map { |c| c.methods.grep /poll/ } would give me class methods only, correct?
<eam> I'm after instance methods too
arthurix has quit [Ping timeout: 240 seconds]
<norc> eam: Dont use methods
<norc> It just tells you whether that class responds to that method.
jam_ has quit [Ping timeout: 256 seconds]
<eam> c.instance_methods?
<norc> For example
<Ox0dea> eam: Should do.
<eam> yeah that's what I want
<eam> rad thx
grebl has joined #ruby
PedramT has joined #ruby
arthurix_ has quit [Ping timeout: 240 seconds]
stannard_ has joined #ruby
Danishman has joined #ruby
arthurix has joined #ruby
aegis3121 has quit [Ping timeout: 255 seconds]
<Ox0dea> norc: That's something very different.
atomical has quit [Ping timeout: 245 seconds]
<eam> >> ObjectSpace.each_object(Class).map { |c| match = c.instance_methods.grep /poll/; c unless match.size.zero? }.select {|x| !x.nil?}
<ruby[bot]> eam: # => [] (https://eval.in/502798)
<eam> (it works, I guess there aren't any in that env)
braincrash has joined #ruby
dfinninger has quit [Remote host closed the connection]
podman has quit [Quit: Connection closed for inactivity]
aegis3121 has joined #ruby
arthuri__ has quit [Ping timeout: 260 seconds]
<Ox0dea> eam: select { |x| !x.nil? } == compact
dfinninger has joined #ruby
stannard has quit [Ping timeout: 240 seconds]
fsfdsf has joined #ruby
<norc> Ox0dea: No that was just something out of curiosity.
<eam> ah rad
mary5030 has quit [Remote host closed the connection]
<Ox0dea> norc: Sure, but I thought you were using it to decide that you would say no.
<norc> Oh no.
<aegis3121> grill: shared contexts sound like it.
<djellemah> >> ObjectSpace.each_object(Class).reject{|k| k.instance_methods.grep(/to_c/).empty?} #eam
<ruby[bot]> djellemah: # => [Complex, Rational, Bignum, Float, Fixnum, Integer, Numeric, String, NilClass] (https://eval.in/502799)
mistermocha has joined #ruby
<norc> Ox0dea: It is pretty disgusting how &:foo in an arg works however looking at the bytecode.
arthurix has quit [Ping timeout: 246 seconds]
<Ox0dea> norc: It's not an argument, though.
<norc> Precisely..
<norc> It just passes :sym and marks it a special argument.
_djbkd has quit [Remote host closed the connection]
<grill> hm
<norc> Though come to think of it..
<djellemah> norc: I've wondered about that. How does &:itself compare to ->x{x} performance wise?
<norc> djellemah: No idea
atomical has joined #ruby
<norc> Ox0dea: Nevermind, that really is the only way to do this.
<Ox0dea> djellemah: Blocks are less expensive than Procs.
arthurix has joined #ruby
lucasb has joined #ruby
Snowy has joined #ruby
sftrabbit has quit [Quit: sftrabbit]
<Ox0dea> A Proc is essentially just a reified block.
<djellemah> Yeah, but in that case they would both be procs. map{|x| x} would be a block though.
<Ox0dea> &:itself is a Block.
<Ox0dea> *block
<norc> djellemah: And interestingly, a proc gets converted into a block when being called.
<djellemah> Ok, so there's extra overhead for creation and for calling.
xxneolithicxx has joined #ruby
<norc> djellemah: Indeed.
mistermocha has quit [Remote host closed the connection]
<norc> djellemah: And everytime you bind a block to an argument like def foo(&thing) you incur that penalty.
<norc> Because that also creates a proc based on the block passed.
El3ktra has joined #ruby
fsfdsf has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<norc> djellemah: I think calling should be the same performance however.
atomical_ has quit [Ping timeout: 265 seconds]
<Ox0dea> norc: Not true.
bhalash has joined #ruby
<norc> Ox0dea: Why is that?
bweston92 has joined #ruby
ico has quit [Remote host closed the connection]
<Ox0dea> norc: https://eval.in/502800
_djbkd has joined #ruby
zcreative has joined #ruby
arthurix has quit [Ping timeout: 245 seconds]
_djbkd has quit [Remote host closed the connection]
<norc> Ox0dea: Point taken.
arthurix has joined #ruby
<norc> Ox0dea: The result of your example is probabilistic though if the GC works just before you inspect OS again.
<Ox0dea> norc: The intended demonstration remains. :)
<norc> Yeah.
<Ox0dea> Every method takes an implicit block; it would be insane if they were all automatically reified.
CloCkWeRX has quit [Remote host closed the connection]
<norc> Insanity is the mark of some of our authors.
mchu has joined #ruby
<Ox0dea> `&block` at the end of a parameter list is almost always either noise or a little malodorous.
dfinninger has quit [Remote host closed the connection]
sivoais-ms is now known as sivoais
jackjackdripper has joined #ruby
dpg_ has joined #ruby
CloCkWeRX has joined #ruby
dfinninger has joined #ruby
<soahccc> Ox0dea: I use it a lot when passing or saving the procs in variables rather than just yielding... Or do you mean the "descriptivness" of block?
arthurix has quit [Ping timeout: 255 seconds]
<Sou|cutter> Ox0dea: I sorta like knowing that methods expect to take blocks sometimes
chipotle_ has quit [Quit: cheerio]
<norc> >> puts RubyVM::InstructionSequence.compile("def foo(&bar); end; foo {1};").disasm
<ruby[bot]> norc: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502801)
<Sou|cutter> IIRC there's a performance hit for (&block) which makes it less-nice
<norc> >> puts RubyVM::InstructionSequence.compile("def foo(&bar.call(1)); end; foo { |a| };").disasm
<ruby[bot]> norc: # => <compiled>:1: syntax error, unexpected '.', expecting ')' ...check link for more (https://eval.in/502802)
tubuliferous_ has joined #ruby
<norc> Sou|cutter: That was what I learned a while ago too, but its time to figure out whether that is true, and why.
* Sou|cutter nods
<Synthead> is there a way I can make inifile ignore '#' symbols as comments? I have an inifile that uses "InitialProgram=#Internet Explorer 11" ... (facepalm)
<norc> >> puts RubyVM::InstructionSequence.compile("def foo(&bar) bar.call(1)); end; foo { |a| };").disasm
<ruby[bot]> norc: # => <compiled>:1: syntax error, unexpected ')', expecting keyword_end ...check link for more (https://eval.in/502803)
<norc> >> puts RubyVM::InstructionSequence.compile("def foo(&bar) bar.call(1); end; foo { |a| };").disasm
<ruby[bot]> norc: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502804)
<Ox0dea> soahccc: Nah, that's the valid use case I had in mind.
spider-mario has joined #ruby
musl_ has quit [Ping timeout: 264 seconds]
pietr0 has quit [Quit: pietr0]
<norc> Ox0dea: Okay I think it is a little misunderstanding. It is not as much the &arg part that is the penalty, but passing a block *and* specifying a &arg
psyq has joined #ruby
<norc> I completely agree that just specifying the parameter should not be relevant.
saturnmir_mate2 has joined #ruby
<soahccc> Ox0dea: depending on what you are doing you have that a lot (a lot of view related stuff requires to pass the block to capture, etc.)
bluOxigen has joined #ruby
<norc> Synthead: Try wrapping the content in "" perhaps? This is just a random guess.
northfurr has joined #ruby
SaturnMir has joined #ruby
<SaturnMir> what is the best way to test datatype
<Ox0dea> soahccc: Certainly many libraries use it to great effect, but there's a lot of Ruby code out there that uses Proc#call where `yield` would suffice.
<Synthead> norc: the ini file has this originally, unfortunately. I was thinking of doing a .tr('#', '\#') on the file's contents, but this seems kinda smelly
Limix has quit [Quit: Limix]
<Synthead> it'd be much better if I could do an IniFile.load("file", comments: :ignore) or something
fl has joined #ruby
<Sou|cutter> SaturnMir: Fixnum === 0 # maybe?
<Ox0dea> >> 'foo'.class # SaturnMir
<ruby[bot]> Ox0dea: # => String (https://eval.in/502805)
grebl has left #ruby [#ruby]
<djellemah> Synthead: or maybe you can preprocess and convert =# to = . Hopefully that doesn't have unintended consequences.
ldnunes has quit [Quit: Leaving]
<Sou|cutter> not quite sure I understand the question
<norc> Synthead: Based on the intro doc of inifile it should accept the Hash symbol in the middle.
<SaturnMir> 0x0dea how does this work if I do 64.class and 429527346982634928.class
<norc> Synthead: What error do you get?
<aegis3121> >> 64.class
<ruby[bot]> aegis3121: # => Fixnum (https://eval.in/502806)
<aegis3121> the same
dlitvak has joined #ruby
<SaturnMir> so integer == fixnum == bignum ?
<Synthead> norc: no error, but the value for this item is blank after it's parsed via IniFile
<aegis3121> not quite
jackjackdripper has quit [Quit: Leaving.]
dtordable has quit [Remote host closed the connection]
<Synthead> norc: I actually want a "#Internet Explorer 11" value
jackjackdripper has joined #ruby
<SaturnMir> in terms of 64 == integer and 12416482763482453 == integer
<norc> Synthead: Just double quote the string.
<norc> SaturnMir: That should work.
<norc> And sorry, mistab.
<Synthead> norc: right, but this ini file is user input (I don't control it)
Nuru has joined #ruby
<SaturnMir> 64.class == Integer ?? or 64.class == Integer.class
<norc> Synthead: Then have your users provide you with a valid ini file
<norc> It is that simple.
<lucasb> n.is_a?(Integer)
<Synthead> norc: tell that to citrix :p
<SaturnMir> awesome
<SaturnMir> thanks!
<norc> Synthead: Tell citrix to fuck off.
<norc> From me.
* Synthead sighs
<Synthead> thanks for your help, anyway
<norc> Synthead: Preprocess the file before you stuff it into inifile.
<Synthead> norc: that's what I was thinking, but that seems like code smell
<norc> Synthead: The code smell is on citrix side.
<Synthead> not like a # in there isn't already
<Synthead> agreed, but that doesn't inherently mean that I must write smelly code
<norc> In fact there is a lot of smell on citrix side.
<norc> But lets not get into that.
<Synthead> as mentioned, if there was a comments: :ignore to IniFile or something, it'd be a lot better, I think
<norc> Synthead: Feel free to fork the repo.
Darmani has joined #ruby
<Synthead> I prefer to find solutions than blaming people and doing nothing about it
<Synthead> :p
polishdub has joined #ruby
<norc> I enjoy blaming people for things.
<Darmani> @Synthead - Blaming people is so much easier bro
Limix has joined #ruby
<Synthead> also exhausting
<Synthead> but agreed
<soahccc> SaturnMir: that might also be interesting :) https://gist.github.com/2called-chaos/998020a21ab2da4fb787
<norc> You need to practice on throwing rocks at your colleagues.
<norc> Dont use your voice.
<Darmani> @Synthead - Why take responsibility when you can make others responsible for your problems?
* Darmani waves to norc
* norc throws a rock at Darmani
<Synthead> Darmani: until someone takes responsibility, regardless of who, progress is not being made
* Darmani catches rock
<Darmani> thanks man. Is this your pet rock?
dfinninger has quit [Remote host closed the connection]
<Darmani> @Synthead - You do realize everything I said just now was sarcasm?
gbgdev has quit [Remote host closed the connection]
mchu has quit [Ping timeout: 240 seconds]
mistermocha has joined #ruby
emilford has quit [Read error: Connection reset by peer]
usershell has quit [Remote host closed the connection]
bweston92 has quit [Ping timeout: 240 seconds]
Nuru has quit [Quit: Nuru]
andikr has quit [Remote host closed the connection]
<Ox0dea> soahccc: https://eval.in/502808 :P
<djellemah> Synthead: https://github.com/TwP/inifile/blob/master/lib/inifile.rb you can specify what characters to use as comments in the opts
jgt1 has quit [Ping timeout: 276 seconds]
sdwrage has quit [Quit: This computer has gone to sleep]
framling has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 260 seconds]
pdoherty has quit [Ping timeout: 260 seconds]
yfeldblum has joined #ruby
sdwrage has joined #ruby
govg has quit [Ping timeout: 240 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
casadei has quit [Remote host closed the connection]
taq has quit [Quit: Leaving]
gizmore has joined #ruby
<lucasb> in [*a], if a = 42, then it simply returns [42]
emilford has joined #ruby
<lucasb> if a is an instance of a class that has to_a return 42, it errors
djbkd has quit [Ping timeout: 265 seconds]
<lucasb> Ox0dea: ^^ I saw this in your paste
dtordable has joined #ruby
tubuliferous_ has quit [Ping timeout: 240 seconds]
mchu has joined #ruby
sdwrage_ has joined #ruby
<Ox0dea> lucasb: Ah, that wasn't the greatest example. [*foo] is just Array(foo). I was trying to demonstrate that the * unary operator invokes #to_a.
gizless has quit [Ping timeout: 260 seconds]
<Ox0dea> And that, alas, it must return an Array, as you point out.
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bhalash has quit [Ping timeout: 240 seconds]
Cohedrin has joined #ruby
sdwrage has quit [Ping timeout: 240 seconds]
blarghlarghl has left #ruby [#ruby]
dlitvak has quit [Ping timeout: 245 seconds]
emilford has quit [Ping timeout: 240 seconds]
<lucasb> anyway, I just thought the different behaviour was not very orthogonal
<lucasb> Ox0dea: thanks for the snippet
musl has joined #ruby
grill is now known as grip
<Ox0dea> lucasb: Sure, but which different behavior?
<lucasb> a = 42; [*a] #=> returns [42]
<lucasb> a = C.new; [*a] #=> errors
<lucasb> when the C class has the to_a method returning 42
<Ox0dea> I see how you mean.
emilford has joined #ruby
ico has joined #ruby
<lucasb> I mean, there's one layer of indirection between the two examples
<Ox0dea> There is. :<
<lucasb> but intuitively, I would expect both to behave the same
<Ox0dea> lucasb: Well, mind that C.new isn't returning 42.
<lucasb> yeah, I understand that :)
bweston92 has joined #ruby
<norc> >> [*a]
<ruby[bot]> norc: # => undefined local variable or method `a' for main:Object (NameError) ...check link for more (https://eval.in/502812)
<norc> >> [*1]
<ruby[bot]> norc: # => [1] (https://eval.in/502813)
<norc> >> puts RubyVM::InstructionSequence.compile("[*1]").disasm
<ruby[bot]> norc: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502814)
kith has quit [Quit: kith]
govg has joined #ruby
bhalash has joined #ruby
Rodya_ has joined #ruby
<Ox0dea> norc: Array(foo) invokes foo's #to_a, but Array(42) doesn't try to invoke Fixnum#to_a; what's going on there?
dlitvak has joined #ruby
<norc> I suspect a VM optimization going on here
<Ox0dea> Where is the method resolution ending up?
<Ox0dea> There's no Object#to_a.
<norc> Wait!
<norc> >> puts RubyVM::InstructionSequence.compile("a = Object.new; [*a]").disasm
<ruby[bot]> norc: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502815)
<norc> There.
<Ox0dea> Nice.
replay has quit [Ping timeout: 265 seconds]
<Ox0dea> You got there quick. :P
tubuliferous_ has joined #ruby
<norc> Need to ask apeiros whether we can get some kind of shortcut for RubyVM::InstructionSequence.compile(a).disasm
kith has joined #ruby
<norc> It is just so annoying to type without pry autocompletion.
* djellemah edits his .pryrc
Rodya_ has quit [Ping timeout: 255 seconds]
<lucasb> norc: any easy way to get a list of all ruby vm ops?
<Ox0dea> >> RubyVM::INSTRUCTION_NAMES # lucasb
<ruby[bot]> Ox0dea: # => ["nop", "getlocal", "setlocal", "getspecial", "setspecial", "getinstancevariable", "setinstancevaria ...check link for more (https://eval.in/502816)
<norc> Got there first damn.
<norc> I would not trust that constant thoguh.
<norc> This is what I use.
atomical_ has joined #ruby
<lucasb> thanks norc and Ox0dea
<lucasb> but... they are so few :)
<Ox0dea> 91!
Guest27 has joined #ruby
<norc> lucasb: That is the whole point of a bytecode virtual machine.
<norc> Keep it small.
mchu has quit [Quit: mchu]
<norc> lucasb: Also the original intel 8086 had less instructions!
dlitvak_ has joined #ruby
tubuliferous_ has quit [Ping timeout: 250 seconds]
dlitvak_ has quit [Remote host closed the connection]
<norc> Ox0dea: imho this int2fix is such a horrid name - and it is splattered across all C code...
arthurix has joined #ruby
akem has joined #ruby
<Ox0dea> $ python -c 'import dis; print(len(dis.opmap))'
<norc> I mean it makes perfect sense, but when I just read "fix" it just looks like a hack.
<Ox0dea> 114
atomical has quit [Ping timeout: 276 seconds]
fourq is now known as fourq|away
<Ox0dea> ¯\_(ツ)_/¯
<Ox0dea> norc: Seems fine to me.
<norc> Ox0dea: I once submitted a PIP!
<Ox0dea> Did it win?
baweaver has quit [Remote host closed the connection]
fourq|away is now known as fourq
craysiii has joined #ruby
<lucasb> a PEP you mean?
<norc> Recommending the removal of whitespace, explaining in a few paragraphs how the whole language just causes brain cancer.
fourq is now known as fourq|away
craysiii has quit [Max SendQ exceeded]
<norc> Oh PEP yes sorry.
<norc> Was about 7 years ago.
<norc> They thought I was trolling. :S
<Ox0dea> I thought you meant a PyPI package.
<norc> No. The Python Enhancement P...something.
<Ox0dea> Proposal.
renderf__ has quit []
<Ox0dea> I think your PEP should've won. :P
craysiii has joined #ruby
PedramT has quit [Remote host closed the connection]
<norc> I still wonder whether a carriage return without a newline is relevant for indentation...
dlitvak has quit [Ping timeout: 265 seconds]
<norc> s/newline/linefeed/
<SaturnMir> http://pastebin.com/KPWAjYLj -- does this convert integer.to_s(2) to twos compliment correctly?
<ruby[bot]> SaturnMir: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/0f14f4c273b66ae2edaf
<ruby[bot]> SaturnMir: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<Ox0dea> SaturnMir: No.
<Ox0dea> It's just sticking a hyphen on the front for negatives.
<SaturnMir> 0x0dea it is removing a hyphen
last_staff1 has joined #ruby
<SaturnMir> -4.to_s(2) yields -100
<Ox0dea> I don't see a removed hyphen.
speakingcode has joined #ruby
<SaturnMir> 0x0dea oh damn -.- I see now. Really sorry
lucasb has quit [Read error: Connection reset by peer]
<SaturnMir> I am stuck on how to get a proper binary value as a string on ruby.
hexchat_ has joined #ruby
<Ox0dea> SaturnMir: Ruby has arbitrary-precision integers, so you'll need to self-impose a maximum.
<norc> Ox0dea: Honestly the thing I just hated about python is how massively inconsistent the stdlib is about where the receiver goes. Sometimes its rec.meth(a, b), sometimes its a.meth(rec, b), sometimes its a.meth(b, rec)
last_staff has quit [Ping timeout: 265 seconds]
last_staff1 is now known as last_staff
akem has quit [Read error: No route to host]
<SaturnMir> 0x0dea uhm... (I am new to ruby as you can probably tell)
akem2 has joined #ruby
<grip> ruby has a concept of default arugments, right? e.g. some_method(some_var="")
<norc> grip: Yes, exactly like that.
hexchat_ has quit [Remote host closed the connection]
<SaturnMir> grip yes
<grip> why am I getting an error then? ArgumentError: wrong number of arguments
<norc> grip: We also have keyword arguments (which really have not found much popular use because Hashes are often used instead)
<norc> grip: Show us your code.
blackgoat has joined #ruby
<grip> I am not using ruby 2
atomical has joined #ruby
<Ox0dea> SaturnMir: On, say, a 32-bit system, -1 in binary is 32 1s.
<norc> grip: Show us your code.
PedramT has joined #ruby
<djellemah> >> "%b" % 237 # SaturnMir
<ruby[bot]> djellemah: # => "11101101" (https://eval.in/502817)
<grip> sec. i will make an example
<SaturnMir> 0x0dea would I be able to get a maximum by doing log(integer value)/log16 + 1
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea> >> '%b' % -1 # djellemah
tlaxkit has quit [Ping timeout: 255 seconds]
<ruby[bot]> Ox0dea: # => "..1" (https://eval.in/502818)
akem has joined #ruby
akem2 has quit [Read error: No route to host]
<SaturnMir> djellemah -- that is not 2s comp though
<Ox0dea> SaturnMir: You can just use modulus.
<Ox0dea> >> (-1 % 2 ** 32).to_s 2 # SaturnMir
<ruby[bot]> Ox0dea: # => "11111111111111111111111111111111" (https://eval.in/502819)
<SaturnMir> I see!
<Ox0dea> Yay, arithmetic! ^_^
<SaturnMir> I think...
<norc> 19>> def f(a=1) a; end; f()
<ruby[bot]> norc: # => 1 (https://eval.in/502820)
atomical_ has quit [Ping timeout: 245 seconds]
<SaturnMir> so 32 is maxima? 0x0dea ??
<Ox0dea> SaturnMir: That depends on what you're doing.
<Ox0dea> You can choose an arbitrary maximum.
<SaturnMir> how would I best obtain that?
<Ox0dea> Remember that a signed 32-bit integer's range is -2^32..2^31-1.
<Ox0dea> In case that was the source of your confusion in "I think..."
jbrhbr has quit [Quit: Leaving.]
akem has quit [Ping timeout: 246 seconds]
<SaturnMir> I have got ...111101 for (int)-3 ... that is correct right? 0x0dea
hayden_ has quit [Quit: Connection closed for inactivity]
joonty has joined #ruby
<Ox0dea> SaturnMir: Yep.
<Ox0dea> Now, are you sure you need to be doing this in Ruby? :P
<djellemah> >> ("I needed this a month ago".hash % 36**10).to_s 36
<ruby[bot]> djellemah: # => "s25u3" (https://eval.in/502821)
<Ox0dea> Nifty.
fl has quit [Ping timeout: 240 seconds]
<SaturnMir> I just found this easiest to prototype in ;) I am actually trying to get pixeldata from bitmaps...but I am new to the entire concept of stuff like bitmasking and things...so I wanted to suss out how to handle binary first.
joonty has quit [Client Quit]
<SaturnMir> 0x0dea...so if I set my maxima to 4 (bits)...and enter 12... I get an output of 1100 which would be -8+4=-4... so is this the overflow?
synthroid has quit [Remote host closed the connection]
<SaturnMir> like when you go over the max of int 32 and it wraps backaround
TomPeed has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
TomPeed has joined #ruby
karapetyan has joined #ruby
scottschecter has joined #ruby
jayne_ has joined #ruby
sftrabbit has joined #ruby
TomPeed has quit [Client Quit]
nfk|laptop has joined #ruby
TomPeed has joined #ruby
chipotle has joined #ruby
TomPeed has quit [Client Quit]
jayne has quit [*.net *.split]
<Ox0dea> SaturnMir: Just so. The high bit being on indicates negative, and then you interpret the rest as usual.
cdg has joined #ruby
Snowy has quit [Remote host closed the connection]
<SaturnMir> 0x0dea so overflow is detected as being true if foo > 0 but (foo % 2 ^^ 32).to_s(2)[0].eql?"1"
<nfk|laptop> for the first time in my life I hope i have gotten my math wrong, i mean, i knew i was signing up for a a lot but if i did my math right the trivial algorithm i'm still struggling to get right is gonna have complexity that's not that bad until you consider it's 200**<some 4 digit number)
<Ox0dea> SaturnMir: I think that should suffice for your purposes, yep.
<SaturnMir> cheers!
<Ox0dea> Happy to help. :)
imperator has left #ruby ["Leaving"]
<nfk|laptop> i don't know how much that turns out to be but i expect too much even if every one of those was a basic x86 instructions (they aren't)
Darmani has quit [*.net *.split]
norc has quit [*.net *.split]
ruby-lang042 has quit [*.net *.split]
Mackerel has quit [*.net *.split]
northfurr has quit [Quit: northfurr]
JohnT has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rolfb has joined #ruby
sinkensabe has quit [Remote host closed the connection]
Bloomer has quit [Remote host closed the connection]
karapetyan has quit [Ping timeout: 276 seconds]
Yzguy has joined #ruby
govg has quit [Quit: leaving]
govg has joined #ruby
<dtordable> -
Snowy has joined #ruby
Snowy has quit [Remote host closed the connection]
fl has joined #ruby
nb_bez___ has quit [Quit: Connection closed for inactivity]
mistermocha has joined #ruby
<djellemah> >> 0.to_s(37)
<ruby[bot]> djellemah: # => invalid radix 37 (ArgumentError) ...check link for more (https://eval.in/502822)
emilford has quit [Ping timeout: 246 seconds]
mistermocha has quit [Remote host closed the connection]
bensarz has joined #ruby
jgpawletko has quit [Quit: jgpawletko]
carraroj has joined #ruby
mistermocha has joined #ruby
mistermocha has quit [Read error: Connection reset by peer]
emilford has joined #ruby
zambini has quit [Quit: Leaving.]
hannelita has quit [Remote host closed the connection]
<Ox0dea> djellemah: https://eval.in/502828
rodolfowtf has quit [Read error: Connection reset by peer]
synthroid has joined #ruby
theery has joined #ruby
casadei has joined #ruby
<djellemah> Ox0dea: lol nice.
epithet is now known as epi
<Ox0dea> djellemah: It's only wrong for 0 and 1. :<
epi is now known as Guest77003
yfeldblum has quit [Ping timeout: 240 seconds]
renderfu_ has joined #ruby
Snowy has joined #ruby
mostlybadfly has joined #ruby
emilford has quit [Ping timeout: 250 seconds]
<Ox0dea> Relevant: http://cowbirdsinlove.com/43
Melpaws1 has joined #ruby
ruby-n00by has joined #ruby
Guest77003 is now known as epitron
<djellemah> Hmm, I never thought about whether numbers can be represented in base 0 or 1. Kinda defeats the purpose is my intuitive reaction.
Melpaws has quit [Ping timeout: 250 seconds]
djbkd has joined #ruby
mistermocha has joined #ruby
jbrhbr has joined #ruby
zcreative has quit [Ping timeout: 240 seconds]
CloCkWeRX has quit [Quit: Leaving.]
Yzguy has quit [Quit: Zzz...]
<djellemah> () in ruby, rust, ocaml, lisp denotes unit/nil/empty . Now I'm curious. What other languages?
<ruby-n00by> i'm having issues with gem on OSX 10.10.5. i've installed rbenv with homebrew. 'which gem' points to my custom version in my /Users/ directory, however, when i try to run 'gem update --system' i get a permissions error telling me i can't write to the system gem directory. any ideas on PATH changes or anything similar?
Snowy has quit [Remote host closed the connection]
theery has quit []
jbrhbr has quit [Client Quit]
emilford has joined #ruby
mistermocha has quit [Remote host closed the connection]
yalue has quit [Quit: return 0;]
<Ox0dea> djellemah: Haskell.
speakingcode has quit [Remote host closed the connection]
mistermocha has joined #ruby
sdwrage_ has quit [Quit: This computer has gone to sleep]
jbrhbr has joined #ruby
asccigcc has quit [Ping timeout: 245 seconds]
Cohedrin has quit [Remote host closed the connection]
bensarz has quit [Quit: Textual IRC Client: www.textualapp.com]
Cohedrin has joined #ruby
<Ox0dea> ruby-n00by: `gem which rubygems`
Snowy has joined #ruby
cfinley has quit [Ping timeout: 246 seconds]
carraroj has quit [Quit: Konversation terminated!]
SaturnMir has quit [Ping timeout: 264 seconds]
Cohedrin has quit [Max SendQ exceeded]
Cohedrin has joined #ruby
bronson has joined #ruby
<ruby-n00by> Ox0dea: that seems to be pointing to my system directory. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb
sdwrage_ has joined #ruby
emilford has quit [Ping timeout: 246 seconds]
<Ox0dea> ruby-n00by: Well, there it is.
mistermocha has quit [Read error: Connection reset by peer]
mistermocha has joined #ruby
last_staff has quit [Quit: last_staff]
jbrhbr1 has joined #ruby
Rodya_ has joined #ruby
jbrhbr has quit [Ping timeout: 265 seconds]
emilford has joined #ruby
Melpaws has joined #ruby
K1MOS has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
Melpaws1 has quit [Ping timeout: 264 seconds]
Chewy1121 has joined #ruby
asthasr_ has joined #ruby
victortyau has joined #ruby
djcp has quit [Ping timeout: 245 seconds]
asthasr_ is now known as asthasr
Rodya_ has quit [Ping timeout: 265 seconds]
flappynerd has joined #ruby
arup_r has quit []
dpg_ has quit [Ping timeout: 240 seconds]
theery has joined #ruby
Yzguy has joined #ruby
emilford has quit [Ping timeout: 264 seconds]
preyalone has joined #ruby
choke has joined #ruby
mistermocha has quit [Remote host closed the connection]
jam_ has joined #ruby
astron has joined #ruby
BSaboia has joined #ruby
astron has quit [Client Quit]
gruz0 has joined #ruby
KensoDev has joined #ruby
davedev24 has quit []
baweaver has joined #ruby
mattfromseattle has joined #ruby
aupadhye has quit [Ping timeout: 255 seconds]
mistermocha has joined #ruby
K1MOS has quit [Quit: Textual IRC Client: www.textualapp.com]
emilford has joined #ruby
kiidbrian has quit [Ping timeout: 240 seconds]
synthroid has quit []
edwinvdgraaf has quit [Read error: Connection reset by peer]
asccigcc has joined #ruby
jam_ has quit [Ping timeout: 240 seconds]
edwinvdgraaf has joined #ruby
mistermocha has quit [Remote host closed the connection]
Chewysourus has joined #ruby
<Chewysourus> Herro?
Chewy1121 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<Chewysourus> Herro
<Chewysourus> Can anyone help me?
aryaching has quit []
<gruz0> ?
<aegis3121> You haven't asked a question yet.
<Chewysourus> That was a question
lxsameer has quit [Quit: Leaving]
mistermocha has joined #ruby
<Chewysourus> Anyways
<demophoon> Chewysourus: don't ask to ask, just ask your question
FernandoBasso has joined #ruby
<Chewysourus> Test out this code and tell me how I can fix it
<Chewysourus> v
fl has quit [Quit: Leaving]
<Chewysourus> I dunno how
<aegis3121> I'm fairly certain most people here don't appreciate being told to do something. Is there a specific question you have?
baweaver has quit [Ping timeout: 265 seconds]
solars has joined #ruby
sdwrage_ has quit [Read error: No route to host]
emilford has quit [Ping timeout: 265 seconds]
<Chewysourus> Yes,
fl has joined #ruby
<Chewysourus> How can I fix my code, https://ghostbin.com/paste/e9ajr, it puts out the hash multiple times of the same key/value
scottschecter_ has joined #ruby
dlitvak has joined #ruby
<Chewysourus> But the thing is, I have 3 hashs and I need 1 key and value from one of them, and 2 values of the other ones
<treehug88> research 'hash of hashes'
last_staff has joined #ruby
PedramT has quit [Remote host closed the connection]
<Chewysourus> I know what that is
ramfjord has quit [Quit: Lost terminal]
cpup has quit [Ping timeout: 264 seconds]
<Chewysourus> Unfortunatly it will not help me because it wouldn't exactly work in the .each mthod
<Chewysourus> I would still be doing the same thing
<treehug88> it would be much prettier
<Chewysourus> And still be getting the same result
<Chewysourus> Maybe
<Chewysourus> But I am trying to keep this simple
dlitvak has quit [Remote host closed the connection]
<treehug88> if you program the same bug, then yes :) hash of hashes is simpler than the parallel hashes you're using mpw
<treehug88> now
cpup has joined #ruby
<Chewysourus> Not really, not for me. I would have to go through out all my code and change a shit ton of stuff
bb010g has quit [Quit: Connection closed for inactivity]
<treehug88> ah, tradeoffs :)
emilford has joined #ruby
<Chewysourus> The three hashs do not only represent the display. I have them set up to 800 different lines of code.
astron has joined #ruby
scottschecter_ has quit [Remote host closed the connection]
<Chewysourus> So can anyone actually help me?
Snowy has quit [Remote host closed the connection]
dlitvak has joined #ruby