apeiros has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby-lang
iliketurtles has quit [Quit: zzzzz…..]
allomov has joined #ruby-lang
onkara has quit [Quit: onkara]
onkara has joined #ruby-lang
dbussink has quit [Excess Flood]
dbussink has joined #ruby-lang
michaeldeol has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
dbussink has quit [Excess Flood]
apeiros has joined #ruby-lang
<gmas>
anchoring the expression fixes the issue: %r{^(?!.*\.{2}).*\w@}x.match('user..abc@email.com'))
<gmas>
or, as suggested by soahccc , /A and /Z
charliesome has joined #ruby-lang
<karamazov>
When created gems, I was under the impression that if I require a file in the lib/mygem.rb then it'd be applied to all the files in lib/something/*.rb
<karamazov>
Is that not the case for gems created using ruby > 2.0?
banister has joined #ruby-lang
apeiros has quit [Ping timeout: 272 seconds]
banister has quit [Max SendQ exceeded]
<womble>
I don't think that's ever been the case.
banister has joined #ruby-lang
<karamazov>
womble: Oi - this isn't the first time I've gotten something wrong :)
kramsee has quit [Remote host closed the connection]
eristic has joined #ruby-lang
soahccc has joined #ruby-lang
EvilJStoker has quit [Ping timeout: 455 seconds]
shtirlic has quit [Ping timeout: 455 seconds]
esmet____ is now known as esmet___
adambeynon_ is now known as adambeynon
kramsee_ has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
cantonic has quit [Quit: cantonic]
RitterJack has joined #ruby-lang
rahul_j has quit [Ping timeout: 250 seconds]
kalleth has quit [Write error: Broken pipe]
heftig has quit [Excess Flood]
lele|w has quit [Excess Flood]
Mon_Ouie has quit [Write error: Broken pipe]
_whitelogger has joined #ruby-lang
francisfish has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ledestin_ has joined #ruby-lang
mamantoha has joined #ruby-lang
lele|w has joined #ruby-lang
ledestin has quit [Ping timeout: 245 seconds]
ledestin_ is now known as ledestin
allomov has quit [Remote host closed the connection]
jeaye has joined #ruby-lang
GarethAdams has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
onkara has quit [Quit: onkara]
Suchit has joined #ruby-lang
onkara has joined #ruby-lang
ledestin has quit [Ping timeout: 245 seconds]
ledestin has joined #ruby-lang
benlovell has joined #ruby-lang
Caius has joined #ruby-lang
futilegames has joined #ruby-lang
tkuchiki has joined #ruby-lang
mahlon has joined #ruby-lang
Caius has joined #ruby-lang
Caius has quit [Changing host]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
michaeldeol has joined #ruby-lang
rahul_j has joined #ruby-lang
ledestin_ has joined #ruby-lang
ledestin has quit [Ping timeout: 265 seconds]
ledestin_ is now known as ledestin
onkara has quit [Quit: onkara]
onkara has joined #ruby-lang
yusuf1 has quit [Quit: Leaving.]
houhoulis has quit [Remote host closed the connection]
GBrawl has joined #ruby-lang
GBrawl has quit [Client Quit]
fusillicode has joined #ruby-lang
rahul_j has quit [Ping timeout: 250 seconds]
GBrawl has joined #ruby-lang
rahul_j has joined #ruby-lang
onkara has quit [Quit: onkara]
rahul_j has quit [Client Quit]
onkara has joined #ruby-lang
eloquent_mute has joined #ruby-lang
fusillicode has quit [Ping timeout: 272 seconds]
francisfish has joined #ruby-lang
RickHull has quit [Ping timeout: 246 seconds]
houhoulis has joined #ruby-lang
banister has joined #ruby-lang
ta_ has quit [Ping timeout: 245 seconds]
yfeldblum has quit [Ping timeout: 245 seconds]
onkara has quit [Quit: onkara]
ta has joined #ruby-lang
onkara has joined #ruby-lang
mnngfltg has joined #ruby-lang
allomov has joined #ruby-lang
allomov has quit [Remote host closed the connection]
rahul_j has joined #ruby-lang
allomov has joined #ruby-lang
mikecmpbll has joined #ruby-lang
rahul_j has quit [Ping timeout: 258 seconds]
rahul_j has joined #ruby-lang
yfeldblum has joined #ruby-lang
onkara has quit [Quit: onkara]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
onkara has joined #ruby-lang
SuMo_D has quit [Remote host closed the connection]
<yorickpeterse>
morning
<tbuehlmann>
moin
SuMo_D has joined #ruby-lang
<yorickpeterse>
ugh standup ughhh
<yorickpeterse>
agile, kanban, lol
SuMo_D has quit [Ping timeout: 245 seconds]
skade has joined #ruby-lang
jmrepetti has joined #ruby-lang
mistym has quit [Remote host closed the connection]
ta has quit [Read error: Connection reset by peer]
banister has joined #ruby-lang
ur5us has joined #ruby-lang
ta has joined #ruby-lang
onkara has quit [Quit: onkara]
onkara has joined #ruby-lang
ledestin has quit [Ping timeout: 256 seconds]
ledestin has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Suchit has quit [Quit: (null)]
spastorino has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
onkara has quit [Quit: onkara]
onkara has joined #ruby-lang
ledestin_ has joined #ruby-lang
snsei has joined #ruby-lang
banister has joined #ruby-lang
ledestin has quit [Ping timeout: 258 seconds]
ledestin_ is now known as ledestin
snsei has quit [Ping timeout: 264 seconds]
Forgetful_Lion has quit [Remote host closed the connection]
Xzanron has quit [Ping timeout: 245 seconds]
kyb3r_ has quit [Read error: Connection reset by peer]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wm3|busy has joined #ruby-lang
onkara has quit [Quit: onkara]
onkara has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
vang has joined #ruby-lang
mikecmpb_ has joined #ruby-lang
<vang>
Hi, I'm new to ruby and can't find the answer on google. I have a beaker spec ruby file that has 'on host, puppet('module', 'install', 'puppetlabs-stdlib')'. What does the 'on' in 'on host' mean?
<apeiros>
vang: not using puppet - but I'd assume it's a top-level method
<apeiros>
i.e. on(host, puppet(…))
<apeiros>
parens are optional in ruby
<vang>
so the brackets are optional?
<vang>
ok. got it. thanks.
mikecmpbll has quit [Ping timeout: 272 seconds]
<apeiros>
I think apart from brits, [] are brackets ;-)
futilegames has quit [Quit: futilegames]
havenwood has quit []
arBmind1 has quit [Quit: Leaving.]
onkara has quit [Quit: onkara]
onkara has joined #ruby-lang
mikecmpb_ is now known as mikecmpbll
futilegames has joined #ruby-lang
fusillicode has joined #ruby-lang
wm3|busy is now known as workmad3
snovity has joined #ruby-lang
benlovell has quit [Read error: Connection reset by peer]
benlovel1 has joined #ruby-lang
ender|dkm has quit [Ping timeout: 255 seconds]
banister has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
ldnunes has joined #ruby-lang
onkara has quit [Quit: onkara]
onkara has joined #ruby-lang
kaczmar has joined #ruby-lang
houhoulis has quit [Remote host closed the connection]
rahul_j has joined #ruby-lang
doosy has joined #ruby-lang
lcdhoffman has joined #ruby-lang
michaeldeol has quit [Remote host closed the connection]
ruby-lang402 has joined #ruby-lang
<ruby-lang402>
Hola que ase
<ruby-lang402>
programas o que ase
arBmind has joined #ruby-lang
<yorickpeterse>
baguette
<ljarvis>
apeiros: I call them brackets
<ruby-lang402>
con Chorizo
onkara has quit [Quit: onkara]
<ruby-lang402>
Que metodología a´gil empleais
<yorickpeterse>
omelette du fromage
<ruby-lang402>
TDD o BDD
<ruby-lang402>
o Testing
<yorickpeterse>
ruby-lang402: In case you hadn't figured, this is an English channel
<ljarvis>
feta un sausage
onkara has joined #ruby-lang
<ruby-lang402>
English? I can´t speak "inglis"
<ruby-lang402>
what methologic use TDD vs BDD other?
<ljarvis>
ruby-lang402: use whatever makes you most productive and happy
<ruby-lang402>
to develop?
<ruby-lang402>
whatever is CRON, no?
<ruby-lang402>
example?
<yorickpeterse>
what?
charliesome has joined #ruby-lang
stamina has joined #ruby-lang
cantonic has joined #ruby-lang
doosy has quit [Remote host closed the connection]
kaczmar has quit [Quit: kaczmar]
_elia has joined #ruby-lang
_elia has quit [Client Quit]
lcdhoffman has quit [Quit: lcdhoffman]
cantonic has quit [Ping timeout: 265 seconds]
onkara has quit [Quit: onkara]
onkara has joined #ruby-lang
lcdhoffman has joined #ruby-lang
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
ruby-lang402 has quit [Ping timeout: 246 seconds]
sarkyniin has joined #ruby-lang
<apeiros>
ljarvis: you call () brackets? which dialect?
<ljarvis>
apeiros: I call them both brackets, and just say "square" if it seems ambiguous
_elia has joined #ruby-lang
_elia has quit [Client Quit]
<apeiros>
ljarvis: yeah, what dialect? I thought you're american?
godd2 has quit [Ping timeout: 258 seconds]
<ljarvis>
apeiros: wat no, I'm british
<apeiros>
ah, see, so I was right :D
<apeiros>
"apart from brits"
<apeiros>
afaik, only brits also call () brackets
<ljarvis>
"I think apart from brits, [] are brackets"
<yorickpeterse>
They're parenthesis you peasants
tkuchiki has quit [Ping timeout: 244 seconds]
<ljarvis>
that seems to say "brits don't call [] brackets"
_elia has joined #ruby-lang
<apeiros>
ok, badly phrased
<workmad3>
ljarvis: I'm a brit and call [] brackets... but I tend to prefix that with 'square'
malconis has quit [Remote host closed the connection]
sarkyniin has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 258 seconds]
malconis has joined #ruby-lang
banister has quit [Read error: Connection reset by peer]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
onkara has quit [Quit: onkara]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
onkara has joined #ruby-lang
miqui has joined #ruby-lang
<bradland>
man i hate it when people use RVM on servers. I love the tool in my dev environment, but fugghedabout it on servers.
<darix>
bradland: i would love to see how many people are running outdated ruby versions because they are using rvm
banister has joined #ruby-lang
<yorickpeterse>
Find me a distribution that doesn't suck at installing multiple Ruby versions in parallel, then I'll consider it
<darix>
^^
<yorickpeterse>
including 1.9.3 and 2.1.4 in parallel on the same server
banister has quit [Max SendQ exceeded]
snooc has joined #ruby-lang
<darix>
yorickpeterse: SUSE?:D
<yorickpeterse>
darix: No idea how that handles it
<[spoiler]>
installing or just having them installed?
<yorickpeterse>
Debian, Ubuntu and CentOS all suck at it tremendously
<bradland>
i never do it. i spin up separate VMs.
<darix>
yorickpeterse: i actually gave you the how to read?!:p
<bradland>
ridiculous, but i sleep better.
banister has joined #ruby-lang
<darix>
yorickpeterse: multiple binaries with suffixes.
banister has quit [Max SendQ exceeded]
<darix>
the only really viable way imho :)
<yorickpeterse>
darix: things like ruby21 ruby19 is the part that sucks
<yorickpeterse>
(as the executable name)
<[spoiler]>
Idk, I never had problems with it on ubuntu (although I'd use rvm.io and gemsets, which does some bash voodoo lol)
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
<lupine>
update-alternatives is a perfectly fine mechanism
<darix>
lupine: it wouldnt help if you want to use both in parallel
<lupine>
the other option is path mangling, of course
banister has joined #ruby-lang
<lupine>
darix, of course it does, you just need to specify which one you mean
<darix>
lupine: neither distro opted for that.
banister has quit [Max SendQ exceeded]
<darix>
lupine: so i run my ruby 2.1 script then update /usr/bin/ruby to 1.9 and run my 1.9 script?
* lupine
is a system ruby evangelist
<darix>
really?;)
<[spoiler]>
also, we don't have a problem with it on centOS either; we adjust the env vars for the user for the required ruby version(even provide a few script that does it)
<ohsix>
multiple binaries with stuff added is also the thing supported by autotools
banister has joined #ruby-lang
<lupine>
darix, no, if you depend on a particular ruby, you specify it explicitly
banister has quit [Max SendQ exceeded]
<darix>
lupine: and yorickpeterse has a problem with that ;)
<lupine>
doesn't mean he's right
Sunlorhic has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
<darix>
yorickpeterse: in any case ... I can easily package gems for multiple ruby versions in parallel.
<lupine>
personally, I target my code to the ruby and libraries that I know can be deployed with decent security support - which means that which comes with debian wheezy
caseydriscoll has joined #ruby-lang
RitterJack has quit [Quit: Quitte]
<bradland>
yorickpeterse: have you looked at postmodern’s chruby? it’s list of anti-features always seemed to make it a good candidate for server usage.
<lupine>
(personally, I'm moving away from ruby as time goes by, but that's that)
banister has joined #ruby-lang
charliesome has quit [Quit: zzz]
<lupine>
I still have to write and deploy a lot of it now
<yorickpeterse>
bradland: Yes, I've been using chruby/ruby-install for about 2 years now
banister has quit [Client Quit]
<darix>
yorickpeterse: even packaging rails apps with rpm is quite easiy
<darix>
easy
<lupine>
cutting-edge and servers do not go well together
<yorickpeterse>
darix: packaging itself is a non problem for me
kaczmar has quit [Quit: kaczmar]
mbr__ has joined #ruby-lang
<yorickpeterse>
What I don't want is to have this setup where suddenly my deployment tools need to know the difference in binary naming between versions
<yorickpeterse>
"oh I'm running on 2.1.4 so I have to use ruby214 instead of ruby"
<yorickpeterse>
^ screw that
webhat_ has joined #ruby-lang
a1digital has joined #ruby-lang
My_Hearing has quit [Ping timeout: 265 seconds]
lele has quit [Ping timeout: 265 seconds]
mbr has quit [Killed (kornbluth.freenode.net (Nickname regained by services))]
mbr__ is now known as mbr
My_Hearing has joined #ruby-lang
PaulePanter has quit [Ping timeout: 265 seconds]
maloik has quit [Ping timeout: 265 seconds]
webhat has quit [Ping timeout: 265 seconds]
JohnBat26 has quit [Ping timeout: 265 seconds]
zenojis has quit [Ping timeout: 265 seconds]
<ohsix>
won't it already know to use alternate vms?
zenojis has joined #ruby-lang
theotherstupidgu has quit [Remote host closed the connection]
JohnBat26 has joined #ruby-lang
PaulePanter has joined #ruby-lang
<yorickpeterse>
ohsix: right now that's a "rvm use XXXX" line, that's it
maloik has joined #ruby-lang
<darix>
yorickpeterse: how is that much different from having to pick the right rvm set?
<yorickpeterse>
darix: that only happens once
theotherstupidgu has joined #ruby-lang
<yorickpeterse>
If you have to call multiple Ruby things during deployment you'd have to set the correct name multiple times
<darix>
yorickpeterse: if you only use one ruby version on that system
<darix>
then you can just use update-alternatives and be done
<darix>
also once
<yorickpeterse>
If there's only one version it's not a problem, no
<yorickpeterse>
Like I specifically said, it's a problem when running versions in parallel
sepp2k has joined #ruby-lang
<darix>
i am sure you will find something.
lele has joined #ruby-lang
cantonic has joined #ruby-lang
onkara has quit [Quit: onkara]
<ohsix>
as nice it is to just deploy on the version you use, it does create these problems; ruby is the only software i use that plays this game
onkara has joined #ruby-lang
fusillicode has joined #ruby-lang
godd2 has quit [Ping timeout: 255 seconds]
a1digital has quit [Quit: a1digital]
lcdhoffman has joined #ruby-lang
<bradland>
yorickpeterse: based on your experience with chruby, is there a reason you don’t use it on servers? i’m curious because i’ve tested the waters with RVM a few times and always stepped back after running in to other complications.
<yorickpeterse>
bradland: Yes, because RVM is already there
<yorickpeterse>
and has been for 4 years
<yorickpeterse>
and it's everywhere
<yorickpeterse>
Replacing that doesn't take 5 minutes sadly
<bradland>
yeah, i feel you on that one :(
<yorickpeterse>
There's actually been a ticket in Pivotal since January to get rid of RVM
cantonic has quit [Ping timeout: 265 seconds]
t4nk955 has joined #ruby-lang
jimbach has quit [Remote host closed the connection]
<t4nk955>
I'm trying to fill an array with the numbers 1 to 999. So far, numbers = [1..999] was a failed attempt. Any ideas?
<yorickpeterse>
t4nk955: (1..999).to_a
jimbach has joined #ruby-lang
<t4nk955>
Oh, that did the trick! Can I name the array?
nertzy has quit [Quit: This computer has gone to sleep]
<yorickpeterse>
Sure, you can just assign it to a variable
<t4nk955>
I am trying to find out how many of the numbers between 1 and 999 contain at least one even number. I thought I could create and array with numbers, use #each to format the to strings and then use #each with a regex to raise a counter if it contains 2, 4, 6 or 8. Does that sound like a good approach?
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oleo has joined #ruby-lang
<darix>
t4nk955: you would need to call "to_s" on them for a regexp match
<t4nk955>
Yeah. Does regexp return true if it finds anything?
<darix>
it returns the match
mattyohe has joined #ruby-lang
<darix>
and it returns nil if there is no match
cleopatrax has quit [Ping timeout: 240 seconds]
sirene has quit [Ping timeout: 240 seconds]
cleopatras has quit [Ping timeout: 255 seconds]
<workmad3>
t4nk955: I'd suggest map and select rather than each and counters btw ;)
<workmad3>
t4nk955: also, what about 0?
kaczmar has joined #ruby-lang
<bradland>
t4nk955: if you want to know if the number is even, use the modulus operator, rather than a regex.
<workmad3>
bradland: wrong problem ;)
<t4nk955>
workmad3: I don't think zero counts.
<workmad3>
bradland: he's looking for things like 839, which contains an even digit, while not being an even number
<ljarvis>
workmad3: yeah, works just like "a".."z"
<workmad3>
yup
chinmay_dd has joined #ruby-lang
bradland has quit [Quit: bradland]
<t4nk955>
Good thing I workmad too!
<workmad3>
right, I guess I'd better get back to my encoding issues :(
dangerousdave has joined #ruby-lang
* t4nk955
giggles.
bradland has joined #ruby-lang
<ljarvis>
psh ruby fixed all encoding problems in 1.9 nobody has them anymore
<lupine>
violence time
dangerousdave has quit [Client Quit]
nathanstitt has joined #ruby-lang
enebo has joined #ruby-lang
Xzanron has quit [Ping timeout: 245 seconds]
<[spoiler]>
ngl, the way *"40".."5x" (or w/e) generates 40 .. 90 is bizarre lol
kurko___ has joined #ruby-lang
<workmad3>
ljarvis: by 'encoding issue' I mean "I'm reading the first line out of a CSV file to detect what particular format it is, and on UTF-16 encoded files I'm getting the feckin BOM"
<ljarvis>
workmad3: as someone who works on a csv importer, i feel for you
lcdhoffman has quit [Quit: lcdhoffman]
<workmad3>
ljarvis: I'm guessing it's because the file is currently set up by ruby as utf-8 by default, so I need to use something like charlock-holmes to do a 'best-guess' on the encoding and set it on the file :)
<workmad3>
ljarvis: it's just... argh!
<ljarvis>
:(
onkara has quit [Quit: onkara]
kurko__ has quit [Ping timeout: 250 seconds]
onkara has joined #ruby-lang
koderok has joined #ruby-lang
dwknoxy has joined #ruby-lang
<workmad3>
ljarvis: discovered the issue during some user testing (thankfully an understanding user). Later on during the test, we had to split the file up into 3 sections... which ended up with the files being re-encoded as latin1 or something, which was even worse :(
<workmad3>
stupid excel
Xzanron has joined #ruby-lang
yfeldblum has joined #ruby-lang
kaczmar has quit [Quit: kaczmar]
<ljarvis>
I ended up building our importer at work in Go because the rate of failure was so high and everyting "just worked" when I rewrote it
<bradland>
my fav is excel on mac, save as csv, results in line endings \r
<bradland>
*dafuq*
<workmad3>
bradland: fun fun fun :)
tbuehlmann has joined #ruby-lang
<ljarvis>
i thought windows did that
<ljarvis>
oh excel on mac, right
<ljarvis>
yeah the ruby csv parser picks those up, had to write something custom in go to handle crapping windows csv imports
danijoo has joined #ruby-lang
whippythellama has joined #ruby-lang
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cored has quit [Quit: leaving]
danijoo_ has quit [Ping timeout: 250 seconds]
<t4nk955>
Is there something else than regexp I can use, which returns true or false if the characters have either been found or not found?
<bradland>
many things in ruby eval as true or false, so there are a number of ways to accomplish that.
<bradland>
for example, String#scan
<ljarvis>
that doesn't return true of false, and neither does regexp matching
<ljarvis>
or*
<ljarvis>
t4nk955: String#include?
<workmad3>
t4nk955: =~ for regexp matching
<ljarvis>
"something else than regexp" :D
yusuf1 has joined #ruby-lang
yusuf1 has quit [Max SendQ exceeded]
yusuf1 has joined #ruby-lang
<bradland>
by “other than regexp”, he/she probably means other than this current method i’m using.
mamantoha_ has quit [Ping timeout: 250 seconds]
<bradland>
String#include? is definitely the closest to what t4nk955 asked for though.
<t4nk955>
ljarvis: My hero! Can I search for multiple elements with that one? Say i want to search for 2 and 4 in 345. Only needs to return true if one is right.
<workmad3>
t4nk955: is there a reason to not use regexp?
<ljarvis>
t4nk955: no, you'd need to join the conditions with &&, or split and check the characters (but regexp would be better than all of this)
<ljarvis>
yes, so your homework is to avoid regexp?
<ljarvis>
and this is math homework? if so you shouldn't be doing it the way you're doing it, or the way anyone has suggested so far
<j2p2>
that's usually the focus of my real work ;D
<ljarvis>
j2p2: so much this
<ljarvis>
my homework is usually to avoid math
<t4nk955>
Probability is boring, so I thought I'd try it with Ruby. I tried regexp for the first time, and failed. I just need it to return true if the numbers are found.
<ljarvis>
t4nk955: regexp works fine and that's what you should use if you don't need to use math
<ljarvis>
myself and workmad3 both showed you examples of working code
<bradland>
i’d like to point out that i recommended modulus a long time ago :P
<t4nk955>
Yeah, really cracked my head on that.
<bradland>
t4nk955: if this is math homework, don’t use regex to test for even numbers
<bradland>
think about the definition of an even number
<bradland>
what does it mean, literally?
<ljarvis>
wait, this is to test for even numbers?
<ljarvis>
wat
<t4nk955>
The numbers need to contain even numbers, not be some.
<workmad3>
t4nk955: *even digits
<bradland>
is this math homework?
<ljarvis>
right, contain, so regexp is fine
<ljarvis>
workmad3: pedant
danijoo_ has joined #ruby-lang
<bradland>
regexp is fine, if you’re writing pratical code, but if this is homework, they’re probably looking for a programatic implementaiton of some math
dorei has joined #ruby-lang
chinmay_dd has quit [Read error: Connection reset by peer]
<bradland>
t4nk955: break the problem down in to a procedure
chinmay_dd has joined #ruby-lang
<bradland>
1) break the number apart in to digits
<workmad3>
ljarvis: regexp is fine if the point is to count the number in a specific range... regexp isn't fine if the point is to generate a formula for calculating (or estimating) the count of numbers containing even digits up to a value X :)
<bradland>
2) test the number to see if it’s even
<bradland>
3) count the number of times that is strue
<ljarvis>
im not sure why you're telling me that, that's what I've said to t4nk955 multiple times :)
<workmad3>
ljarvis: dunno... :D
tharindu has quit [Ping timeout: 258 seconds]
<workmad3>
t4nk955: btw, we aren't here to do your homework for you :P
<ljarvis>
^
<ljarvis>
even though we did twice
<ljarvis>
before we knew it was homework though
<workmad3>
:D
<t4nk955>
workmad3: I know. You're there to tell me if regexp was good or not. Trying with #include now. Looks a bit nicer.
<workmad3>
ljarvis: as for being a pedant... pretty sure it's in my job description ;)
danijoo has quit [Ping timeout: 250 seconds]
<t4nk955>
ljarvis: I reveled myself!
<workmad3>
t4nk955: nicer than 'str =~ /[2468]/'? :P
kaczmar has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
loincloth has quit [Remote host closed the connection]
<t4nk955>
workmad3: Oh, that's what it meant! ty
mkaesz has quit [Ping timeout: 245 seconds]
<apeiros>
workmad3: right. you have to be a pedant to argue with the world's most finicky pedant :)
jimbach_ has joined #ruby-lang
<workmad3>
apeiros: heh :) I had to check 'finicky' then, I've only come across 'finickity' before ;)
* apeiros
off for commute, cya folks
apeiros has quit [Remote host closed the connection]
<t4nk955>
workmad3: Tried yours. It didn't run into any errors, but it only returned 0. Have a look, if you like https://eval.in/220034
<workmad3>
t4nk955: not surprising... you didn't successfully convert your numbers to strings :P
apeiros has joined #ruby-lang
<t4nk955>
workmad3: Do you suggest I even failed #to_s ?
Asher has quit [Read error: Connection reset by peer]
<workmad3>
t4nk955: no, I'm suggesting you failed to capture the result of calling that :P
jimbach has quit [Ping timeout: 245 seconds]
<t4nk955>
workmad3: Converting all the numbers from 1 to 999 in the array to strings?
loincloth has joined #ruby-lang
<ljarvis>
t4nk955: are you learning Ruby?
Miphix has quit [Quit: Leaving]
Asher has joined #ruby-lang
<t4nk955>
ljarvis: Very slowly, yes.
snsei has quit [Remote host closed the connection]
<t4nk955>
ljarvis: Probably the reason why I use more time at failing with ruby than the actual math.
<ljarvis>
t4nk955: so basically, each { } just yields each value to the block, and does not return anything other than the original object without mutating the contents
<workmad3>
t4nk955: numbers.each { |n| n.to_s } <-- that doesn't change anything in the 'numbers' array
<t4nk955>
:0
<ljarvis>
you want map, or more specifically, map! but, you only care about the string value once, so just use it within your second block
<workmad3>
or just create your array with 'numbers = [*"1".."999"]'
onkara has quit [Quit: onkara]
<ljarvis>
^ which is the same as ("1".."999").to_a
onkara has joined #ruby-lang
apeiros has quit [Ping timeout: 272 seconds]
<t4nk955>
I'll try #map, since it seems like a thing I should know.
<t4nk955>
Isn't it normal to only call him by his last name?
yfeldblum has joined #ruby-lang
SuMo_D has quit [Remote host closed the connection]
<ljarvis>
it doesn't have a name
SuMo_D has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
benlovell has joined #ruby-lang
onkara has quit [Quit: onkara]
hackingoff has quit [Ping timeout: 255 seconds]
koderok has quit [Quit: koderok]
SuMo_D has quit [Remote host closed the connection]
mamantoha has quit [Ping timeout: 245 seconds]
onkara has joined #ruby-lang
SuMo_D has joined #ruby-lang
<workmad3>
ljarvis: any suggestion on a relatively reliable way to tell if a CSV file is using commas or tabs as separators? (I know, it's a TSV when using tabs...)
kaczmar has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
<ljarvis>
workmad3: no I haven't faced that fortunately. I would maybe pull in the first row and do some dumb testing against it
<ljarvis>
in general if it's using tabs it should be relatively obvious
jo__ has joined #ruby-lang
banister is now known as banisterfiend
<t4nk955>
ljarvis: Of course he had a name. How else would he get into the yellow book? I'm guessing it was Frank.
imperator has joined #ruby-lang
t4nk955 is now known as Frank_Monster
RobertBirnie has joined #ruby-lang
gmas has joined #ruby-lang
<ljarvis>
uh wat
<ljarvis>
im not even gonna try and argue that
<ljarvis>
im off, see ya
nelsonsar has quit [Remote host closed the connection]
mamantoha_ has joined #ruby-lang
gmas has quit [Ping timeout: 250 seconds]
symm- has joined #ruby-lang
danijoo_ has quit [Quit: Leaving...]
nertzy has joined #ruby-lang
Xzanron has joined #ruby-lang
danijoo has joined #ruby-lang
apeiros has joined #ruby-lang
nelsonsar has joined #ruby-lang
chinmay_dd has quit [Read error: Connection reset by peer]
<workmad3>
ljarvis: my worry is a header line that uses tabs for separators and commas in some headers... but then thinking about it, I'm looking for specific field signatures so I can do a dumb solution :)
benlovell has quit [Ping timeout: 250 seconds]
fusillicode has quit [Ping timeout: 272 seconds]
<bradland>
workmad3: to tell if a file is using csv or tsv, i’d look at the consistency of the appearance of those characters across a sample of rows
<workmad3>
bradland: I require a header line with a certain set of headers ;)
<workmad3>
bradland: and that's before I do any processing
<workmad3>
bradland: so I can just look to see if the headers are there with either tabs or commas
<bradland>
even easier :)
symm- has quit [Ping timeout: 240 seconds]
solars has joined #ruby-lang
__butch__ has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
arBmind has joined #ruby-lang
koderok has joined #ruby-lang
workmad3 has quit [Ping timeout: 244 seconds]
arBmind has quit [Quit: Leaving.]
mikecmpbll has quit [Ping timeout: 256 seconds]
GBrawl has joined #ruby-lang
hahuang65 has quit [Ping timeout: 272 seconds]
yfeldblum has joined #ruby-lang
_elia has quit [Quit: Computer has gone to sleep.]
dacamp has left #ruby-lang [#ruby-lang]
mustmodify has joined #ruby-lang
<mustmodify>
I'm looking for an iterator that works like detect, stopping on the first non-falseish result, but which returns the result. I just wrote it but thought I would see if it was already in the language and somehow I had missed it?
yfeldblum has quit [Ping timeout: 265 seconds]
mnngfltg has quit [Remote host closed the connection]
banister has joined #ruby-lang
iliketurtles has joined #ruby-lang
fusillicode has joined #ruby-lang
banisterfiend has quit [Read error: Connection reset by peer]
<tbuehlmann>
mustmodify, #detect will return the element when found, isn't that what you want?
jmrepetti has quit [Remote host closed the connection]
iliketurtles has quit [Remote host closed the connection]
<jhass>
mustmodify: [nil, false].sample ?
fusillicode1 has joined #ruby-lang
g0bl1n has quit [Ping timeout: 265 seconds]
workmad3 has joined #ruby-lang
fusillicode has quit [Ping timeout: 265 seconds]
mamantoha_ has quit [Ping timeout: 264 seconds]
arooni-mobile has joined #ruby-lang
ahmetkapikiran has joined #ruby-lang
snovity has quit [Read error: Connection reset by peer]
<mustmodify>
jhass: tbuehlamann: sorry, I was lost track of this window.
AKASkip has joined #ruby-lang
nelsonsar has quit [Remote host closed the connection]
sepp2k has quit [Quit: Konversation terminated!]
<mustmodify>
if I'm looking for something in a cache, then in a database, and finally via API call, then [cache, db, api].first_result{|resource| resource.query } should give me ... the answer.
djbkd has joined #ruby-lang
<jhass>
that's a plain .find/.detect
<jhass>
oh, wait
<mustmodify>
no. Detect will return the resource that succeeded
<jhass>
you actually want the old lazy hack:
workmad3 has quit [Ping timeout: 245 seconds]
<mustmodify>
out = nil
<jhass>
.lazy.map(&:query).find(&:itself)
<mustmodify>
resources.detect{|x| out = x.query}
<mustmodify>
oh wait
mamantoha_ has joined #ruby-lang
<mustmodify>
Well I don't know what .lazy does...
<mustmodify>
but that does seem hackish. :P
wallerdev has joined #ruby-lang
<mustmodify>
here's the iterator I wrote. Not wild about return but it was the first solution that occurred to me.
Thecrazylumberja has quit [Read error: Connection reset by peer]
<bradland>
cleopatra: looks like readline isn’t installed on your system. what operating system are you using?
loincloth has joined #ruby-lang
marr has joined #ruby-lang
onkara has quit [Quit: onkara]
SuMo_D has quit [Remote host closed the connection]
<Phrogz>
Opinions requested: I'm writing a method that lets you find objects by arbitrary attribute names, or three special values. For example, jungle.find( color:'orange', TYPE:'model' ). "TYPE" is a special key. I cannot use type:'model' in case there is an arbitrary attribute named "type". So, which of the following do you prefer?
<cleopatra>
bradland, i am using ubuntu last vercion
seank_ has quit [Read error: Connection reset by peer]
kurko___ has quit [Read error: Connection reset by peer]
seank_ has joined #ruby-lang
<Phrogz>
nofxx: I am writing a method that lets you specify a hash of options. The keys to the hash can be any symbol. I also have four 'special' keys that I need to distinguish, but I can't let them collide with any same-named key. So, which option do you prefer?
<Phrogz>
The one with value 0 is the 'special' key in this case, while "smooth" is a normal name. I'm currently strongly leaning towards #3. I did #1 originally, and found it quite cumbersome.
ur5us has joined #ruby-lang
<Phrogz>
It has to be both clear and easy-to-type, since this is going to be used heavily in a REPL environment.
<cleopatra>
bradland, i trink i have fix the problem
skade has quit [Quit: Computer has gone to sleep.]
mirageglobe has joined #ruby-lang
Sunlorhic has joined #ruby-lang
dagda1_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
matp_ has joined #ruby-lang
matp has quit [Ping timeout: 272 seconds]
ZaRDaK has joined #ruby-lang
Sunlorhic has quit [Ping timeout: 255 seconds]
dagda1_ has joined #ruby-lang
Sunlorhic has joined #ruby-lang
thagomizer has quit [Quit: Leaving.]
Thecrazylumberja has joined #ruby-lang
thagomizer has joined #ruby-lang
thagomizer has quit [Client Quit]
kaczmar has joined #ruby-lang
Sunlorhic has quit [Ping timeout: 240 seconds]
djbkd has quit [Remote host closed the connection]
whippythellama has quit [Quit: whippythellama]
solars has quit [Quit: WeeChat 0.4.2]
solars has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
ldnunes has quit [Quit: Leaving]
SuMo_D has joined #ruby-lang
allomov has quit [Remote host closed the connection]
SuMo_D has quit [Remote host closed the connection]
allomov has joined #ruby-lang
dwknoxy is now known as dknox-bbl
nelsonsar has quit [Remote host closed the connection]
<nofxx>
Phrogz, .slide(0).only(:smooth)
<nofxx>
(7)
<nofxx>
Phrogz, .slide(0).filter(:smooth) not sure I got the attr to get a verb
francisfish has joined #ruby-lang
emmesswhy has quit [Quit: emmesswhy]
amigo99 has joined #ruby-lang
apt-get_ has joined #ruby-lang
sarkyniin has quit [Ping timeout: 265 seconds]
hahuang65 has joined #ruby-lang
yfeldblum has joined #ruby-lang
nelsonsar has joined #ruby-lang
mirageglobe has quit [Remote host closed the connection]
SuMo_D has joined #ruby-lang
mirageglobe has joined #ruby-lang
solars has quit [Quit: WeeChat 0.4.2]
solars has joined #ruby-lang
hahuang65 has quit [Ping timeout: 240 seconds]
solars has quit [Client Quit]
mirageglobe has quit [Ping timeout: 244 seconds]
allomov_ has joined #ruby-lang
solars has joined #ruby-lang
mirageglobe has joined #ruby-lang
apt-get_ has quit [Ping timeout: 240 seconds]
allomov has quit [Ping timeout: 245 seconds]
matp has joined #ruby-lang
djbkd has joined #ruby-lang
cantonic has quit [Read error: Connection reset by peer]
francisfish has quit [Remote host closed the connection]
cantonic has joined #ruby-lang
matp_ has quit [Ping timeout: 265 seconds]
Sunlorhic has joined #ruby-lang
kurko__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skade has joined #ruby-lang
[spoiler] has quit [Quit: Leaving]
spastorino has joined #ruby-lang
jmrepetti has joined #ruby-lang
seank_ has quit [Read error: Connection reset by peer]
seank_ has joined #ruby-lang
wallerdev has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
seank_ has quit [Ping timeout: 244 seconds]
miqui has quit [Remote host closed the connection]
whippythellama has joined #ruby-lang
dangerousdave has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
matp_ has joined #ruby-lang
cleopatra has quit [Excess Flood]
banister has joined #ruby-lang
whippythellama has quit [Client Quit]
banister has quit [Client Quit]
whippythellama has joined #ruby-lang
dangerousdave has quit [Client Quit]
allomov_ has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
dangerousdave has joined #ruby-lang
djbkd has joined #ruby-lang
matp has quit [Ping timeout: 250 seconds]
allomov has joined #ruby-lang
dangerousdave has quit [Client Quit]
dangerousdave has joined #ruby-lang
dangerousdave has quit [Client Quit]
allomov has quit [Ping timeout: 255 seconds]
dangerousdave has joined #ruby-lang
Sunlorhic has quit [Ping timeout: 264 seconds]
hahuang65 has joined #ruby-lang
Phrogz has quit [Quit: Page closed]
arooni-mobile has quit [Ping timeout: 264 seconds]
cantonic has quit [Quit: cantonic]
hahuang65 has quit [Ping timeout: 245 seconds]
mirageglobe has quit [Remote host closed the connection]
Xzanron has quit [Quit: Leaving]
mistym has quit [Remote host closed the connection]
mirageglobe has joined #ruby-lang
xalupeao has joined #ruby-lang
<xalupeao>
Hi guys, ruby have a framework to create a game ? ... similar python with pygame ?
nelsonsar has quit [Remote host closed the connection]
<bnagy>
so what's my next step to bug people about it?
kaczmar has quit [Client Quit]
<bnagy>
now that I have a little time to devote to it again :
oleo__ has joined #ruby-lang
Sgeo_ has joined #ruby-lang
<womble>
bnagy: Sure that's the right bug? That seems to be about ECC, not PFS
oleo__ has quit [Client Quit]
oleo has joined #ruby-lang
<bnagy>
the ECDHE suites are 'ephemeral' ie pfs
rikkipitt has joined #ruby-lang
<womble>
bnagy: But you don't need EC to do ephemeral DH
<womble>
A DHE-RSA cipherspec would give you PFS without EC
<bnagy>
you don't, it's just that all the good new suites are ecdhe
Sgeo has quit [Ping timeout: 245 seconds]
<bnagy>
and tbh I can't really be fucked having a pedantic discussion about it
<womble>
That being said, I've bumped up against OpenSSL::PKey::EC's insane API, and I'd love to see it fixed (with a baseball bat if necessary)
rikkipitt has quit [Client Quit]
<bnagy>
all of the openssl API is insane
<womble>
There is that.
<bnagy>
but fixing it is boiling the ocean. I just want it to work.
<bnagy>
I guess the root of the issue is that the server-side tests aren't even there
<bnagy>
I suspect that it _is_ actually in the way they've tried to shoehorn the EC stuff into the same PKEY api
<bnagy>
but I can't get much out of the C binding without debugging into openssl itself
<bnagy>
cause the binding produces an incorrect error
<bnagy>
SO, the question remains - what's the best way to move this along?
<bnagy>
contact the maintainer / open a new bug / mailing list / ... ?
cornerma1 has joined #ruby-lang
<womble>
bnagy: I think your bug is separate enough from that one to be worth opening a separate issue, otherwise you might just stall John's fix while the cause of your bug gets sorted out.
solars has quit [Ping timeout: 244 seconds]
<womble>
As far as getting action, well, I don't know -- I've got a security bug (with patch) in OpenSSL::ASN1 that's seen no movement in a year, so if you work out some way to move that sort of thing ahead, I'd like to know about it, too...
banister has joined #ruby-lang
cleopatra has quit [Read error: Connection timed out]
cornerman has quit [Ping timeout: 255 seconds]
cornerma1 is now known as cornerman
dknox-bbl is now known as dknox
<bnagy>
well his bug is definitely the root of mine
<womble>
Sorry, it's been six months, not a year.
<bnagy>
I haven't actually verified the DHE-RSA suites cause I wouldn't use them
JohnBat26 has quit [Ping timeout: 264 seconds]
<bnagy>
but yeah I can reopen it as EC Certs Just Don't Work
<imperator>
3rd party gem maybe?
<bnagy>
well they work clientside
<imperator>
dunno what's out there
<bnagy>
you just can't have them on your server
<bnagy>
imperator: I thought about wrapping boringssl or something
yusuf1 has quit [Quit: Leaving.]
<bnagy>
but ( sorry ) I wouldn't use ruby as a TLS server in a real project
<womble>
It wouldn't be my first choice either.
<bnagy>
so it's too much work
__butch__ has quit [Quit: Leaving.]
<bnagy>
and I can't switch to jruby cause they haven't implemented EC, even though bouncycastle support it :)
<headius>
help us do that :-)
GaelanAintAround has quit [Ping timeout: 265 seconds]
<bnagy>
headius: I know, I know
zz_dlu has quit [Ping timeout: 245 seconds]
<bnagy>
but it's hard, and it's kind of a side issue
<headius>
it is
<bnagy>
cause that would only help jruby peeps
cornerma1 has joined #ruby-lang
<bnagy>
and tbh it should probably be a java person doing it
<bnagy>
or at least someone that knows any java at all
GBrawl has quit [Ping timeout: 265 seconds]
mirageglobe has joined #ruby-lang
zz_dlu has joined #ruby-lang
miqui has joined #ruby-lang
cornerman has quit [Ping timeout: 272 seconds]
cornerma1 is now known as cornerman
GaelanAintAround has joined #ruby-lang
amigo99 has quit [Quit: This computer has gone to sleep]
matp has joined #ruby-lang
mirageglobe has quit [Ping timeout: 245 seconds]
jmrepetti has quit [Remote host closed the connection]
matp_ has quit [Ping timeout: 240 seconds]
jmrepetti has joined #ruby-lang
imperator has quit [Quit: Leaving]
nelsonsar has quit [Remote host closed the connection]
malconis_ has joined #ruby-lang
wamarcum has joined #ruby-lang
jimbach_ has quit [Remote host closed the connection]
malconis has quit [Ping timeout: 250 seconds]
haxxtivist has quit [Ping timeout: 272 seconds]
havenwood has quit [Remote host closed the connection]
nelsonsar has joined #ruby-lang
charliesome has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
cmhobbs has quit [Remote host closed the connection]
_djbkd has joined #ruby-lang
AKASkip has quit [Ping timeout: 240 seconds]
loincloth has quit [Remote host closed the connection]
allomov has joined #ruby-lang
_djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
nofxx has quit [Ping timeout: 255 seconds]
allomov has quit [Ping timeout: 258 seconds]
ducklobster has quit [Remote host closed the connection]
ducklobster has joined #ruby-lang
symm- has quit [Ping timeout: 245 seconds]
cantonic has joined #ruby-lang
nelsonsar has quit [Remote host closed the connection]
jmrepetti has quit [Remote host closed the connection]
nelsonsar has joined #ruby-lang
mamantoha has quit [Ping timeout: 258 seconds]
David_H__ has joined #ruby-lang
cantonic has quit [Client Quit]
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
David_H_Smith has quit [Ping timeout: 244 seconds]