jhass changed the topic of #ruby to: Welcome new users migrating from #ruby-lang! || Rules & more: http://ruby-community.com || Ruby 2.2.2; 2.1.6; 2.0.0-p645: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || log @ http://irclog.whitequark.org/ruby/
sinkensabe has joined #ruby
j4cknewt has joined #ruby
j4cknewt has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
dseitz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
thiagovsk has joined #ruby
chouhoulis has joined #ruby
stantonnet has quit [Remote host closed the connection]
sarkyniin has quit [Quit: Quit]
sinkensabe has quit [Ping timeout: 255 seconds]
momomomomo has quit [Quit: momomomomo]
Guest70962 has quit [Ping timeout: 256 seconds]
prasselpikachu_ is now known as prasselpikachu
Tritone has joined #ruby
maletor has joined #ruby
dseitz has joined #ruby
BTRE has quit [Ping timeout: 255 seconds]
tkuchiki has joined #ruby
tubulife- has joined #ruby
bungoman has joined #ruby
mxrguspxrt has quit [Ping timeout: 240 seconds]
mxrguspxrt has joined #ruby
joneshf-laptop has quit [Ping timeout: 244 seconds]
quazimodo has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
tubulife- has quit [Ping timeout: 256 seconds]
ndrei has quit [Ping timeout: 256 seconds]
bungoman has quit [Remote host closed the connection]
bruno- has joined #ruby
charliesome has quit [Quit: zzz]
tubuliferous_ has quit [Ping timeout: 255 seconds]
Aswebb_ has joined #ruby
Azure has quit [Quit: Oops.]
radialneon has quit [Read error: Connection reset by peer]
Azure has joined #ruby
tkuchiki has quit [Remote host closed the connection]
BTRE has joined #ruby
totimkopf has quit [Quit: WeeChat 1.2]
valetudo has joined #ruby
jbw_ has joined #ruby
jbw has quit [Ping timeout: 248 seconds]
Aswebb_ has quit [Ping timeout: 260 seconds]
tubuliferous_ has joined #ruby
Schalla has quit [Quit: Leaving]
saadq has joined #ruby
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea> >> [1, 2, 3].first(&:even?)
<ruboto> Ox0dea # => 1 (https://eval.in/401037)
yuuvee has quit [Quit: Leaving...]
<jhass> troll
jenrzzz has quit [Ping timeout: 244 seconds]
chouhoulis has quit [Remote host closed the connection]
acke has joined #ruby
pyon is now known as kawaii-imouto
<Coraline> I had to look up why first even took an argument, but it makes sense
eggoez has quit [Ping timeout: 246 seconds]
<Ox0dea> Coraline: Blocks don't count as arguments, technically.
<Coraline> True
brandon has joined #ruby
<Ox0dea> I realize we have #find/#detect to make that do "the right thing", but #last has no such saviors.
brandon is now known as Guest91133
sharpmachine has joined #ruby
eggoez has joined #ruby
<shevy> raise(Invalid, 'invalid data')
<shevy> ^^^ is that common? or do people omit the parens
<Ox0dea> jhass: What would you use to find the last even element of a collection?
saadq has quit [Remote host closed the connection]
<Ox0dea> shevy: `raise` is a "command" method, like `puts`; do you use parens for `puts`? :)
<Coraline> [1,2,3,4,5,6,7,8].select(&:even?).last ?
<Ox0dea> Coraline: But that creates an intermediate array.
<shevy> the above is not my code, I was stumbling over that part above
<Coraline> Yes
NeverDie has quit [Read error: Connection reset by peer]
<Ox0dea> = bad
<shevy> I think I saw the majority without parens
acke has quit [Ping timeout: 246 seconds]
NeverDie has joined #ruby
desigx has quit [Ping timeout: 248 seconds]
desigx has joined #ruby
EllisTAA has joined #ruby
hfp has quit [Quit: bye]
hfp_work has quit [Quit: bye]
<Ox0dea> >> foo = [1, 2, 3]; foo[foo.rindex(&:even?)]
<ruboto> Ox0dea # => 2 (https://eval.in/401038)
<Ox0dea> I think that's the best we can do, and that's not great.
eggoez has quit [Ping timeout: 244 seconds]
<Ox0dea> foo.last(&:bar) really ought to do the unsurprising thing, but then so should #first for the sake of symmetry.
<Coraline> Fine, then [1,2,3,4,5,6[.reverse!.find(&:even?)
GitGud has joined #ruby
<Ox0dea> Coraline: #[] and #rindex would be much faster than #reverse! on sufficiently large arrays.
<toretore> >> [1,2,3,4,5,6].reverse_each.find(&:even?)
<ruboto> toretore # => 6 (https://eval.in/401039)
maletor has quit [Quit: Computer has gone to sleep.]
<Ox0dea> But all these intermediates!
tubuliferous_ has quit [Ping timeout: 255 seconds]
<Coraline> Anyway arrays are cheap
<toretore> reverse_each only creates an Enumerator
lolmaus has quit [Ping timeout: 244 seconds]
<Ox0dea> That's a good point, but it's still wordy.
<toretore> though rfind, rselect, etc wouldn't be out of place on Array or Enumerable
<Coraline> def stubborn_find(stubborn); 0.upto(stubborn.size - 1) { |e| return stubborn[stubborn.size - e] if stubborn[stubborn.size - e].even? }; nil; end
<Ox0dea> Yikes.
<Coraline> Take that
<toretore> not sure if rselect would make sence
<Ox0dea> toretore: Nah, probably not, but #rfind wouldn't go unappreciated.
<toretore> *sense
<toretore> there's other rmethods so why not
<Ox0dea> I suppose I'll submit a patch and see how it goes.
<toretore> though i like the generality of using Enumerator
Muhannad has quit [Ping timeout: 256 seconds]
dimasg has quit [Ping timeout: 256 seconds]
<toretore> instead of solve 1 problem, solve many problem
<toretore> even problem not have now but at later time
eggoez has joined #ruby
allcentury has joined #ruby
hfp has joined #ruby
DenSchub has quit [Remote host closed the connection]
dimasg has joined #ruby
hfp_work has joined #ruby
martinium has joined #ruby
DenSchub has joined #ruby
Azure has quit [Quit: Oops.]
Azure has joined #ruby
Spami has joined #ruby
tno has quit [Remote host closed the connection]
Vile` has quit [Ping timeout: 248 seconds]
Muhannad has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
Spami has quit [Quit: This computer has gone to sleep]
Vile` has joined #ruby
sinkensabe has joined #ruby
rgb-one has joined #ruby
Mendenhall has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
sinkensabe has quit [Ping timeout: 240 seconds]
joneshf-laptop has joined #ruby
<Ox0dea> I guess #rfind isn't a thing because it'd break LSP between Array and Enumerator.
<Ox0dea> An Enumerator needn't have a "right" side from which to begin searching.
lolmaus has joined #ruby
prestorium has quit [Ping timeout: 260 seconds]
Spami has joined #ruby
arescorpio has joined #ruby
Mendenhall has quit [Ping timeout: 265 seconds]
sharpmachine has quit [Remote host closed the connection]
rubie has quit [Remote host closed the connection]
fabrice31 has joined #ruby
rubie has joined #ruby
char76 has quit [Read error: Connection reset by peer]
fabrice31 has quit [Ping timeout: 244 seconds]
charliesome has joined #ruby
Igorshp has joined #ruby
EllisTAA has joined #ruby
sross_work|2 has joined #ruby
Spami has quit [Ping timeout: 244 seconds]
wnd_ has joined #ruby
chishiki has quit [Ping timeout: 256 seconds]
kiki_lamb has quit [Ping timeout: 256 seconds]
wnd has quit [Ping timeout: 256 seconds]
sross07 has quit [Read error: Connection reset by peer]
EllisTAA has quit [Client Quit]
atomi has quit [Ping timeout: 264 seconds]
tkuchiki has joined #ruby
atomi has joined #ruby
baweaver has joined #ruby
chishiki has joined #ruby
kiki_lamb has joined #ruby
kfpratt has joined #ruby
dimasg has quit [Ping timeout: 256 seconds]
artmann has quit [Quit: No Ping reply in 180 seconds.]
artmann_ has joined #ruby
tkuchiki has quit [Ping timeout: 246 seconds]
duncannz has joined #ruby
Tritone has quit [Read error: Connection reset by peer]
Tritone has joined #ruby
[k- has joined #ruby
jonathanmarvens has joined #ruby
wnd_ is now known as wnd
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
linuxboytoo has quit [Remote host closed the connection]
linuxboytoo has joined #ruby
celly has joined #ruby
Igorshp has quit [Remote host closed the connection]
acke has joined #ruby
Igorshp has joined #ruby
bruno- has quit [Ping timeout: 246 seconds]
charliesome has quit [Quit: zzz]
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
linuxboytoo has quit [Ping timeout: 250 seconds]
Igorshp has quit [Ping timeout: 244 seconds]
acke has quit [Ping timeout: 256 seconds]
tubuliferous_ has joined #ruby
raypulver has joined #ruby
centrx has quit [Quit: Shutting down, Please wait...]
tubuliferous_ has quit [Client Quit]
<raypulver> I am making a gem.. how can I expose my function as LEON:::parse(str) and LEON::stringify(v)
<raypulver> when you require my library
chishiki has left #ruby ["WeeChat 1.2"]
<raypulver> functions*
iateadonut has joined #ruby
iateadonut has quit [Client Quit]
dimasg has joined #ruby
xkickflip has joined #ruby
zacstewart has quit [Remote host closed the connection]
nfk has quit [Remote host closed the connection]
<Ox0dea> raypulver: module Leon; def self.parse(str) ...
<[k-> Ox0dea that doesn't work
<rgb-one> Hey
<[k-> you need to def Leon.parse explicitly
<rgb-one> anyone know how to center an image in css?
<[k-> based on my experience
<[k-> ?ot
<ruboto> this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<[k-> also Hi Ox0dea!
<rgb-one> anyone know any web development channels?
<Ox0dea> [k-: Heya!
<Ox0dea> >> module Foo; def self.bar; 42 end end; Foo.bar
<ruboto> Ox0dea # => 42 (https://eval.in/401045)
<Ox0dea> [k-: Come on, guy. :P
<[k-> it never seemed to work? :(
<Ox0dea> raypulver: Lutz's Evil Object Notation?
<zenspider> Ox0dea: unsurprising to whom? it'd be surprising to me if first was an alias for find
EllisTAA has joined #ruby
<Ox0dea> zenspider: Yes, I've reconsidered.
Averna has joined #ruby
tkuchiki has joined #ruby
<[k-> oh oh oh, since Obfuscate was a hash, that's why def self.encode didn't work!
<[k-> I'm such a dummy :)
<[k-> wait, I tried declaring it in a module in the first place
Stratege has quit [Ping timeout: 248 seconds]
mike___1234 has quit [Ping timeout: 250 seconds]
allcentury has quit [Ping timeout: 256 seconds]
tkuchiki has quit [Ping timeout: 256 seconds]
<[k-> it works in eval.in when I change it to self >_>
<zenspider> jesus. my eyes.
<Ox0dea> I think it's beautiful.
Channel6 has joined #ruby
<Ox0dea> Terrible, but beautiful.
tubuliferous_ has joined #ruby
icebourg has joined #ruby
RandyT has quit [Ping timeout: 252 seconds]
<zenspider> at least my obfuscator compiled to C
mike___1234 has joined #ruby
<[k-> the encode part is an example itself!
RandyT has joined #ruby
radialneon has joined #ruby
sinkensabe has joined #ruby
<Ox0dea> zenspider: I trust you're not referring to transmogrify?
tubuliferous_ has quit [Ping timeout: 244 seconds]
<[k-> which aspect were you referring to when you said terrible
ValicekB has quit [Ping timeout: 250 seconds]
<zenspider> no, transmogrify was just a joke. zenobfuscate
<[k-> apeiros showed me that :o
<[k-> 2006!
htmldrum has joined #ruby
radialneon has quit [Remote host closed the connection]
Feyn has joined #ruby
charliesome has joined #ruby
Unicorn| has quit [Quit: Connection closed for inactivity]
<zenspider> showed you what?
<[k-> zenobfuscate
<zenspider> ... it was never released
EllisTAA has quit [Quit: EllisTAA]
<[k-> your blog posts*
<zenspider> ah. yes. it was announced. got a couple ppl interested, but not enough to pay for it.
chridal has quit [Ping timeout: 256 seconds]
Spami has joined #ruby
sinkensabe has quit [Ping timeout: 252 seconds]
Aswebb_ has joined #ruby
prestorium has joined #ruby
chridal has joined #ruby
zacstewart has joined #ruby
mesamoo has joined #ruby
<[k-> I don't think I want to use common lisp
<[k-> seems like bloat!
<zenspider> use scheme
<[k-> yes
<[k-> that was what I was thinking
<Ox0dea> [k-: Use Clojure.
<[k-> JVM is fat
ValicekB has joined #ruby
<Ox0dea> You only need the one.
<[k-> but I was thinking clojure anyway \o/
Aswebb_ has quit [Ping timeout: 250 seconds]
<Ox0dea> \o/
endash has quit [Quit: endash]
<[k-> but I would like to have static typing
<Ox0dea> [k-: It's dangerous to go alone. Here, take this: https://github.com/ninjudd/drip
<[k-> I grew fond of it
<Ox0dea> [k-: clojure/core.typed is good and getting better.
<[k-> is it inferrable :>
<Ox0dea> Sometimes.
<[k-> I'm bookmarking that
Thomas-0725 has joined #ruby
jack_rabbit has joined #ruby
<Ox0dea> Haskell's type system was bound to spoil you.
<[k-> it's so amazing!
<Ox0dea> It's pretty great.
iooner has quit [Ping timeout: 246 seconds]
<[k-> I think it's currently the best, no?
<Ox0dea> The hour is odd enough that we shouldn't need fire extinguishers.
<[k-> I think I'll learn rust before though
iooner has joined #ruby
<[k-> I'm guessing it is far late into the night
maletor has joined #ruby
sankaber has joined #ruby
zacstewart has quit [Remote host closed the connection]
PhantomS_ has joined #ruby
lorikeet has quit [Ping timeout: 248 seconds]
tyrbo has joined #ruby
PhantomSpank has quit [Read error: Connection reset by peer]
tyrbo has quit [Client Quit]
tyrbo has joined #ruby
Soda has quit [Remote host closed the connection]
jbw__ has joined #ruby
dimasg has quit [Ping timeout: 244 seconds]
lorikeet has joined #ruby
closer has quit [Ping timeout: 272 seconds]
jbw_ has quit [Ping timeout: 244 seconds]
Spami has quit [Quit: This computer has gone to sleep]
jack_rabbit has quit [Ping timeout: 248 seconds]
closer has joined #ruby
kfpratt has quit [Remote host closed the connection]
dopie has joined #ruby
bnizzle has quit [Read error: Connection reset by peer]
jonathanmarvens has quit []
nettoweb has joined #ruby
jack_rabbit has joined #ruby
nettoweb_ has joined #ruby
nettoweb_ has quit [Client Quit]
charliesome has quit [Quit: zzz]
maletor has quit [Quit: Computer has gone to sleep.]
nettoweb has quit [Ping timeout: 244 seconds]
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Thomas-0725 has joined #ruby
miwood has joined #ruby
desigx has quit [Ping timeout: 248 seconds]
Channel6 has quit [Quit: Leaving]
bnizzle has joined #ruby
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
GeissT has quit [Ping timeout: 248 seconds]
SpikeMaster has joined #ruby
SpikeMaster has left #ruby [#ruby]
odlox has joined #ruby
jbw_ has joined #ruby
Agoldfish has quit [Quit: G'Bye]
zacstewart has joined #ruby
odlox has quit [Client Quit]
jbw__ has quit [Ping timeout: 244 seconds]
mxrguspxrt has quit [Ping timeout: 256 seconds]
<Ox0dea> [k-: Is that the font you use?
<[k-> no, I'm too lazy to install it, it should be somewhere in my computer though
<[k-> I don't remember :P
<[k-> I tried it once on linux
<[k-> it was amazing!
kjones_ has quit [Read error: Connection reset by peer]
<[k-> 10/10
<[k-> (but now I am on osx)
mxrguspxrt has joined #ruby
<Coraline> I like Consolas on OS X
<[k-> I haven't tried other fonts on os x
<[k-> but they do look very nice
<[k-> OS x basically ships with the nicest fonts ever
<Ox0dea> [k-: Do you even Infinality?
<[k-> no :o
Channel6 has joined #ruby
<Ox0dea> Well, there's your problem. :)
davedev24 has quit [Ping timeout: 248 seconds]
davedev2_ has joined #ruby
<[k-> OSX probably does it better >:3
<Ox0dea> OSX's font configuration is obviously top-notch, but Infinality brings freetype2 very close.
<[k-> should I bookmark it :o
Averna has quit [Quit: Leaving.]
sinkensabe has joined #ruby
braincrash has quit [Quit: bye bye]
baweaver has quit [Remote host closed the connection]
<Ox0dea> [k-: Do you plan on ditching OSX?
yqt has quit [Ping timeout: 250 seconds]
sankaber has joined #ruby
<[k-> other OSes dont really work well on a Mac book
lessless has joined #ruby
<[k-> Macbook*
<[k-> probably irritated a lot of people here accidentally leaving a space there ;)
sinkensabe has quit [Ping timeout: 240 seconds]
<Ox0dea> [k-: Plenty of folks dual- or even triple-boot on their Macs.
<Ox0dea> Well, I suppose "plenty" is stretching it, but it's been done.
PapaSierra has joined #ruby
<[k-> the trackpad doesn't work very well on other os
<[k-> I get very irritated by the trackpad
<pizzaops> Can't dual boot if you use filevault and not using filevault is nuts.
htmldrum has quit [Ping timeout: 244 seconds]
braincrash has joined #ruby
<Ox0dea> [k-: But it's configurable!
matcouto has joined #ruby
<Ox0dea> It's all configurable.
PapaSierra has quit [Read error: Connection reset by peer]
<[k-> I tried configuring it, not satisfactory
<[k-> but I am a noob so >.<
jbw__ has joined #ruby
penzurx has quit [Quit: Leaving]
Muhannad has quit [Ping timeout: 256 seconds]
<Ox0dea> The Arch Wiki would've had your back. :/
<Ox0dea> Shame we lost ya.
<[k-> I don't use arch :o
jbw_ has quit [Ping timeout: 244 seconds]
fabrice31 has joined #ruby
desigx has joined #ruby
<[k-> I tried deepin
<[k-> I'm a fan of ui :)
dimasg has joined #ruby
<Ox0dea> [k-: http://papyros.io/
<[k-> you know just what I want!
jbw_ has joined #ruby
gambl0re has joined #ruby
<Ox0dea> It's pretty much Arch x Android.
<Ox0dea> A nifty combination, if you're into those sorts of thing.
zacstewart has quit [Remote host closed the connection]
jbw__ has quit [Ping timeout: 255 seconds]
fabrice31 has quit [Ping timeout: 244 seconds]
nateberkopec has quit [Quit: Leaving...]
acke has joined #ruby
The_Phoenix has joined #ruby
<[k-> deepin still looks better though >.<
acke has quit [Ping timeout: 240 seconds]
<[k-> haskell has ".c" `isSuffixOf` "hello.c"; I think it would be better if they provided "hello.c" `hasSuffix` ".c" tho
Channel6 has quit [Quit: Leaving]
<[k-> wouldn't it look much more natural
duncannz has quit [Remote host closed the connection]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
iateadonut has joined #ruby
iateadonut has quit [Client Quit]
mary5030 has joined #ruby
<[k-> it depends on the use case tho
<[k-> maybe the second one could be for handling multiple extensions
EllisTAA has joined #ruby
<[k-> while the first is for checking if the extension is correct
<Ox0dea> [k-: The order is as it is to permit a more useful partial evaluation.
<[k-> ah
desigx has quit [Ping timeout: 248 seconds]
<[k-> I am probably influenced by String#end_with?
rgb-one has quit [Read error: Connection reset by peer]
kfpratt has joined #ruby
linuxboytoo has joined #ruby
eggoez has quit [Ping timeout: 240 seconds]
prestorium has quit [Ping timeout: 246 seconds]
<Ox0dea> It makes sense for object-oriented languages to "parameterize" in the other direction.
prestorium has joined #ruby
prestorium has quit [Client Quit]
EllisTAA has quit [Client Quit]
<Ox0dea> Of course, that tends to make their constructs less general, which is why functional is best.
Channel6 has joined #ruby
<[k-> i like how you said functional is best at the end ^^
konsolebox has quit [Quit: Leaving]
<[k-> *The Oracle sides with functional*
konsolebox has joined #ruby
<Ox0dea> endsWithFoo = isSuffixOf "foo" vs. foo_ends_with = "foo".method(:end_with?)
<Ox0dea> The winner is clear.
<[k-> they don't do the same thing :s
<Ox0dea> No, they don't, but they're both "natural" in their respective languages.
<Ox0dea> It's just that the former is much more useful than the latter.
<[k-> :>
htmldrum has joined #ruby
dimasg has quit [Ping timeout: 260 seconds]
rubie has quit [Remote host closed the connection]
TheHodge has quit [Quit: Connection closed for inactivity]
rubie has joined #ruby
lkba_ has joined #ruby
bertro has quit [Ping timeout: 250 seconds]
dimasg has joined #ruby
Channel6 has quit [Remote host closed the connection]
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rubie has quit [Remote host closed the connection]
rubie has joined #ruby
lkba has quit [Ping timeout: 256 seconds]
jbw__ has joined #ruby
eggoez has joined #ruby
<Ox0dea> [k-: Show me your fooEndsWith?
jbw_ has quit [Ping timeout: 248 seconds]
<[k-> fooEndsWith s = flip isSuffixOf "foo"
<Ox0dea> [k-: Why the explicit argument?
<[k-> I'm not an expert yet!
miwood has quit [Remote host closed the connection]
<[k-> s `isSuffixOf` "foo" is clearer though
_blizzy_ has quit [Read error: Connection timed out]
* [k- makes a mental note that point free isn't always the best
dimasg has quit [Ping timeout: 264 seconds]
<Ox0dea> [k-: You got the order backwards. :P
* Ox0dea maintains his position on point-free.
tubuliferous_ has joined #ruby
dimasg has joined #ruby
<[k-> I typed more on that example!
<[k-> like, 1 character more
<Ox0dea> Hm?
<[k-> the point free version
EllisTAA has joined #ruby
_blizzy_ has joined #ruby
<Ox0dea> Oh, never mind; I forgot we'd switched to fooEndsWith.
CloCkWeRX has joined #ruby
gix has quit [Ping timeout: 256 seconds]
bosma has quit [Quit: Leaving]
<Ox0dea> Yes, the infix version certainly reads better, but that's not an argument against point-free.
Mendenhall has joined #ruby
<[k-> come up with a better point free version then :>
<Ox0dea> [k-: Yours is already point-free; you just need to remove the explicit argument.
tubuliferous_ has quit [Ping timeout: 264 seconds]
<Ox0dea> That's... why I asked why you were using it?
desigx has joined #ruby
htmldrum has quit [Ping timeout: 244 seconds]
<[k-> I wanted to go with s `isSuffixOf` "foo" first
<[k-> but I changed my mind midway
Feyn has quit [Ping timeout: 246 seconds]
darkf has joined #ruby
<Ox0dea> I think you did the right thing. :P
duncannz has joined #ruby
CloCkWeRX1 has joined #ruby
gix has joined #ruby
<[k-> does s = `isSuffixOf` "foo" work by any chance
duncannz has quit [Max SendQ exceeded]
duncannz has joined #ruby
arup_r has joined #ruby
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
duncannz has quit [Max SendQ exceeded]
<Ox0dea> There's no LHS there.
CloCkWeRX has quit [Ping timeout: 248 seconds]
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
bb010g has quit [Quit: Connection closed for inactivity]
<[k-> but (/2) works
Aswebb_ has joined #ruby
duncannz has joined #ruby
duncannz has quit [Max SendQ exceeded]
casadei_ has joined #ruby
Aswebb_ has quit [Ping timeout: 250 seconds]
duoi has quit [Remote host closed the connection]
user1138 has quit [Quit: Leaving]
htmldrum has joined #ruby
user1138 has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sinkensabe has joined #ruby
dimasg has quit [Ping timeout: 248 seconds]
bosma has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
chinmay_dd has joined #ruby
casadei_ has quit [Ping timeout: 244 seconds]
<Ox0dea> [k-: I don't know the exact semantics, but symbol functions are special: https://gist.github.com/0x0dea/63df1b6c75e347529a7b
lorikeet has quit [Ping timeout: 248 seconds]
sinkensabe has quit [Ping timeout: 240 seconds]
<[k-> Ox0dea you are doing d 2 4
<[k-> which is 2 `d` 4
<[k-> you aren't doing (/2)!
fromthedepths has joined #ruby
<[k-> I asked for `d` 2 :)
<Ox0dea> Right, so symbol functions fix differently?
<[k-> yes, they are infix by default
<[k-> actually they are always infix
<Ox0dea> That's the rub of it, I think.
<Ox0dea> You can alias d to (/) and it'll behave differently.
<[k-> doing (d 2) doesn't turn it infix :)
<[k-> it will return a curried function
dimasg has joined #ruby
<[k-> that divides 2 by a numbet
<[k-> I like how you called it wtf.hs :p
<Ox0dea> How do you define d such that (d 2) 4 == 2?
<[k-> flip (/)?
<Ox0dea> From scratch, I mean.
<Ox0dea> I suppose I naively assumed an "alias" would inherit fixation.
arescorpio has quit [Quit: Leaving.]
ndrei has joined #ruby
<[k-> how do you even implement /
<Ox0dea> It's just x / y = x * (1 / y) in Prelude.
Thomas-0725 has joined #ruby
<[k-> but that's recursive!
<Ox0dea> Yay, Haskell!
zacstewart has joined #ruby
<[k-> does that even work :/
Rickmasta has joined #ruby
<[k-> 1/y is 1*(1/y) :/
bubbys has quit [Ping timeout: 246 seconds]
<Ox0dea> I'm sure their being inlined has something to do with everything holding together.
mary5030 has quit [Remote host closed the connection]
<[k-> you are looking at the class definition
<[k-> not the instance definition :/
<[k-> class Eq defines == as not (/=)
<[k-> and /= as not ==
<[k-> you can see how that goes
zacstewart has quit [Ping timeout: 240 seconds]
<[k-> Ox0dea: you need more sleep :3
<Ox0dea> [k-: Wait, I thought we were talking about (/)?
<Ox0dea> Why've you mentioned (==) and (!=)?
Channel6 has joined #ruby
<[k-> because you are confused!
<[k-> class definitions provide the *default* implementation
<[k-> and the don't always make sense
<Ox0dea> Um...
<[k-> they*
<Ox0dea> Perhaps my link didn't take you to the right place?
thiagovsk has quit [Quit: Connection closed for inactivity]
<[k-> it took me to class (Num a) => Fractional a
<Ox0dea> It should've taken you right to the definition of (/), which is implemented in terms of recip, which are both inlined.
<[k-> it's still under the class definition >.>
<[k-> {-# MINIMAL fromRational, (recip | (/)) #-}
<[k-> this line states that you must implement either recip or (/)
<[k-> so that shows us they refer to each other
<[k-> it's the class Eq situation that I just stated :/
sepp2k has quit [Read error: Connection reset by peer]
<[k-> don't you see that (==) = not (/=) becomes (==) = not (not (==)) and that goes on forever?
desigx has quit [Ping timeout: 248 seconds]
bruno- has joined #ruby
matcouto has joined #ruby
<arup_r> Using Ruby's Net::HTTP module can I send Redirect URL after doing a POST requst?
<Ox0dea> Ah, right, I derped pretty hard there.
<Ox0dea> [k-: But, then, how *do* you even implement (/)?
jbw_ has joined #ruby
<[k-> could be here
jbw__ has quit [Ping timeout: 244 seconds]
chinmay_dd has quit [Ping timeout: 244 seconds]
<Ox0dea> arup_r: Redirection must be done by the response, not the request.
<Ox0dea> The response needs simply to provide a value for the Location header.
bruno- has quit [Ping timeout: 240 seconds]
<Ox0dea> [k-: There's no implementation of (/) in there.
cornerman has joined #ruby
bigmac has joined #ruby
htmldrum has quit [Ping timeout: 244 seconds]
<arup_r> Ox0dea, any example how to set location while doing POST ? Just a small example.
<[k-> divideDouble could be anywhere dear friend :3
<Ox0dea> Aye, but I reckon I caught the gist.
<Ox0dea> arup_r: You can't. It's up to the response.
<[k-> actually dividedouble leads to /## :/
<arup_r> REDIRECT=<Merchant Receipt URL>?paymentID=<Payment ID>
<Ox0dea> arup_r: Do you control the response?
djbkd_ has joined #ruby
htmldrum has joined #ruby
<arup_r> Yes, I do. But processing response data and saving into DB I need to send the PG again a request as they said in the link I gave
_blizzy_ has quit [Read error: Connection timed out]
iateadonut has joined #ruby
arensburgh has joined #ruby
<Ox0dea> arup_r: Do you want to perform an HTTP redirect, or is this some Knet-specific mechanism?
Feyn has joined #ruby
<arup_r> actually that small paragraph not telling much.. where to send.. I am bit confused.
_blizzy_ has joined #ruby
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Ox0dea> Well, if you wish to perform an automatic HTTP redirect, you must set the Location header in the response.
<[k-> Ox0dea: https://www.fpcomplete.com/blog/2015/02/primitive-haskell might shed some light on this
<Ox0dea> [k-: But how to define d from scratch such that (d 2) 4 == 2?
Yiota has joined #ruby
<arup_r> ok
<[k-> flip (/)!
<Ox0dea> That's not scratch!
<[k-> d x y = let scratch = flip (/) in scratch x y
tjbiddle has joined #ruby
<Ox0dea> Ha.
Marsupermammal has joined #ruby
<[k-> doing (d 2) 4 is the same as d 2 4
<Ox0dea> Except not for (/).
<Ox0dea> Why?
<Ox0dea> Because of its left-fixity of 7?
<[k-> function application has the highest precedence
arensburgh has quit [Quit: Leaving]
<[k-> fixity applies to symbols only
<Ox0dea> Nope.
<Ox0dea> infixl 7 `d`
acke has joined #ruby
<[k-> :/ does that even do anything
<Ox0dea> Apparently not.
<Ox0dea> In short, it's impossible to define a d function that behaves exactly like (/), right?
<[k-> symbols are automatically infix
<[k-> they do not need to be declared infix
<[k-> Yes
maletor has joined #ruby
<[k-> unless `d`
<Ox0dea> I guess that makes sense.
<Ox0dea> It seems like an arbitrary restriction.
<[k-> Ox0dea I win!
<[k-> λ let d = (/) in (`d` 2) 4
<[k-> 2.0
<Ox0dea> Right, but not (d 2), because math reasons.
<[k-> if you would just try out my `d` suggestion in the first place
casadei_ has joined #ruby
<[k-> d :: Int -> Int -> Int; d 2 :: Int -> Int; d 2 4 :: Int
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<[k-> d 2 supplies the first argument to d
GitGud has quit [Quit: My name is your name]
<[k-> (d 2) doesn't change that
<[k-> we have map (\x y -> do something with x and y) xs
acke has quit [Ping timeout: 264 seconds]
<[k-> if it did, this would be chaos
<[k-> at least I think so
<Ox0dea> I guess I'm just trying to get clear on why non-symbol functions can't be given fixity.
<[k-> fixity applies for infix only :/
<[k-> symbols are always infix so (+3) works because (`add` 3) does too
<Ox0dea> Oh, I'm derping again; non-symbolic infix operators would beget terribly ambiguity.
<Ox0dea> *terrible
<[k-> scala more or less
bigmac has quit [Ping timeout: 246 seconds]
Mendenhall has quit [Ping timeout: 255 seconds]
<Sp4rKy> W 1
<Ox0dea> Sp4rKy: I know exactly what went wrong there.
EllisTAA has joined #ruby
<Sp4rKy> :)
<Ox0dea> Stupid big-ass right Shift key.
<[k-> is that scala
<Sp4rKy> that's it :D and not enough coffee probably :)
matcouto has joined #ruby
<[k-> unfortunately I do not know Scala
<Ox0dea> [k-: /w is Sp4rKy's alias for switching windows in his IRC client.
dimasg has quit [Ping timeout: 250 seconds]
<Ox0dea> / is right next to right Shift on many keyboards.
<[k-> oh
<[k-> how is that even Scala
zr2d2 has quit [Ping timeout: 264 seconds]
<Ox0dea> ?ot [k-
<ruboto> [k-, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
Casty has quit [Quit: Textual IRC Client: www.textualapp.com]
<Ox0dea> ^_^
sinkensabe has joined #ruby
<[k-> we have been off topic for hours
iateadonut has joined #ruby
<Ox0dea> Nobody's around to phone the authorities.
<Nilium> Off topic? Allow me to complain about how hard it is to use proportional fonts in code editors.
<Nilium> It's really hard.
<[k-> the sudden allowance of off topic!
<Ox0dea> Nilium: What madness overcomes you that you find yourself with such a problem?
EllisTAA has quit [Quit: EllisTAA]
<Nilium> The desire to have nice, pretty text.
<Ox0dea> Heathen.
<[k-> haskell will solve some of your problems!
sinkensabe has quit [Ping timeout: 240 seconds]
EllisTAA has joined #ruby
symm- has joined #ruby
<[k-> newtype IO a = IO (State# RealWorld -> (# State# RealWorld, a #))
Marsupermammal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nisstyre has joined #ruby
<[k-> I'm not ready to look at this...
fenjamin has joined #ruby
nisstyre has quit [Changing host]
nisstyre has joined #ruby
fabrice31 has joined #ruby
iateadonut has quit [Quit: Leaving.]
bigmac has joined #ruby
irk has quit [Ping timeout: 255 seconds]
lkba_ has quit [Remote host closed the connection]
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
irk has joined #ruby
casadei_ has quit [Remote host closed the connection]
Thomas-0725 has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
<fenjamin> merely curious: perhaps in an exercise of DRY programming if the program understandably does what's expected, there are zero bugs, why then must methods be named consistent with the program? the method names can be gibberish, in other words
<Nilium> Every time I look at Haskell it just convinces me that yeah, no, I'm not smart enough for this.
<fenjamin> other than it helps others to read the program (which people can infer about how it works even if the methods are gibberish?
fabrice31 has quit [Ping timeout: 256 seconds]
celly has quit [Remote host closed the connection]
<Nilium> fenjamin: DRY says nothing of naming, so far as I'm concerned.
<Nilium> Not repeating yourself is just not repeating yourself.
_blizzy_ has quit [Read error: Connection timed out]
<[k-> fenjamin*
<[k-> Nilium you are!
<Nilium> Exactly.
<[k-> everything takes time to learn
<[k-> I don't even know how I learnt 1+1
<fenjamin> [k thanks for clarifying
icebourg has quit []
<fenjamin> inference has its limits
<[k-> you are welcome :>
Thomas-0725 has quit [Client Quit]
rubie has quit [Remote host closed the connection]
<[k-> that 100% runs
<[k-> it's legal Ruby!
_blizzy_ has joined #ruby
<fenjamin> free of dependencies?
<Ox0dea> fenjamin: Programs are written to be read as well as executed; what benefit to giving things meaningless names?
<[k-> well you need to require the library in lib/libobf.rb first
greenride has joined #ruby
<fenjamin> where's that?
ledestin has joined #ruby
<[k-> it's here
<Ox0dea> fenjamin: Are you familiar with FizzBuzz? ;P
<[k-> oooooo he's gonna do it!
<Ox0dea> Maybe.
<[k-> do it Ox0dea!
<Ox0dea> The pieces must be in place.
Channel6 has quit [Quit: Leaving]
<Ox0dea> Lest nothing shall be learnt.
Muhannad has joined #ruby
EllisTAA has joined #ruby
Thomas-0725 has joined #ruby
EllisTAA has quit [Client Quit]
<nofxx> >> puts (1..5).map { |i| (fb = [["Fizz"][i % 3], ["Buzz"][i % 5]].compact.join).empty? ? i : fb }
<ruboto> nofxx # => 1 ...check link for more (https://eval.in/401078)
<nofxx> there's a smaller one somewhere
Blaguvest has joined #ruby
EllisTAA has joined #ruby
EllisTAA has quit [Client Quit]
<fenjamin> yes I'm finding something with explicit naming conventions it can become a "who's on first" routine
<fenjamin> *sometimes
DenSchub has quit [Read error: Connection reset by peer]
<nofxx> there was this site, backed by ibm iirc, with some challenges that you could compile & run in a bunch of langs
DenSchub has joined #ruby
mary5030 has joined #ruby
<[k-> that's a cool way to do fizzbuzz
<Ox0dea> We golfin'?
<Ox0dea> fenjamin: That's what namespaces are for.
<[k-> dundundun you have triggered Ox0dea!
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<fenjamin> ox0dea: ::?
<fenjamin> Ox0dea: ::?
<Ox0dea> fenjamin: Well, yes, that's the resolution operator.
mary5030 has quit [Ping timeout: 256 seconds]
<Ox0dea> foo.compact.join == foo*'' if foo is an array of maybe strings.
<[k-> >> ::
<ruboto> [k- # => /tmp/execpad-a76eadcb3df8/source-a76eadcb3df8:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/401079)
<Ox0dea> >> ['Fizz', nil] * ''
<ruboto> Ox0dea # => "Fizz" (https://eval.in/401080)
tubuliferous_ has joined #ruby
<Ox0dea> >> 1::to_s # ogodwhy
<ruboto> Ox0dea # => "1" (https://eval.in/401081)
<[k-> $-o::[](?.)
<Ox0dea> It'll work.
<[k-> abooooooose
<[k-> adding that to the tips and tricks section later
htmldrum has quit [Ping timeout: 265 seconds]
<[k-> # how to avoid name spacing issues
<[k-> # do it the JavaScript way
<[k-> -> {# your things here}.call()
<fenjamin> if i understand correctly namespacing is organizationally nesting methods?
<zenspider> *sigh* always saddens me when I see fizz buzz.
<Ox0dea> fenjamin: Nesting anything, really.
CpuID has quit [Ping timeout: 246 seconds]
<Ox0dea> [k-: All my non-alphanumeric sillinesses use IIFEs.
<fenjamin> Ox0dea: you're a treasure
tubuliferous_ has quit [Ping timeout: 250 seconds]
<[k-> IIFEs?
<Ox0dea> Immediately-invoked function expressions.
lkba has joined #ruby
<[k-> ._. how would I resolve that
<Ox0dea> Hm?
<fenjamin> without using |x|
<[k-> IIFE isn't defined as immediately-invoked function expressions in my book
havenwood has joined #ruby
<[k-> hence, I can't resolve it
<fenjamin> {|x| x p y} rather
riotjones has joined #ruby
<Ox0dea> [k-: I'm not sure I follow.
lkba has quit [Remote host closed the connection]
<Ox0dea> [k-: Did you accidentally your_book.freeze?
<[k-> I am unable to understand what you mean by IIFE when you suddenly threw it at me
<Ox0dea> But... it's the first result.
<Ox0dea> And you were already familiar with the concept.
<[k-> wow... indeed it is
<[k-> that's because I use jquery!
<greenride> In the following snippet of code, how can the environment of the first block be changed such that it's variable definitions are available in the rest of the method? https://dpaste.de/MApc
<[k-> that's a cool code pasting site
<Ox0dea> greenride: You'd have to declare inner_object outside of the block.
riotjones has quit [Ping timeout: 240 seconds]
Aswebb_ has joined #ruby
jbw_ has quit [Ping timeout: 256 seconds]
<greenride> Ox0dea: Isn't there some way to use binding to modify the scope in which that block's code runs?
jbw_ has joined #ruby
Mon_Ouie has quit [Ping timeout: 265 seconds]
<zenspider> greenride: *sigh* why?
<[k-> you have to eval first....
<greenride> zenspider: I'll construct an example. One sec.
<[k-> he doesn't want to see it...
<[k-> lel
djbkd_ has quit [Remote host closed the connection]
<zenspider> "how do I violate nice clean scoping rules? preferably... rectally?"
Aswebb_ has quit [Ping timeout: 256 seconds]
<Ox0dea> It's fitting that your nick hashes to a shade of jade.
<[k-> :<; :^)*
maletor has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Aeyrix has quit [Ping timeout: 244 seconds]
<greenride> zenspider: https://dpaste.de/L0bh What if I have the following method, and I want to benchmark the time for each line in this method? If I use the Benchmark library, I have to ensure every variable defined within the block is defined outside the block. That's the problem I'm trying to avoid.
pepperbreath has joined #ruby
<zenspider> greenride: above it you put a = b = c = d = nil
<zenspider> done
<zenspider> don't be clever with bindings. be explicit about what you're doing. do the simplest thing that could possibly work
<zenspider> also, use better tools to figure out where your benchmarks are
<Ox0dea> greenride: Alternatively, there's a gem for that: https://github.com/niklasb/ruby-dynamic-binding
Channel6 has joined #ruby
<zenspider> Ox0dea: do you _have_ to?
xkickflip has quit [Quit: xkickflip]
<Ox0dea> _why not?
<greenride> zenspider: It seems strange to me that I need to identify every single variable and set it to nil as the very first line.
Aeyrix has joined #ruby
<nofxx> expect(Foo).to be or to_not be
<nofxx> that's the spec
afrianska has joined #ruby
<[k-> Ox0dea highly tempting!
xkickflip has joined #ruby
<[k-> this will be a great addition!
<greenride> zenspider: Also, if my goal is to benchmark every single line in an arbitrary method; will the approach of setting all local variables to nil as the first line always work?
orbitalo has quit [Remote host closed the connection]
<zenspider> greenride: all you're doing is declaring the variables at the top (relevant) scope.
<Ox0dea> [k-: You might also enjoy binding_of_caller.
<[k-> greenride: there are profiling tools in Ruby
orbitalo has joined #ruby
fenjamin has quit [Quit: 离开]
<Ox0dea> greenride: Do it dynamically! Use RubyVM::InstructionSequence.of(foo), programmatically extract each line of the method, then benchmark them while also mutating some object that holds the last return value.
<[k-> huehuehue
<Ox0dea> greenride: It'd probably be much easier just to benchmark every single expression if you wound up taking that path, though.
<zenspider> Radar: can we mute bad idea generators who don't prefix their bad ideas as such?
<[k-> I bet 10 bucks that Ox0dea did that before!
<Ox0dea> Nah, Ruby's iseqs are pretty gnarly.
<[k-> there goes 10 bucks :(
<Ox0dea> I *did* try to modify and execute one, which seems to have been doable at some point, but it's no longer kosher.
<zenspider> you can with some fiddle code to make a C entrypoint public
<Ox0dea> zenspider: It's commented out in trunk.
<Ox0dea> RubyVM::InstructionSequence#load, I mean.
acke has joined #ruby
sinkensabe has joined #ruby
xkickflip has quit [Quit: xkickflip]
Thomas-0725 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea> I am derping all over the place. The function is still defined, but I wonder whether its being cast to void causes it to be optimized out of the final binary.
<zenspider> in my build I see: 0000000100171920 t _iseq_build_load_iseq
<[k-> if you want to modify code on the fly you are treating code as data!
<[k-> time for a lisp!
Channel6 has quit [Quit: Leaving]
acke has quit [Ping timeout: 246 seconds]
<Ox0dea> zenspider: iseq_build_load_iseq() calls rb_iseq_load(), which is in the symbol table, but that calls iseq_load(), which is not.
<zenspider> huh
<zenspider> is for me... it seems
sinkensabe has quit [Ping timeout: 244 seconds]
<greenride> zenspider: The problem with putting something like a = b = c = nil at the top of the method where a, b, and c are the local variables is that it can change the output.
pdxvegan has quit [Remote host closed the connection]
<Ox0dea> greenride: Assignment is not your bottleneck, bud.
<greenride> Ox0dea: I'm thinking/google through your suggestions.
<Ox0dea> greenride: As evinced by zenspider's chewing me out, I was mostly fucking with you.
<[k-> cey cry weeping sounds
<zenspider> change it how? if you have bad logic for nils, then use the right starting value
<greenride> Ox0dea: I'm not worried about assignment being the performance bottleneck. I'm concerned about conditionals such as b = (defined? a) ? 2 : 3.
<greenride> Ox0dea: Granted, people shouldn't write code like that, but I'm looking for a 'correct' method.
<[k-> this, is profiling
<[k-> pls don't do it your way
konsolebox has quit [Ping timeout: 244 seconds]
<Ox0dea> greenride: Whom do you suppose will have need of your "benchmark every line" library?
<greenride> The set of users is probably limited.
symm- has quit [Ping timeout: 260 seconds]
<Ox0dea> It might even be one.
<zenspider> I'm shooting for zero here
<greenride> Yes, that's a lower bound.
<zenspider> do we have negative one?
<[k-> write it in libobf!
<Ox0dea> ^
<zenspider> negative two??
<zenspider> greenride: you're trying to generalize this
<zenspider> ?
davedev2_ has quit [Remote host closed the connection]
yardenbar has joined #ruby
<greenride> zenspider: Yes.
tyrbo has quit [Remote host closed the connection]
<zenspider> and you're thinking about lines of code?
<greenride> zenspider: The obvious way is to get the time before and after a line of code. Then, find the difference.
<zenspider> and you're not doing flow analysis on those variables and where they're used?
<zenspider> You're doomed.
<zenspider> Either do the simple thing I suggested for your one-time "profiling", or be prepared for pain.
<zenspider> what; about; this; line ?
<zenspider> lines mean nothing
<Ox0dea> greenride: For what it's worth, there are several excellent Ruby parsers.
nullsides has joined #ruby
jbw__ has joined #ruby
nullsides has quit [Quit: leaving]
jbw_ has quit [Ping timeout: 255 seconds]
<greenride> Ox0dea: What would a Ruby parser help me do in this case?
<nofxx> %?() what's the '?' for symbols again?
htmldrum has joined #ruby
<Ox0dea> nofxx: i and I.
<nofxx> Ox0dea, thanks!
lavros has joined #ruby
<[k-> oh he meant ? as in a wildcard
<Ox0dea> greenride: You've been advised of the futility of benchmarking lines.
<[k-> I was confused
<Ox0dea> [k-: Took me a second as well.
<[k-> it took you a second but I remained confused!
<nofxx> Don't remember the name of this sourcery
<Ox0dea> nofxx: I call them symbol array literals.
<nofxx> array magic spell #8
xkickflip has joined #ruby
<[k-> percent literals
<[k-> they are called percent literals
<Ox0dea> Aye, but what do you call the ones that're specfically for symbols?
<nofxx> yeah percent array thing
<[k-> the percent literal specifically for constructing an array of symbols
<[k-> or, shorthand for array filled with symbols
<nofxx> percent array symbol spell
<[k-> that makes no sense to me
rubie has joined #ruby
<[k-> the spell part will throw people ofr
konsolebox has joined #ruby
<[k-> off*
<Ox0dea> I suspect facetiousness.
htmldrum has quit [Ping timeout: 264 seconds]
<nofxx> agreed... was looking for something more it's the force not magic
t_ has quit [Ping timeout: 256 seconds]
<Ox0dea> >> 'facetious'.scan(/[aeiou]/).join
<ruboto> Ox0dea # => "aeiou" (https://eval.in/401088)
<[k-> even in order!
<[k-> there is no y, though
matcouto has joined #ruby
<Ox0dea> Y is only a vowel when there are no others.
bruno- has joined #ruby
<[k-> it is like Pluto :(
* Ox0dea checks that "facetious" is still the shortest word with that property.
<nofxx> [k-, hehe, which is your mother tongue?
<[k-> mandarin
htmldrum has joined #ruby
<nofxx> [k-, for latin it looks strange, Y V as vowels, guess it's because we made new letter's for em
<nofxx> latin based tongues*
rubie has quit [Ping timeout: 265 seconds]
<Ox0dea> nofxx: V?
<nofxx> Ox0dea, yup.. there was no 'U'
<nofxx> i,j,u are the newest iirc
<Ox0dea> Uh...
<[k-> there is no v in mandarin
<[k-> only ü
<Ox0dea> I... think he's talking about English.
bruno- has quit [Ping timeout: 246 seconds]
<[k-> I'm not sure what he is talking about :/
<nofxx> [k-, hum? you mean simplified mandarin, something to write on west keyboard (sorry my naiveness)
afrianska has quit [Quit: Leaving]
<[k-> Chinese/Mandarin
<zenspider> greenride: what
<zenspider> about
<zenspider> this
<zenspider> line?
tmtwd has joined #ruby
<Ox0dea> nofxx: Isn't V just how they *wrote* the letter U way back when?
<nofxx> Ox0dea, [k- we're talking about the latin alphabet, aren't we?
<Ox0dea> nofxx: A-Z is the Latin alphabet.
<nofxx> Ox0dea, yes
tkuchiki has joined #ruby
<[k-> we don't know what you are taking about
<nofxx> is now
<Ox0dea> nofxx: They had the letter U, they just didn't write it like we do now.
<Ox0dea> How do you reckon they pronounced Jvlivs?
<nofxx> Y being a vowel... I said that after we came up with the new i and u it looks strange
<Ox0dea> nofxx: Right, but you also mentioned V.
jud has quit [Quit: Leaving]
<Ox0dea> More to the point of confusion, you mentioned V being a vowel.
tjbiddle has quit [Ping timeout: 246 seconds]
phutchins has joined #ruby
<greenride> zenspider: You asked me 'what about this line?'. Which line are you referring to?
<nofxx> Ox0dea, now you are confusing greek and latin alphabets
riotjones has joined #ruby
<[k-> he is confusing everything today
<Ox0dea> >> eval "1 + \n 2 + \n 3" # greenride
<ruboto> Ox0dea # => 6 (https://eval.in/401089)
<[k-> it's upside down day everyone!
<Ox0dea> nofxx: I would appreciate being enlightened as to the nature of my confusion.
celly has joined #ruby
<Ox0dea> In short, in which languages, past or present, is the letter V a vowel?
phutchins has quit [Ping timeout: 244 seconds]
pwnz0r has joined #ruby
<nofxx> Ox0dea, really not a expert here but here it goes: basically rome uses some letter from greek and add some others
<greenride> Ox0dea: I see. You are demonstrating that lines are a bad thing to benchmark since your example shows that lines are not necessarily a unit that translates into something meaningful at the token level or the ruby virtual machine level.
toretore has quit [Quit: This computer has gone to sleep]
<nofxx> and build the latin alphabet, and rome being rome it gets widespread
<zenspider> greenride: I asked you "what; about; this; line?"
<Ox0dea> greenride: That's exactly right.
<zenspider> greenride: I also asked you "what\nabout\nthis\nline?"
<Ox0dea> In Ruby, statements may span multiple lines, and a single line may contain multiple statement.
<Ox0dea> greenride: If you desire to benchmark a method piecemeal, you'll need to do so at the expression level.
<nofxx> Ox0dea, its basically our aphabet, but 'J' did not exist until some centuries ago (another history I dont recall).. they added I and U for instance
<zenspider> half an hour ago I said "lines mean nothing"
<Ox0dea> nofxx: Who added U?
<greenride> Ox0dea: Fully agree.
<nofxx> Ox0dea, rome
riotjones has quit [Ping timeout: 244 seconds]
<greenride> zenspider: Thanks for pointing that out. I just wasn't sharp enough to get it back then.
mxrguspxrt has quit [Remote host closed the connection]
<greenride> zenspider: Noted that you said it.
<nofxx> Ox0dea, if not it's the same J history, was later and rome added 'I' heh need to wikipedia
<[k-> zenspider: I actually have a code snippet for that
<[k-> want to see?
<nofxx> Ox0dea, I guess it was later cuz we see a lot of julius as you wrote, and GAIVS too for caesar
tjbiddle has joined #ruby
celly has quit [Ping timeout: 248 seconds]
<zenspider> [k-: before I answer your question, expand on "for that"
<nofxx> Ox0dea, they used a lot of greek ones http://www.idlcoyote.com/ps_tips/greeksym_3.png
<[k-> I used \
<nofxx> what they didn't use mathematica grabbed
<[k-> ended with .
<[k-> and stuff
<[k-> to increase number of lines and make it harder to read basically
Vile` has quit [Remote host closed the connection]
<nofxx> Ox0dea, cyrillic is a beautiful alphabet too...
<Ox0dea> YIL that Mongolian script is gorgeous.
tkuchiki has quit [Read error: Connection reset by peer]
<zenspider> Ox0dea: ooh. url?
<[k-> zenspider: https://eval.in/392790
htmldrum has quit [Ping timeout: 264 seconds]
Pupeno has joined #ruby
Vile` has joined #ruby
WhitePride has joined #ruby
<WhitePride> hi
<Ox0dea> WhitePride: Bye.
<WhitePride> ?
duoi has joined #ruby
WhitePride has left #ruby [#ruby]
<greenride> Ox0dea: By the way, thanks for the discussion.
<greenride> zenspider: By the way, thanks for the discussion.
<zenspider> n/p
<[k-> zenspider: greenride: I think I gave up after this: https://eval.in/392793
<Ox0dea> greenride: Sure thing. Sorry your idea turned out to be crazier than you might at first assume.
<Ox0dea> Consider switching to a homoiconic language. :)
<zenspider> ... huh. didn't need to: /troll WhitePride
EllisTAA has joined #ruby
<zenspider> ... did the internet just go bizarro?
<zenspider> that script is gorgeous
Pupeno has quit [Remote host closed the connection]
<Ox0dea> It's very pretty. nofxx's mention of Cyrillic brought it to mind, since that's the alphabet they use for transliteration.
Pupeno has joined #ruby
Pupeno has quit [Changing host]
Pupeno has joined #ruby
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<nofxx> Ox0dea, it's rotated? or they write top to down?
<Ox0dea> It's vertical.
<zenspider> gah so pretty
<greenride> [k-: Thanks for the discussion as well. That's a cool little script.
<nofxx> Ox0dea, that's crazy... does html5 support this? vertical input fields haha
tmtwd has quit [Remote host closed the connection]
codecop has joined #ruby
<zenspider> if it support RTL, it better support vertical
<zenspider> or a ~billion ppl will be annoyed
<nofxx> TTB ?
<nofxx> wait... isn't japanese top to bottom to? AND RTL ? hehe
<Ox0dea> nofxx: Modern Japanese is RTL, but not TTB.
<zenspider> all of the above, depending
<Ox0dea> Apparently so.
<Ox0dea> I know I've had highlighting issues on pages containing Japanese text, and I also seem to vaguely recall seeing pages from a Murakami novel being written right-to-left, but LTR is obviously way more common.
<Ox0dea> I thought for the longest that it had something to do with formality.
mike___1234 has quit [Ping timeout: 240 seconds]
Volsus has joined #ruby
sinkensabe has joined #ruby
zacstewart has joined #ruby
xkickflip has quit [Quit: xkickflip]
<[k-> append xs ys = foldr (:) ys xs -- amazeballs
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
Mendenhall has joined #ruby
sinkensabe has quit [Ping timeout: 240 seconds]
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
nullsides has joined #ruby
zacstewart has quit [Ping timeout: 248 seconds]
xkickflip has joined #ruby
fabrice31 has joined #ruby
WhitePride has joined #ruby
<WhitePride> i hate niggers
WhitePride has quit [Quit: Page closed]
<[k-> r00d
fabrice31 has quit [Ping timeout: 260 seconds]
Vile` has quit [Read error: Connection reset by peer]
peter_paule has joined #ruby
tyrbo has joined #ruby
xkickflip has quit [Quit: xkickflip]
bluOxigen has joined #ruby
[k- has quit [Read error: No route to host]
xkickflip has joined #ruby
[k- has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
htmldrum has joined #ruby
tubuliferous_ has joined #ruby
Vile` has joined #ruby
nini1294 has joined #ruby
tyrbo has quit [Ping timeout: 260 seconds]
nini1294 has quit [Client Quit]
mike___1234 has joined #ruby
<zenspider> damnit
<zenspider> I was so ready before
nin1294 has joined #ruby
tubuliferous_ has quit [Ping timeout: 244 seconds]
<zenspider> maybe we should mute all web/freenode logins until they watch a video and answer questions to prove that they're human beings
nin1294 is now known as nini1294
joonty has joined #ruby
peter_paule has quit [Ping timeout: 240 seconds]
j4cknewt has joined #ruby
[k- has quit [Ping timeout: 264 seconds]
bruno- has joined #ruby
araujo has quit [Ping timeout: 240 seconds]
<Ox0dea> I pronounce "damnit" "dam nit" every time.
tjbiddle has quit [Ping timeout: 256 seconds]
araujo has joined #ruby
<Ox0dea> I wonder if any IRCd has CAPTCHA functionality built in.
Aswebb_ has joined #ruby
bluOxigen has quit []
bruno- has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
lxsameer has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
Tristan-Speccy has joined #ruby
Aswebb_ has quit [Ping timeout: 244 seconds]
iateadonut has joined #ruby
tjbiddle has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
armyriad has joined #ruby
greenride has left #ruby [#ruby]
timonv has joined #ruby
xkickflip has quit [Quit: xkickflip]
postmodern has quit [Ping timeout: 256 seconds]
iateadonut has quit [Quit: Leaving.]
pen has quit []
xkickflip has joined #ruby
krz has joined #ruby
baweaver has joined #ruby
peter_paule has joined #ruby
yfeldblu_ has quit [Ping timeout: 248 seconds]
sinkensabe has joined #ruby
roolo has joined #ruby
allomov has joined #ruby
xkickflip has quit [Quit: xkickflip]
DexterLB has quit [Ping timeout: 260 seconds]
xkickflip has joined #ruby
DexterLB has joined #ruby
peter_paule has quit [Ping timeout: 265 seconds]
arooni-mobile has joined #ruby
[k- has joined #ruby
revath has joined #ruby
<[k-> we could have a CaptchaServ
<[k-> :>
tyrbo has joined #ruby
ryba has quit [Ping timeout: 250 seconds]
_ht has joined #ruby
kidoz_ has quit [Quit: Ухожу я от вас]
Musashi007 has joined #ruby
galeido has joined #ruby
Alina-malina has joined #ruby
relix has joined #ruby
acke has joined #ruby
<Ox0dea> Is there anything even vaguely resembling something which might be called IRCQL?
<[k-> QL?
yfeldblum has joined #ruby
<Ox0dea> I'm thinking along the lines of "foo@bar" denoting foo's addressing bar, and maybe "foo+bar" to denote foo and bar speaking in succession.
<Ox0dea> [k-: Query Language.
<Ox0dea> Like SQL for IRC.
<wasamasa> aha
<Ox0dea> I'm considering writing an interactive log exploration... thingy.
<[k-> if you might have noticed, I'm very poor at addressing people
<Ox0dea> [k-: I have noticed that, and you shouldn't do that. :P
<Ox0dea> You're going to get lost in so many of my search results.
<[k-> I have deduced that it is the reason why people don't listen
<[k-> lol
bubbys has joined #ruby
<Ox0dea> Something, something, bystander effect. Something else, "you in the blue shirt!".
<[k-> ! me?
<Ox0dea> Singling people out has a way of forcing them to stop being a bystander.
<[k-> it's much harder to address people on phone
<Ox0dea> And even harder to tell what color shirt they're wearing.
arturmartins has joined #ruby
<[k-> in other news what is seq
veduardo has joined #ruby
<Ox0dea> Sequence?
<[k-> as in how do we use it
<Ox0dea> You'll have to clarify the context.
<[k-> the forcing of evaluation of thunks
tyrbo has quit []
<Ox0dea> Oh, you're learning Clojure?
<[k-> no, Haskell has it too
Mendenhall has quit [Ping timeout: 244 seconds]
<Ox0dea> Right, it's really just an abstraction over iterable things.
<Ox0dea> Ruby's Enumerator::Lazy, more or less.
<[k-> seq forces evaluation
<Ox0dea> >> (1..Float::INFINITY).lazy.select(&:even?).take(10).force
<ruboto> Ox0dea # => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] (https://eval.in/401116)
<[k-> hmm
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Muhannad has quit [Ping timeout: 244 seconds]
Ilyas has joined #ruby
DoubleMalt has joined #ruby
kies^ has quit [Ping timeout: 252 seconds]
peter_paule has joined #ruby
celly has joined #ruby
relix has joined #ruby
Soda has joined #ruby
arooni-mobile has quit [Ping timeout: 248 seconds]
peter_paule has quit [Ping timeout: 244 seconds]
celly has quit [Ping timeout: 248 seconds]
phutchins has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
veduardo has quit [Ping timeout: 256 seconds]
pwnz0r has quit [Remote host closed the connection]
phutchins has quit [Ping timeout: 256 seconds]
Bloodshot has quit [Ping timeout: 248 seconds]
Violentr has joined #ruby
vickleton has joined #ruby
Pupeno has quit [Quit: Leaving...]
Pupeno has joined #ruby
j4cknewt has quit [Remote host closed the connection]
<Ox0dea> [k-: Still about?
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k-> I think I found out how to use seq
<[k-> that example in the book confused me
<[k-> chained x y z = x `seq` y `seq` someFunc z
baweaver has quit [Remote host closed the connection]
<Ox0dea> That won't be overly enlightening, but it demonstrates the surface view of Ruby's "thunks".
revath has quit [Quit: Leaving.]
krz has quit [Quit: WeeChat 1.0.1]
revath has joined #ruby
<[k-> totally enlightening!
<[k-> ./s
<[k-> that isn't related!
joonty has quit [Quit: joonty]
<[k-> or I can't make the connection :s
krz has joined #ruby
timonv has quit [Ping timeout: 244 seconds]
<Ox0dea> A thunk, in a nutshell, is a delayed computation.
peter_paule has joined #ruby
<Ox0dea> Ruby's Enumerator::Lazy remembers the methods you called on its instances, but doesn't actually execute them until you force it to, at which point it's able to prune the (potentially infinite) result set down to something more concrete.
<[k-> I was confused because the example I gave didn't make use of x and y :s
veduardo has joined #ruby
relix has quit [Quit: Textual IRC Client: www.textualapp.com]
Jackneill has joined #ruby
dubkoidragon has joined #ruby
<dubkoidragon> hello my rubyrific friends!
<Ox0dea> dubkoidragon: Tell us of your travels.
<dubkoidragon> just got home from a night out on the town
<dubkoidragon> feeling good
<dubkoidragon> doing some rubying now
<Ox0dea> That last part sounds particularly Rubyrific; tell us more about that one.
<dubkoidragon> I will be doing a quick tutorial on blocks, procs, and lambdas. I assume theyll be quite similar to pythons lamdbas, but I havent heard of procs, so will be good to know the syntax
ohaibbq has quit [Remote host closed the connection]
kraljev11 has joined #ruby
<[k-> the reason why they are grouped together is because they are mostly the same
<dubkoidragon> ok I see, yah I know about blocks, and labdas, but no idea what this proc thign is, but I will in a couple mins
_blizzy_ has quit [Ping timeout: 255 seconds]
tubuliferous_ has joined #ruby
veduardo has quit [Ping timeout: 240 seconds]
Volsus has quit [Ping timeout: 248 seconds]
<Ox0dea> [k-: Where's the block?
<dubkoidragon> I'm checking out the site right now
<[k-> how do you even print the block
<DexterLB> hmm, the first time you start the ruby interpreter it's slow (about 3-4 seconds). Every subsequent time is a lot faster - why is that?
fabrice31 has joined #ruby
<Ox0dea> DexterLB: In a word, caching.
<dubkoidragon> I do not know
<Ox0dea> [k-: Blocks come into methods as Procs.
<Ox0dea> DexterLB: You should find that that's the case for many prorams you run, at least near to boot time.
tubuliferous_ has quit [Ping timeout: 248 seconds]
<Ox0dea> 3-4 seconds is rather excessive, though.
<DexterLB> Ox0dea: ah, you mean the standard memory caching performed by the OS?
<Ox0dea> DexterLB: There's all sorts of caching going on, but yes, mostly that one.
rubie has joined #ruby
<dubkoidragon> so blocks go into methods as procs
<dubkoidragon> why
<zenspider> DexterLB: windows?
revath has quit [Read error: Connection reset by peer]
<[k-> Ox0dea, lies
<zenspider> 3-4 seconds is super duper slow
<DexterLB> zenspider: nope, linux
<[k-> you have to &block
<Ox0dea> [k-: No, you don't.
<[k-> when you do that, it is converted to a proc!
<zenspider> DexterLB: `gem list | wc -l`
revath has joined #ruby
<DexterLB> zenspider: lol, shit.
konsolebox has quit [Quit: Leaving]
<DexterLB> zenspider: thanks
<zenspider> _maybe_ related... not necessarily
<zenspider> run it, tell me the number
<DexterLB> 86
<zenspider> that's not that high
<DexterLB> it's a lot
<zenspider> nah
fabrice31 has quit [Ping timeout: 248 seconds]
<zenspider> not 3-4 seconds high
<zenspider> unless you're running on a floppy
<Ox0dea> [k-: Every method receives an implicit block if one isn't explicitly provided, and every method's block is accessible via Proc.new/proc when called without an explicit block; &block just lets you name the thing if you so choose.
<Ox0dea> >> def foo; proc[1, 2] end; foo { |a, b| a + b }
<ruboto> Ox0dea # => 3 (https://eval.in/401120)
<[k-> that is obviously converting it to a proc
<Ox0dea> [k-: Blocks are one of the few things that aren't actual Objects in Ruby.
Violentr has quit [Ping timeout: 252 seconds]
<Ox0dea> They *must* be converted to Procs for you to use them.
<zenspider> huh. I had no idea
<Ox0dea> zenspider: You lie.
<zenspider> Ox0dea: no, they MUST not
<zenspider> yield
<[k-> ^
rubie has quit [Ping timeout: 265 seconds]
<Ox0dea> s/use/manipulate/, then.
<[k-> which was why you can't print a block!
<Ox0dea> I'm sure it could technically be done.
GarethAdams has quit [Ping timeout: 256 seconds]
krz has quit [Ping timeout: 260 seconds]
<zenspider> Blocks _are_ "actual Objects".... &b assigns it to a name. therefore first class object
Aswebb_ has joined #ruby
<[k-> looking back, using was was a good idea
<dubkoidragon> what do you mean by cant prnit a block so like cant print this : 5.times {|x| x**2}
<dubkoidragon> i might be way off im just trying ot learn
<zenspider> no, I think they mean .... print out the code or somethnig
<[k-> (and converts it to a proc)
<Ox0dea> zenspider: What is the class of a block?
<dubkoidragon> oh
<zenspider> blocks and procs are really the same thing. one is just syntactic sugar
<Ox0dea> How do I get the object_id of a block?
<[k-> I mean this
krz has joined #ruby
<zenspider> Ox0dea: #object_id
yeticry has quit [Quit: leaving]
<[k-> blocks aren't procs at first!
<[k-> only when you convert it
<Ox0dea> And then it's not a block.
<Ox0dea> I think it's disingenuous to so thoroughly conflate the two.
<zenspider> [k-: honestly? that's probably just some wierd historical bullshit. it's gone through so much manipulation over the years
<zenspider> Ox0dea: I disagree
<Ox0dea> zenspider: I can call a method with n Procs, but only one block; they are obviously not the same thing.
Blaguvest has quit [Remote host closed the connection]
<zenspider> that isn't obvious at all. nor proof.
fantazo has joined #ruby
<Ox0dea> Do you even LSP?
<zenspider> one is syntactic sugar for the other. that's it.
<[k-> if you would look at <source that I am trying to remember>
fantazo has quit [Remote host closed the connection]
<zenspider> just like: f { ... } vs f(&block) ? same thing.
<[k-> zenspider, no, &block has overhead
<[k-> it converts the block to a proc
<zenspider> other way around in this case
Aswebb_ has quit [Ping timeout: 246 seconds]
<Ox0dea> zenspider: When else does conversion take place between two things that are the same?
<zenspider> dubkoidragon: the big difference between a python lambda and a ruby lambda is that in ruby there isn't the language distinction between an expression and a statement. your blocks/procs in ruby can be as complex as you want
bertro has joined #ruby
<zenspider> in python, you can only have an expression in the lambda
revath has quit [Read error: Connection reset by peer]
<zenspider> Ox0dea: I don't understand your question
GarethAdams has joined #ruby
<[k-> how do you search reddit
<zenspider> poorly
<zenspider> tho the search engine seems to have improved a bit
<Ox0dea> [k-: Google + site:reddit.com is better than "native".
revath has joined #ruby
<zenspider> you can now get semi-reliable searches if you limit it to the subreddit
<zenspider> which is harder to do with google
AlexRussia has quit [Quit: WeeChat 1.3-dev]
<Ox0dea> site:reddit.com/r/foo works fine.
thomasvm has joined #ruby
arup_r has quit [Ping timeout: 244 seconds]
leat has joined #ruby
bodgix has joined #ruby
<dubkoidragon> what does .to_a do again
<zenspider> calls the method to_a on an object
<[k-> I'm pretty bad at remembering
<zenspider> [k-: me too! we're so alike
<[k-> usually to_a converts the object to an array
<zenspider> dubkoidragon: aka, depends on what object it is called on
The_Phoenix has quit [Read error: Connection reset by peer]
<[k-> zenspider, by alike, you mean you write ugly code too? :)!
<dubkoidragon> oh I thought it would be an answer simple like to_sym changes it to a sybol
<dubkoidragon> \but i see its not
<Ox0dea> dubkoidragon: It is.
<dubkoidragon> ok so whats it do again
<zenspider> .to_sym calls to_sym on an object. depends on what object
AlexRussia has joined #ruby
Yiota has joined #ruby
leat4 has quit [Ping timeout: 264 seconds]
<jhass> well, to_sym is a method too, I could do class Foo; def to_sym; "I'm a teapot"; end; end and nobody would stop me
ndrei has quit [Ping timeout: 260 seconds]
<Ox0dea> dubkoidragon: This is the price paid for ill-conceived questions.
<dubkoidragon> (1..100).to_a.select(&multiples_of_3)
<dubkoidragon> whats to_A do
<dubkoidragon> a**
<zenspider> .xyz just means "sends the message xyz to the reciever" what happens after that is entirely dependent upon the reciever
<[k-> OK I give up, I need to narrow my unknowns first
<jhass> dubkoidragon: do you have irb or pry?
<[k-> what is the site that also documents Ruby and starts with o
<dubkoidragon> i dont know what those things are
<Ox0dea> [k-: Omniref.
<[k-> they look at the source of Ruby too
<[k-> YES!
<[k-> THATS IT
<zenspider> haha
<zenspider> that's how my indexer works too...
<jhass> dubkoidragon: type irb into your command line
<zenspider> "you know... that thing! it starts with a u"
<jhass> then type (1..100).to_a
<zenspider> sometimes I can even dual index the suffix and still be just as lost
<dubkoidragon> like in mcd??
<dubkoidragon> cmd
<jhass> uh, windows...
<dubkoidragon> yea
<jhass> I hope yes :P
<[k-> zenspider ^
<dubkoidragon> but why what am i doing?
<Ox0dea> We all thought you were trying to learn Ruby.
<dubkoidragon> i meant with the ird thing
<jhass> irb
<jhass> try it
<dubkoidragon> ok
<zenspider> [k-: yup. some syntax has overhead. your point?
thomasvm_ has joined #ruby
statu has quit [Ping timeout: 255 seconds]
<Ox0dea> > syntax overhead
<dubkoidragon> irb(main):001:0
<dubkoidragon> thats whati t says
<jhass> great
<jhass> now (1..100).to_a
<zenspider> start with 2 + 3
revath has quit [Read error: Connection reset by peer]
<[k-> it's not only syntax overhead
<[k-> read the whole thing
thomasvm_ has quit [Read error: Connection reset by peer]
<[k-> there's a second paet
<[k-> part*
<zenspider> I've _implemented_ this
<dubkoidragon> it counted to a hundred
revath has joined #ruby
<Ox0dea> dubkoidragon: Well, there it is! to_a counts to a hundred.
<dubkoidragon> yeah
<dubkoidragon> that was awsome
<dubkoidragon> that actually explained it good, then you can call a proc on that
thomasvm has quit [Ping timeout: 246 seconds]
<zenspider> I'm surprised it's still as bad as it is... I thought 1.9+ did a lot of improvement to blocks/procs
lolmaus has quit [Ping timeout: 244 seconds]
<dubkoidragon> ok so next question i guess what is this irb thing i went into
<zenspider> dubkoidragon: you're not calling a proc on anything... you're sending the message select and passing it a block/proc to filter
<dubkoidragon> oh
<Ox0dea> Which... calls the Proc for every element in the collection.
lolmaus has joined #ruby
<dubkoidragon> ok cool
joonty has joined #ruby
<dubkoidragon> whats the irb menu for?
leat has quit [Remote host closed the connection]
leat has joined #ruby
<[k-> lel, there it is! to_a counts to a hundred
krz has quit [Ping timeout: 240 seconds]
<Ox0dea> dubkoidragon: irb is pronounced like "herb"; the irb menu is to be consulted when you're unsure which spices go best with a given dish.
<zenspider> [k-: look at the numbers for jruby, only 1.3x. speed differences are just implementation details.
tobacco_joe has joined #ruby
<dubkoidragon> ok cool, and how can I get back out of it and into my ruby folder
<[k-> the implementation differs, so they aren't the same!
<zenspider> exit or ... maybe cntrl d
<zenspider> I dunno about cmd
<Ox0dea> Ctrl-Z.
<[k-> exit, quit, etc
Mon_Ouie has joined #ruby
<[k-> irb has those methods defined
<[k-> exit is a Kernel method tho
<zenspider> etc?
<dubkoidragon> exit works
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<[k-> etc is obviously not a method!
<zenspider> nothing is obvious with ruby
<Ox0dea> zenspider: Thread.main.kill?
<zenspider> dunno why irb defined quit
<zenspider> hah. they define their own exit and quit
<[k-> because quit is what other repls do?
<zenspider> and... oddly... irb_quit
<[k-> in Haskell, :quit
arup_r has joined #ruby
<[k-> in vim, :quit
<[k-> etc
Yiota has joined #ruby
<zenspider> vim != repl. besides :q :P
codecop has quit [Remote host closed the connection]
nini1294 has quit [Ping timeout: 240 seconds]
postmodern has joined #ruby
<zenspider> and python? needs the parens.. hah
<zenspider> I always just close stdin w/ ^d
<zenspider> >>> quit
<zenspider> Use quit() or Ctrl-D (i.e. EOF) to exit
<ruboto> zenspider # => /tmp/execpad-ea983eb34158/source-ea983eb34158:2: syntax error, unexpected '>' ...check link for more (https://eval.in/401131)
joonty has quit [Quit: joonty]
<zenspider> oops. sorry ruboto
<Ox0dea> I did the same damned thing recently.
<zenspider> maybe ruboto should know that if there are 3 chevrons it should eval in python
jamesaxl|2 is now known as jamesaxl
<zenspider> what could go wrong?
<Ox0dea> apeiros: ^
nofxx has quit [Ping timeout: 240 seconds]
<[k-> syntax errors?
<Ox0dea> And then maybe two leading semicola for Scheme evaluation.
<[k-> and a lambda for haskell
<[k-> I need to add a lambda to my keyboard first, of course
<jhass> why not brainfuck for three >>> and interpret them as part of the program already?
lolmaus has quit [Read error: Connection reset by peer]
lolmaus has joined #ruby
revath has quit [Quit: Leaving.]
acke has quit [Remote host closed the connection]
<Ox0dea> [k-: Ctrl-g for Greek.
revath has joined #ruby
spider-mario has joined #ruby
_ixti_ has joined #ruby
<[k-> Ctrl does not exist on my keyboard :(
nini1294 has joined #ruby
leat has quit [Remote host closed the connection]
leat has joined #ruby
troulouliou_div2 has joined #ruby
krz has joined #ruby
lkba has joined #ruby
tkuchiki has joined #ruby
krz has quit [Read error: Connection reset by peer]
zz_Outlastsheep is now known as Outlastsheep
fantazo has joined #ruby
<zenspider> gotta stop using typewriters
lessless has joined #ruby
tkuchiki has quit [Ping timeout: 265 seconds]
revath has quit [Ping timeout: 244 seconds]
ruurd has joined #ruby
<[k-> I do not use a typewriter!
troulouliou_div2 has quit [Ping timeout: 244 seconds]
<Ox0dea> [k-: Your MacBook's keyboard really doesn't have a Ctrl key?
<[k-> I'm on my phone!
<Ox0dea> Oh, right. :/
Musashi007 has quit [Quit: Musashi007]
Silox| has joined #ruby
troulouliou_div2 has joined #ruby
benlovell has joined #ruby
<Silox|> Are there any gems providing numpy array support to ruby?
<[k-> when I see numpy and Ruby in the same sentence I feel sad
<[k-> is shevy here?
zacstewart has joined #ruby
krz has joined #ruby
kfpratt has quit [Remote host closed the connection]
<Silox|> [k-: I tried to look for alternatives but there just don't seem decent (and non-experimental) packages out there
<Silox|> there's NArray which is still experimental, and then you have ScuRuby's nmatrix which relies on BLAS/LAPACK
<arup_r> shevy, Hi
<arup_r> Aww! all are calling shevy
<[k-> pretty much why I feel sad
benlovell has quit [Ping timeout: 264 seconds]
<Silox|> I'm thinking about putting up a Python Flask API to communicate between my ruby "front end" and the Python processing backend now :c
<Ox0dea> :C
Aym_C has joined #ruby
<[k-> Ox0dea, quick, do something!
<Ox0dea> But Silox| is considering doing the right thing. :/
jbw_ has joined #ruby
<[k-> at least still rubying
<zenspider> I don't think narray is considered experimental
pandaant has joined #ruby
jbw__ has quit [Ping timeout: 255 seconds]
<zenspider> but I wouldn't say it makes up for numpy
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Silox|> Can NArrays get passed through FFI to a C library though?
Alayde has quit [Read error: Connection reset by peer]
Alayde has joined #ruby
zacstewart has quit [Remote host closed the connection]
pandaant has quit [Remote host closed the connection]
Mekkis has quit [Max SendQ exceeded]
Mekkis has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
bruno- has joined #ruby
_blizzy_ has joined #ruby
bruno- is now known as Guest62155
<dubkoidragon> hey guys, my head's really hurting. I'm going to go get some sleep, but tommorrow I will be on again for sure, learning classes. Thanks for your help today, it was very helpful. good night :)
Musashi007 has joined #ruby
quimrstorres has joined #ruby
celly has joined #ruby
<[k-> he doesn't drink water!
<[k-> You need to give him your wonderful advice, Ox0dea!
Yiota has joined #ruby
nini1294 has quit [Ping timeout: 260 seconds]
Guest62155 has quit [Ping timeout: 252 seconds]
Yiota has quit [Client Quit]
bodgix has quit [Read error: Connection reset by peer]
statu has joined #ruby
<statu> hi!
bodgix has joined #ruby
<[k-> hello
<statu> I am looking for a gem to access to a API server that returns some JSON data. Any suggestion?
_blizzy_ has quit [Read error: Connection reset by peer]
lolmaus has quit [Quit: Konversation terminated!]
<[k-> JSON
celly has quit [Ping timeout: 248 seconds]
<Silox|> statu: Don't look into 1 solution, use something like HTTParty to do the requests and as [k- said, use JSON to translate the content of the response body
ruurd has quit [Quit: ZZZzzz…]
bodgix has quit [Client Quit]
<statu> Silox|: [k- thanks you!! I am very new (1 day xD) in ruby and I don't know the ecosystem yet
<Silox|> xD
_blizzy_ has joined #ruby
Yiota has joined #ruby
<arup_r> Ox0dea, my Php to Ruby integration is finished successfully..:)
<Ox0dea> arup_r: Oh?!
<Ox0dea> Well done.
<arup_r> thanks to you guys also
Yiota has quit [Client Quit]
<[k-> Ox0dea: (I am very new in Ruby) in ruby
<[k-> no quotes!
tkuchiki has joined #ruby
<Ox0dea> That's syntactically valid Scheme and Ruby. :)
<Ox0dea> Ah, shit, it's not, because `in`.
<[k-> in Ruby pls
<Ox0dea> >> def method_missing(*) end; Ruby = "<3"; (I am very new to Ruby)
<ruboto> Ox0dea # => nil (https://eval.in/401134)
Yiota has joined #ruby
<[k-> :>
Musashi007 has quit [Quit: Musashi007]
mike___1234 has quit [Ping timeout: 244 seconds]
<[k-> I am very new in Ruby, libobf style
<[k-> or no alphanum
whiteline_ is now known as whiteline
<[k-> I(am(very(new(to(Ruby should return "welcome!"
<[k-> Reddit upgraded its ui!
<Silox|> no way
<[k-> totally nicer!
<Silox|> That's on mobile though
<[k-> *Reddit mobile
jamesaxl has quit [Ping timeout: 246 seconds]
ndrei has joined #ruby
mike___1234 has joined #ruby
<[k-> I'm so downloading omniref browser plugin
<Silox|> I just realised that I don't actually need super fast serialisation of my array data... I'll just go with Marshal and FFI and see how fast it is
htmldrum has quit [Ping timeout: 246 seconds]
mandarinkin has quit [Ping timeout: 246 seconds]
acke has joined #ruby
jbw__ has joined #ruby
bruno-_ has joined #ruby
jbw_ has quit [Ping timeout: 256 seconds]
astrobunny has quit [Read error: Connection reset by peer]
<Ox0dea> >> 'foo'[/(o+)/]; [$1, $1.upcase!, $1]
<ruboto> Ox0dea # => ["oo", "OO", "oo"] (https://eval.in/401135)
<Ox0dea> Bug?
ruurd has joined #ruby
astrobunny has joined #ruby
acke has quit [Ping timeout: 264 seconds]
<[k-> >> $1 = 'TEST'
<ruboto> [k- # => /tmp/execpad-ad551d5c0c68/source-ad551d5c0c68:2: Can't set variable $1 (https://eval.in/401136)
<Ox0dea> But then #upcase! ought to warn about that.
jbw_ has joined #ruby
TinkerTyper has quit [Ping timeout: 260 seconds]
jbw__ has quit [Ping timeout: 244 seconds]
<[k-> ask omniref!
<[k-> we should make it a thing!
Outlastsheep is now known as zz_Outlastsheep
mhib has joined #ruby
<[k-> >> 'foo'[/(o+)/]; [$1, $1[0]=?&, $1]
<ruboto> [k- # => ["oo", "&", "oo"] (https://eval.in/401137)
yfeldblum has quit [Ping timeout: 248 seconds]
tubuliferous_ has joined #ruby
roolo_ has joined #ruby
kraljev11 has quit [Quit: kraljev11]
_blizzy_ has quit [Ping timeout: 255 seconds]
roolo has quit [Ping timeout: 252 seconds]
tubuliferous_ has quit [Ping timeout: 244 seconds]
rubie has joined #ruby
sdothum has joined #ruby
Axy has joined #ruby
cornerman has quit [Quit: leaving]
_ixti_ has quit [Quit: WeeChat 1.2]
<krz> when executing User. i want to display something else. which is the method i need to implement? is this to_s?
<krz> User is a class
<Ox0dea> krz: You want instances of User to display differently, yes?
Mia has quit [Ping timeout: 246 seconds]
quimrstorres has quit [Remote host closed the connection]
rubie has quit [Ping timeout: 265 seconds]
<krz> Ox0dea: yea
<[k-> krz, your phrasing is unclear
schaerli has joined #ruby
<Ox0dea> krz: Redefine #inspect for printing, and #to_s for string interpolation.
<krz> ty Ox0dea
<Ox0dea> Sure thing.
mandarinkin has joined #ruby
<[k-> you shouldn't redefine inspect
Aswebb_ has joined #ruby
<[k-> it has everything you could possibly need
nettoweb has joined #ruby
<krz> yea probably just to_s
<krz> i believe rails does this too with their Models
<Ox0dea> krz: #inspect is for when your object is given to Kernel.p, but the default does indeed provide all the information you should need.
<Ox0dea> Class, address in memory, instance variables.
nettoweb has quit [Client Quit]
<Ox0dea> #to_s for puts, print, and interpolation.
revath has joined #ruby
<Ox0dea> And then #to_str for when your object needs to be coerced to a string, but that's rare.
jbw__ has joined #ruby
schaerli has quit [Remote host closed the connection]
jbw_ has quit [Ping timeout: 244 seconds]
<Ox0dea> [k-: Should Ruby warn us for redefining #inspect? :P
zacstewart has joined #ruby
<[k-> to_str calls to_s by default or is it the other way round
<[k-> Ox0dea, yes, because I was stupid enough to redefine inspect
<[k-> my github still has that library >.>
zdf has joined #ruby
Aswebb_ has quit [Ping timeout: 264 seconds]
<Ox0dea> String and NameError are the only classes with #to_str defined by default, but it does delegate to #to_s for the former.
sonOfRa has quit [Quit: Bye!]
PhantomS_ has quit []
sonOfRa has joined #ruby
jbw__ has quit [Ping timeout: 256 seconds]
jbw__ has joined #ruby
zacstewart has quit [Ping timeout: 264 seconds]
tno has joined #ruby
isxek has joined #ruby
matcouto has joined #ruby
jamesaxl has joined #ruby
tsvenson has quit [Quit: Leaving]
tsvenson has joined #ruby
ryba has joined #ruby
<shevy> [k- I was asleep, the heatwave is knocking me out
sevenseacat has joined #ruby
linuxboytoo has quit [Remote host closed the connection]
cornerman has joined #ruby
linuxboytoo has joined #ruby
<[k-> I thought only the cold puts people to sleep
tsvenson_ has joined #ruby
cornerman has quit [Client Quit]
<jhass> nah, humans turn the brain off in all kind of emergency situations
[k-_ has joined #ruby
cornerman has joined #ruby
yqt has joined #ruby
<[k-_> do we need chanserv repeating the topic
nini1294 has joined #ruby
<jhass> yeah
cornerman has quit [Client Quit]
<jhass> people still don't read it but it increases the chances
Soda has quit [Remote host closed the connection]
symm- has joined #ruby
isxek is now known as acl_
linuxboytoo has quit [Ping timeout: 252 seconds]
cornerman has joined #ruby
cornerman has quit [Read error: Connection reset by peer]
<[k-> how about delaying it for 40s and prefixing their nick with it
cornerman has joined #ruby
<jhass> that's not how it works
cornerman has quit [Read error: Connection reset by peer]
<jhass> chanserv sends it only to you, not the channel
bruno-_ has quit [Ping timeout: 244 seconds]
tsvenson_ has quit [Quit: Ex-Chat]
<[k-> I know that
postmodern has quit [Quit: Leaving]
<[k-> but delaying the notice makes it more noticeable after a stream of messages from the motd
<jhass> send a patch to atheme
<[k-> :(
arturmartins has quit [Quit: Leaving...]
phutchins has joined #ruby
bodzio has joined #ruby
<Ox0dea> I finally got to use the two-argument form of Hash#fetch_values.
bodgix has joined #ruby
pandaant has joined #ruby
bodzio is now known as bodgix_wrk
bodgix is now known as bodzio
<[k-_> i know what is atheme .__.
segfalt has joined #ruby
jbw_ has joined #ruby
djbkd_ has joined #ruby
bodzio has quit [Quit: Leaving.]
bodgix has joined #ruby
railsraider has joined #ruby
bodgix has quit [Client Quit]
jbw__ has quit [Ping timeout: 264 seconds]
bodgix_wrk has left #ruby [#ruby]
carlosoliveira has quit [Quit: Connection closed for inactivity]
allcentury has joined #ruby
bodgix has joined #ruby
acke has joined #ruby
kidoz has joined #ruby
dimasg has joined #ruby
bodgix is now known as bodzio
jbw__ has joined #ruby
dtcristo has joined #ruby
jbw_ has quit [Ping timeout: 246 seconds]
mistermocha has joined #ruby
Aym_C has quit [Remote host closed the connection]
hahuang65 has quit [Quit: WeeChat 1.2]
acke has quit [Ping timeout: 244 seconds]
lxsameer has quit [Remote host closed the connection]
dfockler has joined #ruby
lxsameer has joined #ruby
peter_paule has quit [Ping timeout: 244 seconds]
_blizzy_ has joined #ruby
ruurd has quit [Ping timeout: 265 seconds]
DEA7TH_ has joined #ruby
ruurd has joined #ruby
dfockler has quit [Ping timeout: 252 seconds]
lxsameer has quit [Remote host closed the connection]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
FernandoBasso has joined #ruby
_blizzy_ has joined #ruby
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Node1 has joined #ruby
<Node1> Hi
Node1 is now known as l0oky
dorei has joined #ruby
<l0oky> >> puts "test string".parameterize
<ruboto> l0oky # => undefined method `parameterize' for "test string":String (NoMethodError) ...check link for more (https://eval.in/401154)
celly has joined #ruby
<Ox0dea> l0oky: Maybe #rubyonrails' bot includes ActiveSupport::Inflector.
<l0oky> Ox0dea: Yeah I thought so. Thanks for the heads up.
<[k-_> why are you doing it here :(
<Ox0dea> [k-_: pry is expensive these days.
celly has quit [Ping timeout: 248 seconds]
_blizzy_ has quit [Read error: Connection reset by peer]
<Ox0dea> Given that some people "half-use" it, we can assume the number of users must be fractional. Thus, if nobody used pry, at its current cost of 0, total expenses would be:
<Ox0dea> >> 0 / 0.0
<ruboto> Ox0dea # => NaN (https://eval.in/401156)
<[k-_> unfathomable!
<Ox0dea> Incalculable!
<[k-_> >> 1.0/0.0
<ruboto> [k-_ # => Infinity (https://eval.in/401157)
l0oky has quit [Ping timeout: 246 seconds]
krz has quit [Read error: Connection reset by peer]
mistermocha has quit [Remote host closed the connection]
zacstewart has joined #ruby
<Ox0dea> Ah, true; pry does cost one `gem` invocation.
iateadonut has joined #ruby
stamina has joined #ruby
dtcristo has quit [Quit: Textual IRC Client: www.textualapp.com]
nfk has joined #ruby
Pupeno has quit [Remote host closed the connection]
dtcristo has joined #ruby
Papierkorb has joined #ruby
mary5030 has joined #ruby
zacstewart has quit [Ping timeout: 244 seconds]
dimasg has quit [Ping timeout: 244 seconds]
Aym_C has joined #ruby
Pupeno has joined #ruby
lkba_ has joined #ruby
railsraider_ has joined #ruby
<[k-_> :o now i am on my computer
<[k-_> i am in a position of submiting patches
<[k-_> s/now/now that
njection has quit [Ping timeout: 248 seconds]
Pupeno has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
bronson has joined #ruby
lkba has quit [Ping timeout: 265 seconds]
railsraider has quit [Ping timeout: 240 seconds]
railsraider_ is now known as railsraider
symm- has quit [Ping timeout: 256 seconds]
<[k-_> s/ith/it h
<mikecmpbll> is there a circular list structure in ruby?
cats has joined #ruby
<[k-_> you mean a linked list?
<mikecmpbll> sure
<arup_r> no builtin mikecmpbll I think,, :)
<mikecmpbll> arup_r: ok :)
<arup_r> we have only Queue
davedev24 has joined #ruby
Unicorn| has joined #ruby
bruno- has joined #ruby
<mikecmpbll> basically wanna be able to have a list of elements, and for a user to pass in an element and i want to iterate over every other element starting with the one they pass in, so [1,2,3,4] with 3 would iterate [3,4,1,2].
<mikecmpbll> i could hack something up but wondering if i was missing something elegant :0
sarkyniin has joined #ruby
jdeen has joined #ruby
bronson has quit [Ping timeout: 260 seconds]
dtcristo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sarkyniin has quit [Client Quit]
<[k-_> Array#rotate
<mikecmpbll> an array that would iterate circularly forever would be the simplest because i can just break when i meet the same element :)
<mikecmpbll> ooh.
sarkyniin has joined #ruby
<[k-_> yw
<mikecmpbll> that's the ticket
<mikecmpbll> cheers [k-_ !
serivich has joined #ruby
mxrguspxrt has joined #ruby
havenwood has joined #ruby
<mikecmpbll> >> a = [1,2,3,4]; a.rotate(a.index(3))
<ruboto> mikecmpbll # => [3, 4, 1, 2] (https://eval.in/401177)
<mikecmpbll> awesome.
nini1294 has quit [Quit: nini1294]
bruno- has quit [Ping timeout: 244 seconds]
<Mon_Ouie> By the way "iterating circularly forever" also exists (Enumerable#cycle)
jdeen has quit [Ping timeout: 252 seconds]
<Ox0dea> [k-_: What needs patching in rb_mod_eqq()?
<[k-_> the documentation
<Ox0dea> It is indeed rather misleading.
keen__________25 has joined #ruby
<Ox0dea> Wait, is it?
jdeen has joined #ruby
keen__________24 has quit [Ping timeout: 252 seconds]
<[k-_> jhass also said that it is misleading
mary5030 has quit [Remote host closed the connection]
<[k-_> jhass opinion = win
davedev24 has quit [Ping timeout: 248 seconds]
bodzio has quit [Quit: Leaving.]
<Ox0dea> With what did he say he took issue?
cornerman has joined #ruby
mary5030 has joined #ruby
sarkyniin has quit [Ping timeout: 246 seconds]
<Mon_Ouie> Is rb_mod_eqq Module#===?
<[k-_> yes
cornerman has quit [Remote host closed the connection]
cornerman has joined #ruby
<Mon_Ouie> Ox0dea: It could be parsed as saying "Returns true if obj is (an instance of mod) or (one of mod's descendants)
<Mon_Ouie> Instead of "Returns true if obj is an instance of (mod or one of mod's descendants)
<[k-_> thats totally what i understood it as
tubuliferous_ has joined #ruby
cornerman has quit [Client Quit]
cornerman has joined #ruby
<[k-_> where is object.c >:(
dtcristo has joined #ruby
<Ox0dea> [k-_: You... linked to it?
mary5030 has quit [Ping timeout: 248 seconds]
symm- has joined #ruby
FernandoBasso has quit [Quit: May the force be with you.]
dgutierrez1287 has joined #ruby
<[k-_> :o there is only one o*.c in ruby
<[k-_> i kept missing it >.<
davedev24 has joined #ruby
tubuliferous_ has quit [Ping timeout: 255 seconds]
<[k-_> tada
rubie has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k-_> i must ping shevy about this
<[k-_> he will be happy
bruno- has joined #ruby
<shevy> wat
kfpratt has joined #ruby
<[k-_> i contributed to ruby!
<shevy> well that is just documentation
<shevy> you improved the documentation by 0.00000000241%
<[k-_> you didnt contribute to ruby >.>
<ddv> aww
yqt has quit [Ping timeout: 256 seconds]
rubie has quit [Ping timeout: 265 seconds]
Tristan-Speccy has quit [Ping timeout: 248 seconds]
<[k-_> >> 0.00000000241%
<ruboto> [k-_ # => /tmp/execpad-39d104817ce9/source-39d104817ce9:3: syntax error, unexpected keyword_rescue ...check link for more (https://eval.in/401178)
<[k-_> >> 0.00000000241
<ruboto> [k-_ # => 2.41e-09 (https://eval.in/401179)
<[k-_> look, ruby knows the notation!
jazz has joined #ruby
<[k-_> what do we call that notation again?
jazz is now known as vimz
<[k-_> ah yes, standard form + 3 significant figures
<[k-_> i was going to do 0.00000000241 > 0 but we all know that is true
zz_Outlastsheep is now known as Outlastsheep
Aswebb_ has joined #ruby
<vimz> is anyone prepared to explain procs to a n00b? Slowly. :P https://gist.github.com/anonymous/2b6369fea84ae625c9bb
<Ox0dea> >> [1e-323 > 0, 1e-324 > 0]
<ruboto> Ox0dea # => [true, false] (https://eval.in/401181)
<[k-_> vimz: your block is converted to a proc implicitly when you have block as an explicit argument
<vimz> [k- okay, that clears it up a bit. And a proc is just a portable, executable snippet of code?
allcentury has quit [Ping timeout: 250 seconds]
nateberkopec has joined #ruby
<[k-_> a portable, executable snippet of code would be xslt!
<[k-_> you should use &block tho, it makes it more explicit that the method expects a proc
ni886105 has joined #ruby
<vimz> [k- okay...what is a proc then? if not a portable snippet of code?
<Mon_Ouie> foo(&x) calls x.to_proc (unless x is nil) to obtain a Proc object, and passes that Proc object as a block argument to the foo method
<Mon_Ouie> What are you calling "portable"?
sarkyniin has joined #ruby
<[k-_> do you know a symbol turns into a proc?
<vimz> Mon_Ouie nice. By portable I mean you can pass it into methods.
<[k-_> >> &:itself
<ruboto> [k-_ # => /tmp/execpad-46bed3509f76/source-46bed3509f76:2: syntax error, unexpected & ...check link for more (https://eval.in/401193)
<[k-_> >> :itself.to_proc
<ruboto> [k-_ # => #<Proc:0x40cf0388> (https://eval.in/401194)
<[k-_> ruby is so awkward when & only works in certain places
<vimz> But why do we want to turn these arguments into procs?
<vimz> [k- haha no worries
<[k-_> i see you use tabs
Silox| has quit [Quit: Connection closed for inactivity]
djbkd_ has quit [Remote host closed the connection]
djbkd_ has joined #ruby
<[k-_> i dont use rspec and i dont know how the magic works
FernandoBasso has joined #ruby
<[k-_> so i dont follow the flow of the code :/
<[k-_> also, you need to use good english to make your questions clear and easy to understand :/
fabrice31 has joined #ruby
schaerli has joined #ruby
djbkd_ has quit [Ping timeout: 240 seconds]
endash has joined #ruby
ni886105 has left #ruby [#ruby]
jaygen_ has joined #ruby
nfk has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 250 seconds]
schaerli has quit [Remote host closed the connection]
jaygen has quit [Ping timeout: 244 seconds]
rippa has joined #ruby
<Ox0dea> [k-_: Noel Rappin would like some of your time: https://speakerdeck.com/noelrap/rspec-it-isnt-actually-magic
<vimz> Ox0dea haha yes not magic I am told
<[k-_> sorry i'm not willing to spend that time :s
nateberkopec has quit [Quit: Leaving...]
<[k-_> read yes, presentation no
<vimz> [k- what part of my English tripped you up?
lxsameer has quit [Quit: Leaving]
<[k-_> i forgot
<[k-_> i threw a whole mess of errors and gave up
<havenwood> +1 magic
<havenwood> Minitest! \o/
segfalt has quit [Quit: segfalt]
chouhoulis has joined #ruby
barkerd427 is now known as zz_barkerd427
<[k-_> i never wrote tests :>
zz_barkerd427 is now known as barkerd427
<[k-_> except for finishing_moves
<[k-_> if i didnt write it i would feel wrong
dtcristo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k-_> welp, today 40% of the time was me, 40% of the time was Ox0dea, 7% of the time was zenspider, the rest for ther rest
ZYPP is now known as hool
<havenwood> [k-_: The other 13%?
<havenwood> [k-_: I demand answers!
<[k-_> did i miss 13%?
lorikeet has joined #ruby
<havenwood> [k-_: You did.
<[k-_> oh
<[k-_> welp, today 46% of the time was me, 44% of the time was Ox0dea, 7% of the time was zenspider, 3% for the rest
* [k-_ notes the lack of adaedra today
<Ox0dea> He popped in for a little bit.
<Ox0dea> We could find out exactly when if somebody'd help me flesh out IRCQL.
<[k-_> sorry, i dont do -QL
<[k-_> i went to irclog.whitequark.org/ruby/ and ctrl+f adaedra
<Ox0dea> Fucking neanderthal.
hool is now known as ZYPP
<[k-_> :(
<Ox0dea> Says the guy wanting to write an interactive log viewer for the terminal. :P
<[k-_> i dont keep logs in the first place
<Ox0dea> You compute weird.
iateadonut has quit [Quit: Leaving.]
<[k-_> compute what
ruurd has quit [Read error: Connection reset by peer]
<Ox0dea> "Compute" here meaning "use your computers".
ruurd_ has joined #ruby
<[k-_> i dont keep logs, what do you want me to do
ruurd_ has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
<[k-_> Ox0dea: do you want a git branch graph
<shevy> I also don't keep logs \o/
<[k-_> those are fun!
<[k-_> i also don't keep logs is almost singlish!
asmodlol has joined #ruby
tmtwd has joined #ruby
<[k-_> my fingers are fragile and clumsy
<[k-_> vim is difficult
kfpratt has quit [Remote host closed the connection]
Spami has joined #ruby
<Ox0dea> [k-_: Do :nmap <Up> <NOP>, and likewise for the other arrow keys.
<Ox0dea> Same for :imap, while you're at it. :)
<Ox0dea> You'll eventually thank yourself for doing it.
<[k-_> i am in lesson 2 of vim tutor
<Ox0dea> I'll do it along with you. :P
<[k-_> and i do not know what is nmap, <NOP>, etc
<[k-_> not lesson 2, sorry, lesson 1.2
<Ox0dea> Right, sorry. Jumped the gun there.
sinkensabe has quit []
<Ox0dea> [k-_: <Esc> is actually a really shitty key for how often it's used. You'll want to remap that to something more convenient ASAP.
Marsupermammal has joined #ruby
Feyn has quit [Quit: Leaving]
<[k-_> yeah, it seems so far away
mxrguspxrt has quit [Remote host closed the connection]
<shevy> do it like jhass and switch to sublime :>
exadeci has quit [Quit: Connection closed for inactivity]
<[k-_> i use sublime currently >.>
<Ox0dea> jhass switched from Vim to Sublime?
<zdf> editor war
eGGsha has joined #ruby
<Ox0dea> Scuffle at worst.
<zdf> what about os?
mxrguspxrt has joined #ruby
<[k-_> i use mac os x
<zdf> linux
<Ox0dea> zdf: Which Linux?!
<zdf> ubuntu 14.04
<Ox0dea> How come?
<zdf> ?
<Ox0dea> You can't explain why you chose that distro?
celly has joined #ruby
<zdf> because i haven't mac which i wish i would have one day and don't like windows
<[k-_> vim is nice since it separates inserting and deleting i learnt
<Ox0dea> That does not explain why you chose Ubuntu over every other Linux distribution.
<ddv> Ox0dea: what does it matter to you if he chose Ubuntu, Arch or whatever?
<[k-_> Ox0dea is a strong believer of arch
<Ox0dea> [k-_: Insert mode is for typing text, normal mode is for speaking a text editing language.
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
<zdf> installing rails in ubuntu is easier then fedora
mxrguspx_ has joined #ruby
<zdf> and arch
<Ox0dea> ddv: He started the OS flamewar; I'm just going along with it.
eGGsha is now known as eGGshke
<Ox0dea> zdf: You have never used Arch.
mxrguspxrt has quit [Ping timeout: 240 seconds]
eGGshke has quit [Client Quit]
<shevy> real men compile from source
<zdf> no someone told me there is only terminal window there and rest black also no need of update
<ddv> :/
<zdf> is it true
<Ox0dea> Yeah, it's true.
<ddv> zdf: you are talking out of your butt
bubbys has quit [Ping timeout: 265 seconds]
<Ox0dea> zdf: Even the terminal window is black.
<Ox0dea> Even the text is black!
<shevy> mine is pink
<zdf> cool
<Ox0dea> I have to do all my computing blind.
<ddv> no homo, shevy
<zdf> real hacker
<shevy> hey that is the sailormoon theme ddv!
<ddv> lol
<sevenseacat> installing rails is virtually identical in both ubuntu and fedora.
codecop has joined #ruby
<sevenseacat> if anything, its harder in fedora because you need to install a few extra packages first.
joneshf-laptop has quit [Remote host closed the connection]
howdoi has joined #ruby
<zdf> but i faced some problem in fedora
<ddv> shevy: ur such a nerd
celly has quit [Ping timeout: 250 seconds]
<zdf> correct
<sevenseacat> then you did it wrong.
<[k-_> LESSON 1 complete!
duoi has quit [Remote host closed the connection]
sinkensabe has joined #ruby
<[k-_> Ox0dea uses green text on black
<[k-_> is he a hacker
<zdf> anyway why is installing rails always painfull for beginners?
rubie has joined #ruby
<sevenseacat> its not, if you follow the numerous guides written on the topic.
ZYPP is now known as hool
ruurd_ has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
<zdf> still people face some error
<[k-_> oh i forgot i need to add the tips and tricks thing
<sevenseacat> not if they follow the instructions.
bruno- has quit [Ping timeout: 244 seconds]
<[k-_> i'll do it in vim!
acke has joined #ruby
chinmay_dd has joined #ruby
joneshf-laptop has joined #ruby
<ddv> [k-_: nobody cares that you use vim
<[k-_> yes they do!
<ddv> [k-_: get over it
<Ox0dea> ddv: I care.
<[k-_> :(
<Ox0dea> ddv: Perhaps nobody cares that you don't care?
<ddv> Ox0dea: probably
<Ox0dea> ddv: Then why waste your precious finger bones?
<ddv> Ox0dea: I had to put [k-_ in his place
<Ox0dea> You're going to be arthritic that much sooner because you had to voice your righteous indignation.
eGGsha has joined #ruby
<[k-_> so i deserve no place in ruby...
krz has joined #ruby
<zdf> you can make new chat room for ruby vim
<ddv> lol ^
<ddv> this guy
<zdf> ruby irc is more active irc ever i have seen
<Ox0dea> #archlinux is activer.
<zdf> Ox0dea: r u a hacker
<zdf> ?
<Ox0dea> zdf: You'll need to provide your definition of the term.
n3vtelen_ has quit [Ping timeout: 256 seconds]
<Ox0dea> Have I seen the movie "Hackers"? Yes. Do I use Arch? I do. Have I ever written a line of code in my life? 'Fraid not. :/
<ddv> he hacked the gibson, zdf
<havenwood> zdf: Hacked the Gibson...
<zdf> means software hacker or network hacker
<Ox0dea> zdf: You're still using a term for which you've not provided a definition.
<Ox0dea> Dictionaries don't take kindly to recursion that doesn't eventually terminate.
<zdf> what is gibson
<Ox0dea> No idea. It's my first day on the Internet.
<zdf> i searched and found guitar
<zdf> you r a college guy or professional
<ddv> lol
<[k-_> well i did it twice
mxrguspx_ has quit [Remote host closed the connection]
<Ox0dea> [k-_: vimtutor?
<zdf> m colege guy
<[k-_> README.md
<Ox0dea> What is it you did twice?
<zdf> k: can we use vim for ubuntu
chinmay_dd has quit [Read error: Connection reset by peer]
<[k-_> i had to add the section twice because i was on the wrong branch
sankaber has joined #ruby
Aym_C has quit []
lessless has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<zdf> is there any gsocers
<zdf> ?
<zdf>
Violentr has joined #ruby
<havenwood> zdf: You have an overactive return key.
_blizzy_ has joined #ruby
bubbys has joined #ruby
<havenwood> zdf: Sure, there are a few mentors and mentees around. Unless you mean gangster sorcerers, in which case there are quite a few.
yuuvee has joined #ruby
<zdf> actully i want to participate next time
<havenwood> zdf: Next Spring.
<zdf> needed giudence regarding
desigx has joined #ruby
endash has quit [Quit: endash]
<havenwood> zdf: Talk to use come Spring, once the mentoring orgs are chosen.
<havenwood> us*
<[k-_> gSoC isnt some easy thing :<
<havenwood> zdf: Ruby hasn't been chosen yet for next year, since that decision is in the mysterious future.
<zdf> i guess if i would start from now at least some ground level then it would be good
zacstewart has joined #ruby
<shevy> lol
<shevy> gangster sorcerers
mxrguspxrt has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
endash has joined #ruby
[k-_ has quit [Quit: Lingo: www.lingoirc.com]
chouhoulis has quit [Remote host closed the connection]
<pontiki> gangster sorcerers of ruby?
<Ox0dea> Those are sourcerers, surely.
dimasg has joined #ruby
sarkyniin has quit [Ping timeout: 240 seconds]
zacstewart has quit [Ping timeout: 246 seconds]
<pontiki> indeed
sevenseacat has quit [Quit: Me dun like you no more.]
<[k-> rgsourcerers*
Pupeno has joined #ruby
blue_deref has joined #ruby
joneshf-laptop has quit [Remote host closed the connection]
Outlastsheep is now known as zz_Outlastsheep
NeverDie has joined #ruby
Pupeno has quit [Ping timeout: 246 seconds]
nfk has joined #ruby
zdf has quit [Ping timeout: 246 seconds]
Kalov has quit []
tubuliferous_ has joined #ruby
Rickmasta has quit [Read error: Connection reset by peer]
Rickmasta has joined #ruby
havenwood has quit [Ping timeout: 246 seconds]
athos_diddy has joined #ruby
tubuliferous_ has quit [Ping timeout: 264 seconds]
mxrguspxrt has quit [Remote host closed the connection]
mxrguspxrt has joined #ruby
DEA7TH_ has quit [Quit: DEA7TH_]
havenwood has joined #ruby
mxrguspxrt has quit [Remote host closed the connection]
kj has joined #ruby
htmldrum has joined #ruby
desigx has quit [Ping timeout: 248 seconds]
hool is now known as ZYPP
noname has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
ndrei has joined #ruby
chouhoulis has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yiota has joined #ruby
Mon_Ouie has quit [Ping timeout: 250 seconds]
htmldrum has quit [Ping timeout: 246 seconds]
railsraider has quit [Quit: railsraider]
last_staff has joined #ruby
Gabo has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
tmtwd has quit [Ping timeout: 255 seconds]
j4cknewt has joined #ruby
<Gabo> hello
l0oky has joined #ruby
sarkyniin has joined #ruby
<[k-> # hello
<pontiki> keep your comments to yourself
s00pcan has quit [Ping timeout: 244 seconds]
<[k-> # precisely why I am using comments
<pontiki> heehee
s00pcan has joined #ruby
j4cknewt has quit [Remote host closed the connection]
drewvanstone has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chinmay_dd has joined #ruby
<Ox0dea> =begin
Gabo has quit [Ping timeout: 246 seconds]
j4cknewt has joined #ruby
<[k-> __END__
j4cknewt has quit [Remote host closed the connection]
<[k-> # you will never be able to write Ruby code!
j4cknewt has joined #ruby
* Ox0dea is trying to make WeeChat send EOF.
Soda has joined #ruby
nfk has quit [Remote host closed the connection]
allcentury has joined #ruby
<pontiki> what does that mean on a network connection?
j4cknewt has quit [Ping timeout: 248 seconds]
aryaching has joined #ruby
endash has quit [Quit: endash]
<Ox0dea> Well, it'd come down to the IRC protocol in particular, but I'm reasonably certain it uses a more robust termination signal.
<pontiki> no doubt; "sending EOF" doesn't make sense to me; it's generally just a flag set in the driver on read
jud has joined #ruby
<Ox0dea> pontiki: I meant the character "\x4".
<pontiki> oh, well now i feel stupid
<Ox0dea> I'm just trying to get us out of this DATA!
<Ox0dea> [k-: This is all just going into the ether 'cause of you.
<[k-> # oh well
acl_ has quit [Ping timeout: 246 seconds]
nfk has joined #ruby
l0oky has quit [Ping timeout: 244 seconds]
peter_paule has joined #ruby
zenguy_pc has quit [Read error: Connection reset by peer]
zenguy_pc has joined #ruby
<Ox0dea> 
<[k-> # remote host closed the connection
nfk has quit [Remote host closed the connection]
nfk has joined #ruby
schaerli has joined #ruby
<Ox0dea> I checked the log. I totally sent \x4. :)
<Ox0dea> We're in a new file.
nfk has quit [Remote host closed the connection]
<[k-> # you did not create a new file
<Ox0dea> New files create themselves.
<Ox0dea> That's how the Internet works.
<pontiki> that's why we have to dust and vacuum, to clean up all the old files
<[k-> eval(DATA.read)
<[k-> there, we won't face this issue anymore
acl_ has joined #ruby
timonv has joined #ruby
zacstewart has joined #ruby
<[k-> __END__
<[k-> # if we don't do this DATA wouldn't exist and Ruby will crash
<[k-> # now we all have to type in comments
aphprentice has quit [Remote host closed the connection]
j4cknewt has joined #ruby
amystephen has joined #ruby
chinmay_dd has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
zenguy_pc has quit [Read error: Connection reset by peer]
chinmay_dd has joined #ruby
zenguy_pc has joined #ruby
zacstewart has quit [Ping timeout: 252 seconds]
charliesome has joined #ruby
matti has quit [Quit: Oh dear...]
lanemeyer has joined #ruby
zacstewart has joined #ruby
<[k-> if we crash the ruby interpreter, we wont have to deal with this nonsense
timonv has quit [Ping timeout: 244 seconds]
ndrei has quit [Ping timeout: 240 seconds]
Spami has quit [Quit: This computer has gone to sleep]
ruurd_ has quit [Read error: Connection reset by peer]
kirun has joined #ruby
chinmay_dd_ has joined #ruby
<shevy> DATA is annoying anyway - it should be baseable on the .rb file in question
ruurd has joined #ruby
schaerli has quit [Remote host closed the connection]
chinmay_dd has quit [Ping timeout: 265 seconds]
<Ox0dea> shevy: It should be a global Hash.
<[k-> baseable?
Yiota has joined #ruby
<[k-> I believe it should remain as per-file only
chinmay_dd_ has quit [Remote host closed the connection]
<[k-> encapsulation!
<shevy> [k- if Bush jr. can coin new words, so can I!
Yiota has quit [Client Quit]
<Ox0dea> You can't use the username "man" on GitHub.
s00pcan has quit [Ping timeout: 252 seconds]
<Ox0dea> Somebody phone the Social Justice police.
<[k-> is it taken?
<Ox0dea> No, it's a reserved word.
<[k-> it's likely to be abused anyway
<Ox0dea> How do you abuse a username?
<[k-> you abuse the meaning of the username
s00pcan has joined #ruby
codecop has quit [Remote host closed the connection]
Yiota has joined #ruby
FernandoBasso has quit [Remote host closed the connection]
j4cknewt has quit [Remote host closed the connection]
sepp2k has joined #ruby
j4cknewt has joined #ruby
j4cknewt has quit [Remote host closed the connection]
Papierkorb has joined #ruby
Stratege has joined #ruby
<pontiki> is it a path in https://github.com/man/ or something?
ndrei has joined #ruby
schaerli has joined #ruby
<Ox0dea> pontiki: No, that page is a 404; it's just an explicitly disallowed username.
j4cknewt has joined #ruby
celly has joined #ruby
<Ox0dea> pontiki: Oh, I see how I might've misinterpreted that now, but GitHub's help is on help.github.com, so I don't see why that'd be so.
<pontiki> it is now
j4cknewt has quit [Remote host closed the connection]
l0oky has joined #ruby
dorei has quit [Read error: Connection reset by peer]
<pontiki> anyway
<pontiki> if it's pitchfork and torches time, i'm in!!
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
<Ox0dea> Coraline: We need you!
<pontiki> always up for a good storming of the castle frankenstein
<pontiki> then beer and skittles for afters
mike___1234 has quit [Ping timeout: 244 seconds]
allcentury has quit [Ping timeout: 240 seconds]
<Ox0dea> I like where this is headed.
celly has quit [Ping timeout: 252 seconds]
<[k-> Coraline: did not find consolas on my macbook :(
serivich has quit [Ping timeout: 244 seconds]
bruno- has quit [Ping timeout: 264 seconds]
<[k-> github is made with love in ruby
* pontiki consoles your lack of consolas for your console
<[k-> how can you do this!
cornerma1 has joined #ruby
<Ox0dea> [k-: Is it difficult to install fonts?
<[k-> I doubt github is written in Ruby anymore though
<pontiki> it is
<Ox0dea> [k-: Bits and pieces. Linguist, for instance.
konsolebox has joined #ruby
<pontiki> rails 2 for parts of it, still
<Ox0dea> I don't believe it.
konsolebox has quit [Max SendQ exceeded]
<pontiki> i have friends
<[k-> Ox0dea, no, you just select all the .ttf they give you, double click, and Mac knows what to do
<[k-> it's a painless process
ArchRogem has joined #ruby
l0oky has quit [Ping timeout: 246 seconds]
dorei has joined #ruby
<[k-> pontiki: we all have friends
<pontiki> sorry; i have friends that work at github and this is what they tell me
einarj has joined #ruby
<[k-> probe more
<shevy> [k- everyone abandons ruby in the late stage :<
Spami has joined #ruby
cornerman has quit [Ping timeout: 250 seconds]
chouhoulis has quit [Ping timeout: 264 seconds]
cornerma1 is now known as cornerman
charliesome has quit [Quit: zzz]
nateberkopec has joined #ruby
<[k-> Ruby simply can't keep up
<kj> why shevy?
<[k-> we need to optimise more common idioms
<[k-> 100% of them!
<shevy> dunno, see what [k- wrote above: <[k-> I doubt github is written in Ruby anymore though
<pontiki> you really have to realize github is not one thing
nveselinov has joined #ruby
<Ox0dea> Microservices for days!
<pontiki> parts are written in ruby, parts are written in go, huge parts are written in coffee/javascript
<[k-> so twitter is one thing? :o
<Ox0dea> Is Twitter still Scala?
<pontiki> they probably have parts written in other languages, too
<pontiki> twitter is definitely not one thing
<[k-> but we all know twitter is Scala!
<pontiki> the main messaging service is still scala afaik
s00pcan has quit [Read error: Connection reset by peer]
<pontiki> i don't know anyone who works there anymore
<[k-> anymore :(
mike___1234 has joined #ruby
ArchRogem has quit [Quit: Textual IRC Client: www.textualapp.com]
<[k-> at least github pages is Ruby!
<[k-> I have proof, look!
fenjamin has joined #ruby
<kj> correct
<kj> ruby is loosing its charm bad news..
Marsupermammal has quit [Remote host closed the connection]
<[k-> Ruby is dying is nonsense
<kj> intially twitter used ruby but got converted into scala somewhat is going with git i think
Channel6 has joined #ruby
<fenjamin> i have an output of a .csv file into one array, need nested into 4 elements
htmldrum has joined #ruby
<Ox0dea> fenjamin: Could you clarify?
veduardo has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
weemsledeux has joined #ruby
<[k-> ?wordcrime
<ruboto> I don't know anything about wordcrime
Spami has joined #ruby
<fenjamin> pastie takes a .csv file and returns an array from a row however i need that array nested into 4 elements. [[a,b,c,d],[e,f,g,h],[i,j,k,l],[m,n,o,p]]
tmtwd has joined #ruby
<fenjamin> rather 4 elements per nested array into however many arrays as the dataset.
<[k-> fenjamin: you need to work more on your phrasing :s
htmldrum has quit [Ping timeout: 256 seconds]
htmldrum has joined #ruby
<fenjamin> among problem solving abilities.
<fenjamin> which are correlated quite possibly.
sinkensabe has quit [Remote host closed the connection]
<fenjamin> is it understandable? i have [a,b,c,d,e,f,g,...z] need [[a,b,c,d],[e,f,g,h],[i,j,k,l]. . etc]
<[k-> (I need to have a collection of [arrays of 4 elements] created when I read data from a CSV file)
<[k-> examples are always nice
<shevy> hmm there was a method for that .... was it zip ? hmm or group_by ...
ruurd has quit [Read error: Connection reset by peer]
dimasg has quit [Ping timeout: 260 seconds]
DoubleMalt has quit [Remote host closed the connection]
<[k-> fenjamin: can you show us what the CSV looks like?
modern has quit [Ping timeout: 260 seconds]
joneshf-laptop has joined #ruby
allcentury has joined #ruby
<FenrirReturns> fenjamin: If you already have an array and just want it grouped like the that, check out http://ruby-doc.org/core-2.2.0/Enumerable.html#method-i-each_slice
edwinvdgraaf has joined #ruby
<fenjamin> gracie
<fenjamin> to clarify: i would append this to the .csv parameter?
<fenjamin> foreach('file.csv', headers:true).each_slice(4)
<FenrirReturns> fenjamin: your_array.each_slice(4).to_a should do what you're describing, since Array includes Enumerable and each_slice takes an argument and returned an Enumerable, and that provides to_a
<[k-> I never knew what that method was for ;)
<pontiki> i find it profitable to keep reviewing Enumerable. so many methods...
spider-mario has quit [Read error: Connection reset by peer]
<Ox0dea> >> [1, 2, 3, 4].each_cons(2).to_a
<ruboto> Ox0dea # => [[1, 2], [2, 3], [3, 4]] (https://eval.in/401226)
GitGud has joined #ruby
<[k-> that is different from what he is describing though
araujo has quit [Quit: Leaving]
veduardo has quit [Ping timeout: 240 seconds]
<fenjamin> pontiki: agree FenrirReturns: curious solution - [#<CSV::Row "New York":"Alicia MacLennan" nil:nil
chinmay_dd has joined #ruby
<Ox0dea> [k-: I was just showing off another of Enumerable's lesser-known methods.
<FenrirReturns> @fenjamin that's becuase you're putting the object in the array, not to_s or whatever it is you really want.
GitGud has quit [Client Quit]
htmldrum has quit [Ping timeout: 244 seconds]
<pontiki> #zip is fun, too; i was looking at a chunk of code and was like !OMG! i can use zip here!! (was an each_with_index then using index for another collection)
rubie has quit [Remote host closed the connection]
<Ox0dea> Also, #grep takes an optional block to apply to the results:
<Ox0dea> >> [*?a..?z].grep(/[aeiou]/, &:succ)
<ruboto> Ox0dea # => ["b", "f", "j", "p", "v"] (https://eval.in/401227)
iateadonut has joined #ruby
<fenjamin> brb
fenjamin has quit [Quit: 离开]
dimasg has joined #ruby
tubuliferous_ has joined #ruby
Alina-malina has quit [Ping timeout: 256 seconds]
<[k-> I used Array#rotate to solve the Josephus problem
rubie has joined #ruby
Alina-malina has joined #ruby
schaerli has quit [Remote host closed the connection]
modern has joined #ruby
Silox| has joined #ruby
ttilley has quit [Read error: Connection reset by peer]
jpfuentes2 has joined #ruby
arooni-mobile has joined #ruby
<Ox0dea> [k-: I bet it could be done with a wicked-clever #slice!.
Pupeno has joined #ruby
chinmay_dd has quit [Read error: Connection reset by peer]
tubuliferous_ has quit [Ping timeout: 265 seconds]
<arup_r> why don't we have updated doco for Ruby in this site.. still 2.0.0 http://docs.ruby-lang.org/en/2.0.0/Hash.html :)
<pontiki> any reason you don't use the new doc?
Alina-malina has quit [Ping timeout: 264 seconds]
<pontiki> why would new docs be written in an old path?
<arup_r> I googled hash and it came first
<arup_r> so got curious why not updated
<Ox0dea> arup_r: Because it's been moved: http://ruby-doc.org/core-2.2.2/Hash.html
<arup_r> ooo
<arup_r> not aware of
<pontiki> google is not always your friend
<Ox0dea> It learns, though.
ndrei has quit [Ping timeout: 252 seconds]
<pontiki> sometimes
<arup_r> one link is old and another is updated.. I thought both are same
rudak__ has joined #ruby
<[k-> google should show the magic links
Pupeno has quit [Ping timeout: 244 seconds]
weemsledeux has quit [Ping timeout: 252 seconds]
tsvenson has quit [Ping timeout: 248 seconds]
htmldrum has joined #ruby
tsvenson has joined #ruby
iateadonut has quit [Quit: Leaving.]
freerobby has quit [Quit: Leaving.]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kies^ has joined #ruby
<pontiki> i just pin this in a tab on chrome: http://ruby-doc.org/core-2.2.2/
yardenbar has quit [Quit: Leaving]
Alina-malina has joined #ruby
wpp has joined #ruby
j4cknewt has joined #ruby
centrx has joined #ruby
centrx has quit [Remote host closed the connection]
centrx has joined #ruby
jpfuentes2 has joined #ruby
tsvenson has quit [Ping timeout: 244 seconds]
chipotle has joined #ruby
kj has quit [Quit: Page closed]
<shevy> long live firefox! \o/
jack_rabbit has quit [Ping timeout: 248 seconds]
<arup_r> shevy, I am done.. but got another.. :(
<shevy> more php? you are a poor person
celly has joined #ruby
<arup_r> o^o ........ hummmmmmm
<shevy> the only rewrites I have to do are from my old code... which is more than enough torture as is
<[k-> reject their demands
<shevy> the more code, the harder it gets to manage it :(
<[k-> i bet shevy uses 1.8.7
<arup_r> I can't reject... :/ I have to
<arup_r> but after converting it to Ruby the code looks like `gal`.. really.. :)
tsvenson has joined #ruby
<[k-> get a php dev in
<[k-> and tell him to write Ruby
<[k-> you will have done him and the world a favor
toretore has joined #ruby
chouhoulis has joined #ruby
fantazo has quit [Quit: Verlassend]
lele is now known as Guest24
ne1l has joined #ruby
celly has quit []
CloCkWeRX1 has quit [Quit: Leaving.]
<[k-> I expect by 2016 that the number of users would have increased by 1%
chouhoulis has quit [Ping timeout: 250 seconds]
<[k-> I call this the k's law
arup_r has quit [Quit: Leaving]
lavros has quit [Quit: leaving]
<shevy> [k- I see that you have not been long on #ruby as otherwise you would know that I am on ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
arup_r has joined #ruby
<[k-> lies, you definitely only write legacy Ruby
tsvenson has quit [Ping timeout: 244 seconds]
<Ox0dea> shevy: Still?!
<[k-> how many users do we have now
Casty has joined #ruby
<shevy> what do you mean with still
<[k-> Ox0dea is on 2.3
<Ox0dea> [k-: 2**10-1
<shevy> that is not an official ruby
<[k-> I mean #ruby
<shevy> ftp://ftp.ruby-lang.org/pub/ruby/
pothibo has joined #ruby
<[k-> obviously Ox0dea has means to access 2.3
<Ox0dea> As does everyone else?
<shevy> totally useless
dgutierrez1287 has joined #ruby
<Ox0dea> shevy: Then why do you follow the ChangeLog?
<Ox0dea> What do you stand to gain?
<[k-> useless?
<shevy> to have a look at what is upcoming
<[k-> yeah, he follows it a lot
<Ox0dea> shevy: But why not wait until you can actually use it?
<shevy> to then digest xxxxx information when I can digest x information before?
DEA7TH_ has joined #ruby
<[k-> he pings me every time he looks at it :/
<shevy> [k- no worries! no more pings for you in regards to the changelog
DEA7TH_ has quit [Read error: Connection reset by peer]
<[k-> I don't read the changelog, I don't know how to
mxrguspxrt has joined #ruby
DEA7TH_ has joined #ruby
Violentr has quit [Ping timeout: 244 seconds]
tsvenson has joined #ruby
dgutierrez1287 has quit [Ping timeout: 264 seconds]
niemcu has joined #ruby
<arup_r> how you guys declared default value for Hash, I don't like my approach.. :/
lorikeet has quit [Ping timeout: 248 seconds]
stamina has quit [Quit: WeeChat 1.2]
<Ox0dea> arup_r: What do you think is bad about it?
mistermocha has joined #ruby
<pontiki> i think that's perfectly fine
<Ox0dea> The only sane alternative would be foo = Hash.new('bar'), followed by a bunch of foo['x'] = 'y', which is hardly an improvement.
drewvanstone has quit [Ping timeout: 248 seconds]
<arup_r> it seems like.. I'm doing something twice.. I went with Hash.new { } syntax.. but with that also I need to do twice.. I am thinking if I can do it in a single definition..
tobacco_joe has quit []
arooni-mobile has quit [Ping timeout: 248 seconds]
<pontiki> you're not repeating your self, if that's your concern
<arup_r> as you guys support .. I will go with my code.. I was just curious to see if any improvement is possible
sinkensabe has joined #ruby
<Ox0dea> arup_r: You can get quite fancy with Hash.new, but not when your data is completely static.
<arup_r> Yes.. I have static data
mistermocha has quit [Remote host closed the connection]
<Ox0dea> arup_r: No sense in complicating things, then.
<Ox0dea> >> foo = Hash.new { |h, k| h[k] = Hash.new &h.default_proc }; foo[1][2][3][4][5]; foo
<ruboto> Ox0dea # => {1=>{2=>{3=>{4=>{5=>{}}}}}} (https://eval.in/401242)
<Ox0dea> Autovivification will always be my favorite Hash trick.
pothibo has quit [Quit: pothibo]
peter_paule has quit [Ping timeout: 255 seconds]
endash has joined #ruby
kies^ has quit [Ping timeout: 240 seconds]
arooni-mobile has joined #ruby
<arup_r> one more thing.. just wanted to know.. Do you people write STATUS_CODE or StatusCode ? which one Ruby community follow ?
<arup_r> while declaring constants
<Ox0dea> I think SCREAMING_SNAKE_CASE is, as the name might imply, unnecessarily noise, but it's the most common style.
<Ox0dea> *noisy
zenguy_pc has quit [Read error: Connection reset by peer]
<arup_r> ok..
sinkensabe has quit [Ping timeout: 264 seconds]
<centrx> MULTIWORD_CONSTANTS_ARE_NAMED_LIKE_THIS
<Ox0dea> But only because tradition.
zenguy_pc has joined #ruby
<centrx> Also because it's the best way
<centrx> All the other options are taken. Something has to be all-caps
fabrice31 has joined #ruby
marr has joined #ruby
<Ox0dea> centrx: Because we have to differentiate between constants and modules at the syntactic level?
<centrx> yeah they're very different
zr2d2 has joined #ruby
<centrx> methods and variables have the same naming style though
<centrx> but methods often have (params)
<centrx> and that's Ruby-specific, calling methods without ()
tkuchiki has quit [Remote host closed the connection]
<Ox0dea> centrx: I was being facetious; Ruby gives us the ability to determine that something is a class irrespective of its name.
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<centrx> Ruby gives us the ability to determine what a method or variable does irrespective of its name
<centrx> myvar1, myvar2, myvar3
<centrx> names are helpful
<centrx> humans
<Ox0dea> Sure, but how has that anything to do with capitalization?
fabrice31 has quit [Ping timeout: 260 seconds]
<centrx> It's faster to see that a particular name is a class/module, or variable, or method, or constant
<centrx> Ruby could remove the starts-with-caps-is-a-constant
<centrx> or it could add all-caps-means-constant and is unmodifiable
<arup_r> ^^ true
<pontiki> it's all about how you wish to communicate to your team mates, now and in the future. i.e., it's a human communication thing
<pontiki> which is what coding standards are for
<Ox0dea> >> Complex.constants(false)
<ruboto> Ox0dea # => [:compatible, :I] (https://eval.in/401244)
Yiota has joined #ruby
<centrx> >> RUBY_VERSION
<ruboto> centrx # => "2.2.0" (https://eval.in/401245)
therealfibonacci has joined #ruby
<Ox0dea> 21>> Complex.constants(false)
<ruboto> Ox0dea # => [:compatible, :I] (https://eval.in/401246)
<Ox0dea> centrx: Or were you not checking which version of Ruby has a non-capitalized constant?
<centrx> I don't have this Complex::compatible in my Ruby
<centrx> What is it?
<Ox0dea> It's a secret constant.
<Ox0dea> For internal use only.
<Ox0dea> It's probably a bug that it shows up in #constants, to be honest.
kies^ has joined #ruby
<Ox0dea> There are loads of internal instance variables with no leading @ that get hidden in #instance_variables.
Yiota has quit [Client Quit]
<Ox0dea> *hidden from
ndrei has joined #ruby
<Ox0dea> I patched my local Ruby to get at them: https://gist.github.com/0x0dea/7d288ea71387856b4330
AlphaAtom has joined #ruby
Yiota has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
poguez_ has joined #ruby
<Ox0dea> That's pretty much the sanest way to implement Enumerator::Lazy, but I enjoyed seeing it first-hand.
<livcd_> guys what's your opinion about eloquent ruby book ?
<Ox0dea> livcd_: It's great. Go read it.
<Ox0dea> (Really.)
peter_paule has joined #ruby
<ljarvis> yeah it's a decent book
<pontiki> a classic, but not in the Twain sense of classic
<livcd_> i like how you had to add that no-irony disclaimer :D
<ljarvis> Anything is better than the Pickaxe
<Ox0dea> ljarvis: Metaprogramming Ruby 2?
TinkerTyper has joined #ruby
<ljarvis> Ox0dea: Haven't read it
Spami has quit [Quit: This computer has gone to sleep]
<pontiki> i've read version 1, haven't gotten to read 2 yet
zenguy_pc has quit [Read error: Connection reset by peer]
leat has quit [Remote host closed the connection]
zenguy_pc has joined #ruby
Mia has joined #ruby
leat has joined #ruby
icebourg has joined #ruby
<pontiki> i really enjoyed it, even if most of it isn't directly applicable to the sort of work i end up doing
<pontiki> it was really informative
<livcd_> pontiki: you are talking about what book now ?
<pontiki> Metaprogramming Ruby (1 or 2)
<livcd_> ah
zenguy_pc has quit [Read error: Connection reset by peer]
<pontiki> i wouldn't disrecommend the new pickaxe book, but it's far more of a reference, and you can get all the info online easily anyway
totimkopf has joined #ruby
zenguy_pc has joined #ruby
<pontiki> there are lots of good ruby books out there
<pontiki> don't limit yourself to one!
Axy has quit [Ping timeout: 265 seconds]
Spami has joined #ruby
baweaver has joined #ruby
hanmac has quit [Quit: Leaving.]
hanmac has joined #ruby
darkf has quit [Quit: Leaving]
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<Ox0dea> Unless that one is _wPGtR.
peter_paule has quit [Ping timeout: 264 seconds]
zenguy_pc has quit [Read error: Connection reset by peer]
peelback has joined #ruby
drewo has joined #ruby
<pontiki> i've never more than glanced at it, so i wouldn't know
zenguy_pc has joined #ruby
<livcd_> pfff dollar is so strong
<livcd_> err euro is so weak..this is going to be expensive :S
zenguy_pc has quit [Read error: Connection reset by peer]
zenguy_pc has joined #ruby
momomomomo has joined #ruby
lkba_ has quit [Ping timeout: 256 seconds]
eGGsha has joined #ruby
<livcd_> i need to practice focusing while reading
schaerli has joined #ruby
nettoweb has joined #ruby
<livcd_> i tend to automatically skip the boring parts
<livcd_> and then i miss all of the nuances :S...anybody has a similar issue ?
schaerli has quit [Remote host closed the connection]
chouhoulis has joined #ruby
momomomomo has quit [Quit: momomomomo]
MasterPiece has joined #ruby
schaerli has joined #ruby
htmldrum has quit [Ping timeout: 264 seconds]
<therealfibonacci> livcd_ same here
nettoweb has quit [Client Quit]
drewo has quit [Ping timeout: 240 seconds]
zenguy_pc has quit [Read error: Connection reset by peer]
zenguy_pc has joined #ruby
arooni-mobile has quit [Ping timeout: 248 seconds]
chouhoulis has quit [Ping timeout: 244 seconds]
schaerli has quit [Ping timeout: 246 seconds]
Unicorn| has quit [Quit: Connection closed for inactivity]
Spami has quit [Quit: This computer has gone to sleep]
_blizzy_ has quit [Ping timeout: 246 seconds]
rubie has quit [Remote host closed the connection]
blue_deref has quit [Quit: bbn]
zenguy_pc has quit [Read error: Connection reset by peer]
zenguy_pc has joined #ruby
zenguy_pc has quit [Read error: Connection reset by peer]
t_ has joined #ruby
zenguy_pc has joined #ruby
pandaant has quit [Remote host closed the connection]
Violentr has joined #ruby
CorySimmons has joined #ruby
Cust0sLim3n has quit [Ping timeout: 264 seconds]
pocketprotector has quit [Ping timeout: 240 seconds]
DLSteve has joined #ruby
freezevee has joined #ruby
<freezevee> hi all
<freezevee> I am trying to read a binary file and count the bits
yeticry has joined #ruby
<Ox0dea> freezevee: Sounds like a blast! How far've you gotten?
<freezevee> I have opened the file and read each_byte, then I do .to_s(2).count('1')
workmad3 has joined #ruby
charliesome has joined #ruby
<freezevee> Ox0dea: I have read the bits from a 4.5Mb file and it does 3.5seconds
peelback has quit [Ping timeout: 256 seconds]
<Ox0dea> That seems rather slow.
<freezevee> you think so ?
orbitalo has quit [Remote host closed the connection]
<Ox0dea> Yeah, it's not great, but this is Ruby. :P
<freezevee> I initially scanned the file and converted each byte to bits, then it tool 10 minutes
Kalov has joined #ruby
<Ox0dea> freezevee: You must've been doing that very wrongly.
<freezevee> and I am trying to decrease the time... so far I've gone from 4.5s to 3.5s
nveselinov has quit [Quit: Connection closed for inactivity]
<freezevee> Ox0dea: I have two questions - first, If to_s(2) does the right thing and then what about unpack ?
lkba has joined #ruby
<freezevee> Ox0dea: probably when you do 8.to_s(2) must be 00001000
<Ox0dea> Yes, that's right.
icebourg has quit []
<Ox0dea> Well...
<Ox0dea> >> 8.to_s(2)
<ruboto> Ox0dea # => "1000" (https://eval.in/401248)
<freezevee> Ox0dea: why '8'.unpack('b*') is wrong ?
<Ox0dea> As you can see, it doesn't bother with padding, but that doesn't matter for popcount.
Rickmasta has quit [Ping timeout: 244 seconds]
<freezevee> sure
peelback has joined #ruby
<Ox0dea> '8' the string != 8 the number.
<Ox0dea> >> "\x8".unpack('b*')
<ruboto> Ox0dea # => ["00010000"] (https://eval.in/401249)
<freezevee> why ?
<freezevee> why \x8 ?
lordkryss has joined #ruby
<Ox0dea> freezevee: Hm, do you know about ASCII?
<freezevee> I know that each character has its own ascii value in the ascii table
<Ox0dea> freezevee: Yes, that's right, and "\x8" just gets you the character at ASCII value 8.
<Ox0dea> It's a hexadecimal escape.
tubuliferous_ has joined #ruby
endash has quit [Quit: endash]
<Ox0dea> So, since 'a' is ASCII 97, we can convert that to hexadecimal 61, and then:
<Ox0dea> >> "\x61"
<ruboto> Ox0dea # => "a" (https://eval.in/401250)
Mendenhall has joined #ruby
<Ox0dea> >> "\x61".unpack('B*').to_i(2)
<ruboto> Ox0dea # => undefined method `to_i' for ["01100001"]:Array (NoMethodError) ...check link for more (https://eval.in/401251)
<Ox0dea> >> "\x61".unpack('B*')[0].to_i(2)
<ruboto> Ox0dea # => 97 (https://eval.in/401252)
<freezevee> what is the deal with unpack ?
CorySimmons has quit [Quit: Bye!]
<Ox0dea> It takes the string and "breaks it up" according to the format specifier.
<freezevee> so you have to pass a string
<Ox0dea> Yes, and the format can get rather complex.
<Ox0dea> For the simple case of converting character values to 8-bit binary, 'B*' is sufficient.
rubie has joined #ruby
ohaibbq has joined #ruby
<freezevee> Ox0dea: https://gist.github.com/chrisvel/3bc37acc1c1371039e2f this is my code
jpfuentes2 has joined #ruby
<freezevee> Ox0dea: I am creating a lookup table with bytes and arrays with the amount of [0,1] bits
<Ox0dea> freezevee: That looks pretty involved for such a simple operation. :/
tubuliferous_ has quit [Ping timeout: 248 seconds]
<freezevee> I tried to create some kind of "lookup table" in order to speed things up
pocketprotector has joined #ruby
bubbys has quit [Ping timeout: 250 seconds]
<freezevee> so I don't have to count the bits
<freezevee> each time
htmldrum has joined #ruby
bubbys has joined #ruby
gamename has quit []
<freezevee> so If I read 23 123 11 234 22 111 from the file, then I call hblt[23] and automatically I get the array of counted '1's and '0'
<freezevee> I have to do this as an exercise so please, don't give me a solution
<Ox0dea> freezevee: Why an array and not just how many 1s there are?
codecop has joined #ruby
codecop_ has joined #ruby
<freezevee> but I'd appreaciate If you tell me what I am doing wrong
<freezevee> Ox0dea: because I want the '0's also
<Ox0dea> freezevee: Well, you should strive to make your lookup table as simple (and thus fast) as possible.
<freezevee> I think it's called population count
<Ox0dea> Yes, that's right.
<Ox0dea> But you can get the numeber of 0s simply by subtracting the number of 1s from the total number of characters * 8, right at the end.
<Ox0dea> You get the number of 0s "for free".
<Ox0dea> Do you see what I mean?
<freezevee> Ox0dea: that's what I am doing
<freezevee> actually in that case I should count the number of bytes
<freezevee> hmmm
hectortrope has quit [Remote host closed the connection]
Rickmasta has joined #ruby
<freezevee> Right now I have an image with Size: 4409.817Kb
<Ox0dea> freezevee: You also get that "for free" via `file.stat.size`. :)
<freezevee> so it's 4409817 kilobytes = 35278536
<freezevee> 35278536 bits
<Ox0dea> Why these specifics?
<freezevee> so If I get the '1's = 18211764 you say I could just substract them to get the '0's
<freezevee> sorry for the specific information
zenguy_pc has quit [Read error: Connection reset by peer]
<Ox0dea> No worries; I see now why you went there.
Aswebb_ has quit [Read error: Connection reset by peer]
<Ox0dea> If you've got a bunch of bits, which can only be 0 or 1, and you know how many are 1, subtraction gets you how many are 0.
<freezevee> I see
zenguy_pc has joined #ruby
<Ox0dea> Given that you know how many bits you had to start with, of course, which you can easily obtain.
arooni-mobile has joined #ruby
axl_ has joined #ruby
<freezevee> do you think it's going to get less time ?
zenguy_pc has quit [Read error: Connection reset by peer]
<freezevee> so I don't need a lookup table ?
<freezevee> I didn't think about it
axl_ has quit [Client Quit]
zenguy_pc has joined #ruby
axl_ has joined #ruby
axl_ has left #ruby [#ruby]
<Ox0dea> freezevee: A lookup table from {0=>0, 1=>1, 2=>1, 3=>2, 4=>1, ...} would certainly gain you some speed over doing to_s(2).count('1') on every single byte, absolutely.
<freezevee> I see
<freezevee> let me check it
workmad3 has quit [Ping timeout: 256 seconds]
zenguy_pc has quit [Read error: Connection reset by peer]
EllisTAA has joined #ruby
zenguy_pc has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Pupeno has joined #ruby
zenguy_pc has quit [Read error: Connection reset by peer]
zenguy_pc has joined #ruby
Aswebb_ has joined #ruby
bruno- has joined #ruby
zenguy_pc has quit [Read error: Connection reset by peer]
valetudo has quit [Read error: Connection reset by peer]
phroa has joined #ruby
mike___1234 has quit [Ping timeout: 256 seconds]
<freezevee> Ox0dea: I believe I did it
<freezevee> Ox0dea: 0m0.723s !!!!
<freezevee> but I somehow must find out If it's right
<freezevee> the number of bits in total
<Ox0dea> freezevee: Not bad.
<Ox0dea> freezevee: Well, you know the file's size in bytes, don't you?
<freezevee> I love it
<freezevee> yeah
<Ox0dea> And how many bits in a byte?
<freezevee> usually 8 lol
<Ox0dea> Well, it's not the 1970s anymore. :P
Pupeno has quit [Ping timeout: 244 seconds]
<freezevee> you mean to just multiply and double check with the size in bytes ?
athos_diddy has quit []
<Ox0dea> freezevee: You want to verify that your answer is correct, yes?
<freezevee> true
<Ox0dea> Are you on Windows?
havenwood has quit [Quit: Textual IRC Client: www.textualapp.com]
<freezevee> OSX
<shevy> windows users are dying out like the dodo
mike___1234 has joined #ruby
peter_paule has joined #ruby
<freezevee> Ox0dea: would you write tests for a function like that ?
<freezevee> Ox0dea: is there any meaning in it ?
devbug has joined #ruby
Tritone has quit [Remote host closed the connection]
<Ox0dea> freezevee: Well, I was going to suggest using either `od` or `xxd` to validate your results, but the former doesn't print binary and the latter doesn't print binary without also outputting address columns. :/
<Ox0dea> freezevee: I mean, you want to know you've written a correct method, don't you?
<freezevee> of course
<Ox0dea> At the very least, test it on simple inputs whose answers you know to be correct (even if that means hand validation).
<freezevee> like ?
<Ox0dea> freezevee: The string "abc"?
Yiota has joined #ruby
<freezevee> Ox0dea: should I write a test with RSpec for that case ?
<Ox0dea> freezevee: Maybe take this opportunity to explore the space a bit and find the one you like best.
<Ox0dea> test/unit, minitest, and rspec are all nice and not in their own ways.
<Ox0dea> freezevee: If you were asking whether you should write a spec to verify that your code works for something as simple as "abc", then definitely yes.
<Ox0dea> "Fail early" so you can get back to fixing things ASAP.
<freezevee> I mean it's pretty simple, does it make sense to write a test ?
radialneon has joined #ruby
<Ox0dea> Yes, it makes sense to write a test.
<Ox0dea> If only to get into the habit of the thing.
<freezevee> and test what? it's a simple function that takes files as attributes
<Ox0dea> Test that it's correct...
bruno- has quit [Ping timeout: 255 seconds]
<freezevee> ok I see
Yiota has quit [Client Quit]
<Ox0dea> You want to be able to prove that your code does what you say/think it does.
mike___1234 has quit [Ping timeout: 260 seconds]
<Ox0dea> Even, and indeed especially after you've made some minor improvement which you think couldn't possibly affect the result.
jenrzzz has joined #ruby
Volsus has joined #ruby
htmldrum has quit [Ping timeout: 244 seconds]
arooni-mobile has quit [Ping timeout: 248 seconds]
NeverDie has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
spider-mario has joined #ruby
peter_paule has quit [Ping timeout: 248 seconds]
jpfuentes2 has joined #ruby
<freezevee> Ox0dea: it's pretty awesome
<Ox0dea> freezevee: Shall we compare answers?
<freezevee> it does 0m0.758s for a file 110Mb
lorn has joined #ruby
<freezevee> I can't believe it
gamename has joined #ruby
mike___1234 has joined #ruby
einarj has quit [Remote host closed the connection]
timonv has joined #ruby
<phroa> Hey there. I'm writing a script that at one point executes `./configure --with-some-options'. Problem being, the options I pass appear to be ignored. Here's what I've tried and what breaks: https://gist.github.com/anonymous/51144060a5dba330f2a5
<phroa> as far as I know, that's correct syntax/usage. Any other details that would be helpful?
Silox| has quit [Quit: Connection closed for inactivity]
shinnya has quit [Ping timeout: 250 seconds]
<Ox0dea> phroa: You're on the right track with `system *command`.
<Ox0dea> phroa: Rename "command" to "options". :)
yqt has joined #ruby
Carnage\ has joined #ruby
revath has quit [Ping timeout: 244 seconds]
<phroa> would it seriously work, or is that just better variable naming? :P
<Ox0dea> phroa: No, there's one last piece to the puzzle before it would work as you'd like.
j4cknewt has quit [Remote host closed the connection]
<Ox0dea> phroa: Erm, wait; I might be derping.
icebourg has joined #ruby
<Ox0dea> phroa: Yeah, either of your approaches really ought to work. :/
<Ox0dea> Are you sure you're not generating syntax errors in your interpolations?
<phroa> I'm totally stumped. I copy the generated command and run it in a shell and it works :/
<phroa> Ox0dea: puts output in array form and array.join form: https://gist.github.com/anonymous/e78a4893926b601e7678
pandaant has joined #ruby
nateberkopec has quit [Quit: Leaving...]
<phroa> which I can directly run
jdeen has quit [Quit: Lost terminal]
<Ox0dea> ++stumped :<
<phroa> the output is actually `puts %x[echo #{command.join ' '}]' -- so obviously ruby knows there's a command there
yqt has quit [Ping timeout: 252 seconds]
serivich has joined #ruby
<phroa> I've been banging my head against the wall on this for the past four days at work
<phroa> every time I fix one issue another doubly hard one crops up with this damn program
Pupeno has joined #ruby
Yiota has joined #ruby
Carnage\ has quit []
<phroa> on ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
<Ox0dea> phroa: This'll sound a little silly, but what happens if you write your command out to some file foo, then `sh foo`?
<phroa> that does sound silly :P one sec
lkba_ has joined #ruby
<Ox0dea> That is, %x(sh foo), to clarify.
bashusr has quit [Ping timeout: 244 seconds]
<phroa> yep
l0oky has joined #ruby
mxrguspxrt has quit []
<phroa> errors out
<phroa> `cat foo' shows the proper command though
<phroa> if I run `sh foo' in a terminal it works
lkba has quit [Ping timeout: 246 seconds]
<phroa> I'm not going nuts, right? this should work?
<phroa> %x[echo #{command.join ' '} > foo]
<phroa> %x[sh foo]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bashusr has joined #ruby
timonv has quit [Ping timeout: 244 seconds]
yqt has joined #ruby
<phroa> I certainly feel like I'm going nuts
c355E3B has joined #ruby
<Ox0dea> Yeah, this is pretty strange.
calleerlandsson has quit [Quit: Connection closed for inactivity]
Vile` has quit [Ping timeout: 244 seconds]
<phroa> I guess I could try updating ruby?
<jhass> how about system "echo #{command.join(' ')} | tee | sh"
<jhass> what does that print
yosafbridge has quit [Ping timeout: 248 seconds]
cubicool has joined #ruby
<Ox0dea> phroa: Is there any chance you're being pranked?
<Ox0dea> Redefining Kernel#` affects %x.
pandaant has quit [Remote host closed the connection]
<phroa> yeah, I don't think so
<Ox0dea> Maybe check the output of Kernel.method(:`).source_location, just in case. :P
Vile` has joined #ruby
judofyr has joined #ruby
<phroa> jhass: fails
<jhass> not my question ;)
<phroa> irb(main):001:0> Kernel.method(:`).source_location
<phroa> => nil
dfockler has joined #ruby
<Ox0dea> Welp, I'm outta guesses.
<cubicool> Hey guys, I need some advice. In python, I'm used to calling methods and specifying the argument name explicitly: foo(1, 2, x=10). I can't do anything like this in Ruby directly, unless there's something I don't know. I want to define initialize() methods that accept many different methods of invocation, so I use the technique of passing it a single (args={}) argument.
<jhass> ?guys cubicool
<ruboto> cubicool, we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
<cubicool> However, the code for testing this Hash (the size, type of the arguments, etc.) is getting really, really tedious. is this common enough that there may be a library to help?
<ElSif> yes, there are no kw args in ruby
<Ox0dea> >> def foo(x:, y:); x + y; end; foo(y = 17, x = 25) # cubicool
<ruboto> Ox0dea # => wrong number of arguments (2 for 0) (ArgumentError) ...check link for more (https://eval.in/401256)
<jhass> wrong, Ruby 2.0 and 2.1 introduced them
sinkensabe has joined #ruby
<Ox0dea> >> def foo(x:, y:); x + y; end; foo(y: 17, x: 25)
<ruboto> Ox0dea # => 42 (https://eval.in/401257)
<Ox0dea> That was bad.
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass> cubicool: so since Ruby 2.0 you can use keyword args, since 2.1 you can use required ones
<Ox0dea> ElSif: Please don't do that.
howdoi has quit [Quit: Connection closed for inactivity]
<ElSif> lol what??
<centrx> jhass, Yes we are: guy, n. - A person of grotesque appearance, esp. with reference to dress; a ‘fright’.
yosafbridge has joined #ruby
<cubicool> Wow, nice. The job I'm at currently, however (I'm learning Ruby "as-I-go" there) is stuck on 1.9.3.
<Ox0dea> ElSif: Spew misinformation?
<jhass> ?guys2 centrx
<ruboto> centrx, it doesn’t matter if it’s "normal"/gender neutral to say "guys" in your idiolect. "You guys" to refer to a mixed group is erasure. All we ask from you is to be a decent channel member and respect that. If you want to further discuss this, join #ruby-offtopic.
<cubicool> Thanks for the information. :)
<cubicool> Maybe I can get them to upgrade.
<shevy> cubicool you could try to use a hash if you are on 1.9.x
<centrx> ?ugly
<ruboto> I don't know anything about ugly
<ElSif> ok ill keep my 'you could have googled that' jokes to myself
<Ox0dea> cubicool: Even on 1.9, you can use a final Hash argument to emulate keyword arguments.
<cubicool> shevy: That is how I'm doing it now, I just have tons of conditional code and it doesn't have that Ruby beauty.
jpfuentes2 has joined #ruby
<Ox0dea> It's not perfect, but it sufficed for a long time.
<cubicool> Ox0dea: I use that too, actually.
niemcu has quit [Ping timeout: 250 seconds]
<shevy> yeah, I end up having to do lots of hash-query checking when I use hash-as-keywords
<jhass> cubicool: well, Ruby 1.9 is EOL (no official security updates anymore) and Ruby 2.0 is set to EOL February 2016, so there are more serious reasons to upgrade ;)
<Ox0dea> cubicool: Well, 1.9.3 is "dead" since February, so yo should be...
<Ox0dea> Yeah, that.
dfockler has quit [Ping timeout: 248 seconds]
nofxx has joined #ruby
<jhass> phroa: so, my command produced no output?
_blizzy_ has joined #ruby
sinkensabe has quit [Ping timeout: 240 seconds]
<phroa> jhass: er, sorry, alt-tabbed. here's the output, same as always https://gist.github.com/anonymous/46701fd5ece44c55531b
eGGsha has joined #ruby
fabrice31 has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
<jhass> the ../'s in the paths are kinda weird
<Ox0dea> phroa: You don't have write-access to the directory you're trying to build in.
<jhass> I wonder if they don't get resolved
l0oky has quit [Ping timeout: 264 seconds]
<ElSif> sounds like a permissions error yea
<phroa> jhass: well, I can copy the exact command and run it in a shell, so that isn't happening
<jhass> phroa: yeah, in your shell
<jhass> I'm saying Ruby/the shell ruby invokes might not
<phroa> not sure how I wouldn't have write access - this script downloads and unzips the source tarball...
<phroa> let me run some permissions checks
<ElSif> coul the permissions on the tarballed files be strange? what args are you using to untar?
<jhass> phroa: try resolving them by hand (or with File.expand_path if you need to do it programmatically)
pwnz0r has joined #ruby
<phroa> jhass: er, actually; would the fact that `%x[echo command > foo]' generates a file named foo be proof enough? because I tried that earlier and it worked.
<phroa> by worked I mean the file was written, script still failed :(
_blizzy_ has quit [Read error: Connection reset by peer]
serivich has quit [Ping timeout: 244 seconds]
<phroa> ElSif: %x[curl -fSsl #{CURL_URL} -o - | tar -zxf -]
<phroa> yes, it works
<jhass> phroa: proof of what?
<phroa> jhass: that ruby has write permission to the directory
Tritone has joined #ruby
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fabrice31 has quit [Ping timeout: 256 seconds]
<jhass> I never claimed it hasn't, Ox0dea did
<phroa> wait, it was Ox0de...yeah
<phroa> whoops :P
<jhass> I claimed it fails to resolve the /../ in the path
<jhass> *paths, even
_blizzy_ has joined #ruby
centrx has quit [Quit: Shutting down, Please wait...]
therealfibonacci has quit [Quit: Leaving.]
dont-panic has joined #ruby
Tritone has quit [Ping timeout: 248 seconds]
<phroa> jhass: late reply, but `puts %x[ls #{bin_path}/../]' works
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ElSif> and you are just running this script with 'ruby blah.rb' not any special command line magic?
<jhass> still
<jhass> try resolving them
mistermocha has joined #ruby
<phroa> I'm unsure what you mean by 'resolve' if the `ls' wasn't it
<phroa> ElSif: ./script.rb with a shebang, but I could use `ruby` if you like
<ElSif> no thats fine
<jhass> phroa: change the paths so that they don't contain any /../ if you pass them to configure
leat has quit [Remote host closed the connection]
leat has joined #ruby
freezevee has quit [Ping timeout: 264 seconds]
Casty has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
krz has quit [Quit: WeeChat 1.0.1]
<ElSif> you could try adding -p to your tar args
<phroa> jhass: removed ../, fails
<jhass> mh
<jhass> how about explicitly calling the shell in which "it works"?
<phroa> just kidding, had more ../s than I thought
<phroa> let me remove those and try that
<jhass> system "/bin/bash -c '#{command.join(" ")}'"
mistermocha has quit [Remote host closed the connection]
yfeldblum has joined #ruby
krz has joined #ruby
radialneon has quit [Ping timeout: 260 seconds]
kies^ has quit [Ping timeout: 256 seconds]
radialneon has joined #ruby
<ElSif> phroa: have you compile things on this system with this user manually?
<phroa> ElSif: yes, again, I can take the output of `puts command' and run that myself.
<ElSif> ah, i though you had only done a 1 file test, nvm
<ElSif> did you try jhass last suggestion?
<phroa> I'm removing the ..s in the paths
<phroa> then I will, yes
<jhass> yeah, try without the .. first
krz has quit [Client Quit]
ragingcake has joined #ruby
arup_r has quit [Quit: Leaving]
freezevee has joined #ruby
TheHodge has joined #ruby
Violentr has quit [Ping timeout: 240 seconds]
havenwood has joined #ruby
Ox0dea has quit [Ping timeout: 255 seconds]
choppington has joined #ruby
futilegames has joined #ruby
peter_paule has joined #ruby
idiocrash has quit []
choppington has quit [Ping timeout: 240 seconds]
eggoez has quit [Ping timeout: 252 seconds]
Musashi007 has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maletor has joined #ruby
<phroa> jhass: no dice with `system "/usr/local/bin/zsh -c '#{command.join(" ")}'"' but I added a /usr/bin/env -i before it and it worked. thanks so much for getting me halfway there <3
<phroa> I'll have to look in to what borked the environment, but I'll save that for another day
<jhass> strange nonetheless
pdxvegan_ has joined #ruby
<phroa> toodle-oo
phroa has left #ruby ["WeeChat 1.3-dev"]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
eggoez has joined #ruby
FernandoBasso has joined #ruby
ragingcake has quit [Quit: ragingcake]
ragingcake has joined #ruby
<ElSif> something with a non-interactive versus interactive shell difference??
<ElSif> yea that would be quite rare if it was the case
gemmy has joined #ruby
<ElSif> for just running a local script anyways
acl_ has quit [Quit: Page closed]
ragingcake has quit [Client Quit]
cubicool has quit [Quit: Leaving.]
DEA7TH_ has quit [Quit: DEA7TH_]
ragingcake has joined #ruby
Mendenhall has quit [Ping timeout: 248 seconds]
AlphaAtom has joined #ruby
dgutierrez1287 has joined #ruby
Contigi has quit [Quit: Leaving]
Aym_C has joined #ruby
tubuliferous_ has joined #ruby
Casty has joined #ruby
pdxvegan_ has quit [Read error: Connection reset by peer]
Aym_C has quit [Client Quit]
NeverDie has quit [Read error: Connection reset by peer]
<shevy> long live ruby \o/
dgutierrez1287 has quit [Ping timeout: 244 seconds]
NeverDie has joined #ruby
Muhannad has joined #ruby
ruby-lang619 has joined #ruby
<ruby-lang619> hallo
<ruby-lang619> wow
Bloodshot has joined #ruby
<jhass> hello
<ruby-lang619> anybody here?
<jhass> well, you are
<ruby-lang619> fine
<wasamasa> if only you are there, did the tree fall down?
<shevy> ruby-lang619 were you not here yesterday as wel
tubuliferous_ has quit [Ping timeout: 264 seconds]
Casty has quit [Ping timeout: 244 seconds]
ruby-lang619 has quit [Client Quit]
<jhass> oO
icebourg has quit []
<jhass> what did we do :/
Yiota has joined #ruby
Yiota has quit [Client Quit]
<wasamasa> the tree fell down
radialneon has quit [Ping timeout: 248 seconds]
eGGsha has joined #ruby
ph8 has joined #ruby
aryaching has quit [Ping timeout: 264 seconds]
Channel6 has quit [Quit: Leaving]
LiquidInsect has quit [Read error: Connection reset by peer]
hololeap has joined #ruby
sinkensabe has joined #ruby
ndrei has quit [Ping timeout: 244 seconds]
symm-_ has joined #ruby
symm- has quit [Ping timeout: 244 seconds]
eggoez has quit [Ping timeout: 256 seconds]
niemcu has joined #ruby
ndrei has joined #ruby
peter_paule has quit [Ping timeout: 252 seconds]
freezevee has quit [Remote host closed the connection]
Sypheren has quit [Ping timeout: 255 seconds]
sinkensabe has quit [Ping timeout: 246 seconds]
orbitalo has joined #ruby
Sypheren has joined #ruby
<shevy> yeah :)
<shevy> he was using webchat so that is to be expected
edenc has joined #ruby
sharpmachine has joined #ruby
Muhannad has quit [Ping timeout: 256 seconds]
ndrei has quit [Ping timeout: 256 seconds]
codecop_ has quit [Remote host closed the connection]
codecop has quit [Remote host closed the connection]
FernandoBasso has quit [Quit: May the force be with you.]
ndrei has joined #ruby
dom__ has joined #ruby
mhib has quit [Remote host closed the connection]
radialneon has joined #ruby
DLSteve has quit [Quit: Leaving]
cjk101010 has joined #ruby
radialneon has quit [Read error: Connection reset by peer]
Yiota has joined #ruby
ragingcake has quit [Quit: ragingcake]
zenguy_pc has joined #ruby
bertro has quit [Read error: Connection reset by peer]
ragingcake has joined #ruby
ljarvis has quit [Quit: Lost terminal]
maletor has quit [Quit: Computer has gone to sleep.]
lkba_ has quit [Remote host closed the connection]
ragingcake has quit [Client Quit]
zenguy_pc has quit [Read error: Connection reset by peer]
eggoez has joined #ruby
futilegames has quit [Quit: futilegames]
<nofxx> wish ruby gems had an enforce way for this http://guides.rubygems.org/name-your-gem/
bruno- has joined #ruby
pwnz0r has quit [Remote host closed the connection]
<nofxx> I mean: "your gem was rejected, foo-bar-baz must require
<nofxx> foo/bar/baz*
<nofxx> feels too much apple store? heh
pwnz0r has joined #ruby
ndrei has quit [Ping timeout: 265 seconds]
Jackneill has quit [Remote host closed the connection]
peelback has quit []
s00pcan has joined #ruby
peelback has joined #ruby
finisherr has joined #ruby
cpg has joined #ruby
DEA7TH_ has joined #ruby
<nofxx> worst was this bug I faced: gem is 'foo-bar', I: require 'foo/bar' strange errors happen... author wants you to r equire 'foo_bar' and my way required some part of it =/
ragingcake has joined #ruby
<nofxx> To be clear: not require errors, that would caught my attention, it required fine, just worked misteriously
acke has quit [Remote host closed the connection]
<nofxx> my way == correct way btw
pwnz0r has quit [Ping timeout: 248 seconds]
bruno- has quit [Ping timeout: 264 seconds]
<nofxx> hmm... now need to hear the song, sid vicious or sinatra?
Agoldfish has joined #ruby
ragingcake has quit [Client Quit]
g3funk has joined #ruby
peelback has quit [K-Lined]
ragingcake has joined #ruby
sarkyniin has quit [Ping timeout: 256 seconds]
Yiota has quit [Ping timeout: 246 seconds]
<shevy> nofxx what will it reject precisely?
icebourg has joined #ruby
RobertBirnie has joined #ruby
Fezzler has joined #ruby
woodruffw has quit [Quit: And then he took off.]
woodruffw has joined #ruby
maletor has joined #ruby
<nofxx> shevy, enforce... or at least give a warn
<shevy> yeah I still don't know what it will reject when
<nofxx> and a atta boy when its ok
<nofxx> shevy, just gave a rant/example
zacstewart has quit [Remote host closed the connection]
rubie has quit [Remote host closed the connection]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sarkyniin has joined #ruby
<nofxx> this foo-bar gem that have a lib/foo_bar.rb you are expect to require: Rubygems: [WARN] Your lib should countain a requirable lib/foo/bar.rb
DEA7TH_ has quit [Quit: DEA7TH_]
DEA7TH_ has joined #ruby
l0oky has joined #ruby
zacstewart has joined #ruby
pengin has joined #ruby
Silox| has joined #ruby
Musashi007 has quit [Quit: Musashi007]
bruno- has joined #ruby
g3funk is now known as braidn
JackBQuik has joined #ruby
allcentury has quit [Ping timeout: 255 seconds]
sinkensabe has joined #ruby
_blizzy_ has quit [Ping timeout: 265 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
symm-_ has quit [Ping timeout: 244 seconds]
martinbjeldbak has quit [Remote host closed the connection]
c355E3B has quit [Quit: Connection closed for inactivity]
allcentury has joined #ruby
martinbjeldbak has joined #ruby
quazimodo has quit [Ping timeout: 252 seconds]
martinbjeldbak has quit [Remote host closed the connection]
sinkensabe has quit [Ping timeout: 252 seconds]
Xoro has quit [Read error: Connection reset by peer]
pengin has quit [Remote host closed the connection]
martinbjeldbak has joined #ruby
zacstewart has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 264 seconds]
Musashi007 has joined #ruby
j4cknewt has joined #ruby
dom__ has quit [Ping timeout: 265 seconds]
Xoro has joined #ruby
Channel6 has joined #ruby
RobertBirnie has joined #ruby
BTRE has quit [Quit: Leaving]
ndrei has joined #ruby
solars has joined #ruby
BTRE has joined #ruby
totimkopf is now known as biik
Fezzler has quit [Quit: Leaving]
leat has quit [Ping timeout: 246 seconds]
icebourg has quit []
FernandoBasso has joined #ruby
dimasg has quit [Ping timeout: 256 seconds]
quimrstorres has joined #ruby
AlphaAtom has quit [Read error: Connection reset by peer]
lkba has joined #ruby
solars has quit [Ping timeout: 256 seconds]
AlphaAtom has joined #ruby
ragingcake has quit [Quit: ragingcake]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Pupeno_ has joined #ruby
Pupeno has quit [Ping timeout: 244 seconds]
MasterPiece has quit [Remote host closed the connection]
hashrocket has quit [Quit: Connection closed for inactivity]
ajaiswal has quit [Ping timeout: 256 seconds]
quazimodo has joined #ruby
devbug has quit [Ping timeout: 252 seconds]
senayar has joined #ruby
icebourg has joined #ruby
ragingcake has joined #ruby
dom__ has joined #ruby
Pyrotecnix has quit [Ping timeout: 246 seconds]
endash has joined #ruby
pandaant has joined #ruby
njection has joined #ruby
l0oky has quit [Ping timeout: 246 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
Pyrotecnix has joined #ruby
icebourg has quit [Client Quit]
niemcu has quit [Ping timeout: 244 seconds]
ajaiswal has joined #ruby
ta has joined #ruby
postmodern has joined #ruby
Asher1 has joined #ruby
bruno- has quit [Ping timeout: 240 seconds]
tubuliferous_ has joined #ruby
Asher has quit [Disconnected by services]
Asher1 has quit [Client Quit]
Asher has joined #ruby
radialneon has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
ta_ has quit [Read error: Connection reset by peer]
sankaber has quit [Read error: Connection reset by peer]
dimasg has joined #ruby
hanmac has quit [Ping timeout: 240 seconds]
armyriad has joined #ruby
allomov has quit [Remote host closed the connection]
BTRE has quit [Ping timeout: 240 seconds]
rudak__ has quit [Ping timeout: 260 seconds]
judofyr has quit []
rubie has joined #ruby
mozzarella has quit [Ping timeout: 240 seconds]
zacstewart has joined #ruby
hanmac has joined #ruby
ragingcake has quit [Quit: ragingcake]
mozzarella has joined #ruby
maknz has joined #ruby
ragingcake_ has joined #ruby
tubuliferous_ has quit [Ping timeout: 240 seconds]
EllisTAA has joined #ruby
lkba has quit [Quit: Bye]
lkba has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass> well, it did in your case, right? how would you detect it's not the "right" one?
tno has quit [Remote host closed the connection]
athos_diddy has joined #ruby
athos_diddy has quit [Client Quit]
devbug has joined #ruby
vdamewood has joined #ruby
decoponio has quit [Read error: Connection reset by peer]
maknz has quit [Quit: Textual IRC Client: www.textualapp.com]
maknz has joined #ruby
finisherr has quit [Quit: finisherr]
maletor has joined #ruby
decoponio has joined #ruby
maknz has quit [Client Quit]
BTRE has joined #ruby
finisherr has joined #ruby
[k- has quit [Ping timeout: 256 seconds]
Tritone has joined #ruby
vdamewood has quit [Quit: Life beckons.]
spider-mario has quit [Remote host closed the connection]
_blizzy_ has joined #ruby
sporkmonger has joined #ruby
dom__ has quit [Ping timeout: 244 seconds]
sistema32 has joined #ruby
sporkmonger has quit [Client Quit]
<sistema32> hi
<pontiki> hi
ScriptGeek has joined #ruby
roolo_ has quit [Remote host closed the connection]
sistema32 has quit [Client Quit]
_blizzy_ has quit [Read error: Connection reset by peer]
havenwood has quit [Ping timeout: 240 seconds]
radialneon_ has joined #ruby
radialneon has quit [Disconnected by services]
radialneon_ is now known as radialneon
davedev24 has quit [Ping timeout: 248 seconds]
radialneon_ has joined #ruby
davedev24 has joined #ruby
_blizzy_ has joined #ruby
Channel6 has quit [Quit: Leaving]
ragingcake_ has quit [Quit: ragingcake_]
edwinvdgraaf has quit []
sinkensabe has joined #ruby
dorei has quit [Ping timeout: 264 seconds]
prasselpikachu has quit [Ping timeout: 264 seconds]
ValicekB has quit [Ping timeout: 246 seconds]
FernandoBasso has quit [Quit: May the force be with you.]
Ilyas has quit [Read error: Connection reset by peer]
sharpmachine has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 246 seconds]
prasselpikachu has joined #ruby
Aswebb_ has quit [Remote host closed the connection]
sharpmachine has joined #ruby
sinkensabe has quit [Ping timeout: 246 seconds]
lorikeet has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
hahuang65 has joined #ruby
radialneon has quit [Quit: Leaving]
finisherr has quit [Quit: finisherr]
jamesaxl has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
miwood has joined #ruby
sporkmonger has joined #ruby
borkdude_ has quit [Ping timeout: 240 seconds]
dgutierrez1287 has joined #ruby
bruno- has joined #ruby
CustosLimen has joined #ruby
quimrstorres has quit [Remote host closed the connection]
htmldrum has joined #ruby
ValicekB has joined #ruby
dgutierrez1287 has quit [Ping timeout: 248 seconds]
dimasg has quit [Ping timeout: 244 seconds]
borkdude has joined #ruby
wpp has quit [Quit: ZZZzzz…]
CloCkWeRX has joined #ruby
allcentury has joined #ruby
JackBQuik has quit [Killed (Sigyn (Spam is off topic on freenode.))]
bruno- has quit [Ping timeout: 264 seconds]
zenguy_pc has joined #ruby
allcentury has quit [Ping timeout: 264 seconds]
quimrstorres has joined #ruby
l0oky has joined #ruby
desigx has joined #ruby
blue_deref has joined #ruby
Yiota has joined #ruby
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
quimrstorres has quit [Ping timeout: 265 seconds]
<shevy> ih
hanmac has quit [Ping timeout: 244 seconds]
_blizzy_ has quit [Ping timeout: 265 seconds]
senayar has quit [Remote host closed the connection]
Blaguvest has joined #ruby
sarkyniin has quit [Ping timeout: 250 seconds]
csmb has quit [Quit: quitin]
meatchicken has joined #ruby
Thomas-0725 has joined #ruby
<meatchicken> Is there a way I can convert string matches to captures @ regex?
<meatchicken> such as "/posts/{id}".gsub(/{.+}/,"\\(.+)\\")
<meatchicken> trying to create a basic router for learning
Pupeno_ has quit [Quit: Leaving...]
duoi has joined #ruby
<jhass> meatchicken: sure, just stuff the result into Regexp.new to turn it into one
pengin has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
DEA7TH_ has quit [Quit: DEA7TH_]
Spami has joined #ruby
<meatchicken> jhass: let me try - last time it threw an error because I tried using it with union
EllisTAA has quit [Quit: EllisTAA]
maletor has quit [Quit: Computer has gone to sleep.]
finisherr has joined #ruby
ScriptGeek has quit [Quit: Leaving.]
bodgix has joined #ruby
bodgix has quit [Client Quit]
prasselpikachu has quit [Ping timeout: 248 seconds]
zenguy_pc has quit [Ping timeout: 246 seconds]
CustosLimen has quit [Ping timeout: 246 seconds]
prasselpikachu has joined #ruby
stantonnet has joined #ruby
zenguy_pc has joined #ruby
finisherr has quit [Client Quit]
_blizzy_ has joined #ruby
hanmac has joined #ruby
CustosLimen has joined #ruby
bakednotfried has quit [Remote host closed the connection]
cpg is now known as cpg|away
pengin has quit [Remote host closed the connection]
quimrstorres has joined #ruby
ScriptGeek has joined #ruby
asmodlol has quit [Ping timeout: 256 seconds]
gemmy has quit [Quit: leaving]
EllisTAA has joined #ruby
sarkyniin has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
quimrstorres has quit [Ping timeout: 252 seconds]
bruno- has joined #ruby
CloCkWeRX has joined #ruby
_blizzy_ has joined #ruby
sharpmachine has quit [Remote host closed the connection]
sharpmachine has joined #ruby
miwood has quit [Remote host closed the connection]
miwood has joined #ruby
kinda has joined #ruby
radialneon_ has quit [Remote host closed the connection]
miwood has quit [Ping timeout: 248 seconds]
finisherr has joined #ruby
charliesome has quit [Quit: zzz]
bigmac has quit [Ping timeout: 265 seconds]
sinkensabe has joined #ruby
mgorbach has quit [Quit: ZNC - http://znc.in]
mgorbach has joined #ruby
j4cknewt has quit [Remote host closed the connection]
drewvanstone has joined #ruby
charliesome has joined #ruby
eggoez has quit [Ping timeout: 244 seconds]
charliesome has quit [Client Quit]
fabrice31 has joined #ruby
sinkensabe has quit [Ping timeout: 244 seconds]
EllisTAA has quit [Quit: EllisTAA]
fabrice31 has quit [Ping timeout: 244 seconds]
benlovell has joined #ruby
jeremati_ has quit []
EllisTAA has joined #ruby
sharpmachine has quit [Remote host closed the connection]
Mendenhall has joined #ruby
_ht has quit [Quit: Konversation terminated!]
last_staff has quit [Quit: off to visit the void]
benlovell has quit [Read error: Connection reset by peer]
desigx has quit [Ping timeout: 248 seconds]
benlovell has joined #ruby
charliesome has joined #ruby
Contigi has joined #ruby
arescorpio has joined #ruby
sporkmonger has quit [Quit: sporkmonger]
meatchicken has quit [Quit: Page closed]
Tritone has quit [Remote host closed the connection]
shinnya has joined #ruby
Tritone has joined #ruby
sharpmachine has joined #ruby
eggoez has joined #ruby
haneen has quit [Read error: Connection reset by peer]
hanine has joined #ruby
sarkyniin has quit [Quit: Quit]
vickleton has quit [Ping timeout: 256 seconds]
ruurd has joined #ruby
tubuliferous_ has joined #ruby
j4cknewt has joined #ruby
jesterfraud has joined #ruby
jbw_ has joined #ruby
jbw__ has quit [Ping timeout: 260 seconds]
<ruurd> >> bar = {label: 'All fields', field: 'all fields'}
<ruboto> ruurd # => {:label=>"All fields", :field=>"all fields"} (https://eval.in/401287)
S3thc0n has joined #ruby
<ruurd> >> bar
<ruboto> ruurd # => undefined local variable or method `bar' for main:Object (NameError) ...check link for more (https://eval.in/401288)
benlovell has quit [Ping timeout: 265 seconds]
jimmychimms has joined #ruby
tubuliferous_ has quit [Ping timeout: 244 seconds]
ruurd has quit [Quit: Bye]
<jesterfraud> Is there a version of ||= that only triggers on nils (instead of falses)?
<weaksauce> jesterfraud you can use fetch for hashes
<jimmychimms> hi - can someone help? I'm trying to capitalize every word in a sentence greater than 3 letters long - following code capitalizes each word, but how do i modify it so it only capitalizes words with 3 characters or more? str.split.each{|i| i.capitalize!}.join(' ')}
darithorn has joined #ruby
<jesterfraud> weaksauce: that helps
<jesterfraud> thanks
<weaksauce> though if the value is actually nil it won't override the nil value jesterfraud only if it's not been assigned anything to that key
<weaksauce> >> {test: nil}.fetch(:test, "yay")
<ruboto> weaksauce # => nil (https://eval.in/401289)
<jesterfraud> ah. That actually sounds really useful
dseitz has joined #ruby
<weaksauce> >> {}.fetch(:test, "yay")
<ruboto> weaksauce # => "yay" (https://eval.in/401290)
sharpmachine has quit [Remote host closed the connection]
rubie has quit [Remote host closed the connection]
sharpmachine has joined #ruby
cscheib has left #ruby [#ruby]
Musashi007 has quit [Quit: Musashi007]
zacstewart has quit [Remote host closed the connection]
quazimodo has joined #ruby
Musashi007 has joined #ruby
kirun has quit [Quit: Client exiting]
hahuang65 has quit [Quit: WeeChat 1.2]
hahuang65 has joined #ruby
sharpmachine has quit [Remote host closed the connection]
dtcristo has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
sharpmachine has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
hashrocket has joined #ruby