fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
cakehero has quit [Quit: Computer has gone to sleep.]
ph^ has quit [Ping timeout: 264 seconds]
Juul has quit [Quit: Leaving]
<Spooner>
qq99 : contents = File.read(@proxy) is simpler than 86..88 - Not sure what params[:splat] is expected to be, but that seems to be the only place one could "hack". Maybe regexp it to validate that it is sensible?
digitalcakestud1 has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<Spooner>
Though using a db, e.g. MongoDB, sounds a bit more sensible than saving files.
digitalcakestudi has quit [Ping timeout: 244 seconds]
<Spooner>
Also a nice idea to limit the size of the file and/or amount appended (if appropriate).
lggr has joined #ruby
sailias has joined #ruby
<Spooner>
chiel BASE62.sample(5).join is even simpler, but each char would be unique :D
nari has quit [Ping timeout: 264 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
elico has quit [Quit: elico]
<Spooner>
falieson : Still struggling with max_id?
Virunga has quit [Remote host closed the connection]
sent-hil has joined #ruby
sent-hil has quit [Remote host closed the connection]
mxweas has joined #ruby
seanstickle has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
skogis has quit [Ping timeout: 264 seconds]
<falieson>
Spooner: a bit, its not as simple as just declaring it
<Spooner>
falieson : while (max_id = dataset.min(:t_id)) > 248209782517932032 do
<Spooner>
If you want to do it that way, max_id = Float::INFINITY is better than 12313123123123123 ;)
<falieson>
Spooner: lol
ScottNYC has quit [Quit: ScottNYC]
<falieson>
Spooner: so your way declares the var at the same time?
<chiel>
Spooner: ah yeah, that's not necessary, means there will be less combinations. :)
arubin has quit [Quit: arubin]
<Spooner>
Yeah. Or have that line twice. Once before the while and once at the end of the while. But yes, doing it the way I suggested both sets it and tests it in one.
gfontenot has joined #ruby
<Spooner>
falieson : And use #each not #map (now is a good tiem to look at the Array page and find out the difference ;) ).
pfaff has quit [Ping timeout: 245 seconds]
ffranz has quit [Quit: Leaving]
lggr has joined #ruby
<_7894>
Map returns the array consisting of each return value
<falieson>
Heh so I started that script (its supposed to pull a lot of data)
<falieson>
and since I'm pretty nubby I use phpmyadmin to browse through mysql result
<falieson>
and … it freezes
mmitchell has joined #ruby
<falieson>
um, I don't think its sleeping every 1s
<_7894>
xD That may be the prob :D
<falieson>
or the db inserts are queued up?
<falieson>
I'm adding about 300rows every refresh
<Spooner>
No idea.
davidcelis has quit [Quit: K-Lined.]
<falieson>
lol
<falieson>
well lets just hope twitter api doesn't ban my office
<blazes816>
(1..10).inject(&:+) should take about a second in ruby
<falieson>
thanks for the help Spooner
icole has quit [Remote host closed the connection]
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-rc2)]
slainer68 has quit [Remote host closed the connection]
dagnachewa has joined #ruby
hbpoison has joined #ruby
<roz-monokeros>
blazes816: 1 second? that's too much
cakehero has joined #ruby
digitalcakestud1 has quit [Read error: Connection reset by peer]
<blazes816>
i was totally kidding man
digitalcakestudi has joined #ruby
<blazes816>
ruby has teh web scalez
dakine has joined #ruby
<falieson>
I have sleep 1 in there
icole has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
<falieson>
so it should be fine
<blazes816>
falieson: when i'm doing stuff like this I used a cached version in a db for testing, and then get it all working correctly before letting loose all over twitter's unicorns
mmitchell has quit [Ping timeout: 264 seconds]
<blazes816>
also, are you doing an insert for each of the returned tweets?
hbpoison has quit [Ping timeout: 256 seconds]
slicslak has quit [Ping timeout: 244 seconds]
<blazes816>
you can make them into 1 insert
tyfighter has quit [Quit: tyfighter]
ph^ has joined #ruby
adeponte has quit [Remote host closed the connection]
xeronic has quit [Ping timeout: 245 seconds]
BrokenCog has joined #ruby
BrokenCog has joined #ruby
BrokenCog has quit [Changing host]
dagnachewa has quit [Remote host closed the connection]
<falieson>
blazes816: hmm, that would probably be good to know how to do. I'm not too worried about resources since I'm downloading everything to my local machine
<matti>
Spooner: I could not sleep and I was bored...
rabidpraxis has joined #ruby
<Spooner>
fizzbuzz gem. Inspired :)
thomasfedb has quit [Ping timeout: 245 seconds]
Know1edge has quit []
<Spooner>
Your test results need to go a bit higher, since they ignore the first actual fizzbuzz (at 15 :D).
<matti>
Spooner: I wrote it in C, so you guys cannot complain about it being slow.
<Spooner>
I am sure we all appreciate it.
<matti>
Spooner: Oh, good point ;]
<matti>
I am just a Ruby n00b
sent-hil has joined #ruby
<Spooner>
Testing nub ;)
jenrzzz has joined #ruby
thomasfedb has joined #ruby
kst has quit [Ping timeout: 256 seconds]
pipopopo has quit [Ping timeout: 244 seconds]
<Spooner>
matti An exercise - rather than generate an array, use an Enumerator :D
nari has joined #ruby
CarlB_the_great has joined #ruby
<matti>
Spooner: It does.
<matti>
Spooner: It has .each
<Spooner>
Oh, but you don't test it, so it clearly doesn't work :D
<matti>
Pff
pipopopo has joined #ruby
kiyoura has quit [Quit: Leaving]
<matti>
I practice HDD -- Hate Driven Development
<matti>
;p
lggr has quit [Ping timeout: 256 seconds]
<matti>
No tests!
<matti>
Move along ;p
<matti>
Spooner: I am too tired at the moment ;]
<Spooner>
Still, I am impressed.
<matti>
Impressed?
<Spooner>
Maybe I should fork and improve it. Good projects need more love.
<matti>
Its hardly a good project.
dagnachewa has quit [Remote host closed the connection]
xrl has joined #ruby
<matti>
I was just bored and read IRC backlog.
brianpWins has quit [Quit: brianpWins]
<matti>
Spooner: Feel free to improve ;]
TomJ has quit [Quit: TomJ]
<matti>
Spooner: And +1 for not testing Enumerator.
lggr has joined #ruby
<matti>
I mean, for poining it out.
<Spooner>
And not testing FizzBuzz itself :D
<matti>
Oh, oh yes.
<matti>
;p
<matti>
Oh yes.
<matti>
;p
* matti
hugs Spooner
CarlB_th_ has joined #ruby
karakedi has joined #ruby
Dwarf has quit [Ping timeout: 246 seconds]
<Spooner>
I will remind you that you could have written it: (1..100).each{|i|s="#{'fizz'if i%3==0}#{'buzz'if i%5==0}";puts s==''?i:s} but no, pages of C :D
<Spooner>
Well, except the enumerator, of course.
CarlB_the_great has quit [Ping timeout: 240 seconds]
tbbach has quit [Quit: tbbach]
Dwarf has joined #ruby
<Spooner>
I learned about RETURN_ENUMERATOR if nothing else.
sent-hil has quit [Remote host closed the connection]
dagnachewa has joined #ruby
<matti>
;]
sent-hil has joined #ruby
<falieson>
Spooner: :-( I just did some more research and it appears that twitter IDs aren't sequential
lggr has quit [Ping timeout: 248 seconds]
<Spooner>
That would explain a lot, I imagine.
ph^ has joined #ruby
<Spooner>
matti Hate to tell you, but you never get to FizzBuzz. You fell for the Fizzbuzz trap.
GraemeLion has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
indian has quit [Ping timeout: 245 seconds]
pingfloyd has joined #ruby
<matti>
Spooner: I know.
indian has joined #ruby
lggr has joined #ruby
<matti>
Spooner: I just fixed it.
mohits has joined #ruby
<matti>
Spooner: I added test, and then went "Doh".
<Spooner>
:D
AlbireoX`Laptop has joined #ruby
AlbireoX has quit [Ping timeout: 240 seconds]
<matti>
Spooner: I was doing some re-factoring and moved code around and I think I pressed "u" too many times.
<matti>
Spooner: And % 15 left on the bottom.
<matti>
Meh.
<Spooner>
That isn't an excuse. That is what the tests were for.
pfaff has joined #ruby
hbpoison has joined #ruby
dagnachewa has quit [Read error: Connection reset by peer]
<Spooner>
You didn't get the job.
jasonkuhrt has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
ckrailo has joined #ruby
mmitchell has quit [Remote host closed the connection]
digitalcakestudi has quit [Read error: Connection reset by peer]
<matti>
falieson: I am leaving you in the Spooner's capable hands ;p
digitalcakestudi has joined #ruby
<falieson>
haha, thanks matti
lggr has joined #ruby
icole has joined #ruby
<Spooner>
I know nothing about Sequel, but I am good at guessing.
<matti>
Thanks Spooner !
<Spooner>
matti : Good luck with the gem. I am sure it will be downloaded many times in interviews.
pfaff has quit [Ping timeout: 245 seconds]
<qq99>
Spooner, I was avoiding using a DB since I wanted it to be easy to FTP a file in and have a route work
<falieson>
Spooner: haha, you certainly are
<Spooner>
How do you fizzbuzz, young softie? gem install fizzbuzz; fizzbuzz 100
<matti>
falieson: x = x.to_i if x.is_a?(BigDeciaml) and so on...
<falieson>
Spooner: I don't understand ^^
<Spooner>
qq99 : Makes sense.
<qq99>
Spooner, thanks, I guess I might re-evaluate sanitizing stuff to make sure... I was wondering if File.join(base_path, "../../../other....") could traverse up and out of the app's directory
vlad_starkov has joined #ruby
<Spooner>
It can, assuming that other is somethign like "frog/../../../fish"
<qq99>
so it can actually go upwards with the ../..?
<qq99>
say, up a level from /frog?
<Spooner>
So just ensure that the user-entered file-name is just letters.
<Spooner>
qq99: Yep.
<qq99>
Spooner, thanks
<Spooner>
You can have /../ in a filename. File.expand_path will work out the "real" path, but it will work fine to find files regardless of whether the .. are resolved.
<Spooner>
falieson : What don't you iunderstand? I got lost.
<falieson>
haha, I got lost too
jenrzzz has quit [Ping timeout: 265 seconds]
<falieson>
Spooner: "You actually want :max_id ==> max_id - 1 otherwise you grab that one twice."
<falieson>
how do I grab it twice?
justsee has quit [Quit: Leaving...]
vlad_starkov has quit [Ping timeout: 265 seconds]
<Spooner>
Right, if max_id is 1000, then it will grab 902..1000 (99 results). The next time, the min is 902, so it will grab xx..902. So 902 is grabbed twice. You want xx..901 instead.
Taichou has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
mikepack has quit [Remote host closed the connection]
<falieson>
ah i see
<falieson>
nice catch
<falieson>
but then I'd only have 1 duplicate
<falieson>
I have like 10
<falieson>
(500K rows, probably have 8 dupes each)
<falieson>
*Each tweet
glyytchy has quit [Quit: Leaving...]
<Spooner>
Mmm.
dagnachewa has joined #ruby
reset has quit [Ping timeout: 245 seconds]
brianpWins has joined #ruby
<Spooner>
I know zilch about the Twitter system, other than that it is mainly full of crap (in the posts).
<falieson>
haha true
<Spooner>
Sorry, 8 duplicates of every tweet?
joeycarmello has joined #ruby
<falieson>
I grabbed a random selection of 100, at least 30 dupes of one tweet, a dozen of another
<Spooner>
With different IDs?
<falieson>
same ID
lggr has joined #ruby
<Spooner>
Right, but they just end up as one in the database though?
maletor has quit [Quit: Computer has gone to sleep.]
<falieson>
I have 30 or so rows with the same twitter id
<Spooner>
Then your db is broken. Surely you should have id being unique?
pfaff has joined #ruby
<falieson>
i have a unique id I'm using, but I didn't set twitter id to be unique in the db
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
<Spooner>
Right, but that doesn't explain why you get so many copies downloaded.
qq99 has quit [Quit: Leaving]
* Spooner
shrugs.
<falieson>
yeah
<falieson>
I suppose I have extra processing time, I could check for unique
<falieson>
but it doesn't seem like yet should be necessary
<falieson>
*like it should be
<Spooner>
I'd just make the twitter id unique.
Taichou has quit [Remote host closed the connection]
<matti>
Spooner: I fixored typos in tests...
<matti>
Spooner: And now, nap time.
<Spooner>
matti : Goodo!
<falieson>
Spooner: http://pastie.org/4822616 so remove :id and change :t_id from BigDecimal to primary_key ?
Taichou has joined #ruby
<Spooner>
Ah, think I have it. There isn't any reason that Twitter.search returns the results in order.
<Spooner>
No, that doesn't work. Ignore me.
rakl has joined #ruby
<falieson>
you are the only one I'm listening to lol
lggr has quit [Ping timeout: 245 seconds]
<Spooner>
And EACH EACH EACH not MAP MAP MAP!
dmiller has quit [Remote host closed the connection]
Bosox20051 has joined #ruby
lggr has joined #ruby
stan_man_can has quit [Quit: stan_man_can]
rakl has quit [Client Quit]
<falieson>
lol, it started working so I didn't change it out
c0rn_ has quit [Quit: Computer has gone to sleep.]
jhunter has quit [Ping timeout: 252 seconds]
<falieson>
Spooner: `<main>': undefined method `>' for nil:NilClass (NoMethodError)
<Spooner>
I'm not sure about the Bignum stuff, by the way.
<Spaceghostc2c>
matti: Don't be a prick.
<falieson>
the BigDecimal?
<falieson>
What would you suggest instead
arubin has quit [Quit: arubin]
<Spooner>
I didn't pick up what the error was about, so I am in the dark.
<Spooner>
falieson : Look at line #3
<Spooner>
Guessing you forgot to paste that in.
<Spaceghostc2c>
matti: <3
<falieson>
Spooner: nope I got that
<falieson>
:-)
GraemeLion has quit [Quit: Lost terminal]
* Spooner
looks lost.
<falieson>
man me too =(
lggr has quit [Ping timeout: 240 seconds]
<Spooner>
Well, line 5 is the only > and line 3 sets the value, so it can't really be nil at that point.
<falieson>
oh, if the db is bill it can be
<falieson>
haha
<falieson>
*nill
<falieson>
I'll make a little loop for that
<Spooner>
Ooh. Nah, just dataset.min(:t_id) || 0
<falieson>
god I love ruby
<falieson>
so slick
<Spooner>
or while min_id && min_id > 123141 do
lggr has joined #ruby
<falieson>
|| 0 won't work because it has to be greater than 248209782517932032
<falieson>
right?
<Spooner>
Oh, yeah, sorry. I was thinking about it the wrong way around.
stan_man_can has joined #ruby
stan_man_can has quit [Client Quit]
Averna has joined #ruby
dagnachewa has quit [Remote host closed the connection]
<falieson>
I suppose || infinity wouldn't work
<falieson>
haha
ph^ has quit [Ping timeout: 252 seconds]
swarley has quit []
dagnachewa has joined #ruby
<Spooner>
Depends how the search works. If it is "the highest 99 <= this limit" then it would, but if it is "the 99 immediately below this limit" it won't. Well, and it probably will cry about being given INFINITY anyway.
<Spooner>
How did you do it before?
jeffreybaird has quit [Quit: jeffreybaird]
<Spooner>
You must have had something in the database to give a min before now.
<falieson>
yeah I must have
<falieson>
I just trunked it because I wanted to easily see the data that we put in with this version
<Spooner>
Well, just pick a silly big number.
<falieson>
haha
<Spooner>
or 2**99 or something.
<Spooner>
That might be a bit large though.
peneconleche has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 244 seconds]
GoHuyGo has joined #ruby
dmiller has joined #ruby
lggr has joined #ruby
<falieson>
no dupes yet
<falieson>
and yeah i think so
<falieson>
so min_id = dataset.min(:t_id) || 2**99
<falieson>
if dataset.min() is nil it uses the 2**99
Bosox20051 has quit [Remote host closed the connection]
<CaptainJet>
you could use 1 << 64
<CaptainJet>
which is 18446744073709551616
<CaptainJet>
</late>
pfaff has joined #ruby
adkron has joined #ruby
<falieson>
haha
<falieson>
nice
lggr has quit [Ping timeout: 246 seconds]
<falieson>
well that finished quickly
<falieson>
~22K results
dmiller has quit [Remote host closed the connection]
<Spooner>
You can probably remove the sleep, since I'm guessing that was standard "I don't know what is wrong, so I'll pepper it with sleeps" (I've done that myself on bad days :D).
<falieson>
haha
<falieson>
I put the sleep in there because if it took hours (like my duplicate mess did) I didn't want twitter to ban me
<falieson>
they don't want more than 1query/s
<Spooner>
Oh, I see.
<falieson>
ok, so that finished nice and quick
pu22l3r has joined #ruby
dmiller has joined #ruby
dagnachewa has quit [Remote host closed the connection]
jarred has quit [Quit: jarred]
Cache_Money has joined #ruby
<Spooner>
Duplicates?
<Spooner>
Or were they just there because you weren't cleaning the database each time you tested?
lggr has joined #ruby
ScottNYC has joined #ruby
Chryson has joined #ruby
bigmcq77 has quit [Quit: Computer has gone to sleep.]
hbpoison has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
wallerdev has quit [Quit: wallerdev]
itnomad has joined #ruby
diegoviola has quit [Ping timeout: 252 seconds]
tblamer has joined #ruby
lggr has quit [Ping timeout: 264 seconds]
mohits has quit [Ping timeout: 256 seconds]
freeayu has joined #ruby
dagnachewa has joined #ruby
hbpoison has quit [Ping timeout: 264 seconds]
ph^ has joined #ruby
<falieson>
I think that it wasn't sorting properly
SeySayux has quit [Ping timeout: 256 seconds]
<falieson>
and we changed something that now it is
<falieson>
I changed result_type to mixed to recent
<falieson>
but I hope that wasn't it since I was grabbing min
dagnachewa has quit [Remote host closed the connection]
Bosox20051 has joined #ruby
verto is now known as verto|off
wallerdev has joined #ruby
dagnachewa has joined #ruby
lggr has joined #ruby
vlad_starkov has joined #ruby
<falieson>
thinking about it though, that probably was it
<falieson>
something stupid like that
<falieson>
what does min_id = [status.id, min_id].min do?
AlbireoX has joined #ruby
SeySayux has joined #ruby
Guest_ has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
philcrissman has quit [Remote host closed the connection]
Edward_ has joined #ruby
<falieson>
is it grabbing the lesser of the two?
<Spooner>
Ensures that min_id is always at the lowest id. #min is a very standard method on Array (well, on Enumerable).
<bnagy>
-.-
<falieson>
maybe that's what fixed it
<bnagy>
because min is a pretty opaque method name
<Spooner>
bnagy : Yeah :P
lggr has quit [Ping timeout: 265 seconds]
groupcat_ has joined #ruby
AlbireoX`Laptop has quit [Ping timeout: 256 seconds]
<falieson>
so I just grabbed 22K tweets with #election2012 in it
groupcat has quit [Quit: Reconnecting]
ph^ has quit [Ping timeout: 264 seconds]
iaj has quit [Read error: Connection reset by peer]
<Spooner>
But it shouldn't make a difference really. All it does is avoid the need to keep asking the db what the minimum id is.
groupcat_ is now known as groupcat
iaj_ has joined #ruby
<falieson>
oh
hbpoison has joined #ruby
randym has quit [Ping timeout: 264 seconds]
<falieson>
mind if I ask a non-ruby question?
fir_ed has quit [Ping timeout: 264 seconds]
<falieson>
since you've been helping me so much with this little script
<Spooner>
Right, I am going to bed and you are going to start pry and do show-doc [].min :D
<falieson>
:-D
CarlB_th_ has quit [Remote host closed the connection]
<falieson>
I was going to do a comparison of sentiment for Rep vs Dem but there are so many people already doing that. Can you think of some other data points that might be interesting that would be difficult for an engine to determine but easy for a human?
guns has quit [Quit: guns]
jenrzzz has joined #ruby
<bnagy>
comment IQ
<Spooner>
Comparison of "I like X" rather than "I hate Y". Do people like candidates or do they hate the other one.
lggr has joined #ruby
dagnachewa has quit [Remote host closed the connection]
<falieson>
along those lines
<Spooner>
I'm guessing, that for the people who can be arsed to get off their arse to make a comment, more are negative comments than positive ones.
<falieson>
its about 80% of tweets are Republican:negative
<falieson>
or rather, 80% of Republican tweets are negative
<Spooner>
Republicans suck. There's another one.
<falieson>
lol
<Spooner>
Democrats suck a bit less.
<falieson>
while its equal parts Positive/Negative (about 40%) Democrats
<Spooner>
Interesting.
<bnagy>
falieson: spell check them
<bnagy>
and then break them down by affiliation
<Spooner>
Not sure what you gain from comparisons that are easy for humans but hard for machines. Surely you want to know things that are easy for machines?
<falieson>
bnagy: lol, nice
<falieson>
Spooner: things that are easy for machines is already done
dagnachewa has joined #ruby
<bnagy>
that is a deeply flawed assumption
<falieson>
I'm interning at a crowdsourcing company
<Spooner>
Well, good luck in automating the bits other people can't do.
qos has joined #ruby
<falieson>
so, if its easy for a human but hard for a computer, that leverages the power of crowdsourcing
<Spooner>
Aha.
indian has quit [Remote host closed the connection]
flip_digits has quit [Quit: Computer has gone to sleep.]
<Spooner>
But regardless of that, this crowd needs sleep. Goodnight (and I can honestly say that 1) I didn't know there was a US election and 2) I haven't a clue who is or even might be running. Oh, I guess Obama is going for second term? Drat!).
<falieson>
night man
<falieson>
and thanks for the help
<falieson>
:-
sent-hil has quit [Remote host closed the connection]
<falieson>
:-)
<Spooner>
Of course, I'm in the UK, so I have an excuse.
randym has joined #ruby
c0rn_ has joined #ruby
<falieson>
and bed now?
<falieson>
jeez
<falieson>
:-D
lggr has quit [Ping timeout: 252 seconds]
bradhe has quit [Remote host closed the connection]
<Spooner>
Yeah, I live a life electric.
Spooner has quit []
<falieson>
or eclectic ?
freeayu has quit [Read error: Connection reset by peer]
Juul has quit [Ping timeout: 256 seconds]
bradhe has joined #ruby
quazimodo has quit [Ping timeout: 246 seconds]
falieson has left #ruby [#ruby]
c0rn_ has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
dagnachewa has quit [Remote host closed the connection]
CaptainJet has quit []
freeayu has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
Guest64548 has joined #ruby
xyzodiac has joined #ruby
loves_color_text has quit []
AlbireoX has quit [Read error: Connection reset by peer]
AlbireoX`Laptop has joined #ruby
love_color_text has joined #ruby
love_color_text has quit [Client Quit]
love_color_text has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ruby
AndChat| has joined #ruby
sdegutis has joined #ruby
<sdegutis>
hello
ph^ has joined #ruby
bradhe has quit [Remote host closed the connection]
manizzle has joined #ruby
AlbireoX`Laptop has quit [Read error: Connection reset by peer]
Banistergalaxy has quit [Ping timeout: 264 seconds]
ryanf has quit [Ping timeout: 256 seconds]
hvq has quit [Ping timeout: 264 seconds]
ananthakumaran has joined #ruby
lggr has quit [Ping timeout: 265 seconds]
Guest_ has quit [Quit: Computer has gone to sleep.]
xyzodiac has quit [Quit: Computer has gone to sleep.]
<iosctr>
Cache_Money: fyi, state/city is not unique. Many states have duplicate city names. You might want to use state/zipcode.
locriani has joined #ruby
ij has joined #ruby
<Cache_Money>
iosctr: good call
<A124>
Cache_Money: Or in your case an array.
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
justsee has quit [Client Quit]
lggr has joined #ruby
butblack has left #ruby [#ruby]
dmiller has quit [Remote host closed the connection]
m3pow has quit [Quit: ChatZilla 0.9.89 [Firefox 15.0.1/20120907231657]]
lggr has quit [Ping timeout: 264 seconds]
joeycarmello has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
macmartine has quit [Quit: Computer has gone to sleep.]
m3pow has joined #ruby
rabidpraxis has quit [Remote host closed the connection]
cyong has joined #ruby
sent-hil has quit [Remote host closed the connection]
gabrielrotbart has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
lggr has quit [Ping timeout: 265 seconds]
tagrudev has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
lggr has joined #ruby
mahmoudi_ has quit [Quit: Computer has gone to sleep.]
<HardKoreMofo>
I was told all the hot sexy women ewhore hang out here
<A124>
[regexp] Can anyone point me out how should I match all occurences instead of one? (any number) "var latitude=35.77333, longitude=-80.82883;".match(/-?\d+(?:\.\d+)?/)
AlbireoX has quit [Remote host closed the connection]
bsmith_ has quit [Read error: Connection reset by peer]
robozahn has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
timonv has joined #ruby
matrixise has joined #ruby
<adoff>
Hanmac: A124 bnagy It works thank you so much.
<adoff>
there is no problem if I do ----> if (type & 0x800)!=0 or (type & 0x4000)!=0
<adoff>
and type is an integer
<adoff>
that condicion could be more optimized?
cezar has joined #ruby
cezar has quit [Client Quit]
bsmith_ has joined #ruby
timmow has joined #ruby
<bnagy>
you can use .nonzero?
<adoff>
bnagy: I don't know that :P I'm starting with ruby
arkiver has joined #ruby
<adoff>
let me find information
<bnagy>
and can't you just do 0x4800 ?
<A124>
adoff: Welcome
lggr has quit [Ping timeout: 256 seconds]
<adoff>
bnagy: yes I could you're right :)
<bnagy>
it's probably less readable though
<adoff>
no no its ok like that
<bnagy>
if ( type & (0x4000|0x800)).nonzero?
<adoff>
thank you :)
manizzle has quit [Ping timeout: 246 seconds]
arkiver has quit [Client Quit]
lggr has joined #ruby
berserkr has joined #ruby
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
horrror has joined #ruby
<horrror>
is there a Ruby lib to extract Words out of MP3 or any other media file?
<horrror>
is it possible?
<Mon_Ouie>
"words"? As in speech recognition?
<horrror>
yes
<horrror>
like lyrics etc
<Mon_Ouie>
That's a very tough problem, unless the file contains the lyrics in its metadata
vaclavt has joined #ruby
<horrror>
no it doesn't
hbpoison has quit [Ping timeout: 245 seconds]
<horrror>
I may parse the lyrics from somewhere else but i do need the time stamp of each word
jamjam has joined #ruby
timonv has quit [Remote host closed the connection]
<Xeago>
horrror: that is very difficult to do
lggr has quit [Ping timeout: 240 seconds]
<horrror>
bummer
<Xeago>
accurate speech recognition is nearly impossible if there is background noise (music)
<Mon_Ouie>
You could try to get the lyrics from the internet if you can somehow identify the song (the safest way is to use metadata; if there are none for that either, I'd try to find some service that does it.
timonv has joined #ruby
<Xeago>
you could try matching syllables
<Xeago>
and then count along with lyrics from the internet
<Xeago>
but still, that is very hard to do
<horrror>
hmm ok
adambeynon has joined #ruby
<Xeago>
you'd need to understand how audio works
lggr has joined #ruby
<Xeago>
have you seen captions at youtube?
<Xeago>
they're horrible
xpen has joined #ruby
Hanmac has quit [Ping timeout: 246 seconds]
<horrror>
yea they're
<horrror>
but i can work with that
<Xeago>
google has more engineers than you are old
<bnagy>
I can't work out a way without lots of checking args.empty?
zommi has quit [Ping timeout: 265 seconds]
schickung has joined #ruby
jasonkuhrt has quit [Ping timeout: 256 seconds]
<shevy>
wat
<shevy>
asm
<bnagy>
yes
<bnagy>
asm
QKO_ has joined #ruby
darthdeus has quit [Remote host closed the connection]
gokul has quit [Quit: Leaving]
matthewrobbins_ has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
matthewrobbins has quit [Read error: Operation timed out]
matthewrobbins_ is now known as matthewrobbins
QKO has quit [Ping timeout: 264 seconds]
matthewrobbins has quit [Remote host closed the connection]
matthewrobbins has joined #ruby
<Xeago>
Can this be read concisely: "It is therefore encouraged that nodes outside of the regional area do not participate in master election **or** do not hold data."?
icole has joined #ruby
<bnagy>
well negative encouragement is discouragement
aces1up has joined #ruby
lggr has joined #ruby
<Xeago>
so you encourage to negate the sentence, and then add something like, 'but not both' at the end?
<aces1up>
hey, I need some help with an enumerable call on my compisite tree.. the code for it is here: http://codepad.org/3fYDBZME any help would be appreciated!
<bnagy>
but just start off with Nodes outside blah should not
<canton7>
"nodes outside of the regional area are therefore encouraged not to participate in master election, and not to hold data"?
<Xeago>
canton7: that I however, cna read in different ways
<canton7>
s/and/or maybe -- I'm having trouble parsing the original
drkfiber has joined #ruby
<drkfiber>
hello all
zommi has joined #ruby
icole has quit [Ping timeout: 255 seconds]
<Xeago>
to not to, or to to not?
<Xeago>
"are encouraged to not participate" vs "are encouraged not to participate"
fyolnish has quit [Remote host closed the connection]
<bnagy>
nodes outside blah should not participate in blah if they hold data
<bnagy>
not to, otherwise split infinitive
<canton7>
Xeago, either. "to not" is a bit stronger I'd say
mucker has quit [Ping timeout: 244 seconds]
<Xeago>
how about this: "It is therefore discouraged that nodes outside of the regional area participate in master-elction **and** hold data."
<Xeago>
, they should only have 1 role
<Xeago>
or something liek that
<Xeago>
however I'd prefer using should instead of discouragement, due to rfc2119
lggr has quit [Ping timeout: 248 seconds]
<Xeago>
"Nodes outside of the regional area should either participate in master lection **or** hold data, but not both."
<bnagy>
well that says they should do one or the other
<Xeago>
which is what I am trying to say :3
<bnagy>
it doesn't allow for doing neither - if that' what you mean then cool
<Xeago>
hmm, well it is possible to do neither
<bnagy>
then just say they should not both hold data and participate
<Xeago>
"Therefore, nodes outside of the regional area should not hold data **and** participate in master election."?
<bnagy>
should not both
<canton7>
still can be read as "can either hold data *or* participate, but not both" or "can neither hold data not participate"
xorgnak has joined #ruby
Aaaarg has quit [Quit: Aaaarg]
<bnagy>
you can just say nodes that hold data should not participate
<Xeago>
Therefore, nodes outside of the regional area should not both hold data **and** participate in master election at the same time.
xorgnak has quit [Remote host closed the connection]
<bnagy>
logically equivalent and a lot clearer
<Xeago>
bnagy: nodes that participate should also not hold data
xorgnak has joined #ruby
<bnagy>
or that, either way
<Xeago>
I feel both would be needed
lggr has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
<RubyPanther>
I say it clearly and only can mean that it can be A or B, there is no reason to think it means A xor B or whatever
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ruby
ssspiff has joined #ruby
ssspiff has quit [Changing host]
ssspiff has joined #ruby
frogprince_mac has joined #ruby
sspiff has quit [Ping timeout: 260 seconds]
hbpoison has joined #ruby
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
_dave_h_d has quit [Quit: _dave_h_d]
lggr has quit [Ping timeout: 256 seconds]
cantonic_ has joined #ruby
chendo_ has quit [Ping timeout: 255 seconds]
tgraham has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
lggr has joined #ruby
cantonic has quit [Ping timeout: 244 seconds]
cantonic_ is now known as cantonic
chendo_ has joined #ruby
rjmt__ has joined #ruby
PragCypher has joined #ruby
Hamed-R has quit [Ping timeout: 245 seconds]
ProT-0-TypE has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
drkfiber has quit [Quit: leaving]
vlad_starkov has joined #ruby
verto|off is now known as verto
sagax has quit [Ping timeout: 246 seconds]
verto is now known as verto|off
lggr has joined #ruby
manizzle has joined #ruby
chussenot has quit [Quit: chussenot]
Hamed-R has joined #ruby
Hamed-R has quit [Changing host]
Hamed-R has joined #ruby
jastix has quit [Read error: Operation timed out]
matrixise has joined #ruby
tgraham has quit [Quit: Leaving...]
hbpoison has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 256 seconds]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
seme has joined #ruby
seme is now known as Guest53096
icole has joined #ruby
colinbm has joined #ruby
daniel_- has quit [Ping timeout: 255 seconds]
kermes has joined #ruby
amskah has quit [Quit: Leaving]
PragCypher has quit [Quit: Leaving]
lggr has joined #ruby
icole has quit [Ping timeout: 246 seconds]
dhruvasagar has quit [Remote host closed the connection]
D4T has joined #ruby
Dreamer3 has joined #ruby
bsmith_ has quit [Changing host]
bsmith_ has joined #ruby
bsmith_ is now known as bsmith
<aces1up>
hey, I need some help with an enumerable call on my compisite tree.. the code for it is here: http://codepad.org/3fYDBZME any help would be appreciated!
lggr has quit [Ping timeout: 260 seconds]
issyl0 has joined #ruby
issyl0 is now known as Guest85093
bsmith has left #ruby [#ruby]
_bart has joined #ruby
dhruvasagar has joined #ruby
lggr has joined #ruby
gani has joined #ruby
<_bart>
my string a = 'something/awesome >', and my array b = ['some', 'thing', 'something/awesome >'], as you can see b holds an exact match of a, how do I check a for an exact match in b?
samphippen has joined #ruby
<hoelzro>
_bart: b.include? a
<_bart>
ah obviously
<hoelzro>
=)
<_bart>
I was looking in the wrong way
<_bart>
thanks
<_bart>
trying .any and so on..
Rochefort has quit [Remote host closed the connection]
futilegames has quit [Quit: futilegames]
lggr has quit [Ping timeout: 252 seconds]
TomJ has quit [Quit: TomJ]
lggr has joined #ruby
pskosinski has quit [Ping timeout: 276 seconds]
Forevernade has joined #ruby
haxrbyte has quit [Ping timeout: 256 seconds]
tehgeekmeister has joined #ruby
arietis has joined #ruby
nari has quit [Ping timeout: 268 seconds]
sayuj has quit [Read error: Connection reset by peer]
xpen has quit [Remote host closed the connection]
mengu has quit [Read error: No route to host]
lggr has quit [Ping timeout: 256 seconds]
pskosinski has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
Hamed-R has quit [Ping timeout: 245 seconds]
Rochefort has joined #ruby
<Xeago>
"Nodes that have disappeared from the cluster are automatically detected as such and queries will be routed to not hit said node."
<Xeago>
does this sentence try too hard to say too many things?
lggr has joined #ruby
ttt has quit [Remote host closed the connection]
<JonnieCache>
you could replace "not hit" with "avoid" and it would read better
Mon_Ouie has quit [Ping timeout: 264 seconds]
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
<chrismcg>
"Nodes that disappear from the cluster are automatically detected and queries will not routed to them" or maybe just "Queries will not be routed to nodes that disappear from the cluster"
ij has quit [Ping timeout: 264 seconds]
lggr has quit [Ping timeout: 265 seconds]
robozahn has quit [Remote host closed the connection]
sayuj has joined #ruby
JustinCampbell has joined #ruby
chimay has joined #ruby
<ccooke>
Xeago: "Nodes leaving the cluster will be automatically detected and queries will not be routed to them"
<Xeago>
ty all
Hamed-R has joined #ruby
Hamed-R has quit [Changing host]
Hamed-R has joined #ruby
thillux has quit [Remote host closed the connection]
thillux has joined #ruby
lggr has joined #ruby
hbpoison has joined #ruby
jasonkuhrt has joined #ruby
cyong has quit [Quit: Leaving.]
fmcgeough has quit [Quit: fmcgeough]
hbpoison has quit [Ping timeout: 244 seconds]
icole has joined #ruby
und3f has joined #ruby
jasonkuhrt has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 265 seconds]
Guest85093 is now known as issyl0
moted has quit [Read error: Operation timed out]
icole has quit [Ping timeout: 256 seconds]
TomJ has quit [Quit: TomJ]
tbbach has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
tgraham has joined #ruby
jastix has joined #ruby
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
daniel_- has joined #ruby
mr_dynamix has quit [Quit: mr_dynamix]
thillux_ has joined #ruby
wpaulson has joined #ruby
tgraham has quit [Client Quit]
wpaulson has quit [Client Quit]
lggr has joined #ruby
thillux has quit [Ping timeout: 240 seconds]
elsifaka has joined #ruby
xyzodiac has joined #ruby
tehgeekmeister has quit [Remote host closed the connection]
Taichou has quit [Remote host closed the connection]
Dreamer3 has quit [Quit: Leaving...]
Dreamer3 has joined #ruby
xyzodiac has quit [Client Quit]
manizzle has quit [Ping timeout: 255 seconds]
chendo_ has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 256 seconds]
chendo_ has joined #ruby
thaz has joined #ruby
Taichou has joined #ruby
thaz has quit [Client Quit]
lggr has joined #ruby
yshh has quit [Remote host closed the connection]
dagnachewa has joined #ruby
hsbt_away is now known as hsbt
tbbach has quit [Quit: tbbach]
wmoxam has quit [Ping timeout: 268 seconds]
verto|off is now known as verto
dagnachewa has quit [Read error: Connection reset by peer]
dagnachewa has joined #ruby
dagnachew has joined #ruby
dagnachewa has quit [Client Quit]
dagnachew has quit [Client Quit]
dagnachewa has joined #ruby
ShiintoRyuu has joined #ruby
fermion has joined #ruby
hsbt is now known as hsbt_away
lggr has quit [Ping timeout: 256 seconds]
theRoUS_ has joined #ruby
heftig has joined #ruby
dagnachewa has quit [Remote host closed the connection]
lggr has joined #ruby
<Xeago>
blurgh, basically have the same issue again: "This component needs to be made aware of nodes leaving the cluster so requests get routed to nodes still available."
<Xeago>
"Nodes leaving the cluster have to manually be detected for requests to get rerouted." is the best I can come up with
verto is now known as verto|off
matthewrobbins has quit [Quit: matthewrobbins]
larissa has joined #ruby
wmoxam has joined #ruby
peneconleche has joined #ruby
mark_locklear has joined #ruby
ltsstar has joined #ruby
<A124>
Anyone could recommend a versioning system for one person?
<matti>
Xeago: This is a fall off recent FizzBuzz golfs here ;d I could not sleep yeserday.
<matti>
Xeago: And this was born.
<Xeago>
lol
yshh has joined #ruby
hukl has joined #ruby
<JonnieCache>
this is the opposite of golf
<matti>
JonnieCache: True.
<matti>
;]
<matti>
JonnieCache: But it was fun to make.
<JonnieCache>
i bet its fast as well haha
<JonnieCache>
reminds me of the node fibbonacci solver
<Xeago>
where does the method block_given? come from?
<Spooner>
Xeago : It is built-in.
<Xeago>
uhh, where is fizzbuzz/fizzbuzz.rb?
<matti>
Xeago: Its written in C
<matti>
Xeago: ext/fizzbuzz
<matti>
I said, I was boed.
<matti>
bored8
<matti>
s/8/*/
hbpoison has joined #ruby
lggr has joined #ruby
<Hanmac>
Xeago: block_given? is like defined? not defined as a method, its more a feature of the parser
<Spooner>
You missed a trick by not implementing FizzBuzz[n]
<matti>
Hahah
<matti>
Spooner: :))))
ewag has joined #ruby
<Xeago>
matti: you got a linux.com address :O?
<theRoUS_>
ruby 1.8.7: is there any way to hook the '@' means of accessing instance variables?
hbpoison has quit [Ping timeout: 255 seconds]
<Spooner>
theRoUS_ : Nope. Youi should be accessing them via accessors if you want to hook them.
<Xeago>
matti: if we're going for speed
<Xeago>
I am sure we can strip off a few condtionals
icole has joined #ruby
<matti>
Xeago: Sure, but why? They are there for readability.
<theRoUS_>
Spooner: comprends. in general i agree. however, i want to wrap an instance variable so that *all* accesses to it are intercepted.
<_bart>
how do I test a specific string contains a match for an array of regexp'es?
<Spooner>
theRoUS_ : Yeah, but noone should be accessing it but your own class.
<_bart>
so a = 'apple boo' b = [/boo/i, /[0-9]/] would be true, but b = [/9091/, /z/] would be false
lggr has quit [Ping timeout: 248 seconds]
fantazo has quit [Remote host closed the connection]
<Spooner>
_bart regexps.any? {|r| str =~ r }
<_bart>
thanks
jokar has quit [Quit: Leaving.]
<Xeago>
shouldn't that be all?
theRoUS_ has quit [Changing host]
theRoUS_ has joined #ruby
theRoUS_ is now known as theRoUS
<Spooner>
Nope, not based on the example.
<theRoUS>
Spooner: indeed. but this is for a module that can be included and provides the wrapper.
<Xeago>
ah, contains a match, thought it read matches an array of regexp'es
icole has quit [Ping timeout: 244 seconds]
mikekelly has quit [Ping timeout: 246 seconds]
mohits has quit [Quit: Leaving]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
mohits has quit [Remote host closed the connection]
<Xeago>
matti how did you get @linux.com address?
gry has quit [Quit: off]
nga4 has quit [Ping timeout: 264 seconds]
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
fmcgeough has joined #ruby
chimay has quit [Ping timeout: 256 seconds]
xyzodiac has joined #ruby
peneconleche is now known as peneconleche|awa
krawchyk has joined #ruby
lggr has joined #ruby
<matti>
Xeago: You can either help Linux Foundation (which is what I did), or donate and then get it.
<Xeago>
ty
Axsuul has quit [Ping timeout: 256 seconds]
luckyruby has joined #ruby
matthewrobbins has joined #ruby
<Spooner>
OIr just tell people it is your address and assume no-one will ever email you.
lggr has quit [Ping timeout: 260 seconds]
tgraham has joined #ruby
pseudo has joined #ruby
verto|off is now known as verto
Elico1 has quit [Quit: Elico1]
<pseudo>
I am having trouble using a X509 pksc12 certificate for https/SSL, how to I properly read in a .p12 certificate in ruby? http.cert = OpenSSL::X509::Certificate.new(pem) is erroring out.
josh^ has quit [Remote host closed the connection]
<Spooner>
matti : No, I meant FizzBuzz[10] => "Buzz"
<matti>
Ah.
<Xeago>
and don't calculate 1 up to n
<Spooner>
Aye.
<matti>
What? From 0?
<Xeago>
no, not at all
frogprince_mac has quit [Read error: Connection reset by peer]
<Xeago>
just calculate n
lggr has joined #ruby
<matti>
I assumed no negative numbers.
<Xeago>
that's fine
hsbt has quit [Ping timeout: 256 seconds]
<matti>
And yes, I can do it.
<Xeago>
but as [10] does not return an array
<matti>
;]
<Spooner>
I'm thinking if I want to know Fizzbuzz[134251513413152] it might take a while and fill up with Ruby arrays ;D
<Xeago>
there's no need to loop from 0
verto is now known as verto|off
<Xeago>
Spooner: exactly, that's what we want to prevent
<matti>
Right, right ;p
hsbt has joined #ruby
<matti>
I will do it later :)
<Xeago>
booh, bummer
<Xeago>
!
<matti>
?
<Xeago>
now is the time, you shall prevail and work hard on fizzbuzz!
<matti>
You guys don't like it, it seems.
<Xeago>
I like the work alot
<matti>
Xeago: You do it ;]
<Spooner>
xeago Fork it if you need the funcationality now :D
<Xeago>
shit
<matti>
Haha
<Xeago>
my c is rusty
<Xeago>
my ruby's c is untouched
<matti>
Xeago: I am not even a Ruby developer ;]
<Xeago>
thing is, your caculate method assumes it should calculate from 1 up to n
<matti>
I know.
sailias has joined #ruby
<matti>
I wrote it at 3 am ;p
<matti>
For fun ;p
timonv has joined #ruby
<Xeago>
fine, i'll write for fun soon
<Xeago>
first work
<matti>
Yeah.
<Xeago>
it is forked tho
<matti>
Yay. Somebody forked something I've done.
* matti
cries...
<matti>
Tears of joy.
hsbt is now known as hsbt_away
nwest has joined #ruby
<Spooner>
I've even had pull requests, but never anything more than a typo in the readme, I think :D
<matti>
Typo?
<matti>
Oh dear.
<matti>
;/
<Spooner>
You are on your way to Ruby superstardom, matti!
<matti>
I rather not.
<matti>
I may be tempted to look at Rails if that happens.
<matti>
And then I will be damaged for life.
<Spooner>
You won't be able to go outside without being mobbed by Ruby-groupees!
<matti>
LOL
<matti>
We should get it into Core ;p
<matti>
As an easter egg.
<matti>
;d
<Xeago>
rofl
<Spooner>
Get it into Rails. Can't make it any more bloated ;)
<matti>
LOL
Guest53096 has quit [Ping timeout: 245 seconds]
<matti>
We should have: is_{fizz,buzz,fizzbuzz}?
<matti>
;d
<matti>
And then [] as you guys pointed out.
<matti>
And calculate from n-onwards.
<matti>
I like it.
<Spooner>
Oh yeah, 5.is_buzz? Nice.
<shevy>
matti!
<shevy>
let's have babies
<matti>
shevy shevy shevy
<matti>
LOL
<matti>
O_o
<Xeago>
that's as simple as self%5==0
<Spooner>
Or 5.buzz?
<shevy>
hey
<shevy>
monkey patching!!!
<matti>
LOL
kitofr has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
<Xeago>
shevy: what?
<shevy>
the .buzz? method!
krawchyk has quit [Remote host closed the connection]
<Spooner>
I think interviewers should throw in "print Fizz if divisible by 3 and Buzz if it is divisible by 7 and print FizzBuzz if it is both divisible by 3 and 7" and see how many people submit the standard Fizzbuzz ;)
Criztian_ has joined #ruby
<Xeago>
lol
Criztian has quit [Ping timeout: 265 seconds]
<Spooner>
Actually, how about 5.buzzes?, 7.fizzes? and 9.fizzes_while_it_buzzes?
<Xeago>
lol
<shevy>
Spooner will I be able to google at the time of the interview
justinmcp has joined #ruby
<Spooner>
I'm sure people memorise it.
luckyruby has quit [Remote host closed the connection]
<shevy>
wow
hsbt_away has quit [Ping timeout: 265 seconds]
lggr has joined #ruby
<Spooner>
Whoever it was in the other day, talking about using it in his own interviews, said he asked interviewees to explain it, since memorising did take place.
<Spooner>
It is such a standard question...
lolmaus has quit [Read error: Connection reset by peer]
faen has quit [Quit: faen]
keymone has joined #ruby
faen has joined #ruby
hsbt_away has joined #ruby
hsbt_away is now known as hsbt
bbttxu has joined #ruby
hsbt is now known as hsbt_away
jrist-afk is now known as jrist
<matti>
Xeago, Spooner: TODO updated.
hsbt_away is now known as hsbt
Goles has joined #ruby
lolmaus has joined #ruby
<Spooner>
I should have opened a feature-request issue. Sorry matti!
<Xeago>
still do it
<Xeago>
I'll then open a pull-request, mentioning your issue!
<rbuck>
hoelzro: yeah, but global_variables only returns an array of the names, once you get the name, what do you do to get the value; eval is not always a safe choice
<Xeago>
rbuck: you could sned it to Kernel
<hoelzro>
hmm...
<Xeago>
right?
<hoelzro>
Xeago: it's not a method though, right?
v0n has quit [Ping timeout: 268 seconds]
<Xeago>
I don't know :O
* hoelzro
scans the Ruby source
Hanmac has quit [Ping timeout: 240 seconds]
peneconleche|awa has quit [Quit: Leaving...]
kpshek has joined #ruby
* m3pow
appreciates Xeago
hsbt has quit [Ping timeout: 244 seconds]
gfontenot has quit [Ping timeout: 245 seconds]
hsbt_away has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.8]
shiki_ has quit [Remote host closed the connection]
mmitchell has joined #ruby
<hoelzro>
well
phantasm66 has joined #ruby
<hoelzro>
I can't see that functionality being exposed directly to Ruby
<hoelzro>
but!
<hoelzro>
there's rb_gv_get
<hoelzro>
so just wrap that in a C extension and you're good to go
yekta has joined #ruby
mucker has joined #ruby
gfontenot has joined #ruby
keymone has quit [Quit: keymone]
lggr has quit [Ping timeout: 260 seconds]
Hanmac1 has joined #ruby
jrajav has joined #ruby
enroxorz-work has joined #ruby
<Hanmac1>
yeah the bot-maker is back again
Hanmac1 is now known as Hanmac
<jrajav>
Heya
<hoelzro>
\o/
<jrajav>
Apparently that one guy is having some trouble getting it set up
<Xeago>
jrajav: could you set it up in a vagrant?
<jrajav>
I don't know how close he is to getting it up (or if he'll still be able to)
<catphish_>
i am having a character encoding problem but I'm unclear why
haxrbyte has joined #ruby
Nisstyre-laptop has quit [Ping timeout: 252 seconds]
<catphish_>
i am trying to convert an unknown character set to ascii using the following: text.force_encoding('BINARY').encode("utf-8", :invalid => :replace, :undefined => :replace)
Nisstyre-laptop has joined #ruby
<catphish_>
however i get: Encoding::UndefinedConversionError: "\xA8" from ASCII-8BIT to UTF-8
haxrbyte_ has joined #ruby
Taichou has quit [Remote host closed the connection]
mklappstuhl has joined #ruby
Criztian has joined #ruby
<catphish_>
i would expect :invalid => :replace to handle the invalid byte in the original string
<catphish_>
Encoding::UndefinedConversionError: "\xA8" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII
rjmt__ has quit []
catphish_ has quit [Quit: Leaving]
emergion has joined #ruby
lggr has joined #ruby
<geekbri>
Is there an elegant way to handle the situation where you want to call a method on an object that returns true/false in a conditional, but there is a chance that object could be nil?
<geekbri>
E.G. if( condition_one || some_object.include?(something) )
kpshek has quit []
h4mz1d has joined #ruby
Rochefort has quit [Remote host closed the connection]
Elhu has quit [Quit: Computer has gone to sleep.]
chussenot has joined #ruby
Rochefort has joined #ruby
<havenn>
catphish_ Hrm, works without the #force_encoding: "\xA8".encode 'ascii', invalid: :replace, undefined: :replace; #=> "?"
kpshek has joined #ruby
<shevy>
geekbri usually it would be easier if the object would have only two states
Beoran has quit [Ping timeout: 260 seconds]
cakehero has quit [Quit: Computer has gone to sleep.]
h4mz1d has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 244 seconds]
supergiantrobot_ has joined #ruby
cakehero has joined #ruby
chussenot has quit [Quit: chussenot]
My_Hearing has joined #ruby
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
fredjean has joined #ruby
Mon_Ouie has quit [Ping timeout: 265 seconds]
Guest47475 has joined #ruby
harushimo has quit [Quit: Leaving]
colinbm has quit [Quit: colinbm]
quest88 has quit [Quit: quest88]
chussenot has joined #ruby
timonv has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
theRoUS has quit [Ping timeout: 248 seconds]
lggr has joined #ruby
wting has joined #ruby
olaaa has joined #ruby
<wting>
How should I iterate through half of an array? e.g. array has 10 items and I only want to go through the first 5?
<hoelzro>
wting: take?
lolmaus has quit []
jonathan_ has joined #ruby
davidcelis has quit [Quit: K-Lined.]
<wting>
nm, I just realized Ruby also has slices
<hoelzro>
or that ;)
tk__ has quit [Quit: ばいばい]
margle has quit [Quit: Computer has gone to sleep.]
Criztian has quit [Remote host closed the connection]
jonathanwallace has quit [Ping timeout: 264 seconds]
ben_alman has quit [Excess Flood]
lggr has quit [Ping timeout: 240 seconds]
Beoran has joined #ruby
maesbn has quit [Ping timeout: 252 seconds]
Virunga has joined #ruby
icole has joined #ruby
Nisstyre-laptop has quit [Remote host closed the connection]
jonathanwallace has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
<shevy>
array =%w( a b c d e f g h i j k l m n ); array.each_slice(array.size / 2) {|slice| p slice} # => ["a", "b", "c", "d", "e", "f", "g"] ["h", "i", "j", "k", "l", "m", "n"]
<shevy>
katana slice!
jonathan_ has quit [Ping timeout: 245 seconds]
<shevy>
I am going to add aliases for ninja language
Hanmac has quit [Read error: Connection reset by peer]
<shevy>
array.katana_slice(:half)
xeronic has quit [Ping timeout: 265 seconds]
timonv has joined #ruby
answer_42 has joined #ruby
Targen has joined #ruby
icole has quit [Ping timeout: 245 seconds]
nykac_ has quit [Ping timeout: 244 seconds]
Hanmac has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
jonathanwallace has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 245 seconds]
thillux_ has joined #ruby
thillux has quit [Read error: Operation timed out]
beit has joined #ruby
havenn has quit [Remote host closed the connection]
<Xeago>
lol
gfontenot has quit []
rmcafee has joined #ruby
lggr has joined #ruby
Rochefort has quit [Remote host closed the connection]
<m3pow>
shevy, you have the black belt in ninja coding ?
<shevy>
was a time where Hong Kong still did good movies
Ankhers has joined #ruby
<shevy>
today, it
mengu has joined #ruby
<shevy>
is all dead :(
nykac_ has joined #ruby
<m3pow>
not just Chinese movies
haxrbyte_ has quit [Ping timeout: 246 seconds]
<m3pow>
but most of them are that way
<shevy>
ah
<shevy>
some good movies are still made... I liked Inception for instance...
<m3pow>
that i liked too, very good movie
<m3pow>
though matrix is my fav
lggr has quit [Ping timeout: 245 seconds]
<wmoxam>
too bad the sequels sucked
haxrbyte has joined #ruby
<m3pow>
they were good
<m3pow>
but not as the original
<shevy>
hmmm
deadghost has joined #ruby
<shevy>
Matrix 1 was ok, I think the idea in it was quite new. Matrix 2 was not that bad but was along the lines "hey guys, let's stop here and you going to watch part III ok!" ending. Matrix III really sucked, so much awful digital effects...
wchun has joined #ruby
<m3pow>
well still, that movie was about the ideea behind the effects and all
lggr has joined #ruby
<m3pow>
you should also see Animatrix
<shevy>
but take the new batman... Batman begins was ok, I did not like it that much but it was ok. The Dark Knight was really awesome... Dark Knight rises was ok but kinda unlogical, often unfitting, and Bane sounded like a croaking puppet all the time
<wmoxam>
Girl with the Dragon Tattoo was good
carloslopes has quit [Quit: Leaving.]
<shevy>
oh I saw Animatrix
<shevy>
problem with animatrix is that 50% of the short stores are nice, 50% suck
<shevy>
*stories
Synthead has joined #ruby
<shevy>
most digital effects are really bad
nykac_ has quit [Ping timeout: 252 seconds]
Morkel has quit [Quit: Morkel]
<Xeago>
what would your preferred representation of the word graduation be?
areil has quit [Remote host closed the connection]
<Xeago>
image-representation*
Emmanuel_Chanel has quit [Quit: Leaving]
<m3pow>
a beer
<wmoxam>
Xeago: typically it's either a hat
<wmoxam>
Xeago: or a rolled document
mikepack has joined #ruby
<Xeago>
looking for a button to put on the left side: blog.xeago.nl
mmitchell has quit [Remote host closed the connection]
<aces1up>
hey, I need some help with an enumerable call on my compisite tree.. the code for it is here: http://codepad.org/3fYDBZME any help would be appreciated!
booginga has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
mmitchell has joined #ruby
hbpoison has joined #ruby
blazes816 has joined #ruby
hukl has quit [Quit: Leaving...]
atmosx has joined #ruby
Z0idberg has joined #ruby
ltsstar has quit [Ping timeout: 256 seconds]
matthewrobbins has quit [Quit: matthewrobbins]
lggr has joined #ruby
willclark has joined #ruby
timonv has quit [Remote host closed the connection]
ltsstar has joined #ruby
frogprince_mac has joined #ruby
mmitchell has quit [Ping timeout: 260 seconds]
philcrissman has quit [Remote host closed the connection]
deadghost has quit [Ping timeout: 252 seconds]
_bart has quit [Ping timeout: 246 seconds]
fredjean has quit [Quit: Computer has gone to sleep.]
kaawee has joined #ruby
<kaawee>
Hello! Given a string s in encoding "ASCII-8BIT", how can I split this string into segments of 28-bytes each?
Mon_Ouie has quit [Quit: WeeChat 0.3.8]
Mon_Ouie has joined #ruby
brianpWins has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
alvaro_o has joined #ruby
<Hanmac>
kaawee: string.each_byte.each_slice(28) {|i| i }
<Xeago>
my interpreter is soon timing out, could you yield please?:P
<Xeago>
or wait I syntax erro'd you
<Xeago>
Hanmac.sample.is_fizz?
<Xeago>
:)
busybox42 has quit [Ping timeout: 256 seconds]
<Xeago>
anyways, the fun is spoiled, and the joke is bad
chussenot has quit [Ping timeout: 245 seconds]
slicslak has quit [Ping timeout: 265 seconds]
thunderstrike has joined #ruby
schickung has joined #ruby
lolmaus has joined #ruby
futilegames has joined #ruby
drkfiber has joined #ruby
gfontenot has quit []
<drkfiber>
hello
Hanmac has quit [Remote host closed the connection]
arturaz has quit [Ping timeout: 264 seconds]
sailias has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
cakehero has joined #ruby
davidcelis has joined #ruby
manizzle has joined #ruby
patrickrb has joined #ruby
<matti>
Hi drkfiber
cakehero has quit [Client Quit]
<shevy>
hi matti
<matti>
Xeago: What are you doing?
maletor has joined #ruby
<Mon_Ouie>
Now that's an elegant solution. There's even C code. Clearly that must mean it is great work.
<shevy>
hehe
nateberkopec has joined #ruby
mark_locklear has quit [Quit: Leaving]
tgraham is now known as tgraham|away
<patrickrb>
Hey everyone. I've just setup ruby/rails on a centos 6 with passenger and apache. I've got the default 'welcome aboard' page to load but when I click on "About your application’s environment" it shows a 500 internal server error. My database is mysql, I have all the necessary packages installed including the mysql gem. However, everything works as intended in the webbrick server. I can
<patrickrb>
post links to both the apache version with the error and the working webbrick version if anyone cares to see. Any tips?
lggr has joined #ruby
philcrissman has joined #ruby
mklappstuhl has quit [Ping timeout: 245 seconds]
luckyruby has quit [Remote host closed the connection]
mohits has quit [Quit: Leaving]
deadghost has joined #ruby
carloslopes has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
Chryson has joined #ruby
schickung has quit [Quit: schickung]
Spooner has joined #ruby
recycle has joined #ruby
havenn has quit [Remote host closed the connection]
zommi has quit [Quit: Leaving.]
xpen has quit [Remote host closed the connection]
Kruppe has joined #ruby
chrishunt has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
tgraham|away is now known as tgraham
recycle has quit [Remote host closed the connection]
havenn has joined #ruby
hadees has quit [Quit: hadees]
<matti>
Mon_Ouie: I know, its dull.
<matti>
Mon_Ouie: Apologies.
lggr has joined #ruby
macmartine has joined #ruby
havenn has quit [Read error: Connection reset by peer]
slainer68 has quit [Ping timeout: 246 seconds]
havenn has joined #ruby
kaawee has quit [Remote host closed the connection]
chrismcg is now known as zz_chrismcg
timepilot has joined #ruby
mercwithamouth has quit [Ping timeout: 255 seconds]
ShiintoRyuu has joined #ruby
pauC has quit [Quit: Ex-Chat]
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
lggr has quit [Ping timeout: 255 seconds]
Guest47475 has quit [Ping timeout: 260 seconds]
ncr100 has joined #ruby
thunderstrike has quit [Read error: Connection reset by peer]
thunderstrike has joined #ruby
AlbireoX`Laptop has joined #ruby
drkfiber has quit [Ping timeout: 256 seconds]
Hanmac has joined #ruby
drkfiber has joined #ruby
AlbireoX has quit [Read error: Connection reset by peer]
moted has joined #ruby
schickung has joined #ruby
hadees has joined #ruby
JohnBat26 has quit [Ping timeout: 252 seconds]
mikedevita has joined #ruby
lggr has joined #ruby
s0ber has quit [Read error: Connection reset by peer]
drkfiber has quit [Ping timeout: 246 seconds]
notwen has quit [Read error: Connection reset by peer]
diegoviola has joined #ruby
notwen has joined #ruby
<mikedevita>
i have a date stored as a date object and im trying to convert it from 'Y-m-d' to 'b d, Y' when i run Date.strptime(i.date, '%Y-%m-%d').strftime(%b %d, %Y) it gives me an error
drkfiber has joined #ruby
<mikedevita>
i shouldnt have to use strptime if its already a date object should i?
shevy has quit [Ping timeout: 245 seconds]
<mikedevita>
i should be able to just use .strftime
mk03 has joined #ruby
<matti>
mikedevita: If you already have Time / DateTime object.
<mikedevita>
its just a date ojbect
<mikedevita>
there is no time
<matti>
mikedevita: Then strftime should do.
<mikedevita>
undefined method `strftime' for nil:NilClass is what i get back
Iszak has quit [Quit: User has gone to sleep.]
<matti>
mikedevita: If you want 1st, 2nd, 25th etc in your date, then you have to do a little bit of calculation -- very easy.
<havenn>
mikedevita: Your 'date' is actually a nil.
replore_ has quit [Remote host closed the connection]
pskosinski has joined #ruby
davidpk has joined #ruby
berserkr has joined #ruby
mahmoudimus has joined #ruby
davidpk is now known as dpk
pskosinski has quit [Remote host closed the connection]
Russell^^ has joined #ruby
GoHuyGo has joined #ruby
sepp2k1 has joined #ruby
pskosinski has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
mmitchell has joined #ruby
sepp2k has quit [Ping timeout: 264 seconds]
eldariof has joined #ruby
darthdeus has joined #ruby
timmow has quit [Ping timeout: 252 seconds]
peneconleche has quit [Quit: Leaving...]
<shevy>
carwin depends on what you wanna do the most
<shevy>
carwin for me I tend to write ruby scripts that I need
Xeago has quit [Remote host closed the connection]
<carwin>
shevy: well i've been a php guy for 5 years or so -- so probably web related stuff, but i'm also just generally interested in ruby for everything
Squarepy has quit [Quit: Leaving]
<carwin>
so far i've managed to write a little script that takes arguments to find and replace strings within a string
<carwin>
and a script that utilizes libnotify in gnome
<carwin>
just prints a notification out
fantazo has quit [Ping timeout: 246 seconds]
roflmaus has joined #ruby
lggr has joined #ruby
beneggett has joined #ruby
lolmaus has quit [Ping timeout: 240 seconds]
<shevy>
carwin I used php before ruby too
<shevy>
I ported all my www things I did with php to ruby
<carwin>
oh duh! nice idea
<carwin>
can't believe that didn't occur to me lol
<shevy>
well
<shevy>
I was using php to "empower" my local knowledge base
bigmcq77 has joined #ruby
virtuose has quit [Ping timeout: 246 seconds]
philcrissman has quit [Remote host closed the connection]
<shevy>
back then all in .php, with ruby I actually use .cgi right now, which sucks... but I wont move to rails, so I need something else
jgwong has quit [Ping timeout: 256 seconds]
virtuose has joined #ruby
peneconleche has joined #ruby
jgwong has joined #ruby
yekta has quit [Quit: yekta]
<shevy>
carwin, also turn the more useful projects you write in ruby into a .gem file quickly
<shevy>
then maintain them for a longer while
virtuose has quit [Max SendQ exceeded]
* Hanmac
wispers that he use ruby for 3D games
lggr has quit [Ping timeout: 246 seconds]
gani has quit [Quit: leaving..]
virtuose has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
<jgwong>
Hanmac: Interesting, do you have any link?
xyzodiac has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 244 seconds]
<xclite>
if anybody in here has used commander to make command-line apps in ruby, i'd love tips for how to make arguments required without having to check that they were entered myself
xyzodiac has joined #ruby
Xeago has joined #ruby
juarlex has joined #ruby
daniel_- has joined #ruby
jgwong has quit [Ping timeout: 252 seconds]
treyconnell has quit [Remote host closed the connection]
olaaa has quit []
<wting>
blazes816: Close, but unfortunately get an undefined method error for .send()
lggr has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
<blazes816>
:s
<blazes816>
gist your stack trace please?
peneconleche is now known as peneconleche|awa
<blazes816>
attr = [:height, :name]; attr.map!{|a| person.send(a) if person.respond_to? a}; p attr
<blazes816>
perhaps
mklappstuhl has joined #ruby
futilegames_ has joined #ruby
Mon_Ouie has quit [Ping timeout: 245 seconds]
Mon_Ouie has joined #ruby
margle has joined #ruby
the_jeebster has joined #ruby
futilegames has quit [Ping timeout: 252 seconds]
futilegames_ is now known as futilegames
<matti>
Mon_Ouie: ;-)
xyzodiac has quit [Ping timeout: 260 seconds]
glyytchy has joined #ruby
<wting>
blazes816: Thanks for your help. I'm on a tight deadline so I've just hacked a simple fix where I explicitly print each attribute individually. I'll probably get back to this later. :-/
cbuxton has joined #ruby
xyzodiac has joined #ruby
haxrbyte has joined #ruby
<Hanmac>
wting maybe you mix instance_variables with methods ... as sample you have an @abc, that does not mean there is a method "abc" too
Raduwen has quit [Quit: Leaving...]
margle has quit [Client Quit]
lggr has quit [Ping timeout: 260 seconds]
haxrbyte_ has quit [Ping timeout: 256 seconds]
lggr has joined #ruby
deadghost has quit [Ping timeout: 260 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
ests has quit [Quit: ChatZilla 0.9.89 [Firefox 15.0.1/20120907164141]]
Xeago has quit [Remote host closed the connection]
hukl has joined #ruby
eldariof has quit [Ping timeout: 245 seconds]
hukl has quit [Client Quit]
TheShadowFog has quit [Remote host closed the connection]
TheShadowFog has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
lggr has quit [Ping timeout: 245 seconds]
Kovensky has quit [Ping timeout: 264 seconds]
hbpoison has joined #ruby
eldariof has joined #ruby
lggr has joined #ruby
duracrisis has quit [Quit: Leaving]
koshii has quit [Remote host closed the connection]
<GoHuyGo>
I know this question has been asked a million times
<shevy>
stan_man_can, apparently the second option should be a hash. in your code example, you pass in a string.
lggr has joined #ruby
<stan_man_can>
kaleido: I can promise you you're at least 4-5 steps above me
<shevy>
puts CSV.parse(csv.read, ";;") <-- you pass in ";;"
<stan_man_can>
shevy: ohhhh
<GoHuyGo>
but for someone with some programming experience ( some C - dynamic mem allocation + limited data struct) what's a good book for learning ruby
<shevy>
GoHuyGo the pickaxe is ok
joelsbeard has quit [Ping timeout: 260 seconds]
<GoHuyGo>
I've been getting destroyed in interviews becuase of simple questions like
<GoHuyGo>
how do you implement polymorphism
<stan_man_can>
so it should be CSV.parse(csv.read, {:fs => ";;"})
reset has quit [Read error: Connection reset by peer]
reset has joined #ruby
<shevy>
"polymorphism in the context of object-oriented programming, is the ability to create a variable, a function, or an object that has more than one form"
<shevy>
ok simple
<shevy>
GoHuyGo, within the body of your method, you check for the type
thnee has quit [Quit: Lost terminal]
<shevy>
def foo(a, b)
jenrzzz has joined #ruby
<shevy>
if a.is_a? Hash
<shevy>
elsif a.is_a? Array
<shevy>
end
rcassidy has joined #ruby
<shevy>
end
<shevy>
that's polymorphism in ruby in a simple way
<shevy>
then also how many arguments your method will have
<shevy>
def foo(*a)
<GoHuyGo>
right
<GoHuyGo>
but in ruby
<shevy>
there we go. now you can pass in as many arguments as you want.
<shevy>
yes in ruby
<GoHuyGo>
we have to implement it using modules no?
<shevy>
why
<yxhuvud>
shevy: it is not the ideomatic way though.
<shevy>
what has the module to do with polymorphism?
<GoHuyGo>
I have no idea
<GoHuyGo>
that's why i am asking for books :)
<GoHuyGo>
let me look
<GoHuyGo>
I wrote it down
<shevy>
with module you can mix in behaviour to your classes
<GoHuyGo>
some dude asked me this during my interview
joofsh has quit [Ping timeout: 248 seconds]
<shevy>
those questions are simply idiotic so simply give idiotic answers really
drkfiber has quit [Ping timeout: 260 seconds]
<GoHuyGo>
I wish I knew enough to give idiotic answers
<GoHuyGo>
hahaha
<shevy>
well
<yxhuvud>
GoHuyGo: go read up on duck typing. That is a lot better approach to polymorphism than explicit dispatch
ananthakumaran has quit [Quit: Leaving.]
haxrbyte has joined #ruby
<shevy>
write 100 classes on your own in ruby
<shevy>
won't take you long... 2 or 3 days
<GoHuyGo>
he mentioned
AlbireoX has joined #ruby
<GoHuyGo>
something about module mixins
<shevy>
then you can answer all those questions with real example code that works
<shevy>
there is nothing magical about mixin in a module
<kaleido>
thats all covered in the books that were linked
cbuxton has quit [Quit: Leaving.]
baroquebobcat has joined #ruby
rmcafee has quit [Remote host closed the connection]
AlbireoX`Laptop has quit [Read error: Connection reset by peer]
<shevy>
module Bar; def test; puts 'Hi this is a test.'; end; end; class Foo; include Bar; end; foo = Foo.new; foo.test
<GoHuyGo>
I forgot what he said
rmcafee has joined #ruby
<rcassidy>
ooh, walked in at the right time, i have a module question, i think
<GoHuyGo>
but basically you have to implement polymorphism using module mixins
<stan_man_can>
I really do like Ruby but coming from a PHP background I do prefer their docs
lggr has quit [Ping timeout: 245 seconds]
Neomex has joined #ruby
Neomex has quit [Client Quit]
<shevy>
GoHuyGo simply write the method into a module. task solved
haxrbyte has quit [Remote host closed the connection]
<rcassidy>
i've got 2 separate scripts i'm not supposed to be changing- but they contain global variables with the same names. when using them separately it's not an issue.
lggr has joined #ruby
pettsson has joined #ruby
roflmaus has quit []
<wting>
I'm having trouble upserting with the Ruby driver. This line works: coll.update( { "app_id" => app.app_id }, doc)
<rcassidy>
but if i wanted to write another script to utilize both of these, is there some way to compartmentalize them? i think i'm stuck squashing the global variables no matter what
<shevy>
a global variable is always global
<rcassidy>
shevy: that's what i thought
bbttxu has joined #ruby
<wting>
but this line fails: coll.update( { "app_id" => app.app_id }, doc, true)
<shevy>
you can perhaps load the first script first, copy the content of the global variable, then load the second script
F1skr has quit [Quit: WeeChat 0.3.8]
daniel_- has quit [Ping timeout: 260 seconds]
<rcassidy>
makes sense. the person who is trying to tell me not to edit these two scripts was trying to come up with a solution involving modules/classes, but i thought the global variable clashing was unavoidable, too
My_Hearing has joined #ruby
<shevy>
wting, and from the information you provided, you think anyone will be able to know what is the problem? ;)
Monie has quit [Read error: Connection reset by peer]
<rcassidy>
back to drawing board :)
Monie has joined #ruby
Monie has quit [Changing host]
Monie has joined #ruby
<shevy>
rcassidy, well yeah, whatever script is loaded last, the global variable will have that last changed value
<rcassidy>
right.
<shevy>
it is very rare that one needs to use a global variable though
Mon_Ouie has quit [Ping timeout: 246 seconds]
<rcassidy>
shevy: tell that to the person who wrote the code i inherited o_O
<shevy>
well I would tell him to stop writing code
<rcassidy>
but, yes, i agree.
<shevy>
for the good of mankind and such
<wting>
shevy: Oops, I copy and pasted from #mongodb because I didn't get a response after a while but forgot to add in certain details. xD
<wting>
but anyway it turns out I have to pass true in as a hash.
<shevy>
hehe
<shevy>
odd API :)
rippa has quit [Ping timeout: 255 seconds]
<chiel>
hi all, when I am sending an array over to the server, for some reason it arrives as an object with numeric keys
lggr has quit [Ping timeout: 245 seconds]
kermes has quit [Remote host closed the connection]
<chiel>
if I try to .to_a it, the resulting structure looks a bit like this: `[["0", "..."], ["1", "..."], ["2", "..."]]`
<chiel>
which is entirely not what I want. :p
<chiel>
is there some sane way to turn it into a regular array?
axl_ has quit [Quit: axl_]
<chiel>
i.e., ["...", "...", "..."]
sagax has joined #ruby
joofsh has joined #ruby
<Virunga>
ary.map {|a| a[1]} ?
<matti>
;
<matti>
;]
<chiel>
yeah i suppose, but i was wondering why it does this?
<Virunga>
That wasn't the question :D
<chiel>
i am posting it from javascript, where it's represented just fine as an array of strings
<chiel>
yeah ok :p
cbuxton has joined #ruby
<chiel>
is there any specific reason it's coming through as an object rather than an array?
lggr has joined #ruby
nga4 has quit [Remote host closed the connection]
nga4 has joined #ruby
Forevernade has quit [Read error: Connection reset by peer]
Juul has joined #ruby
jasonkuhrt has joined #ruby
Forevernade has joined #ruby
My_Hearing is now known as Mon_Ouie
deadghost has joined #ruby
daniel_- has joined #ruby
<chiel>
hm.. looking at the request in the inspector network tab, the data being sent looks like this:
pskosinski has quit [Remote host closed the connection]
cbuxton1 has quit [Read error: Connection reset by peer]
emmanuelux has quit [Remote host closed the connection]
<blazes816>
"oh, forgot a curly brace somewhere? segfault"
lggr has quit [Ping timeout: 256 seconds]
kpshek has joined #ruby
Xeago has joined #ruby
nyuszika7h has joined #ruby
pskosinski has joined #ruby
lggr has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
<matti>
blazes816: At least in JVM I would just print a nice stack trace on an NPE.
jonathanwallace has joined #ruby
<blazes816>
mmmm I <3 jvm
hbpoison has joined #ruby
bluenemo has quit [Remote host closed the connection]
philcrissman has joined #ruby
My_Hearing has joined #ruby
recycle has joined #ruby
recycle has quit [Remote host closed the connection]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
jonathanwallace has quit [Ping timeout: 244 seconds]
Mon_Ouie has quit [Ping timeout: 245 seconds]
hbpoison has quit [Ping timeout: 248 seconds]
haxrbyte has joined #ruby
chussenot has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
steph` has joined #ruby
lggr has joined #ruby
bluenemo has quit [Ping timeout: 240 seconds]
vlad_starkov has joined #ruby
haxrbyte_ has joined #ruby
CarlB_the_great has quit [Remote host closed the connection]
talking has joined #ruby
triptec has quit [Ping timeout: 264 seconds]
CarlB_the_great has joined #ruby
workmad3 has joined #ruby
philcrissman_ has joined #ruby
haxrbyte has quit [Remote host closed the connection]
philcrissman has quit [Read error: Connection reset by peer]
<mr-rich>
is there a GUI front end for ri?
haxrbyte has joined #ruby
slicslak has joined #ruby
krawchyk has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 252 seconds]
haxrbyte_ has quit [Ping timeout: 245 seconds]
Guest64548 has quit [Ping timeout: 246 seconds]
cbuxton has joined #ruby
lggr has joined #ruby
timonv has joined #ruby
chrisja has quit [Quit: leaving]
fmcgeough has quit [Quit: fmcgeough]
joelsbeard has joined #ruby
moshee has quit [Ping timeout: 256 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
futilegames has quit [Quit: futilegames]
haxrbyte_ has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
ij has joined #ruby
ij has quit [Changing host]
ij has joined #ruby
haxrbyte has quit [Ping timeout: 260 seconds]
cbuxton has quit [Ping timeout: 248 seconds]
mklappstuhl has joined #ruby
ori-l has joined #ruby
lggr has joined #ruby
Britney has joined #ruby
<Britney>
Hello
<mr-rich>
hi
Targen has joined #ruby
jonathanwallace has joined #ruby
Britney is now known as Ravenna
<Ravenna>
Targen?
<Ravenna>
Who is Owner here?
Ravenna has quit [Client Quit]
fredjean has joined #ruby
emmanuelux has joined #ruby
<Sou|cutter>
Is it possible to specify a timezone for Time.local(...) ? The docs indicate that you can, but when I try doing so it seems to be ignored
peneconleche|awa has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 255 seconds]
<ori-l>
hi. i'm coming to ruby from python, and find both symbols and dynamic monkey-patching a bit confusing. i want to override the value of a symbol attribute(?) so that the first time Klass[:foo] is evaluated, it's true, but subsequent evaluations are false. how would i do that?
My_Hearing is now known as Mon_Ouie
<Mon_Ouie>
Symbols don't have values; they *are* values, just like integers are.
* ori-l
weeps.
sailias has quit [Ping timeout: 245 seconds]
<Sou|cutter>
ah screw it, Time.iso8601 ftw
mahmoudimus has joined #ruby
<ori-l>
i understand this in the abstract, but i have a hard time figuring out what this means when you attach symbols to instances or classes
mmitchel_ has quit [Ping timeout: 245 seconds]
<Mon_Ouie>
That doesn't mean anything as far as I know
<ori-l>
so is there any way to make foo[:bar] == true once and thereafter false?
lggr has joined #ruby
<Mon_Ouie>
foo[:bar] calls the method #[] on foo with one argument, :bar
<Mon_Ouie>
Just like array[1] calls the method #[] on array with one argument, the integer 1
zz_chrismcg is now known as chrismcg
<ori-l>
can i wrap #[] with my own function?
hakunin has joined #ruby
<asteve>
you can get a good look at a butcher by sticking your head up a cows ass but why not take his word for it?
<asteve>
i mean...
<asteve>
wait
axl_ has joined #ruby
<ori-l>
i'm sorry if i'm being daft, i am vaguely aware of not grokking something fundamental
delinquentme has quit [Quit: Leaving]
bbttxu has quit [Quit: bbttxu]
<ori-l>
in python, i can override a type's __getitem__, so that myfoo[1] produces a computed value
<rcassidy>
ori-l: yes, you can override the [] function
<rcassidy>
is the bot still around?
<rcassidy>
>> ping
<rcassidy>
damn
Mon_Ouie has quit [Ping timeout: 246 seconds]
<ori-l>
rcassidy: thanks, i'll look up how to do that
Mon_Ouie has joined #ruby
<ori-l>
any pointers? it's not very googleable
<rcassidy>
class A; def[](arg); .....; end; end;
<tommylommykins>
def [](arg); stuff_goes_here end
<rcassidy>
google "override square brackets ruby"
triptec has joined #ruby
<ori-l>
ah cool, thanks!
Bosox20051 has joined #ruby
adurity has joined #ruby
<rcassidy>
wonder what happened to our repl-bot, it's nice to give examples of code in chat
<catphish>
Encoding::UndefinedConversionError: "\xA8" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII
hadees has quit [Quit: hadees]
lggr has quit [Ping timeout: 256 seconds]
thone has quit [Ping timeout: 244 seconds]
phantasm66 has joined #ruby
rads has joined #ruby
mmitchell has quit [Remote host closed the connection]
emsilva has quit [Ping timeout: 248 seconds]
lggr has joined #ruby
mklappstuhl has quit [Ping timeout: 245 seconds]
darthdeus has quit [Quit: Leaving...]
darthdeus has joined #ruby
bbttxu has joined #ruby
araujo has joined #ruby
philcrissman_ has quit [Remote host closed the connection]
joshman_ has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie>
roz-monokeros: Kernel#caller returns the backtrace (as an array of strings)
LouisGB has joined #ruby
ponty has joined #ruby
Hgananavak has joined #ruby
<ponty>
hi is there a short way to do the following: -if current_user && current_user.role == "customer"
<ponty>
have to do it otherwise i get an error when current_user is nil
<catphish>
that's how i do it
hbpoison has joined #ruby
<catphish>
but there is a method called try
<catphish>
which calls a method if it exists
ij has joined #ruby
<catphish>
current_user.try(:role) == :customer
<catphish>
iirc
<Paradox>
time to eat lizard meat
<catphish>
i think try is a rails feature
alanp_ has joined #ruby
<catphish>
i prefer the way you already pasted personally
lggr has quit [Ping timeout: 255 seconds]
alanp has quit [Read error: Connection reset by peer]
jgwong has quit [Ping timeout: 246 seconds]
<Hgananavak>
Is ruby used much/at all outside of web development in enterprise programming?
workmad3 has quit [Ping timeout: 244 seconds]
<catphish>
Hgananavak: that's 2 questions, but the answer to both is yes
the_jeebster has quit [Quit: Leaving.]
<catphish>
it's not designed for web
<catphish>
so it's used for everything
jgwong has joined #ruby
<catphish>
it's not as popular in enterprise development as java, but growing fast
kpshek has quit []
bbttxu has quit [Quit: bbttxu]
hbpoison has quit [Ping timeout: 246 seconds]
<ponty>
thx for the hint
mk03 has quit [Ping timeout: 245 seconds]
<Hgananavak>
I know it's not, but I'm just looking for another language to branch into, ruby's sexy but I just want to make sure it's something I actually might use i na job (I already know most C variants and Java quite well)
bobbbo has quit [Quit: bobbbo]
kpshek has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
jimeh has quit [Ping timeout: 265 seconds]
ph^ has joined #ruby
bbttxu has joined #ruby
<catphish>
i use ruby for almost everything, but C for high speed network socket stuff and desktop apps
<ponty>
Hgananavak: hackers seem to like ruby too. metasploit is written in ruby
<catphish>
ruby is certainly versitile (mostly for server applications)
Axsuul has joined #ruby
lggr has joined #ruby
<catphish>
and growing in enterprise use i believe
dustinleer has joined #ruby
dustinleer has quit [Remote host closed the connection]
headius_ has joined #ruby
jgwong has quit [Ping timeout: 255 seconds]
maletor has joined #ruby
jjbohn has quit [Ping timeout: 245 seconds]
horrror has joined #ruby
jgwong has joined #ruby
headius has quit [Disconnected by services]
headius_ is now known as headius
pygmael has quit [Quit: pygmael]
jeffreybaird has quit [Quit: jeffreybaird]
tgraham is now known as tgraham|away
<horrror>
ok so I have this school project. I need help! I have a list of images which I want to make a motion video out of them. which means i want that in 1minutes the 10 images will be shown
<horrror>
each image for average time of 6 seconds
Mon_Ouie has quit [Ping timeout: 245 seconds]
<horrror>
and transition effects would be nice too (fade-in/out, twirls etc)
<catphish>
power point?
mk03 has joined #ruby
<horrror>
I guess RMagick is the way to go. but how do I make it to be a video?
pygmael has joined #ruby
<Hgananavak>
catphish: Interesting, however 'Desktop Apps' are what we spend most of the time working on! So what do you do with Ruby then, simple scripting etc?
willclark has left #ruby [#ruby]
<catphish>
Hgananavak: i write web apps, server daemons, command line tools
<catphish>
my job is mostly socket programming and server side data processing
nga4 has quit [Ping timeout: 255 seconds]
lggr has quit [Ping timeout: 246 seconds]
jgwong has quit [Ping timeout: 252 seconds]
ph^ has quit [Ping timeout: 245 seconds]
phantasm66 has quit [Quit: *sleeeeep*]
JustinCampbell has quit [Remote host closed the connection]
xyzodiac has quit [Quit: Computer has gone to sleep.]
jgwong has joined #ruby
murtas has quit [Quit: leaving]
pygmael has quit [Client Quit]
<catphish>
we also use ruby for server and network management tools
hadees has joined #ruby
<Hgananavak>
Hmm, that's a shame. I'm more looking for something which I can easily create Desktop apps in, as this is what I do day-to-day.
stopbit has quit [Quit: Leaving]
<catphish>
ruby has good GTK bindings if you wanted to use GTK
<catphish>
but i've always preferred C for that
<Hgananavak>
Mhmm tis true, not really a fan. Mucked around with PHP-GTK for a while, too hacky for my liking
peregrine81 has quit [Quit: Computer sleeping.]
<catphish>
I use GTK with C which is really nice
lggr has joined #ruby
xyzodiac has joined #ruby
hoelzro is now known as hoelzro|away
jblack has joined #ruby
axl_ has quit [Quit: axl_]
joofsh has quit [Ping timeout: 246 seconds]
rakm has joined #ruby
<GoHuyGo>
I am using map to create a new array
cjs226 has joined #ruby
<blazes816>
nice!
<GoHuyGo>
do I just assign a new variable
<GoHuyGo>
to the block?
<GoHuyGo>
i.e.
<GoHuyGo>
b = a.map do |item| ...
<GoHuyGo>
it works liek this
lggr has quit [Ping timeout: 260 seconds]
<GoHuyGo>
but I just want to know if it's proper
<catphish>
usually you would do b = as.map {|a|a.somtthing}
rabidpraxis has quit [Remote host closed the connection]
swarley has quit [Disconnected by services]
swarley has joined #ruby
falieson has joined #ruby
swarley has quit [Client Quit]
lggr has quit [Ping timeout: 246 seconds]
swarley_ is now known as swarley
replore has quit [Remote host closed the connection]
<falieson>
http://pastie.org/4832194 yesterday to fix duplicates in line 22 we used min_id = [status.id, min_id].min but I don't really understand what it does, especially to modify it for this version of the script that updates the current db, rather than downloading it from scratch
hbpoison has joined #ruby
<falieson>
yesterdays script that 100% works to download all the tweets -> http://pastie.org/4832212