<ukd1>
gbchaosmaster, cool - I meant ASCII to chars. I've just tried it and it's outputting unicode. It's probably a good idea, but is there way of getting ASCII?
pencilcheck has quit [Ping timeout: 264 seconds]
DaZ has quit [Ping timeout: 252 seconds]
danneu has joined #ruby
danneu has quit [Client Quit]
JaMesCZs has joined #ruby
Sonmi_001 has quit [Quit: Quitte]
<gbchaosmaster>
ukd1: Any particular reason for not wanting Unicode?
<havenn>
cjhanks: No, it isn't standard really. It is slightly on the verbose side but a good doc format.
tjbiddle has quit [Ping timeout: 240 seconds]
<internetishard>
I see that you can readline[regex] or readlines[0] - I want to do both. That is, I want to use a regex, but only read the first line - if I do it with just the regex, then I get EOF error
tjbiddle_ is now known as tjbiddle
<havenn>
cjhanks: I wouldn't say there is a single standard for documentation for Ruby.
<cjhanks>
Ahh, well as long as RubyDev's recognize it easily that's fine with me. It's my first time having to develop Ruby.
joeycarmello has quit [Remote host closed the connection]
<havenn>
cjhanks: I think depending on the complexity of the code and aesthetical style, documentation can vary from self-documenting-code to thorough tomdoc style.
DaZ has joined #ruby
davidcelis has quit [Quit: K-Lined.]
<internetishard>
csmrfx: so it turns out doing it your way, where I do readline[regex] causes the EOF error while readlines[0] doesn't
<csmrfx>
internetishard: I already presented a fix for that
<csmrfx>
and, calling that "my way" is giving me, oh about 1000x more credit than I deserve
jim80net has joined #ruby
<csmrfx>
internetishard: ignore pasties at your own peril...
<internetishard>
sorry for giving you too much credit :P
jim80net has quit [Client Quit]
DrShoggoth has quit [Quit: Leaving]
<csmrfx>
also
<csmrfx>
like I said
<internetishard>
Sorry, I've been killing and booting this VM all day
mrsolo has quit [Quit: Leaving]
davidcelis has joined #ruby
<csmrfx>
ri StringIO.readline may be painful, but may also be the only way out of ignorance
TitaniumStudioUs has quit [Quit: This computer has gone to sleep]
Jasko has joined #ruby
<reppard>
that works too, the reverse in block works as well
<reactormonk>
reppard, nah, that's just magic. you don't want to make your code look like magic if possible
yshh has joined #ruby
TitaniumStudioUs has joined #ruby
<reppard>
haha indeed i was about to add that index,x is more readable
<reactormonk>
>> array = [4,5,6]; p Hash[array.map.with_index];
<eval-in>
reactormonk: Output: "/tmp/execpad-f52802091c01/source-f52802091c01:1:in `[]': odd number of arguments for Hash (ArgumentError)\n\tfrom /tmp/execpad-f52802091c01/source-f52802091c01:1:in `<main>'\n" (http://eval.in/4454)
<reactormonk>
>> array = [4,5,6]; p Hash[*array.map.with_index];
<eval-in>
reactormonk: Output: "/tmp/execpad-d9f9219d80c4/source-d9f9219d80c4:1:in `[]': odd number of arguments for Hash (ArgumentError)\n\tfrom /tmp/execpad-d9f9219d80c4/source-d9f9219d80c4:1:in `<main>'\n" (http://eval.in/4455)
dotnull has quit [Remote host closed the connection]
hderms has quit [Changing host]
hderms has joined #ruby
gridaphobe has quit [Ping timeout: 265 seconds]
carlyle has quit [Remote host closed the connection]
apok has quit [Remote host closed the connection]
apok has joined #ruby
carlyle has joined #ruby
nari has joined #ruby
fred909_ has joined #ruby
jenrzzz has joined #ruby
`brendan has joined #ruby
squidBits has quit [Quit: squidBits]
fred909 has quit [Ping timeout: 255 seconds]
carlyle has quit [Remote host closed the connection]
nga4 has quit [Ping timeout: 248 seconds]
daniel_- has quit [Ping timeout: 240 seconds]
fred909_ has quit [Ping timeout: 250 seconds]
TitaniumStudioUs has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
generalissimo has joined #ruby
joeycarmello has quit [Remote host closed the connection]
nwertman has joined #ruby
johnmilton has quit [Quit: Leaving]
ttt has joined #ruby
Spaceghost|cloud has joined #ruby
shakesoda has left #ruby [#ruby]
TitaniumStudioUs has quit [Ping timeout: 276 seconds]
daniel_hinojosa has joined #ruby
cj3kim has joined #ruby
ttt has quit [Ping timeout: 276 seconds]
acrocity has quit [Ping timeout: 260 seconds]
zeen has joined #ruby
brax4444 has joined #ruby
acrocity has joined #ruby
Alaude has quit [Quit: Leaving]
ttt has joined #ruby
xrl has joined #ruby
nwertman has quit [Ping timeout: 264 seconds]
TitaniumStudioUs has joined #ruby
davidcelis has joined #ruby
acrocity has quit [Ping timeout: 240 seconds]
gridaphobe has joined #ruby
glyytchy has quit [Quit: glyytchy]
acrocity has joined #ruby
TitaniumStudioUs has quit [Ping timeout: 255 seconds]
cpruitt has quit [Remote host closed the connection]
alexim has quit [Quit: sleep]
krz has joined #ruby
xnm has quit [Read error: Connection reset by peer]
jonahR has quit [Quit: jonahR]
cakehero has joined #ruby
squidBits has joined #ruby
jenrzzz has joined #ruby
AltGrendel has joined #ruby
zarubin has joined #ruby
nat2610 has quit [Quit: Leaving.]
yaymukund has joined #ruby
bradhe has joined #ruby
bigkm has joined #ruby
hsbt has quit [Read error: Connection reset by peer]
hsbt has joined #ruby
bigmac has quit [Ping timeout: 264 seconds]
kenneth has joined #ruby
TitaniumStudioUs has joined #ruby
ttt has quit [Remote host closed the connection]
punkrawkR has quit [Read error: Connection reset by peer]
ttt has joined #ruby
Norrin has quit [Ping timeout: 240 seconds]
wmoxam has joined #ruby
shiin has quit [Quit: Computer has gone to sleep.]
bradhe has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 252 seconds]
<kenneth>
hey guys, question about modules
<kenneth>
say i want to have some extensions to base classes (monkey-patching) but let the user selectively activate them
<kenneth>
no way to do that without ruby 2.0, right?
TitaniumStudioUs has quit [Ping timeout: 240 seconds]
chaosis has joined #ruby
<kenneth>
would it be better to just monkey patch the classes i want (Hash and Object) with non-ambiguous names, or provide a model function that takes the object as first argument
<kenneth>
a quick example, say i wanted to implement something like map on array, would it be better to have
<kenneth>
module Stuff; def map(hash, &fn); …; end; end
banjara has quit [Quit: Leaving.]
bradhe has joined #ruby
rakm has quit [Quit: sleeping]
<kenneth>
or should i just monkey patch Array (if it didn't already have map)
alvaro_o has quit [Quit: Ex-Chat]
brianpWins has joined #ruby
<waxjar>
if you're going to alter behaviour, definitely don't start monkey patching pls :P
<waxjar>
if you're going to add some methods, i don't see why that would be a problem
acrocity has quit [Ping timeout: 250 seconds]
<kenneth>
waxjar: adding methods :)
DanBoy_ has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<waxjar>
you should keep in mind that it might clash with other libraries bolting on methods with the same name
DanBoy has quit [Ping timeout: 265 seconds]
brianpWins has quit [Client Quit]
c0rn has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
acrocity has joined #ruby
fred909 has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
nga4 has joined #ruby
Norrin has joined #ruby
bigmac has joined #ruby
epwhorl has joined #ruby
noric has joined #ruby
brax4444 has quit [Ping timeout: 255 seconds]
TitaniumStudioUs has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
mneorr has quit [Remote host closed the connection]
<noric>
A module Server has a hundred static utility functions. Each function is available as Server::func1, Server::func2. To keep the code clean, the hundred functions are defined in separate files. What's the right way to do this?
<noric>
(sorry if I pasted that twice)
lolcathost has quit [Ping timeout: 244 seconds]
jjbohn has joined #ruby
<waxjar>
module; def method; …; end; end in each file (make sure to require them all)
<waxjar>
i doubt that will make it any cleaner though, i'd rather scroll than constantly open and close files.
ejholmes has quit [Quit: ejholmes]
love_color_text has joined #ruby
DanBoy_ is now known as DanBoy
<noric>
I don't like re-opening the module in separate files. What would the files be named?
voodoofish430 has quit [Quit: Leaving.]
TitaniumStudioUs has quit [Ping timeout: 260 seconds]
<noric>
Can I declare a group of functions in a separate module, and mix it into Server?
<waxjar>
sure
<noric>
So, server.rb mixes in server/blue_functions.rb, and Server::BlueFunctions includes twenty blue functions
agarie has joined #ruby
<noric>
how to do that? So that BlueFunctions::foo is available as Server::foo
<noric>
I don't think extend or include was intended to be used that way
theRoUS has joined #ruby
Hanmac1 has joined #ruby
binaryplease has joined #ruby
segv-_ has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
carlyle has joined #ruby
love_color_text has quit [Ping timeout: 244 seconds]
Hanmac has quit [Ping timeout: 250 seconds]
<waxjar>
why not? Server.extend Server::BlueMethods (ruby has no functions :)) works perfectly well :)
segv- has quit [Ping timeout: 260 seconds]
segv-_ is now known as segv-
TitaniumStudioUs has joined #ruby
<noric>
waxjar: Ah thanks, I need to review extend/include semantics :)
epwhorl has quit [Ping timeout: 260 seconds]
cj3kim has joined #ruby
carlyle has quit [Ping timeout: 245 seconds]
Gooder has joined #ruby
jackdanger has joined #ruby
TitaniumStudioUs has quit [Ping timeout: 250 seconds]
adeponte has quit [Remote host closed the connection]
jackdanger1 has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
AltGrendel has left #ruby [#ruby]
niklasb has joined #ruby
NiteRain has quit [Ping timeout: 246 seconds]
jackdanger has quit [Ping timeout: 252 seconds]
ratcheer has left #ruby [#ruby]
dukedave has joined #ruby
Goles has joined #ruby
seanstickle has joined #ruby
mjolk has joined #ruby
squidBits has quit [Quit: squidBits]
joeycarmello has joined #ruby
cableray has quit [Quit: cableray]
TitaniumStudioUs has joined #ruby
brax4444 has joined #ruby
cyong has joined #ruby
epwhorl has joined #ruby
Ruler_Of_Heaven_ has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
pipopopo has quit [Ping timeout: 240 seconds]
joeycarmello has quit [Ping timeout: 256 seconds]
jackdanger1 has quit [Quit: Leaving.]
TitaniumStudioUs has quit [Ping timeout: 264 seconds]
Slivka has joined #ruby
xpen has joined #ruby
quest88 has joined #ruby
jjbohn has quit [Quit: Leaving...]
jjbohn has joined #ruby
atal421 has joined #ruby
cdt has joined #ruby
`brendan has quit [Ping timeout: 244 seconds]
rondale_sc has quit [Quit: rondale_sc]
Goles has quit [Ping timeout: 240 seconds]
jjbohn has quit [Quit: Leaving...]
Goles has joined #ruby
daniel_hinojosa has quit [Ping timeout: 240 seconds]
reppard_ has quit [Ping timeout: 244 seconds]
reppard has quit [Ping timeout: 244 seconds]
adeponte has joined #ruby
maletor has joined #ruby
love_color_text has joined #ruby
glyytchy has joined #ruby
glyytchy has quit [Client Quit]
cdt has quit [Ping timeout: 276 seconds]
daniel_hinojosa has joined #ruby
pu22l3r_ has quit [Remote host closed the connection]
marknyc has joined #ruby
TitaniumStudioUs has joined #ruby
tungd has joined #ruby
binaryplease has quit [Quit: WeeChat 0.3.9.2]
TitaniumStudioUs has quit [Client Quit]
tungd has quit [Client Quit]
joshman_ has quit [Quit: Computer has gone to sleep.]
pu22l3r has joined #ruby
mascool has quit [Ping timeout: 252 seconds]
tungd has joined #ruby
agarie has quit [Remote host closed the connection]
seanstickle has quit [Quit: seanstickle]
cj3kim has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
nat2610 has joined #ruby
apok_ has joined #ruby
apok_ has quit [Client Quit]
lol_ has joined #ruby
apok_ has joined #ruby
apok has quit [Ping timeout: 252 seconds]
apok_ is now known as apok
ner0x has quit [Quit: Leaving]
c0rn has joined #ruby
kenneth has quit [Quit: kenneth]
atal421 has quit [Quit: atal421]
mercwithamouth has quit [Quit: leaving]
ckrailo has joined #ruby
mercwithamouth has joined #ruby
ananthakumaran has joined #ruby
apok has quit [Quit: apok]
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
digitalcakestudi has quit [Quit: Leaving.]
fred909 has quit [Ping timeout: 265 seconds]
quest88 has quit [Quit: quest88]
squidBits has joined #ruby
vasile has quit [Ping timeout: 264 seconds]
bradhe has quit [Remote host closed the connection]
Mon_Ouie has quit [Read error: Connection reset by peer]
Mon_Ouie has joined #ruby
lol_ has quit []
taoru has joined #ruby
jobicoppola has joined #ruby
havenn has joined #ruby
rohit has joined #ruby
kenneth has joined #ruby
niklasb has quit [Read error: Operation timed out]
kil0byte has quit [Remote host closed the connection]
Z_Mass has joined #ruby
kil0byte has joined #ruby
malkomalko has joined #ruby
banisterfiend has quit [Ping timeout: 264 seconds]
banisterfiend has joined #ruby
rinfon has joined #ruby
squidBits has quit [Quit: squidBits]
generalissimo has quit [Remote host closed the connection]
kil0byte has quit [Ping timeout: 255 seconds]
jackdanger has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
iamjarvo has joined #ruby
brax4444 has quit [Quit: brax4444]
squidBits has joined #ruby
cj3kim has joined #ruby
x82_nicole has joined #ruby
jobicoppola has quit [Ping timeout: 252 seconds]
adamramadhan has joined #ruby
luckyruby has quit [Remote host closed the connection]
CamonZ_afk has joined #ruby
gridaphobe has quit [Ping timeout: 244 seconds]
CamonZ has quit [Read error: Connection reset by peer]
nga4 has quit [Read error: Connection reset by peer]
paolooo has joined #ruby
Tref has joined #ruby
atal421 has joined #ruby
rellin has joined #ruby
jackdanger has quit [Quit: Leaving.]
tungd has quit [Quit: leaving]
adamramadhan has quit [Ping timeout: 255 seconds]
banisterfiend has quit [Ping timeout: 276 seconds]
philcrissman has quit [Remote host closed the connection]
love_col_ has joined #ruby
banisterfiend has joined #ruby
cableray has joined #ruby
otherj has joined #ruby
thinkclay has joined #ruby
love_col_ has quit [Ping timeout: 265 seconds]
bradhe has joined #ruby
Takehiro has joined #ruby
<otherj>
is there an easy way to compare an object parameter against a hash and if it matches use the hashe's value to, say, set the value of a different object?
<epwhorl>
that sounds deceivingly simple
<otherj>
it's what is probably a bad solution to another problem i have
<otherj>
but i think it might work if i can figure out how. haven't really used hashes in ruby though
phipes has quit [Quit: phipes]
<waxjar>
by object parameter do you mean instance variables (@variable)?
<otherj>
yep
bradhe has quit [Ping timeout: 264 seconds]
<otherj>
sorry, sometimes it's hard to remember the correct terms for this
<waxjar>
do you mean something like this then: x = 'whatever' if hash.has_key? @variable ?
paolooo has quit [Quit: Page closed]
<otherj>
hm. maybe. i'll have to test it
<otherj>
oh, ok. that works only if hash only has one value, right?
<waxjar>
a Hash has key-value pairs: { 'key' => 'value', 'another_key' => 'value' }
<epwhorl>
nope, that searches the entire hash for that key
<otherj>
basically i need to have an array with key/value where i have a string and some integer, and when i'm writing a value i need to compare against that array and write the integer value to an order column
<otherj>
and the string can be one of like 6 choices
<waxjar>
an Array is just a list of objects: [1,2,3,4,5]
daniel_hinojosa has quit [Ping timeout: 264 seconds]
<otherj>
yeah, so that's the wrong term
<otherj>
hash is what i really mean right?
<epwhorl>
yes
<epwhorl>
key/value pairs
cdt has joined #ruby
cjhanks has quit [Quit: Leaving]
<otherj>
let me try to make some code to better explain what i mean
<otherj>
a moment please
ejholmes has joined #ruby
<epwhorl>
use pastebin or gist
<otherj>
yep
<otherj>
just making sure this actully does what i think in irb
love_color_text has quit [Ping timeout: 265 seconds]
xpen_ has quit [Read error: Connection timed out]
xbayrockx has joined #ruby
jhchabran has quit [Read error: Operation timed out]
xbayrockx is now known as wf2f
matrixise has quit [Ping timeout: 248 seconds]
xpen has joined #ruby
rohit has joined #ruby
spacebug1 has joined #ruby
Takehiro has quit [Remote host closed the connection]
cantonic_ has joined #ruby
mikekelly has quit [Ping timeout: 265 seconds]
jhchabran has joined #ruby
spacebug has quit [Ping timeout: 265 seconds]
bradhe has joined #ruby
JohnBat26 has joined #ruby
x82_nicole has quit [Ping timeout: 240 seconds]
Hanmac has joined #ruby
mikekelly has joined #ruby
browndawg1 has quit [Quit: Leaving.]
ananthakumaran has quit [Ping timeout: 252 seconds]
cantonic has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
wf2f has quit [Ping timeout: 256 seconds]
<squidBits>
Does anyone have a project that's kind of in the beginning phase that they want help with / do pair programming type stuff on?
<squidBits>
I'm kinda newish to ruby and want to expand.
LouisGB has joined #ruby
xAndy is now known as xandy
cyong has quit [Quit: Leaving.]
x82_nicole has joined #ruby
wedtm is now known as wedtm|away
x82_nicole has quit [Read error: Connection reset by peer]
otherj has quit [Quit: otherj]
slash_nick is now known as slash_nick_away
miso1337 has quit [Quit: afk]
burgestrand has joined #ruby
LouisGB has quit [Ping timeout: 248 seconds]
havenn has quit [Remote host closed the connection]
io_syl has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
x82_nicole has joined #ruby
xpen has quit [Read error: Connection timed out]
Takehiro has joined #ruby
xpen has joined #ruby
slash_nick_away has quit [Ping timeout: 265 seconds]
love_color_text has joined #ruby
kil0byte has joined #ruby
havenn has quit [Ping timeout: 255 seconds]
chendo_ has quit [Quit: Leaving...]
malkomalko has joined #ruby
Tref has quit [Quit: Tref]
tagrudev has joined #ruby
<Hanmac>
squidBits what do you mean with "Pair Programming" ?
kil0byte_ has quit [Ping timeout: 244 seconds]
DIAPERCOP has quit [Quit: POOP]
<squidBits>
Hanmac: a small 2 person project.
<squidBits>
Kinda.
pcarrier has quit []
wedtm|away is now known as wedtm
<squidBits>
It's basically working on the same code at the same time.
<squidBits>
Using screen sharing, or some sort of sharing.
postmodern has quit [Ping timeout: 250 seconds]
<Hanmac>
i have some projects i do allone ... but they are not small ...
<squidBits>
I guess it doesn't have to be small, but maybe something that you could explain to someone who doesn't fully grasp the bigger concepts of ruby.
kil0byte_ has joined #ruby
<squidBits>
I learn quickly :)
jackdanger has quit [Quit: Leaving.]
<BoomCow>
you should build a site
<BoomCow>
that will allow students to do this
<Hanmac>
... the suff i wrote for ruby is not in ruby ... it is in C++ :P (and because of the time it is still undocumented)
<BoomCow>
what are you looking to write squidBits
<squidBits>
Well, we could write a rails app to do live pair programming.
x82_nicole has quit [Read error: Connection reset by peer]
BoomCow has quit [Quit: This computer has gone to sleep]
hotovson has joined #ruby
rohit has joined #ruby
samuel02 has joined #ruby
samuel02 has quit [Read error: Connection reset by peer]
mafolz has joined #ruby
samuel02 has joined #ruby
quest88 has quit [Quit: quest88]
answer_42 has joined #ruby
Monie has quit [Ping timeout: 255 seconds]
tonini has joined #ruby
akemrir has quit [Quit: WeeChat 0.3.8]
x82_nicole has joined #ruby
Goles has quit [Ping timeout: 252 seconds]
postmodern has joined #ruby
vlad_starkov has joined #ruby
daniel_hinojosa has quit [Quit: Leaving.]
havenn has joined #ruby
BoomCow has joined #ruby
Goles has joined #ruby
squidBits has quit [Ping timeout: 255 seconds]
charliesome has joined #ruby
witty_fool has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
cableray has quit [Quit: cableray]
<Hanmac>
squidbits i could show you one of my projects that is an binding for an 3d-engine but the current code may confuse you :P
mjbamford has joined #ruby
x82_nicole has quit [Ping timeout: 276 seconds]
djdb has joined #ruby
vlad_starkov has joined #ruby
Monie has joined #ruby
x82_nicole has joined #ruby
BigO has joined #ruby
gmci_ has quit [Quit: Computer has gone to sleep.]
BigO has quit [Remote host closed the connection]
cableray has joined #ruby
darthdeus has joined #ruby
witty_fool has quit [Read error: Connection reset by peer]
havenn has quit [Ping timeout: 240 seconds]
kil0byte has joined #ruby
darthdeus has quit [Ping timeout: 248 seconds]
malkomalko has joined #ruby
Phoop has joined #ruby
ChampS666 has joined #ruby
<bricker>
Hello, trying to setup a simple script to fetch some stuff from an API (for testing), but the problem is that it's writing all of the formats from the entire loop into every file: https://gist.github.com/4265750 Do I need to "flush" somewhere, or something?
ChampS_ has joined #ruby
BoomCow has left #ruby ["Leaving"]
rohit has quit [Ping timeout: 240 seconds]
kil0byte_ has quit [Ping timeout: 265 seconds]
ChampS666 has quit [Ping timeout: 244 seconds]
<Hanmac>
bricker why do you use curl and not some of other ruby stuff like Net::HTTP ?
wf2f has quit []
epwhorl has quit [Ping timeout: 252 seconds]
<bricker>
Hanmac: I certainly could, I am mostly just curious about this now :)
dmiller has quit [Remote host closed the connection]
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
a_a_g has joined #ruby
wedtm is now known as wedtm|away
wedtm|away is now known as wedtm
squidBits has joined #ruby
malkomalko has quit [Ping timeout: 255 seconds]
tommyvyo has quit [Quit: Computer has gone to sleep.]
nemesit has joined #ruby
undersc0re97 has quit [Quit: Live from Pyongyang DPRK this is...]
rohit has joined #ruby
lurch_ has left #ruby [#ruby]
paolooo has joined #ruby
cheez0r has quit [Ping timeout: 255 seconds]
undersc0re97 has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
BoomCow has joined #ruby
cezar has joined #ruby
BoomCow has quit [Client Quit]
danneu has joined #ruby
mneorr has quit [Remote host closed the connection]
io_syl has joined #ruby
gridaphobe has quit [Ping timeout: 264 seconds]
dukedave has quit [Quit: Leaving.]
mneorr has joined #ruby
cheez0r has joined #ruby
mahmoudimus has joined #ruby
havenn has joined #ruby
schaerli has joined #ruby
reset has quit [Quit: Leaving...]
ckrailo has quit [Quit: Computer has gone to sleep.]
Tref has joined #ruby
luckyruby has joined #ruby
rohit has quit [Quit: Leaving]
L1_ has joined #ruby
rakl has joined #ruby
marknyc has quit []
altious has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
havenn has quit [Ping timeout: 244 seconds]
L1 has quit [Ping timeout: 264 seconds]
maesbn has joined #ruby
workmad3 has joined #ruby
zigomir has joined #ruby
matrixise has joined #ruby
mafolz has quit [Read error: No route to host]
headius has joined #ruby
malkomalko has joined #ruby
gregorg_taf has quit [Changing host]
gregorg_taf has joined #ruby
gregorg_taf is now known as gregorg
ChampS_ has quit [Ping timeout: 255 seconds]
mafolz has joined #ruby
yacks has joined #ruby
atal421 has quit [Quit: atal421]
DatumDrop has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
eldariof has joined #ruby
cheez0r has quit [Ping timeout: 255 seconds]
cheez0r has joined #ruby
Morkel has joined #ruby
elsifaka has joined #ruby
malkomalko has quit [Ping timeout: 252 seconds]
mneorr has quit [Remote host closed the connection]
nomenkun has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
timonv has joined #ruby
rakunHo has joined #ruby
ephemerian has joined #ruby
crocket has left #ruby ["Leaving"]
paolooo has quit [Ping timeout: 245 seconds]
schaerli has quit [Remote host closed the connection]
reset has joined #ruby
nomenkun has quit [Ping timeout: 260 seconds]
vlad_starkov has quit [Remote host closed the connection]
Tref has quit [Quit: Tref]
ipalaus_ has quit [Changing host]
ipalaus_ has joined #ruby
rezzack has quit [Quit: Leaving.]
ipalaus_ is now known as ipalaus
robotmay has joined #ruby
postmodern has joined #ruby
timonv has quit [Remote host closed the connection]
<JDubs>
For instance: someothermethod.(whatever) == outputofsomeothermethod squared
<dEPy>
What's that: module Something, then class << self
slainer68 has joined #ruby
<JDubs>
dEPy it just sends the codeblock up to the class level I think, minus the config part
<JDubs>
dEPy: but I could be wrong, I'm a newb
<JDubs>
xD
<JDubs>
Still learning blocks/procs/lambdas myself
kil0byte has quit [Ping timeout: 256 seconds]
s1n4 has joined #ruby
igro has joined #ruby
Zai00 has joined #ruby
igro has quit [Read error: Connection reset by peer]
cascalheira has quit [Quit: Leaving...]
ananthakumaran has quit [Ping timeout: 244 seconds]
kil0byte has joined #ruby
<lupine>
JDubs, number**2
cdt has quit [Ping timeout: 276 seconds]
ananthakumaran has joined #ruby
tobinharris has joined #ruby
grzywacz has quit [Ping timeout: 276 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
igro has joined #ruby
timmow has joined #ruby
kil0byte_ has quit [Ping timeout: 248 seconds]
qb has quit [Read error: Connection reset by peer]
brendan` has quit [Read error: Connection reset by peer]
brendan` has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
Sigma00 has quit [Ping timeout: 245 seconds]
yacks has quit [Ping timeout: 259 seconds]
vlad_starkov has joined #ruby
<Hanmac>
depy: class << self opens the singleton class of self (in this case the singleton class of the module PayRoll) eveything defined in class << self is aplyed to the classObject itself, not to the instances (you could call the methods static)
ddd1 has joined #ruby
mahmoudimus has joined #ruby
ddd has quit [Ping timeout: 245 seconds]
djdb has quit [Read error: Connection reset by peer]
Sigma00 has joined #ruby
nari has quit [Ping timeout: 260 seconds]
Guest18281 has quit [Remote host closed the connection]
headius has quit [Quit: headius]
ejnahc has quit [Ping timeout: 240 seconds]
ejnahc has joined #ruby
malkomalko has joined #ruby
Averna has joined #ruby
<JDubs>
lupine thanks!, does that work inline?
tps_ has quit [Quit: tps_]
<Hanmac>
what do you mean with "inline"?
Gooder has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
wallerdev has quit [Quit: wallerdev]
<JDubs>
like .**2.blahblah.blahblah
Skelz0r has quit [Ping timeout: 244 seconds]
Skelz0r has joined #ruby
<DefV>
JDubs: (stuff ** 2).foo.bar would work
<apeiros_>
or stuff.**(2).foo.bar - I prefer the former, though
timonv has joined #ruby
<apeiros_>
stuff**2.foo.bar "works" too, but it's interpreted as: stuff**(2.foo.bar)
igro has quit [Quit: Computer has gone to sleep.]
Xeago has joined #ruby
L1_ has quit [Quit: Quitter]
<JDubs>
apeiros: thanks! :)
<JDubs>
Apeiros_ think you can help me figure out how to make some code more efficient? I wrote a solution to a eueler problem, but it took my computer over a minute to find the answer!
<JDubs>
I want to learn how to write more efficient code
malkomalko has quit [Ping timeout: 248 seconds]
<apeiros_>
I can take a look
gyre007 has joined #ruby
<Xeago>
I HATE MY COLLLEAGUES
<JDubs>
Thanks :)
<JDubs>
xeago: it's ok we love you <3
<Xeago>
binding.pry in prodction
banjara has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<apeiros_>
I think 1.9.3's Prime lib has become faster too, no?
jellow has quit [Ping timeout: 256 seconds]
<Hanmac>
Xeago i dont know if n % 2 != 0 && (n + (n.even? ? 1 : 0)).step(3,-2).any? {|i| n % i != 0 } may be better (it does from the other direction ... )
<apeiros_>
yeah, by `ls Prime` it seems like it uses eratosthenes sieve too
<apeiros_>
it contains the constants EratosthenesGenerator and EratosthenesSieve
<JDubs>
what is eratosthenes? you guys are speaking crazy lol
<apeiros_>
JDubs: a greek guy
<Xeago>
it is an ancient greek from BC
<Xeago>
use the lmddgtfy.net link
<apeiros_>
he came up with an algorithm to find prime numbers
<Xeago>
and than go to wiki
<Xeago>
Hanmac (n.even? ? 1 : 0) will always be 0
thone has joined #ruby
<Hanmac>
huch you are right ...
<Xeago>
as any number with modulus of 2 not 0 will not be even :)
<Xeago>
what you could do is, incremental step
tvw has joined #ruby
<Xeago>
but that has quirks <11
<apeiros_>
JDubs: 0.15s on my computer: (1..10000).count { |n| Prime.prime?(n) }
* Xeago
thank god for crypto course for letting me be smart here :P
<Xeago>
apeiros_: is Prime in ruby or in C?
<apeiros_>
no idea. but don't use that code pre 1.9.3
wedtm is now known as wedtm|away
heftig has joined #ruby
<Xeago>
JDubs: you looked at the gif at wikipedia?
daniel_- has joined #ruby
<JDubs>
apeiros_ what is the Prime constant from?
<Xeago>
from ruby core iirc
<apeiros_>
require 'prime'
<apeiros_>
stdlib, not core
<Xeago>
standard :O
<Xeago>
surprising
<JDubs>
xeago: no i havent done any of that yet I'm still looking up methods
<Xeago>
look up the sieve first
<JDubs>
what's the difference between stdlib and core?
<apeiros_>
core is there without require
<JDubs>
oic
<apeiros_>
stdlib *should* be there with require on any installed ruby
<Xeago>
damnit apeiros_ you type faster, hands are still frozen from commute :\
<apeiros_>
(should, because some distros are obtuse)
<apeiros_>
JDubs: re your loop - you only have to test divisors up to Math.sqrt(self)
tvw has quit [Ping timeout: 240 seconds]
<witchdoc>
hi all
<Xeago>
apeiros_: sqrt is not optimal, logarythmic takes longer than the loop tho..
<JDubs>
witchdoc: o/
<apeiros_>
Xeago: in ruby, the cost of sqrt is insignificant compared with the loop
<apeiros_>
if we were talking C…
<Xeago>
in all languages
bradhe has quit [Remote host closed the connection]
<Xeago>
sqrt > log
wikiziner has joined #ruby
<Xeago>
except algebra
<Xeago>
:)
mengu has joined #ruby
<apeiros_>
logarithmic btw.
<JDubs>
what do I load to ge tthe sqrt function?
<Xeago>
think it is in math
<Xeago>
but implement it yourself ;
<JDubs>
:/
<JDubs>
lol
<JDubs>
I wouldn't know how to write a sqrt program :/
<JonnieCache>
use jon carmack's super l33t square root algorithm
<workmad3>
Xeago: so (self & 1 != 0) is your preferred reading?
<Hanmac>
okay it is a little bit faster ... but i am curios because it looks faster then the Prime stuff?
<Xeago>
not for ruby, but for performance critical code yes
<workmad3>
Xeago: I can see why you'd like it on a performance angle but not on readability
brjannc has joined #ruby
zommi has joined #ruby
<Xeago>
to me (self & 1 != 0) && \n\tetc reads the same
<workmad3>
Xeago: and I wouldn't want to push that until I've profiled and verified that the even/odd check is actually bottlenecking
<Xeago>
it isn't ;p
<workmad3>
Xeago: if it's not a bottleneck, it's not a performance problem
<apeiros_>
Hanmac: yes, that got me interested too. I'm checking right now whether Prime has other ways of using it.
<apeiros_>
Hanmac: hm, that's bad… Prime.prime? really should be faster than some handwritten (in less than 5min!) ruby code…
arkiver has joined #ruby
<workmad3>
Xeago: also, the super-naive timer of 'time ruby -e "1000000.times { 3.odd?}" ' vs 'time ruby -e "1000000.times { 3 & 1 != 0}"' consistently shows that using 'odd?' is faster on my machine
cdt has quit [Quit: Ex-Chat]
cdt has joined #ruby
<apeiros_>
workmad3: 2 method calls vs 1
karakedi has joined #ruby
<workmad3>
apeiros_: :)
<apeiros_>
also, .odd? is implemented as `num & 2` in C
<Xeago>
& 2 :O
<Xeago>
try even? instead
<Xeago>
and 3 & 1 == 0
<apeiros_>
same, but reversed return values
Shamgar has quit [Ping timeout: 264 seconds]
<workmad3>
Xeago: slightly smaller gap, but still slower than .even?
<Xeago>
I attribute that to c code ;)
<workmad3>
Xeago: and again, in ruby terms because 3 & 1 == 0 is 2 method calls, .even? is 1
<workmad3>
and, thinking about it, 3 & 1 != 0 is 3 method calls, not 2
<Xeago>
are ruby method calls that slow?
Shamgar has joined #ruby
<apeiros_>
Xeago: yes
<Xeago>
never knew..
<apeiros_>
much slower than any basic algorithmic function in C anyway
<workmad3>
Xeago: it's about 1 hundreth of a second over 1000000 iterations
<apeiros_>
algebraic?
<apeiros_>
when you optimize ruby code, after you've optimized the algorithm itself, the next step is reducing method calls.
<apeiros_>
also, things like extend kill the lookup caches (globally!)
<workmad3>
Xeago: so it's hardly 'slow', but it's certainly 'slower' and definitely not 'free'
<Hanmac>
apreiros_ i noticd that we both forgot the "2"
<workmad3>
Xeago: but also not something to worry about in the majority of circumstances :)
* apeiros_
hands Hanmac a tab key, behold its powers of nick-completion ;-p
pcarrier has joined #ruby
burgestrand has joined #ruby
<apeiros_>
Hanmac: what do you mean, forgot the 2?
<Hanmac>
i dont trust the tab key in irc ... when it could happen that i annow the wrong user ...
<Xeago>
is it Low and behold or Lo and behold?
<Paradox>
anything i should watch out for or sanitize out of the public repo of a rails site?
<Hanmac>
the prime*? methods in the pastie shows all false for 2
<apeiros_>
love and hold!
ipalaus has joined #ruby
<workmad3>
Xeago: lo
<workmad3>
Xeago: although I'd be highly dubious of any use of the phrase outside of a religious text
<apeiros_>
Hanmac: ah, yes
ipalaus has left #ruby [#ruby]
<Xeago>
workmad3: my crypto prof often uses it
<lupine>
I have seen it used correctly in secular texts
<Xeago>
'and lo and behold, you will find both values are equal'
vlad_starkov has quit [Read error: Connection reset by peer]
Shamgar has quit [Ping timeout: 264 seconds]
<Xeago>
or 'lo and behold, the adversary completely breaks the ...'
<workmad3>
lupine: oh, it can be used in secular texts, but it still carries over more religious baggage than necessary, IMO
vlad_starkov has joined #ruby
<lupine>
such is life
Shamgar has joined #ruby
<workmad3>
Xeago: your crypto prof sounds like he's being overly dramatic about these things :P
x0F has quit [Read error: Connection reset by peer]
kil0byte_ has joined #ruby
reset has quit [Quit: Leaving...]
<apeiros_>
Hanmac: added `return true if self < 4`, doesn't change much about the numbers.
<Xeago>
he always says: It is obvious that completely-not-obvious-and-arcane-thing ...
<Xeago>
when asking for it on online forums
<Xeago>
he types out a multipage forum reply
x0F has joined #ruby
<Xeago>
also JDubs you do use git right?
<workmad3>
Xeago: I bet it is obvious... if you have an in-depth background in cryptography and have understood the initial axioms and followed the proofs
<Xeago>
I asked the guys in ##crypto, they said it was non obviously obvious
hemanth_ has quit [Quit: Leaving]
kil0byte has quit [Ping timeout: 276 seconds]
burgestrand1 has joined #ruby
<JDubs>
Xeago: yeah
wikiziner has quit [Remote host closed the connection]
<Xeago>
why not source control your pasties
<JDubs>
Ok guys, I think I came up with a pretty efficient solution to eueler 8, tell me what you think: http://pastie.org/5515396
<apeiros_>
JDubs: iirc for euler, I had a cache of the first 1e6 primes :)
<JDubs>
Xeago: what do you mean?
karakedi has quit [Ping timeout: 240 seconds]
<Xeago>
for example gist.github.com
dr_bob has quit [Ping timeout: 240 seconds]
<Xeago>
line 7 is redundant
<JDubs>
I've never used gist, why is it better than pastie?
burgestrand has quit [Ping timeout: 240 seconds]
dr_bob has joined #ruby
<lupine>
versioning
<JDubs>
lupine: i see
<Xeago>
I'd use gist because I can sourcecontrol and update the gist without using my browse
adeponte has quit [Remote host closed the connection]
<JDubs>
xeago: anything else?
<JDubs>
xeago: for my code i mean
<apeiros_>
JDubs: I think that one I brute forced with each_cons and .inject(:*) (back then with a block…)
<JDubs>
is there a better way than an until loop?
<Xeago>
what is it supposed to do
Shamgar has quit [Ping timeout: 244 seconds]
InFlames has joined #ruby
<Xeago>
and explain line 2 please
<Xeago>
it gets absolutely decimated with negative numbers btw :P
<Xeago>
but the way you split that can't happen
<JDubs>
line 2 is make it where i can split the number by digit
<JDubs>
and then make sure it comes out as a number not a string
<JDubs>
the purpose is to find the product of every group of 5 digits in the number
<JDubs>
and find the highest product
Shamgar has joined #ruby
<Xeago>
also you could write 'highest = current if current > highest' 9-11
<JDubs>
apeiros_ each_cons?
<apeiros_>
JDubs: Enumerable#each_cons
<workmad3>
that's what I was about ot suggest :)
arkiver has quit [Quit: Leaving]
<apeiros_>
gets you N consecutive items out of the enumerable
<workmad3>
lupine: if each_cons doesn't solve it, I bet each_slice will ;)
* apeiros_
wonders what the non-brute-force solution would look like
kpshek has joined #ruby
<lupine>
^^
<JDubs>
workmad what is &:to_i?
<lupine>
things like "given a string, cut it into chunks of X bytes and process"
<workmad3>
JDubs: equivalent to doing .map {|n| n.to_i}
<JDubs>
so what does &: mean?
<JDubs>
current object?
<apeiros_>
I guess you could do some kind of rolling check, but hmm
fyolnish has quit [Ping timeout: 252 seconds]
<workmad3>
JDubs: no, it's calling to_proc on the symbol :to_i
<lupine>
"method(:meth_name)"
<apeiros_>
workmad3: &:* --> :*
wikiziner has joined #ruby
arkiver has joined #ruby
<apeiros_>
inject accepts symbols by now
<apeiros_>
and is probably faster that way
<workmad3>
apeiros_: I always prefer to explicitly put the &:* in, and I don't think it's faster
<apeiros_>
wanna bet? :)
<JDubs>
I dont understand how to &:to_i works still
<Xeago>
oh god
<JDubs>
&: somehow represents |n|?
arquebus has quit [Remote host closed the connection]
<Xeago>
JDubs: no
<Xeago>
&:symbol calls symbol on an element
<apeiros_>
workmad3: 50% slower in a quick test
<workmad3>
apeiros_: because then I just remember to use &:* with enumerable methods all the time, rather than thinking 'if I use inject but don't need to pass an initial value in, then I can use just the symbol on its own)
nazty has quit [Read error: Connection reset by peer]
nazty has joined #ruby
igro has joined #ruby
matthewrobbins has joined #ruby
xandy is now known as xAndy
dr_bob has quit [Ping timeout: 240 seconds]
kpshek has quit []
krz has quit [Quit: krz]
nazty has quit [Read error: Connection reset by peer]
jxriddle has joined #ruby
dr_bob has joined #ruby
bradhe has joined #ruby
nazty has joined #ruby
<JDubs>
what is the diff between .send and .__send__
<Hanmac>
apeiros_ num.to_s.each_char.map(&:to_i).each_cons(5).map {|a| a.inject(:+)}.max .... bad that i cant get it more nice (i tryed it to make it nice without map)
Phoop has quit [Quit: Phoop]
<lupine>
chances of being overridden
<apeiros_>
Hanmac: I had newlines in the text, so each_char wouldn't do
<apeiros_>
(I copy pasted from the source)
<apeiros_>
where the source = project euler
<workmad3>
apeiros_: hmm, using your test, .inject(:*) is faster on my machine, but only by about .005s
<workmad3>
apeiros_: not 50%
<apeiros_>
how long is the complete running time?
<workmad3>
0.140
<workmad3>
upped it to 1000 runs each time, .inject(:*) is about 0.05s faster now
hotovson has quit [Remote host closed the connection]
InFlames has quit [Quit: Leaving]
<Godd2>
If I set a = 3, and then I call a, it gives me 3. How can I make a class where calling it wihtout a method gives me one of the attributes of the object?
<workmad3>
apeiros_: hmm, any ideas why it's 50% on yours but less than 1% on mine? :/
<apeiros_>
what's the precise code and ruby version?
Virunga has quit [Remote host closed the connection]
<apeiros_>
you can let Test act as if it was 2, but you can't make an instance of Test become 2
atno has joined #ruby
ToTo has joined #ruby
<apeiros_>
workmad3: odd
<JDubs>
Apeiros_ couldn't Godd2 use method_missing to return a default attribute or something?
<apeiros_>
JDubs: no, since no method is invoked there
<workmad3>
apeiros_: are we going to need to get down into compiler flags? :( :P
<apeiros_>
workmad3: I assumed it might be CPU time vs. real time, but both our methods use cpu time
<JDubs>
is there a no_method? hehe
<Godd2>
is there no method to override when I simply type test
<workmad3>
apeiros_: I was reporting user time from using 'time' initially anyway
<workmad3>
apeiros_: then constructed the benchmark to double-check
<JDubs>
man...my computer sucks or my programming sucks
punkrawkR has quit [Client Quit]
<JDubs>
my eueler solutions take forever sometimes
<JDubs>
lol
punkjul has joined #ruby
atno has quit [Remote host closed the connection]
<workmad3>
Godd2: no
atno has joined #ruby
<Godd2>
JDubs: which problem are you working on?
PlaydoBear has joined #ruby
<JDubs>
Godd2: 10
<JDubs>
looks like it's going to take my computer about 10-15 minutes lol
<Godd2>
got it. I just have to override to_s
<workmad3>
Godd2: wrong
wikiziner has quit [Remote host closed the connection]
toto_ has joined #ruby
<workmad3>
Godd2: that doesn't make test into '2', it just overrides what the string representation is
<workmad3>
Godd2: and if you override to_s to return 2, instead of a string, you're doing bad things
ToTo has quit [Ping timeout: 255 seconds]
<Godd2>
noted
<Godd2>
Ill keep away from having to_s return non strings
<JDubs>
Aperios_: My solution to #10 must be horrible lol....I think it might take 20 minutes or longer for my computer to find answer
<Godd2>
but if was returning "2", thatd be okay, right?
<apeiros_>
workmad3: if I use your Benchmark code, it's ~5% here too. and I checked, the 1000.times within the code is not the reason, that only attributes for <1‰ of the time
<workmad3>
Godd2: it still wouldn't be what you want, afaict, but it would be at least fulfilling the contract of 'to_s'
<Godd2>
JDubs: If youve already gotten the answer to 10, would you like to see my solution?
<apeiros_>
JDubs: project euler questions are often designed in a way that the naive solution takes a lot of time
<workmad3>
apeiros_: huh... weird
<JDubs>
Godd2: computer is still working through the solution to find out if I have the right answer
<apeiros_>
workmad3: yeah, I guess I have to double check my Kernel#mbench method :(
<JDubs>
apeiros_ thanks for calling my programming naive :(
<apeiros_>
oh, banisterfiend, ping - bug in pry! $ mbench tells me `Error: unexpected $end` :D
wikiziner has joined #ruby
<workmad3>
JDubs: not the programming, the solution you're attempting ;)
beiter has joined #ruby
codecaster has quit [Read error: Connection reset by peer]
<JDubs>
wow apeiros_ I think it might take over an hour wtf
<JDubs>
:/
<apeiros_>
JDubs: that's a common term
<workmad3>
JDubs: brute-force approaches to project euler are often naive solutions
<apeiros_>
JDubs: the "naive" solution is the one which you usually come up first
<apeiros_>
and yeah, brute force is almost always "the naive solution"
<workmad3>
JDubs: naive as in they don't attempt to do clever optimisations or play on particular insights
red5 has joined #ruby
red5 has left #ruby [#ruby]
<workmad3>
JDubs: so they are naive in the purest sense of they encode the least amount of information about the problem in the solution :)
<apeiros_>
that's… not even the one from my pryrc o0
<banisterfiend>
haha
<Godd2>
workmad3: I believe you can make the prime checker more efficient by instead of checking every integer up to the sqrt of the number in question, you only check every currently known prime
<apeiros_>
errr… that source location report is wrong
<apeiros_>
that file doesn't even *have* 471 lines…
<workmad3>
Godd2: sure, you can do a seive too
<apeiros_>
wtf is going on there? o0
<banisterfiend>
apeiros_: can u type this: cat /Users/stefan/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.10/lib/pry/pry_class.rb:471 -l
<Xeago>
workmad3: making a sieve essentially does that
<JDubs>
apeiros_ for some reason, I just increased my run-time by about 50% by adding a .step :/
grzywacz has joined #ruby
<JDubs>
apeiros_ I thought it would LOWEr my runtime
<apeiros_>
banisterfiend: as said, that file doesn't even have 471 lines
a_a_g has joined #ruby
<banisterfiend>
apeiros_: oh
<workmad3>
Xeago: by 'sieve' there I was naming what Godd2 was describing ;)
<apeiros_>
banisterfiend: that .source_location is totally bogus
<workmad3>
Xeago: rather than proposing a third approach
haxrbyte has joined #ruby
<Xeago>
his approach is different, as he uses a precomputed (or earlier computed/otf) table
<banisterfiend>
apeiros_: does $ work on other methods defined ni your .pryrc ?
<Hanmac>
apeiros_ it would be funny if source_location works with c-extendions too :D
<Godd2>
oh I was suggesting that as you go along, you collect the primes into an array
<apeiros_>
banisterfiend: no
vasile has joined #ruby
<apeiros_>
banisterfiend: and other methods report that file as source location too
<banisterfiend>
apeiros_: so it looks like a but with .pryrc loading
<Godd2>
and then only check against the elements of that array
<banisterfiend>
let me try
pcarrier has joined #ruby
<apeiros_>
banisterfiend: seems like all methods in pryrc report pry_class as source
<JDubs>
Apeiros_ any idea why adding a .step would INCREASE my runtime instead of lower it?
<Xeago>
JDubs: gist source
<apeiros_>
JDubs: if you forgot the step-size
<apeiros_>
then it'd be slower
<banisterfiend>
apeiros_: yeah, cool, ill try HEAD to see if it's fixed
tps_ has joined #ruby
<banisterfiend>
apeiros_: HEAD seems to work ok
<banisterfiend>
so whaever weird thing it is, it's fixed :)
<Hanmac>
banisterfiend does source_location works with *.so files too? :D
<banisterfiend>
Hanmac: no, but we can show source of methods defined in them, many times :)
<banisterfiend>
Hanmac: watch this
JohnBat26 has quit [Remote host closed the connection]
<JDubs>
Apeiros_ lol all these math problems are pwning my CPU, my fan is going crazy lol
<workmad3>
banisterfiend: how long before pry gets pulled into the standard lib to replace IRB? :P
<apeiros_>
JDubs: Prime.take_while { |n| n < 2_000_000 }.inject(:+) ~7s on my machine :)
<JDubs>
apeiros_ I'm at runtime about 80 seconds now...but my answer is wrong :/
<Xeago>
what was the require for prime?
<apeiros_>
prime
<apeiros_>
trolol ;-p
<Xeago>
don't have it :\
<apeiros_>
wuzz?
<JDubs>
apeiros_ can you help me figure out where my code is bad?
<banisterfiend>
Hanmac: that figures out where *.c files must be stored, and scans them to extract the source of c methods
<apeiros_>
JDubs: try `2.is_prime?`
kpshek has joined #ruby
<apeiros_>
I bet it returns false for you
<banisterfiend>
workmad3: never i think :) we have too many dependencies
<apeiros_>
while 2 definitively is a prime :)
<Godd2>
JDubs: one reason its taking so long is the putsing
<Hanmac>
banisterfiend i need to test if it works for my bindings too ... bacause in 99% i dont have the methods (i generate them via C-Macros)
<banisterfiend>
Hanmac: probably not then
<banisterfiend>
it's just using a simple C scanner
<apeiros_>
oh, and `for i in (3..((self**0.5).ceil)).step(2)` is probably slow indeed. but I have no experience to back that up. just a hunch. I'd try Fixnum#step instead, without the for…in
<Hanmac>
(hm my files are *.cpp ... )
<apeiros_>
and you can floor the result of **0.5
<apeiros_>
(little difference, though)
[Neurotic] has quit [Ping timeout: 252 seconds]
<apeiros_>
until current >= 2_000_000 - here you can use for…in with a range instead, should be faster
<apeiros_>
ah, or you could adapt your is_prime?, and use .step there. i.e. don't iterate over even numbers and don't test the numbers for being even
<workmad3>
hmm, the Prime lib does memoising
<banisterfiend>
Hanmac: but it works on libraries like ruby-debug and nokogiri, and so on
<Godd2>
apeiros_: shoud he initialize prime_total = 2 ?
<apeiros_>
JDubs: anyway, I think your current code omits the lower primes (2, 3)
<Godd2>
oh, then prime_total = 5 starting out
JohnBat26 has joined #ruby
<apeiros_>
yeah, why not
<apeiros_>
saves ~2mio tests
<Hanmac>
banisterfiend, my binding may be a bit different then them :P
<JDubs>
apeiros_ I don't think it omits 3
<Beoran__>
hi apeiros_
<JDubs>
is 1 considered a prime?
<apeiros_>
hi Beoran__
<workmad3>
JDubs: no
<Beoran__>
had some fun with Alps?
<Godd2>
JDubs: 1 is not prime
<Xeago>
some people argue different
<apeiros_>
Beoran__: was/am sick, so not much, no :(
<Hanmac>
all primes are odd, and 2 is the oddest :P
Banistergalaxy has quit [Ping timeout: 276 seconds]
<Beoran__>
Ah, too bad, I hope you're feeling better?
<workmad3>
Xeago: it's generally considered to be not prime, because it breaks the uniqueness of prime factorisation
<apeiros_>
yes, thanks :) otherwise I wouldn't be here and help solve project euler ;-)
kil0byte has joined #ruby
Solnse has quit []
gbchaosmaster has quit [Ping timeout: 264 seconds]
<JDubs>
Apeiros_ my answer is still wrong :/
<apeiros_>
JDubs: what's your answer?
<ccooke>
Ooh, project euler. Haven't looked at that in ages
Banistergalaxy has joined #ruby
<Godd2>
his answer is 142915828923
<JDubs>
142915828925
<apeiros_>
hm, that's off by quite a margin
Goles has quit [Quit: Computer has gone to sleep.]
<apeiros_>
ah
<apeiros_>
that one otoh is only off by 2
haxrbyte has quit [Ping timeout: 252 seconds]
<apeiros_>
oh
<apeiros_>
wait, no
<Godd2>
neither is off by two
<apeiros_>
compared the wrong numbers :)
<apeiros_>
they're both off by ~2mio
kil0byte_ has quit [Ping timeout: 256 seconds]
<apeiros_>
JDubs: oh btw., puts'ing is very slow
<Hanmac>
dr_bob has quit [Quit: Leaving.]
<JDubs>
apeiros_ so my code is adding an extra 2? or not adding a 2 it needs?
tungd has joined #ruby
<apeiros_>
JDubs: your code is off by ~2_000_000
<apeiros_>
so it's not just the 2
<apeiros_>
but 2 things which are wrong with your current code: 1.is_prime? # => true <-- that's wrong
timonv has quit [Remote host closed the connection]
<apeiros_>
2.is_prime? # => false <-- that's wrong too
<Godd2>
oh I see why
sepp2k has quit [Quit: Leaving.]
<Godd2>
JDubs: would you like to know why its off by 2_000_000?
dr_bob has joined #ruby
<apeiros_>
JDubs: what's the last prime your code prints?
timonv has joined #ruby
<apeiros_>
I bet you're adding `2_000_003` to the result…
a_a_g has quit [Quit: Leaving.]
<JDubs>
2_000_003
<workmad3>
hehe
<apeiros_>
you should check your loop condition ;-)
<Godd2>
what does the second line of the qeustion on project euler say ? ;)
<apeiros_>
JDubs: but you went half way to a pretty clever solution
vlad_starkov has quit [Remote host closed the connection]
<foucist>
JDubs: btw, you can just do "time ruby file.rb" to find out how long it took, instead of the Time.now, if you're running it at the command line
altious has quit [Ping timeout: 252 seconds]
<JDubs>
foucist: thanks
<apeiros_>
Godd2: it's almost twice as fast for me… pasting up my code…
altious2 has quit [Ping timeout: 265 seconds]
ddd1 is now known as ddd
vlad_starkov has joined #ruby
<JDubs>
apeiros_ can you explain the 3.step? Does it mean step starting at 3, until self**.5 rounded down, by steps of 2?
Zai00 has quit [Quit: Zai00]
Slivka has quit [Remote host closed the connection]
berserkr has quit [Quit: Leaving.]
<Godd2>
JDubs: step will increment by 1 by default
banisterfiend has quit [Remote host closed the connection]
moos3 has quit [Quit: Computer has gone to sleep.]
<apeiros_>
foucist: ouch… should be much faster here in that case…
<apeiros_>
i7 @ 2.3ghz, no virtualization
Goles has joined #ruby
kil0byt__ has joined #ruby
Xeago has quit [Ping timeout: 250 seconds]
tk__ has joined #ruby
kil0byte has quit [Ping timeout: 255 seconds]
g_bleezy has quit [Ping timeout: 265 seconds]
kirun has joined #ruby
Virunga has joined #ruby
yshh has joined #ruby
<foucist>
strange
kil0byte_ has quit [Ping timeout: 255 seconds]
<foucist>
apeiros_: falcon patched?
aajjbb has joined #ruby
<apeiros_>
no
<apeiros_>
falcon causes segfaults here in some cases
<foucist>
using rvm head, rvm install 1.9.3 --patch falcon (it's got both falcon & greg price's patch)
<foucist>
ah
<apeiros_>
also iirc falcon isn't yet ready for p327
<foucist>
ah this is on p327 ?
<apeiros_>
yes
<foucist>
i mean (i have p327)
skaczor has joined #ruby
<foucist>
it's p327 falcon patched
<apeiros_>
oh
<apeiros_>
hm, then it got updated :)
karakedi has joined #ruby
<foucist>
yep
<apeiros_>
how do I change the name by which rvm installs the ruby?
<apeiros_>
i.e., I don't want the falcon patched replace my current 1.9.3
ssspiff has quit [Ping timeout: 264 seconds]
<foucist>
no idea, i had p286 before, so it wasn't clobbering a p327 version
dukedave has joined #ruby
sspiff has joined #ruby
yshh has quit [Remote host closed the connection]
SoonerBourne has quit [Read error: Connection reset by peer]
toto_ has quit [Ping timeout: 276 seconds]
aajjbb_ has joined #ruby
`brendan has joined #ruby
SoonerBourne has joined #ruby
acrocity has quit [Ping timeout: 276 seconds]
Neomex has joined #ruby
Neomex has quit [Client Quit]
Zai00 has joined #ruby
acrocity has joined #ruby
pcarrier has joined #ruby
banisterfiend has joined #ruby
codecaster has quit [Quit: Leaving.]
gmci has joined #ruby
gmci is now known as Guest78419
pcarrier has quit [Read error: Operation timed out]
dr_bob has quit [Quit: Leaving.]
moos3 has joined #ruby
_alejandro has quit [Remote host closed the connection]
rakunHo has quit [Remote host closed the connection]
* Hanmac
points his finger and laughts about falcon :D
<apeiros_>
foucist: did you compile ruby with any special flags? like -O3 or somesuch?
<apeiros_>
Hanmac: oh? why's that?
grzywacz has joined #ruby
Banistergalaxy has quit [Ping timeout: 250 seconds]
<Hanmac>
falcon does change something about GC right? then it could break my bindings
wikiziner has joined #ruby
s1n4 has quit [Quit: leaving]
<apeiros_>
no idea what falcon changes :-/
<foucist>
apeiros_: nope, just literally just the 'rvm install 1.9.3 --patch falcon' thing.. um, i'm using the https://github.com/rails/rails-dev-box vagrant recipe, but i doubt that does anything
<devians>
hey, im trying to use puppet on osx. i have 1.8.7 system ruby and 1.9.3 via homebrew. puppet requires the former, vim requires the latter. how can i get these things to co-exist?
<apeiros_>
ddd: yeah, did that, didn't like it as it seems
<apeiros_>
ddd: use -n falcon
<apeiros_>
resulted in just overriding my existing 1.9.3
* apeiros_
not amused
<ddd>
could be because its a patch name so conflicted (?)
mjbamford has quit [Quit: Leaving...]
<JDubs>
apeiros_ I'm having a bit of trouble...i have an array of arrays
<JDubs>
I want to do each with index on both levels of the array
<JDubs>
but on the second level, it's saying cant each with index fixnum
<apeiros_>
JDubs: paste
tps_ has joined #ruby
<lupine>
you've got the arguments the wrong way around
schaary has left #ruby [#ruby]
<lupine>
I think the order is |item, i| but I could be wrong
<ddd>
apeiros_: you'll have to hit up mpapis for that. not sure whats going on there
carloslopes has quit [Read error: Connection reset by peer]
<apeiros_>
ddd: I will, but not now. my head is still achy from that stupid sickness
carloslopes has joined #ruby
<ddd>
ouch :/
<ddd>
apeiros_: know how you feel. I'm still on antibiotics here.
aajjbb_ has quit [Remote host closed the connection]
aajjbb has quit [Remote host closed the connection]
miso1337 has joined #ruby
ExxKA has joined #ruby
<apeiros_>
oh wow, reading fail… I had an answer and it was way higher than what was in the problem - but I looked at the example number instead of the answer :D
Guest78419 has quit [Ping timeout: 244 seconds]
lkba has quit [Ping timeout: 252 seconds]
rondale_sc has joined #ruby
philips_ has quit [Excess Flood]
fyolnish has quit [Remote host closed the connection]
altious2 has quit [Ping timeout: 255 seconds]
altious has quit [Ping timeout: 265 seconds]
fyolnish has joined #ruby
fyolnish has quit [Read error: Connection reset by peer]
dukedave has left #ruby ["PART #RubyOnRails :QUIT :Leaving."]
mjolk2 has joined #ruby
fyolnish has joined #ruby
ttt has quit [Remote host closed the connection]
philips_ has joined #ruby
carloslopes has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
lolmaus has quit []
joshman_ has quit [Quit: Computer has gone to sleep.]
tps_ has quit [Quit: tps_]
ffranz has quit [Quit: Leaving]
haxrbyte has joined #ruby
GoGoGarrett has joined #ruby
flip_digits has joined #ruby
samphippen has joined #ruby
postmodern has quit [Quit: Leaving]
jtharris has joined #ruby
jim80net has joined #ruby
ffranz has joined #ruby
willob has joined #ruby
aquaranto has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
TitaniumStudioUs has quit [Quit: This computer has gone to sleep]
sandGorgon has quit [Ping timeout: 244 seconds]
MissionCritical has quit [Ping timeout: 252 seconds]
digitalcakestudi has joined #ruby
nari has joined #ruby
rakl has quit [Quit: sleeping]
hotovson_ has joined #ruby
bananastalktome has joined #ruby
yonda has joined #ruby
bbttxu has joined #ruby
swex_ has joined #ruby
areil_ has joined #ruby
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ruby
chussenot has joined #ruby
Gooder has joined #ruby
areil has quit [Ping timeout: 252 seconds]
sailias has joined #ruby
atal421 has joined #ruby
bananastalktome has quit [Client Quit]
swex has quit [Ping timeout: 264 seconds]
bananastalktome has joined #ruby
havenn has joined #ruby
bananastalktome has quit [Client Quit]
areil has joined #ruby
havenn has quit [Remote host closed the connection]
cakehero has joined #ruby
d2dchat has joined #ruby
sspiff has quit [Ping timeout: 252 seconds]
jrist-afk is now known as jrist
areil_ has quit [Ping timeout: 264 seconds]
skaczor has quit [Remote host closed the connection]
a_a_g has joined #ruby
NiteRain has joined #ruby
epwhorl has joined #ruby
yonda has left #ruby [#ruby]
ananthakumaran has joined #ruby
<apeiros_>
JDubs: btw., euler11 can be solved with a one-liner too ;-) (granted, 190 chars long, but no ; in it)
reppard has joined #ruby
blaxter has quit [Ping timeout: 246 seconds]
sspiff has joined #ruby
reppard_ has joined #ruby
banister_ has joined #ruby
mercwithamouth has quit [Ping timeout: 248 seconds]
ExxKA has quit [Quit: This computer has gone to sleep]
Jck_true has quit [Remote host closed the connection]
areil has quit []
xscc has joined #ruby
xscc has quit [Client Quit]
execute has joined #ruby
<JDubs>
apeiros_ my solution so far, although getting wrong number for some reason
<JDubs>
so if you only want it overriden in your current class, make it a subclass I thinki
<JDubs>
Apeiros_ ya there bromo
lobak has joined #ruby
jim80net_ has quit [Remote host closed the connection]
theRoUS_ has joined #ruby
jim80net_ has joined #ruby
pavilionXP__ has joined #ruby
jim80net has quit [Read error: Connection reset by peer]
jim80net_ is now known as jim80net
<workmad3>
Godd2: first question - is the new_method only really applicable to this particular type of array from Game?
vasile has joined #ruby
<workmad3>
Godd2: or is it universally applicable in your app?
bradhe has quit [Ping timeout: 248 seconds]
<Godd2>
workmad3: its a tictactoe game and the array is a row of cells and Im checking if all of their contents are the same
dmerrick has joined #ruby
<workmad3>
Godd2: right, so the new method is really only applicable to this particular array
<Godd2>
oh so I shouldnt go to the trouble of overriding Array?
<workmad3>
Godd2: so there are two nicer approaches that don't globally pollute the array with a very specific method... one is to create a new class that wraps up the array and add the new method there
Guest73164 has joined #ruby
Hanmac has quit [Quit: Page closed]
<workmad3>
Godd2: the other would be to extend the specific array instance you're using with a module that contains the method(s) you want to add
<JDubs>
wordmad3: i'm getting the wrong answer for euler 11
<workmad3>
0o
<workmad3>
I've never done that problem...
<JDubs>
ok :(
<workmad3>
the 0o is more to do with being confronted with that grid btw :)
lowkey has joined #ruby
DaZ has quit [Ping timeout: 265 seconds]
<workmad3>
ok, so I know how I'd approach the problem
skaczor has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
yalue has joined #ruby
phantasm66 has joined #ruby
AlSquire has joined #ruby
AlSquirrel has quit [Read error: Connection reset by peer]
<workmad3>
I'd personally approach it from a data-structure centric view... you have a 2d grid, you want to extract from it every set of 4 adjacent, straight line elements
taoru has quit [Remote host closed the connection]
<workmad3>
so I'd focus on how to do that first, rather than on both problems
<workmad3>
because I know once I've solved that bit, the rest is trivial
ejnahc has quit [Remote host closed the connection]
banister_ has quit [Read error: Connection timed out]
AlSquirrel has joined #ruby
ejnahc has joined #ruby
AlSquire has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
carloslopes has joined #ruby
quest88 has joined #ruby
<lowkey>
hello .. is there a way I could tell ruby where "public" images/stylesheets/js are ? something like 'config.action_controller.asset_host' but it's not hosts based .. I just like to "add" another subdir in url where things are .. because I am proxying request via nginx server and I'd like to serve static content with nginx
MissionCritical has joined #ruby
xclite has joined #ruby
<JDubs>
@workmad3 I don't really know what you mean...Isn't that what I did?
stopbit has joined #ruby
<Godd2>
workmad3: ok thanks, ive gone ahead and created a Row class and Im gonna define uniqueness there
elico has joined #ruby
xhoy has joined #ruby
haxrbyte has quit [Remote host closed the connection]
xeocs has joined #ruby
pu22l3r has joined #ruby
haxrbyte has joined #ruby
haxrbyte_ has joined #ruby
xeocs has left #ruby [#ruby]
haxrbyte has quit [Read error: Connection reset by peer]
quest88 has quit [Quit: quest88]
pu22l3r has quit [Remote host closed the connection]
nobuoka has joined #ruby
iamjarvo has quit [Quit: Leaving.]
entrenador has joined #ruby
<workmad3>
JDubs: you've jumbled together all 3 things, the extraction of each 4-tuple, the summation, and the determination of the highest value
nomenkun has quit [Read error: Connection reset by peer]
<workmad3>
JDubs: I've suggesting that you split each bit out so that it's more amenable to reasoning
nomenkun has joined #ruby
ner0x has joined #ruby
adamnbowen has joined #ruby
altious has joined #ruby
ananthakumaran has quit [Ping timeout: 252 seconds]
buibex has joined #ruby
joshman_ has joined #ruby
elaptics is now known as elaptics`away
burgestrand has quit [Quit: Leaving.]
tk__ has quit [Quit: ばいばい]
<JDubs>
@workmad3 I'm not sure what could be wrong, I've picked a bunch of random products to check for, and they are all in the product list...
<JDubs>
@workmad3 so I don't know what could be wrong
nomenkun has quit [Read error: Connection reset by peer]
nwertman has quit [Ping timeout: 255 seconds]
nomenkun has joined #ruby
havenn has joined #ruby
bean has joined #ruby
k610 has joined #ruby
<JDubs>
where did everyone go?!
vasile has quit [Read error: Connection reset by peer]
<workmad3>
couldn't be bothered to remove the duplication between the left and right diagonals :)
<apeiros_>
if I'd solve it *nicely*, I'd probably create a class Table and provide accessors for the tuples
dawkirst_ has quit [Ping timeout: 264 seconds]
<JDubs>
workmad3 your code hurts my brain too :/
<JDubs>
Hopefully eventually this stuff no longer hurts to look at
<JDubs>
:/
<Xeago>
that table always hurts
<Xeago>
doesn't matter how long you program it will hurt
skaczor has joined #ruby
<workmad3>
JDubs: it's just doing what I suggested - instead of trying to calculate everything at once, I instead calculate 4 data structures, one of the rows, one of the columns, one of the 'left diagonals' and one of the 'right diagonals'
<workmad3>
JDubs: and yeah, as Xeago said, the embedded 20x20 data table in the code will always hurt :)
<JDubs>
@workmad3 you mean parsing the numbers will hurt? not sure what you are saying, sorry.
<workmad3>
JDubs: not the parsing, just the mere presence
<workmad3>
JDubs: that grid of numbers directly in code... ewww
<JDubs>
workmad3 yeah lol
stefhen has left #ruby [#ruby]
xpen has joined #ruby
<JDubs>
workmad3: I'm really looking forward to when reading other peoples code, like yours, doesn't hurt my brain to where I'm struggling to even look at it, let alone understand it.
<Xeago>
read pretty code :3
<workmad3>
JDubs: with project euler solutions, that's not likely to ever happen...
tagrudev has quit [Remote host closed the connection]
jgarvey has joined #ruby
cj3kim has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
wikiziner has joined #ruby
<apeiros_>
Godd2: I like the approach, I think some details could be done nicer (e.g. use .max instead of line 38-41)
wf2f has quit []
<workmad3>
JDubs: because the problems are small, so don't need the abstractions you'd introduce by engineering a solution that would make it nicely readable, and the problems also go for clever solutions, which tend to require mental overhead
nomenkun has quit [Remote host closed the connection]
<apeiros_>
Godd2: also proper init of product would be 0 ;-)
<Godd2>
apeiros_: I think it was to reset the value wach time?
phelps has quit [Ping timeout: 255 seconds]
ananthakumaran has joined #ruby
<apeiros_>
Godd2: what for? you assign a new value anyway
<Xeago>
workmad3, JDubs: and also often have mathematical complexity
<Godd2>
apeiros_: I wouldnt want to set the product to 0, because if I go in and *=, it will still be 0
Goles has quit [Ping timeout: 252 seconds]
C0deMaver1ck has joined #ruby
<apeiros_>
Godd2: you don't do product*anything in the code
<workmad3>
Xeago: yeah, that too, which tends to lead to a certain amount of complexity
S0da has joined #ruby
<Godd2>
I didnt in this case, thats correct
<apeiros_>
Godd2: you're using product as the maximum product
nat2610 has joined #ruby
<JDubs>
workmad3: True... Bean: nice solution... I feel like I'm the worst coder in this chatroom :P
freeayu has quit [Remote host closed the connection]
<apeiros_>
and the for that reason it should be set to the smallest possible product - which is 0
<JDubs>
JDubs, I need the hyperbolic time chamber :(
Slivka has quit [Read error: Connection reset by peer]
<JDubs>
errr
philcrissman has quit [Remote host closed the connection]
nari has quit [Ping timeout: 240 seconds]
<bean>
lol, JDubs. I've been writing ruby for a while. Took some courses in college that I used ruby in, etc.
<apeiros_>
Godd2: same for line 28-31 if they were actually needed
<JDubs>
Apeiros_, Bean, Xeago, Workmad3, Godd2: I need the hyperbolic time chamber
jpfuentes has joined #ruby
jpfuentes has left #ruby [#ruby]
<apeiros_>
JDubs: who doesn't…
rippa has joined #ruby
jackdanger has joined #ruby
<JDubs>
Apeiros_ I mean so I can do well in my course...My class starts March
mikepack has joined #ruby
wikiziner has quit [Remote host closed the connection]
<JDubs>
Apeiros_ I want to be as overprepared as possible, and be in the top of the class
<JDubs>
lol
phelps has joined #ruby
Goles has joined #ruby
<bean>
JDubs: what is the course
<Xeago>
JDubs: what is the level of the class?
swarley-freenode has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
AlSquirrel has quit [Read error: Connection reset by peer]
<bean>
so they're going to teach you basic ruby... but you already know basic ruby?
<Xeago>
just continue coding, don't stress about becoming the best of the class
<Xeago>
or whatever you are stressing about
drfreeze has joined #ruby
<JDubs>
Xeago: the better I do in the course, the higher salary I will be likely to get when I get done, so it's pretty important :)
<Xeago>
you have the gist of most of it we say and the will to understand
<drfreeze>
Anyone here know how to handle file and directory names with special characters on Windows?
<JDubs>
Bean: at some point I need to start working on rails I think, and then start learning javascript maybe?
bradhe has joined #ruby
<drfreeze>
I have a file name "+FOLDER TEMPLATES"
<JDubs>
Xeago: Thanks :)
cakehero has joined #ruby
<drfreeze>
Dir.chdir does not like the +, even if I quote the name
<bean>
heh, JDubs, I doubt you need to know much about rails beforehand
<Xeago>
JDubs: it would be good for you to get used to rails tho
<Xeago>
it is completely different
<Xeago>
what bean said
<Xeago>
:)
<JDubs>
I know, but I'm afraid of getting left behind
<Xeago>
but that is something you haven't seen before
<JDubs>
or getting confused and not finishing etc
<bean>
lol
<JDubs>
I want to make sure I do well in the course
<bean>
It's not nearly as big of a deal as you're making it out to be
<JDubs>
This is, in my opinion, my last shot at a good career and not flipping burgers the rest of my life
nemesit has quit [Quit: Leaving...]
<JDubs>
bean: big deal to me... :/
<Xeago>
JDubs: do you know what heroku is?
<bean>
why?
jlast has joined #ruby
<JDubs>
Bean: plus I need a good career so I can get married to my fiance and support us
<Xeago>
JDubs: if so, host a railsapp there that does all of your euler stuff
<Xeago>
:)
wikiziner has joined #ruby
<JDubs>
Xeago: no I don't know what a heroku is, is it like a haiku?
jdripper has joined #ruby
tjbiddle has joined #ruby
<Xeago>
JDubs: heroku.com
<Xeago>
get started :)
altious has quit [Ping timeout: 264 seconds]
x82_nicole has joined #ruby
<Xeago>
haiku = verse/poem iirc like a 353 or something?
<Xeago>
or 7 11 7
nat2610 has quit [Quit: Leaving.]
<JonnieCache>
i think its 7 11 7
<JDubs>
5 7 5
AlSquire has quit [Ping timeout: 265 seconds]
<JDubs>
This is a haiku, your mom is so very fat, refrigerator
banisterfiend has quit [Remote host closed the connection]
<JDubs>
^ like that ^
<bean>
JDubs: why is this your "last chance"
<JDubs>
bean, because I have no degree in anything, I'm almost 30, and I need to get a career going before I'm ancient...
uris has joined #ruby
<bean>
Ah.
<Xeago>
JDubs: coursera, it is awesome
<Xeago>
doing crypto there, the course for algorythms is really fun
<JDubs>
I always love computers/IT/programming etc as a teenager, then I went into the Army and forgot about it basically
bradhe has quit [Ping timeout: 256 seconds]
altious has joined #ruby
carloslopes has quit [Remote host closed the connection]
buibex has quit [Remote host closed the connection]
<JonnieCache>
JDubs: if youre working through the euler problems then youre doing very well
<JonnieCache>
JDubs: youd be shocked at the average ability of programmers in industry
wikiziner has quit [Remote host closed the connection]
<JDubs>
JonnieCache: really??? why is that???
_alejandro has joined #ruby
<bean>
Most programmers suck.
<apeiros_>
sad but true :(
<JonnieCache>
most people out there dont have the first clue what theyre doing
<bean>
I'm a sysadmin and I can code better than half of them I'd say.
AlSquire has joined #ruby
<Xeago>
JDubs: we asked you to do fizzbuzz
<apeiros_>
lots of copy coding
<oqa>
JDubs: coding is just part of the whole trade, if you're planning on higher salaries invest some time on other skills also
<apeiros_>
lots of cargo culting
<Xeago>
I know a lot of people that can't do it
<Xeago>
googlecoding
eldariof has quit [Ping timeout: 264 seconds]
<virtualentity>
i tend to believe it's the businesses who breed those "bad coders" though
<JDubs>
Xeago: Fizzbuzz?
joshman_ has joined #ruby
MissionCritical has joined #ruby
<Xeago>
yup
<apeiros_>
also languages like ruby and java enable people without deeper understanding to code, which is great, but also leads to code which has horrible issues
<JDubs>
Oqa: what do you suggest?
<oqa>
oqa: the skills that pay the most have little to do with coding
<virtualentity>
the business doesn't care about the code. then why hire "expensive" programmers?
<JDubs>
Xeago: not sure what you mean man
<oqa>
err JDubs
<Xeago>
fizzbuzz challenge, google it
<oqa>
sleep deprivation is starting to have effect
<apeiros_>
like "what's wrong with array.any? { |x| other_array.include?(x) } - it's just one loop, why is it so slow?"
<apeiros_>
(because it's two loops and because there are more efficient ways to get the same result)
dmiller has joined #ruby
<apeiros_>
oqa: such as? :)
AlSquirrel has joined #ruby
<JDubs>
oqa: What skills should I work on besides programming?
<workmad3>
oqa: as I've heard said before - 'programming is a social problem'
<bean>
Also, learning how to estimate how long something will take is a hard thing to do
<JonnieCache>
JDubs: partly comments but its mostly about communicating with people
<JonnieCache>
oh yeah what bean said. but thats basically impossible :)
<oqa>
JDubs: also it doesn't hurt to understand something about software development processes and tools, like scrum and kanban
ltsstar has quit [Quit: ltsstar]
<JDubs>
oqa: any suggested reading materials?
<workmad3>
in addition, programming in the small, like with these project euler problems, require a certain amount of cleverness and the ability to think through the problems, but require almost no design
<bean>
oqa: Godd2: we did a Clean Code book group at work, learned a lot
tvsutton has joined #ruby
<Godd2>
alright then it's agreed. tonight's reading material is to read Chapter 1 of Clean Code. There will be a quiz at 2300 hours
generalissimo has joined #ruby
suhi has joined #ruby
<workmad3>
Godd2: I'll look forward to it! (although I haven't read clean code for a while now)
<JDubs>
@Godd2 I've written in C
EyesIsMine has quit [Ping timeout: 248 seconds]
<oqa>
bean: yea, it's nicely thought provoking.. I think most of my 200 colleagues have read it.. we're passionate about coding standards
<Godd2>
JDubs: Is Ruby your first Object Oriented language?
<Xeago>
*!*!*!* but c is OO :O?
<Xeago>
hurrhurrhurr
<JDubs>
Godd2: yes
<suhi>
hi
<JDubs>
suhi hello o/
<workmad3>
still... books... TDD By Example, Clean Code, Refactoring, Growing Object Oriented Software, Practical OO Design in Ruby, Patterns of Enterprise Application Architecture, xUnit Test Patterns, Specification By Example, The Agile Samurai, Agile Estimating and Planning, Eloquent Ruby....
rhweix has quit [Remote host closed the connection]
<workmad3>
that'll get you started... :P
<bean>
Learning Agile is good
<bean>
in general
<JDubs>
workmad3: :O
<JDubs>
workmad3: when will I find the time/money to read all these books?! lol
<Godd2>
if you're a video person, you can watch the Lynda.com Ruby tutorials
<Godd2>
that's how I learned
<suhi>
hi dear
havenn has left #ruby ["Leaving..."]
havenn has joined #ruby
xpen has quit [Remote host closed the connection]
<workmad3>
JDubs: well, I managed to wrangle them through work, and I read them over the course of the last few years on my daily commutes ;)
<oqa>
JDubs: software development is about continuous improvement, things are moving so fast that if you don't keep up you might be left behind at some point
<workmad3>
but they tend to be looking for people with established reputations, I believe, especially if it's someone who'd have to emmigrate to the US
xpen has quit [Ping timeout: 265 seconds]
<JDubs>
@workmad3 I'm from the US
swarley-freenode has joined #ruby
<JDubs>
@workmad3 and moving to SF in february lol
<workmad3>
JDubs: heh
Jasko has quit [Ping timeout: 264 seconds]
<bean>
Godd2: duolingo rocks.
<workmad3>
JDubs: incidentally, the general feeling I tend to get is that qualifications, course scores, etc. don't particularly matter too much to a lot of the companies you'd actually want to work at
* bean
works in the midwest at a company that does bank websites / other financial solutions.
geekbri has quit [Remote host closed the connection]
<bean>
workmad3: +++++
<workmad3>
JDubs: instead, you need to be able to demonstrate skill through code
<JDubs>
bean: I'm from oklahoma, where you from bro?
<bean>
JDubs: Iowa.
<JDubs>
workmad: That's what I'm attempting to do atm...Build up a large library of stuff I've written :)
<Godd2>
bean: I joined early, so my username on there is google :P
<oqa>
workmad3: "if you can talk the talk..."
<Godd2>
JDubs: Do you have repos up on github?
generalissimo has quit [Ping timeout: 260 seconds]
<workmad3>
oqa: if you can talk the talk well enough, they might miss that you can't walk the walk... but generally, you need to demonstrate at least some crawling ;)
<JDubs>
Godd2: Yeah but I haven't pushed any of my new code recently, I need to go through and do that :)
<JDubs>
workmad3: what do you mean crawling?
generalissimo has joined #ruby
<workmad3>
JDubs: I'm just stretching a metaphor, don't worry
<workmad3>
JDubs: it appears this one isn't elastic enough and it just snapped on me
<oqa>
there are people who can talk the talk, but can't code a working program without google
<shevy>
hmm
krz has quit [Quit: krz]
<shevy>
is it possible, in a .gsub(), to replace all '.', but to ignore certain '.' if there comes a special word?
<JDubs>
oqa: lol
haxrbyte_ has quit [Ping timeout: 244 seconds]
schaerli has quit [Remote host closed the connection]
<workmad3>
oqa: I'm thinking it's getting around to fizzbuzz time! :)
<shevy>
like "foobar." vs. "foobar.(IGNORE)"
<JDubs>
shevy: pretty sure if you write your regex correctly, yes
<oqa>
unfortunately I'm slipping more and more in to the "without google" crowd.. too many languages to remember any specifics
skaczor has quit [Remote host closed the connection]
<shevy>
oqa hehe
<oqa>
current work project has java, scala, javascript, jruby
<workmad3>
oqa: in fairness, it's the 'programmers' who can't even code *with* google that are the worst :P
ryannielson has joined #ruby
<lurch_>
being able to lookup stuff eficiently is a skill too
xpen_ has quit [Remote host closed the connection]
kil0byt__ has quit [Remote host closed the connection]
zmo_ has quit [Quit: Leaving]
<oqa>
lurch_: yes, definitely :)
<oqa>
workmad3: lol :(
ejholmes has quit [Quit: ejholmes]
pavilionXP__ has quit [Quit: Forget progress by proxy. Land on your own moon.]
davidcelis has quit [Quit: K-Lined.]
<oqa>
too close to reality there
<bean>
JDubs: having code examples on your github will very much help your chances of becoming gainfully employeed
<workmad3>
oqa: and yeah, syntax can get muddled when you're dealing with polyglot languages :)
ejholmes has joined #ruby
pavilionXP__ has joined #ruby
<JDubs>
bean: sweet, even euler problems?
<bean>
I'd push anything and everything
nyrb has quit [Ping timeout: 255 seconds]
* bean
has a git repo for his project euler stuff.
<workmad3>
oqa: it doesn't impact on your ability to code though, just on the human brain's inability to context-switch quickly and keep things nicely organised and compartmentalised :)
<oqa>
workmad3: yea.. three months of this project and first thing that got messed up was exception handling.. I'm totally confused between java-scala-ruby
<bean>
also, if you're ever interested in systems I recommend learning Chef.
<bean>
chef = <3
<oqa>
try rescue catch ensure finally begin ... why my code doesn't compile
<workmad3>
oqa: bleh, and especially when you throw JS into the mix then...
bbttxu has quit [Quit: bbttxu]
<workmad3>
oqa: I'm currently dealing with ruby, coffeescript and javascript (coffeescript to write, js to debug :) )
davidcelis has joined #ruby
jackdanger has quit [Quit: Leaving.]
apok has joined #ruby
elsifaka has quit [Quit: Veloma e!]
<oqa>
I'm actually trying to axe scala & ruby acceptance tests from the project
<oqa>
plain java is better than the polyglot hell
<workmad3>
hmm, I can see axing multiple languages in the acceptance tests
johnmilton has joined #ruby
<workmad3>
but I don't quite understand why you'd pick java as the language of choice :P
<oqa>
scala is used only for the front application (play framework), there are about 8 java applications for the backend
<workmad3>
and the teams on those 8 other apps don't do scala?
_cheney has joined #ruby
<Xeago>
JDubs: pushing learning stuff to github is really recommended
<Xeago>
it shows you are actively learning and willing to learn
Goles has quit [Quit: Computer has gone to sleep.]
cakehero has quit [Quit: Computer has gone to sleep.]
<oqa>
workmad3: kind of.. and it seems that play framework leads to too complex code
<JDubs>
Xeago: alrighty will do that right now
<workmad3>
I've only dabbled with play and scala tbh... wasn't too impressed with play, but I quite liked scala, especially the scala specs library for testing
<bean>
We have a CMS written on top of play framework
Spaceboy has quit [Ping timeout: 276 seconds]
<bean>
works pretty well.
<bean>
we're nearly 100% scala at my work
<oqa>
bean: can you summarize the best parts of play?
<workmad3>
oqa: and I've heard of some teams that started writing all their tests in scala while still using java for the app code :)
<oqa>
I used to think it would be cool to be in a position where you'd be the guru in the project, then I got in to a project where I was the "main guy" for 1.5 years and I was responsible for development of test automation & continuous delivery platform for 1500 people software development organization
<oqa>
took a while to realize that being a guru is quite stressful
<Xeago>
I am deemed irrelevent
harushimo has joined #ruby
<Xeago>
with proper spelling
<harushimo>
hey everyone
<Xeago>
that aint fun either
<bean>
hello harushimo
Virunga has joined #ruby
Mission-Critical has quit [Ping timeout: 260 seconds]
<foucist>
bean: yep, makes shit faster.. and for a basic square root finding code earlier for some euler problem, halves the time it takes to solve
jrabbit has quit [Read error: Operation timed out]
samphippen has joined #ruby
alvaro_o has joined #ruby
jrabbit has joined #ruby
<harushimo>
man, how come it see?
<harushimo>
Flordia, I mispelled it
<bean>
Florida
<bean>
vs
<bean>
Flordia
<bean>
yep
elaptics`away is now known as elaptics
<harushimo>
I've been noticing when I'm coding, the smallest thing trips me up. I can't tell the error at all
<GeekOnCoffee>
I am yet to meet the veritable army of totally useless non-programming programmers << this person has never had to interview people for jobs
<harushimo>
thanks
pavilionXP has quit [Quit: Forget progress by proxy. Land on your own moon.]
mmitchell has joined #ruby
apok has joined #ruby
rakl has joined #ruby
skaczor has joined #ruby
<oqa>
harushimo: IDEs with debugging help with that
<GeekOnCoffee>
or the average person asking questions on IRC :S
samphippen has quit [Max SendQ exceeded]
davidcelis has joined #ruby
<harushimo>
what's good for ruby? I've been using aptana studio
<oqa>
I specially love IDEA's debugger runtime evalution
<oqa>
put a breakpoint
<GeekOnCoffee>
Rubymine's not bad if you're looking for an IDE
<harushimo>
is it open source?
<harushimo>
I sort can't afford if the software is paid version
<oqa>
open up the dialog, run any code in that runtime environment
<DanBoy>
sublime sublime sublime
<GeekOnCoffee>
no, it's commercial
<harushimo>
oh man
<oqa>
netbeans 6.9.1 has working ruby debugger
<oqa>
and it's free and opensource
<GeekOnCoffee>
harushimo: are you a student?
<harushimo>
I know aptana studio. I've used it a couple of times
<oqa>
I don't know if anyone's released newer netbeans versions with ruby support
* bean
uses vim
<DanBoy>
sublime text 2 is free at the moment
<harushimo>
I use vim too
<harushimo>
is that for mac?
<DanBoy>
mac and linux
<oqa>
harushimo: test driven development is also very good for catching that kind of bugs
<DanBoy>
im using it on osx
<Guest73164>
sublime text, is for mac linux and win too
<harushimo>
like rspec right?
<bean>
sort of
beilabs_ has quit [Ping timeout: 248 seconds]
<bean>
except write the tests first.
<oqa>
develop code in small bits, always do tests and run the tests, if you break existing functionality -> tests fail
<harushimo>
RAILS use is heavy on TDD and BDD
nemesit has joined #ruby
<harushimo>
I was thinking of rspec
<oqa>
those have only superficial differences, slightly different syntax
cr3 has joined #ruby
axl_ has quit [Quit: axl_]
<oqa>
anyways, when you have tests, debugger is super useful
MissionCritical has joined #ruby
<bean>
wow, falcon patch made some of my shit a lot faster
yaymukund has joined #ruby
samphippen has joined #ruby
<bean>
like, from 38 secs to 10 sec
<oqa>
stepping through the code one line at a time shows stupid problems very clearly
TitaniumStudioUs has quit [Quit: This computer has gone to sleep]
buibex has quit [Remote host closed the connection]
<yaymukund>
can I `gem install` a gem from a private repo on GH? I tried `gem install https://github.com/yaymukund/repo.git` and it says that it 'Could not find a valid gem in any repository'
adeponte has joined #ruby
<cr3>
hi folks, I'd really appreciate some help running rake spec on a puppet project but I don't know where to turn to anymore :( the problem is that puppet classes checked in the spec don't seem to be found
<yaymukund>
curiously, it works when I add it to my gemfile and run `bundle`
<bean>
jrist: what are you attempting to accomplish
dr_bob has quit [Quit: Leaving.]
<jrist>
somewhat hard to explain, but it appears that the _() method actually returns the original string if called within _() :)
<jrist>
(confusing, I know)
<bean>
lol ok
Weazy has joined #ruby
altious has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
cezar has quit [Ping timeout: 244 seconds]
nat2610 has joined #ruby
ExxKA has joined #ruby
alexim has joined #ruby
baroquebobcat_ has joined #ruby
<shevy>
jrist, hmm I found gettext annoying, I dont like to use _() calls :\
<shevy>
my solution to internationalization is simple
<jrist>
not really my choice, shevy
<shevy>
everyone go use english
<jrist>
I agree
<shevy>
:D
<jrist>
I like the t. i18n built into rails
<jrist>
*shrug*
Nisstyre has quit [Quit: Leaving]
<jrist>
gettext has its advantages
bradhe has joined #ruby
danneu has joined #ruby
baroquebobcat has quit [Ping timeout: 244 seconds]
baroquebobcat_ is now known as baroquebobcat
mahmoudimus has joined #ruby
arietis has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
babykosh has joined #ruby
<jrist>
thanks bean, sheerun
<jrist>
asldf
<jrist>
shevy: thanks
<bean>
np
nwertman has joined #ruby
<babykosh>
noob question….I need to extract the 'key' associated with the max value in this hash, which is 'alpha'……hash = {{alpha} => 1000, {beta} => -10}….how to do this?
carloslopes has quit [Remote host closed the connection]
osvico has joined #ruby
jdripper has quit [Quit: Leaving.]
<JDubs>
Hey guys, trying to build a simple webapp
<JDubs>
require 'sinatra'
<JDubs>
get '/' do
<JDubs>
File.new('/index.html','r')
<JDubs>
end
Adget has joined #ruby
altious has quit [Ping timeout: 248 seconds]
<JDubs>
But I'm getting "undefined local variable or method `index' for #<Sinatra::Application:0x00000002292c80>"
<JDubs>
should probably switch to rails I suppose...
<havenn>
babykosh: Or if you want to sort the Hash and keep the new order: Hash[{:middle=>50, :largest=>500, :smallest=>5}.sort]
ExxKA has quit [Quit: This computer has gone to sleep]
PlaydoBear has quit [Ping timeout: 260 seconds]
joeycarm_ has joined #ruby
<C0deMaver1ck>
does anybody here have experience with Mechanize?
Godd2 has quit [Quit: Page closed]
joeycarmello has quit [Read error: Connection reset by peer]
darthdeus has joined #ruby
Vert has quit [Read error: Connection reset by peer]
<bean>
C0deMaver1ck: do you have a more specific question
apok has joined #ruby
<shevy>
hehe
<shevy>
C0deMaver1ck I used it a long time ago
<C0deMaver1ck>
yes, the problem is that the site returns a 401 status code while still displaying a login page. Mechanize will just throw an exception and die
<shevy>
then it switched to nokogiri
<shevy>
which did not work for me, so I stopped using mechanize :(
Adget has quit [Quit: Adget]
<bean>
well... 401 is "Unauthorized" so I think it's appropriate to throw an exception
pu22l3r has joined #ruby
daniel_- has quit [Ping timeout: 265 seconds]
gyre007 has quit [Remote host closed the connection]
c0rn has quit []
<C0deMaver1ck>
I do think it's appropriate but the way this web service works is stupid and so I'm having to work around it
<C0deMaver1ck>
I'm trying to find a way to force it to continue parsing the page
<C0deMaver1ck>
It seems the Perl version had an autocheck flag that you could set so it wouldn't throw Exceptions on status code errors
c0rn has joined #ruby
<C0deMaver1ck>
doesn't look like this one does
timonv has quit [Remote host closed the connection]
TitaniumStudioUs has quit [Quit: Leaving]
timmow has quit [Quit: is having a nap]
nwertman_ has joined #ruby
phelps has joined #ruby
carlyle has joined #ruby
<Xeago>
bye everyone, been stressful today :\
ebouchut has joined #ruby
<slash_nick_away>
C0deMaver1ck: can you rescue the exception?
nwertman has quit [Ping timeout: 265 seconds]
<C0deMaver1ck>
yes
headius has quit [Quit: headius]
<JDubs>
cya
DaZ has joined #ruby
<slash_nick_away>
Is that what you mean by 'having to work around it'?
cdt has quit [Ping timeout: 240 seconds]
ryanf has quit [Quit: leaving]
headius has joined #ruby
<C0deMaver1ck>
yes
c0rn has quit [Ping timeout: 244 seconds]
Bry8Star has quit [Ping timeout: 276 seconds]
freakazoid0223 has quit [Quit: Leaving]
beilabs_ has quit [Read error: Operation timed out]
<C0deMaver1ck>
havenn: yeah I had tried that a few minutes ago, undefined method
browndawg has quit [Read error: Connection reset by peer]
withnale has joined #ruby
iamjarvo has joined #ruby
<C0deMaver1ck>
I'm going to try posting directly to the url it posts the login data too
<slash_nick_away>
That's sort of expected behavior... "die early, die loud" philosophy or something. I've written some things that return a "result object" which itself accumulates exceptions...it's up to the app to call something like @result.errors.map { |e| raise e }, but I think that's frowned upon?
Nykolla has quit [Read error: Connection reset by peer]
browndawg has quit [Quit: Leaving.]
malkomalko has quit [Remote host closed the connection]
<havenn>
JDubs: Does this work?: gem install nokogiri
<C0deMaver1ck>
Xeago: ROFL
withnale has joined #ruby
<havenn>
JDubs: You may need to install some build essentials so you can compile gems: sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev
<Xeago>
neways, off
kenneth has joined #ruby
gbchaosmaster has joined #ruby
<C0deMaver1ck>
Xeago: this is so bad my eyes started bleeding
<havenn>
Xeago: Wow, l33t hax0r there. Haha.
withnale has quit [Excess Flood]
withnale has joined #ruby
withnale has quit [Remote host closed the connection]
love_color_text has quit [Remote host closed the connection]
cascalheira has quit [Quit: Leaving...]
<GlenK>
hey. so someone pointed me to a guide yesterday on how to install gems to your home directory. anyone have that handy? I follow it and I get stuff thrown into an actual directory called "$HOME".
cascalheira has joined #ruby
cj3kim has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cascalheira has quit [Client Quit]
love_color_text has joined #ruby
kil0byte has quit [Remote host closed the connection]
kil0byte has joined #ruby
<GlenK>
nevermind...I found it.
Goles has joined #ruby
cj3kim has quit [Client Quit]
jlwestsr has joined #ruby
ChampS666 has joined #ruby
<GlenK>
bah. doesn't even seem to have a way to provide feedback. nothing.
kil0byte has quit [Ping timeout: 244 seconds]
Munto has joined #ruby
squidBits has joined #ruby
DaZ has quit [Ping timeout: 246 seconds]
timonv has quit [Remote host closed the connection]
apok has quit [Remote host closed the connection]
Vainoharhainen has joined #ruby
apok has joined #ruby
Vainoharhainen has quit [Client Quit]
_nitti has joined #ruby
<pewter_tao>
rondale_sc: did you see my pastebin?
<rondale_sc>
pewter_tao: Yeah just found it.
GoGoGarrett has quit [Remote host closed the connection]
<rondale_sc>
pewter_tao: That'll run through your ruby files (or at least all files with an .rb extension), and next if it doesn't find ASCII in the regex.
<pewter_tao>
That leaves out all the importants thins I'm trying to do
samphippen has joined #ruby
vlad_starkov has quit [Ping timeout: 250 seconds]
<pewter_tao>
Can you tell why my script is stopping?
cakehero has quit [Quit: Computer has gone to sleep.]
Bry8Star has joined #ruby
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
ConvergenceRunne has joined #ruby
chrxn has quit [Ping timeout: 276 seconds]
chrxn_ is now known as chrxn
jtharris has joined #ruby
skaczor_ has joined #ruby
Bosma has quit [Quit: leaving]
keyvan has quit [Remote host closed the connection]
keyvan has joined #ruby
generalissimo has quit [Read error: No route to host]
love_color_text has quit [Ping timeout: 248 seconds]
generalissimo has joined #ruby
ryanf has quit [Quit: broken pipes |||]
maletor has joined #ruby
wedtm is now known as wedtm|away
eldariof has quit []
keyvan has quit [Remote host closed the connection]
reppard has quit [Ping timeout: 256 seconds]
dmerrick_ has joined #ruby
love_color_text has joined #ruby
dmerrick has quit [Ping timeout: 240 seconds]
AndChat| has quit [Remote host closed the connection]
cj3kim has quit [Quit: This computer has gone to sleep]
blaxter has quit [Quit: foo]
Bry8Star has quit [Remote host closed the connection]
dmerrick_ has quit [Ping timeout: 260 seconds]
Coolhand|laptop has joined #ruby
Bry8Star has joined #ruby
squidBits has quit [Quit: squidBits]
shevy has quit [Ping timeout: 260 seconds]
_nitti has quit [Ping timeout: 276 seconds]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
haxrbyte_ has joined #ruby
chussenot has joined #ruby
<bricker>
What's the least dumb way to merge three hashes? hash1.merge(hash2).merge(hash3) doesn't feel right
fred909 has quit [Ping timeout: 255 seconds]
_nitti has joined #ruby
mengu has quit [Quit: Konversation terminated!]
beilabs_ has quit [Ping timeout: 260 seconds]
haxrbyte has quit [Ping timeout: 248 seconds]
Ethan has quit [Quit: Live from Pyongyang DPRK this is...]
ryanf has joined #ruby
bwlang has left #ruby [#ruby]
havenn has quit [Ping timeout: 276 seconds]
zeen has quit [Quit: Read error: Connection reset by YOURMOM]
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
Shamgar has quit [Read error: Connection reset by peer]
omg765 has joined #ruby
undersc0re97 has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
Shamgar has joined #ruby
cakehero has joined #ruby
timonv has quit [Remote host closed the connection]
banisterfiend has joined #ruby
x82_nicole has joined #ruby
shevy has joined #ruby
rezzack has joined #ruby
epwhorl has quit [Read error: Connection timed out]
carloslopes has quit [Remote host closed the connection]
epwhorl has joined #ruby
jxf has quit [Ping timeout: 246 seconds]
jxf has joined #ruby
nomenkun has joined #ruby
cj3kim has joined #ruby
<wmoxam>
bricker: Why doesn't that feel right?
Guest73164 has quit [Quit: Guest73164]
<pewter_tao>
first part of this line isn't working right: !!file.readline(0).match(/#!.*ruby/) || File.extname(file.path) == ".rb"
<pewter_tao>
It does match .rb files, but not files with ruby in the first line
<bricker>
wmoxam: dunno, that's what I ended up doing :P
skaczor_ has quit [Remote host closed the connection]
wermel has quit [Remote host closed the connection]
jxf has quit [Ping timeout: 246 seconds]
CodeVision has joined #ruby
fred909 has joined #ruby
jriddle has joined #ruby
arturaz_ has quit [Ping timeout: 260 seconds]
Beoran_ has joined #ruby
Nykolla has joined #ruby
mjbamford has joined #ruby
malte_ has joined #ruby
jxriddle has quit [Ping timeout: 252 seconds]
statarb3 is now known as Proshot
vd0 has quit [Read error: Connection reset by peer]
altious has joined #ruby
Beoran__ has quit [Ping timeout: 252 seconds]
c0rn has quit [Quit: Computer has gone to sleep.]
jrajav has quit [Quit: I tend to be neutral about apples]
ConvergenceRunne has quit [Remote host closed the connection]
dtwwf has quit [Quit: Page closed]
vd0 has joined #ruby
love_color_text has quit [Read error: Connection reset by peer]
keyvan has joined #ruby
keyvan has joined #ruby
keyvan has quit [Changing host]
Slivka has quit [Ping timeout: 276 seconds]
banisterfiend has quit [Remote host closed the connection]
keyvan has quit [Remote host closed the connection]
ebouchut has quit [Quit: This computer has gone to sleep]
love_color_text has joined #ruby
ConvergenceRunne has joined #ruby
solidresolve has joined #ruby
phelps has joined #ruby
epwhorl has quit [Read error: Connection timed out]
havenn has joined #ruby
epwhorl has joined #ruby
DaZ has quit [Ping timeout: 246 seconds]
moshee has quit [Ping timeout: 240 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
Proshot is now known as statarb3
ryannielson has left #ruby [#ruby]
vlad_starkov has quit [Remote host closed the connection]
love_color_text has quit [Ping timeout: 265 seconds]
ferric has quit [Remote host closed the connection]
elliottcable has quit [Quit: Lost terminal]
gbchaosmaster has joined #ruby
jxriddle has joined #ruby
havenn has quit [Read error: No route to host]
jxriddle has quit [Client Quit]
Banistergalaxy has joined #ruby
sonne has quit [Ping timeout: 250 seconds]
jasonthesensei has joined #ruby
havenn has joined #ruby
<jasonthesensei>
i'm new to ruby is there away to read an html tag and create the file if it doesn't exist. Like <script type="text/javascript" src="js/app.js"> and if app.js doesn't exist in the js folder have it create a blank app.js file in the js directory?
foohey has joined #ruby
<yaymukund>
jasonthesensei: yes, but that's probably not a good idea :s
jriddle has quit [Ping timeout: 255 seconds]
<yaymukund>
jasonthesensei: but if you must, you probably want to read/parse the file, pull the name of the file, and then use FileUtils to create the file if it doesn't exist.
<yaymukund>
read/parse the *html, pull the name of the file... etc.
<jasonthesensei>
why would it be a bad idea?
umurgedik has joined #ruby
slash_nick_away has quit [Ping timeout: 264 seconds]
<pewter_tao>
yaymukund: can you do a short code review for me?
<jasonthesensei>
I was think of using it during development.
<yaymukund>
jasonthesensei: because you generally want tags to point to files that exist.
<bean>
okay, 1, what does the !! in front of the file do
<bean>
I still don't see a "file.readline(int)" method
cj3kim has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
<pewter_tao>
bean: I'm new to ruby, I thought I could have the "(file)" thing at the top, and that'd be enough
warb0 has joined #ruby
chussenot has quit [Quit: chussenot]
<pewter_tao>
bean: where's this method go?
DarthGandalf has joined #ruby
<bean>
one sec, pew
<bean>
pewter_tao:
yalue has quit [Read error: Connection reset by peer]
<bricker>
Isn't there a better way? https://gist.github.com/4271702 The problem with inheriting directly from Hash is that one of the config options is "sort"
<pewter_tao>
I tried next if !File.directory? but that didn't work
<havenn>
whitenoise: Ambiguity due to no parens? p_regex.match(ARGV[1]) && ip_regex.match(ARGV[2])
<whitenoise>
let me try that
<davidcelis>
havenn: yep that's what i just suggested
vlad_starkov has quit [Remote host closed the connection]
tvw has joined #ruby
Kruppe has joined #ruby
<havenn>
davidcelis: aha, yup :)
vd0 has joined #ruby
<whitenoise>
sweet--works like a charm now
<whitenoise>
as I understood Ruby, it did not require ()s--in what situations are they required? when you are using an operator to extend an if, as one?
BigO_ has joined #ruby
<davidcelis>
when it would otherwise be ambiguous
powerplay has joined #ruby
<pewter_tao>
bean: ideas?
workmad3 has joined #ruby
AndChat| has joined #ruby
elliottcable has joined #ruby
Banistergalaxy has quit [Ping timeout: 260 seconds]
pcarrier has joined #ruby
<pewter_tao>
bean: oh I think I needed it to be file.directory?(file)
<powerplay>
had a quick ruby question, can someone help me with the concept of "sender" of methods
daniel_- has joined #ruby
<yaymukund>
powerplay: what's your question?
<yaymukund>
I may or may not be able to help, depending on how advanced it is :p
<pewter_tao>
undefined method `match' for nil:NilClass for "!!file.readlines[0].match(/#!.*ruby/)"
<bean>
pewter_tao: File.directory?(file)
<pewter_tao>
bean: yeah figured that out... now I get ^^
<bean>
pewter_tao: that means file is nil
<powerplay>
yaymukund: if i call a method and its not inside a class wh would be consisdered the sender?
<pewter_tao>
man, so I need another check!
<rondale_sc>
powerplay: if you aren't inside a class or any other containing body send should be 'main'
<rondale_sc>
powerplay: I think
<rondale_sc>
powerplay: sender should be*
g_bleezy_ has quit [Remote host closed the connection]
<powerplay>
rondale_sc: so the "main" object is the sender right? just wanted to double check
<bean>
pewter_tao: no, it means somehow you called ruby_file?(file) where file isn't actually anything
<bean>
or is a dir
NobbZ is now known as NobbZ|ZZzz
<powerplay>
rondale_sc: thank you for your help
rbennacer has joined #ruby
<rondale_sc>
powerplay: np
<pewter_tao>
bean: File.directory?(file) should take care of if it's a dir
<pewter_tao>
bean: "isn't actually anything" means the file doesn't have a first line, right?
<bean>
pewter_tao: paste your code again
<rbennacer>
hello, i am trying to run a regex on a large file (20G) but i can't load it into my memory, how should i deal with this problem
<yaymukund>
aces1up: that's pretty much as simple as it gets, I think. if you want to make the objects smarter, you could implement an api like: self.timers.execute!
powerplay has left #ruby [#ruby]
banisterfiend has joined #ruby
alex__c2022_ has quit [Ping timeout: 240 seconds]
<yaymukund>
but it would basically do the same thing your code does
undersc0re97 has quit [Quit: Live from Pyongyang DPRK this is...]
<pewter_tao>
havenn: what did you changed?
<pewter_tao>
change*
[Neurotic] has joined #ruby
<havenn>
pewter_tao: Line 10
pu22l3r has quit [Remote host closed the connection]
bwlang has joined #ruby
<pewter_tao>
havenn: it does the same thing
pu22l3r has joined #ruby
<havenn>
pewter_tao: And added sane indentation and syntax highlighting for sake of eyes! Doesn't put hard return in where looks like one not intended.
cdt has quit [Ping timeout: 260 seconds]
<havenn>
pewter_tao: Or was the system \n intended?
danshultz has joined #ruby
<aces1up>
yaymukund but that isn't correct right?
<aces1up>
yaymukund the way i have it now?
<aces1up>
it might delete the wrong timer?
danshultz has quit [Remote host closed the connection]
Slivka has quit [Read error: Connection reset by peer]
elico has quit [Quit: Elico]
Slivka has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
<pewter_tao>
I get `match': invalid byte sequence in US-ASCII (ArgumentError) now
Slivka has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
<pewter_tao>
after it hits some unknown file
daniel_hinojosa has quit [Read error: Connection reset by peer]
mark_locklear has quit [Remote host closed the connection]
<rbennacer>
atmosx, any other ideas?
<pewter_tao>
bean: ^ideas?
<yaymukund>
aces1up: huh? as long as you're guaranteeing that timers_to_fire is a subset of @timers, I don't see how it could fail?
Morkel has quit [Quit: Morkel]
alex__c2022 has joined #ruby
<bean>
sry, was working pewter_tao
<bean>
pewter_tao: No, you need to determine if a file is empty, not use some ASCII regex
pu22l3r has quit [Ping timeout: 244 seconds]
<bean>
pewter_tao: File.zero?(file)
itchyouch has joined #ruby
<pewter_tao>
I don't think that's the problem, I'm getting some invalid byte sequence error
<pewter_tao>
but I'll try that
sailias has quit [Quit: Leaving.]
<bean>
pewter_tao: change your regex back to how it was
<pewter_tao>
bean: yep I get: undefined method `match' for nil:NilClass, if it hits a zero file, but I get match': invalid byte sequence in US-ASCII (ArgumentError) if it hits a non-ascii file
Schmidt has joined #ruby
havenn has left #ruby ["Leaving..."]
<pewter_tao>
so I need some sort of ascii regex
<bean>
hmm ok
vlad_starkov has joined #ruby
freakazoid0223 has quit [Quit: Leaving]
spanner has quit [Remote host closed the connection]
jtharris has quit [Quit: WeeChat 0.3.9.2]
<pewter_tao>
bean: how would I do that? I wanna use the file cmd for obvious reasons: `file "#{not sure what goes here}"`[/ASCII/]
<bean>
pewter_tao: File.open("Install OS X Mountain Lion").read.encoding
seich is now known as Seich
spanner has joined #ruby
<bean>
err, file, instead of that string
<bean>
I was testing it on that file lol
<pewter_tao>
hehe
undersc0re97 has joined #ruby
mercwithamouth has joined #ruby
<bean>
pewter_tao: except I don't think that works :) cuz it says an executable is utf8
<pewter_tao>
where do I put that?
<pewter_tao>
can we use the file cmd and search for"ASCII"?
zastern has joined #ruby
<bean>
uh sure
<bean>
one sec
<zastern>
So, in the ruby documentation for the File class, these methods(?) are described twice, with the same source code, but different functionality. I'm confused. Anybody know what's up? http://cl.ly/image/3F3X3l1K1j07
spanner has quit [Read error: Connection reset by peer]
<pewter_tao>
bean: I thought
<pewter_tao>
!!`file "#{fn}"`[/ASCII/] would do it
<ddd>
I'm running a CLI application under JRuby 1.7.1. I've set the YAML parsing engine to 'psych' with ::YAML::ENGINE.yamler = 'psych'. I've edited my db/database.yml to use eRB to define which adapter to use depending on if its run under MRI or JRuby, but the eRB isnt being processed. https://github.com/ddd/dtf/blob/master/db/config.yml Would someone take a look and see if I've goofed something?
<bean>
pewter_tao: it should
<pewter_tao>
bean: I mean it does, but I'm not sure how to inject it into my code
<bean>
oh, i'd make a function that you pass the filename or file into.
atal421 has quit [Ping timeout: 248 seconds]
havenn has joined #ruby
<ddd>
the sqlite3 adapter selection works fine, and depending on RUBY_PLATFORM the correct gems are selected, installed, and used. Its when it tries to parse the erb in the database.yml that it pukes. It *should* be parsing it but its not. It sees the erb as if its straight text.
jlwestsr has joined #ruby
<pewter_tao>
bean: this isn't working: next if file.binmode? || File.directory?(file) || File.zero?(file) || !!`file "#{file_name}"`[/ASCII/] || !ruby_file?(file) # || !bash_file?(file)
thams has quit [Quit: thams]
<bean>
pewter_tao: can you paste that to pastebin again
<bean>
w/ those changes
Kuifje has quit [Ping timeout: 265 seconds]
squidBits has quit [Ping timeout: 255 seconds]
vlad_starkov has quit [Ping timeout: 250 seconds]
<pewter_tao>
think, I fixed it, but it may be logically wrong, I used one '!' instead of '!!'
_nitti has quit [Remote host closed the connection]
ejholmes has quit [Quit: ejholmes]
ejholmes has joined #ruby
jhunter has quit [Ping timeout: 244 seconds]
nomenkun has quit [Ping timeout: 248 seconds]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
BigO_ has quit [Remote host closed the connection]
rondale_sc has joined #ruby
LouisGB has quit [Ping timeout: 252 seconds]
rondale_sc has quit [Remote host closed the connection]
freakazoid0223 has joined #ruby
JodaZ has quit [Remote host closed the connection]
JodaZ has joined #ruby
pwelch_ has joined #ruby
Mon_Ouie has quit [Ping timeout: 260 seconds]
phantasm66 has quit [Quit: *sleeeep….]
pwelch_ has quit [Client Quit]
hukl has quit [Quit: Leaving...]
alex__c2022 has quit [Remote host closed the connection]
emergion has joined #ruby
alex__c2022 has joined #ruby
BigO_ has joined #ruby
BigO_ has quit [Remote host closed the connection]
sailias has joined #ruby
pwelch has quit [Ping timeout: 276 seconds]
burgestrand has joined #ruby
emergion has quit [Ping timeout: 244 seconds]
<JDubs>
bean: what you workin on
gyre007 has joined #ruby
kirun has quit [Quit: Client exiting]
atal421 has quit [Quit: atal421]
seanyo has joined #ruby
love_color_text has joined #ruby
<JDubs>
ugh...i hate when my eueler programs run forever...
samphippen has joined #ruby
d2dchat has quit [Remote host closed the connection]
<havenn>
JDubs: Which Euler # are you on?
love_color_text has quit [Remote host closed the connection]
reppard has joined #ruby
reppard_ has joined #ruby
<JDubs>
12
JodaZ has quit [Remote host closed the connection]
<JDubs>
What's a method that will find the first true and return it enumerable?
GoGoGarrett has quit [Remote host closed the connection]
<JDubs>
find?
squidBits has quit [Quit: squidBits]
mneorr has quit [Remote host closed the connection]
cableray has joined #ruby
Vert has quit [Read error: Connection reset by peer]
<havenn>
JDubs: Yup.
<havenn>
JDubs: [*1..10].find { |x| x > 7 } #=> 8
jonahR has quit [Quit: jonahR]
danneu has quit [Quit: WeeChat 0.3.8]
pkeni has quit [Changing host]
pkeni has joined #ruby
seanyo has quit [Ping timeout: 256 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
<JDubs>
hey guys, I think i figured out a neato method to reduce runtime on some recursive functions
<JDubs>
tell me what you think
elico has joined #ruby
<JDubs>
oops
<JDubs>
let me fix somethin sec
maletor has joined #ruby
<apeiros_>
a
seanyo has joined #ruby
<apeiros_>
nav
<apeiros_>
gah
<apeiros_>
ga
<JDubs>
apeiros_ what?
<apeiros_>
lol, I fail at typing
nari has joined #ruby
<apeiros_>
havenn: no need for the [*] there, (1..10).find is sufficient
cascalheira has joined #ruby
cascalheira has quit [Client Quit]
punkrawkR has quit [Read error: Connection reset by peer]
alex__c2022 has quit [Quit: alex__c2022]
cascalheira has joined #ruby
<havenn>
apeiros_: Good point, I was just thinking of an array for some reason - does make example easier to read!
cascalheira has quit [Client Quit]
seanyo_ has joined #ruby
cascalheira has joined #ruby
havenn has quit [Remote host closed the connection]
samuel02 has quit [Remote host closed the connection]
blacktulip has quit [Remote host closed the connection]
cantonic has joined #ruby
seanyo has quit [Ping timeout: 252 seconds]
<JDubs>
what's the best way to count to infinite?
sepp2k1 has quit [Remote host closed the connection]
<JDubs>
if i want to search infinite numbers until my find works
<JDubs>
without doing until
<JDubs>
apeiros_ any idea bromo?
malte_ has quit [Quit: malte_]
<kenneth>
range to infinity
slainer68 has joined #ruby
<JDubs>
how do you make a range go to infinite?
reppard_ has quit [Ping timeout: 248 seconds]
generali_ has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
reppard has quit [Ping timeout: 276 seconds]
<kenneth>
(1..1.0/0.0)
<kenneth>
it's a little weird
DrShoggoth has quit [Quit: Leaving]
<kenneth>
but in ruby if you divide a float by zero you get infinity
<kenneth>
if you do it to an int though you get an exception
<JDubs>
i see
Guest___ has joined #ruby
banister_ has quit [Ping timeout: 244 seconds]
alanp has quit [Ping timeout: 240 seconds]
ejholmes has quit [Quit: ejholmes]
<JDubs>
apeiros_ make my solutions run faster :'(
<pewter_tao>
http://pastebin.com/diff.php?i=YcYeLjBy this ends up doing ruby checks on bash files and bash checks on ruby files... How do I keep the defs separate?
andrewhl has quit [Remote host closed the connection]
<pewter_tao>
I thought having separate defs for bash and ruby would do it, but I need some extra logic
LouisGB has joined #ruby
evilsushi has quit [Quit: Lost terminal]
joshman_ has quit [Quit: Computer has gone to sleep.]
<foucist>
JDubs: :P
seanyo_ has quit [Remote host closed the connection]
<foucist>
but it's easier to fork and show how you modified versions and so on
<foucist>
and other people can fork it and you can follow what they changed etc
havenn has joined #ruby
theRoUS_ has quit [Ping timeout: 265 seconds]
jeekl has joined #ruby
<foucist>
pastebin ain't loading for me.. weird
Guest___ is now known as dweeb
epwhorl has joined #ruby
idzuna has joined #ruby
<pewter_tao>
havenn: you around?
<ner0x>
Is it possible to split by multiple things?
catphish has joined #ruby
<havenn>
pewter_tao: Hey, yup.
<ner0x>
Say /:;-\//
<pewter_tao>
ah ok, http://pastebin.com/diff.php?i=YcYeLjBy this ends up doing ruby checks on bash files and bash checks on ruby files... How do I keep the defs separate?
<pewter_tao>
havenn: make sense?
mjolk2 has quit [Quit: Leaving]
ChampS666 has quit [Ping timeout: 265 seconds]
<dweeb>
ner0x: why don't you try?
<havenn>
pewter_tao: Sec phone, will look in a min. :)
undersc0re97 has quit [Quit: Live from Pyongyang DPRK this is...]
<ner0x>
dweeb: I wouldn't ask here if I didn't :)
<ner0x>
dweeb: And I asked to see if there were some sort of tips/tricks to it.
<kenneth>
hey
<kenneth>
can you make an object be falsy in ruby?
ikaros has quit [Quit: Ex-Chat]
osvico has joined #ruby
<JDubs>
Apeiros_ is there something like .find but for a num? to match a block to the num? and if block(using num) matches it returns the num?
nga4 has joined #ruby
SCommette has quit [Quit: SCommette]
<catphish>
kenneth: afaik you can't
<foucist>
JDubs: isn't it gonna run forever if the range is to infinity btw?
<JDubs>
foucist: should run till the .find passes I think?
<ddd>
JDubs: 18.5y
<foucist>
JDubs: ah right
<JDubs>
that's pretty close to 20, you get medical ?
atal421 has joined #ruby
<ddd>
spread across 22y. I took some time off during that time
<ddd>
yeah
<ddd>
out on 80% SC
<JDubs>
Hope you didn't lose any limbs :/
<ddd>
no. 4 discs, both knees shot, nerve damage, migraines
<ddd>
gimme a few. gotta make a jruby+rspec stack trace for this
jxf has quit [Ping timeout: 260 seconds]
fir_ed has joined #ruby
<JDubs>
kk
rondale_sc has joined #ruby
<ddd>
ok, actually, i'm running rspec ——backtrace spec but I also need as much additional info as I can from the underlying ruby as well. anyone know how to turn on verbosity with the underlying ruby just for that run?
JodaZ has quit [Remote host closed the connection]
rondale_sc has left #ruby [#ruby]
kpshek has joined #ruby
rondale_sc has joined #ruby
<havenn>
pewter_tao: Link isn't working for me. Can you Gist it?
catphish has left #ruby ["Leaving"]
ejholmes has joined #ruby
<lectrick>
!(A and B) == !A or !B .. What is that called?
<pewter_tao>
havenn: I realized that the logic wasn't kept separate, I'm not sure how to separate it out. Right now ruby is run on bash files and bash on ruby....
foohey has quit [Read error: Connection reset by peer]
<blazes816>
lectrick: demorgan's law?
mercwithamouth has joined #ruby
kpshek has quit []
robotmay has joined #ruby
<pewter_tao>
havenn: make sense?
<havenn>
pewter_tao: Ah, kk. Yup, makes sense. Sec.
Guest___ has joined #ruby
banisterfiend has joined #ruby
Guest___ is now known as dweeb
<apeiros_>
JDubs: hu? find works for anything, that's why you've got a block
<apeiros_>
or can you make a concrete example?
ner0x has quit [Quit: Leaving]
willob has quit [Quit: Leaving.]
Nisstyre has quit [Ping timeout: 244 seconds]
razibog has joined #ruby
williamcotton has quit [Quit: williamcotton]
<kenneth>
is there a way to break out of a map?
<kenneth>
say i have
Averna has quit [Quit: Leaving.]
<gbchaosmaster>
kenneth: Mhm, use break.
<kenneth>
what will that do in a map block?
<kenneth>
that'll return the list of mapped elements up till that point?
hakunin has quit [Read error: Connection reset by peer]
<pewter_tao>
havenn: now it doesn't find any files :X
<JDubs>
havenn: i've been waiting for my answer to 500 to pop out for over half an hour :/
<havenn>
JDubs: hehe
<JDubs>
havenn: can you help me figure out why my code is so sluggish so i can get my answer? lol
DaZ has joined #ruby
[D]rammer has joined #ruby
<havenn>
JDubs: Name the file with an '.rb' so it looks pretty!
<aces1up>
hey all i have a timer class i built, i'm not quite sure if its having thread lock issues, could someone take a look at and see if there are any issues they can see?
<rismoney>
blazes816...not sure i fully understand... i have a def prompt (name) ; puts "what {#name}" ; then i want to add a var_name = gets.chomp
<JDubs>
havenn: there :P
<bricker>
JDubs: Did you try just running "factor" without the loop? Look.... 1_000_000.factor.size #=> 49. And the higher the number gets, the longer it will take to run, because it has to go through every single number between 2 and self/2
<blazes816>
rismoney: where does the name of the var come from?
<bricker>
JDubs: 1_000_000_000.factor.size is only 100
nat2610 has left #ruby [#ruby]
brianpWins has quit [Quit: brianpWins]
<JDubs>
bricker: so how do I make the code more efficient?
reppard has joined #ruby
reppard_ has joined #ruby
<rismoney>
I want to create it from "name" string i pass to the def
C0deMaver1ck has quit [Remote host closed the connection]
rellin has joined #ruby
jjbohn has quit [Quit: Leaving...]
<pewter_tao>
havenn: I need to have it using the logic that I defined for bash and ruby up top