mariozaizar has quit [Remote host closed the connection]
pantomime_cheap has quit [Quit: Leaving]
pantomime_cheap has joined #ruby
Takehiro has joined #ruby
SegFaultAX|work has quit [Ping timeout: 246 seconds]
dmerrick has quit [Quit: dmerrick]
<swarley>
i think when I code the actual interface for getting the values, I'm going to allow for ranges and stuff for value matching
<swarley>
yeah, that's a neat convenience function
cbuxton1 has quit [Ping timeout: 248 seconds]
<swarley>
I was thinking the following as the syntax (comments welcome)
<swarley>
xml["p", :class => /(hello|world)/, :some_other_attribute => "exactly this", :enumerable_attr => 1..19] # This syntax for immediate level selection, the first argument "p" being the tag name, and the hash being specifiers
<swarley>
xml%["p", :class => /(hello|world)/, :some_other_attribute => "exactly this", :enumerable_attr => 1..19] # Simulates the same syntax, but effectively does the same as */ in xpath, allowing multilevel searching in the xml
<swarley>
notice the % is the real method in there
<dpatel>
when i'm calling samplehash.except(:id).each_page do |key,value|, key is returned as a string which causes the except function to return id, is there another way to make it work rather than putting "id" in the except call, as I'm planning on using an array of values to exclude
c0rn_ has quit [Quit: Computer has gone to sleep.]
Vert has quit [Remote host closed the connection]
<Spooner>
arietis : Ask google "ruby zip gem" - not hard.
judd7 has quit [Client Quit]
yshh has joined #ruby
cinsk has joined #ruby
mrsolo has quit [Quit: Leaving]
bapa has joined #ruby
<Spooner>
Oops not gem, stdlib module. *looks silly*
<swarley>
but yeah Spooner, should calling the [] method on a Suwarui::XML::Document return a ruby structure with the hierarchy, or should it be a class that can use the same [] method
maletor has quit [Quit: Computer has gone to sleep.]
STyler has quit [Quit: STyler]
<Spooner>
jamesaxl : Well, ffi is relatively easy. You could wrap i tin a c-extension manually or with something like rice or swig. The options are many...
<arietis>
Spooner: there are no such module in stdlib -.-
yshh has quit [Remote host closed the connection]
mando has joined #ruby
alan_ has joined #ruby
<Spooner>
arietis : No, swarley said that zlib is the stdlib one. I suggested there were also several gems that supported zipping.
alan_ is now known as Guest10729
Takehiro has quit [Remote host closed the connection]
cableray has joined #ruby
<arietis>
Spooner: ah, well, rubyzip seems to be the one i need :)
mikepack has quit [Remote host closed the connection]
jeffreybaird has joined #ruby
<arietis>
i just don't get why it's imported as zip/zip
Guest10729 has quit [Client Quit]
brianpWins has joined #ruby
Averna has joined #ruby
maletor has joined #ruby
Averna has quit [Max SendQ exceeded]
love_color_text has quit [Remote host closed the connection]
busybox42 has joined #ruby
<Spooner>
swarley : No reason you can't return something that can both be an enumerator and offer [] (since this this case, [] is effectively like select, not index).
love_color_text has joined #ruby
<Spooner>
*since in this case
Averna has joined #ruby
Takehiro has joined #ruby
<jamesaxl>
Spooner, thanks
shadoi has quit [Quit: Leaving.]
<Spooner>
arietis : Because it is. You are right, though, it does seem unnecessary to have zip/zip.
chrishunt has quit [Ping timeout: 252 seconds]
M- has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
cakehero has quit [Quit: Computer has gone to sleep.]
arubin has joined #ruby
busybox42 has quit [Client Quit]
Takehiro has quit [Remote host closed the connection]
<swarley>
well, [] is effectively 2 methods, and then it is a third when it goes to a element collection
<Spooner>
jamesaxl I think you'd make a lot of people happy if you made a nice wrapper around the current gtk. We don't have any up-to-date GUI libraries to my knowledge.
freeayu has joined #ruby
pskosinski has quit [Quit: A few unofficial Red Eclipse 1.3.1 (r4131) servers: http://altred.tk/toggle.rb]
vlad_starkov has quit [Remote host closed the connection]
LouisGB has quit [Ping timeout: 245 seconds]
<Spooner>
jamesaxl : Unless you are prepared to accept Rails as a frontend to a desktop app :D
r1ddl3r has quit [Ping timeout: 245 seconds]
busybox42 has joined #ruby
<Spooner>
swarley : Hmm, I think making #[] into a lazy enumerator would work fine. You can always to_a if you just want an array out of it.
chrishunt has joined #ruby
savage- has quit [Remote host closed the connection]
<swarley>
hm, i suppose so
<arietis>
i get OpenSSL::PKCS12::PKCS12Error: PKCS12_parse: mac verify failure
<arietis>
does it means i'm using wrong passphrase?
Tearan has quit [Quit: Sleepy Badger....]
eldariof-office has joined #ruby
miphe has quit [Quit: Leaving]
<Spooner>
swarley : In fact, xml%["p", :class => /(hello|world)/, :some_other_attribute => "exactly this", :enumerable_attr => 1..19] => xml[:p].class(/(hello|world)/).enumerable_attr(1..19) feels even more rubyish ;)
Guedes0 has joined #ruby
nitti has joined #ruby
Michael_ has quit [Remote host closed the connection]
r1ddl3r has joined #ruby
djorr is now known as himsin
himsin has quit [Quit: Leaving]
yshh has joined #ruby
<swarley>
the only thing i don't like about the second one is that it would require a very very large amount of methods created dynamically
<swarley>
especially if you're dealing with a large HTML file
<Spooner>
But I have to reiterate, that whatever the API, I am not sure why you can't just wrap an existing lib with a nice API.
Michael_ has joined #ruby
<swarley>
Because I'm difficult
<Spooner>
swarley : Sorry, why a lot o methods?
<swarley>
and have to much time
<arietis>
oh, it's cause i need binary mode
eldariof has quit [Ping timeout: 246 seconds]
<Spooner>
I have too much time, too, but I get nothing done. And when I do, it never works and then I give up.
<swarley>
Spooner; because if you are going to do a .method for every xml attribute in a tag, the methods you'll have in each tag will pile up quickly
kc8tpz has joined #ruby
<swarley>
especially if someone goes event attribute happy
<swarley>
I suppose it could be evaluated dynamically with method_missing though
<swarley>
But that's still heavy with meta programming
chin-tastic has quit [Ping timeout: 245 seconds]
<Spooner>
I didn't suggest that. How your elements work isn't really anything to do with how the searching is done, does it?
nitti has quit [Ping timeout: 260 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<swarley>
Well, an element is going to be a glorified Struct
<Spooner>
As I have stated before, though, I haven't spent any real time with XML pathsearching, so maybe I'm missing key things.
<swarley>
Well when i say :class
<swarley>
that's an example of an attribute
<Spooner>
swarley : Yep.
<swarley>
<xml attr="hi"
<swarley>
invalid xml i know blah blah blah
bradhe has quit [Remote host closed the connection]
<swarley>
but if its random XML, it can have any number of attributes
bricker has quit [Read error: Operation timed out]
mahmoudimus has joined #ruby
pantomime_cheap has quit [Quit: Leaving]
pantomime_cheap has joined #ruby
<Spooner>
Oh, I see. Yes, #class doesn't make sense does it, since class is just an attribute. xml[:p].with_attribute(:class => /me|he/) makes more sense then, I suppose.
<swarley>
Yeah
<Spooner>
Though I can see class and id being special cases with shortcuts.
<swarley>
That would make sense
<jamesaxl>
Spooner, i'm going to do my best :)
<Spooner>
Ack, now it looks like Rails 3 ;)
<swarley>
The reason i like the hash style, is because it integrates well with HAML syntax
<jamesaxl>
Spooner, i'll mange god willing, it is god to make people happy
<Spooner>
swarley : Yeah, I prefer slim, but there you go (body id = "this_id" class = "the_class")
eldariof has joined #ruby
adurity has quit [Remote host closed the connection]
eldariof-office has quit [Ping timeout: 260 seconds]
<Spooner>
Oh, actually, I don't think you can put spaces around the = in slim.
mmitchell has joined #ruby
<Spooner>
But my suggested syntax still uses a hash.
<swarley>
well, either way. It looks more natural to use the "smart" syntax
<swarley>
After i finish the parser I can do more work with the interface
ddd has quit [Quit: Leaving.]
ddd has joined #ruby
_bry4n has joined #ruby
Banistergalaxy has quit [Ping timeout: 260 seconds]
ddd has left #ruby [#ruby]
ddd has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9]
jeffreybaird has quit [Quit: jeffreybaird]
<swarley>
does anyone know off hand if <xml attr = "value"> is value?
<swarley>
errrr
<swarley>
valid*
reuf_ has joined #ruby
kc8tpz has quit [Quit: Leaving]
reuf has quit [Quit: Leaving]
reuf_ has quit [Read error: Connection reset by peer]
dpatel has quit [Quit: dpatel]
jenrzzz has quit [Ping timeout: 245 seconds]
<swarley>
Woo, two syntax characters down..
<swarley>
lots more to go
Hunner_ has joined #ruby
Hunner_ has quit [Changing host]
Hunner_ has joined #ruby
Spooner has quit [Read error: Connection reset by peer]
x82_nicole has joined #ruby
cout is now known as KALP
spathi has joined #ruby
chrishunt has quit [*.net *.split]
crates has quit [*.net *.split]
freeayu has quit [*.net *.split]
ckrailo has quit [*.net *.split]
Axsuul has quit [*.net *.split]
adeponte has quit [*.net *.split]
jgrevich has quit [*.net *.split]
jbw has quit [*.net *.split]
wmoxam has quit [*.net *.split]
take_cheeze has quit [*.net *.split]
LucidDreamZzZ has quit [*.net *.split]
wargasm has quit [*.net *.split]
TheNumb has quit [*.net *.split]
kapowaz has quit [*.net *.split]
malcolmva has quit [*.net *.split]
babinho has quit [*.net *.split]
combatai` has quit [*.net *.split]
manouche has quit [*.net *.split]
jrist-afk has quit [*.net *.split]
spathi_ has quit [*.net *.split]
gurps has quit [*.net *.split]
anekos has quit [*.net *.split]
David_Miller has quit [*.net *.split]
jayne has quit [*.net *.split]
Hunner has quit [*.net *.split]
juha_ has quit [*.net *.split]
tessi has quit [*.net *.split]
lahwran has quit [*.net *.split]
_root_ has quit [*.net *.split]
drags has quit [*.net *.split]
elektronaut has quit [*.net *.split]
Spooner has joined #ruby
freeayu has joined #ruby
crates has joined #ruby
Axsuul has joined #ruby
wmoxam has joined #ruby
jgrevich has joined #ruby
jbw has joined #ruby
LucidDreamZzZ has joined #ruby
ckrailo has joined #ruby
take_cheeze has joined #ruby
wargasm has joined #ruby
kapowaz has joined #ruby
TheNumb has joined #ruby
malcolmva has joined #ruby
manouche has joined #ruby
combatai` has joined #ruby
babinho has joined #ruby
jrist-afk has joined #ruby
anekos has joined #ruby
gurps has joined #ruby
David_Miller has joined #ruby
jayne has joined #ruby
lahwran has joined #ruby
drags has joined #ruby
tessi has joined #ruby
juha_ has joined #ruby
_root_ has joined #ruby
elektronaut has joined #ruby
crates has quit [Max SendQ exceeded]
josh^ has quit [Excess Flood]
[Neurotic] has quit [Excess Flood]
lushious has quit [Ping timeout: 252 seconds]
sepp2k has joined #ruby
pantomime_cheap has quit [Quit: Leaving]
pantomime_cheap has joined #ruby
lushious has joined #ruby
josh^ has joined #ruby
[Neurotic] has joined #ruby
Hunner_ is now known as Hunner
gkwhc has joined #ruby
crates has joined #ruby
Michael_ has quit [Remote host closed the connection]
chimkan_ has joined #ruby
joeycarmello has joined #ruby
jenrzzz has joined #ruby
<gkwhc>
Hi, im trying to install a gem called pg. However it complains of lack of necessary libraries/headers. Any ideas? (i know i encountered this when install gem for mysql..i had to install mysql first then install the gem)
Banistergalaxy has joined #ruby
<sent-hil>
gkwhc: is that postgresql
Goles has joined #ruby
lewis has quit [Read error: Connection reset by peer]
lewis has joined #ruby
chrisramon has quit [Quit: chrisramon]
hotovson has quit [Remote host closed the connection]
<gkwhc>
sent-hil: ah yes! however there seems to be many postgresql packages...like dovecot, mysql, qt, etc...i am a bit confused
lledet has joined #ruby
A124 has quit [Read error: Connection reset by peer]
nga4 has joined #ruby
chimkan_ has left #ruby [#ruby]
xorgnak has joined #ruby
tvw has quit [Remote host closed the connection]
xaq has quit [Remote host closed the connection]
ddd has quit [Quit: Leaving.]
ddd has joined #ruby
jasond has quit [Ping timeout: 246 seconds]
Banistergalaxy has quit [Ping timeout: 264 seconds]
pantomime_cheap has quit [Quit: Leaving]
pantomime_cheap has joined #ruby
sent-hil has quit [Remote host closed the connection]
chin-tastic has joined #ruby
xorgnak has quit [Remote host closed the connection]
ddd has left #ruby [#ruby]
ddd has joined #ruby
eldariof-office has joined #ruby
xorgnak has joined #ruby
Trioke has quit [Ping timeout: 252 seconds]
busybox42 has left #ruby [#ruby]
chrisramon has joined #ruby
sent-hil has joined #ruby
tomzx_ has quit [Ping timeout: 260 seconds]
eph3meral has joined #ruby
Takehiro has joined #ruby
eldariof has quit [Ping timeout: 260 seconds]
busybox42 has joined #ruby
fatninja has quit [Read error: Operation timed out]
fatninja has joined #ruby
miso1337 has joined #ruby
Banistergalaxy has joined #ruby
rabidpraxis has joined #ruby
joeycarmello has quit [Remote host closed the connection]
jarred has quit [Quit: jarred]
rabidpraxis has quit [Ping timeout: 255 seconds]
nari has joined #ruby
mmitchell has quit [Remote host closed the connection]
pantomime_cheap has quit [Quit: Leaving]
pantomime_cheap has joined #ruby
sent-hil has quit [Remote host closed the connection]
wwoodrum has joined #ruby
<wwoodrum>
spoooonnnerrr are you up?
sn0wb1rd has joined #ruby
swarley has quit [Read error: Operation timed out]
miso1337 has quit [Ping timeout: 264 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
<ddd>
he's whispering softly in the wind
<wwoodrum>
well thats okay i gues
<wwoodrum>
i need help with fibonacci again. I called out my professor and he changed the requirements lol
ttt has joined #ruby
chrishunt has joined #ruby
miso1337 has joined #ruby
hbpoison has joined #ruby
Banistergalaxy has quit [Ping timeout: 264 seconds]
skaczor has quit [Read error: Operation timed out]
<wwoodrum>
hold that thought dog needs outside
medik- has quit [Quit: Leaving]
cbuxton has joined #ruby
swarley has joined #ruby
<swarley>
oh yeah, i'm writing this library because its going to be the best library ever and everyone and their mother is going to use it and i'll get all the money and the wimminz
jlwestsr has quit [Quit: Ex-Chat]
kramutils has quit [Read error: Connection reset by peer]
Banistergalaxy has joined #ruby
<Spooner>
swarley : I had wondered :D
<swarley>
well now you know
xaq has joined #ruby
<swarley>
it has nothing to do with me having two half days in a row
<swarley>
nothing at all
rabidpraxis has joined #ruby
<swarley>
I'm halfway afraid to put this on github
<Spooner>
Because it would make all the other projects look a bit flat?
r1ddl3r has quit [Quit: Leaving.]
jrajav has joined #ruby
<swarley>
because, nenolod doesnt like me, at least, the last time he was around and a CIA bot announced a project i was working on i was begged never to program again
<swarley>
so, i can only imagine what this would incur
<swarley>
I should make a wrapper like this for SQLite as well
<Spooner>
Why do that? Why not develop your own DB while you are on a roll? ;)
<swarley>
xD
<swarley>
because i have no idea how :p
<swarley>
Never considered DB theory
Banistergalaxy has quit [Ping timeout: 264 seconds]
<wwoodrum>
ok back. hey spooner :)
<Spooner>
Hey wwoodrum! School getting you down?
<wwoodrum>
so what i have a question about is.. now the professor wants to enter an integer to STOP the fibonacci
<wwoodrum>
for ex. when he types 21. he wants 0 1 1 3 5 8 13 21
<wwoodrum>
yeh alittle bit. jsut confusing professor
<Spooner>
That is fine and easy with your code, if I remember.
<swarley>
well, about 6 seconds in i think, well its just not going to work
<swarley>
i start to move my mouse
<swarley>
Surprise!
<swarley>
mouse doesnt move
<Spooner>
Yeah, it just super-exponentialises ;)
<swarley>
So i enter tty1
<swarley>
start typing as fast as i can
<swarley>
my computer heating up *fast*
<Spooner>
Ha!
busybox42 has quit [Quit: leaving]
<swarley>
login, and kill -9 ghc and get an acpi reading just in time to see 212 degrees F
busybox42 has joined #ruby
Guest77727 is now known as karstensrage
<swarley>
moral of the story
<swarley>
don't fuck with something that you know is already a bad idea
busybox42 has quit [Client Quit]
<Spooner>
I'm surprised it was that bad.
justinmcp has joined #ruby
busybox42 has joined #ruby
gabrielrotbart has quit [Remote host closed the connection]
<swarley>
So am I to be honest
<swarley>
Probably because of the concurrency
<swarley>
and wanting to do everything at once
<swarley>
what was I doing? right, xml library
<Spooner>
Hmm, "fib_rec(40) involves c(40) = 331,160,281 calls to the fib_rec" - I guess that would grind a little ;)
<jrajav>
swarley: Other moral of the story: You need WAY better power management
<swarley>
jrajav; other moral of the story is that i should never get an AMD again
<jrajav>
Haha yes.
manizzle_ has quit [Ping timeout: 255 seconds]
<swarley>
i swear, i regret that decision every day
<swarley>
I'm always like, i should have gotten an i3 for $50 more
busybox42 has quit [Client Quit]
r1ddl3r has joined #ruby
<jrajav>
Intel, Nvidia, and Asus
<jrajav>
Never disrespect the Holy Trinity
gmurphey has joined #ruby
<swarley>
yeah i have the anti christ
<swarley>
ATI, AMD, HP
busybox42 has joined #ruby
<jrajav>
Holy crap dude
<swarley>
yeah, its all sorts of fucked up
<swarley>
i hate my computer
<jrajav>
Like'
<jrajav>
That was my honest reaction
<jrajav>
lol
<swarley>
lol
<jrajav>
How on earth
<jrajav>
Did you land that
voodoofish430 has quit [Quit: Leaving.]
gabrielrotbart has joined #ruby
<swarley>
My dad got it for me
<swarley>
he thinks he knows more about computers than i do
<swarley>
so... he took the liberty to pick it out
<jrajav>
You need to sit him down
<jrajav>
And give him a heart-to-heart
<jrajav>
About the... bits and the b-trees
<jrajav>
I guess
<swarley>
I want, an ASUS/Dell i5 with a good NVidia
<Spooner>
wwoodrum : Getting anywhere?
<swarley>
the american dream
miso1337_ has joined #ruby
<jrajav>
Dell? Dude you don't need more than Asus
<wwoodrum>
closer to suicide
<jrajav>
And a box with roughly six sides
<swarley>
Yeah, Dell is a bucket dream
<jrajav>
And holes to screw stuff in
<swarley>
jrajav; well i'm thankful for this piece of shit laptop
<swarley>
because
<swarley>
the only other computer i have
<swarley>
and prepare yourself
<jrajav>
emachines?
<wwoodrum>
ice tried looping until... then i just end up with endless loops :/
<swarley>
1998 PII HP i dont even know the model, 6GB hdd, 128mb RAM and 2 USB ports
<swarley>
i've been compiling my gentoo kernel on it for 5 days now
miso1337 has quit [Ping timeout: 246 seconds]
miso1337_ is now known as miso1337
<jrajav>
Well that's at least got some kind of retro kitsch to it
<swarley>
waiting for the modules to finish
<swarley>
The thing is
<swarley>
its not even a nice retro computer
<swarley>
its a shitty one
<swarley>
the CD drive protector is held on by tape
nvictor has joined #ruby
<wwoodrum>
@ Spooner, if you can help he finish this i'll be forever in debted to you
<nvictor>
hey guys
<swarley>
ohi
<nvictor>
ohai swarley :>
F1skr has quit [Quit: WeeChat 0.3.9]
<nvictor>
when gem list displays a name with two versions (version1, version2) does that mean that both are installed ?
<Spooner>
wwoodrum : I can give you the solution, but I think dragging you into doing it yourself might be hard work. Where are you up to now?
eldariof has quit [Read error: Operation timed out]
brianpWins has quit [Ping timeout: 246 seconds]
<wwoodrum>
well i keep trying different ways but keep eding up with error or it doesn't work as it should. so I go back to the orginal code which actually works. it just doesn't give the output i want.
<Spooner>
wwoodrum : Well, do you know what you want out of it. That can help.
<wwoodrum>
I have the fibonacci sequence down, itll times by whatever i put in. I just want it to stop when the fibonacci number is equal to or greater than the integer I input
eldariof has joined #ruby
<Spooner>
Yeah, so keep adding to the array until the number you are going to add is > limit and return it. Not as hard as you are envisioning it, I suspect.
<wwoodrum>
puts "\n enter a number integer or float to calculate the Fibonacci sequence"
<wwoodrum>
is in main script
<Spooner>
Yeah, that isn't really relevant, is it?
<wwoodrum>
can i implement num in the above method
sambio_ has quit []
nvictor has left #ruby [#ruby]
<Spooner>
Yeah, just return an array rather than the last number.
cbuxton has left #ruby [#ruby]
<Spooner>
By the way, what sort of course is teaching people Ruby? I know it is ace, but I can't see it actually replacing the Holiness that is Java for CS101 ;)
<wwoodrum>
security script programming
<wwoodrum>
ISA
busybox42 has quit [Quit: leaving]
<wwoodrum>
i guess for metasploit
<Spooner>
Yeah, I thought that.
rakl has joined #ruby
busybox42 has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<wwoodrum>
in the main script what should i use for the .times?
hsbt has joined #ruby
thecreators has joined #ruby
<Spooner>
I already told you. You don't know how many times you need to get the next value, so you need an infinite loop.
<wwoodrum>
hmmm ok
xpen has joined #ruby
<Spooner>
Or, at least, not a loop based on iterating. You could use while/until or loop do, depending on your algorithm.
<Spooner>
No, you don't want to do that. That means you have to calculate the entire sequence every time. You don't need to change the test loop. Only the loop in your method.
<wwoodrum>
so like... do until vals >= num.to_i?
<wwoodrum>
in the method
busybox42 has quit [Quit: leaving]
moted has quit [Ping timeout: 272 seconds]
busybox42 has joined #ruby
justinmcp has quit [Ping timeout: 260 seconds]
thecreators has quit [Quit: thecreators]
<Spooner>
wwoodrum : I assume this is what you want? Just to check that we are on the same page.
<wwoodrum>
what i want is when the program starts the unser inputs a number.
<wwoodrum>
lets say
<wwoodrum>
25
<wwoodrum>
it does fibonacci until the number is greater than or equal to 25, then the program ends
<Spooner>
Yes, but I'm showing you the output for all numbers, so you can see them all. I could test manually with every number, but that isn't terribly useful for testing purposes.
ffranz is now known as ffranz-afk
scx has joined #ruby
sent-hil has joined #ruby
headius has joined #ruby
<wwoodrum>
ohhh
<wwoodrum>
okay i see it now.
<wwoodrum>
yes thats what i need
seoaqua has joined #ruby
<Spooner>
Yes, you could just leave your original #fib method and alter the loop after the user enters their request. It would be crazy inefficient, but you want to get it done, not done "properly" ;)
<wwoodrum>
yeah thats the problem i have now is the loop.
<wwoodrum>
now i can't get it to run at all
<wwoodrum>
just keep getting errors
eldariof has quit [Ping timeout: 246 seconds]
<Spooner>
Yeah, you are referencing vals outside the method.
eldariof has joined #ruby
<Spooner>
And in any case, it is an array, so not comparible with num.
Progster has joined #ruby
joeycarmello has joined #ruby
apok_ has quit [Ping timeout: 245 seconds]
<Spooner>
And loop do isn't the same as times, so you don't get a number out of it (so no |n| - you'd have to add one to n in every loop).
hbpoison has quit [Ping timeout: 260 seconds]
JonnieCache has quit [Ping timeout: 246 seconds]
<wwoodrum>
so do i put the loop in the method?
busybox42 has quit [Quit: leaving]
cyong has joined #ruby
vlad_starkov has joined #ruby
<wwoodrum>
can you even do that?
<Spooner>
Well, it depends. It is considerably easier to leave the method as it was before and change the lower code, so I think that makes more sense, even though the result would be inelegant.
horsey has joined #ruby
busybox42 has joined #ruby
seoaqua has quit [Ping timeout: 265 seconds]
<wwoodrum>
im not even sure what code to use on the bottom anymore cause when i use XX.times |n| it doesn't stop it just keeps going until XX is reached
<horsey>
where does rbenv store the source?
<Spooner>
Move to PM. #ruby doesn't need this ;)
<horsey>
for rubys it installs
<Spooner>
@ wwoodrum ^^
<postmodern>
horsey, rbenv uses ruby-build to download/compile them
locriani has quit [Read error: Connection reset by peer]
<postmodern>
horsey, by default ruby-build deletes the source
locriani has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<postmodern>
horsey, you'd need to run `rbenv install --keep ...`
prettymuchbryce has quit [Quit: prettymuchbryce]
<postmodern>
horsey, also you can set $RBENV_BUILD_ROOT for where the source should be downloaded to
<eph3meral>
scx: I love vim, as do many others - but it's admittedly not for the faint of heart
voodoofish has quit [Ping timeout: 252 seconds]
<scx>
Eclipse (RadRails 2 or Aptana with RadRails 3) doesn't have working autocomplete feature for Ruby at all
<swarley>
sweet, and the code builds for tonight
cakehero has joined #ruby
<eph3meral>
radrails is defunct for that matter, i believe
<eph3meral>
aptana is defunct even, I think, for that matter
<eph3meral>
scx: eclipse does have the Ruby DLTK but it doesn't integrate with projects very well, much less with rails
<horsey>
swarley: what are you working on?
<scx>
NetBeans dropped suppord for Ruby since 7.x
miso1337 has quit [Quit: afk]
<eph3meral>
scx: yeah, it's kind of surprising IMO
<eph3meral>
but, oh well
<eph3meral>
scx: in my (not so) humble opinion, most people who think they want an IDE just haven't used a good text editor, and by a good text editor I mean vim :P
<eph3meral>
emacs qualifies though
<eph3meral>
different strokes for different folks
vlad_starkov has joined #ruby
<eph3meral>
scx: Notepad++ is a decent option on windows, and it's equivalent, Scite on Linux
<eph3meral>
scx: lots of people like Sublime Text 2
<eph3meral>
scx: take your pick
<scx>
eph3meral: vim isn't for me
adeponte has joined #ruby
<eph3meral>
scx: I highly recommend giving one of either (or really both of) vim and emacs a try
<eph3meral>
scx: so you might prefer emacs
<Quadlex>
Metaprogramming is hard 0.o
sent-hil has quit [Remote host closed the connection]
sent-hil has joined #ruby
<swarley>
horsey; a more ruby oriented xml parser
<scx>
eph3meral: Notepad++ is simply text editor: doesn't have integration with git, mylyn (bugzilla), code autocompletion, code tips, debugger, etc
gabrielrotbart has quit [Read error: Connection reset by peer]
gabrielrotbart has joined #ruby
<eph3meral>
scx: emacs and vim both do
reset has quit [Ping timeout: 255 seconds]
ryanf has joined #ruby
<eph3meral>
scx: although to be fair, vim at least doesn't have "auto" completion, but it does have completion
<scx>
eph3meral: i know, but i just dont like vim (and emacs)
r1ddl3r has quit [Quit: Leaving.]
<eph3meral>
scx: k, well… good luck finding something that has an equivalent feature set that doesn't suck as hard as Netbeans/Eclipse
<eph3meral>
scx: and as far as ruby goes, there are really no debuggers at all
<eph3meral>
scx: if you find a good one, please let me know
<scx>
NetBeans 6.x was fine... for Ruby 1.8 and Rails 2.x
<eph3meral>
i've been meaning to write a DBGp crossplatform GUI
<eph3meral>
scx: eh, yeah possibly, I haven't used 2.x or 1.8 in years though
<scx>
i am looking for something similar for Ruby 1.9.x and Rails 3.x
mando has quit [Remote host closed the connection]
<eph3meral>
scx: it doesn't exist
<eph3meral>
sorry to be the bearer of bad news, but… not really
<horsey>
swarley: like Hpricot?
<scx>
I heard about RubyMine and InteliJIDEA but I never use them
ryanf has quit [Ping timeout: 264 seconds]
<Spooner>
Scx I use Rubymine a lot. It is good, but not very free ;)
<Spooner>
But you can easily get a free license if you are workong on opensource only.
<Spooner>
*free opensource
guilhermekfe has quit [Read error: Connection reset by peer]
uris has joined #ruby
<Quadlex>
I really dig RubyMine
ffranz-afk has quit [Quit: Leaving]
yaymukund has quit [Read error: Operation timed out]
g-ram has joined #ruby
<scx>
Spooner: i can pay but i don't want to waste money for another "nearly working" solution
voodoofish has joined #ruby
<Spooner>
scx There is a 30 day trial. It wouldn't take long to see if it fullfilled what you required of it.
ryanf has joined #ruby
<Spooner>
I like that it knows about Ruby, for example, rake and bundler are integrated, which I'm doubting in more general IDEs would be there.
g-ram has quit [Client Quit]
<Quadlex>
One thing I've found about it, however, is that it can get confused if you add a new SDK and don't restart it
<Quadlex>
So if it stops being able to navigate your code, it's trying to do so with the wrong SDK:P
mahmoudimus has joined #ruby
<Spooner>
I'm guessing you don't add new SDKs every 10 minutes though, Quadlex.
araujo has quit [Quit: Leaving]
<Quadlex>
No. But it's something I've done a couple of times
<Quadlex>
And forgotten each one
ndboost has joined #ruby
<scx>
Spooner: Have you used IntelliJ IDEA too?
<Spooner>
scx Nope.
<Spooner>
I generally use Notepad++ for non-project files and I tried stuff like Eclipse, but that was years ago and I hated it.
<scx>
ok, thanks for suggestion
<Spooner>
scx And if it matters, I haven't paid for it. I have the free opensource license ;)
hadees has joined #ruby
glyytchy has quit [Quit: glyytchy]
g-ram has joined #ruby
d2dchat has quit [Remote host closed the connection]
arubin has quit [Quit: Computer has gone to sleep.]
sent-hil has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
justinmcp has joined #ruby
<gkwhc>
anyone use redmine here?
<jrajav>
Notepad++? Do yourself a favor and try Sublime Text
iamjarvo has joined #ruby
<jrajav>
I'd suggest vim but I do not sense the force in you
schleppy has joined #ruby
<gkwhc>
...uh
<schleppy>
I am not a ruby dev - far from it. But I need to do a little maintenance on a rails site. Specifically using RPH Navigation. https://github.com/rpheath/navigation
<schleppy>
I am trying to figure out the correct syntax to add a sub_menu item, within a conditional on the main item.
<Spooner>
jrajav : The free edition of sublimetext does nothing, bnut the free edition of Notepad++ works fine. I'll stick with the latter ;)
<jrajav>
gkwhc: That was for Spooner not you ;P
<jrajav>
The free edition does nothing? .. What?
Progster has quit [Ping timeout: 246 seconds]
<Spooner>
I mean it isn't free. I was convoluting.
<jrajav>
Well, you're not supposed to, but nobody's gonna stop you
<jrajav>
(It's a little weird like that)
ryanf has quit [Quit: leaving]
<jrajav>
i.e. it's payware but has an unlimited unrestricted trial
<Spooner>
If something free works fine for 50 line scripts, why change? I use rubymine quite happily (and free) for anything of any size.
<jrajav>
I guess whatever works for you
<jrajav>
It's good to get familiar with something efficient and powerful, though
mneorr_ has joined #ruby
<Spooner>
I've never had much truck with the vim-style "remember 100 key combinations to do anything you possibly could desire", I'm afraid.
ndboost has quit [Remote host closed the connection]
Guest66015 has quit [Quit: WeeChat 0.3.9]
<jrajav>
Which is precisely why I didn't suggest vim :P
nwertman has quit [Quit: leaving]
<jrajav>
You can drag and drop something into Sublime Text, click somewhere, mash a few keys, and Ctrl-S
<jrajav>
And it won't complain even the tiniest bit
<Spooner>
Like in Notepad++ then? :O
<jrajav>
And you can *also* use any of its extremely powerful built-in commands or hundreds of plugins
<jrajav>
It's the best of both worlds
<jrajav>
It's also hella sexier than Notepad++
mneorr has quit [Ping timeout: 260 seconds]
<jrajav>
Reason enough right there
hbpoison has joined #ruby
<Spooner>
It wouldn't be too hard.
<Quadlex>
Why is it that assert_equal is passing ENV to an equals method I'm testing?
chrishunt has quit [Ping timeout: 252 seconds]
mklappstuhl has quit [Ping timeout: 245 seconds]
jamesaxl has quit [Read error: Operation timed out]
gmurphey has quit [Ping timeout: 245 seconds]
alienvenom has joined #ruby
voodoofish has quit [Quit: Leaving]
beachandbytes has joined #ruby
<swarley>
i only remember 20 vim keys
<swarley>
but i still use it
<swarley>
anyways, night
akem has quit [Read error: Connection timed out]
icole has joined #ruby
akem has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
arubin has joined #ruby
Spooner has quit [Ping timeout: 240 seconds]
miso1337 has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
swarley has quit [Ping timeout: 255 seconds]
tjbiddle_ has joined #ruby
mercwithamouth has quit [Ping timeout: 245 seconds]
mercwithamouth has joined #ruby
tjbiddle has quit [Ping timeout: 245 seconds]
tjbiddle_ has quit [Read error: Connection reset by peer]
fantazo has joined #ruby
hadees has quit [Quit: hadees]
ndboost has joined #ruby
prettymuchbryce has joined #ruby
ndboost has quit [Remote host closed the connection]
tjbiddle has joined #ruby
tjbiddle has quit [Client Quit]
schleppy has quit [Quit: Leaving.]
rakl has quit [Quit: sleeping]
hbpoison has quit [Ping timeout: 256 seconds]
SegFaultAX|work has joined #ruby
icole has quit [Read error: Connection reset by peer]
icole has joined #ruby
mahmoudimus has joined #ruby
chrishunt has joined #ruby
hadees has joined #ruby
schleppy has joined #ruby
fduf has joined #ruby
adeponte has quit [Remote host closed the connection]
headius has quit [Quit: headius]
drago757 has quit [Quit: drago757]
xaq has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
lewis has quit [Changing host]
lewis has joined #ruby
rakl has joined #ruby
cableray has quit [Quit: cableray]
burgestrand has quit [Quit: Leaving.]
g-ram has joined #ruby
justinmcp has quit [Ping timeout: 248 seconds]
xaq has quit [Remote host closed the connection]
yaymukund has joined #ruby
wizard` has joined #ruby
justinmcp has joined #ruby
AdrienG has joined #ruby
advorak has joined #ruby
xaq has joined #ruby
mando has joined #ruby
Guedes0 has quit [Ping timeout: 252 seconds]
joeycarmello has quit [Remote host closed the connection]
freezey has joined #ruby
glyytchy has joined #ruby
mando has quit [Ping timeout: 256 seconds]
xaq has quit [Remote host closed the connection]
ryanf has joined #ruby
PapaSierra has joined #ruby
mklappstuhl has joined #ruby
miso1337 has quit [Read error: Connection reset by peer]
wizard` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
siyusong has joined #ruby
miso1337 has joined #ruby
<schleppy>
I am using RPH navigation for rails. Part of the parameters passed into creating a menu item includes a callable, like :path => :foo, where foo is a method in scope. If I want to change foo to take params, how does my argument being passed change (ie. how does :path => :foo change)
ananthakumaran has joined #ruby
uris has quit [Quit: Lost terminal]
chrishunt has quit [Ping timeout: 240 seconds]
quest88_ has joined #ruby
M- has quit [Read error: Operation timed out]
rabidpraxis has quit [Remote host closed the connection]
miso1337 has quit [Read error: Connection reset by peer]
okapi has joined #ruby
arubin has quit [Quit: Computer has gone to sleep.]
miso1337 has joined #ruby
dhruvasagar has joined #ruby
wizard` has joined #ruby
nitti has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
miso1337 has quit [Client Quit]
xaq has joined #ruby
nitti has quit [Ping timeout: 260 seconds]
JoeTheGuest_ has quit [Changing host]
JoeTheGuest_ has joined #ruby
seoaqua has joined #ruby
squimmy has quit [Ping timeout: 246 seconds]
krz has joined #ruby
cbuxton has joined #ruby
cbuxton has left #ruby [#ruby]
burgestrand has joined #ruby
hbpoison has joined #ruby
ryanlecompte has joined #ruby
joeycarmello has joined #ruby
pantomime_cheap has quit [Quit: Leaving]
pantomime_cheap has joined #ruby
d3vic3 has quit [Ping timeout: 244 seconds]
sayuj has joined #ruby
<sayuj>
hello
manizzle has joined #ruby
d3vic3 has joined #ruby
davidcelis has joined #ruby
<sayuj>
How can I rescue "IOError (closed stream)". ie. I want to rescue only when the message is 'closed stream'
hbpoison has quit [Ping timeout: 260 seconds]
<burgestrand>
sayuj: rescue it, and re-raise it if the message does not match your expectations
cyong has quit [Quit: Leaving.]
bapa has quit [Ping timeout: 246 seconds]
<burgestrand>
sayuj: or write your own class to use in the list of rescue exceptions, ruby uses === for comparison
M- has joined #ruby
<sayuj>
I can match the messages. I think it's not safe.
<burgestrand>
It’s probably not.
whackatre has joined #ruby
monkegjinni has joined #ruby
<sayuj>
I have same situation with Thrift::TransportException. there I use Thrift::TransportException::END_OF_FILE to compare with e.type.
emanu has joined #ruby
adeponte has joined #ruby
wizard` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<sayuj>
burgestrand: is IOError has any constant to check the eoor type?
flagg0204 has quit [Ping timeout: 246 seconds]
joeycarmello has quit [Ping timeout: 256 seconds]
Banistergalaxy has quit [Ping timeout: 264 seconds]
Banistergalaxy has joined #ruby
tjbiddle has joined #ruby
tjbiddle has quit [Client Quit]
rippa has joined #ruby
sterNiX has quit [Ping timeout: 260 seconds]
ananthakumaran has quit [Ping timeout: 252 seconds]
yxhuvud has joined #ruby
flagg0204 has joined #ruby
replore_ has joined #ruby
replore_ has quit [Read error: Connection reset by peer]
x82_nicole has quit [Quit: Computer has gone to sleep.]
sterNiX has joined #ruby
spinagon has joined #ruby
bapa has joined #ruby
JonnieCache has joined #ruby
rippa has quit [Read error: Connection reset by peer]
pantomime_cheap has quit [Quit: Leaving]
greasegum has quit [Ping timeout: 252 seconds]
pantomime_cheap has joined #ruby
Krists has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
gmci has quit [Quit: Computer has gone to sleep.]
gmci has joined #ruby
<dmiller>
hey #ruby, what exactly is a "long" in ruby? I'm working with some mighty big numbers (50+ digits) and keep running across errors where BigNum can't be converted to Long ... but what is a Long?
quest88_ has quit [Quit: quest88_]
vlad_starkov has quit [Remote host closed the connection]
irleif has joined #ruby
<Mon_Ouie>
A C data type. Some functions need to convert Ruby integers to C native integers, and can only do that within certain bounds.
<Mon_Ouie>
What kind of functions give you such errors? Most regular math function should be able to deal with bignums just fine
<dmiller>
Mon_Ouie: Well I've been trying to use this number as an "index" so I have $giantnumber => "some value" as a hash
<dmiller>
or an array, more precisely
<Mon_Ouie>
Well, with an array that big, you'd run out of memory anyway
<Mon_Ouie>
Hashes and arrays are completely different data structure
<schleppy>
Is there any way to access `group` within `relpath` in this snippet?
<schleppy>
if the answer is to pass `group` to `relpath` then can you explain the syntax change for :path => :relpath?
brianpWins has joined #ruby
<Mon_Ouie>
Arrays don't have keys, but indices, and the greatest indices you can use is determined by the array's size. If you want to set an item at index n, you need an array of size n+1.
<Mon_Ouie>
Which is whole lot of memory in your case
theRoUS has quit [Remote host closed the connection]
<dmiller>
Yeah it's a giant data set.
mercwithamouth has quit [Ping timeout: 272 seconds]
emanu has quit [Quit: emanu]
monkegjinni has quit [Ping timeout: 246 seconds]
<Mon_Ouie>
You mean you *do* need to store a value for every integer up to 10^50 ?
<Mon_Ouie>
(starting from 0, I mean)
bapa has quit [Ping timeout: 252 seconds]
spinagon has quit [Read error: Connection reset by peer]
dakine has quit [Ping timeout: 245 seconds]
rippa has joined #ruby
pantomime_cheap has quit [Quit: Leaving]
<dmiller>
Mon_Ouie: I have a giant array that I am serializing to a flat string, or maybe even number.
pantomime_cheap has joined #ruby
answer_42 has joined #ruby
orospakr has left #ruby ["Ex-Chat"]
<dmiller>
preferably number because I can then use an array
<dmiller>
which in my tests is much more efficient than a hash
miso1337 has joined #ruby
<dmiller>
I want to be able to serialize my giant array, and retrieve some meta-data about it that I would store in this array
<dmiller>
but I can't figure out a way to serialize the array efficiently enough =\
<schleppy>
anyone?
hakunin has quit [Ping timeout: 246 seconds]
freezey has quit [Quit: freezey]
horsey has quit [Remote host closed the connection]
nitti has joined #ruby
<Mon_Ouie>
You're missing the point that unless you actually need a value for (almost) every index upto 10^50 (in which case RAM will be able to hold your dataset either way), an array is a memory waste — due to the empty indices it will contain
sertaconay has quit [Ping timeout: 260 seconds]
advorak has quit [Quit: Leaving]
samrose has quit [Ping timeout: 246 seconds]
bapa has joined #ruby
<dmiller>
Mon_Ouie: yeah you're right. Unfortunately I need to figure out a better strategy, computers aren't big enough for my naive approach. Thanks for your help!
nemesit has joined #ruby
chrishunt has joined #ruby
JonnieCache has quit [Ping timeout: 246 seconds]
<Mon_Ouie>
I'm still wondering, does your approach require such an array?
nitti has quit [Ping timeout: 260 seconds]
samuel02 has joined #ruby
flagg0204 has quit [Ping timeout: 255 seconds]
<dmiller>
So to let the cat out of the bag a little, I'm representing a rubik's cube. A great way would be a three dimensional array. Given that I am constructing a search tree where I could have millions of states loaded in memory at any given time, a multidimensional array is too inefficient, so I serialized it to a string (RRRWWWGGG etc)
Goles has quit [Read error: Operation timed out]
jarred has joined #ruby
<dmiller>
this works well, except I am precomputing the graph if you will, so I walk through all the possible states, compute the costs between them and store them *somewhere*
<dmiller>
the trick being that when I give the problem an unsolved state it needs to get that state from my data structure of precomputed data to start walking the graph
g-ram has quit [Quit: Computer has gone to sleep.]
<dmiller>
and there are a lot of possible states ;)
chrishunt has quit [Read error: Operation timed out]
noyb has joined #ruby
ananthakumaran has joined #ruby
sterNiX has quit [Quit: Lagging Off]
<dmiller>
(88 million, possibly more)
<dmiller>
I implemented it in a hash but the hash can't get much past 20 million on my macbook air before thrashing
<dmiller>
array was able to complete... after a while, but no way to go from a state to an index in the array as they weren't related at all
xaq has joined #ruby
<Mon_Ouie>
I'd think for a problem like the Rubik's cube (like for solving Sudokus and as opposed to a Tic-Tac-Toa AI), memorizing all possible states isn't the best approach
siyusong has quit [Quit: Computer has gone to sleep.]
spinagon has joined #ruby
tjbiddle has joined #ruby
tjbiddle has quit [Client Quit]
rippa has quit [Read error: Connection reset by peer]
Takehiro has quit [Remote host closed the connection]
IrishGringo has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121010144125]]
<dmiller>
Mon_Ouie: one would think. I'm just learning about this stuff. If you're knowledgable I am looking at iterative deepening A* search using a pattern database. I could very well be approaching the problem wrong :P
johnduhart2 has quit [Remote host closed the connection]
hakunin has joined #ruby
katherinem13 has quit [Ping timeout: 246 seconds]
monkegjinni has joined #ruby
<dmiller>
also more specifically I am looking at all the possible permutations of the corner cubes, but that is still 88 million
vlad_starkov has joined #ruby
maesbn has joined #ruby
d2dchat has joined #ruby
AndChat| has joined #ruby
eph3meral has quit [Ping timeout: 255 seconds]
flagg0204 has joined #ruby
Banistergalaxy has quit [Ping timeout: 256 seconds]
justinmcp has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 244 seconds]
IrishGringo has joined #ruby
bluOxigen has joined #ruby
margle has joined #ruby
sebastorama has joined #ruby
gabrielrotbart has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
maletor has joined #ruby
ZubKonst_ has quit [Read error: Connection reset by peer]
senny has joined #ruby
ZubKonst has joined #ruby
pantomime_cheap has quit [Quit: Leaving]
nyuszika7h has quit [Ping timeout: 246 seconds]
pantomime_cheap has joined #ruby
katherinem13 has joined #ruby
hakunin has quit [Read error: No route to host]
<scx>
Is there an easy way to get a cartesian product of arrays? For example [1, 2, 3], [4, 5], [1, 2, 6] => [1, 4, 1], [1, 4, 2], ..., [3, 5, 2], [3, 5, 6]
<workmad3>
method(&some_variable) is saying 'call some_variable.to_proc and pass it in as the block parameter of method)
<workmad3>
'
<franksch_>
and when I run gem list
<franksch_>
I get "Failed to load ~/.gemrc"
samphippen has joined #ruby
<Xeago>
workmad3: ah okay, that makes more sense to me now
Takehiro has joined #ruby
<workmad3>
Xeago: you can use the same technique on anything that will evaluate to an object that responds to 'to_proc' :)
<Xeago>
so the prefix of &
<franksch_>
permissions are -rw-r--r--
<franksch_>
any idea what could be wrong?
<Xeago>
is equal to the suffix of .to_proc ?
<workmad3>
Xeago: not quite
<workmad3>
Xeago: because it also passes it in as the block argument
<workmad3>
Xeago: so it's sort of the equivalent of doing 'method {|*args| arg.to_proc.call(*args)}'
marienz has joined #ruby
JonnieCache has joined #ruby
seoaqua has quit [Quit: 离开]
<workmad3>
Xeago: incidentally, ':sym.to_proc' really produces a proc equivalent to 'proc{|callee, *args| callee.send(:sym, *args)}' (which helps to make sense of how symbol to_proc works for all the enumerables :) )
JeanMertz has joined #ruby
niklasb has joined #ruby
hbpoison has quit [Ping timeout: 260 seconds]
monkegjinni has quit [Ping timeout: 255 seconds]
S1kx has joined #ruby
S1kx has quit [Changing host]
S1kx has joined #ruby
murtaughlist has joined #ruby
Fandekasp has quit [Disconnected by services]
Eplemosen has joined #ruby
chichou has quit [Read error: Connection reset by peer]
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
ABK has joined #ruby
bapa has joined #ruby
tonini has quit [Remote host closed the connection]
fatninja has quit [Changing host]
fatninja has joined #ruby
mneorr has quit [Remote host closed the connection]
<hoelzro>
adaro: I'm not sure about the best way to do this in Ruby, but there's always tsocks
<Xeago>
if the port is outside of root range, not needed
<Xeago>
you can socks the process for example
<hoelzro>
which overrides the socket library calls provided by libc to send them to a proxy
<adaro>
Xeago: well the current shell and any subprocesses
<Xeago>
"you can socks the process for example" => use tsocks
vimal2012 has joined #ruby
tvw has joined #ruby
<adaro>
Socks sounds worse than creating a simple wrapper script
nesoi has joined #ruby
kyktommy has quit [Quit: kyktommy]
<hoelzro>
it probably is
<nesoi>
hello, what editors do people like for ruby on windows?
<hoelzro>
I would use http_proxy in the env
<nesoi>
besides vim
<nesoi>
:)
<Xeago>
emacs
<nesoi>
and emacs
<Xeago>
notepad
<DefV>
most ruby developers on windows shot themselves a long time ago
<adaro>
rubymine is nice regardless of platform
nitti has quit [Ping timeout: 246 seconds]
<nesoi>
if I could get it to work properly on osx 10.6 I might use that
<adaro>
emacs and vim are for massochists :)
ksinkar has joined #ruby
hsbt is now known as hsbt_away
<nesoi>
how about "what free editor do people like for ruby on windows which isn't vim or emacs"?
<nesoi>
rubymine appears to cost $69
samphippen has joined #ruby
zmo_ has quit [Ping timeout: 252 seconds]
<hoelzro>
I've heard good things about Sublime Text 2
<Xeago>
i've hears bad thigns about Sublime Text 2
samphippen has quit [Client Quit]
<Xeago>
however, just try it
<hoelzro>
but I can't vouch based on personal experience
<Xeago>
there's also e
<Xeago>
e is cool
sayuj has joined #ruby
<Xeago>
notepad++
monkegjinni has joined #ruby
JeanMertz has quit [Ping timeout: 260 seconds]
<JonnieCache>
sublime text 2 is amazing
vimal2012 has left #ruby ["Leaving"]
areil_ has joined #ruby
areil has quit [Read error: Connection reset by peer]
<Xeago>
it's documentation is arcane
<JonnieCache>
definitely try it if youre looking for a new editor
<JonnieCache>
who needs documentation ;)
<Xeago>
I want to customize it
<JonnieCache>
python's reflection api should be enough for you :P
horsey has quit [Read error: Connection reset by peer]
AndChat| has quit [Read error: Connection reset by peer]
<Xeago>
myself, and not c/p from others who died trying
xpen has quit [Remote host closed the connection]
<JonnieCache>
but yeah that is an issue. its because theres only one developer and he works like a machine on new features all day every day
xpen has joined #ruby
<Xeago>
open source it
<Xeago>
>.<
xpen_ has joined #ruby
<JonnieCache>
let him make his money
<Xeago>
there's licenses for that
<hoelzro>
I thought ST2 *was* open sourced?
KindTwo has joined #ruby
<JonnieCache>
yeah but whos gonna buy a license for an oss tool? a lot less people
<nesoi>
I thought sublime text 2 was a mac app
<nesoi>
also, it's not free either
<Xeago>
at the moment it is free shareware
<JonnieCache>
its osx/linux/windows
<Xeago>
with no expiration
yeggeps has joined #ruby
<nesoi>
hmm Sublime Text 2 may be downloaded and evaluated for free, however a license must be purchased for continued use. There is currently no enforced time limit for the evaluation.
yeggeps has left #ruby [#ruby]
Banistergalaxy has joined #ruby
<JonnieCache>
its one of those things where if you like it, you *really* like it and you just throw money at the guy
<nesoi>
I tried intext, but it won'
<nesoi>
t load the ruby bundle
zmo_ has joined #ruby
<JonnieCache>
i bought a license pretty quickly
samphippen has joined #ruby
<Xeago>
what's the difference between"Sublime Text 2 may be downloaded and evaluated for free, however a license must be purchased for continued use. There is currently no enforced time limit for the evaluation." and buy a license for commercial use
<nesoi>
and the filename includes "unstable" which doesn't give me confidence
hbpoison has joined #ruby
<JonnieCache>
nesoi: thats just him being modest. ive never seen it misbehave and i run the least stable builds
<JonnieCache>
Xeago: it nags you ever n saves
xpen has quit [Ping timeout: 246 seconds]
<JonnieCache>
s/ever/every
<nesoi>
ah very nice
<nesoi>
pretty colors
noxoc has joined #ruby
<JonnieCache>
also check out the vim mode, which is entirely implemented using the key binding api (with a little of the general python api)
arietis has joined #ruby
<nesoi>
I first used vi about 40 years ago, but I never learned it, so vim mode won't be that useful to me
clj_newb has quit [Ping timeout: 256 seconds]
robotmay has quit [Read error: Connection reset by peer]
<Xeago>
my vim setup only misses shell integration, I haven't taken time to do it yet, with my current setup I got multiple keyboards 3 1440*2560 screens + 1280*800 below that,
akem has quit [Ping timeout: 272 seconds]
robotmay has joined #ruby
<Xeago>
I hooked up a secondary keyboard to always type to a shell
<Xeago>
and that's all I need
<Xeago>
whether in vim, macvim, textmate
<lewis>
is it recommended to learn sql
<nesoi>
is vim actually better or is it just odd snobbery? I always thought of vi as a primitive hack done before true screen editors existed
<Xeago>
vi is standardized
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
<Xeago>
vim extends (and is incompatible) with the standard
x0F_ is now known as x0F
<nesoi>
yeah, but the reason for vi was slow update speeds
<nesoi>
so you could use it on a very slow text terminal
<Xeago>
vim can run in vi mode
<nesoi>
screen editors had to repaint everything until the vt50
<Xeago>
which is default I might add
<nesoi>
and then the vt100 implemented scrolling regions, etc.
<nesoi>
so you could do line inserts and deletes without repainting
<nesoi>
I wrote an early screen editor that did that btw
<nesoi>
but I never learned vi because it seemed very outdated
<Xeago>
vi is outdated
<Xeago>
but it runs freaking everywhere
Michael__ has joined #ruby
<nesoi>
so my question is: is it really better for some reason or is it just like cyberpunk snobbery?
hbpoison has quit [Ping timeout: 272 seconds]
KindTwo has quit [Ping timeout: 240 seconds]
<Xeago>
vim is better than vi handsoff
<Xeago>
as vim is vi + more
<nesoi>
sure but it's still the same mode oriented crap no?
<nesoi>
which really existed for line mode terminals afaik
<Xeago>
no, it exists for seperating concerns
<nesoi>
not originally
<nesoi>
originally it existed because you couldn't repaint your whole fucking screen at 75bps
<nesoi>
or even 300
<nesoi>
I remember when 1200bps was super fast and reserved for the graphics tubes
<nesoi>
that's when people used vim
<nesoi>
I mean vi
<nesoi>
and it was really because you couldn't run a screen editor
KindTwo has joined #ruby
<nesoi>
when kedit came out it was just fantastic
<nesoi>
so that's why I have a hard time believing that vi or even vim is really great, since it was built to satisfy a very limited environment
<nesoi>
but maybe it is. is it?
<Xeago>
I like vim
zommi has joined #ruby
<nesoi>
why is it better than a true screen editor?
<Xeago>
ed was a line editor
<nesoi>
vim was optimized for slow displays because it didn't repaint
<nesoi>
as I recall
<nesoi>
back then, terminals were totally dumb in that you couldn't delete a line without repainting everything under it
<nesoi>
which required the host to resend it at 75bps or 300bps if you were lucky
pen has joined #ruby
Michael__ has quit [Remote host closed the connection]
<pen>
hey
clocKwize has joined #ruby
<pen>
anyone use Watir Webdriver?
<clocKwize>
hey
<pen>
Is it possible to not let it open the browser window?
<nesoi>
"Joy explained that the terse, single character commands and the ability to type ahead of the display were a result of the slow 300 baud modem he used when developing the software and that he wanted to be productive when the screen was painting slower than he could think."
brianpWins_ has joined #ruby
cantonic_ has joined #ruby
love_color_text has quit [Remote host closed the connection]
manizzle has quit [Ping timeout: 256 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
mucker has joined #ruby
jgrevich has quit [Quit: jgrevich]
brianpWins has quit [Ping timeout: 240 seconds]
cantonic has quit [Ping timeout: 240 seconds]
cantonic_ is now known as cantonic
brianpWins_ is now known as brianpWins
flagg0204 has quit [Read error: Operation timed out]
flagg0204 has joined #ruby
samphippen has joined #ruby
KindTwo has quit [Ping timeout: 260 seconds]
slainer6_ has quit [Read error: Connection reset by peer]
Takehiro has quit [Remote host closed the connection]
LennyLinux has quit [Remote host closed the connection]
wpaulson has joined #ruby
wpaulson has quit [Client Quit]
sayuj has quit [Ping timeout: 260 seconds]
ests has joined #ruby
LennyLinux has joined #ruby
LennyLinux has quit [Remote host closed the connection]
ests has quit [Client Quit]
monkegji_ has joined #ruby
monkegjinni has quit [Read error: Connection reset by peer]
Takehiro has joined #ruby
lkba has joined #ruby
KindTwo has joined #ruby
lejtih has joined #ruby
Archisze has joined #ruby
emmanuelux has quit [Ping timeout: 246 seconds]
hsbt_away is now known as hsbt
heftig has quit [Read error: Connection reset by peer]
miso1337 has quit [Quit: afk]
lejtih has quit [Read error: Connection reset by peer]
heftig has joined #ruby
heftig has quit [Read error: Connection reset by peer]
werdnativ has joined #ruby
beit has joined #ruby
jaannp has joined #ruby
sertaconay has joined #ruby
hamed_r has quit [Ping timeout: 246 seconds]
emergion has joined #ruby
hsbt is now known as hsbt_away
<shevy>
Xeago I think it is a bit along the lines of "If you like Sublime, please donate." in a little bit more stern voice perhaps :-)
ph^ has quit [Remote host closed the connection]
<shevy>
it's quite ok... I am still using bluefish 1.0.7 but I have realized that there will come the day when I must switch... still unsure where to... geany, bluefish 2 or sublime ... or perhaps I go back to vim... but my brain hates wanting to master vim...
<shevy>
now I am tricking my brain though
hsbt_away is now known as hsbt
<shevy>
I learn C and vim at the same time!
slainer68 has quit [Remote host closed the connection]
sayuj has joined #ruby
manizzle has quit [Ping timeout: 256 seconds]
<hoelzro>
C is definitely worth learning, even if you don't use it all the time
hbpoison has joined #ruby
frogprince_mac has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
<shevy>
yeah well
<shevy>
I stopped always at around the times when pointers where used
<shevy>
*were
<hoelzro>
pointers aren't that complicated
<hoelzro>
they do require a bit of a leap of thinking, I suppose
<JonnieCache>
is there an equivalent of %w{} that lets me do comma delimeted strings?
kyktommy has joined #ruby
<JonnieCache>
so i can do %foo{word,anotherword,two words, three more words}
hbpoison has quit [Ping timeout: 272 seconds]
scx has quit [Ping timeout: 244 seconds]
<hoelzro>
JonnieCache: I'm guessing not; how about '...'.split /,/?
<JonnieCache>
nah that looks ugly and weird
<hoelzro>
fair enough =)
abionic has joined #ruby
<matled>
JonnieCache: I don't think so, but at least you can escape spaces if necessary
<JonnieCache>
ive just gone for a normal array with commas and quotes and everything. im just declaring a constant full of strings and wanted it to look neat
samphippen has quit [Quit: Computer has gone to sleep.]
gmurphey has joined #ruby
Virunga has joined #ruby
ShiintoRyuu has joined #ruby
Banistergalaxy has quit [Read error: Connection reset by peer]
Goles has quit [Ping timeout: 240 seconds]
Banistergalaxy has joined #ruby
hamed_r has joined #ruby
emmanuelux has joined #ruby
Matrix has joined #ruby
iamjarvo has joined #ruby
ttt has quit [Remote host closed the connection]
hamed_r has quit [Read error: Connection reset by peer]
jastix has quit [Quit: Leaving]
emmanuelux has quit [Ping timeout: 245 seconds]
ABK_ has joined #ruby
kyktommy has quit [Quit: kyktommy]
jeffreybaird has joined #ruby
monkegjinni has quit [Read error: No route to host]
elsifaka has joined #ruby
monkegjinni has joined #ruby
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
abionic has quit [Ping timeout: 246 seconds]
hbpoison has joined #ruby
mark_locklear has joined #ruby
<arietis>
lol
<arietis>
the problem was i used manifest file in wrong format
hbpoison has quit [Ping timeout: 264 seconds]
krawchyk has joined #ruby
yshh has joined #ruby
<Xeago>
Does anyone know why some methods in Tire::Search use @value[:abc]= and some use @value = { :abc =>}
colinbm has joined #ruby
chussenot has joined #ruby
Servidorv has joined #ruby
clj_newb has joined #ruby
theRoUS has quit [Ping timeout: 264 seconds]
<Servidorv>
hey guys
<Servidorv>
good morning
<Servidorv>
is anyone there??
johnjohnson has joined #ruby
samphippen has joined #ruby
Banistergalaxy has quit [Read error: Connection reset by peer]
carloslopes has joined #ruby
<hoelzro>
servidorv: morning
wodKa has quit [Ping timeout: 252 seconds]
sonne has joined #ruby
<sonne>
greetings!
<sonne>
is there a way to generate a Gemfile from gems that are installed?
Banistergalaxy has joined #ruby
<sonne>
sort of "pip freeze"
<Xeago>
sonne: to what intent?
<sonne>
making sure that "bundle install" installs the same versions of gems that i'm using right now
<Xeago>
if there is a lock file yes
<Xeago>
tho you should use bundle
<sonne>
point is... if i type "gem 'rails', '=1.2.3'" in the Gemfile and then install it with bundle, i'm not sure the dependencies will be at the same version when the project will be installed on some other machine in the future
literal_username has joined #ruby
<Xeago>
thats why there is a Gemfile.lock
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
tommyvyo has joined #ruby
<Xeago>
that specifies the exact version used
<sonne>
aha!
<sonne>
so when i use 'gem "rails"' in the Gemfile bundle refers to the lock file for the versions
<sonne>
i didn't know that... cheers :)
literal_username has left #ruby [#ruby]
<Xeago>
other way around
<Xeago>
bundler looks in gemfile what dependencies it has
<Xeago>
than in gemfile.lock what versions of the dependencies were used
jrist-afk is now known as jrist
<sonne>
what i meant is: after i did my bundle install for my project, the next person's bundle will check the lock file to know which versions to install
<Xeago>
yep :)
<sonne>
awesome!
<Xeago>
tho, use 'bundle' satisfy gem dependencies
<Xeago>
use 'bundle install' to add new gem dependencies
<sonne>
yup, i always do that
<sonne>
but never noticed that the .lock file actually had stuff inside... :)
elico has joined #ruby
fgro has joined #ruby
Axsuul has quit [Ping timeout: 272 seconds]
irleif has joined #ruby
sspiff has joined #ruby
<fgro>
how can i determine all the classes which include a certain module? or rather test include?(module) on the set of classes in question?
ssspiff has quit [Ping timeout: 264 seconds]
elliot98 has joined #ruby
<burgestrand>
Xeago: aren’t `bundle` and `bundle install` the same command?
<sonne>
Xeago, i noticed that the lock file has different means of specifying the versions: some are =, some ~>, some have no indication... i guess there is some way that bundle uses to detect which ones could be ideally upgraded safely?
<Xeago>
yep
<burgestrand>
… I mean, both installs gems
<Xeago>
burgestrand: could be, am a bit unsure
monkegjinni has quit [Read error: No route to host]
<burgestrand>
I haven’t used bundle install for ages, I just bundle :)
<Xeago>
sonne: they correspond to the versions constructed in the gemfile
<JonnieCache>
to bitmask or not to bitmask, that is the question
<sonne>
cheers
<sonne>
..."pessimistic operator" :D
elico has quit [Quit: elico]
<Xeago>
JonnieCache: without a doubt, bitmask
elliot98 has quit [Quit: Konversation terminated!]
elliot98 has joined #ruby
Virunga has quit [Remote host closed the connection]
elliot98 has quit [Changing host]
elliot98 has joined #ruby
<JonnieCache>
but maybe the client will want to change the list of things
<JonnieCache>
maybe i want a new db table
<JonnieCache>
im going to err on the side of the clients wanting to change things
<JonnieCache>
they are, after all, clients
reisl has joined #ruby
<arietis>
is it possible to have 2 date formats?
<arietis>
my date value can be divided by "/" or "-"
clj_newb has quit [Ping timeout: 244 seconds]
<arietis>
on different devices
dhruvasagar has quit [Ping timeout: 268 seconds]
larissa has quit [Ping timeout: 246 seconds]
<arietis>
can i set delimiter to some mask?
<Xeago>
arietis: there's strftime
dhruvasagar has joined #ruby
<arietis>
yeah
znake has joined #ruby
<arietis>
but i have '%m-%d-%Y-%H:%M'
<arietis>
and i wanna be able to parse it like '%m/%d/%Y-%H:%M' also
<Xeago>
then simply put it in 2 variables?
<arietis>
i can't
miso1337 has joined #ruby
xpen has joined #ruby
sspiff has quit [Ping timeout: 246 seconds]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<arietis>
since i don't know which format to use
<arietis>
at the moment of parsing
sspiff has joined #ruby
<arietis>
i could check if string contains '/' char tho
<arietis>
is it good idea?
franksch_ has quit [Quit: Page closed]
whalesalad has joined #ruby
Banistergalaxy has quit [Read error: Connection reset by peer]
clj_newb has joined #ruby
cantonic_ has joined #ruby
heftig has quit [Quit: leaving]
miso1337_ has joined #ruby
mneorr has quit [Remote host closed the connection]
mmitchell has joined #ruby
mneorr has joined #ruby
miso1337 has quit [Read error: Connection reset by peer]
BSaboia has joined #ruby
cantonic has quit [Ping timeout: 252 seconds]
cantonic_ is now known as cantonic
<arietis>
at least it works
<arietis>
:)
schaary has joined #ruby
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
miso1337_ has quit [Ping timeout: 260 seconds]
miso1337 has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
<schaary>
hi - how could i enforce a thor script to use utf-8 as default encoding?
<schaary>
in a ruby file I could write # encoding: UTF-8 in the first line
miso1337 has quit [Remote host closed the connection]
<schaary>
but in thor ... there is #!/usr/bin/ruby in the first line
<hoelzro>
schaary: I'm pretty sure the encoding line is valid in line 2 as well
cyt93cs_ has quit [Ping timeout: 255 seconds]
<Xeago>
it is
<schaary>
thx
cyt93cs_ has joined #ruby
<schaary>
the script still works ;)
<schaary>
thx
wmoxam has quit [Quit: leaving]
wmoxam has joined #ruby
hbpoison has joined #ruby
jrist is now known as jrist_mtg
chin-tastic has joined #ruby
invisime has joined #ruby
slainer68 has quit [Ping timeout: 260 seconds]
jrajav has joined #ruby
justinmcp has quit [Remote host closed the connection]
Zai has joined #ruby
linoj has joined #ruby
kn330 has joined #ruby
Konboi has quit [Remote host closed the connection]
GoGoGarrett has joined #ruby
ttt has joined #ruby
Konboi has joined #ruby
slainer68 has joined #ruby
TomRone has quit [Ping timeout: 246 seconds]
dhruvasagar has quit [Ping timeout: 260 seconds]
dhruvasagar has joined #ruby
boodle has joined #ruby
TomRone has joined #ruby
boodle has left #ruby [#ruby]
v0n has joined #ruby
ffranz has joined #ruby
ttt has quit [Ping timeout: 260 seconds]
gmurphey has quit [Ping timeout: 260 seconds]
yekta has joined #ruby
iamjarvo has quit [Ping timeout: 245 seconds]
dmerrick has joined #ruby
Neomex has joined #ruby
havenn has quit [Remote host closed the connection]
g-ram has joined #ruby
margle has quit [Ping timeout: 272 seconds]
mercwithamouth has joined #ruby
margle has joined #ruby
Matrix has quit [Quit: Leaving]
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
sailias has joined #ruby
monkegjinni has quit [Ping timeout: 265 seconds]
abionic has joined #ruby
yekta has quit [Quit: yekta]
bbttxu has joined #ruby
gmurphey has joined #ruby
lledet has quit [Quit: lledet]
ABK_ has quit [Read error: Operation timed out]
moos3 has joined #ruby
joeycarmello has joined #ruby
Konboi has quit [Remote host closed the connection]
philcrissman has joined #ruby
werdnativ has quit [Quit: werdnativ]
bbttxu has quit [Ping timeout: 260 seconds]
apok has joined #ruby
xcbghz has joined #ruby
<xcbghz>
hi guys... anyone knows how to solve this problem [-] Exception handling request: undefined method `%' for nil:NilClass
<xcbghz>
?
<hoelzro>
xcbghz: does that error message come with a line number, filename, and code?
colinbm has quit [Quit: colinbm]
<xcbghz>
hoelzro: i get only that line... no more info
<hoelzro>
what kind of application is this?
<hoelzro>
I'm guessing a web app
joeycarmello has quit [Ping timeout: 246 seconds]
Virunga has joined #ruby
<_axx>
hey guys, how would you handle a lost connection on a ruby tcp client? (i have a ruby script that runs a tcp connection (client)) when my connection gets dropped, i would like to reconnect tcp client (it now just does nothing)
mneorr has quit [Remote host closed the connection]
cdzombak has joined #ruby
mneorr has joined #ruby
<_axx>
i'm not sure how to detect the lost connection and reconnect then
<hoelzro>
xcbghz: sorry, I'm not familiar with metasploit
BeLucid has joined #ruby
<hoelzro>
_axx: are you just read()'ing from the socket?
<xcbghz>
ok thanks anyway hoelzro :)
<postmodern>
xcbghz, ask in #metasploit
erichmenge has joined #ruby
<xcbghz>
thanks
dnstbr has joined #ruby
dmiller_ has quit [Ping timeout: 246 seconds]
xpen_ has joined #ruby
xpen_ is now known as xen
xen is now known as xpen_
<_axx>
hoelzro: yeah more or less, i connect to an IRC server via tcp, the same daemon opens up an udpsocket and forwards incoming udp messages to the irc channel, i only use socket.puts to send the IRC data. i also use socket.gets to resond on PING/PONG messages from irc servers.
dmiller has joined #ruby
havenn has joined #ruby
znake has quit [Quit: znake]
<hoelzro>
ok
Vert has joined #ruby
<_axx>
but the tcp connection doesn't recognize, when my tcp connection gets lost
<hoelzro>
so if you lose the TCP connection, I'm guessing puts/gets should return raise an exception
<adaro>
h4x0r
<hoelzro>
or possible return a special value
theRoUS has joined #ruby
<_axx>
yes. :) i thought about a begin / recue / retry flow
awestroke has quit [Remote host closed the connection]
<_axx>
throw the exception -> restart method (the method starts the udp server and tcp connection
postmodern has quit [Quit: Leaving]
pantomime_cheap has joined #ruby
xpen has quit [Ping timeout: 246 seconds]
<hoelzro>
why restart the UDP socket if the TCP connection goes down?
<_axx>
it basically restarts the whole script, i could also limit that to the tcp connection only.
kwaskwan has joined #ruby
a_a_g has quit [Quit: Leaving.]
<kwaskwan>
<sixteneighty>
hi. i want to create a new file in my directory and write some xml markup in it. here is my code where i create the file and create the xml markup but i do not know how to write my markup into my file ... https://gist.github.com/3905630
<_axx>
i'm just having problems, handling the lost tcp connection :S
akem has joined #ruby
<sixteneighty>
maybe anybody can push me in the right direction
<_axx>
sixteneighty: you can use File.open also to write to a file
lobak_ has quit [Quit: No Ping reply in 180 seconds.]
lobak has joined #ruby
<_axx>
File.open('file/path','w') do |line| line.puts "your data" end
wallerdev has joined #ruby
rakl has joined #ruby
Eplemosen has joined #ruby
jasond has joined #ruby
heftig has joined #ruby
<sixteneighty>
_axx: ok i give i try :-)
<_axx>
:)
rakl has quit [Client Quit]
monkegjinni has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
Coolhand has joined #ruby
morf has quit [Quit: eof]
<sixteneighty>
_axx: hm i tried this way ....
<sixteneighty>
File.open(title + '.plist', 'w') do |f| f.puts "<?xml version="1.0" encoding="UTF-8"?>" f.puts "<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">"
<sixteneighty>
end
<sixteneighty>
but get syntax error messages
zii has quit [Read error: Connection reset by peer]
Spooner has joined #ruby
kwaskwan has quit [Quit: WeeChat 0.3.9]
whalesalad has quit [Quit: whalesalad]
<sixteneighty>
i think because of escaping the " the wrong way
zii has joined #ruby
zii has quit [Changing host]
zii has joined #ruby
<_axx>
you can either use ' ' instead or you change " to \" and // to \/\/ (it's called escaping)
answer_42 has quit [Remote host closed the connection]
scx has quit [Remote host closed the connection]
<sixteneighty>
ok thx!
matrixise has quit [Ping timeout: 246 seconds]
clj_newb has quit [Ping timeout: 272 seconds]
krawchyk_ has joined #ruby
answer_42 has joined #ruby
xclite has joined #ruby
axl_ has joined #ruby
matrixise has joined #ruby
yshh has quit [Remote host closed the connection]
stopbit has joined #ruby
freeayu has quit [Remote host closed the connection]
uris has joined #ruby
chimay has joined #ruby
axl_ has quit [Read error: Operation timed out]
pantomime_cheap has quit [Quit: Leaving]
morozovm has joined #ruby
hoelzro has quit [Quit: leaving]
cmol has joined #ruby
krawchyk has quit [Ping timeout: 246 seconds]
fr00ty_l00ps has joined #ruby
<fr00ty_l00ps>
Alright, so I am making a program for school that draws the Fibonacci Spiral on a TKCanvas
<cmol>
Hi guys. I've been writing a lib, and i have some configuration data that i want people to be able to add. Where should i put the file? I have a lib dir with _scriptname_.rb and a _scriptname_ folder and everything in a module. How to do this smartest?
<fr00ty_l00ps>
all I need now is to basically rotate the bottom section (the part that is not the first two iterations) 180 degrees. How would I go about this?
<burgestrand>
cmol: configuration data?
nyuszika7h has joined #ruby
nyuszika7h has quit [Changing host]
<cmol>
burgestrand: passwords, servername
<burgestrand>
fr00ty_l00ps: sorry I can’t help you, I don’t use tk myself and you’re the first person I’ve ever encountered in here in two years that brings up tk :p
psychouroboros has joined #ruby
<fr00ty_l00ps>
Haha, and I am 14 xD
<burgestrand>
cmol: people to be able to add?
geekbri has joined #ruby
<burgestrand>
fr00ty_l00ps: okay
axl_ has joined #ruby
<fr00ty_l00ps>
Its the only graphical library that is portable (school's computers are picky) that will suffice for me
<cmol>
burgestrand: well, edit. my idea is a config.example or something like that to add to the repo
<Spooner>
fr00ty_l00ps : Tried gosu?
<fr00ty_l00ps>
cant install gems
<burgestrand>
cmol: ah, why do you need it to be accessible from users of your gem?
Morkel has quit [Quit: Morkel]
<fr00ty_l00ps>
im running Ruby off of my flashdrive
Serial_Killer_C has joined #ruby
johnjohnson has quit []
<fr00ty_l00ps>
with a command prompt on the flashdrive too
<Spooner>
fr00ty_l00ps: Can...yeah that isn't going to work, though no reason you can'r install gems on your flashdrive installation.
<sixteneighty>
_axx: ok, only one error left :-) /fileReader.rb:17: syntax error, unexpected tSTRING_BEG, expecting keyword_end f.puts '<key>items</key>'
<cmol>
burgestrand: to make it work with their own setup
<sixteneighty>
_axx: is this because of the backslash?
<burgestrand>
cmol: anyway, for non-required files you place them wherever, I tend to place them outside the lib directory, and then provide either a method or a constant with the full path to the file
dnstbr has quit [Quit: Computer has gone to sleep.]
anderse has quit [Read error: Connection reset by peer]
<fr00ty_l00ps>
Spooner: well, it doesnt let every program that we use access the network ^^
<cmol>
burgestrand: Ok, i had and idea that there was a universal "we do it like this" for it :P
<fr00ty_l00ps>
theoretically speaking, of course
lledet has joined #ruby
<burgestrand>
fr00ty_l00ps: you can download gems to disk and install them from there :)
<Spooner>
fr00ty_l00ps: Yeah, but surely you can install the gem when you aren't on that network.
<Spooner>
Or do that ;)
<fr00ty_l00ps>
But I am soooooo close with tk!! I dont exactly care to change it now c:
<burgestrand>
cmol: not as far as I know, rails has a similar thing with assets in gems, but what it does is really funky and you don’t want your users to have to do that
<cmol>
burgestrand: Ok, well, thanks for the help!
<_axx>
sixteneighty: yes, maybe.
guns has joined #ruby
abionic has quit [Ping timeout: 246 seconds]
riley526 has joined #ruby
Ankhers has joined #ruby
<Spooner>
fr00ty_l00ps : Well, anyway, what you are asking for is someone to parse your script, and correct your algorithm (regardless of TK) which is a bit beyond the scope of #ruby ;) We can tell you how to do stuff, but design is your bag!
skaczor has joined #ruby
<burgestrand>
the rate at which you get help is usually proportional to how complex and big your code is :p
tobiassjosten has joined #ruby
<fr00ty_l00ps>
haha, I figured as much, but I didnt know if anybody knew anything related that I did not ^^
riley526 has quit [Read error: Connection reset by peer]
riley526 has joined #ruby
<fr00ty_l00ps>
Thanks though :)
<tobiassjosten>
I'm trying to get Compass working with Symfony2. Ruby is installed with RVM (using 1.9.3) and I have the compass gem installed properly (shows up on `gem list` and in my path).
<Spooner>
fr00ty_l00ps I can tell you that if x; ...; elsif x != true; ...; end is redundant. 'else' is enough ;)
<tobiassjosten>
Still I bump in the error: /…/rubygems/dependency.rb:247:in `to_specs': Could not find compass (>= 0) amongst …
<Spooner>
I can also say tht you are usin upto i and altering the value of i in the loop, which is redundant.
<fr00ty_l00ps>
Spooner, yes, I forgot to change that back, as I was just flipping through things, changing what could be a problem
dhruvasagar has quit [Ping timeout: 256 seconds]
<fr00ty_l00ps>
A friend of mine who has never written Ruby before came up with the upto
<fr00ty_l00ps>
xD
fgro has quit [Ping timeout: 260 seconds]
<Spooner>
upto is fine. The i += 1 is the bit that is redundant.
<tobiassjosten>
Any ideas what could cause that? What could cause Ruby to sometimes not find the correct "gem path"? Or am I wrong in supposing that's the problem?
riley526 has quit [Read error: Connection reset by peer]
riley526 has joined #ruby
<fr00ty_l00ps>
Spponer: so i dont need that? I use i in the recalc_length() though...
<Spooner>
fr00ty_l00ps : I is incremented by upto. Just try it without the i += 1 and it will do the same thing.
<fr00ty_l00ps>
oh, okay, thanks :)
<Spooner>
*i is incremented by #upto
rabidpraxis has joined #ruby
<fr00ty_l00ps>
other than that, is it Ruby-like enough? I come from a java background... So a lot is different for me...
<Spooner>
You also don't need to do @shapes[i] at all (so don't need i = 0). You can just @shapes << TkcR...
<shevy>
man I feel as if I need to beat someone
<fr00ty_l00ps>
true... I will change that ^^
monkegjinni has quit [Read error: No route to host]
zodiak has joined #ruby
<Spooner>
calc_a and calc_b could have += and -= in them. There is no reason to return @values in either of those methods, since they alter @ivars.
Sou|cutter has joined #ruby
nari has joined #ruby
freezey has joined #ruby
<Spooner>
fr00ty_l00ps : $PHI = 1/(((5 ** 0.5) +1)/2) should just be PHI = 1/(((5 ** 0.5) +1)/2) in the class scope (outside initialize) for a class constant.
monkegjinni has joined #ruby
<fr00ty_l00ps>
Spooner, as for the calc_a and calc_b isnt it better practice to return something, rather than just access @vars elsewhere?
jrist_mtg is now known as jrist
<Spooner>
fr00ty_l00ps : No. Either modify @ivars or return new values (that you can put in those @ivars). No point doing both!
<fr00ty_l00ps>
alrighty
<sixteneighty>
ok thx to _axx i can write the xml markup into my file, now i want to write some values into my markup and tried it this way https://gist.github.com/3905816
<sixteneighty>
how can i write the value from #{ipa_file.bundle_identifier} into the markup?
<Spooner>
sixteneighty : Please don't do that. Use Nokogiri::XML to generate xml please!
bbttxu has joined #ruby
erichmenge has quit [Quit: Be back later]
fgro has joined #ruby
dhruvasagar has joined #ruby
<fr00ty_l00ps>
Spooner, the change to $PHI gave me an error
margle has quit [Quit: Computer has gone to sleep.]
thisirs has quit [Remote host closed the connection]
mucker has quit [Quit: leaving]
<sixteneighty>
Spooner: Ok.
<fr00ty_l00ps>
"dynamic constant assignment"
<Spooner>
fr00ty_l00ps : You need to access it as PHI as well.
<fr00ty_l00ps>
ahhhhh
<Spooner>
fr00ty_l00ps : Oh, I said put it outside initialize.
<fr00ty_l00ps>
oops xD
<fr00ty_l00ps>
so in do_work?
<Spooner>
No, in the class but outside any method.
<Spooner>
arietis : You need Ruby 1.9.3 to do that.
<Spooner>
Before that, #rand only accepted integers.
noxoc has quit [Quit: Leaving.]
<arietis>
Spooner: kk, thanks
<matti>
Spooner: :)
<Spooner>
sixteneighty : IN fact, you've required builder (which is the stdlib XML generator, which is fine) but then not used it! Just use that if you don't want an external gem dependency.
medik- has joined #ruby
<wereHamster>
why is there no Net::HTTPUnprocessableEntity in 1.8.7?
<wereHamster>
and what do I use in a 'case response; when X' to catch it?
<Spooner>
wereHamster: Just: when Net::HTTPUnprocessableEntity
margle has joined #ruby
fr00ty_l00ps has left #ruby [#ruby]
medik- has quit [Client Quit]
mucker has joined #ruby
<Spooner>
Unless I'm misunderstanding what you are trying to do.
<wereHamster>
oh, did I mention that there is, quote, "no Net::HTTPUnprocessableEntity in 1.8.7" ?
ZubKonst_ has joined #ruby
<Spooner>
I was answering your second question.
<wereHamster>
so how do I detect a 422 response then?
burgestrand has quit [Quit: Leaving.]
<Spooner>
There doesn't seem to be one in 1.9.3, so not sure why you are making that clear anyway.
quest88_ has joined #ruby
telling has quit [Ping timeout: 240 seconds]
<wereHamster>
I have a when Net::HTTPCreated, when Net::HTTPUnauthorized block etc. How do I handle a 422 response?
<Spooner>
wereHamster : Short answer is generate one and see what you get given in the code.
<sixteneighty>
thx Spooner
<wereHamster>
Spooner: how do I generate one? Where is the documentation how to generate one?
<Spooner>
There'll probably be a general HTTPUnknownError (just a guess) that manages all theones that aren't specifically named).
ZubKonst has quit [Ping timeout: 264 seconds]
<Spooner>
wereHamster : Well, presumably you are testing your script with all the responses you expect to have to deal with...
fuffi has joined #ruby
telling has joined #ruby
fuffi is now known as Ufo13
<JonnieCache>
anyone here who's sick of activerecord and has been thinking of trying out sequel - do it
<JonnieCache>
all the stuff in AR thats actually useful but much less bloat, and a lot less abstraction
<Spooner>
JonnieCache : I think we could do with more like that in Ruby ;)
replore has joined #ruby
krawchyk_ has quit [Remote host closed the connection]
<JonnieCache>
it still has abstractions, it is after all an ORM which is an abstraction pattern
<JonnieCache>
but it doesnt pile loads of other indirection on top of that
krawchyk has joined #ruby
xaq has joined #ruby
Goles has joined #ruby
quest88_ has quit [Quit: quest88_]
<Spooner>
wereHamster : Interestingly, Ruby 2.0 has Net::HTTPUnprocessableEntity :D
punkrawkR has joined #ruby
<JonnieCache>
AR sometimes feels like its adding abstraction just for the sheer thrill of it
<JonnieCache>
rails is like that in general but ar is the worst
sent-hil has joined #ruby
schleppy has quit [Quit: Leaving.]
<oz>
Sequel++
iamjarvo has quit [Ping timeout: 245 seconds]
chrishunt has joined #ruby
chussenot has quit [Quit: chussenot]
lolmaus has quit []
piotr_ has joined #ruby
piotr__ has quit [Ping timeout: 264 seconds]
<sixteneighty>
_axx: the string interpolation is not working, i have tried it this way '<string>\"#{ipa_file.bundle_identifier}\"</string>'
Doc_X has joined #ruby
monkegjinni has quit [Read error: No route to host]
chussenot has joined #ruby
quest88_ has joined #ruby
monkegjinni has joined #ruby
<matti>
sixteneighty: Its still in ''
<Spooner>
a) just use an xml builder (please) or b) "<string>#{ipa_file.bundle_identifier}</string>"
<matti>
Spooner: With \" \" inside.
dnyy has joined #ruby
<matti>
Spooner: If he has to quote something there.
noxoc has joined #ruby
<Spooner>
What? Why on earth do you need quotes inside xml? *gives up*
<matti>
No idea ;]
<matti>
He seem like he wantes it there.
<matti>
But it might be just him trying to get it to work.
<matti>
;p
* matti
hugs Spooner
<matti>
Spooner: Don't give up, shevy will miss you
maletor has joined #ruby
sent-hil has quit [Remote host closed the connection]
<_axx>
sixteneighty: you need to do it like this: "<string>#{ip_file_bundle_identifier}</string>"
Krists has quit [Read error: Connection reset by peer]
rippa has joined #ruby
<_axx>
sixteneighty: if you enclose your string with ' or " you need to do the opposite
psychouroboros has quit [Ping timeout: 252 seconds]
Coolhand has quit [Remote host closed the connection]
<sixteneighty>
_axx: jepp got it thx
<shevy>
people still use XML???
<_axx>
sixteneighty: good. :)
Serial_Killer_C has quit [Remote host closed the connection]
<sixteneighty>
:-)
<_axx>
shevy: in a captain fancy pants startup world that seems funny, but some people actually use XML. :D
manizzle has joined #ruby
ElderFain has joined #ruby
ElderFain has quit [Remote host closed the connection]
Serial_Killer_C has joined #ruby
joshman_ has joined #ruby
ElderFain has joined #ruby
<Spooner>
shevy : Have you seen that swarley is writing an XML gem from scratch in C? People love XML :D
sspiff has quit [Remote host closed the connection]
riley526 has quit [Ping timeout: 268 seconds]
<matti>
Spooner: Not because he loves it.
<matti>
Spooner: He is plain nuts.
<Spooner>
matti Oh, OK. That was sort of my assumption too.
<matti>
Spooner: Or, he is secretly a masochist who likes to entail mental harm upon himself.
<matti>
Spooner: :)
clj_newb has joined #ruby
<Spooner>
matti I prefer to waste my time developing stuff few people want that doesn't work in the end so no-one actually wants. I find life is simpler then.
nateberkopec has joined #ruby
<matti>
Spooner: ;)
bartj3 has quit []
hbpoison has quit [Ping timeout: 260 seconds]
yshh has joined #ruby
chrisja has joined #ruby
nari_ has joined #ruby
nari has quit [Ping timeout: 260 seconds]
quest88_ has quit [Quit: quest88_]
tk__ has quit [Quit: ばいばい]
<ShiintoRyuu>
I recently upgraded the brew ruby version and I think this is what caused my capistrano and capifony gem to break - is there something to cleanup/reinstall after updating ruby?
mikepack has joined #ruby
bbttxu has quit [Quit: bbttxu]
F1skr has joined #ruby
jprovazn is now known as jprovazn_away
take_cheeze has quit [Quit: Leaving.]
davidcelis has quit [Quit: K-Lined.]
take_cheeze has joined #ruby
v0n has quit [Ping timeout: 246 seconds]
axl_ has quit [Quit: axl_]
dhruvasagar has quit [Read error: Operation timed out]
shiroginne has joined #ruby
Serial_Killer_C has quit [Remote host closed the connection]
chussenot has quit [Quit: chussenot]
rehat has quit [Remote host closed the connection]
xpen has joined #ruby
areil_ has left #ruby [#ruby]
areil has joined #ruby
maesbn has quit [Remote host closed the connection]
Serial_Killer_C has joined #ruby
maesbn has joined #ruby
xpen_ has quit [Ping timeout: 244 seconds]
nari_ has quit [Ping timeout: 252 seconds]
baroquebobcat has joined #ruby
monkegjinni has quit [Ping timeout: 260 seconds]
xaq has quit [Remote host closed the connection]
Virunga is now known as LennyLinux
margle has quit [Quit: Computer has gone to sleep.]
maesbn has quit [Ping timeout: 260 seconds]
tos9 has quit [Ping timeout: 256 seconds]
delinquentme has joined #ruby
<delinquentme>
has anyone in here done ruby PHP integration?
senny has quit [Remote host closed the connection]
<delinquentme>
I'm not really a PHP developer ... b ut someone just dropped the bomb on me saying " I've heard ruby integrates well with PHP "
dpk has quit [Excess Flood]
hoelzro is now known as hoelzro|away
dpk has joined #ruby
bbttxu has joined #ruby
mando has joined #ruby
<regedarek>
Hello, guys how to set in module variable which will be availible in any class of this module?
<jcoglan>
instance variables, just like in a class
<jcoglan>
@foo = 'bar'
margle has joined #ruby
<jcoglan>
a fun fact: classes are just a special type of module. a module is a bag of methods with 0 or more parents (mixins)
hoofman has quit [Ping timeout: 246 seconds]
deadalus has joined #ruby
zf has joined #ruby
<jcoglan>
a class is just a module you can instantiate, plus it has additional inheritance semantics (single parent class, singleton methods are inheirted)
<jcoglan>
but constants are globally visible -- you can reference TwilioApp::FOO from anywhere
<regedarek>
and then in new class I would like to have access to @client
<jcoglan>
you might want this to be varaible then, rather than a constant, or make TwilioApp a class you can instantiate
<jcoglan>
module TwilioApp
<jcoglan>
class << self
aganov has quit [Remote host closed the connection]
<jcoglan>
attr_accessor :config, :client
<jcoglan>
end
<jcoglan>
end
<jcoglan>
then you can use TwilioApp.config = :blah
chussenot has joined #ruby
<JonnieCache>
delinquentme: who said that to you?
dreamfall has joined #ruby
lest has joined #ruby
<delinquentme>
JonnieCache, an academic
<delinquentme>
=P
<JonnieCache>
wtf
<JonnieCache>
they dont integrate at all
xpen has quit [Remote host closed the connection]
<JonnieCache>
i mean, you can integrate them like you can integrate any two systems, by exposing apis in a common format like json-over-http or 0mq or whatever
lledet has quit [Read error: Connection reset by peer]
<JonnieCache>
but i mean you can do that with any language
lledet has joined #ruby
<JonnieCache>
you should have asked them to elaborate
nitti has quit [Remote host closed the connection]
davidcelis has joined #ruby
slainer68 has quit [Ping timeout: 248 seconds]
ewag has quit [Ping timeout: 246 seconds]
sterNiX has joined #ruby
wedtm|away is now known as wedtm
yaymukund has quit [Ping timeout: 246 seconds]
bradhe has joined #ruby
kaawee has joined #ruby
<kaawee>
Hello! Does anybody uses Ruby Installer Development Kit under Windows?
v0n has joined #ruby
cbuxton has joined #ruby
xaq has quit [Remote host closed the connection]
cbuxton has quit [Client Quit]
ElderFain has quit [Ping timeout: 272 seconds]
bradhe has quit [Remote host closed the connection]
need_electricity has quit [Quit: Leaving]
need_electricity has joined #ruby
bluOxigen has quit [Ping timeout: 260 seconds]
hoelzro|away is now known as hoelzro
fgro has quit [Ping timeout: 264 seconds]
brianpWins has quit [Quit: brianpWins]
bauffman has joined #ruby
samuelj has joined #ruby
baphled has quit [Ping timeout: 248 seconds]
bauffman has left #ruby [#ruby]
khakimov has joined #ruby
<samuelj>
Hey everyone, i'm using bundler with jruby. If i specify in my gemfile that i need the jruby engine, can i just execute my ruby file as follows: bundle exec foo.rb ? Or do I need to use jruby -S bundle exec foo.rb
chussenot has joined #ruby
<samuelj>
Can someone actually explain why I should use exec at all?
aantix has joined #ruby
deadalus has quit [Ping timeout: 255 seconds]
margle has quit [Quit: Computer has gone to sleep.]
ryanlecompte has joined #ruby
hadees has joined #ruby
<shevy>
Spooner I dont understand this world anymore
<shevy>
today's young folks are all on facebook. I feel excluded :(
aantix has quit [Read error: Connection reset by peer]
aantix_ has joined #ruby
<shevy>
jrajav we all miss the bot
<jrist>
don't
Xeago has joined #ruby
<jrajav>
Oh crap I totally forgot about putting that VM up as a torrent
<shevy>
oh a bundle question
<jrajav>
Need to somehow remind myself tonight
<jrajav>
XD
<shevy>
who was the bundle expert... workmad3?
<shevy>
jrajav, nah come on
<shevy>
give in to laziness
<shevy>
embrace the sleep
<shevy>
:)
dnstbr has quit [Quit: Computer has gone to sleep.]
<jrajav>
Its too late! I already set an alarm
sent-hil has joined #ruby
<jrajav>
Now the laziest course is to NOT be lazy
<jrajav>
:P
aantix has joined #ruby
GoGoGarrett has quit [Read error: Connection reset by peer]
BSaboia has quit [Read error: Connection reset by peer]
BSaboia has joined #ruby
Trioke has joined #ruby
GoGoGarrett has joined #ruby
roadt has joined #ruby
<shevy>
hehe
sent-hil has quit [Remote host closed the connection]
<shevy>
oh man :(
chimay has quit [Quit: WeeChat 0.4.0-dev]
fjfish has quit [Ping timeout: 272 seconds]
<shevy>
I feel so lazy... I wanna finally learn C and vim at the same time, but laziness took hold of me again
<hoelzro>
shevy: you need to find a reason to learn C
<hoelzro>
why not write a Ruby extension using C?
Servidorv has quit [Quit: Some folks are wise, and some otherwise.]
<jrajav>
Why do you need a reason to learn C?
adaro has quit [Ping timeout: 245 seconds]
<jrajav>
Just think of a few simple problems and code them up
<shevy>
hoelzro well I kinda feel as if I dont really understand C alone
<jrajav>
I have a list of problems I run through for learning any new language
<shevy>
I had that working hello world example in ruby-c and that jukebox example from pickaxe, but C code is totally mysterious to me (save for the functions... those are quite similar to ruby... but pointers, man, they dont get into my old brain..)
noxoc has quit [Ping timeout: 256 seconds]
<Spooner>
kaawee : I do (use the devkit). What's up?
<shevy>
yeah
aantix_ has quit [Ping timeout: 246 seconds]
<shevy>
I can use arrays in C :)
<jrajav>
Pointers are tough
<shevy>
(not pointers of arrays though, I cant even remember the syntax without having to look at a reference)
<jrajav>
The thing that clicked for me when I was first learning about them was that they're really just indexes into a huge array representing memory
<shevy>
some & I think... or was it *
<shevy>
hmm
sertaconay has quit [Read error: Connection reset by peer]
<hoelzro>
& is to get a pointer
<jrajav>
& is for getting a pointer to something given the variable
<hoelzro>
* is to dereference
<jrajav>
* is the opposite, it dereferences a pointer
<shevy>
pointers are like arrays?
margle has joined #ruby
<jrajav>
* is also to declare pointer types
<jrajav>
No, pointers correspond to locations in memory
<jrajav>
Arrays are implemented with pointer arithmetic
cbuxton has joined #ruby
<jrajav>
An array variable is really just a pointer to the start of the array in memory, and doing something like a[4] increments that start pointer by 4 memory-locations
<Spooner>
ary == &ary[0] and ary[0] == *ary - all you need to know ;)
erichmenge has joined #ruby
<JonnieCache>
pointers arent complicated. its the concequences of using them thatll melt your brain
guns has quit [Quit: guns]
<jrajav>
Pointers are just numbers
schaary has left #ruby [#ruby]
<JonnieCache>
all the most complicated stuff is implemented simply
<jrajav>
That the computer understands as pointing to memory locations
Takehiro has quit [Remote host closed the connection]
<workmad3>
pointers are easy... forgetting to stop iterating over your pointer array and wandering off through memory, corrupting it as you go... that's the annoying part...
<heftig>
Spooner: the latter may not be writable. trying to modify a string literal will result in undefined behavior
arubin has joined #ruby
deadalus has joined #ruby
deadalus has quit [Changing host]
deadalus has joined #ruby
ddd has quit [Quit: Leaving.]
_md has joined #ruby
<Spooner>
heftig : I didn't say anything to the contary.
<heftig>
i know
a_a_g has joined #ruby
samuelj has quit [Quit: Leaving]
Coolhand has joined #ruby
zommi has quit [Quit: Leaving.]
margle has quit [Quit: Computer has gone to sleep.]
<Spooner>
Though I admit I didnt' realise that the former (foo[]) used the stack. My C is very rusty, but got resurrected for extensions, that are mostly a headache ;)
noxoc has quit [Quit: WeeChat 0.3.9]
Ankhers has quit [Remote host closed the connection]
sent-hil has joined #ruby
judd7 has joined #ruby
bradhe has joined #ruby
heftig has quit [Quit: leaving]
<Spooner>
The idea of using anything but char-arrays as constants in C is pretty laughable really. Any sane person would use a string object (well, not object, but I hope C has libraries that manage strings better than farting around with nulls and strlen and stuff).
<Spooner>
*using char-arrays as anything but constants
SegFaultAX|work has joined #ruby
<Spooner>
Although I wouldn't be surprised if you were considered, by C people, to be no better than Rubyists, if you didn't fly by the seat of your pants for _everything_.
<yxhuvud>
Spooner: bstring.
ephemerian has quit [Quit: Leaving.]
d2dchat has joined #ruby
<jrajav>
>> I hope C has libraries that manage strings better than farting around with nulls and strlen and stuff << Uh, what would you suggest?
<Spooner>
Oh good. C people aren't all crazy then.
mehrdad has joined #ruby
ananthakumaran has joined #ruby
* JonnieCache
only writes C in embedded environments
daniel_- has joined #ruby
daniel_- has joined #ruby
daniel_- has quit [Changing host]
<JonnieCache>
fuck managing your own memory on the desktop
<JonnieCache>
lifes too short
<jrajav>
There are modern, sane functions that don't allow for buffer overflows
<jrajav>
But other than that string processing in C is still mostly the same
<JonnieCache>
(unless your super optimising your physics engine or whatever)
<jrajav>
String objects in more "modern" languages bring along a lot of baggage and overhead
<Spooner>
jrajav : Yes and the assumption that 100% of your code needs to be optimised brings a lot of worthless effort.
<jrajav>
Well generally when you're writing in C it's because you're trying to avoid inherent overhead
sn0wb1rd has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
siyusong has joined #ruby
manizzle has quit [Ping timeout: 265 seconds]
<Spooner>
Yes, but unless your bottleneck is in string processing, using C-strings is just mascohism. You could make the same argument for never using any libraries, since you could roll-your-own and they'd be 10% faster for your specific usecase.
<yxhuvud>
actually, c-strings are usually not optimal from a performance perspective since a lot of the string methods have to recalculate the length all the time.
heftig has joined #ruby
<Spooner>
Good point.
margle has joined #ruby
rubious has joined #ruby
ddd has joined #ruby
hadees has quit [Quit: hadees]
<sent-hil>
what's the diff, between warden and omniath
<sent-hil>
From what I can get from their readme, they're competitor gems
stkowski has joined #ruby
Xeago has quit [Remote host closed the connection]
carloslopes has quit [Quit: Leaving.]
rakl has joined #ruby
need_electricity has quit [Quit: Leaving]
need_electricity has joined #ruby
_md has quit [Quit: Leaving...]
Serial_Killer_C has quit [Remote host closed the connection]
tosoa has joined #ruby
tosoa has quit [Client Quit]
macmartine has quit [Quit: Computer has gone to sleep.]
<JonnieCache>
warden is a generalised framework for doing auth
<JonnieCache>
it doesnt authenticate anything on its own, you have to build on top of it
xcbghz has quit [Read error: Connection reset by peer]
<JonnieCache>
omniauth is a whole ready-to-go authentication system which plugs into all the popular identity providers
<JonnieCache>
they work in similar ways, as rack middleware
Serial_Killer_C has joined #ruby
chrishunt has joined #ruby
<JonnieCache>
devise, which you may also have heard of, is built on warden, as are many other similar things
sent-hil has quit [Remote host closed the connection]
moted has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
h4mz1d has joined #ruby
francisfish has joined #ruby
JohnBat26 has quit [Ping timeout: 252 seconds]
akem has quit [Ping timeout: 260 seconds]
tjbiddle has joined #ruby
mahmoudimus has joined #ruby
brianpWins has joined #ruby
RomyRomy has joined #ruby
timmow has quit [Quit: is having a nap]
RomyRomy has quit [Client Quit]
beit has quit [Quit: beit]
UberNerdGirl has joined #ruby
need_electricity has quit [Quit: Leaving]
need_electricity has joined #ruby
v0n has quit [Ping timeout: 260 seconds]
hbpoison has joined #ruby
Neomex has quit [Ping timeout: 255 seconds]
hoelzro is now known as hoelzro|away
zigomir has quit [Ping timeout: 265 seconds]
endzyme has joined #ruby
jgrevich has joined #ruby
mneorr has quit [Remote host closed the connection]
irleif has joined #ruby
Xeago has joined #ruby
mneorr has joined #ruby
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
voodoofish430 has joined #ruby
irleif has quit [Client Quit]
minijupe has joined #ruby
apok has joined #ruby
lledet has quit [Read error: Connection reset by peer]
hbpoison has quit [Ping timeout: 272 seconds]
lledet has joined #ruby
alvaro_o has joined #ruby
beachandbytes has joined #ruby
schleppy has joined #ruby
ckrailo has joined #ruby
schleppy has left #ruby [#ruby]
leoncamel has quit [Ping timeout: 245 seconds]
telling has quit [Ping timeout: 246 seconds]
horsey has joined #ruby
baphled has joined #ruby
bluenemo has quit [Remote host closed the connection]
sent-hil has joined #ruby
<UberNerdGirl>
hi, i'm new to user authentication and user management for Ruby web frameworks (i'm learning through Sinatra, in particular) and am creating an app where t would like to use OmniAuth to handle all of that (Twitter and Facebook) Whilst googling 'omniauth sinatra', i came across Warden (https://github.com/hassox/warden_omniauth) OmniAuth-for-Sinatra (https://github.com/charliepark/omniauth-for-sinatra), and even a a 'Warden
ryanlecompte has quit [Read error: Connection reset by peer]
<UberNerdGirl>
My questions are 1) what does warden have to offer that Omniauth can't do by itself (it says 'authentication' in the Warden docs, but i thought that's just a basic concept OA should be taking care of?)
hoelzro|away is now known as hoelzro
v0n has joined #ruby
ryanlecompte has joined #ruby
iamjarvo has joined #ruby
<UberNerdGirl>
2) what would be an example of an app where it would be a good idea to use Warden with omniauth, and one where omniauth alone should do the job?
h4mz1d has quit [Ping timeout: 246 seconds]
c0rn_ has quit []
Takehiro has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
<Spooner>
UberNerdGirl : Just pasted a recent answer on a similar topic to your PM.
need_electricity has quit [Quit: Leaving]
jonathanwallace has quit [Remote host closed the connection]
DrShoggoth has joined #ruby
akem has joined #ruby
need_electricity has joined #ruby
telling has joined #ruby
telling has quit [Changing host]
telling has joined #ruby
jrist is now known as jrist-mtg
Takehiro has quit [Read error: No route to host]
Takehiro has joined #ruby
Neurotiquette has quit [Quit: Neurotiquette]
SegFaultAX|work has quit [Ping timeout: 240 seconds]
tosoa has joined #ruby
thepirateguy has joined #ruby
tosoa has quit [Remote host closed the connection]
adeponte has joined #ruby
<thepirateguy>
All open source and free software developers are thieves because they don't have a source of money, all pirate, warez, nulled and cracked software downloaders and users are thieves because it is against the rules to download software and shit pirately, and all software sellers are in a good position to kiss my ass, because there are pirate downloaders!
sertaconay has joined #ruby
nemesit has quit [Read error: Connection reset by peer]
nemesit has joined #ruby
<Spooner>
Shitting pirately sounds like fun!
<thepirateguy>
Shitting pirately sounds like fun!
himsin has joined #ruby
artOfWar has joined #ruby
artOfWar_ has joined #ruby
elsifaka has quit [Quit: Veloma e!]
JonnieCache has quit [Ping timeout: 246 seconds]
areil has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
dpatel has joined #ruby
<thepirateguy>
All open source and free software developers are thieves because they don't have a source of money, all pirate, warez, nulled and cracked software downloaders and users are thieves because it is against the rules to download software and shit pirately, and all software sellers are in a good position to kiss my ass, because there are pirate downloaders!
thepirateguy has left #ruby [#ruby]
kendrick_ is now known as kendrick
UberNerdGirl is now known as UberNerdGirl-afk
artOfWar has quit [Ping timeout: 255 seconds]
horsey has quit [Read error: Connection reset by peer]
Zai has quit [Quit: Zai]
freezey has quit [Quit: freezey]
need_electricity has quit [Quit: Leaving]
need_electricity has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
elaptics is now known as elaptics`away
<wmoxam>
lol thepirateguy
beachandbytes has quit [Ping timeout: 246 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
atran_ has joined #ruby
elsifaka has joined #ruby
margle has joined #ruby
jaannp has quit [Remote host closed the connection]
atran_ has quit [Read error: Connection reset by peer]
Spooner has quit []
need_dog has joined #ruby
need_dog has quit [Max SendQ exceeded]
telling has quit [Ping timeout: 268 seconds]
telling has joined #ruby
jcoglan has quit [Ping timeout: 255 seconds]
LennyLinux has quit [Remote host closed the connection]
goxncg has joined #ruby
hiroyuki has quit [Remote host closed the connection]
<Trioke>
I'm using $! to log the error message in a rescue block, but it doesn't show the (assumed) line number of the error. How can I also get the line number for the exception?
Rydefalk has quit [Read error: Connection reset by peer]
hunting_mom has joined #ruby
hunting_mom has quit [Max SendQ exceeded]
Rydefalk has joined #ruby
bwlang has joined #ruby
manizzle has joined #ruby
need_electricity has quit [Ping timeout: 268 seconds]
Juul has joined #ruby
jcaudle has joined #ruby
carlyle has joined #ruby
ewag has joined #ruby
mrsolo has joined #ruby
<Trioke>
I'm using $! to log the error message in a rescue block, but it doesn't show the (assumed) line number of the error. How can I also get the line number for the exception?
haxrbyte has joined #ruby
carloslopes has joined #ruby
haxrbyte_ has quit [Ping timeout: 246 seconds]
robustus has joined #ruby
<hoelzro>
Trioke: did you try calling $!.backtrace?
<claymore>
it spits out "import.rb:9:in `initialize': undefined local variable or method `a' for #<Bar:0x7f222d27b4a0> (NameError)"
irleif has quit [Client Quit]
emanu has joined #ruby
<hoelzro>
claymore: a is a lexical variable local to the block defining the module
<hoelzro>
it's not in the scope of the class
gmci has joined #ruby
<hoelzro>
constants would be, as would methods
adeponte has quit [Remote host closed the connection]
bradhe has quit [Remote host closed the connection]
<claymore>
hmm, I see
d3vic3 has joined #ruby
<claymore>
thanks
baphled has quit [Ping timeout: 260 seconds]
need_electricity has joined #ruby
shevy has quit [Ping timeout: 246 seconds]
Xeago has quit [Remote host closed the connection]
robotmay_ has joined #ruby
cbuxton has joined #ruby
bluOxigen has joined #ruby
nitti has joined #ruby
Xeago has joined #ruby
slainer6_ has quit [Remote host closed the connection]
slainer68 has joined #ruby
sent-hil has quit [Remote host closed the connection]
robotmay has quit [Ping timeout: 246 seconds]
bricker has joined #ruby
sent-hil has joined #ruby
judd7 has quit [Quit: judd7]
clj_newb has joined #ruby
LennyLinux has joined #ruby
slainer68 has quit [Ping timeout: 244 seconds]
chussenot has quit [Quit: chussenot]
haxrbyte has quit [Ping timeout: 256 seconds]
prettymuchbryce has quit [Remote host closed the connection]
carlyle_ has joined #ruby
a_a_g has quit [Quit: Leaving.]
Xeago has quit [Ping timeout: 246 seconds]
havenn has joined #ruby
jrajav has quit []
dmiller has quit [Remote host closed the connection]
carlyle has quit [Ping timeout: 245 seconds]
bluOxigen has quit [Ping timeout: 256 seconds]
LennyLinux has quit [Remote host closed the connection]
clj_newb has quit [Ping timeout: 248 seconds]
zmo_ has quit [Ping timeout: 240 seconds]
jgarvey has joined #ruby
shevy has joined #ruby
hbpoison has joined #ruby
Takehiro has quit [Remote host closed the connection]
judd7 has joined #ruby
eldariof has joined #ruby
tvw has quit [Ping timeout: 240 seconds]
KALP is now known as cout
judd7 has quit [Client Quit]
havenn has quit [Ping timeout: 256 seconds]
Neomex has joined #ruby
need_electricity has quit [Quit: Leaving]
need_electricity has joined #ruby
bradhe has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
judd7 has joined #ruby
adeponte has joined #ruby
bradhe has quit [Remote host closed the connection]
bradhe has joined #ruby
adeponte has quit [Remote host closed the connection]
jeffsmykil has joined #ruby
<jeffsmykil>
any reason file.puts "CREATE\\RENTAL\\#{type}\\#{type}-#{x}" wouldnt print on a single line?
<hoelzro>
jeffsmykil: if type or x has a newline in it?
<jeffsmykil>
a carriage return
<jeffsmykil>
line seperated list
chussenot has joined #ruby
chussenot has quit [Client Quit]
sent-hil has quit [Remote host closed the connection]
yaymukund has joined #ruby
samphippen has joined #ruby
elico has joined #ruby
adeponte has joined #ruby
sebastorama has joined #ruby
dmiller has joined #ruby
imami|afk is now known as banseljaj
c0rn_ has joined #ruby
<jeffsmykil>
hoelzro: do i need to chomp the last number somehow?
<hoelzro>
I don't know; where are you getting those values from?
cardoni has joined #ruby
<jeffsmykil>
a text document
kaawee has joined #ruby
Goles has quit [Ping timeout: 252 seconds]
mneorr has quit [Remote host closed the connection]
margle has quit [Ping timeout: 260 seconds]
irleif has joined #ruby
piotr__ has joined #ruby
piotr_ has quit [Ping timeout: 260 seconds]
itnomad has joined #ruby
yshh has quit [Remote host closed the connection]
need_electricity has quit [Quit: Leaving]
need_electricity has joined #ruby
ukd1 has joined #ruby
siyusong has quit [Quit: Computer has gone to sleep.]
fermion has joined #ruby
k4mirox has joined #ruby
Juul has quit [Ping timeout: 255 seconds]
slainer68 has joined #ruby
anderse has quit [Quit: anderse]
sent-hil has joined #ruby
a_a_g has joined #ruby
siyusong has joined #ruby
clj_newb has joined #ruby
jbw has quit [Ping timeout: 276 seconds]
emmanuelux has joined #ruby
emmanuelux has quit [Read error: Connection reset by peer]
havenn has joined #ruby
Krists has joined #ruby
Takehiro has joined #ruby
h4mz1d has joined #ruby
n1x has joined #ruby
Krists has quit [Client Quit]
irleif has quit [Quit: Computer has gone to sleep.]
mucker has quit [Quit: leaving]
<RubyPanther>
Are there any books that cover RACC extensively?
BSaboia__ has joined #ruby
BSaboia has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
irleif has joined #ruby
<RubyPanther>
I am way down the rabbit hole without any manuals (trying to figure out Journey so I can parse rails routes.rb outside of rails)
havenn has quit [Ping timeout: 260 seconds]
zmo_ has joined #ruby
icole has joined #ruby
GoGoGarrett has joined #ruby
werdnativ has joined #ruby
stkowski has quit [Quit: stkowski]
<RubyPanther>
None of the parts are documented, and the code is all divided up in a way that makes sense... once you've read every file and cross-referenced them
nitti has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
<rakl>
is something like this possible for a ruby array? ` [1, 2, 3].delete(1,2)`
nitti has joined #ruby
<rakl>
instead of doing it in two lines
arturaz has quit [Ping timeout: 240 seconds]
clj_newb has quit [Ping timeout: 260 seconds]
<RubyPanther>
rakl: if they are continuous you can assign an empty array to a range: arr = %w! one two buckle my shoe ! ; arr[0,2]=[] ; arr
judd7 has quit [Quit: judd7]
emanu has quit [Quit: emanu]
Takehiro has quit [Ping timeout: 245 seconds]
<RubyPanther>
rakl: or use Array#slice!
nitti has quit [Ping timeout: 255 seconds]
werdnativ has quit [Quit: FAMOUS_LAST_WORDS is nil]
<rakl>
no not necessarily continous
<RubyPanther>
If you want two ranges you're out of luck, there is no #slap_chop!
<rakl>
i have an array and just want to remove to specific items
riley526 has joined #ruby
<rakl>
can't chain .delete because that returns the deleted items
centipedefarmer has quit [Quit: This computer has gone to sleep]
<xclite>
rakl any reason [1, 2, 3] - [1, 2] doesn't work for you?
jbw has joined #ruby
shadoi has joined #ruby
<rakl>
xclite nope, that's perfect
<rakl>
the simplest solutions escape me
<xclite>
rakl, well it's one of those things you always want that Ruby is nice enough to have :)
need_electricity has quit [Quit: Leaving]
samphippen has quit [Quit: Computer has gone to sleep.]
need_electricity has joined #ruby
<rakl>
hmm actually turns out that my use case is slightly more complicated than I thought. aka, I'm removing objects based on an attribute, rather than the object itself. so I can't subtract. But I'll just write a bool method
<rakl>
probably better to have that than to hardcode it into the logic anyway
<xclite>
arr = arr.reject{|o| o.attr = key}
<xclite>
?
<xclite>
or
<xclite>
duh
<xclite>
arr.reject!
<xclite>
lol
<xclite>
o.attr == key, because i fail at life
havenn has joined #ruby
<RubyPanther>
Ruby is so easy, you never need a Schwartzian
emanu has joined #ruby
Konboi_ has joined #ruby
axl_ has joined #ruby
<xclite>
RubyPanther, I'm dumb - what does that mean? or is that googleable
sent-hil has quit [Remote host closed the connection]
<blazes816>
sort_by is just a fancy schwartzian
nitti has joined #ruby
<xclite>
it's googleable nvm
emanu has quit [Client Quit]
Forevernade has joined #ruby
Konboi has quit [Ping timeout: 240 seconds]
<RubyPanther>
I was trying to sound cool by leaving off the word "Transform," sorry
<xclite>
well there's not really a reject_by, right?
<blazes816>
no, because reject is an O(n) algorithm
<blazes816>
it would never need to execute the block more than once
<rakl>
reject is a handy dandy method
choffstein has joined #ruby
<blazes816>
oh yeah it is
<xclite>
i use reject all the time
<xclite>
i'm abusive
<RubyPanther>
I try to use #collect when I can
ForevernadeAFK has quit [Ping timeout: 252 seconds]
<blazes816>
you mean select?
obryan has joined #ruby
mehrdad has quit [Remote host closed the connection]
<blazes816>
or do you mean you prefer to full-on map shit you don't want out
minijupe has quit [Quit: minijupe]
xorigin has joined #ruby
roadt has quit [Ping timeout: 246 seconds]
<blazes816>
and if we get a bot again ever, it needs to find tokens of the pattern #foo and give a link to ruby docs for that method, making a best guess effort
<RubyPanther>
lol no you're right I grabbed the first inclusive method I could to counter abusive rejection
axl_ has quit [Quit: axl_]
<blazes816>
lol
axl_ has joined #ruby
xorigin has left #ruby [#ruby]
Tearan has joined #ruby
judd7 has joined #ruby
freezey has joined #ruby
bluOxigen has joined #ruby
Russell^^ has joined #ruby
freezey has quit [Client Quit]
sent-hil has joined #ruby
goxncg has quit [Remote host closed the connection]
freezey has joined #ruby
Tearan has quit [Quit: Sleepy Badger....]
cardoni has quit [Quit: cardoni]
siyusong has quit [Quit: Computer has gone to sleep.]
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
brendan` has quit [Quit: This computer has gone to sleep]
Ankhers has joined #ruby
Ankhers has quit [Remote host closed the connection]
<claymore>
so one probably shouldn't define variables in a module that are local to the module?
gwpwyy has joined #ruby
freezey has joined #ruby
emmanuelux has joined #ruby
kirun has quit [Ping timeout: 268 seconds]
sent-hil has quit [Remote host closed the connection]
tos9 has joined #ruby
<claymore>
I'm still not entirely sure why mine doesn't work
Michae___ has joined #ruby
havenn has joined #ruby
havenn has quit [Remote host closed the connection]
itnomad has quit [Quit: Leaving]
havenn has joined #ruby
Serial_Killer_C has quit [Remote host closed the connection]
anderse has joined #ruby
Scriptwriter has joined #ruby
tchebb has quit [Read error: Connection reset by peer]
jrist-mtg is now known as jrist
judd7 has quit [Quit: judd7]
need_electricity has quit [Quit: Leaving]
need_electricity has joined #ruby
cardoni has joined #ruby
Serial_Killer_C has joined #ruby
UberNerdGirl-afk has quit [Quit: UberNerdGirl-afk]
roychri has joined #ruby
clj_newb has joined #ruby
<roychri>
If I make a class with a module, how can a method in the module access the instance and/or the class of the includer (the one including the module) ?
bapa has joined #ruby
xorgnak has quit [Remote host closed the connection]
judd7 has joined #ruby
<TTilus>
roychri: see incuded callback
<TTilus>
roychri: if i got what you are after
choffstein has quit [Remote host closed the connection]
<roychri>
TTilus: ok, thanks. I will look.
irleif has quit [Quit: Computer has gone to sleep.]
<roychri>
TTilus: In my module I have a method that needs to create an instance of the class that included this module.
schabe has joined #ruby
<roychri>
TTilus: I can gist it.
<TTilus>
please do
hoofman has joined #ruby
skyjumper has joined #ruby
skyjumper has left #ruby [#ruby]
tchebb has joined #ruby
samphippen has joined #ruby
jamesaxl has quit [Ping timeout: 272 seconds]
tchebb has quit [Remote host closed the connection]
jamesaxl has joined #ruby
<TTilus>
prolly you just need self.class.new or self.new
chussenot has joined #ruby
Morkel_ has joined #ruby
chin-tastic has quit [Ping timeout: 265 seconds]
Takkote has joined #ruby
Morkel has quit [Ping timeout: 252 seconds]
Morkel_ is now known as Morkel
gwpwyy has quit [Remote host closed the connection]
bapa has quit [Ping timeout: 240 seconds]
Michae___ has quit [Remote host closed the connection]
Michae___ has joined #ruby
<roychri>
TTilus: Now I realized I explained it wrong. My module will have a class (if it is possible?)
<Mon_Ouie>
kn330: Methods don't close over local variables
<sent-hil>
kn330: turn a into a method that returns 10
internet_user has joined #ruby
skipper has quit [Read error: Operation timed out]
<Mon_Ouie>
You can use define_method with a block when you need to define a method dynamically depending on some variables
swarley has joined #ruby
ephemerian has joined #ruby
<kn330>
booyakah: @@a=10 doesn't work.
<booyakah>
kn330, u need to "puts @@a" then as well
nitti has quit [Ping timeout: 252 seconds]
xorgnak has joined #ruby
<kn330>
booyakah: ah!
<booyakah>
kn330, works?
<kn330>
sent-hil: thanks for the tip :)
<kn330>
booyakah: yeah, it works!
Takehiro has quit [Ping timeout: 240 seconds]
<booyakah>
sweet
<Mon_Ouie>
Class variables are usually avoided because they are shared with all the ancestry tree up to the point where it is defined
jrist is now known as jrist-afk
yshh has quit [Ping timeout: 246 seconds]
<Mon_Ouie>
Plus depending on the actual problem, it probably doesn't make sense to use one at all here
<kn330>
Mon_Ouie: Ohk, this was just an example. In my case I need to access a few variables across different methods
kirun has joined #ruby
pyrotechnick has joined #ruby
sertaconay has quit [Ping timeout: 246 seconds]
<kn330>
passing them as a parameters to each method is an option but then it looked boring ;)
<pyrotechnick>
what do you guys think of wycats?
<Mon_Ouie>
Do those variables actually change at runtime?
<kn330>
Mon_Ouie: Not all of them do
<Mon_Ouie>
Well, I'd tend to recommend class instance variables (just an ivar defined at class-level) over class variables then
<Mon_Ouie>
And also constants
irleif has joined #ruby
k4mirox has quit [Ping timeout: 240 seconds]
JonnieCache has joined #ruby
<kn330>
Mon_Ouie: Ok. Btw I'm pretty noob in OOP, just started :)
<yxhuvud>
Mon_Ouie: are there any situations where you'd recommend @@ variables?
dpk has quit [Quit: Terminated with extreme prejudice - dircproxy 1.2.0]
pyrotechnick has left #ruby [#ruby]
judd7 has quit [Quit: judd7]
<ddd>
detect_troll(pyrotechnick)
the_jeebster has joined #ruby
hoelzro is now known as hoelzro|away
<Mon_Ouie>
Actually, I remember having seen cases where I thought using them wasn't actually bad — but I can't remember exactly what.
<Mon_Ouie>
I think something like an instance counter, where you'd want the counter to be increased for every instance of your class and of one of its subclasses
samphippen has quit [Quit: Computer has gone to sleep.]
<yxhuvud>
give it an explanation in a comment and I'd agree.
awarner has quit [Remote host closed the connection]
sertaconay has joined #ruby
reinaldob has quit [Remote host closed the connection]
russfrank has joined #ruby
h4mz1d has quit [Ping timeout: 246 seconds]
shikamaru has quit [Ping timeout: 256 seconds]
ananthakumaran has quit [Quit: Leaving.]
UberNerdGirl has joined #ruby
JonnieCache has quit [Ping timeout: 260 seconds]
delinquentme has quit [Ping timeout: 246 seconds]
ablew has left #ruby [#ruby]
shikamaru has joined #ruby
x82_nicole has joined #ruby
replore has quit [Remote host closed the connection]
clj_newb has quit [Ping timeout: 256 seconds]
ukd1 has quit [Quit: leaving]
mando has quit [Remote host closed the connection]
<swarley>
I think after I finish this XML library im going to write another VM
<blazes816>
VM for what?
<blazes816>
Fortran?
<swarley>
No, I was using parrot the other day and I was thinking
<swarley>
This is really high level, what a neat concept for a vm
joaoh82 has joined #ruby
<swarley>
But then
<swarley>
Its slow
<swarley>
So I thought to myself, classes really aren't that complicated, what is keeping you from turning the code into machine code and throwing the vm into an executable with it?
<swarley>
Implementation
<swarley>
That's all
recycle has joined #ruby
<swarley>
So I figure, first make a base level vm system, then write a language wrapper for it
R3dy has joined #ruby
chussenot has quit [Quit: chussenot]
<R3dy>
I'm trying to figure out how to use cookies with net/http
<swarley>
Rewrite the compiler in the language itself and you've got super complicated dynamically compiled code
<R3dy>
everywhere I google I see this resp, data = http.get(path, nil)
<swarley>
But you don't even need that unless you are using an eval function
dpk has joined #ruby
<R3dy>
but when I run that I get this error
<R3dy>
initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)
samphippen has joined #ruby
adeponte has quit [Remote host closed the connection]
tchebb has quit [Read error: Connection reset by peer]
havenn has quit [Remote host closed the connection]
<Servidorv>
hey guys
<Servidorv>
i have a question
Michae___ has quit [Remote host closed the connection]
joaoh82 has quit [Remote host closed the connection]
dpk has quit [Quit: Terminated with extreme prejudice - dircproxy 1.2.0]
<Servidorv>
i have this code from = Date.commercial(params['from_year'].to_i, params['from'].to_i).to_time.to_s and from is the week number of the year and from_year is the year
joaoh82 has joined #ruby
<Servidorv>
how can i change it so instead of giving the week # and year i just give the unix timestamp
<Servidorv>
??
pwelch has joined #ruby
swarley has quit [Ping timeout: 260 seconds]
jamjam has joined #ruby
sebastorama has quit [Quit: Computer has gone to sleep.]
dnstbr has joined #ruby
BSaboia__ has quit [Read error: Connection reset by peer]
maletor has quit [Quit: Computer has gone to sleep.]
<booyakah>
kn330, you expect to output 0000111 instead of 111?
<kn330>
basically I'm converting an integer to its equivalent binary using "7.to_s(2)" but I need an output with 8 bits i.e. "00000111" and not just "111"
deadalus has quit [Quit: Leaving]
h4mz1d has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
<kn330>
any way that ruby could do it, without me writing a method for it?
Axsuul has joined #ruby
rakl has quit [Quit: sleeping]
chussenot has quit [Quit: chussenot]
LouisGB has quit [Ping timeout: 265 seconds]
samphippen has joined #ruby
francisfish has joined #ruby
yekta has joined #ruby
<blazes816>
use string formatting
Neomex has quit [Quit: Neomex]
perun_ has quit [Ping timeout: 245 seconds]
<blazes816>
I can't remember the exact ruby syntax but something like "%8d" % 7.to_s(2).to_i
LouisGB has joined #ruby
recycle has quit [Remote host closed the connection]
swarley| has quit [Ping timeout: 246 seconds]
bricker_ has joined #ruby
tchebb has joined #ruby
mneorr has quit [Remote host closed the connection]
leifmadsen has quit [Read error: Connection reset by peer]
samphippen has quit [Client Quit]
<kn330>
blazes816: tried that but it adds blank spaces, I need zero's
Servidorv has quit [Quit: OUCH!!!]
<blazes816>
you should be able to specify the pad character somehow
UberNerdGirl has quit [Ping timeout: 260 seconds]
Vinz_ is now known as Vinz_`
jcoglan has joined #ruby
glyytchy has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
bricker has quit [Ping timeout: 265 seconds]
Vinz_` is now known as Vinz_
a_a_g has quit [Quit: Leaving.]
joaoh82 has quit [Remote host closed the connection]
joaoh82 has joined #ruby
h4mz1d has quit [Ping timeout: 252 seconds]
irleif has joined #ruby
chussenot has joined #ruby
yekta has quit [Quit: yekta]
nlpplz has quit [Ping timeout: 252 seconds]
burgestrand has joined #ruby
linoj has quit [Ping timeout: 264 seconds]
hotovson has quit [Remote host closed the connection]
samphippen has joined #ruby
<kn330>
blazes816: how? :|
<blazes816>
idk, google it. if I knew I would have said.
glyytchy has quit [Client Quit]
rabidpraxis has quit [Remote host closed the connection]
UberNerdGirl has joined #ruby
ngoldman has joined #ruby
thedeadghost has quit [Read error: Connection reset by peer]
glyytchy has joined #ruby
<booyakah>
kn330, maybe not a good solution but can't you replace the blank spaces with zeros?
panpainter has joined #ruby
irleif has quit [Client Quit]
hotovson has joined #ruby
<kn330>
7.to_s(2).rjust(8,"0") | B)
<kn330>
blazes816: got it! ^
<blazes816>
oh, nice
murtaughlist has quit []
murtaughlist has joined #ruby
murtaughlist has quit [Client Quit]
mando has joined #ruby
xclite has quit [Remote host closed the connection]
n1x has quit [Quit: Ex-Chat]
h4mz1d has joined #ruby
perun_ has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
hotovson has quit [Ping timeout: 246 seconds]
minijupe has joined #ruby
nitti has joined #ruby
vlad_starkov has joined #ruby
mva3212 has joined #ruby
mrsolo has joined #ruby
Takehiro has joined #ruby
piotr__ has joined #ruby
yaroslav has joined #ruby
piotr_ has quit [Ping timeout: 260 seconds]
kirun has quit [Ping timeout: 272 seconds]
leggomygreggo has joined #ruby
<leggomygreggo>
Has anyone used the clockwork gem?
drago757 has joined #ruby
<ddd>
this is pretty cool. http://overapi.com/ruby/ someone made a cheatsheet page where you can click on what method in the docs you want to see and takes you direct to that section (e.g File::absolute_path). Makes it easy to scan for what you want and then go right where you want.
xclite has joined #ruby
tos9 has quit [Quit: leaving]
Takehiro has quit [Ping timeout: 240 seconds]
ewag has quit [Ping timeout: 246 seconds]
h4mz1d has quit [Ping timeout: 246 seconds]
mva3212 has quit [Remote host closed the connection]
Servidorv has joined #ruby
Scriptwriter has quit [Ping timeout: 245 seconds]
rippa has quit [Ping timeout: 244 seconds]
nlpplz has joined #ruby
und3f has quit [Quit: Leaving.]
h4mz1d has joined #ruby
pwelch has quit [Ping timeout: 246 seconds]
answer_42 has quit [Ping timeout: 276 seconds]
armenb has quit [Ping timeout: 246 seconds]
mneorr has joined #ruby
tos9 has joined #ruby
leggomygreggo has quit [Quit: leggomygreggo]
anderse has quit [Quit: anderse]
awarner has joined #ruby
chussenot has quit [Quit: chussenot]
alexbst has quit [Remote host closed the connection]
yaroslav has quit [Quit: yaroslav]
nitti has quit [Remote host closed the connection]
nitti has joined #ruby
carlyle_ has quit [Remote host closed the connection]
<roychri>
I am trying to build a module which allow for chainable method and have the module automatically call some method at the end (to process the stack built by the chained method). Much like Rails ability to do alist = Thing.where(:hit => 3..99).limit(5).order("id DESC") ... the SQL query is only executed once, either when I do alist.each or alist.first... I know I mentions rails but only because I want to achieve something simil
<roychri>
ar, not because I am in rails. Is there some easy way or do I have to define every possible scenario?
irleif has joined #ruby
joaoh82 has quit [Remote host closed the connection]
mark_locklear has quit [Remote host closed the connection]
<telagraphic>
re reading your question... you talking about your each ..puts one?
<otters>
I'm talking about |k,(v1,v2)|
<blazes816>
he means that expanded args
xeronic has joined #ruby
<telagraphic>
ok, well idk about that part, what are you trying to ask???
<blazes816>
imagine the code that calls the block appends an * in front of it to expand it
<blazes816>
v1, v2 = *[1, 2]
<otters>
okay
Beoran__ has joined #ruby
ffranz1 has joined #ruby
voodoofish has joined #ruby
<xeronic>
Can someone please look at my code at: http://codepad.org/IbYH949P . The problem is that the else clause is always run, even thou command = "users"
<otters>
so "implicit splatting"
<blazes816>
basically
<blazes816>
IF you use ()
<blazes816>
if you don't, it won't
<blazes816>
so if you just had "v1", it would be = to [1,2]. if you have "(v1, v2)", v1 = 1, and v2 = 2
Beoran_ has quit [Ping timeout: 260 seconds]
ffranz has quit [Ping timeout: 244 seconds]
chussenot has joined #ruby
<telagraphic>
is your case syntax correct?
judd7 has quit [Quit: judd7]
<telagraphic>
nvrmind, it is
_md has joined #ruby
mklappstuhl has joined #ruby
kevinfish1 has joined #ruby
Xeago has joined #ruby
haxrbyte has joined #ruby
<telagraphic>
xeronic: idk! looks legit...
jcaudle has quit [Quit: jcaudle]
Michae___ has joined #ruby
<telagraphic>
xeronic: but it does run your case match too?
Michae___ has quit [Read error: Connection reset by peer]
geekbri has quit [Remote host closed the connection]
dotemacs has quit [Quit: Connection closed for inactivity]
_bry4n has joined #ruby
r4um has quit [Ping timeout: 272 seconds]
sent-hil has joined #ruby
<Spooner>
scriabin : If you are doing sed/sort stuff, wouldn't it be as easy to do it in Ruby or would that be too slow? No idea why it isn't working though.
tos9 has quit [Excess Flood]
manizzle has quit [Ping timeout: 260 seconds]
nari_ has joined #ruby
slainer68 has joined #ruby
piotr__ has quit [Ping timeout: 260 seconds]
horofox has joined #ruby
<horofox>
is ubygems down?
<horofox>
ruby*
tos9 has joined #ruby
tos9 has quit [Excess Flood]
cardoni has quit [Quit: cardoni]
<Spooner>
horofox https://rubygems.org and the gem command seem to work for me. Not sure which you meant.
LouisGB has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
<horofox>
Spooner: I was getting some errors when running bundle, but it's up for me now.
<Spooner>
Oh, OK.
_bry4n has quit [Remote host closed the connection]
xeronic has quit []
<horofox>
Spooner: thank for the help, tho
zf has quit [Quit: leaving]
ElderFain has quit [Ping timeout: 272 seconds]
Russell^^ has quit [Quit: Russell^^]
scriabin has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 255 seconds]
<Spooner>
scriabin : Actually, looking at it again, I'm wondering if \n isn't being passed as the character to sed as a newline character, rather than a blackslash and and an n character. Tried \\n in the seds? and \\ for the other backslashes perhaps?
Forevernade has quit [Remote host closed the connection]
sent-hil has quit [Remote host closed the connection]
nateberkopec has joined #ruby
slainer68 has quit [Ping timeout: 260 seconds]
sent-hil has joined #ruby
nateberkopec has quit [Client Quit]
Vinz_ is now known as Vinz_`
sent-hil has quit [Remote host closed the connection]
gabrielrotbart has quit [Remote host closed the connection]
judd7 has quit [Quit: judd7]
tos9 has joined #ruby
tos9_ has joined #ruby
bier has quit [Ping timeout: 252 seconds]
vlad_starkov has joined #ruby
riley526 has quit [Remote host closed the connection]
Forevernade has joined #ruby
Vinz_` is now known as Vinz_
CaptainKnots has quit [Read error: Connection reset by peer]
joshman_ has quit [Read error: Operation timed out]
maxmmurphy has quit [Ping timeout: 260 seconds]
riley526 has joined #ruby
manizzle has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
Foxandxss has joined #ruby
Orcris has joined #ruby
Takehiro has joined #ruby
banseljaj is now known as imami|afk
baroquebobcat has quit [Quit: baroquebobcat]
Vinz_ is now known as Vinz_`
joaoh82 has quit [Remote host closed the connection]
endzyme has quit [Remote host closed the connection]
joaoh82 has joined #ruby
GoGoGarrett has joined #ruby
mando has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 260 seconds]
tos9_ has quit [Quit: leaving]
tos9_ has joined #ruby
Takehiro has quit [Ping timeout: 240 seconds]
r4um has joined #ruby
Vinz_` is now known as Vinz_
Mon_Ouie has quit [Ping timeout: 246 seconds]
Mon_Ouie has joined #ruby
robotmay_ has quit [Ping timeout: 246 seconds]
lkba has quit [Ping timeout: 260 seconds]
bier has joined #ruby
tos9_ has quit [Quit: leaving]
tos9 has quit [Excess Flood]
Konboi_ has quit [Remote host closed the connection]
gabrielrotbart has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
friskd has joined #ruby
nitti has quit [Remote host closed the connection]
tos9 has joined #ruby
judd7 has joined #ruby
GVRV has joined #ruby
Vinz_ is now known as Vinz_`
Xeago has quit [Remote host closed the connection]
joaoh82 has quit [Remote host closed the connection]
joaoh82 has joined #ruby
tils has joined #ruby
tils has left #ruby [#ruby]
tils has joined #ruby
Nisstyre has quit [Quit: Leaving]
UberNerdGirl has joined #ruby
Vinz_` is now known as Vinz_
Nisstyre has joined #ruby
lkba has joined #ruby
zodiak has quit [Remote host closed the connection]
carlyle has joined #ruby
_bry4n has joined #ruby
nesoi has joined #ruby
IrishGringo has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121010144125]]
jrist is now known as jrist-afk
freezey has quit [Quit: freezey]
<nesoi>
hello, I'm new to Ruby and I'm trying to build db files on a new machine using rake. I have 3 files in db/migrate: 001_create_table_1.rb, 002_create_table_2.rb and 004_modify_table_1.rb. When I run rake, it seems to execute the 1st 2 but then complains that table_1 already exists and it won't execute the 3rd one. What should I do?
stkowski has quit [Quit: stkowski]
<blazes816>
what is your 3rd migration?
<nesoi>
the 004_modify_table_1.rb
carlyle has quit [Remote host closed the connection]
tjbiddle_ has joined #ruby
<nesoi>
oh sorry
scoobysnacks has quit [Quit: scoobysnacks]
sakh_ has joined #ruby
<nesoi>
it executes the 004 and 002, but not the 001 because the table already exists
manizzle has quit [Ping timeout: 256 seconds]
<nesoi>
maybe that's okay?
ukd1 has quit [Quit: Lost terminal]
erichmenge has joined #ruby
<blazes816>
no, what are the actual contents of the file?
<blazes816>
put it on gist.github.com
<nesoi>
which file blazes816?
LouisGB has quit [Ping timeout: 246 seconds]
Michael__ has quit [Remote host closed the connection]
<blazes816>
the one that causes the error. probably 004_modify_table_1.rb