igotnolegs has quit [Quit: Computer has gone to sleep.]
ryanf has joined #ruby-lang
mytrile has joined #ruby-lang
brdude has joined #ruby-lang
fayimora has joined #ruby-lang
t52509 has quit [Remote host closed the connection]
dhruvasagar has quit [Read error: Connection reset by peer]
t10939 has joined #ruby-lang
dhruvasagar has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
workmad3 has quit [Ping timeout: 246 seconds]
brdude has quit [Ping timeout: 252 seconds]
fayimora has quit [Quit: Busy…..zzzzz]
krz has quit [Quit: krz]
gnufied has joined #ruby-lang
<banisterfiend>
gnufied: hey bro
<gnufied>
banisterfiend: hey
banisterfiend has quit [Ping timeout: 248 seconds]
iamlacroix has joined #ruby-lang
<erikh>
BROS
<erikh>
zenny. I lol'd.
brdude has joined #ruby-lang
dc5ala has joined #ruby-lang
ConstantineXVI has quit [Ping timeout: 245 seconds]
Weems has joined #ruby-lang
Weems has joined #ruby-lang
Weems has quit [Changing host]
yats has joined #ruby-lang
Wardrop has joined #ruby-lang
qwerxy has joined #ruby-lang
srbartlett has quit [Remote host closed the connection]
t10939 has quit [Remote host closed the connection]
t41067 has joined #ruby-lang
d3vic3 has joined #ruby-lang
publicvoid has quit [Ping timeout: 260 seconds]
dreamhawk has joined #ruby-lang
<dreamhawk>
http://pastebin.com/YieCayXB <-- Can someone tell me , how many errors i have? ^^. All i want is when, user inputs "Y", it shall restart... but, it justs Exits... im new to this ^^
brdude has quit [Quit: brdude]
thone_ has joined #ruby-lang
rolfb has joined #ruby-lang
<bnagy>
a lot
ConstantineXVI has joined #ruby-lang
<bnagy>
I would not use a class, and then wrap the rest of the functionality in a loop
<bnagy>
...exactly what I told you last time, in fact :)
<dreamhawk>
bnagy: i know its faulty ;D.
<bnagy>
also, it would be a lot easier to read your code if you used proper indenting
<dreamhawk>
bnagy: yeah, but then i had to do alot other stuff, now i kinda got time for ruby again ^^
<dreamhawk>
bnagy: what editor you using ? im just using nano.
<bnagy>
I use vim and sublime text
dhruvasagar has quit [Ping timeout: 245 seconds]
<bnagy>
either of those will indent for you
<dreamhawk>
bnagy: yeah, i need too configure my nano more...
banisterfiend has joined #ruby-lang
<dreamhawk>
bnagy: i just thought if i wrapped it all into a class, it would work with Tiss.new if foo == 'Y'..
thone has quit [Ping timeout: 272 seconds]
perry is now known as perryh_away
ConstantineXVI has quit [Ping timeout: 245 seconds]
<bnagy>
it doesn't seem like a logical abstraction to me
pygmael has joined #ruby-lang
<bnagy>
this is basically a very functional script, get a line, do something, get a line
<bnagy>
using classes for that kind of stuff is just going to lead to bad habits
<bnagy>
basically loop do; get a guess; flip coin; output result; ;ask to continue; break unless gets.chomp=~/^[Yy]/; end
brownies has joined #ruby-lang
<brownies>
hi
<brownies>
i have a simple method... is driving me insane
<brownies>
basically, i do x = thing_that_returns_bool?
<brownies>
x is false
<brownies>
then i write a statement ... if thing_that_returns_bool? do_stuff end
<brownies>
bnagy: i'm hoping there's a third possibility.
<bnagy>
possible - it's "false" (the String 'false') and not false (instance of FalseClass)
<bnagy>
try inspecting using p instead of puts
gnufied has quit [Quit: Leaving.]
<bnagy>
like the string 'false' is truthy, as are all strings, including empty ones
<brownies>
so i just do "p x" instead of "puts x" ?
<bnagy>
yeah
<brownies>
yeah, i was wondering if it was some obscure quirk of Ruby, or some internal thing that changed in the latest point release of Rails... that might be throwing all this off.
<brownies>
let me try that.
<brownies>
bnagy: yes, x is "false" ... good god.
<brownies>
now the only question is HOW
ConstantineXVI has joined #ruby-lang
<bnagy>
cause you returned the value in the cookie thingy directly
<bnagy>
and not actually a bool
<brownies>
oh, shit.
<dr_bob>
:-)
<brownies>
bnagy: in my defense... this used to work before i ran "bundle upgrade" ... sigh.
<brownies>
so it IS a Rails implementation detail... combined with my admittedly sloppy code. =/
<dreamhawk>
bnagy: woho! i did it
<bnagy>
I know 0 about rails, but I dunno if I would expect a cookie thing to hold true ruby objects
<bnagy>
brownies: try like return true if cookie[:thing] && cookie[:thing]=="true"
<bnagy>
or similar I guess
<bnagy>
or invert the logic and do it against "false" or false
<bnagy>
dreamhawk: getting better. I think you'll find your continuation handling isn't quite right though
gnufied1 has joined #ruby-lang
<dreamhawk>
bnagy: i guess that (if i continue learning ruby) in a few years, i would look back and say "Oh God, why?" :)
<bnagy>
personally I don't like until loops that much
<bnagy>
cause you have to do what you did and set a junk variable, which is untidy
<dreamhawk>
i just found it as a solution to my current problem
<bnagy>
using an infinite loop and breaking is tidier
<dreamhawk>
so called "ugly-fix" in sweden ;D
<bnagy>
but to some extent, working is working. Also some people find until loops good to read
<dreamhawk>
bnagy: at first, there was the toss-script, which exited after the toss, i just wanted to make a "TRy again"-feature to it... for experimenting
Bosox20051 has quit [Quit: Leaving]
vmoravec has joined #ruby-lang
<bnagy>
yeah, but I am pretty sure if you enter 'q' at try again and then 'q' at 'why didn't you entry Yn it will restart anyway
<bnagy>
just a small logic bug
dejongge has joined #ruby-lang
<banisterfiend>
bnagy: hey
<bnagy>
not to harp on about it, but as a security person, I prefer to see unexpected input cause failures, not successes, as a pattern
<bnagy>
dreamhawk: if you compare my approach of break unless gets=~/^[Yy]/, that will _only_ reloop if they hit Y or y
<dreamhawk>
bnagy: i know what you mean, input-filtering is up to come.
ohsix has quit [Read error: Operation timed out]
<bnagy>
it's not input filtering, it's backwards design
<yats>
does the net/smtp start method also call helo
<dreamhawk>
bnagy: yes, i found that solution as well, but i started with end until foo == 'n'
unsymbol has joined #ruby-lang
<dreamhawk>
bnagy: but i know what you are looking for :)
unsymbol has left #ruby-lang [#ruby-lang]
<bnagy>
yats: that sounds like a question for the docs?
<yats>
because when i start a smtp session it does a helo
<dreamhawk>
helo as in "Hello!" or in something else? ^^
<bnagy>
yats: logically, a session should start with helo/ehlo
Criztian has joined #ruby-lang
<bnagy>
but when it's actually sent I guess is an implementation detail
<bnagy>
and probably in the docs :)
cdt has joined #ruby-lang
bluemonk has quit [Ping timeout: 245 seconds]
bluemonk has joined #ruby-lang
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
brdude has quit [Quit: brdude]
gnufied1 has quit [Quit: Leaving.]
t41067 has quit [Remote host closed the connection]
t47148 has joined #ruby-lang
sora_h is now known as s0ra_h
brianpWins has quit [Quit: brianpWins]
runeb has joined #ruby-lang
futurechimp has joined #ruby-lang
workmad3 has joined #ruby-lang
<yats>
bnagy: ok
<banisterfiend>
yats: r u me
s0ra_h is now known as sora_h
outsmartin has joined #ruby-lang
voker57_ has joined #ruby-lang
voker57 has quit [Ping timeout: 276 seconds]
banisterfiend is now known as banister`sleep
pabloh has quit [Quit: Ex-Chat]
dtribble has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby-lang
sora_h is now known as s0ra_h
Leeky_afk is now known as Leeky
<yats>
banister`sleep: what ?
ryanf has quit [Quit: leaving]
Criztian has quit [Remote host closed the connection]
esad has joined #ruby-lang
brownies has left #ruby-lang [#ruby-lang]
tooky has quit [Remote host closed the connection]
t47148 has quit [Remote host closed the connection]
t93910 has joined #ruby-lang
foucist has joined #ruby-lang
<foucist>
how do you do something like [1,2] & [2,3] when you have an array of arrays? [[1,2],[2,3]].foobar(&) ?
<foucist>
inject?
esad has quit [Quit: Computer has gone to sleep.]
<heftig>
inject(:&)
<foucist>
cool beans!
postmodern has quit [Quit: Leaving]
sandbags has joined #ruby-lang
s0ra_h is now known as sora_h
* sandbags
sighs
<sandbags>
i come back to Ruby after months of Objective-C and, of course, I am typing @ in front of all my strings now
sailias has quit [Quit: Leaving.]
chris2 has quit [Read error: Connection reset by peer]
sora_h is now known as s0ra_h
<banister`sleep>
sandbags: lols
<banister`sleep>
sandbags: objective c is so damn boring
jtoy has joined #ruby-lang
<banister`sleep>
but i love its OO model :)
<banister`sleep>
and it does have some cool things
<sandbags>
banister`sleep: i rather like Objective-C
<sandbags>
i mean, it can be a bit verbose at times
<banister`sleep>
sandbags: i jsut got bored of editing .m + .h files everytime i'd do a refactor
<sandbags>
but, given the constraint of being a C superset, it's quite elegant ;-)
<banister`sleep>
the time it took to do simple refactors was really irritating
<banister`sleep>
sandbags: Yeah i agree
<banister`sleep>
it's pretty nice for what it is, but it's not a fun language to program, the distance between idea and implementation is much father in obj c than in ruby
<sandbags>
i'm trying out AppCode which seems to have a pretty good handle on refactorings
<banister`sleep>
but not really obj c's fault, but it's still horrible
<sandbags>
ah well, there we disagree.. i have fun with it
<banister`sleep>
sandbags: well it depends on what u're used to i guess. Do you know many dynamic languages?
<sandbags>
a fair few
<banister`sleep>
cos im guessing java programmers may think what they're doing is fun until they learn a more concise language ;)
<sandbags>
ah well a lot of the fun of using Obj-C comes from the Cocoa frameworks
<banister`sleep>
cocoa is cool
t93910 has quit [Remote host closed the connection]
jtoy has quit [Ping timeout: 272 seconds]
t42011 has joined #ruby-lang
Criztian has joined #ruby-lang
<manveru>
if you think Obj-C is boring... did you ever try Go? :)
futurechimp has quit [Ping timeout: 240 seconds]
cantonic has quit [Quit: cantonic]
<sandbags>
i'm currently learning Clojure
<sandbags>
a Lisp I could actually see myself using
<manveru>
i'd give clojure a try if it wasn't for the jvm
<sandbags>
which was always the barrier to my going anywhere with Lisp in the past
<manveru>
i kinda like chicken and sbcl
<sandbags>
manveru: what's wrong with the JVM?
<sandbags>
i mean, as a VM
<manveru>
if i have to use the jvm i can just as well use jruby
<sandbags>
ah, well, i'm learning Clojure for Clojure :)
<manveru>
though for android i like mirah :)
<manveru>
yeah
<sandbags>
i've done some functional stuff in Lisp and Scheme and also Erlang
<sandbags>
but I like what they've done with CLJ
<sandbags>
i could see myself using it in places i might otherwise have used Ruby
<manveru>
anything in particular?
<manveru>
can't say i've given it much of a chance
<yats>
anyone worked with email verification
<yats>
How can i verify if an email is valid or not
<manveru>
i mostly loathe the state of java on linux, the size of the jvm, and the neverending feeling that i'm waiting for it to start up all day
<yorickpeterse>
dreamhawk: you'll probably want to ask this in #rubyonrails/#rails (or whatever the channel was)
futurechimp has joined #ruby-lang
<dreamhawk>
yorickpeterse: oh sorry
<manveru>
oh, mail address verification?
<injekt>
oh email sending verification?
<yorickpeterse>
yats: you can't do it reliably
<yorickpeterse>
Not without sending an Email
<sandbags>
manveru: beyond a soft spot for Lisp (- the cruft which CLJ attempts to mitigate) I'm interested in whether a (relatively)pure functional approach really has benefits to writing parallel software
<injekt>
just send an email
<yats>
injekt: i wanna do it without sedning an email . Its an CRM cleaning application
qwerxy has quit [Quit: offski]
<manveru>
yats: you want to do _what_?
d3vic3 has quit [Ping timeout: 272 seconds]
<injekt>
yeah, your question is confusing
<whitequark>
erm, I was here at yesterdays evening and people were talking about email verification
<injekt>
and you also posted it on another channel
<whitequark>
do you STILL discuss it?!..
<sandbags>
i think he means he's trying to clean up the database of a CRM system
<injekt>
doing that frustrates people :)
s0ra_h is now known as sora_h
<yats>
manveru: If an email is given validate it as in whether it really exists
<injekt>
send an email
<manveru>
yats: an email _what_?
<manveru>
address?
<manveru>
body?
<manveru>
header?
<injekt>
manveru: the recipient exists as an email address
<injekt>
I'm guesing
<injekt>
+s
<yats>
if i give u abc@example.com
d3vic3 has joined #ruby-lang
<yats>
validate if it exists or not
<manveru>
no way
<sandbags>
yats: there is no truly reliable method, i don't think SMTP VRFY is useful these days
<injekt>
exists is so ambiguous lol
<injekt>
but no
<injekt>
send it
<yats>
i cant increase y bounce rate hence need to clean before an email campaign
cantonic has quit [Quit: cantonic]
<yats>
sandbags: how to send VRFY command using net/smpt
<yats>
i am able to send helo ehlo mail from and rcpt
<sandbags>
yats: i'm pretty sure that's not going to help you, with the prevalence of spamming servers these days do not, I think, honour VRFY
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
<yats>
sandbags: So no other way
x0F_ is now known as x0F
<sandbags>
yats: no, i'm afraid this is a fact of life if you do CRM
<sandbags>
your database will rot and become an expensive liability
<yats>
sandbags: :(
srbartlett has joined #ruby-lang
<injekt>
:D
Hakon has quit [Quit: Leaving...]
<yats>
sandbags: but there are tons of SaaS provideing this service?
<sandbags>
and you think they are doing this via some kind of secret protocol?
<injekt>
of course
bytephilia has joined #ruby-lang
<sandbags>
they are either verifying email by sending an email, or by having a partnership with (e.g.) twitter/facebook/google that allows them to check if an email is in use
s1n4 has quit [Quit: peace out]
<yorickpeterse>
"yorick+derp+doesnotexist@gmail.com: This email exists" No it doesn't
<yorickpeterse>
They probably just use a regex and check for the domain
<sandbags>
well i was assuming they were any good :)
<yorickpeterse>
yorick@local is apparently also invalid
<enroxorz-work>
Hey Guys, I am having an algorithm problem in ruby. Essentially I have this ( http://pastebin.com/9e4UhZXp ) and the amount of data I am messing with forces the memory to balloon to a ridiculous amount (and causing errors). What am I doing wrong?
<rue>
Nothing there. If your dataset is large, reading it lazily would be best
<enroxorz-work>
sadly, its two very large xls files that i have to parse
<rue>
If you need to have the entire dataset in memory, there’s little you can do about it…
<enroxorz-work>
hmm. time to re-think from scratch
<rue>
enroxorz-work: Is the data truly completely mixed, so that you can’t chunk it at all?
<rue>
There’re things like map/reduce, of course…
<enroxorz-work>
im not too savvy with map/reduce. it's a mixed data set BUT I think i have an idea of what I need to do. thanks rue, i just need to go to square 1 to figure this out.
<rue>
Cool beens
Weems has quit []
fayimora has quit [Quit: Be back in a gifii]
t50144 has quit [Remote host closed the connection]
sockmonk has quit [Remote host closed the connection]
andrewhl has quit [Remote host closed the connection]
banister`sleep has joined #ruby-lang
bryancp has quit [Remote host closed the connection]
Axsuul has joined #ruby-lang
sockmonk` has quit [Ping timeout: 240 seconds]
banisterfiend` has quit [Ping timeout: 265 seconds]
Criztian has quit []
kvirani has quit [Remote host closed the connection]
rcassidy has left #ruby-lang [#ruby-lang]
rcassidy has joined #ruby-lang
bluemonk has quit [Ping timeout: 256 seconds]
bluemonk has joined #ruby-lang
tooky has quit [Ping timeout: 246 seconds]
qpingu has quit [Ping timeout: 260 seconds]
voker57__ has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
akira989_ has quit [Remote host closed the connection]
snorkdude has joined #ruby-lang
krz has quit [Ping timeout: 246 seconds]
burgestrand has quit [Quit: Leaving.]
esad has joined #ruby-lang
havenn has joined #ruby-lang
qpingu has joined #ruby-lang
brdude has joined #ruby-lang
bryancp has joined #ruby-lang
bryancp has quit [Remote host closed the connection]
krz has joined #ruby-lang
dfr|mac has joined #ruby-lang
s0ra_h is now known as sora_h
erichmenge has quit [Quit: Be back later]
mistym has quit [Remote host closed the connection]
akira989 has joined #ruby-lang
erichmenge has joined #ruby-lang
bryancp has joined #ruby-lang
bfreeman has quit [Quit: bfreeman]
lcdhoffman has quit [Quit: lcdhoffman]
lcdhoffman has joined #ruby-lang
coryf has quit [Remote host closed the connection]
dfr|mac_ has joined #ruby-lang
snorkdude has quit [Remote host closed the connection]
dfr|mac has quit [Ping timeout: 240 seconds]
MrWGW has quit [Ping timeout: 244 seconds]
erichmenge has quit [Quit: Be back later]
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
sora_h is now known as s0ra_h
esad has quit [Quit: Computer has gone to sleep.]
MrWGW has joined #ruby-lang
MrWGW has quit [Remote host closed the connection]
MrWGW has joined #ruby-lang
vesan has quit [Read error: Connection reset by peer]
NemesisD has joined #ruby-lang
<NemesisD>
i'm having a hard time reasoning about the GIL. if i've got a pool of threads and each is downloading data from the internet using open-uri, will that actually happen in parallel
<heftig>
sure
<heftig>
IO is parallelized
<heftig>
ruby code can't be parallel
t48884 has quit [Remote host closed the connection]
<heftig>
you still get your concurrency
t39794 has joined #ruby-lang
workmad3 has quit [Ping timeout: 252 seconds]
<NemesisD>
heftig: if i use open-uri entirely contained in each thread, i shouldn't have a problem right? what about opening and writing files (again, the open and close is all in 1 thread)
<NemesisD>
so each thread is downloading data with open uri and then writing it to a file
<heftig>
that's all IO-bound
Nisstyre has quit [Quit: Leaving]
<NemesisD>
heftig: oh yeah i now that, i just didn't know if there are gotchas about file descriptors being opened and closed like that non-deterministically
<NemesisD>
the threads don't share descriptors or anything but i've been brought up to have great fear of ruby threading in MRI
<heftig>
your threads will spend most of their time waiting on the IO to complete. while they're doing that they don't have the GIL
<NemesisD>
heftig: but back in ruby land when the thread is opening a file to write, ruby synchronizes (with the gil?) to ensure, for example, that it doesn't assign the same file descriptor to 2 threads?
slyphon is now known as slyphon_away
<heftig>
that can't happen
<heftig>
the system won't let it
brdude has quit [Read error: Connection reset by peer]
brdude has joined #ruby-lang
qwerxy has joined #ruby-lang
jackhammer2022 has joined #ruby-lang
itsmeduncan has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
qwerxy has quit [Client Quit]
arooni-mobile has joined #ruby-lang
solars has quit [Ping timeout: 240 seconds]
mistym has joined #ruby-lang
slyphon_away is now known as slyphon
cesar_18 has quit [Read error: Connection reset by peer]
dfr|mac_ has quit [Remote host closed the connection]
vesan has joined #ruby-lang
seanstickle has joined #ruby-lang
s0ra_h is now known as sora_h
hynkle has quit [Quit: Computer has gone to sleep.]