Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
<eggman2001> injekt: that's a method i defined
<injekt> ^
<injekt> then you know where it's being called?
<erikh> e.g., take pry out of the picture
wmoxam_ has joined #ruby-lang
<eggman2001> erikh: I would, but rails c loads up pry. i'm not sure offhand how to revert to the rails console
<erikh> ah, ok
<injekt> :|
<injekt> that's a massive cluster fuck
<erikh> I think it's rails, actually
<injekt> remove it from your ~/.irbrc
<erikh> I know it has ST trimming code.
<injekt> it does?
<erikh> injekt: nah, $10 it's a rails plugin
<erikh> injekt: yeah.
<erikh> err, I mean the pry integration is a rails plugin
<erikh> not the stack trimming
<injekt> ah
<injekt> yeah that's true
<erikh> rails c probably disables it
<erikh> so this could be a "pry bug"
<injekt> anyway, if that's a method eggman2001 has defined, it must be called inside Scraper.start, no?
<erikh> sort of like the deprecated rails globally defined call bug in dbi is a "dbi bug"
<injekt> heh
<erikh> good point
<erikh> anyhow, laundropalooza is going on -- I need to bail
mikeric has joined #ruby-lang
<erikh> eggman2001: best of luck!
herpless_ has joined #ruby-lang
<eggman2001> erikh: thanks!
<injekt> enjoy
<injekt> eggman2001: so, where are you calling that method?
herpless_ has quit [#ruby-lang]
<eggman2001> will do-
<eggman2001> I'm calling it inside my Scraper class
takaokouji has joined #ruby-lang
<injekt> eggman2001: right, so you know where the problem is
takaokou_ has joined #ruby-lang
<eggman2001> problem is that it's part of a loop and I'm having trouble isolating when the error occurs
<injekt> i cant help much without seeing any code
<eggman2001> i'm gonna mess with it a bit more a little later. need to cook dinner
<eggman2001> thanks for the help tho
<injekt> enjoy
lake has joined #ruby-lang
srbaker has joined #ruby-lang
Sailias has joined #ruby-lang
fayimora_ has joined #ruby-lang
acts_as has joined #ruby-lang
Spooner has joined #ruby-lang
srbartle_ has joined #ruby-lang
headius has joined #ruby-lang
heftig has joined #ruby-lang
havenn has joined #ruby-lang
Aaaarg has joined #ruby-lang
fayimora has joined #ruby-lang
srbartlett has joined #ruby-lang
imajes has joined #ruby-lang
fernicle_ has joined #ruby-lang
akahn has joined #ruby-lang
<akahn> How do you do the thing where you write some output to stdout, and then you overwrite that very line of output, like curl does when you download a file?
seanstickle has joined #ruby-lang
Heimidal_ has joined #ruby-lang
fayimora has joined #ruby-lang
srbartlett has joined #ruby-lang
srbartle_ has joined #ruby-lang
erpuds has joined #ruby-lang
looopy has joined #ruby-lang
QoQOoO has joined #ruby-lang
<akahn> ah \b is backspace
<herpless> akahn: \r?
brianpWins has joined #ruby-lang
<akahn> ah, even better, thanks herpless
srbartlett has joined #ruby-lang
herpless has joined #ruby-lang
achiu has joined #ruby-lang
srbartlett has joined #ruby-lang
macmartine has joined #ruby-lang
srbartle_ has joined #ruby-lang
<akahn> is there a method for checking whether a process I have spawned has completed?
darkf_ has joined #ruby-lang
Austin__ has joined #ruby-lang
brownies has joined #ruby-lang
jtoy has joined #ruby-lang
Heimidal has joined #ruby-lang
takaokouji has joined #ruby-lang
jfire1 has joined #ruby-lang
chimkan__ has joined #ruby-lang
tty234 has joined #ruby-lang
kain has joined #ruby-lang
tjgillies has joined #ruby-lang
ezkl has joined #ruby-lang
pvh has joined #ruby-lang
gix has joined #ruby-lang
indstry has joined #ruby-lang
Weems has joined #ruby-lang
Weems has joined #ruby-lang
neoesque has joined #ruby-lang
gnufied has joined #ruby-lang
shtirlic has joined #ruby-lang
srbartlett has joined #ruby-lang
bitrot has joined #ruby-lang
srbartle_ has joined #ruby-lang
RomyRomy has joined #ruby-lang
srbartlett has joined #ruby-lang
rushed has joined #ruby-lang
srbartle_ has joined #ruby-lang
replore has joined #ruby-lang
slimfit has joined #ruby-lang
looopy has joined #ruby-lang
srbartlett has joined #ruby-lang
publicvoid_ has joined #ruby-lang
Luxx_ has joined #ruby-lang
srbartlett has joined #ruby-lang
<erikh> akahn: Process.kill with a signal id of 0
<erikh> I believe it returns an integer -- which is how kill(2) works.
<erikh> or raises Errno::ESRCH maybe?
zach__ has joined #ruby-lang
<erikh> I can't remember -- either way, that's half the battle :)
dv310p3r has joined #ruby-lang
woollyams has joined #ruby-lang
bryno has joined #ruby-lang
QoQOoO has joined #ruby-lang
RomyRomy has joined #ruby-lang
twittard has joined #ruby-lang
MistyM has joined #ruby-lang
l0st1 has joined #ruby-lang
slimfit has joined #ruby-lang
QoQOoO has joined #ruby-lang
<MouseTheLuckyDog> Is there something similar to PopFile written in Ruby?
QoQOoO has joined #ruby-lang
eggman2001 has joined #ruby-lang
rohit has joined #ruby-lang
srbartlett has joined #ruby-lang
v0yager has joined #ruby-lang
igotnolegs has joined #ruby-lang
<oddmunds> anyone know how long rubyforge is planning to be down?
gokul has joined #ruby-lang
chessguy has joined #ruby-lang
Austin__ has quit [#ruby-lang]
<whitequark> someone still uses rubyforge?..
<oddmunds> rubyinstaller does
meise has joined #ruby-lang
[dmp] has joined #ruby-lang
[dmp] has joined #ruby-lang
mika has joined #ruby-lang
rippa has joined #ruby-lang
ivanoats has joined #ruby-lang
ryanf has joined #ruby-lang
<oddmunds> (it's not for me.)
chimkan_ has joined #ruby-lang
mrchrisadams has joined #ruby-lang
eggman2001 has quit [#ruby-lang]
gianlucadv has joined #ruby-lang
ajsie has joined #ruby-lang
ajsie_ has joined #ruby-lang
ajsie has joined #ruby-lang
Slackwise__ has joined #ruby-lang
ajsie has joined #ruby-lang
srbartlett has joined #ruby-lang
srbartle_ has joined #ruby-lang
ajsie has quit [#ruby-lang]
<raggi> whitequark: what else would you use when ec2 goes down (again)
<erikh> ha
<erikh> do not say things like this
<erikh> these are my nightmares
srbartlett has joined #ruby-lang
srbartle_ has joined #ruby-lang
stepnem has joined #ruby-lang
ajsie_ has joined #ruby-lang
h4y4shi has joined #ruby-lang
<h4y4shi> can i put a method inside a method?
<rohit> h4y4shi: I think it will get defined but not called
<h4y4shi> what if I have a method called button, then I have a method called draw. and use method.draw
<rohit> h4y4shi: it will call button first then draw
<rohit> h4y4shi: I don't know details, just experimented in IRB
<h4y4shi> Thank you rohit
eggman2001 has joined #ruby-lang
<rohit> h4y4shi: cheers
steven_ has joined #ruby-lang
srbartlett has joined #ruby-lang
srbartlett has joined #ruby-lang
rohit has quit ["Leaving"]
skryking has joined #ruby-lang
srbartle_ has joined #ruby-lang
srbartlett has joined #ruby-lang
srbartle_ has joined #ruby-lang
guns has joined #ruby-lang
achiu has joined #ruby-lang
looopy has joined #ruby-lang
srbartlett has joined #ruby-lang
lsumner has joined #ruby-lang
lsumner has joined #ruby-lang
srbartlett has joined #ruby-lang
srbartle_ has joined #ruby-lang
jfire has joined #ruby-lang
<zenspider> hoe 2.14.0 released
chimkan has joined #ruby-lang
srbartlett has joined #ruby-lang
srbartlett has joined #ruby-lang
mikeric has joined #ruby-lang
<zenspider> h4y4shi: there's no benefit or reason to put a method inside another method
looopy has joined #ruby-lang
srbartle_ has joined #ruby-lang
looopy has joined #ruby-lang
kitallis has joined #ruby-lang
spuk has joined #ruby-lang
andrewhl has joined #ruby-lang
macmartine has joined #ruby-lang
kitallis has joined #ruby-lang
davidtspf has joined #ruby-lang
davidtspf has joined #ruby-lang
davidtspf has joined #ruby-lang
<WillMarshall> What happens if I include a module I have already included?
rdw200169 has joined #ruby-lang
kitallisii has joined #ruby-lang
x0F_ has joined #ruby-lang
havenn has joined #ruby-lang
Indian has joined #ruby-lang
JohnBat26 has joined #ruby-lang
kitallis has joined #ruby-lang
skipper has joined #ruby-lang
srbartlett has joined #ruby-lang
srbartle_ has joined #ruby-lang
musl has joined #ruby-lang
srbartlett has joined #ruby-lang
kitallis has joined #ruby-lang
srbartle_ has joined #ruby-lang
dine_ has joined #ruby-lang
<dine_> Hi, I am trying to find a way to generate random records, I tried random_record and random_records plugin, but they are returning the duplicate ones like for example I have a = [1,2,3,4,5] ==> Here I need to generate numbers with high randomness but with plugins
takaokouji has joined #ruby-lang
<rippa> what's wrong with duplicates?
<dine_> Here is the gist I have created https://gist.github.com/1874181
<dine_> Here if you see after applying sample on an array numbers coming from an array are not random , numbers should be with high randomness
flebel has joined #ruby-lang
<bnagy> dine_: what makes you say that's not random?
<bnagy> (apart from not understanding statistics)
<dine_> bnagy: Numbers are random but the randomness is not high, I wanted something with high randomness
<bnagy> and you can tell this with your naked brain after 8 samples? :D
<bnagy> sample uses the ruby prng which is mersenne twisterm afaik which has as uniform distribution as you'll get
steven_ has joined #ruby-lang
<dine_> bnagy: OKay, so I think I have to write some script to generate the randome records in the sequence I want
<rippa> dine_: [1,2,3,4,5].cycle
<rippa> no doubles!
<rippa> high randomness!
kitallis has joined #ruby-lang
musl has joined #ruby-lang
<bnagy> lol
<bnagy> ruby-1.9.3-head :015 > dist=Hash.new {|h,k| h[k]=0}; 1_000_000.times do; dist[[1,2,3,4,5].sample]+=1; end; p dist
<bnagy> {4=>200220, 1=>200679, 5=>199999, 2=>199901, 3=>199201}
<bnagy> look random tooo mee
<dine_> bnagy: hmm...can any kind of script is available which will generate random or more specifically the number should repeat after a long gap
<bnagy> dine_: seriously, I don't think you understand what 'random' means
<rippa> you can shuffle the array and take numbers sequentially
musl has joined #ruby-lang
<rippa> then each one will appear one time
<bnagy> rippa: except where they join :)
<bnagy> [1,3,2,4,5] [4,5,...
<rdw200169> can't use UUID's?
<rippa> then don't reshuffle it
<bnagy> rdw200169: is that a new question, or related to thhis 'ramdom' thing?
<rdw200169> related to the random thing
<bnagy> rippa: well then you may as well just use cycle, like you said, which is not random at all
<rippa> yep
<bnagy> dine_: you're seeing what your brain thinks are patterns, it's a form of cognitive bias
<bnagy> if you had a bigger array you would be happy with the output, most likely
<dine_> bnagy: yes, may be I am considering random numbers which will be generated in any sequence
musl has joined #ruby-lang
<bnagy> so you have to understand, that if you flip a coin, sometimes it will come up heads 5 times in a row, or 10 times
your_nick has joined #ruby-lang
<bnagy> doesn't make it a biased coin, although you would think so if it happened as soon as you started flippuing
<dine_> bnagy: correct so after this discussion, I think I am not looking for random, but something that behaves likes random numbers but not as per the algorithm that randome function uses
yxhuvud has joined #ruby-lang
<bnagy> ok.. so what still makes my math brain angry is that you're misusing the word 'random', in that case
thone has joined #ruby-lang
delinquentme has joined #ruby-lang
<bnagy> if you want a totally even distribution, then do what rippa said and just cycle
|Vargas| has joined #ruby-lang
|Vargas| has joined #ruby-lang
<bnagy> but it will be obviously nonrandom
<dine_> bnagy: Okay, I will try that
<bnagy> you could shuffle every few cycles
<rippa> or keep array of several last numbers
<bnagy> but you still risk getting repeats there
<rippa> and retry if they repeat too fast
<dine_> gettign repeats is ok provided they are repeating after long interval
<bnagy> what is 'long' for an array of n elements? n?
<rippa> 2n
kitallis has joined #ruby-lang
<hagebake> what are you using the generated numbers for?
<rdw200169> dine_ why not consider something like how Blackjack works, where you shuffle the array after some % has been used?
<bnagy> :) 2n is probably not possible for more then one element, is it? :D
<rdw200169> well, Blackjack in casinos, where they start with X number of decks, and shuffle after around 1/2 have been used, to keep the card-counters at bay (and promote quasi-randomness in the dealing)
<bnagy> rdw200169: it's nothing to do with randomness
<bnagy> it's just for counting, because it's a finite set
<bnagy> to me it sounds like dine wants an enforced uniform distribution (ie NOT random)
<bnagy> I have no idea why anyone would want that, but that's another story
<dine_> hagebake: Generated numbers are may be going to use for mass mailing , not sure the exact requirement, today mornign my PM gave me this requirement to research on it
<rdw200169> yeah, I'm trying to figure out what _dine is driving at as well, if there's a finite set of records (1,2,3,4,5) and the desire to have a low number of returned duplicates over time, then start with a queue of the whole array, then expend that queue in a 'random' fashion, .remove()-ing as its used, then repopulate the array after the 'allowed' period of time passed in which a duplicate is then allowed
<hagebake> clarify? why do you need "random" for mass mailing?
<bnagy> rdw200169: that's Array#sample :D
<bnagy> uh sample.cycle I guess in effect
jredville has joined #ruby-lang
<rdw200169> bnagy touche, i looked again at Array#sample and you are correct, it does take into account duplicates
twittard has joined #ruby-lang
<rdw200169> bnagy, _dine, as such, I am in agreement, then, that with a (much) larger dataset, the results would be much more pleasing
<delinquentme> can anyone here make a recommendation for Java <> Ruby packages specifically for applications in RoR?
<bnagy> rdw200169: there are only no repeats if you do sample(n) I think
<rdw200169> Rails works with JRuby...
<bnagy> like [1,2,3,4,5].sample(5) is the same as shuffle, effectively
krz has joined #ruby-lang
kitallis has joined #ruby-lang
havenn has joined #ruby-lang
<rippa> a = [1,2]; b = [3,4,5].shuffle
<rippa> random = b.first; a << b.shift; b << a.sample
<rippa> cool?
<rippa> guaranteed no repeats for b.length
<bnagy> %(
<bnagy> [1,2,3,4,5].sample 3
jredville has joined #ruby-lang
<delinquentme> rdw200169, seen it?
<rippa> bnagy: but then element can repeat when you sample again
musl has joined #ruby-lang
<bnagy> well you said no repeats for b.length (3) ?
wallerdev has joined #ruby-lang
<rippa> yes
<dine_> Hi, I liked the idea of suffling an taking the numbers sequentially from an array, this way even if numbers are repeating they will be repeating after some interval??
<dine_> shuffling*
<rippa> and sample(3) can give you [1,2,3],[3,2,1]
<rippa> repeats faster than 3
<rippa> dine_: after longest interval possible
<bnagy> longest interval possible is just cycle
<dine_> rippa: yes
<bnagy> ok I am going to find someone else who has done any stats and commit joint suicide
dc5ala has joined #ruby-lang
<heftig> class Array; def samples; return enum_for(__method__) unless block_given?; loop { yield sample }; end; end
<bnagy> ok I was joking about the suicide before, but now I'm actually considering it
twittard_ has joined #ruby-lang
Indian has joined #ruby-lang
kitallis has joined #ruby-lang
uniqanomaly__ has joined #ruby-lang
dhruvasagar_ has joined #ruby-lang
Carnage\ has joined #ruby-lang
your_nick has joined #ruby-lang
rdeshpande has joined #ruby-lang
QaDeS has joined #ruby-lang
musl has joined #ruby-lang
woollyams has joined #ruby-lang
setmeaway has joined #ruby-lang
sandelius has joined #ruby-lang
your_nick has joined #ruby-lang
csherin has joined #ruby-lang
kitallis has joined #ruby-lang
kitallis has joined #ruby-lang
tyman has joined #ruby-lang
Alik has joined #ruby-lang
dine_ has joined #ruby-lang
fritzek has joined #ruby-lang
robertcarter has joined #ruby-lang
kitallis has joined #ruby-lang
virunga has joined #ruby-lang
havenn_ has joined #ruby-lang
dhruvasagar has joined #ruby-lang
zmack has joined #ruby-lang
<yorickpeterse> Morning
solars has joined #ruby-lang
jfelchner has joined #ruby-lang
chezduck has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
frangiz has joined #ruby-lang
kitallis has joined #ruby-lang
cyril_ has joined #ruby-lang
cyri_ has joined #ruby-lang
WillMarshall has joined #ruby-lang
havenn has joined #ruby-lang
kitallis has joined #ruby-lang
jfelchner has joined #ruby-lang
evenix has joined #ruby-lang
<evenix> hi all anyone can help me with this http://pastebin.com/vUqcWcGH ?
<evenix> I wasn't able to figure out exactly why my test is failing but the paste bin shows whats I've done so far.
<injekt> evenix: wow you're still doing that?
apeiros_ has joined #ruby-lang
<evenix> injekt: ha yes i'm persistent. I read more about hashes, struct and classes and started to figure out what I was doing wrong. I was able to pass one test but the second one won't work.
mytrile has joined #ruby-lang
<injekt> evenix: line 37 is bad, you dont want to use class variables in tests
<injekt> hell, if you can avoid them (which you can), you rarely want class variables anywhere
<evenix> ok arrant class variable used by all the instance of the class?
<apeiros_> +1 @ no @@s
<evenix> arren't*
<evenix> apeiros_: ok
<evenix> injekt: Aren't class variables used b all the instance of a class? As soon as I use @ instead of @@ i get an error message.
chendo has joined #ruby-lang
brownies has joined #ruby-lang
<apeiros_> the problem with class vars is that their scope is far broader than just class+instances
<apeiros_> and no, you can't just swap out @@foo with @foo, the two work differently
<injekt> if you alter a class variable in an inherited class, the variable is changed for the parent class and all children classes..
<injekt> :)
<injekt> but yeah, you cant just swap them as apeiros_ says
<injekt> you must learn how they work
<evenix> ok true yea it make sense that can become a problem since their scope is much larger. Thanks.
<evenix> i'll try not to use it.
<evenix> Do you know what is wrong with my while loop? it is working fine when it test 1 word and fail when it test more than one words..this is really bothering me
<injekt> I cant even read pastebins if im honest
<injekt> that is, I dont even try
<injekt> use something that doesn't suck, paste them as separate files in the same paste
<injekt> gist.github.com
<evenix> ok hold on
<injekt> that is, one file for lexicon.rb, one for test, one for error
rhizmoe has joined #ruby-lang
<rhizmoe> is there a reason i can't find any libnotify gems? ruby-libnotify and libnotify are both DOA
<rhizmoe> at least as far as bundler's concerned
<injekt> can't find them?
kitallis has joined #ruby-lang
burgestrand has joined #ruby-lang
retro-in-better- has joined #ruby-lang
retro|cz has joined #ruby-lang
roadkith has joined #ruby-lang
thone has joined #ruby-lang
<injekt> evenix: first, remove your second failing test and put it into a separate method
<evenix> the thing is i am supposed to do the program from the test
<injekt> what?
<evenix> its an assignment
<injekt> so?
<evenix> ok so you are saying that the test won't work if I don't make some modification to it?
<injekt> evenix: well, your first assertion passes when you remove the second
<injekt> that tells me something is wrong
<evenix> true
<evenix> ok I'm going to create a separate method for it
<evenix> and see how it responds
adambeynon has joined #ruby-lang
havenn has joined #ruby-lang
<evenix> injekt: just did.. got the same response. When @@lexicon.scan("north south east") is called, struct Lexicon::Pair token=:direction, word="north" is returned. While it is supposed to return 3 new struct. So I am assuming that there is something wrong with my while loop.. problem is, I don't know where.
<shevy2> ewwwww class vars
<apeiros_> lol, shevy joins…
<apeiros_> (we said the same, shevy2 ;-)
<injekt> evenix: read that it's ultra simple
<shevy2> oh wait
<shevy2> ah
<shevy2> I am still not fully awake :-) wondered where the class var went, then I realized that injekt showed that code, not evenix
<shevy2> need... cold... water... to... face...
<evenix> injekt: Interesting.. thanks… i didn't know about the map method.
<injekt> then i dont recommend that book
<injekt> also if the statement evaluates to false it'll throw a nil entry in there, so you need to compact those so scan returns an empty array
<injekt> then you can do `assert_empty Lexicon.scan('no keywords here')`
<evenix> oh I see. So my while loop didn't work because a false value was returned when it evaluated one of the match as nill which ended my loop?
<injekt> you always ended your loop early if a match was found
<evenix> thanks a lot.. its like a spark of light in the dark
<injekt> Pair is a bad name for that struct, surprised they used that in the exercise
<injekt> oh wow their test file is literally yours your just copied it, so they use class vars in that rather than setup
* injekt shoots self
<evenix> i think at the end of the assignment I was supposed to figure a way to pair the different kind of :token (direction, verbs, etc..) thats why
<injekt> please stop reading that book
<evenix> haha
<evenix> I just need that feeling of achievement when ill reach 52.. 3 more to go
<injekt> they're just doing such weird/stupid things, and passing these things on to new users
<evenix> well,..any recommendation? I finished reading 'Learn to program' and i go back to it every time i need to clarify some doubts.
<rue> injekt: Pair = Struct.new :a, :b, :c
rohit has joined #ruby-lang
<injekt> rue: :D
futurechimp has joined #ruby-lang
<injekt> as an example
eydaimon has joined #ruby-lang
Indian has joined #ruby-lang
dju has joined #ruby-lang
tjadc has joined #ruby-lang
pp01bit has joined #ruby-lang
lsegal has joined #ruby-lang
<evenix> injekt: thanks, I appreciate. I understood the first one, I'll keep this one in my bookmark just in case and for future use.
dejongge has joined #ruby-lang
virunga has joined #ruby-lang
vesan has joined #ruby-lang
tekin has joined #ruby-lang
shtirlic has joined #ruby-lang
tyman has joined #ruby-lang
dhruvasagar has joined #ruby-lang
jstemmer has joined #ruby-lang
brownies has joined #ruby-lang
at5l has joined #ruby-lang
corsican has joined #ruby-lang
nuclearsandwich has joined #ruby-lang
at5l has joined #ruby-lang
thisirs has joined #ruby-lang
jstemmer has joined #ruby-lang
dhruvasagar has joined #ruby-lang
virunga has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
<rob_> hi, what's the recommended way to install ruby in windows?
<rob_> thanks
<andrewvos> rob_: The only way to install ruby on windows is to not install ruby on windows. Yeah or what rippa said.
masterkorp has joined #ruby-lang
<rob_> andrewvos: :)
<rob_> i've written an app to sync files between windows and linux so it's sort of necessary :)
<valeri_ufo> why would you write such a script?
<valeri_ufo> unison probably does a better job.
<rob_> well basically what it does is make hashes of files in a directory then compares these to files in a remote location and see's if it can move the ones in the remote location about to match the local location
<rob_> i run it before running rsync -avz -e ssh --delete <src> <dst>
<rob_> oh
<rob_> yes it basically does what unison does :)
<rob_> i didnt know that existed
<valeri_ufo> yeah, that's the problem with reinventing the wheel.
Oloryn_lt1 has joined #ruby-lang
<rob_> the binary packages for unison are 3 years old
<rob_> is that right?
<ruskie> 2010 or so
<rob_> they dont make it a simple process do they
rdw200169 has joined #ruby-lang
Natch| has joined #ruby-lang
voker57 has joined #ruby-lang
rohit has joined #ruby-lang
eydaimon has joined #ruby-lang
codewrangler has joined #ruby-lang
workmad3 has joined #ruby-lang
setmeaway has joined #ruby-lang
tekin has joined #ruby-lang
NARKOZ has joined #ruby-lang
futurechimp has joined #ruby-lang
niklasb has joined #ruby-lang
<shevy> hehe
<shevy> why make things simple when you can make them COMPLICATED and sell that complexity!
<shevy> why else use java after all
<lianj> because of the jvm?
<shevy> well these days perhaps
<shevy> but not 1996!!!
jxie has joined #ruby-lang
<uniqanomaly__> http://harmful.cat-v.org/software/java funny quotes
<shevy> I like that
<shevy> "Java is write once, run away."
<shevy> it still dominates TIOBE though :( http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
<shevy> haha the Paul Graham's quotes are the most evil of them all
<shevy> Like the creators of sitcoms or junk food or package tours, Java's designers were consciously designing a product for people not as smart as them. -- Paul Graham
<uniqanomaly__> tiobe = code monkeys
<uniqanomaly__> statistics
<ddfreyne> Java, the best argument for Smalltalk since C++. -- Frank Winkler
<ddfreyne> sad :)
<shevy> hmm
<shevy> what I really don't like in smalltalk is the syntax :(
mark_locklear has joined #ruby-lang
MistyM has joined #ruby-lang
lorenzo has joined #ruby-lang
traws has joined #ruby-lang
tekin has joined #ruby-lang
stephenp has joined #ruby-lang
willdrew has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
yalue has joined #ruby-lang
v0yager has joined #ruby-lang
workmad3 has joined #ruby-lang
MistyM has joined #ruby-lang
vdrab has joined #ruby-lang
jondot has joined #ruby-lang
<jondot> hi guys. given a C library, to make bindings to ruby, should i go ffi or C extension?
bryanl has joined #ruby-lang
dc5ala has joined #ruby-lang
<whitequark> jondot: ffi. definitely.
<jondot> because this buys me into jruby and rbx?
<whitequark> you'll waste like 10 times less time and will get free compatibility with jruby/rbx
<jondot> so the $10M question is, what would be a relevant reason to use C extension?
<whitequark> what's the library?
<jondot> i havn't decided yet, i'll be doing it for educational purposes
<whitequark> well, there are really few things I wouldn't use ffi for
<whitequark> fiddling with MRI internals (not a very bright idea anyway)
bglusman has joined #ruby-lang
<whitequark> maybe wrapping up a very perverted interface which does not map to the type system provided by ffi (unlikely)
stepnem has joined #ruby-lang
<whitequark> I'd say that 99% of C extensions should have been written with ffi.
<jondot> i see, that's reasonable.
<jondot> well, thanks man, i'll focus on FFI
<whitequark> even if they're not wrappers for a C library; you can just compile a .so and load it at runtime
<whitequark> I did that recently and it's awesome how this method is fast to develop and error-proor
<whitequark> (.so/.dylib/.dll)
<whitequark> *error-proof
<jondot> great, is this sometihng i can look at and learn from?
<jondot> thanks!
<whitequark> that's a Qt library attached as a C ext
<whitequark> you would never manage to get it compile with standard extconf.rb rules
<jondot> well its ok, i'll just read around the code
Sailias has joined #ruby-lang
robbrit has joined #ruby-lang
Spooner has joined #ruby-lang
toretore has joined #ruby-lang
Natch| has joined #ruby-lang
andkerosine has joined #ruby-lang
<andkerosine> Arguments for not using parentheses unless required?
workmad3 has joined #ruby-lang
<jondot> andkerosine, you're looking for reasons to not use parens/
<jondot> ?
<andkerosine> No, support for my preference.
<andkerosine> Not including them looks and feels awkward to me.
<andkerosine> But it seems like the "Ruby way".
<jondot> ah.
stef_204 has joined #ruby-lang
<jondot> well, its a matter of getting used to. eventually i don't even think about it, sometimes i do and sometimes i don't use them. eventually it is very similar to the 'ruby' way
<jondot> the points i make to myself is minimalism and readability
<andkerosine> My very same stance.
<andkerosine> I don't know that leaving them off ever /improves/ readability, though.
<jondot> even for a single argument methods
<jondot> obj.foo "this"
<jondot> it really matters, for me, what is obj, what is foo and what is "this"
<jondot> for example, if this were a mathematical notion, i'd keep the parens. myobj.compute(0.7)
<jondot> if this were some kind of filesystem notion, I won't use parens: myobj.storage_dir "/tmp/foo/that"
<jondot> this is definitly my own judgement of 'readable'
<jondot> you might *have* to use parens where there is ambiguity for last hash param and a code block, ofcourse.
thone has joined #ruby-lang
<andkerosine> Mm-hmm, I pretty much follow your logic there.
Natch| has joined #ruby-lang
<andkerosine> I just hate how inconsistent it feels when considering the whole "code picture".
Natch| has joined #ruby-lang
<shevy> andkerosine I use parens in method definitions like def foo(bar), when I call a method without arguments, I dont use (), with arguments I use () though... cat.jump_at(:dog)
<shevy> I see in rails a lot of this though:
<shevy> link_to :foo => "bla", :ble => "lala"
<andkerosine> Mm-hmm.
<andkerosine> I'm all for brace-less hashes.
<shevy> so here I am not sure, because they are right in that case, leaving off the () is more readable
<andkerosine> It just makes sense, and }) really itches me.
<shevy> I am not sure yet what to do with that
tjadc has joined #ruby-lang
<shevy> yeah
<shevy> what I really hate is code where () is omitted in method definitions.
<andkerosine> Mm-hmm.
<shevy> def foo bar, bla
<andkerosine> Just Regexed it into my codebase, not a fan.
<shevy> well yeah it can be inconsistent
<andkerosine> But, like, taking in URIs for example, and then converting them, you get code like this:
<andkerosine> uri = URI uri
<shevy> ugh what is that
<andkerosine> And that just really bugs me for some reason.
<shevy> yeah
<andkerosine> Of course, uri = URI(uri) isn't much better...
<shevy> hehe
<andkerosine> But I think it makes the most sense.
<shevy> well
<andkerosine> It's a URI, so store it in a UI variable...
<shevy> my brain is faster to understand the latter
<andkerosine> *uri variable
<andkerosine> You'd recommend changing the name, presumably?
<shevy> I am not sure
<shevy> the problem is, there are pieces of code where I solve a given problem
<shevy> and then I may even align things into one line
<shevy> I give you an example, a moment
<shevy> if block_given?; cliner(colour); yield; end
<shevy> cliner() is the name of that method
<shevy> if a block is given, it calls itself
<shevy> I tried to align it into 4 lines instead, without ;
<shevy> but I decided 4 lines was not worth it. So I kinda crammed it into one line, and stopped thinking about it
<andkerosine> Hm. I'm not too big on alignment unless it's variable assignment.
<shevy> and I do that a lot with some code elements
<shevy> (when it is reasonable... not when it is a long piece of code that is complicated)
<andkerosine> Well, here's my problem code, for reference: https://gist.github.com/1876766
<shevy> hmm
<andkerosine> Most of those parens aren't required, they just "feel" better.
<shevy> yeah
<shevy> I definitely prefer with parens in that code
<shevy> well consider
<shevy> def self.request(input, data = nil)
<shevy> uri = URI(input)
<shevy> uri = URI input
<shevy> I think with () is definitely better
<shevy> and the variable name, I don't think it makes a huge difference
<shevy> uri is used only once, in uri.path
bjensen has joined #ruby-lang
stepnem has joined #ruby-lang
tomzx has joined #ruby-lang
<andkerosine> Well, and then again in Conn#request, but yeah, I think I'll just keep it as is.
<andkerosine> And then there's this: https://gist.github.com/1876793
<andkerosine> Should they not be on one line like that? Should I un-paren them even if I'm using parens /everywhere/ else?
<andkerosine> Ruby's creative license is a double-edged sword in that it makes my OCD even consider these things... : /
davidsmith4 has joined #ruby-lang
optikalmouse has joined #ruby-lang
<optikalmouse> is there a *good* tutorial for using ruby-git?\
<optikalmouse> The examples are crap in the RDoc of the package...
enebo has joined #ruby-lang
gianlucadv has joined #ruby-lang
mlangenberg has joined #ruby-lang
<mlangenberg> Just discovered this great gem call Faraday :d
<mlangenberg> makes me happy
<mlangenberg> just wanted to sahre.
<mlangenberg> share*
<shevy> what a name
<shevy> my Einstein gem is stronger than your Faraday gem!
<deryl> my Tessler beats you all!
<deryl> Tesla? (sp)
<mlangenberg> :P
bitrot has joined #ruby-lang
<mlangenberg> Finally a good way to be a nice HTTP client an actually follow Last-Modified and ETAG directives.
phillip has quit ["Leaving"]
rdw200169 has joined #ruby-lang
slyphon has joined #ruby-lang
<optikalmouse> no good tutorials for using ruby-git?
rippa has joined #ruby-lang
JEG2 has joined #ruby-lang
<shevy> only ruby-gtk !
mytrile has joined #ruby-lang
dv310p3r has joined #ruby-lang
lake has joined #ruby-lang
<optikalmouse> how do I write a function definition that accepts a block?
<yorickpeterse> optikalmouse: def my_function; yield; end
<ddfreyne> optikalmouse: no different, you just use yield to call the block
<yorickpeterse> Or def my_function(&block); block.call; end
<ddfreyne> what yorickpeterse says
<ddfreyne> yorickpeterse: damn you for being fast
<optikalmouse> what if I'm passing in multiple blocks? I can't use yield then right?
<yorickpeterse> optikalmouse: http://www.youtube.com/watch?v=VBC-G6hahWA
<yorickpeterse> That video discusses blocks, procs and lambdas and should be useful
<ddfreyne> you canno thave multiple blocks
<ddfreyne> you can pass Procs though
<optikalmouse> how do I pass a block from my function to another function? like this: def myfunc(&block); File.open(filename, 'r') block.call?
<yorickpeterse> > def foo(a, b); a.call; b.call; end; foo lambda {}, lambda {}; # etc)
<ddfreyne> optikalmouse: yeah
outoftime has joined #ruby-lang
wyhaines has joined #ruby-lang
<lianj> ddfreyne: yea?
<ddfreyne> yeah!
<lianj> echo BAR > foo; ruby -e 'def a(&block); File.open("foo", "r", &block); end; a{|f| p f.read }'
slyphon has joined #ruby-lang
leonL has joined #ruby-lang
<andkerosine> Is it possible to determine from within method Y that it was called from within method X?
<rippa> andkerosine: Kernel#caller
<andkerosine> Thanks much.
<optikalmouse> does ruby-git have a show function?
adambeynon has joined #ruby-lang
leonL has joined #ruby-lang
<optikalmouse> I'm guessing not, /me monkeypatches Git::Base to add it....
<erikh> now you have two problems
<optikalmouse> actually, one less problem
<erikh> wait until you upgrade ruby-git
<optikalmouse> won't be upgrading, that's the beauty of sticking to stable packages ;p
<erikh> yep, everyone says that
<shevy> hehe
<optikalmouse> (and the beauty of working somewhere where I have no choice about it -_-')
<erikh> then rails 3.1 comes out and dhh is all like trolololololol
<shevy> 4.0 at least!
<shevy> it's the hipster child of 2.0
<optikalmouse> yep, we're using rails 2.x here and jruby 1.3 or something
<erikh> I have made more money cleaning up fucked up monkeypatches than probably anything else I've done in my programming career
<optikalmouse> erikh: that might be because PHP programmers have migrated to Ruby ;)
<erikh> yes, because php programmers are the only ones that are retarded
* erikh sighs
<optikalmouse> I've done some Smalltalk, COmmon Lisp, etc. and it's perfectly fine to extend classes in Smalltalk, but then, it is built better than Ruby.
tjadc has joined #ruby-lang
<erikh> that's great.
bryancp has joined #ruby-lang
<erikh> monkeypatching external libraries is almost always a bad idea
<erikh> wrap the library if you need to
<erikh> there's usually a better way of doing it.
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
havenn has joined #ruby-lang
gsav has joined #ruby-lang
<rippa> monkeypatching is like
<rippa> "decoupling? what's that?"
rayners has joined #ruby-lang
virunga has joined #ruby-lang
<outoftime> in a world where library authors were conscientious about dependency injection, monkey-patching would be unjustifiable
<outoftime> sadly, that is not a world we live in.
gsav has joined #ruby-lang
wallerdev has joined #ruby-lang
<optikalmouse> I think the problem with monkeypatching is that it's difficult to see what the diff between versions of the classes you extended are,,,but I would see that as more of a tools problem than a problem with monkeypatching?
<outoftime> optikalmouse: assuming the library's git repo has version tags, git diff is a pretty good tool
jtoy has joined #ruby-lang
<shevy> the only real problem I see with godpatching is that you can not easily undo a modification. when you extend class String, it tends to be a global change, and that can suck.
<outoftime> in my opinion, one should only godpatch if the addition is of general relevance to the class you're extending.
<outoftime> not, say, extending Symbol to support a DSL for your individual library. that makes my blood boil.
<shevy> I'd love to be able to say, "In file foobar.rb, I want to extend class String with a new method called foo, but this change is specific to foobar. Do not use this for other libraries."
<outoftime> shevy: there is actually a proposed ruby feature for that
<shevy> yeah in 500 years ;<
<outoftime> shevy: with a draft implementation -- but it's not performant
<outoftime> i forget what it's called though : \
slyphon has joined #ruby-lang
<shevy> outoftime I think things often get a lot more readable with some extensions
<shevy> I carry around a lot of modifications to ruby core classes. But in projects when I release things for other people, I tend to rather avoid doing any modifications to ruby's standard behaviour when possible
<outoftime> in my opinion, the Ruby community places a bit too much emphasis on readability.
<andkerosine> ^ Fuck this noise.
<andkerosine> : P
<outoftime> shevy: sure, if you're just using it yourself, it's fair game.
<shevy> yeah the PHP guys never bother with readability hehe
<outoftime> oh right, Q.E.D. : P
<shevy> but they can focus on other things too that way
<shevy> when they don't have to care about readability, they can focus on creating things
sockmonk has joined #ruby-lang
<outoftime> there's a balance to be struck, of course.
<optikalmouse> anyone know how to pass a string to YAML?
<outoftime> optikalmouse: how do you mean, "pass a string to yaml"?
<optikalmouse> yaml.load('hello world')
<outoftime> ...looks like you're passing a string to YAML
<outoftime> so yes! you know how to pass a string to YAML : )
<optikalmouse> wow, I assumed load means load from file.
<optikalmouse> you know, that would make sense.
<optikalmouse> what happens if I pass in a filename to load? will it try to load a file or try to parse the string?
<outoftime> optikalmouse: YAML.load_file
<optikalmouse> oh I see, it loads from an IO stream
<shevy> I tend to use YAML.load_file()
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
jtoy has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<vereteran> is there something like respond_to? but called on class for instance methods? something like String.has_instance_method?(:index) # => true
jbsan has joined #ruby-lang
<outoftime> vereteran: yeah, method_defined?
<vereteran> outoftime, thank you!
<outoftime> vereteran: vereteran no prob
<outoftime> hmm, said your name more times than needed there.
jbsan has joined #ruby-lang
eggman2001 has quit [#ruby-lang]
jbsan has joined #ruby-lang
macmartine has joined #ruby-lang
bjensen has joined #ruby-lang
krz has joined #ruby-lang
rdeshpande has joined #ruby-lang
jfire has joined #ruby-lang
pemeon has joined #ruby-lang
<vereteran> is there any way to tell bundler that gemfile should be actually downloaded from specified location and built?
Phrogz has joined #ruby-lang
Phrogz has joined #ruby-lang
<Phrogz> I wish that there existed Range#clamp, such that range.cover?( range.clamp( any_value_comparable_to_the_ends ) ) #=> true
<Phrogz> [0.0,[1.0,val].min].max seems ghetto
<optikalmouse> Phrogz: it can happen! monkeypatch it :P
<Phrogz> optikalmouse: I know :)
<optikalmouse> and then submit it as a patch to the developers ;p
dc5ala has joined #ruby-lang
canton7 has joined #ruby-lang
slimfit has joined #ruby-lang
fvollero has joined #ruby-lang
tekin has joined #ruby-lang
apeiros_ has joined #ruby-lang
burgestrand has joined #ruby-lang
cjs226 has joined #ruby-lang
looopy has joined #ruby-lang
vmatiyko has joined #ruby-lang
fvollero has joined #ruby-lang
apeiros has joined #ruby-lang
pogopolice has joined #ruby-lang
achiu has joined #ruby-lang
Heimidal has joined #ruby-lang
fvollero has quit [#ruby-lang]
khaase_ has joined #ruby-lang
khaase has joined #ruby-lang
corundum has joined #ruby-lang
ahf has joined #ruby-lang
stderr-_ has joined #ruby-lang
perryh_ has joined #ruby-lang
perryh has joined #ruby-lang
oddmunds has joined #ruby-lang
akahn has joined #ruby-lang
gjaldon has joined #ruby-lang
Tick-Tock has joined #ruby-lang
jordan` has joined #ruby-lang
gokul has joined #ruby-lang
FastJack has joined #ruby-lang
gianlucadv has joined #ruby-lang
EvilJStoker has joined #ruby-lang
melter has joined #ruby-lang
jordan` has joined #ruby-lang
v0yager has joined #ruby-lang
drbrain has joined #ruby-lang
jredville has joined #ruby-lang
mrsolo has joined #ruby-lang
Fretta has joined #ruby-lang
jordan` has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
<andkerosine> Hm... better to just tell the user to properly use the authorize method and terminate, or offer a second chance at login on the terminal?
drbrain has joined #ruby-lang
<andkerosine> Phew. : )
csherin has joined #ruby-lang
solars has joined #ruby-lang
pemeon has joined #ruby-lang
achiu has joined #ruby-lang
fayimora has joined #ruby-lang
<optikalmouse> so what's the diff between passing options to a method like this (:x => 1) and {:x => 1}?
<andkerosine> None at all.
<erikh> sure there is
<andkerosine> Well, not if it's the only argument.
<erikh> (:x => 1) requires a splat
<whitequark> apart from the fact that you cannot do `object.meth { :x => 1 }'
<optikalmouse> wtf is a splat.
<whitequark> erikh: no it does not
<erikh> foo(y, :x => 1) does not require a splat?
<whitequark> try it yourself
<optikalmouse> are these perlisms?
<andkerosine> Yes.
<whitequark> andkerosine: source?
<erikh> no they aren't
<erikh> ugh
<andkerosine> Sorry, strikes me as a very Perl-y thing. : /
<erikh> fat commas work very differently in ruby than in perl
headius has joined #ruby-lang
<optikalmouse> wtf is a fat comma?
<erikh> =>
<optikalmouse> an arrow??
l0st1 has joined #ruby-lang
<erikh> it works like a comma.
<whitequark> perl isn't known for obvious naming
<whitequark> erikh: in perl, not in ruby
<andkerosine> erikh: Passing bracket-less hashes does not require explicit splatting.
<optikalmouse> whitequark: neither is ruby ;)
workmad3 has joined #ruby-lang
* erikh sighs
<whitequark> optikalmouse: well, at least perl has way more unnecessarily unobvious names
<whitequark> actually, the option hash passing is a flexible and unobtrustive form of named arguments
<whitequark> e.g. in Python you can `def method(self, a,b,c)' and then call it as `obj.method(a=1, c=3, b=2)'
<whitequark> Ruby does not have such a builtin construct by a multitude of reasons
<whitequark> but it does not need to
H2H has joined #ruby-lang
drbrain has joined #ruby-lang
<whitequark> erikh: the implicit hash must be the last argument. the code you've posted won't work with splat too
<whitequark> method definition and method calling are completely independent in Ruby
<erikh> yep
<whitequark> the calling code does not know anything about the code it is called. argument names, argument types, splat presence, etc.
<erikh> that's why you don't do stupid things like that
<whitequark> it just passes an array of arguments and a block, nothing more
<erikh> yep. Method#arity
<whitequark> you can introspect methods
<whitequark> you can even get the bytecode
<whitequark> still, this info isn't used in the actual calling protocol
<whitequark> that's why things like DRb work
ageekymonk has joined #ruby-lang
<whitequark> (well, you could get drb to work even with mandatory introspection, but that would be much less efficient)
andrewhl has joined #ruby-lang
hagebake has joined #ruby-lang
hagebake has joined #ruby-lang
<optikalmouse> how the hell do I create a yaml stream? I don't want to serialize ruby objects as YAML, I just want to create a tree, just like you do with XML -_-'
<apeiros> Errno::ENOSENSE
<whitequark> (replace Psych class name by YAML in your actual code.)
workmad3 has joined #ruby-lang
darkf has joined #ruby-lang
nofxx has joined #ruby-lang
gsav has joined #ruby-lang
leonL_ has joined #ruby-lang
Dreamer3 has joined #ruby-lang
Bwild has joined #ruby-lang
Jake232 has joined #ruby-lang
m3nd3s has joined #ruby-lang
dberg has joined #ruby-lang
havenn has joined #ruby-lang
Fullmoon has joined #ruby-lang
<darix> since when is an xml tree a stream?
<andkerosine> Tomorrow.
<optikalmouse> Today.
<optikalmouse> darix: when it's being written or read?
<andkerosine> "Stream" doesn't have so loose a definition.
<optikalmouse> why not? :D
<whitequark> darix: XMPP
<darix> whitequark: yeah but isnt it more a stream of xml trees?
<darix> hm
v0yager has joined #ruby-lang
v0yager_ has joined #ruby-lang
Sailias has joined #ruby-lang
skipper has joined #ruby-lang
gokulnath has joined #ruby-lang
amerine has joined #ruby-lang
havenn has joined #ruby-lang
tbuehlmann has joined #ruby-lang
v0yager has joined #ruby-lang
fayimora has joined #ruby-lang
twittard has joined #ruby-lang
dejongge has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
thrcka has joined #ruby-lang
<shevy> hmm and again I wonder how to arrange my various .rb files in a project
<shevy> right now I am putting them all into a lib/ subdirectory
<deryldoucette> prefix them with ###- :) yeah thats the ticket
woollyams has joined #ruby-lang
<deryldoucette> or better yet, prefix with . and confuse thyself (muahaha)
<necromancer> is it possible to mark messages as read using the Mail gem?
<outoftime> necromancer: isn't Mail just for sending mail?
<necromancer> outoftime: nope. it can read from a POP mailbox too
<outoftime> necromancer: oh
<necromancer> there's a Mail::Message.mark_for_delete boolean I can set but it doesn't seem to be working
<necromancer> i don't see a mark_as_read in the docs...
<whitequark> darix: nope
<whitequark> the root element isn't closed in the middle of stream
<whitequark> so, it can only be parsed with SAX, not DOM
havenn has joined #ruby-lang
<manveru> necromancer: read the source luke
<apeiros> shevy: generally map constants to paths
<apeiros> i.e. Foo::Bar --> lib/foo/bar.rb
<apeiros> Foo::BarBaz --> lib/foo/barbaz.rb
byronb has joined #ruby-lang
<shevy> hmm
anjen has joined #ruby-lang
gokulnath__ has joined #ruby-lang
<manveru> necromancer: are you use POP knows "read" status?
<manveru> *sure
<manveru> i think only IMAP can do that
<manveru> pop can delete the message on the server after retrieval, but that's about it
<deryldoucette> UUIDL
drbrain has joined #ruby-lang
<manveru> ?
<deryldoucette> manveru: UUIDL is wht POP uses for knowing if its seen or downloaded that email before
<manveru> the RFC only knows UIDL
<darix> deryldoucette: doesnt that require maintaining a local list?
<manveru> yeah, i thought that too
<deryldoucette> darix: the MUA usually does
<darix> deryldoucette: with imap the flag \\seen is stored server side to indicate the message is read.
<deryldoucette> so you'll probably have to build that in
<darix> deryldoucette: does the mail gem cache that?
solars has joined #ruby-lang
<deryldoucette> that i do not know
<darix> anyway imap >>> pop anyway.
<manveru> i doubt that very much
<manveru> hehe
<manveru> i know some people who only use POP3 to make sure nothing stays on the server
<deryldoucette> manveru: and you are correct it IS UIDL. Not sure why my fingers keep popping it out as UUIDL
<deryldoucette> well thats because they're not using the exgended capability then
<deryldoucette> the *default* for pop clients is to download and delete off the server. you have to specify to leave them on there. so its basically just them not setting the extended capabilities
<manveru> ?
rue has joined #ruby-lang
<manveru> i just meant that's one reason to prefer pop over imap
<deryldoucette> you said they used POP3 specifically because it leaves nothing on the server. thats only if you use a default configuration in your MUA, ect. pop3 defaults to deleting once you've captured the emails from the server
<deryldoucette> ah
<deryldoucette> nm, :)
<manveru> some people don't trust the cloud further than their wifi reaches
<deryldoucette> hehe
<darix> manveru: you trust wifi?
<manveru> lol
<manveru> no, i was eth only until this year
<whitequark> one can trust WPA2
<manveru> but the 3g router i use right now doesn't have an ethernet port
<deryldoucette> i don't trust anything once it leaves my system. and with my own wifi i do insane shit like changing the keys to the strongest supported by the router, rotating them every 5-15 minutes depending, stuff like that
<deryldoucette> wpa2 can be broken
<whitequark> deryldoucette: with bruteforce, yes
<deryldoucette> depends on how you are implementing. are you using radius? WPA2-PSK what?
<whitequark> any cipher can be broken with bruteforce.
<deryldoucette> whats your point? no it can't be broken as easily as WEP, but you can still crack (kismet comes with a lib for helping with that iirc) wpa2
<deryldoucette> how *easily* still comes down to how you've implemented it
<manveru> well, that's why we use encryption beyond WPA2, right?
<whitequark> deryldoucette: there are no known public exploits for WPA2 which allow you to crack it in less than bruteforce time
<whitequark> it's exactly same with TLS, for example (with all the known updates, of course)
gregf has joined #ruby-lang
<darix> whitequark: well the ssl key survey was kinda fun ... the number of duplicated keys is amazing :)
workmad3 has joined #ruby-lang
bagratte has joined #ruby-lang
<deryldoucette> and since bruteforce time depending on the dictionaries used is under 1 minute in most cases :) (faster for WEP) challenges done all over the interwebs
Sailias has joined #ruby-lang
adambeynon has joined #ruby-lang
bagratte has joined #ruby-lang
<whitequark> deryldoucette: _if_ your key is dictionary
<whitequark> the passphrase I currently use isn't something you could easily find with a dictionary, too
<workmad3> what's the conversation? :)
twittard has joined #ruby-lang
<deryldoucette> true, but you're making it sound more secure than it actually is. what about WPA2-PSK with TKIP and throwing a dictionary at it. which is a very common setup (especially for the highest backwards compatilbility) from ISPs and their clients.
<whitequark> pfft, default setups are more often stupid than not
<deryldoucette> i can't argue against that
<whitequark> that does not affect WPA2's security level by itself
andremaha has joined #ruby-lang
bagratte has joined #ruby-lang
<workmad3> is this just an argument about WPA2 security?
<deryldoucette> not really an argument. more a discussion with the occasional dig ;)
<workmad3> what's under discussion then? :)
publicvoid_ has joined #ruby-lang
<deryldoucette> ehh we just went on a tangent about wpa, wep, wpa2 ect.
<deryldoucette> was good while it lasted
<workmad3> heh :) and you are being careful to distinguish between brute-forcing the wpa2 network password and cracking the session keys used for the encryption, right?
bjensen has joined #ruby-lang
Fullmoon has joined #ruby-lang
<deryldoucette> yeah
tekin has joined #ruby-lang
* whitequark plans to transition to WPA2-EAP
<whitequark> just for the sake of it
<whitequark> my home network doesn't _really_ require certificates.
kain has joined #ruby-lang
andrewhl has joined #ruby-lang
<deryldoucette> whitequark: hehe i make my wifi do stuff it doesn't really require (unless I have a government goon squad sitting outside and I don't know it)
<workmad3> get a router that lets you turn the power of your signal down and get some repeaters if necessary, then adjust the power level so your network doesn't propagate past your external walls
<deryldoucette> but its definitely more secure than your average network
<hagabaka> anyone know how to read a 16 bit integer from a Qt::DataStream with qtruby?
<whitequark> workmad3: for what?
<workmad3> whitequark: for your home wifi :P
<whitequark> if I'd really want to snoop on someone, I'd get a good directional antenna
<whitequark> with like 18dB of amplification
<whitequark> your scheme will only work with a stupid hacker who has nothing but a wifi dongle with a standard omni antenna
<workmad3> whitequark: if someone really wanted to snoop, it's pretty hard to stop them
<workmad3> whitequark: but you may as well stop the idiot hackers who are just cruising for an open connection
<whitequark> workmad3: WPA2-PSK would easily stop them
<whitequark> if your passphrase is not dictionary
<whitequark> and mine isn't
<workmad3> :)
<whitequark> actually, it pretty much the same with snoopers. of course, if your wifi's firmware does not have a backdoor
musl has joined #ruby-lang
justinmcp has joined #ruby-lang
d3vic3 has joined #ruby-lang
<workmad3> whitequark: if they have professional equipment, they could just record the traffic with snooping and crack the session encryption offline later
<whitequark> workmad3: no need in professional equipment
<whitequark> I could do that as well with any Atheros or Ralink card
<whitequark> and a $linuxmachine
<workmad3> whitequark: heh :) you know more about this than I do
<deryldoucette> you can use kismet, that aircrack-ng or whatever the hell the name of it is
bagratte has joined #ruby-lang
<deryldoucette> can snoop using most any wifi card
<whitequark> well, not "most"
<whitequark> definitely not broadcom
<whitequark> but that's really a no-brainer
<deryldoucette> hehe
<whitequark> you'll have no luck cracking the session key
<whitequark> what is it, a 512-bit padded AES?
<whitequark> I don't quite remember, but that's going to be painful
<whitequark> if you'll capture a 4-way handshake for PSK, you can either run a dictionary loop or do bruteforce
<deryldoucette> i'd have to look it up but that sounds about right
d3vic3 has joined #ruby-lang
<whitequark> the former would only work if the user is stupid
<whitequark> the latter is painful if the user isn't
<deryldoucette> we're talking the world at large. most will fall into the first :)
Bwild has joined #ruby-lang
<deryldoucette> ok, sent my dog to the trainer's so i could work, and what am i doing? not working
<deryldoucette> whitequark: i blame you ;)
<whitequark> deryldoucette: 99% of internet-enabled (or should I say "disabled"?) users post their personal data on Facebook
bagratte has joined #ruby-lang
<whitequark> what else do you want?
<deryldoucette> hahahaha touche!
<deryldoucette> probably over half don't even know how TO go and change their default to tighten up a bit on FB what they display
<whitequark> even if they would know that, FB will release that to the public after half a year anyway. if you've signed their ToC, you're basically pwned
<deryldoucette> alas we live in an instant gratification world, and if they're gratified thats all they want. but remember its someone ELSE's fault if they get popped, ID stolen, some creature of the night knows their mommy's name.
<deryldoucette> think its 18 months but yea
<whitequark> doesn't matter
<deryldoucette> thats why they have such a huge damned IPO worth. they're sitting on a damned advertiser's gold mine
<deryldoucette> with monthly rollovers to boot!
<whitequark> advertisers _already_ have all the data they want
<whitequark> but no
<whitequark> these people will release the whole friend graph without asking anyone
<deryldoucette> yeah no shit :/
<whitequark> ... and then curious MIT people go and make a gaydar
<deryldoucette> hehe
<whitequark> if you live in this world at this moment, you're screwed
<deryldoucette> ok i truly am enjoying the conversation, but i'm screwing myself here by staying and chatting. i gotta get this article done.. and then roll onto the last one. (i love writing! why is this so damned hard for me? sheesh!)
<whitequark> can I take a look at your articles?
<deryldoucette> sure, they're not top of the line
<deryldoucette> see msg
<whitequark> thanks
<deryldoucette> np
<deryldoucette> the one i'm on now starts the longer ones because i have to cover the listener class we implement
<deryldoucette> using octopress for that. expect lots of small and fast rapid-fire changes to existing articles, and for new ones. constantly doing little corrections
<whitequark> sure
gregmoreno has joined #ruby-lang
<deryldoucette> it will look better once i find out why the hell its ignoring the custom changes but no real time for that right now. doesn't look tremendously horrid at the moment so..
erpuds has joined #ruby-lang
jfelchner has joined #ruby-lang
headius has joined #ruby-lang
AlHafoudh has joined #ruby-lang
Bwild has joined #ruby-lang
erpuds has joined #ruby-lang
erpuds has joined #ruby-lang
gokulnath has joined #ruby-lang
Stalkr_ has joined #ruby-lang
lsegal has joined #ruby-lang
Pcboy____ has joined #ruby-lang
curtism has joined #ruby-lang
curtism has joined #ruby-lang
leonL has joined #ruby-lang
zmack has joined #ruby-lang
bagratte has joined #ruby-lang
spuk has joined #ruby-lang
robbrit has quit [#ruby-lang]
bagratte has joined #ruby-lang
tyfighter has joined #ruby-lang
floyd2 has joined #ruby-lang
phikes has joined #ruby-lang
phikes has quit [#ruby-lang]
looopy has joined #ruby-lang
ilyam has joined #ruby-lang
srbartlett has joined #ruby-lang
jamw has joined #ruby-lang
Boohbah has joined #ruby-lang
<bjensen> any of you guys who use ruby 1.9.3p0 in production ?
<outoftime> bjensen: heh, no
naz has joined #ruby-lang
<bjensen> outoftime: heh?
<whitequark> bjensen: me
<bjensen> whitequark: any quarks?
<whitequark> have you found a segfault somewhere in GC, too?
<whitequark> hm
<whitequark> there's no such thing as a white quark, obviously
<outoftime> bjensen: maybe the "heh" was unjustified -- but just trying to get my app to start locally on 1.9.3 was a pretty fast fail
<bjensen> Oh I found some that are even present when using ruby 1.9.2
<whitequark> yes, there are some
<bjensen> outoftime: Mine is working out of the box (Rails 3.1.3)
<outoftime> bjensen: i think the main issue was native extensions in our dependencies
<whitequark> doubtful
<bjensen> outoftime: I had one with iconv, but rvm and stack overflow was to the rescue
<whitequark> outoftime: 1.9.3 still has 1.9.1 AI
<whitequark> *ABI version
<outoftime> it was ruby-debug19 actually that wouldn't build
<outoftime> so not an issue for production
<outoftime> so no "heh"
<shevy> what is the opposite of INDENT
<bitrot> OUTDENT
<whitequark> shevy: if we're talking about verbs (to indent), then it's "to unindent"
<shevy> I mean for programming languages and tokens on a stack
<erikh> It's called <<
<shevy> I wonder if you guys know what the python hipsters came up with for that here
<erikh> inverted dent
<shevy> hehehe
<workmad3> shevy: I'm not sure there is an opposite of 'indent'... I'd guess you'd track an indentation level and increment/decrement it personally
<shevy> "The indentation levels of consecutive lines are used to generate INDENT and DEDENT tokens, using a stack, as follows."
<erikh> DEDENT
<erikh> awesome
<workmad3> oh, bleh, python :P
<erikh> gg guido
<shevy> I am talking with Araq on #nimrod though, and he is calling it "[dedentation]" hehehe it's kinda funny what new words are emerging
<yorickpeterse> at least Python has a set of official standards
<shevy> yeah yorickpeterse
<shevy> the docu is quite nice
<bitrot> guess we should be going in the de door...
<erikh> in de door
<shevy> hehe
<workmad3> yorickpeterse: so does java... and C... and C++ :P
<shevy> good old C
<workmad3> shevy: are you meaning ANSI C? :)
<shevy> well yeah the dennis and ritchie C thing
<shevy> not the hipster clones
<workmad3> yeah, ANSI C is the one in K&R :)
<shevy> I feel most of the languages that came after C (I mean C++ java D go ...) just evolved from C as their real starting point
<workmad3> shevy: also, kudos on remembering the full name of just one author of that book ;)
<workmad3> shevy: C itself has roots in ALGOL
Fullmoon has joined #ruby-lang
<shevy> workmad3 haha hey my brain works only at 0.2% right now
<shevy> it's almost always in idle mode
<erikh> K&R C predates ANSI C
evenix has joined #ruby-lang
<erikh> the second edition+ of the book covers the standard
<workmad3> erikh: oh yeah, I forgot that :) I've only ever seen the 2nd ed
<erikh> the "else" in that email is a K&R prototype
<erikh> I had a co-worker who had a humongous hard-on for them
<yorickpeterse> "There is no need to overwrite the model, I just want to extend it. The cleanest thing to do is just monkey patch it." ...
artOfWar has joined #ruby-lang
erpuds has joined #ruby-lang
<apeiros> yorickpeterse: also contains a regex anchoring fail
<yorickpeterse> I'm personally a fan of how "clean" it is to abuse class_eval because somebody was too lazy to type and document a few methods
<bougyman> almost as offensive as using method_missing as a dispatcher.
m3nd3s has joined #ruby-lang
<shevy> hmm
<shevy> that code is beginning to not look like how I write code in ruby
<shevy> perhaps I have no feeling for true ruby code :(
<apeiros> wtf? require File.expand_path('../../app/models/invitable/invitation', Invitable::Engine.called_from)
* apeiros vomits
<yorickpeterse> DAT RUBY
<drbrain> apeiros: LOL
<yorickpeterse> I wonder why that's even in there
<apeiros> require+autoload collision
<apeiros> you can't map Foo::Bar to two autoloads
<yorickpeterse> What I meant is why they're not using __FILE__ instead of the .called_from shit
<apeiros> at least that's my educated guess
<apeiros> because __FILE__ won't help there.
<yorickpeterse> Because you should be loading things relative to the file, not relative to wherever the fuck you're calling it from
<yorickpeterse> Especially not if you're using relative paths as that might lead to non existing files being loaded
<apeiros> yorickpeterse: you have PROJECT/app/models/invitable/invitation.rb with that code in it - and the one of the engine is now relative to it where? it's an engine, meaning it's a gem…
<yorickpeterse> Assuming called_from would point to ~/ then ../../ would go to /, however if I now call this code from ~/foobar it breaks
<yorickpeterse> Hmm
<yorickpeterse> Unless called_from produces the path from a file and now $PWD
<yorickpeterse> * nit
<yorickpeterse> FFFFFF
<yorickpeterse> * not
<apeiros> "we access it with Invitable::Engine.called_from. This will point to the lib/invitable directory in the gem itself"
<apeiros> right there
<yorickpeterse> ah
<apeiros> so I'd say my guess was spot on
<yorickpeterse> I didn't really read the text, I just raged at the code
* apeiros stops wasting his time at that point
<yorickpeterse> :)
bosie has joined #ruby-lang
havenn has joined #ruby-lang
twittard has joined #ruby-lang
bryancp has joined #ruby-lang
flebel has joined #ruby-lang
RomyRomy has joined #ruby-lang
thrcka has joined #ruby-lang
bagratte has joined #ruby-lang
bagratte has joined #ruby-lang
bagratte has quit [#ruby-lang]
bagratte has joined #ruby-lang
bagratte has joined #ruby-lang
tjgillies has quit [#ruby-lang]
rue has joined #ruby-lang
drojas has joined #ruby-lang
<drojas> Hi.. anyone with experience in RGL
Carnage\ has joined #ruby-lang
cmatheson has joined #ruby-lang
musl has joined #ruby-lang
havenn has joined #ruby-lang
musl has joined #ruby-lang
<rue> Nope, what's that?
Spooner has joined #ruby-lang
bjensen has joined #ruby-lang
<drojas> Ruby Graph Library
<drojas> I need to implement a weighted graph using the Ruby Graph Library RGL and I'm having some problems..
srbartlett has joined #ruby-lang
H2H has joined #ruby-lang
<Swimming_Bird> is there a favorite gem for uploading stuff to s3 now adays?
srbartlett has joined #ruby-lang
srbartlett has joined #ruby-lang
<Swimming_Bird> aws-s3's never felt that nice to me
srbartle_ has joined #ruby-lang
gregmore_ has joined #ruby-lang
looopy has joined #ruby-lang
evenix_ has joined #ruby-lang
gregmoreno has joined #ruby-lang
mcantor has joined #ruby-lang
slimfit has joined #ruby-lang
seanstickle has joined #ruby-lang
cored has joined #ruby-lang
mcantor has quit [#ruby-lang]
flowerpot has joined #ruby-lang
jtoy has joined #ruby-lang
bjensen has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
MistyM has joined #ruby-lang
tomzx has joined #ruby-lang
twelvechairs has joined #ruby-lang
twelvechairs has joined #ruby-lang
shevy has joined #ruby-lang
WillMarshall has joined #ruby-lang
slyphon has joined #ruby-lang