<catphish>
i want uncached dns results, but its sufficient to do a cached request for the domain's NS records, then do a request to those for the data i want :)
<catphish>
bnagy: it's incredibly unlikely that root responses require TCP
Ontolog has joined #ruby
<catphish>
but its possible i guess
<bnagy>
jeax: I think you need <<-EOF
<bnagy>
cause your heredoc ends are indented, try that
<jeax>
bnagy, add the dash to the beginning or end EOF?
<bnagy>
start
theRoUS has joined #ruby
<jeax>
bnagy, that fixes the highlighting, lets see how it goes.
kenperkins has quit [Quit: Computer has gone to sleep.]
<Dreamer3>
ah
<Dreamer3>
it's different method_missing or different *args behavior
<jeax>
bnagy, tada! thanks.
<bnagy>
np
<Dreamer3>
the assignment is happing with method_missing and that's what's messing things up
<kizzx2>
hey guys, i attached to a running instance of ruby using gdb, and then did `call rb_eval_string("p 3")` `detach`, STDOUT gives "3" but then the ruby program seems to have halted after i detached.... ideas?
TPFC-SYSTEM has joined #ruby
asobrasil has joined #ruby
iocor has quit [Quit: Computer has gone to sleep.]
raja has joined #ruby
yekta has joined #ruby
gibsonfs has joined #ruby
raja is now known as Guest13353
lxsameer has quit [Quit: Leaving]
randomautomator has joined #ruby
theRoUS has quit [Ping timeout: 240 seconds]
<Dreamer3>
does * not work the same in ruby 1.9?
<Dreamer3>
for expanding arrays
<banisterfiend>
Dreamer3: it works slightly differently in some contexts
<bnagy>
kizzx2: I odn't know gdb, but do you need to go before you detach?
<Dreamer3>
@attributes[att] = *args
Ontolog has quit [Remote host closed the connection]
<Dreamer3>
seems diff
<Dreamer3>
how can i get the previous behavior?
<kizzx2>
bnagy: usually no, but i did a `continue` and the same
<banisterfiend>
Dreamer3: what behaviour do u want, can u describe it
strk has left #ruby [#ruby]
<kizzx2>
the interesting thing is... i was using test.rb which is `sleep 10000`, so when I broke in ruby was in a blocking system call...
<kizzx2>
when i tried test2.rb `(1..Float::INFINITY).each { |i| p i }` and do `call rb_eval_string("p 3")`, i get "recursive deadlock" exception from ruby immediately
<Hanmac>
shevy you are half right ... i wrote my own "wxruby"
<enroxorz>
i have an app with wxruby but i havent found a good designer that helps.
_iMBA has joined #ruby
thone_ has quit [Ping timeout: 264 seconds]
Targen has joined #ruby
<shevy>
so you search not only a GUI toolkit, but also a good designer :)
<shevy>
I found glade really unusable, so I can no longer recommend ruby-gtk
<enroxorz>
shevy: i would be sarcastic at this point but damn you are right on that one.
<enroxorz>
i havent even looked for a good designer
<Hanmac>
enroxorz wxformbuilder should be work for wxruby too
<shevy>
you'll only get disappointed
baroquebobcat has joined #ruby
<bnagy>
swing!
<shevy>
yeah!
<shevy>
oh swing
<enroxorz>
damn it! i was trying to avoid swing...
<shevy>
I thought swig
<shevy>
Hanmac loves swig
<JonnieCache>
swing is actually great its just java that sucks
<enroxorz>
remind me, i remember a while back talks about having tk bindings default for windows ruby installer. is that the case now?
<shadoi>
I kinda wish there was a flag that told Hash to initialize all instances with symbolized keys…
<bnagy>
if only there was some way we could use java libs really easily from ruby
<xclite>
You mean like
<workmad3>
bnagy: </sarcasm>? ;)
<shevy>
dunno. I use ruby-gtk on windows too. every time I tried tk, I could not stand the crap it is, especially how the looks. I am quite superficial
<xclite>
something like
<xclite>
we could combine the names
<xclite>
juby?
rippa has joined #ruby
<xclite>
rava?
<shevy>
jing
<bnagy>
Rava
<bnagy>
:P
<shevy>
jing my ding
<workmad3>
xclite: ruva
<shevy>
and rava my lover
<Sigma00>
juby muby, etc
<xclite>
ooh ruva
<xclite>
that's good
<enroxorz>
shevy: i understand. when it comes to UI I want a toolkit that looks great
baroquebobcat_ has joined #ruby
<workmad3>
jaby?
<enroxorz>
juby?
<shevy>
enroxorz, hmm. the best look is with ruby-qt but if you ask me, ruby qt is dead. there is #qtruby though, the main dev is there
baroquebobcat has quit [Read error: Connection reset by peer]
baroquebobcat_ is now known as baroquebobcat
<enroxorz>
let me look into qt. i havent touched qt before so it will be fun to use!
<bnagy>
shadoi: that would be dumb, because not everything can be symbolized
<workmad3>
bnagy: you could symbolize the inspect string and use that!
<enroxorz>
:everything!!!!
<shevy>
enroxorz, have a look at the examples for the latest rubyqt, they look best
<enroxorz>
shevy: will do
<bnagy>
workmad3: ... yes I suppose you could :<
ryan0x2_ has joined #ruby
<enroxorz>
im trying to extend my gem to be a good desktop app with desktop notifications
apeiros_ has quit [Remote host closed the connection]
jimeh4 has quit [Ping timeout: 264 seconds]
MasterIdler has quit [Quit: MasterIdler]
<enroxorz>
i gotta go gents. be back in 1 hour. until then, dream of blocks and mixins for me
ben_m has joined #ruby
<shevy>
i dont wanna have nightmares
<shevy>
I'll dream of rubyOS instead
<JonnieCache>
shadoi: check out HashWithIndifferentAccess
<shevy>
is so much to type!
<Hanmac>
:"i am a long string with whitespace"
<shevy>
why not ... SymbolHash or HashSymbols or ... hmm
<workmad3>
shevy: A = HashWithIndifferentAccess
<shevy>
Hasher! class Hasher!!!
<bnagy>
HashWithBenefits
<shevy>
workmad3, dunno, I never really do that :)
<JonnieCache>
or just get a decent text editor
ckrailo has joined #ruby
<shevy>
vim?
red-panda has joined #ruby
<JonnieCache>
anything that can do completions really
<Sigma00>
notepad.exe!!
<Sigma00>
:V
<shevy>
vim!
<shadoi>
bnagy: every hash KEY can be symbolized.
<shevy>
:V starts vim
<shevy>
there is only vim, vim and vim
<shevy>
any emacs users here?
jprovazn is now known as jprovazn_away
<workmad3>
shadoi: you can use arbitrary objects as hash keys
<Sigma00>
I thought I was using windows once, turns out it was vim
andreime has quit [Quit: Lost terminal]
<shevy>
I used to use gvim
<shadoi>
workmad3: yeah I realized after I said that that it's probably not true.. lol
<workmad3>
shadoi: :)
maesbn has quit [Remote host closed the connection]
<workmad3>
b = {Object.new => "mwahahaha"}
<shadoi>
bnagy: workmad3: still, I'd like a more performant way to standardize my hash keys.
<shadoi>
doing it after initialization is nasty
<JonnieCache>
class Object; def to_sym; to_s.to_sym; end; end
<JonnieCache>
there we are now you can symbolize all your keys
prometheus has joined #ruby
<JonnieCache>
doesnt make it a good idea though
* Sigma00
twitches in horror
<workmad3>
shadoi: why are you standardising your keys?
Drewch has quit [Read error: Connection reset by peer]
<Mon_Ouie>
Why can't you just make sure to only use strings or symbols?
<workmad3>
shadoi: why aren't you coding it so they are all symbols initially?
<Mon_Ouie>
That'd indicate you're using them wrong in some cases
<shadoi>
workmad3: because I do a lot of serialization/deserialization
jeff_sebring has quit [Quit: Leaving]
<shadoi>
And I get input from API clients that can send either native ruby or json
<workmad3>
shadoi: use a serialisation mechanism that records that the keys are symbols? standardise on strings? make sure you serialise HashWithIndifferentAccess objects instead of plain hashes? :)
<JonnieCache>
i told my python friend that in ruby one can globally redefine the random number generator to always return 3. he freaked out haha
<shadoi>
workmad3: yeah, the proper place to do it is probably in the JSON lib.
<shadoi>
I use symbols everywhere else.
<bnagy>
shadoi: use strings
<workmad3>
shadoi: hmm... you do not want to patch the JSON library to create hashes with symbols
<bnagy>
it's just better
jeff_sebring has joined #ruby
<shadoi>
bnagy: strings take up quite a bit more memory when you're talking about a LOT of fairly big hashes.
<workmad3>
shadoi: that way is a great way to open a potential DoS attack on your server :)
<bnagy>
works with all serialisation libs etc
ckrailo has quit [Ping timeout: 276 seconds]
jimeh4 has joined #ruby
<bnagy>
shadoi: not if they're in a hash
<shadoi>
bnagy: lots of different hashes using symbols as keys is more memory efficient.
<shadoi>
But… maybe it's not worth it.
<bnagy>
like :thisisalongsymbol takes up about the same as 'thisisalongstring' if there are only one copy of each, right?
<JonnieCache>
workmad3 makes a good point. if you do too much funky stuff with your deserialization of user input it can cause big security problems
<bnagy>
JonnieCache: no way, just look at PHP they've never had a problem with....wait
<shadoi>
bnagy: I have quite a few fairly large hashes in memory at a given time depending on workload.
<Spaceghostc2c>
bnagy: Ha.
<shadoi>
bnagy: and they all use almost identical keys
wvms has quit [Quit: wvms]
<workmad3>
shadoi: if you get the JSON lib to just symbolise the keys for the objects it creates, then it is trivial to fire json with permuted keys at the endpoint and, because symbols are by definition never GCed (they never go out of scope essentially) then you run out of memory
kenperkins has joined #ruby
<JonnieCache>
best to let other peoples deserialization code do the work. theyre probably more compentant than you and if theyre not, at least you can blame them when it goes wrong ;)
M00kaw has joined #ruby
<shadoi>
workmad3: true enough, and probably COULD be exploited in some rare case, but if malicious people even have network access to this service, they've already owned the network.
tintin has joined #ruby
<workmad3>
shadoi: fair enough :)
<tintin>
Hi
<tintin>
I have a question?
<workmad3>
shadoi: so it isn't arbitrary JSON that's being fired then... that's alright :)
databyte has joined #ruby
schovi has quit [Remote host closed the connection]
<tintin>
Is ruby portable/platform independent?
ipoval has joined #ruby
<shadoi>
workmad3: yeah, it's just that I provide 2 API client types, native-over-0mq and REST.
maletor has joined #ruby
<catphish>
tintin: it's certainly been ported to several platforms
<shadoi>
so I'd like to make them have standard keys
<tintin>
But isn't the inside .c file of ruby source code compiled? So if it's compiled then how is it portable? Or how is it platform independent?
<shadoi>
I'll probably switch back to strings.
ckrailo has joined #ruby
<shadoi>
memory probably won't ever be a big issue.
<catphish>
tintin: c files can be portable
<graspee>
once it's compiled the interpreter isn't portable obviously
<tintin>
Another question is how is ruby bytecode understandable by computer? I knew computer can only understand assembly or machine language
<catphish>
tintin: ruby is interpreted
<graspee>
because the virtual machine understands it
<JonnieCache>
tintin: you should read up on the difference between compilation and interpretation
<catphish>
tintin: it is bytecompiled when needed
<Hanmac>
about rubybytecode you should ask in #jruby
kpshek has quit [Ping timeout: 276 seconds]
<tintin>
catphish: How is c portable?
<bnagy>
tintin: learn. to. google. (xposted from #ruby-lang)
<catphish>
tintin: are you asking about the portability of ruby? or programs written in riby?
chson has joined #ruby
<graspee>
c is portable because there are c compilers for lots of platforms
<catphish>
tintin: C *is* portable, there are compilers for lots of systems
<workmad3>
Hanmac: standard ruby 1.9 is compiled to bytecode inside the runtime and then the bytecode is executed on a VM within the runtime
<catphish>
ruby code is portable also, because the ruby interpreter can be compiled on different platforms
<tintin>
If you compile a c file and get the executable , that executable can't be run on another machine/computer , so how is c portable?
<workmad3>
C is (or can be) sourcecode portable, not binary portable
<catphish>
tintin: because the c file can be compiled on a different system
<catphish>
binarys aren't portable, but they're not C
<tintin>
I'm talking about the executable you find compiling a C file
krusty_ar has joined #ruby
<catphish>
tintin: that's never portable
<catphish>
that's just machine code
<catphish>
but that's not relevent to ruby
<catphish>
because both the ruby source code, and interpreted ruby code are portable
<tintin>
So the ruby virtual machine can understand the ruby bytecode, that's fine, but is vm the computer/machine?
<bnagy>
which is why all windows, linux and osx computers everywhere compile all binaries they run from source
indian has quit [Ping timeout: 260 seconds]
uris has quit [Read error: Connection reset by peer]
<bnagy>
because binary isn't portable
<catphish>
tintin: there is no ruby bytecode
<workmad3>
tintin: the vm is part of the ruby runtime
<catphish>
at least not that you distribute
<catphish>
ruby is interpreted (compiled on the fly)
<workmad3>
tintin: basically, to run ruby, you need a runtime
<tintin>
workmad3: Isn't there any ruby bytecode?
ckrailo has quit [Ping timeout: 276 seconds]
<tintin>
I knew ruby bytecode exists
<catphish>
tintin: not that you can distribute, no
uris has joined #ruby
Drewch has joined #ruby
<catphish>
tintin: it only exists in memory
<workmad3>
tintin: there aren't any runtimes that generate bytecode and no runtimes that will read bytecode, and no standardised bytecode for ruby
<KevinSjoberg>
Is it possible to copy the contents of one directory into another with FileUtils? Having really hard problems with this. FileUtils.cp_r('some_folder', 'another_folder'). What I want is contents from some_folder into another_folder. At the moment I get another_folder/some_folder.
<workmad3>
tintin: the bytecode is an implementation detail of some runtimes
<catphish>
tintin: the bytecode is only produced at runtime
<catphish>
so it doesn't need to be portable
<workmad3>
catphish: ah, cool, you can generate JVM bytecode with jruby? :)
<workmad3>
catphish: didn't realise that
<Sigma00>
KevinSjoberg: try some_folder/*, maybe?
<catphish>
workmad3: yes you can :)
<catphish>
but not with MRI
<KevinSjoberg>
Sigma00: Tried it, that didn't do it.
<tintin>
I'm confused, isn't bytecode portable?
<Sigma00>
depends on the bytecode
<workmad3>
catphish: yeah, but with 1.9 that's only because the option doesn't exist to generate it into a file, I believe :)
<catphish>
workmad3: i suspect the bytecode wouldn't be portable between builds etc
<workmad3>
catphish: with 1.8 MRI, there's no way at all because it's completely interpreted (no bytecode at all exists)
<catphish>
so its not encouraged to try to save it
<workmad3>
catphish: yeah, I suspect that too
ckrailo has joined #ruby
<tintin>
Does the machine understand bytecode?
<catphish>
i think things like the ruby encoder do part of the compilation
<catphish>
tintin: what are you talking about?
ben_alman has quit [Excess Flood]
<tintin>
Or does the machine converts the bytecode to assembly to understand it/
<bnagy>
tintin is either 'special needs' or a troll
<workmad3>
tintin: no, bytecode is run on a virtual machine that translates the bytecode into machine instructions
<bnagy>
was doing this on ruby-lang for hours
senny has quit [Remote host closed the connection]
<JonnieCache>
wait until he tries to understand pass-by-value versus pass-by-reference
<workmad3>
tintin: as long as you have a virtual machine that can understand the bytecode on the platform you want, you can run it
<tintin>
bnagy: You forgot to mention that none was responding on #ruby-lang.
<Hanmac>
tintin did you read the link you post? ... ruby-bytecode need to be converted to machine code
<bnagy>
they were, until everyone got sick of you
<tintin>
workmad3: So it's the vm that converts the bytecode to assembly, right?
<workmad3>
tintin: no
<JonnieCache>
yep
<bnagy>
nothing converts bytecode to assembly
<workmad3>
tintin: not assembly... that would be stupid
<bnagy>
cpus don't run fricking assembly
<JonnieCache>
not to assembly but to binary opcodes which is essentially the same thing no?
<catphish>
basically
d3c has quit [Quit: Sleep]
<bnagy>
no, it's not
oooPaul has joined #ruby
<JonnieCache>
for the sake of understanding i mean
<bnagy>
otherwise we wouldn't need assemblers
<Sigma00>
assembly still needs an extra step
<tintin>
workmad3: Does the vm convert the bytecode to machine language?
<catphish>
assembly is just a human representation of cpu instructions
<workmad3>
tintin: it translates the bytecode instructions to the machine instructions
<JonnieCache>
assembly is simply ascii labels for opcodes. its *barely* any different
<Hanmac>
tintin: DID YOU READ YOUR OWN LINK?
<tintin>
Hanmac: YES
<catphish>
but if you're looking for portable, compiled, ruby, you'll be disapointed
<workmad3>
JonnieCache: it's an important difference though
<bnagy>
JonnieCache: go write an assembler / disassembler and say that
<Hanmac>
tintin: there you can see twice that a VM is needed to turn bytecode into maschine code
<tintin>
workmad3: So vm is the key, right?
<bnagy>
VMs DO NOT TURN BYTECODE INTO MACHINE CODE
balki has quit [Read error: Connection reset by peer]
<bnagy>
wtf
balki has joined #ruby
<bnagy>
they RUN bytecode
rvmeier has joined #ruby
rvmeier has quit [Client Quit]
<Hanmac>
bnagy i mean that
<JonnieCache>
bnagy: obviously theyre not the same. we're going to have to make some conceptual simplifications though or this conversation will never fucking end
<tintin>
What the hell? Somone is saying vm converts bytecode into machine code and someone else is saying : NO ?
whitenoise has quit [Ping timeout: 264 seconds]
ckrailo has quit [Ping timeout: 276 seconds]
<workmad3>
I didn't say it turns bytecode into machine code
<bnagy>
JonnieCache: it should end by people just ignoring tintin
Ontolog has joined #ruby
Ontolog has quit [Remote host closed the connection]
<workmad3>
I said it translates from bytecode instructions to native instructions
<bnagy>
workmad3 / Hanmac no, tintin did
<JonnieCache>
seriously though man, conceptual simplifcation without loss of useful meaning is the *very essence* of teaching
<tintin>
workmad3: Define native instructions
Ontolog has joined #ruby
<KevinSjoberg>
Is it possible to copy the contents of one directory into another with FileUtils? Having really hard problems with this. FileUtils.cp_r('some_folder', 'another_folder'). What I want is contents from some_folder into another_folder. At the moment I get another_folder/some_folder.
<workmad3>
tintin: grab a book on basic computer architecture
jeax has joined #ruby
<tintin>
Then why do i need vm to convert the bytecode to something else that machine can understand, what's wrong with compiling source code to machine language then?
<JonnieCache>
yeah, youd do much better reading a book than by asking a load of irc pedants
<workmad3>
KevinSjoberg: did you try FileUtils.cp_r('some_folder/*', 'another_folder')
<JonnieCache>
tintin: thats a design decision to do with performance, and other factors.
<graspee>
tintin: some language are more suited to interpretation than compilation
ipoval has quit [Quit: ipoval]
<KevinSjoberg>
workmad3, bnagy: I've read the documentation and I've tried that workmad3. What I've figured out is that I need to glob all files from src directory in order to actually copy them as I want. Correct?
<Sigma00>
tintin: portability. for example java compiles to bytecode, which runs on the java vm anywhere that there is a java vm available
Eldariof-ru has quit [Ping timeout: 264 seconds]
<Sigma00>
tintin: the other option would be compiling once for every architecture you want to target
<shadoi>
whoa.. it's a bytecode shitstorm…
<bnagy>
KevinSjoberg: did you read the bit that says "To do what KevinSjoberg asked, use this code" ?
databyte has quit [Remote host closed the connection]
kevinbond has quit [Quit: kevinbond]
<JonnieCache>
now youve just confused him again though because java's use of bytecode is different to how ruby uses it
ckrailo has joined #ruby
<tintin>
java generates bytecode(.class) that can be run on any machine, but i don't see such bytecode from ruby that can be run on any machine, where does this ruby bytecode locate?
<workmad3>
bnagy: hehe :)
<JonnieCache>
it never leaves the inside of the ruby interpreter
alanp has joined #ruby
<tintin>
Does ruby generate something like .rclass that can be run
<JonnieCache>
tintin: it generates the bytecode, runs it then immediately discards it
<workmad3>
tintin: no
andrei__ has joined #ruby
<Sigma00>
tintin: no, it's all internal, you are not allowed to touch the ruby bytecode, ever
<JonnieCache>
no theres no rclass. you never see or touch the ruby bytecode
<tintin>
That's a problem with ruby then
<KevinSjoberg>
bnagy, workmad3: Oh, god. How could I've missed that. Thanks for the heads up!
<Mon_Ouie>
Not really "immediately"
<Sigma00>
tintin: no, no it's not. Ruby is interpreted
gmci has joined #ruby
<Mon_Ouie>
Not before the VM is shut down
<graspee>
it's not a problem, it's a cultural difference
ben_alman has joined #ruby
<Sigma00>
it is never compiled
<bnagy>
KevinSjoberg: happens to the best of us
CheeToS has joined #ruby
<digitalcakestudi>
how would I check a var to see if its a boolean vs a hash?
<Mon_Ouie>
Sigma00: It is compiled — to bytecode, just like Java
<shadoi>
though… rubinius and mruby both allow compilation and access to the bytecode…
<tintin>
You can run that .class generated by java without seeing/running the .java file, but everytime you need to run a ruby file like that , ruby file.rb, that's a problem
<shevy>
ok
<KevinSjoberg>
bnagy: Indeed it does.
<shevy>
use java
<shevy>
bye tintin
<Mon_Ouie>
*Why* is it a problem?
<workmad3>
tintin: ruby doesn't set a bytecode standard and doesn't define how a ruby VM should behave (which are key parts of java)
<Sigma00>
tintin: again, that's not a problem. use another language
larissa has quit [Quit: Saindo]
mpun7 has joined #ruby
<JonnieCache>
tintin: ruby and java use bytecode for very different reasons
<workmad3>
tintin: as such, ruby bytecode a) isn't a requirement of a ruby runtime (so you can have runtimes that don't bother with it, e.g. 1.8 MRI) and b) wouldn't be guaranteed compatible with different runtimes
d3c has joined #ruby
<Sigma00>
Mon_Ouie: fair point, I was trying to easily distinguish it for him
<JonnieCache>
if it helps, dont think of ruby bytecode as bytecode at all, invent a different name in your head
<shevy>
invent the name java bytecode in your head
<tintin>
"Use java or another language" , that's not a solution, rather design/customize ruby in such a way so that after running ruby file.rb, you will get a .rclas file that can be run on any machine, you don't need that .rb file again
<Sigma00>
'ruby internal-funny-code'
<graspee>
oh right we'll all go and change ruby for you right now then
<xclite>
interpreted languages just don't work that way
<bnagy>
tintin: yeah, we call that 'ruby code'
<shevy>
strange, I dont even get that with python...
<Mon_Ouie>
You already have a rb file that can be run on any machine
<Sigma00>
tintin: no. Ruby is INTERPRETED. You need the source to run. End
KindOne has quit [Excess Flood]
<xclite>
tintin - can you run java bytecode without the JVM?
<workmad3>
Sigma00: it's actually a perfect example
<Sigma00>
<_<
<xclite>
because the point is java doesn't run universally either
<graspee>
you do need the source code again in case you want to modify it
<shevy>
I dont even have java installed
<graspee>
you don't play minecraft?!
<xclite>
it's no better at running everywhere than ruby except that it has a higher install-base
<shevy>
hmm nope
<graspee>
wow
<shevy>
graspee, these days I mostly play only browser games actually :(
<graspee>
i thought everyone played minecraft
lkba has joined #ruby
<wmoxam_>
tintin: what do you need this feature for?
<tintin>
java is also interpreted, but you don't need the .java file for the second time to run the executable(.class) , but of course you need the runtime/jvm/jre/jdk
<shevy>
all those flash interfaces, they killed the old plain browsergames
<xclite>
so how is that better?
<wmoxam_>
shevy: minecraft can be played in a browser
<Hanmac>
if i want pixels big as blocks i play a game from the 80'
<xclite>
you still need a file
<graspee>
i thought it's coarse quantized world and excitable pigs were to everyone's taste
<shevy>
ok so tintin's philosophy is java is interpreted.
<shevy>
tintin, is C also interpreted?
<shevy>
tintin, how about assembly
<graspee>
it can be
<Mon_Ouie>
You're not thinking that it is safer if people can't read your code?
<graspee>
c is a language, not an implementation
<JonnieCache>
lol SOMEONE IS WRONG ON THE INTERNET AND SHEVY IS HERE TO PUT IT WRITE
<workmad3>
tintin: ever heard of decompilers? :)
<xclite>
uh
<JonnieCache>
oops RIGHT
<xclite>
right?
<xclite>
=p
<shadoi>
lectrick: lol @ your class names.
<digitalcakestudi>
is there not a simple condition to check if a var is a boolean true or a hash?
<shevy>
JonnieCache man this tintin guy is just here for one reason and we know it
flype has joined #ruby
<lectrick>
shadoi: :)
wmoxam has quit [Disconnected by services]
jonatha__ has joined #ruby
<Mon_Ouie>
digitalcakestudi: Object#is_a? Hash
<digitalcakestudi>
thanks
<lectrick>
shadoi: It does in fact pass all those tests.
jonathanwallace has quit [Read error: Connection reset by peer]
<shevy>
JonnieCache one thing is sure, he is not even using ruby
<bnagy>
lectrick: I didn't say it was impossible I said a) regexp wasn't made for that, which is true, and b) it's retarded which is also true
<JonnieCache>
if you really think he's trolling then why on earth are you talking to him?
<lectrick>
LOL
<shevy>
JonnieCache because I talk to everyone. I dont even use /ignore ever
Niamkik has joined #ruby
MasterIdler_ has joined #ruby
wmoxam_ has quit [Quit: leaving]
<lectrick>
But... but... it works, and it is my brain-baby
<graspee>
JonnieCache: because his astute questions are forcing us to look inside our ery souls
<graspee>
very
Niamkik has quit [Client Quit]
eywu has joined #ruby
<Sigma00>
digitalcakestudi: you could check if var.respond_to?(:values)
<Mon_Ouie>
lectrick: Are you using regexps just for the fun of learning how to use that feature? Because that's really not a good use case for them
wmoxam has joined #ruby
<shevy>
I like graspee
<graspee>
that's your mistake
<Mon_Ouie>
Technically those aren't even "regular" expressions
<digitalcakestudi>
I like that Sigma00
<JonnieCache>
well just remember this: 80 years is only 960 months
<bnagy>
Mon_Ouie: we told him that, that's why he did it
<shevy>
no, you are my idol... I need to make it on bash org too
<andrei__>
somebody can help me with hpricot. I am trying to parse a very simple html in a hpricot object. And when I inspect the object is looks like this: #<Hpricot::Doc "\xFF\xFE<\x00h\x00t\x00m\x00l\x00>\x00\r\x00\n\x00<\x00h\x00e\x00a\x00d\x00>\x00\r\x00\n\x00T\x00e\x00x\x00t\x00 \x00h\x00e\x00r\x00e\x00\r\x00\n\x00<\x00/\x00h\x00e\x00a\x00d\x00>\x00\r\x00\n\x00<\x00h\x00t\x00m\x00l\x00>\x00">
<graspee>
plenty of people are on bash.org. some of them wish they weren't ;)
<shevy>
ack
<andrei__>
Somebody can help?
<lectrick>
Mon_Ouie: Partly, yes. But people do not realize how powerful they are.
<shevy>
the attack of the \x
<wmoxam>
guyz, how do I make my ruby codez to asm>??? I gots to hide teh codez!
<graspee>
see shevy, it's like minecraft in your irc client
<lectrick>
Mon_Ouie: Because it uses named groups to perform recursion?
<shevy>
wmoxam mRuby will do that!
<Mon_Ouie>
Oh, sorry, hard to follow more than two conversations at the same time
<shevy>
indeed graspee
<wmoxam>
mmmmmRuby
<graspee>
now just rearrange those \blocks into a house
<shevy>
andrei__, perhaps it is a bug in hpricot
<Mon_Ouie>
lectrick: Yes. And it's also a lot harder to read and write than just writing a state machine manually.
<Sigma00>
that's a lot of null
<lectrick>
Mon_Ouie: I didn't think that was hard to read nor write
<JonnieCache>
Mon_Ouie: thats what we told him
kpshek has joined #ruby
<shevy>
andrei__, you can do two things. first, upload the ruby code you use to pastie.org - second, provide the smallest .html example that can reproduce this problem you have
ckrailo has quit [Ping timeout: 276 seconds]
<Sigma00>
do them both <_<
<shevy>
yeah
bluOxigen has quit [Ping timeout: 265 seconds]
cousine has quit [Remote host closed the connection]
<andrei__>
<shevy> ok, I'll do that
<shevy>
\o/
<graspee>
i like ideone myself
<graspee>
it runs ma ruby!
<shevy>
Sigma00, you use weird smileys
<shevy>
are those pockemon smileys?
<Sigma00>
shevy: It's a shify eyed smiley :P
<Sigma00>
shifty*
<lectrick>
Mon_Ouie: I have no clue how to write a state machine. What I do vaguely understand is that I can parse pretty much anything that is "regular" using a BNF-style grammar definition that takes advantage of zero-matched named groups
ckrailo has joined #ruby
<Mon_Ouie>
andrei__: Isn't there maybe an encoding problem?
<JonnieCache>
lectrick: if you can do all that you can write a state machine
<graspee>
i seem to remember norvig and russel being good on state machines but i could be remembering wrong
<JonnieCache>
theyre very simple. its the theoretical implications of them that are hard
<Mon_Ouie>
It's just a fancy name, really
jeff_sebring has quit [Quit: Leaving]
<tintin>
wmoxam: Can you get the original .java code from .class file?
<lectrick>
JonnieCache: Ah. :)
<Mon_Ouie>
If you write it just however you want, you'll most likely have written a state machine without noticing it
arturaz has quit [Ping timeout: 248 seconds]
<graspee>
you can't, and i imagine you know that tintin
Niamkik has joined #ruby
<tintin>
wmoxam: Using decompilation/deassembling
<JonnieCache>
exactly. youve probably written them before without knowing it
<lectrick>
Mon_Ouie: Yes, that's what I assumed :)
<graspee>
but you can get *some java*
<lectrick>
I've used the AASM gem....
jeff_sebring has joined #ruby
<wmoxam>
tintin: Can you distribute Perl and Python bytecode (rather than source code?)?
KindOne has joined #ruby
<andrei__>
<Mon_Ouie> dunno, I am noob to ruby
<xclite>
I'm still waiting for the grand proof that this somehow makes Ruby suck because you can see the source
<JonnieCache>
a state machine can be as simple as a loop, with a variable called "state" which you change inside the loop, with some logic that depends on its contents
bgupta has quit [Quit: bgupta]
<shevy>
tintin: will you father my children?
robotmay has quit [Remote host closed the connection]
<tintin>
I won't give up, i will hang around with ruby
<shevy>
naaaah
<wmoxam>
tintin: We're all switching to Lua
williamcotton has joined #ruby
<shevy>
ruby is elegant
<Sigma00>
graspee: it's to integrate a scripting language into your program so your end users can use it, that's it
<graspee>
it's like pepsi deciding to make trousres
<shevy>
lua is a table language
<Hanmac>
tintin: mruby is a) not finish, b) is just an other interpreter like jruby, rubinus and MRI ... Ruby itself does not die
<JonnieCache>
lua is more designed for embedding into hardware
<shevy>
mruby will destroy lua
<wmoxam>
Ruby died because it could not scale
<graspee>
i hear good things about javascript even recently, with its new shiny functional library
<JonnieCache>
the firmware for things like mixing desks gets written in lua
<shevy>
javascript is the dictator among languages
<JonnieCache>
the lua VM is designed specifically for embedded hardware
<tintin>
Hanmac: How can you be sure about it, do you know that ruby core devs won't leave ruby today or tomorrow?
Drewch has quit [Ping timeout: 246 seconds]
<shevy>
let me use mruby in browsers!
ij has joined #ruby
<wmoxam>
tintin: they already left
<shevy>
tomorrow
<catphish>
wmoxam: lols
<shevy>
tintin what if guido has a car crash tomorrow
<shevy>
tintin WHAT THEN MAN
<shevy>
tintin WHAT THEN MAN!!! I ASK YOU!!!!!!!
<graspee>
even if ruby the language doesn't get updated ever again, ruby won't end as long as people maintain the libraries
<Sigma00>
DIDN'T YOU HEAR!? GUIDO IS IN THE HOSPITAL
<lectrick>
graspee: lol at sid meier reference
<tintin>
Sigma00: Lol
<JonnieCache>
what if i run up in rubyconf with a bomb strapped to me?
miho has quit [Ping timeout: 244 seconds]
<wmoxam>
Sigma00: the same hospital as Matz?
<workmad3>
tintin: if the core developers leave, other people in the community will take up maintenance
<shevy>
JonnieCache dont do that
<Sigma00>
wmoxam: yuuup
<tintin>
wmoxam: So how ruby figures out the problem of scalability ?
<shevy>
JonnieCache your punishment in hell will be to write perl and lisp code until eternity
carlyle has quit [Ping timeout: 246 seconds]
<lectrick>
JonnieCache: Microsoft would hire you
Drewch has joined #ruby
<graspee>
thank you, lectrick, i was recently playing old civs and checking out the credits and thinking "hmm what was sid doing at this point except lending his name and counting his money?"
<shevy>
AT THE SAME TIME
<Sigma00>
JonnieCache: half the world will hate you, the other half will applaud you
<Hanmac>
tintin i dont care, the ruby code itself does work on all kind of ruby interpreters
<ij>
How do I reload a file? (re-require after it's been requireed?)
<wmoxam>
Sigma00: wow, Linus, Matz in Guido in the same hospital
<shevy>
so->(you(can(never%!#(know(when(to(stop
dross has joined #ruby
<tintin>
workmad3: It's not easy to understand such large amount of source code for new comer
<wmoxam>
*and
<Sigma00>
wmoxam: nice typo, I cracked up
<shevy>
ij I think only via load()
<workmad3>
tintin: yeah... but people in the ruby community aren't newcomers
<lectrick>
ij: you don't
<ij>
why
<wmoxam>
tintin: it doesn't. That's why it's dying
<ij>
You don't!
<lectrick>
why would you want to re-require a file that is a class definition?
<workmad3>
tintin: there are plenty of people here who know the ruby codebase (probably even several ruby contributors)
<catphish>
someone please deal with the incessant trolling
<ij>
lectrick: Load a new version -- monkey patch, in console.
<shevy>
tintin, yugui_zzz here is a core dev
<tintin>
workmad3: dude, using ruby and maintaining/developing ruby are not same.
<lectrick>
graspee: exactly lol. /old gamer here too
<workmad3>
tintin: yes I know
jamescarr has quit [Ping timeout: 252 seconds]
<shevy>
catphish someone kill tintin. problem solved
<graspee>
in fact if ruby the language stopped being updated, libraries would stay working for longer!
<workmad3>
tintin: that doesn't mean they're mutually exclusive :P
<shevy>
lol graspee
<lectrick>
ij: oh. "load" then I guess
<lectrick>
if something happened to matz i would be sad :(
<workmad3>
tintin: it *is* possible to both contribute to the ruby source in C *and* write code in ruby
<xclite>
I love the argument
<xclite>
"what if the core devs left"
<graspee>
so long as i have a copy of ruby and the opengl and gosu gems, magic can still happen
<workmad3>
lectrick: ok, I'll call off the hitmen then :P
<JonnieCache>
right thats it. im going outside in the sun. have fun boys and girls
<xclite>
...isn't that a complaint for... anything?
<graspee>
have fun in the sun, JonnieCache
* Sigma00
points at java, and C, and C++, and..
<lectrick>
graspee: whoa, did not know about gosu
<graspee>
know what?
<graspee>
oh
<Sigma00>
that it existed, probably
<graspee>
it's a great library
pygospa has quit [Read error: Operation timed out]
gibsonfs has quit [Ping timeout: 276 seconds]
<wmoxam>
xclite: what if they all got cancer on the same day? WHAT THEN???
pygospa has joined #ruby
<graspee>
i'd stop using ruby because it's obviously carcinogenic
<ij>
Ruby top-level-namespace is Kernel, right?
<xclite>
then... we'd have a pretty good scripting language maintained by its community?
<Hanmac>
tintin my ruby gems are native that means they are c++ code, compiled into something the ruby iterpreter can use
<wmoxam>
graspee: exactly. And that's why other languages wouldn't be affected
<workmad3>
ij: define 'top level namespace'
<mjb2k>
I really like that idea of mruby, first I've seen it. It give to C apps what JRuby gives java apps. (If skimmed that page right)
* Hanmac
could rwite a c app wich used the MRI interpreter
<tintin>
Hanmac: Really? What's the name of that gem?
gilead has quit [Quit: Leaving]
heftig has quit [Ping timeout: 245 seconds]
<tintin>
Hanmac: That's great
<ij>
workmad3: where everything gets put into on defining in the first rb_require/funcall is called.
<shevy>
"I?m excited to announce that as of today (March 28th), I?ve accepted a new position at LivingSocial! I?m an Engineering Director, managing a few teams that work on backend architecture such as email, scaling, etc."
Drewch has quit [Ping timeout: 246 seconds]
fra000 has quit [Quit: Leaving]
<shevy>
but in my experience, like when _why left... those guys who took over shoes and so forth, just can not replace _why
<shevy>
I admit it, I need celebrity hackers!
<graspee>
become your own celebrity!
red-panda has quit [Remote host closed the connection]
<graspee>
release the power within!
<shevy>
ij ok well let's assume that ruby would be as fast as C, for the sake of discussion
<shevy>
what we would need to have then is to replace all of the good features of UNIX, in ruby
mneorr has quit [Ping timeout: 246 seconds]
<shevy>
and a kernel!
user__ has joined #ruby
Drewch has joined #ruby
kpshek has quit [Ping timeout: 265 seconds]
<shevy>
so even if it would be as fast... it would be an insane amount of work
<ij>
Myeah.
<ij>
Has anyone done that?
<shevy>
not really, people tend to say "we already have that" and stop
zeromodulus has joined #ruby
<shevy>
and the speed reason is a valid one too, in addition to that :\
akem has quit [Ping timeout: 246 seconds]
<Hanmac>
shevy i am but my gems are mostly not
<shevy>
lol Hanmac
<shevy>
^^^ best answer ever
<shevy>
where are your gems though?
<graspee>
lol i just read a page on ruby 2 which says a likely feature is being able to save ruby as bytecode
stephenjudkins has joined #ruby
<shevy>
yeah they used to be ambitious
<shevy>
but now that phase has kinda passed ... :(
<graspee>
has it?
<Hanmac>
shevy libarchive-ruby ... but its a bit broken currently ... :/
<graspee>
someone should edit this page and not confuse me then!
<shevy>
I think so. they dont want to make sweeping breaks in ruby 2
cousine has quit [Remote host closed the connection]
thecreators has joined #ruby
<theRoUS>
Hanmac: if i use the const_set(:Foo, Class.new) magic to metaprogram a class, how can i specify inheritance? or, given an existing class, can something be inserted in its ancestry?
catphish has left #ruby ["Leaving"]
<shevy>
perhaps const_set makes use of a block {} or Class.new does {}
pdtpatrick has joined #ruby
<Hanmac>
Class.new does
francisfish has quit [Remote host closed the connection]
manizzle has quit [Read error: No route to host]
zeromodulus has quit [Ping timeout: 245 seconds]
<theRoUS>
Hanmac: so what would i put in the block to make the new class a subclass of, say, 'Bar' ?
<Ontolog>
shevy: i thought there might be a single method to do it
<shevy>
dunno. dont think on class Hash
<Ontolog>
shevy: whether the hash includes all those keys
<Ontolog>
k
cantonic_ has joined #ruby
bgupta has joined #ruby
MrGando has joined #ruby
MrGando has quit [Remote host closed the connection]
<Hanmac>
Ontolog i dont think there is a better way. your code is the best i think
<Ontolog>
Hanmac: thanks
cantonic has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
bradhe has joined #ruby
<Hanmac>
this [:a,:b,:c].all?(&h.method(:include?)) could be faster but not better to read
<shevy>
hehe
<shevy>
this [:a,:b,:c].all? &h.method(:include?)
<shevy>
got rid of one char for you!!!
<matti>
Ugly ;/
<shevy>
yeah
<shevy>
the & is the alien operator
<shevy>
it marks an object as alien
<shevy>
&matti
<Hanmac>
matti: but its may a little faster
<shevy>
this is matti from out of space
CheeToS has quit [Ping timeout: 252 seconds]
<matti>
Hanmac: I am talking about shevy removing parens.
<matti>
Hanmac: :)
bgupta has quit [Ping timeout: 244 seconds]
umttumt has quit [Remote host closed the connection]
tatsuya_o has quit [Remote host closed the connection]
<shevy>
oh
<shevy>
it is a form of sterilization
<shevy>
I call it "de-lisping"
<matti>
No, no.
<Hanmac>
shevy look for HPC ruby :P
Criztian has joined #ruby
<Sigma00>
Ontolog: why not (m - h.keys).size == 0 does what you want...
<Sigma00>
heh, I rewrote the last part of the sentence but forgot about the first <_<
<matti>
?
Spooner has joined #ruby
<Sigma00>
what you want is to check whether all the keys in m are in the hash h, right?
<matti>
Me?
<matti>
I want world peace.
<matti>
;]
<Sigma00>
<_<
<Hanmac>
Sigma00 becaue your code is slower then all?
* Sigma00
shrugs
<Sigma00>
I'm offering ideas, I have no idea whether its slower or not
burgestrand has joined #ruby
Markvilla has joined #ruby
<matti>
Sigma00, Hanmac -- benchmark!#
<matti>
Sigma00, Hanmac ** FIGHT! **
* matti
puts Mortal Combat music
<Sigma00>
nah, he'll kick my ass, I have under a month of Ruby programming in my belt, and that's with lots of breaks :P
<Sigma00>
s/in/under/
<Sigma00>
pesky job, getting in the way...
tewecske has joined #ruby
<matti>
Sigma00: More than I have :)
<matti>
Sigma00: I am on a secret mission from the Python programmers community to learn all there is about the enemy.
<matti>
:)
bgupta has joined #ruby
<shadoi>
can't we all just get along? :P
<shevy>
oh man
chrismcg is now known as zz_chrismcg
apok has joined #ruby
<shevy>
if I have a file called foo.rb which has ONE method called foo (def foo)
<shevy>
is there any way I can group it into a specific module?
<graspee>
the pngs i made with gimp won't load with the png gem or with gosu
<shevy>
without having to write the module into the file
<matti>
shadoi: Sure :p That is why I want world peace ;p
<workmad3>
shevy: what's wrong with putting the module in the file?
<shadoi>
workmad3: he's lazy
<shevy>
workmad3 I want to reshuffle content without having to live them in one specific module
<shevy>
*see them live in one
<shevy>
(or no module)
yekta has joined #ruby
<shevy>
specifically, I am about to write a few hundred tiny .rb files
<Sigma00>
heh, /mark
<Sigma00>
fuck
<shevy>
typing "module Foo" in every .rb file is annoying me to no ends :(
d3c has quit [Read error: No route to host]
mrdtt has quit [Remote host closed the connection]
<Sigma00>
shevy: put them all in a folder, and make your Module.rb file have a loop that includes everything in that folder?
yekta has quit [Client Quit]
<shevy>
hmm
<shevy>
how would that work?
<shevy>
I can load them of course or require them, but what then?
<workmad3>
Sigma00: unless you're going to eval each file in the folder, I don't think that would work
<shadoi>
shevy: when/why would you "reshuffle" module method contents?
ph^ has quit [Remote host closed the connection]
<shevy>
shadoi when I want to put them into other namespaces for instance
<Ontolog>
wrt rspec, i want to use a before :each block but only have it apply to one example group (or "describe")
<shevy>
like when they have no module
MasterIdler_ is now known as MasterIdler
<shadoi>
uhh…
ph^ has joined #ruby
<graspee>
just write all the files, then write a ruby one liner that goes through all the ruby files in the directory and adds that module import into them
<shadoi>
shevy: can you give an example? it sounds fishy.
<Sigma00>
workmad3: too bad :(
<workmad3>
Ontolog: stick the before into that describe block then
<shadoi>
shevy: You probably just want some code that can define methods on any namespace you need, when you need it.
<Ontolog>
workmad3: ah i see, that's how it works by default, awesome thanks
Vert has quit [Ping timeout: 252 seconds]
Vainoharhainen has quit [Quit: Leaving...]
kizzx2 has left #ruby [#ruby]
kpshek has joined #ruby
linoj_ has joined #ruby
zeromodulus has joined #ruby
timonv has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
quest88 has quit [Quit: quest88]
apok has quit [Remote host closed the connection]
apok has joined #ruby
BeLucid has joined #ruby
linoj_ has quit [Remote host closed the connection]
xaq has quit [Remote host closed the connection]
linoj_ has joined #ruby
linoj has quit [Ping timeout: 244 seconds]
RainbowDashh has quit [Quit: SLEEP MODE. <@suborbital> no i filtered out RainbowDashh join quit msgs - appearantly it filtered out everything]
linoj_ has quit [Read error: Connection reset by peer]
linoj has joined #ruby
brianpWins has joined #ruby
shadoi has quit [Quit: Leaving.]
tvw has quit [Remote host closed the connection]
<Spooner>
graspee: ask in #gosu about the png problem? I've never had problems using GIMP + gosu
<graspee>
thanks
RainbowDashh has joined #ruby
<graspee>
i think i might have solved it by resaving the images with a different program though
<graspee>
gimp puts more header in there which gosu and png gem were choking on
<Spooner>
graspee : One problem with gosu is that it gives an unclear error if it is unable to find the image file (the message makes it look like it fails to load the file).
<graspee>
i know that but that's not the problem
<graspee>
but thanks
tdubz_ is now known as thomas
<Spooner>
graspee - I see. Might be worth attaching a broken-headered image to the libgosu.org forum so that issue can get fixed.
RainbowDashh has quit [Read error: Connection reset by peer]
<Sigma00>
^ bug report!
zinjacoder has quit [Remote host closed the connection]
<graspee>
yeah maybe. still testing stuff though
schaerli has quit [Remote host closed the connection]
c0rn_ has joined #ruby
<graspee>
i think it's just the png gem failing, not gosu
EvanR has quit [Read error: Connection reset by peer]
EvanR has joined #ruby
EvanR is now known as Guest45208
zommi has quit [Remote host closed the connection]
RainbowDashh has joined #ruby
zinjacoder has joined #ruby
rakunHo has joined #ruby
zinjacoder has quit [Remote host closed the connection]
JohnBat26 has joined #ruby
adamkittelson has joined #ruby
samuel02 has joined #ruby
<graspee>
and the gem documentation does say that reading pngs is not that polished yet
freezey has quit [Ping timeout: 260 seconds]
freezey has joined #ruby
Targen has quit [Ping timeout: 265 seconds]
mpun7 has quit [Ping timeout: 246 seconds]
berserkr has joined #ruby
Guest45208 has quit [Read error: Connection reset by peer]
EvanR_ has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
brianpWins has quit [Read error: Connection reset by peer]
<shevy>
wmoxam, indeed. one has to read and write japanese for it
r0bby has joined #ruby
<shevy>
translate.google makes things funny
robbyoconnor has quit [Ping timeout: 272 seconds]
<shevy>
ok
mockra has quit [Remote host closed the connection]
<shevy>
here we go translate
<shevy>
"The parallelism of the Church-Rosser confluence by"
<shevy>
"Von Neumann bottleneck does not occur"
<shevy>
"A bug in the program type that can be discovered by inspection"
joch_n has joined #ruby
<shevy>
"All you need to truly optimize good"
<shevy>
"Optimize the use of domain-specific knowledge"
_iMBA has quit [Quit: Leaving.]
<shevy>
"Language is Turing incomplete optimization strict If there is a possible"
<shevy>
hmm
<shevy>
now I understand where yoda originated
<shevy>
he came from one of those translate google things
<wmoxam>
funny, Shevy thinks he is
WeH has joined #ruby
<Sigma00>
it's common knowledge that yoda's script was written in japanese and run through google translate :P
WeH has left #ruby [#ruby]
<shevy>
if the japanese could just get rid of those awful symbols
_iMBA has joined #ruby
<hackeron>
any familiar with GPS trackers?, I'm trying to get information from a GPS tracker to a ruby socket - the format is somewhat weird, whenever I am driving, the GPS tracker reports 2 numbers, for example 24.86 (speed?) and 155.06 -- what do you think could be the second number? - It isn't reported when the vehicle is stationary
ph^ has joined #ruby
<Sigma00>
can't help much without knowing which GPS tracker you're using
elux has joined #ruby
<hackeron>
this is what a complete line looks like: 2012-06-20T15:35:33Z::imei:012497000372775,tracker,1206202335,,F,153502.000,A,5135.7656,N,00014.1210,E,21.19,347.76,;
<mrbrdo>
which things would you say are very different to ruby as compared to C (or C++)? if I start with lambdas&blocks, class reopen and method redefinition?
Targen has joined #ruby
<Sigma00>
careful, c++11 has lambda expressions now
<mrbrdo>
yes I know
<mrbrdo>
but I mean the old C++
<mrbrdo>
I actually mean more compared to C, but I said C++ just because I don't want you to say "it's OOP"
<Sigma00>
what you said would be the biggest differences then, yeah
<shevy>
C++ is less about OOP and more about a disease
r0bby_ has joined #ruby
<mrbrdo>
Sigma00: I'm looking for more :)
<gogiel>
mrbrdo: duck typing
r0bby has quit [Ping timeout: 260 seconds]
<Sigma00>
right, lack of object types
<mrbrdo>
gogiel: well that's not as much of a problem though
<Sigma00>
er, s/object/var/
<mrbrdo>
because if you include ruby.h and link to ruby then you can use VALUE
<mrbrdo>
(without running the interpreter)
exchgr has joined #ruby
<wmoxam>
this smells like a homework assignmnet
<mrbrdo>
well you smell wrong then
exchgr is now known as exlinux
mucker has quit [Quit: leaving]
<mrbrdo>
also an interesting thing
<mrbrdo>
Binding can change existing locals but it can't define new ones
<gogiel>
mrbrdo: garbage collecting
<mrbrdo>
although I guess this is reasonable
<mrbrdo>
gogiel: well this you can still do if you link to ruby and use VALUE :P
<mrbrdo>
although I guess you need to mark by yourself
chomp has quit [Quit: Leaving]
minijupe has quit [Quit: minijupe]
<mrbrdo>
which then is some work I guess
<shevy>
ruby 3.0 will have the brain interface
Solnse has quit [Remote host closed the connection]
<shevy>
then work becomes THOUGHTS
<mrbrdo>
:)
<gogiel>
mrbrdo: well i don't get your question
ianbrandt has quit [Read error: Connection reset by peer]
Solnse has joined #ruby
<mrbrdo>
gogiel: perhaps in this sense, if you were translating ruby into C, which would be the biggest problems to overcome
ianbrandt has joined #ruby
<Sigma00>
problems? none, really
<shevy>
pointers
<mrbrdo>
well method redefinition is a problem in C for example
<mrbrdo>
you can get around it, but it's something to solve
robbyoconnor has joined #ruby
<mrbrdo>
pointers aren't really a problem if you use ruby VALUE type
<Sigma00>
you'd have to rewrite anything you've overloaded, certainly
<gogiel>
mrbrdo: you can use map of function pointers :P
josefig has joined #ruby
<mrbrdo>
gogiel: what do you mean?
<gogiel>
nothing. it's just stupid. C is C, Ruby is Ruby
schovi has joined #ruby
<gogiel>
you want to port some Ruby code to C, right?
<mrbrdo>
Sigma00: actually you can use a pointer to the method and call through that, then you only need to overwrite the pointer when you redefine the method
g0bl1n has joined #ruby
g0bl1n has quit [Changing host]
g0bl1n has joined #ruby
<gogiel>
you always can write ruby code that looks like C. i know people who "code" ruby or python with that style - its awful
<Mon_Ouie>
If you compile ruby code to C, redefining methods isn't really a problem — you just don't translate method definition to function definition
r0bby_ has quit [Ping timeout: 246 seconds]
<mrbrdo>
Mon_Ouie: sure you have to
<Hanmac>
gogiel: my ruby bindings are written in c++
<Mon_Ouie>
No you don't. You can translate it to changing a function pointer somewhere.
<gogiel>
mrbrdo: code made by converters like this is garbage
<mrbrdo>
Mon_Ouie: well yeah, that's what I said a few lines before
<mrbrdo>
gogiel: why would it be garbage?
<gogiel>
mrbrdo: it would be unreadable
eywu1 has joined #ruby
<mrbrdo>
gogiel: it doesn't matter if it's readable
eywu1 has quit [Client Quit]
robdodson_ has joined #ruby
robdodson_ has quit [Client Quit]
<mrbrdo>
actually LLVM is one approach to something like this, but it doesn't seem to work very well because of how different ruby is to compiled languages
<gogiel>
mrbrdo: if you want to use ruby.h it's pointless
<mrbrdo>
gogiel: why?
remmy444 has quit [Ping timeout: 246 seconds]
r0bby has joined #ruby
<gogiel>
mrbrdo: because code like that is dependent on ruby?
<mrbrdo>
so?
<mrbrdo>
why is that a problem
<gogiel>
mrbrdo: it's useless. it would slower than ruby itself
robdodson has quit [Ping timeout: 252 seconds]
mjb2k has quit [Ping timeout: 276 seconds]
<mrbrdo>
gogiel: why would it be slower?
burgestrand has joined #ruby
eywu has quit [Ping timeout: 244 seconds]
<mrbrdo>
with proc and binding implemented fibonacci is 5 times faster than YARV
<Hanmac>
gogiel: are you kidding me? compiled code is in 99% of the cases faster then interpreted code
robbyoconnor has quit [Ping timeout: 246 seconds]
<mrbrdo>
with directly translating YARV instructions without optimizing by hand
<shevy>
swig code is fastest
<mrbrdo>
of course there is some other stuff to consider, but still
<Hanmac>
swig code is also the worst
werdnativ has joined #ruby
<gogiel>
Hanmac: yes, but converters always produce TONS of useless code
<mrbrdo>
gogiel: not necessarily
robotmay has joined #ruby
<mrbrdo>
did you look at RubyVM::InstructionSequence::compile?
eywu has joined #ruby
<mrbrdo>
it basically gives you bytecode of instruction… that bytecode is just executed then in VM
<Hanmac>
gogiel: thats why my gems are not generated by a converter like swig ... my bindings a written by my own hands
<gogiel>
mrbrdo: so your problem is solved
<mrbrdo>
well it's not solved, still need to do stuff like method redefinition and so on :)
<mrbrdo>
that's why I asked which are the most different things, to try to understand if there is something that would significantly impact this kind of solution
<gogiel>
you can store methods as pointers
eywu has quit [Client Quit]
<mrbrdo>
I know, I can't give an example for which I already know solution
<mrbrdo>
I don't*
keppy has quit [Read error: Operation timed out]
iocor has joined #ruby
<gogiel>
mrbrdo: if i were you i would start with reading MRI
<mrbrdo>
the source you mean?
yousoufos has joined #ruby
heftig has quit [Ping timeout: 248 seconds]
schovi has quit [Remote host closed the connection]
danielpunt has joined #ruby
LtHummus has quit [Ping timeout: 276 seconds]
heftig_ has joined #ruby
LtHummus has joined #ruby
JeffreyBaird has quit [Quit: JeffreyBaird]
yousoufos has quit [Client Quit]
TheFuzzball has quit [Quit: Leaving...]
michaelmartinez has joined #ruby
exchgr has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
<shevy>
better
<shevy>
help matz work with mRuby
<mrbrdo>
valid suggestion I guess
danielpunt has quit [Remote host closed the connection]
<mrbrdo>
I usually just look at the insns.def and then grep in the ruby source though
mockra has joined #ruby
<gogiel>
rb_define_method is used to define method and it's pointer to function
<mrbrdo>
i'm well past that part :)
qwerxy has quit [Quit: offski]
<mrbrdo>
I have a working version that can compile code for fibonacci defined in class defined in module
<mrbrdo>
(which module is defined with defineclass instr anyway)
<gogiel>
mrbrdo: you are using ruby.h?
<mrbrdo>
yes
<gogiel>
so what's the problem with defining methods?
Stormbytes has quit [Ping timeout: 246 seconds]
<mrbrdo>
I didn't have a specific problem, just a question of what you think would be the hardest thing to do :)
<gogiel>
how do you store methods?
ryanf has joined #ruby
<mrbrdo>
compiled… but I don't use a funcptr yet
<mrbrdo>
so no method redefinition inside C for now, but this will not be a lot of work
abionic has joined #ruby
<_axx>
hey guys, if i want to convert an variable from string to integer, like myval.to_i i would do something like myval = myval.to_i, is there a shorter way?
<Mitor>
hmm
<gogiel>
_axx: no, there's not
<_axx>
ok, thanks :)
workmad3 has joined #ruby
<mrbrdo>
I use some tricks to bypass ABI on x86_64 so I have locals on native stack.. so I have already set up the stack so it can be used in ruby… I am now decoding Binding so I can communicate with ruby code more easily :)
<gogiel>
_axx: for the same reason you can't do i++
<mrbrdo>
after I implement Binding I can probably offload almost everything I can't parse yet to binding.eval
tommyvyo_ has joined #ruby
Stormbytes has joined #ruby
fayimora_ has joined #ruby
heftig_ is now known as heftig
<mrbrdo>
but not sure if there is a way in the exposed API to pass bytecode to eval in binding though, probably not
exchgr has quit [Quit: exchgr]
exlinux has quit [Quit: exlinux]
tvw has joined #ruby
<_axx>
gogiel: yeah, thought about that too. ^^ but wasn't quite sure..
exchgr has joined #ruby
fayimora has quit [Ping timeout: 250 seconds]
fayimora_ is now known as fayimora
Lachryma has quit [Quit: Leaving]
<mrbrdo>
well you can do stuff like that with strings I think
<mrbrdo>
since it stays the same object
fayimora_ has joined #ruby
sailias has joined #ruby
mockra has quit [Remote host closed the connection]
CannedCorn has quit [Ping timeout: 244 seconds]
<mrbrdo>
btw did anyone ever dig into rb_env_t
francisfish has joined #ruby
<mrbrdo>
I wonder what VALUE *env inside it is
Gavilan has left #ruby [#ruby]
bosphorus has quit [Remote host closed the connection]
axiak has quit [Quit: leaving]
stephenjudkins has quit [Quit: stephenjudkins]
axiak has joined #ruby
fayimora has quit [Ping timeout: 250 seconds]
fayimora_ is now known as fayimora
graspee has joined #ruby
RainbowDashh has quit [Read error: Connection reset by peer]
ramblex has joined #ruby
<gogiel>
mrbrdo: isn't it ENV?
<mrbrdo>
don't think so, it has to be a pointer to something where local variables can be stored
axiak has quit [Client Quit]
<gogiel>
mrbrdo: maybe it's a context?
<mrbrdo>
i'm browsing in source now :)
axiak has joined #ruby
<mrbrdo>
aha found it
<mrbrdo>
it allocates it with ruby ALLOC_N
piotr_ has joined #ruby
<mrbrdo>
and the size is count of local vars + 1 + 1
<mrbrdo>
1 of those is for sure for self I think
<lectrick>
How do I split up a long string of text into strings of 10 words each?
fayimora_ has joined #ruby
cheese1756 has quit [Ping timeout: 245 seconds]
<heftig>
str.split.each_slice(10)
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
axiak has quit [Client Quit]
<mrbrdo>
or with regexp like (([^\s]+){10}) (untested)
Axsuul has joined #ruby
<heftig>
it's an enumerator, so add a block if you want to iterate, or .to_a to get an array
<gogiel>
mrbrdo: so it's just context of execution
cheese1756 has joined #ruby
<heftig>
or just pass the enumerator around
axiak has joined #ruby
<mrbrdo>
gogiel: any idea what the last thing in it could be? so locals + self + what?
hukl has joined #ruby
peregrine81 has joined #ruby
<lectrick>
Why is "puts" also defined as a private method on strings?
fayimora has quit [Ping timeout: 248 seconds]
fayimora_ is now known as fayimora
<lectrick>
"afg".send(:puts, 'hello')
<mrbrdo>
lectrick: I think it's defined on Object as private
<lectrick>
ah ok
<mrbrdo>
so all objects probably have it
<mrbrdo>
not sure though
mengu has joined #ruby
<lectrick>
yep, fixnum has it too so that must be it heh
<mrbrdo>
it doesn't matter performance-wise or anything
sandstrom has quit [Quit: sandstrom]
<mrbrdo>
I like that I don't have to call something like System.out.println :P
<heftig>
they're in the Kernel module
<heftig>
which is included in Object
cjs226 has joined #ruby
axiak has quit [Quit: leaving]
axiak has joined #ruby
v0n has joined #ruby
jgarvey has quit [Quit: Leaving]
axiak has quit [Client Quit]
axiak has joined #ruby
tatsuya_o has joined #ruby
axiak has quit [Client Quit]
axiak has joined #ruby
williamcotton has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
norm has joined #ruby
<norm>
is it possible for rake to use "-g" (include rakefiles from ~/.rake) by default?
jrist-gym is now known as jrist
<gogiel>
mrbrdo: you can do STDOUT.print :0
elux has quit [Quit: Bye!]
<mrbrdo>
?
<mrbrdo>
I get an error if I try that
<mrbrdo>
unexpected tINTEGER
<gogiel>
sorry, i meant ;)
<gogiel>
STDOUT.print "string"
<dtolj>
How to convert duration in format "%H:%M:%S" to integer of total seconds?
mockra has joined #ruby
grendlme has joined #ruby
Cicloid has joined #ruby
<mrbrdo>
gogiel: I like that I can use puts :)
miho has quit [Read error: Connection reset by peer]
<shadoi>
dtolj: see strftime
<mrbrdo>
bad memories of Java
<gogiel>
dtolj: Date.parse
tatsuya_o has joined #ruby
kpshek has quit []
vitoravelino is now known as vitoravelino`afk
abionic has quit [Read error: Connection reset by peer]
<gogiel>
or just .to_date using ActiveSupport afair
abionic has joined #ruby
miho has joined #ruby
<mrbrdo>
gogiel: btw I think the last value in env is related to GC (like used for marking for GC)
flip_digits has joined #ruby
KarlHungus has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
fantazo has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
mpereira has joined #ruby
enroxorz has quit [Quit: leaving]
ankakusu has quit [Ping timeout: 245 seconds]
dtolj has quit [Ping timeout: 245 seconds]
enroxorz has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
BiHi has quit [Quit: Computer has gone to sleep]
coderhut_ has quit [Ping timeout: 245 seconds]
fermion has quit [Quit: P]
Ethan has joined #ruby
abionic has quit [Read error: Connection reset by peer]
mengu has quit [Read error: Connection reset by peer]
Bosma has joined #ruby
abionic has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
<mrbrdo>
gogiel: it's previous env :)
<mrbrdo>
I should have known that heh
josefig has joined #ruby
_NKG has joined #ruby
pygmael has joined #ruby
<Mon_Ouie>
I know he left, but strftime or Date.parse are fore getting a time (or date), not a duration
<mrbrdo>
can you subtract a Date from a DateTime?
enherit has quit [Quit: leaving]
perryh is now known as perry
azm has joined #ruby
fayimora has quit [Quit: Busy…..zzzzz]
schaerli has joined #ruby
<_NKG>
1
pygmael has quit [Ping timeout: 265 seconds]
peregrine81 has quit [Quit: Computer sleeping.]
_NKG has quit [Quit: leaving]
Eldariof-ru has quit []
pygmael has joined #ruby
zeromodulus has quit [Remote host closed the connection]
minijupe has joined #ruby
kpshek has joined #ruby
vitoravelino`afk is now known as vitoravelino
abionic has quit [Read error: Connection reset by peer]
abionic has joined #ruby
cousine has joined #ruby
niklasb has quit [Read error: Operation timed out]
kevinbond has joined #ruby
timonv has joined #ruby
alexmin has quit [Ping timeout: 245 seconds]
skrewler has joined #ruby
cousine has quit [Remote host closed the connection]
wereHamster has quit [Quit: Lost terminal]
fayimora has joined #ruby
ng_ has joined #ruby
sroy2 has joined #ruby
federic has quit [Remote host closed the connection]
sroy2 has quit [Client Quit]
enherit has joined #ruby
bosphorus has joined #ruby
whitenoise has quit [Read error: Connection reset by peer]
kpshek has quit []
jeax has joined #ruby
Poapfel has joined #ruby
QaDeS has joined #ruby
kenperkins has quit [Quit: Computer has gone to sleep.]
jonatha__ has quit [Read error: Connection reset by peer]
jonathanwallace has joined #ruby
Jackneill has quit [Read error: Connection reset by peer]
Natch has quit [Read error: Connection reset by peer]
Natch has joined #ruby
<shevy>
mrbrdo!
<shevy>
go write ruby code!
<mrbrdo>
what? :)
explody has joined #ruby
<shevy>
we need to improve all ruby projects
<shevy>
go go go
<mrbrdo>
what do you mean?
mikepack has quit [Read error: Connection reset by peer]
<shevy>
mrbrdo we need lots of good ruby projects
<shevy>
mrbrdo do you write ruby
azm has quit [Ping timeout: 246 seconds]
<mrbrdo>
so, I made good ruby projects
<shevy>
good, excellent!
<shevy>
that is the spirit
mockra has quit [Remote host closed the connection]
wereHamster has joined #ruby
<mrbrdo>
I even have a commit in rails master :-)
<shevy>
hmmmm
<shevy>
work more outside rails
<shevy>
we need a larger profile for ruby
<mrbrdo>
well
<shevy>
otherwise rails could become a black hole DEVOURING ruby
<mrbrdo>
yes
lepht has joined #ruby
<wmoxam>
lol
<mrbrdo>
dunno, I don't really have any non-web projects at the moment
<shevy>
:(
wallerdev has joined #ruby
<mrbrdo>
but I use ruby in most cases
mockra has joined #ruby
<mrbrdo>
but I also do some low-level programming
<mrbrdo>
so then I use C usually
<shevy>
yeah
<shevy>
in C
<shevy>
:P
<shevy>
pffft I stick to graspee
<shevy>
together we'll change the world
<mrbrdo>
:)
xaq has joined #ruby
<mrbrdo>
I can't wait for mruby stable
<mrbrdo>
this will be really good
emmanuelux has joined #ruby
<enroxorz>
mrbrdo: you and me both
<enroxorz>
i want to see what it can do in terms of performance
ABK_ has joined #ruby
peregrine81 has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<Hanmac>
"I made good ruby projects" and "I even have a commit in rails" ... how does it fit together? XD
<mrbrdo>
well it's still ruby code even it's for rails
IrishGringo has quit [Ping timeout: 244 seconds]
slap has joined #ruby
<Hanmac>
rails is very much of monkey patching ... from monkeys, for monkeys
<shevy>
mrbrdo probably will take a long, long time
<enroxorz>
confession: havent touched rails since starting with Ruby
<mrbrdo>
enroxorz: poor matz… he created this great language but he has to code most of the time in C to write the interpreter :P
<enroxorz>
I use sinatra for any web dev i gotta do
mikepack has joined #ruby
<shevy>
Hanmac, well except for one thing - ruby really should give us the ability to default to the core status of all classes. the tabula rasa state for all classes and modules
<enroxorz>
mrbrdo: if i knew C better i would help Matz
pu22l3r has quit [Read error: Operation timed out]
<shadoi>
development and app (not gem) deployment.
francisfish has joined #ruby
<shadoi>
It's fine to use bundler for gem development (and convenient to use it with .gemspec files), just don't add bundler to your gem depdendencies.
<shadoi>
dependencies*
tommyvyo_ has quit [Quit: Computer has gone to sleep.]
jonathanwallace has quit [Ping timeout: 276 seconds]
<cek>
well crap, they mislead me
<cek>
speaking of, found begin; require 'rubygems'; rescue; end line in stomp gem. what was that for?
francisfish has quit [Read error: Connection reset by peer]
<shadoi>
1.8 you had to require rubygems
<shadoi>
1.9 already has it
<shadoi>
so he just rescued any errors (nasty way to do it)
francisfish has joined #ruby
<ged>
And for 1.8 and before, it was optional, so it was entirely likely that you could install it via one of the other installers.
<shadoi>
*nod*
srji_ has joined #ruby
srji_ has quit [Client Quit]
<cek>
yea, only that it rescues standarderror, which is adjacent to loaderror
indian has joined #ruby
<cek>
would be wonderful if they could publish the usage guide
<cek>
once you require 'bundler' in your app, bundler is your gem's dep.
<cek>
what are publishers doing, stripping out the requires before uploading?
<cek>
what's the workflow?
<ged>
I don't use bundler for anything.
keppy has quit [Quit: Leaving]
<ged>
So nothing to strip out.
ghanima has quit [Quit: Leaving.]
<shadoi>
cek: if you're writing a gem, you don't refer to your local dev environment whatsoever.
srji has quit [Ping timeout: 265 seconds]
<shadoi>
Bundler will auto-require your local gem.
srji has joined #ruby
hynkle has quit [Quit: hynkle]
<cek>
where should I put the require 'bundler/setup' line?
<shadoi>
or your gem development environment rather
<cek>
i'd like to Bundler manages an application's dependencies through its entire life across many machines systematically and repeatably. right the whole sentence.
blacktulip has quit [Remote host closed the connection]
mayankkohaley has quit [Ping timeout: 245 seconds]
<shadoi>
You shouldn't have it in your gem anywhere
tcopp has quit [Quit: Lost terminal]
<shadoi>
just require the libs you need
<cek>
you see, my gem depends on other libs, bundler advertises that it will take care of tracking those libs. So I get him into the company. Now I see the comment from developer that it actually should not be anywhere in the gem.
<shadoi>
It will
<shadoi>
It's in your .gemspec
SeanLazer has quit [Quit: SeanLazer]
josefig has quit [Quit: Computer has gone to sleep.]
* Hanmac
never used bundler for my gems
zeromodulus has quit [Read error: Connection reset by peer]
<cek>
well yeah, the .gemspec has all those deps already there. and the Gemfile is just reading those with gemspec line.
<shadoi>
I use it for lots of gems, it works great.
stephenjudkins has quit [Quit: stephenjudkins]
<shevy>
ack
miho has quit [Read error: Connection reset by peer]
<shevy>
bundler!
peregrine81 has quit [Quit: Goodbye.]
<cek>
i was perplexed by "Inside your app, load up the bundled environment" line in bundler guide
SeanLazer has joined #ruby
<shevy>
a virus spreads and so does bundler
zeromodulus has joined #ruby
<shevy>
Hanmac one day you will fall too ;)
<shevy>
it'll happen slowly... over night ...
<shevy>
ever saw Invasion of the body snatchers?
<cek>
is that like critters?
faitswulff has joined #ruby
miho has joined #ruby
<cek>
anyways, shadoi, how do you use it if you actually don't use it? you don't require 'bundler', you don't use bundler.
<cek>
are you using it solely for gem installments and updates? because that's a different story.
* Hanmac
use rake ...
<shadoi>
cek: 'bundle install' gets me all the dependencies for my gem, bundle update lets me control the dep versions that are locked, etc.
Stormbytes has quit [Quit: Leaving...]
<cek>
ohh, so you use the end-user part :)
<shadoi>
no
<shevy>
cek hmm no... critters I think was more direct violence. invasion of body snatchers, the original one, built upon "communist fears". in the 197x version, it was more alien plants building human clones
<shadoi>
the development part.
dnyy has joined #ruby
<shevy>
or rather "growing"
ken_barber has quit [Remote host closed the connection]
<cek>
i'll leave the bundler to rest in peace now
<cek>
shevy, robot plants building other robots is cooler.
niklasb has joined #ruby
<cek>
Tremors was good, too.
Niamkik has quit [Remote host closed the connection]
Croms has joined #ruby
MrGando has quit [Quit: Bye]
<faitswulff>
I'm going through the Ruby Koans and about_hashes just blew my mind by setting the default value with a block: git://gist.github.com/2962384.git
<faitswulff>
Can anyone explain what's going on there?
<ekaleido>
xml is how satan himself sends messages in hell
<ekaleido>
true story
<cek>
*st_table that
<apeiros_>
cek: yes. wonder over wonders - serialization is about data, not code… but yes, it would be nice if ruby could serialize procs (js after all can serialize its functions)
jimeh4 has quit [Ping timeout: 260 seconds]
<shevy>
faitswulff that is rubyOS
dnyy has quit [Remote host closed the connection]
<cek>
well, hash is a data type, but as i said ruby is lazily typed
<Hanmac>
apeiros_ yeah that would be cool ...
<shevy>
cek is like the channel clown ;P
<apeiros_>
repeating the wrong claim. ruby ain't lazily typed.
carlyle has quit [Remote host closed the connection]
fantazo has quit [Remote host closed the connection]
eywu has joined #ruby
tommyvyo has joined #ruby
<jlogsdon>
its loosely typed
<apeiros_>
Hanmac: I guess the difficulty is with procs/lambdas being closures. but I think doing it like js would be fine enough
<apeiros_>
jlogsdon: no
<cek>
shevy, well the channel would sick in archaic beauracratic swamp otherwise
<cek>
you'd get robots answering robots questions
<apeiros_>
jlogsdon: weak/loose is wrong too. rubys typing system is strong, dynamical typing
<jlogsdon>
"123abc".to_i => 123
<Hanmac>
haha you fail
<apeiros_>
jlogsdon: weak typing would mean the class of an object can change. it can't
<jlogsdon>
touche
<jlogsdon>
dynamic it is
<apeiros_>
.to_i returns a new object ;-)
<jlogsdon>
shush you
<jlogsdon>
stop being so damned right
user__ has quit [Quit: Forget progress by proxy. Land on your own moon.]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<apeiros_>
jlogsdon: 8y of ruby+irc do that to you :-p
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
<jlogsdon>
haha i bet
<cek>
apeiros_, Struct.new
<jlogsdon>
im only at 2y ruby and ~6m irc (for ruby)
<apeiros_>
cek: what about it?
tommyvyo has quit [Client Quit]
wallerdev has quit [Quit: wallerdev]
atmosx has joined #ruby
<cek>
class of an object changes I guess, but that's the only scenario I can think of.
Aaton_off is now known as Aaton
<apeiros_>
cek: with Struct.new, no class of an object changes.
<apeiros_>
Struct is still Struct after Struct.new.
<apeiros_>
you create a new class. just like `class Foo; end` does or Class.new does. but no change of a class in either of these.
<cek>
yeah, that what i meant, the object instance doesn't have the object's class
sailias has quit [Quit: Leaving.]
sailias has joined #ruby
wmoxam has quit [Ping timeout: 255 seconds]
<cek>
why would you need to change the class? you can change the behaviour of the object with mixins and such.
alanp_ has joined #ruby
alanp_ has quit [Read error: Connection reset by peer]
<apeiros_>
that's not the point. the point is that a weakly/loosely typed system means that you *can* change the class of an object.
balki_ has joined #ruby
balki_ has quit [Read error: Connection reset by peer]
cbuxton has joined #ruby
<apeiros_>
which means rubys typing isn't weak/loose. it's strong.
alanp_ has joined #ruby
faitswulff has joined #ruby
balki_ has joined #ruby
<cek>
what's the point of changing the class of an object?
<apeiros_>
and it's dynamical because you're not forced to declare the type of a variable. and neither is the type inferred. x = 1; x = "" - works fine and is allowed.
<apeiros_>
cek: ask the js guys.
dv310p3r has quit [Ping timeout: 244 seconds]
sailias has quit [Client Quit]
<cek>
hold on
<apeiros_>
or any other loosely typed language's implementors
straind has quit [Read error: Connection reset by peer]
yankhates has quit [Ping timeout: 260 seconds]
Solnse2 has quit [Remote host closed the connection]
Solnse has joined #ruby
carlyle has joined #ruby
alanp has quit [Ping timeout: 250 seconds]
balki has quit [Ping timeout: 250 seconds]
wilmoore has joined #ruby
<cek>
well js channel's dead despite of same number of people present
c0rn_ has joined #ruby
jonathanwallace has joined #ruby
tzvi|work has quit [Remote host closed the connection]
zchr has joined #ruby
kpshek has quit []
jimeh4 has joined #ruby
Guest____ has joined #ruby
<cek>
js say "because there is no class"
yxhuvud has quit [Ping timeout: 255 seconds]
<cout>
ruby lets you modify an object's singleton class, which is not entirely different from changing the object's class
<cek>
but enought to change the behaviour of the object.
<cout>
or at the very least,it's not entirely different from changing the object's type
<cek>
so why argue if the outcome's the same
<cout>
who's arguing?
MasterIdler_ has joined #ruby
MasterIdler_ has quit [Client Quit]
jamescarr has joined #ruby
chson has quit [Remote host closed the connection]
<cek>
apeiros_ opened a programming book by charles babbage and reads snippets out of it
iocor has quit [Quit: Computer has gone to sleep.]
uris has quit [Quit: leaving]
<apeiros_>
cek: what are you trying to say, hm?
jamescarr has quit [Client Quit]
Criztian has quit [Remote host closed the connection]
<cout>
I can rarely tell what cek is trying to say
<apeiros_>
I can often say I'm tempted to pull out the ban-hammer. but if I'd do it now he'd go all whiney about how it was just because he said something to me that I didn't like…
MasterIdler has quit [Ping timeout: 248 seconds]
<cek>
if I continue the conversation with the js guys, i'm sure they will steal our eigenclasses, so let's wrap it up.
wpaulson has joined #ruby
ABK_ has quit [Read error: Connection reset by peer]
<cek>
apeiros_, yeah, if you don't like the conversation - set the ignore filter, that's all.
ABK_ has joined #ruby
<apeiros_>
cek: no dude. if you behave like an asshat, I kick you. that's all.
PaciFisT has quit [Quit: Leaving.]
axiak has quit [Quit: leaving]
axiak has joined #ruby
hunglin has quit [Ping timeout: 244 seconds]
niklasb has quit [Read error: No route to host]
axiak has quit [Client Quit]
minijupe has quit [Quit: minijupe]
axiak has joined #ruby
PaciFisT has joined #ruby
PaciFisT has quit [Client Quit]
ZachBeta has joined #ruby
mikepack has joined #ruby
axiak has quit [Client Quit]
minijupe has joined #ruby
<shevy>
is there any usable torrent library in ruby?
SirRamonGabriel has quit [Remote host closed the connection]
dnyy has joined #ruby
akem has quit [Max SendQ exceeded]
rowanu has joined #ruby
btanaka has joined #ruby
carlyle has quit [Remote host closed the connection]
akem has joined #ruby
awarner has quit [Remote host closed the connection]
<Sigma00>
heh, 'threats' are warnings. If you didn't he'd be saying 'OMG YOU NEVER TOLD ME'
crankycoder has joined #ruby
rowanu has quit [Remote host closed the connection]
pk1001100011 has quit [Quit: Burn your gods and kill the king; Subjugate your suffering; Dead heart, in a dead world]
<apeiros_>
Sigma00: right. also, who'd feel threatened by "don't behave like an asshat or you go out"? …exactly, only people who know they behave like one… anyway, bed time for me
<apeiros_>
(if he'd believe he hadn't behaved like one, he'd argue about how he wasn't one)
iocor has joined #ruby
apeiros_ has quit [Remote host closed the connection]
straind has joined #ruby
wardrop has joined #ruby
<wardrop>
Does anyone know how I can send input to a system command. For example, if I run a mysql command, e.g. `mysql --user backup_user --password` it prompts for a password. How do I send that password? I've looked at the Open3 library but it doesn't make it clear how to achieve this.
<fowl>
IO.popen
mikepack has joined #ruby
SirRamonGabriel has joined #ruby
demian`_ has joined #ruby
banisterfiend has joined #ruby
<wardrop>
Using IO.popen, how do I wait until the command asks for input, then only provide the input at that point?
<wardrop>
There's normally a one second delay between running the mysql command, and having it prompt for the password.
<fowl>
wardrop, when you get to that point you'll realize there are all kinds of database gems you could be using instead
peregrine81 has joined #ruby
dhruvasagar has quit [Ping timeout: 260 seconds]
<wardrop>
Yes, but this Ruby script I'm writing is meant to act as a backup coordinator. It's meant to basically run system commands. SSH, Backup MySQL, etc.
r0bby_ has joined #ruby
robbyoconnor has quit [Ping timeout: 244 seconds]
[johnonymous] has joined #ruby
<wardrop>
Rewriting all these built in system tools or learning a whole new API doesn't make any sense.
mrbrdo has quit [Quit: mrbrdo]
ZachBeta has quit [Quit: Computer has gone to sleep.]
<atmosx>
aloha
<shevy>
atmosx! my brother from another mother!
[johnonymous] has quit [Client Quit]
[johnonymous] has joined #ruby
Vert has joined #ruby
ZachBeta has joined #ruby
yaasii has joined #ruby
chrismcg is now known as zz_chrismcg
mpun7 has joined #ruby
brasten has quit [Quit: brasten]
[johnonymous] has quit [Client Quit]
JeffreyBaird has quit [Quit: JeffreyBaird]
randomautomator has quit [Remote host closed the connection]
mikeg has joined #ruby
eywu has quit [Ping timeout: 244 seconds]
nari has joined #ruby
atmosx has quit [Ping timeout: 276 seconds]
atmosx has joined #ruby
<atmosx>
shevy: how's life (my internet connection is lousy :-(( )
<shevy>
busy busy
bosphorus has quit [Remote host closed the connection]
<shevy>
and there is a heatwave in central europe which is so annoying
<atmosx>
yes
ianbishop has joined #ruby
<heftig>
atmosx: how lousy?
[johnonymous] has joined #ruby
<atmosx>
I'm sweating all day long, it's incredibly hot here too
<shevy>
yeah
<shevy>
and there are mosquitos too, I hate them
kuranai|off has quit [Ping timeout: 250 seconds]
<atmosx>
heftig: it's lame, gets disconnected every day between 23:00 and 4:00 am from 3 to 5 times... I'll switch to cable when I come back.
<heftig>
eh, i get disconnected after 24h of uptime. always.
<heftig>
and that changes my ipv4
saschagehlich has quit [Quit: saschagehlich]
yaasii has quit [Quit: Leaving...]
<atmosx>
shevy: ah I don't have mosquitos and/or bugs here ...
<atmosx>
I will have in aprox 10 days when I'll be home
SeanLazer has quit [Quit: SeanLazer]
<shevy>
hehehehe
SeanLazer has joined #ruby
[johnonymous] has quit [Client Quit]
kuranai|off has joined #ruby
fayimora has quit [Read error: Operation timed out]
[johnonymous] has joined #ruby
luckyruby has quit [Remote host closed the connection]
<atmosx>
heftig: you should change ISP too then
<atmosx>
I have too many services running here... disconnects last just 5 minutes max but... still they are annoying
Juul has quit [Ping timeout: 248 seconds]
<heftig>
they're all doing it
eywu has joined #ruby
baroquebobcat_ has joined #ruby
<heftig>
well, those available here, at least (rural area, consumer line)
yaasii has joined #ruby
<heftig>
so i'm stuck.
<heftig>
with a lame 768/128kbit 100ms, to boot
mikepack has quit [Remote host closed the connection]
the_jeebster1 has quit [Quit: Leaving.]
cbuxton1 has joined #ruby
Juul has joined #ruby
baroquebobcat has quit [Read error: Operation timed out]
jimeh4 has quit [Ping timeout: 255 seconds]
yaasii has quit [Client Quit]
cbuxton has quit [Ping timeout: 246 seconds]
baroquebobcat_ has quit [Ping timeout: 250 seconds]
atmosx has quit [Ping timeout: 276 seconds]
Morgotth has quit [Ping timeout: 264 seconds]
werdnativ has quit [Quit: FAMOUS_LAST_WORDS is nil]
[johnonymous] has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
SirRamonGabriel has quit [Remote host closed the connection]
[[johnonymous]] has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
SirRamonGabriel has joined #ruby
<rakm>
i think this might be more a programming practices question than ruby specific, but can someone explain why it's better to say….. 'if something !=nil && something' ? It seems redundant to me.
<rakm>
the above as opposed to just 'something != nil'
tewecske has quit [Quit: Leaving.]
kaneda__ has quit [Ping timeout: 244 seconds]
SirRamonGabriel has quit [Remote host closed the connection]
Guest_ has joined #ruby
Guest_ has quit [Client Quit]
<shevy>
dunno
<shevy>
but it looks ugly
mockra has quit [Remote host closed the connection]
<daed>
your mom.
<shevy>
normally I'd check like "unless something.nil?"
<shevy>
daed! hi!
mockra has joined #ruby
<wardrop>
So does anyone know how to provide a password to a shell command with Ruby?
<rakm>
yeah that's what I would think. Looking at a codebase and it's been done over and over by programmers less experienced in Ruby, but way more experienced in other languages
[[johnonymous]] has joined #ruby
fayimora has joined #ruby
rbanffy has quit [Quit: Ex-Chat]
[[johnonymous]] has quit [Client Quit]
xubuntu5 has joined #ruby
<Gavilan>
rakm: is nil == false?
<rakm>
not the same object in ruby, but evaluates to the same?
<oooPaul>
No.
[[johnonymous]] has joined #ruby
<oooPaul>
Both will "fail" in an if statement, however, they are not equivalent.
<shevy>
Gavilan nil is kinda like the object that does not want to exist
<Gavilan>
then something !=nil && something is different than something !=nil ...
atmosx has quit [Ping timeout: 276 seconds]
<oooPaul>
puts "evals to false" unless nil => "evals to false"
eywu has quit [Quit: Leaving.]
<oooPaul>
puts "evals to false" unless false => "evals to false"
<Gavilan>
puts false !=nil
<oooPaul>
puts "evals to false" unless nil == false => "evals to false"
<xubuntu5>
where do i find the ruby examples provided on ubuntu?
<Gavilan>
puts "false" unless false !=nil
emmanuelux has joined #ruby
eywu has joined #ruby
<xubuntu5>
and how can i make my version of ruby 1.9 i have installed 1.8 and 1.9 but it only runs 1.8.7 when i say ruby -v i see ruby 1.8.7
<shevy>
anyone of you having some experience with pdfs? I am thinking of whether to maintain ruby-fpdf or not
ianbrandt has quit [Quit: ianbrandt]
<shevy>
however, there already is prawn, sooo hmmmmmm
sepp2k has quit [Remote host closed the connection]
<shevy>
they are all there
tintin has left #ruby [#ruby]
[[johnonymous]] is now known as jimmyjam
DanBoy has quit [Remote host closed the connection]
jimmyjam is now known as jimmyjamz
<bricker88>
Here's a question: How can I get an inherited class to use its own constant when using an inherited method? Example: https://gist.github.com/2963023 I want that last command to show "//entry"
aantix has quit [Quit: aantix]
jimmyjamz is now known as [[johnonymous]]
<Gavilan>
bricker88: you should directly reimplement the metod show_xpath