rkj has quit [Read error: Connection reset by peer]
manishjain has quit [Quit: Leaving]
rails_flix has quit [Quit: This computer has gone to sleep]
agjacome has joined #ruby
Ilyas has joined #ruby
tyfighter has joined #ruby
agjacome_ has quit [Ping timeout: 245 seconds]
oo_ has quit [Ping timeout: 250 seconds]
agjacome_ has joined #ruby
mikepack has quit [Remote host closed the connection]
techsethi has joined #ruby
oo_ has joined #ruby
agjacome has quit [Ping timeout: 264 seconds]
sarkis has joined #ruby
heftig has quit [Ping timeout: 272 seconds]
charliesome has quit [Read error: Connection reset by peer]
Photism has quit [Quit: Leaving]
dbasch has quit [Read error: Connection reset by peer]
sarkis has quit [Ping timeout: 245 seconds]
charliesome has joined #ruby
dbasch has joined #ruby
lethjakman has quit [Ping timeout: 240 seconds]
duper has quit [Ping timeout: 256 seconds]
agjacome has joined #ruby
Photism has joined #ruby
agjacome_ has quit [Ping timeout: 260 seconds]
ridget has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sarkis has joined #ruby
duper has joined #ruby
lkba has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
CaptainJet has quit []
heftig has joined #ruby
oo_ has quit [Remote host closed the connection]
techsethi has quit [Quit: techsethi]
iamjarvo has joined #ruby
Bira has joined #ruby
oo_ has joined #ruby
ylluminarious has quit [Quit: Leaving...]
alem0lars has quit [Quit: Going AFK...]
Bira has quit [Ping timeout: 256 seconds]
Arkaniad has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
banjara has joined #ruby
diegoviola has joined #ruby
ji0n has joined #ruby
psmolen has joined #ruby
20WAAU4X7 has joined #ruby
zarul has joined #ruby
sepp2k has joined #ruby
jobewan has joined #ruby
20WAAU07R has joined #ruby
verto has joined #ruby
mr_rich101 has joined #ruby
Lulzon has joined #ruby
cuqa has joined #ruby
Lulzon has quit [Max SendQ exceeded]
zarul has quit [Max SendQ exceeded]
cuqa has quit [K-Lined]
mr_rich101 has quit [K-Lined]
zarul has joined #ruby
DrCode has joined #ruby
kmels has joined #ruby
chipotle_ has quit [Quit: cya]
dvb_ua has quit [Ping timeout: 250 seconds]
Takle has joined #ruby
Kricir has joined #ruby
jackneill has joined #ruby
Avahey_ has quit [Changing host]
Avahey_ has joined #ruby
goshdarnyou has quit [Changing host]
goshdarnyou has joined #ruby
alem0lars has joined #ruby
mostlybadfly has quit [Changing host]
mostlybadfly has joined #ruby
jds has joined #ruby
jds has quit [Changing host]
carraroj has joined #ruby
end_guy has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tjr9898_ has joined #ruby
Takle has quit [Ping timeout: 264 seconds]
tjr9898 has quit [Ping timeout: 260 seconds]
fgo has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
agjacome_ has joined #ruby
memph1s has joined #ruby
jack_rabbit has quit [Ping timeout: 250 seconds]
Poky has joined #ruby
carraroj has quit [Ping timeout: 240 seconds]
Kricir has quit [Remote host closed the connection]
agjacome has quit [Ping timeout: 255 seconds]
oo_ has joined #ruby
rylev has joined #ruby
pygospa has quit [Ping timeout: 240 seconds]
fgo has joined #ruby
oo__ has joined #ruby
linojon has quit [Quit: linojon]
oo_ has quit [Ping timeout: 240 seconds]
tyfighter has quit [Quit: tyfighter]
b00stfr3ak has quit [Ping timeout: 250 seconds]
neonpinkcrayon has joined #ruby
magic has quit [Quit: Resizing Pi]
<neonpinkcrayon>
Possibly a FAQ, but is there a kind of gem that allows me to implement a webserver, so I can handle posts, gets, etc?
mr-foobar has quit [Quit: Leaving...]
magic_ has joined #ruby
dbasch has quit [Quit: dbasch]
agjacome has joined #ruby
magic_ is now known as magic
agjacome_ has quit [Ping timeout: 245 seconds]
grump has joined #ruby
agjacome_ has joined #ruby
agjacome has quit [Ping timeout: 245 seconds]
relix has joined #ruby
agjacome has joined #ruby
Kricir has joined #ruby
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
agjacome_ has quit [Ping timeout: 256 seconds]
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
sarkis has quit [Quit: WeeChat 0.4.3]
kiri has quit [Remote host closed the connection]
lxsameer has joined #ruby
asmodlol has joined #ruby
codezomb has joined #ruby
andrewlio has joined #ruby
arq_ is now known as CorpusCallosum
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
oo__ has quit [Remote host closed the connection]
oo_ has joined #ruby
Daiyousei has joined #ruby
Kricir has quit [Remote host closed the connection]
dangerousdave has quit [Read error: No route to host]
Kricir has joined #ruby
dangerousdave has joined #ruby
wallerdev has quit [Ping timeout: 260 seconds]
Kricir has quit [Ping timeout: 255 seconds]
robbyoconnor has joined #ruby
keen__ has joined #ruby
keen_ has quit [Read error: Connection reset by peer]
mostlybadfly has quit [Quit: Connection closed for inactivity]
wallerdev has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
namxam has joined #ruby
Atttwww has quit [Ping timeout: 260 seconds]
goshdarnyou has quit [Quit: Connection closed for inactivity]
timonv_ has joined #ruby
caveat- has quit [Ping timeout: 272 seconds]
lxsameer has joined #ruby
oo_ has quit [Remote host closed the connection]
grump has quit [Remote host closed the connection]
banjara has quit [Quit: Leaving.]
atmosx has joined #ruby
bradleyprice has quit [Remote host closed the connection]
caveat- has joined #ruby
bradleyprice has joined #ruby
oo_ has joined #ruby
mike32 has joined #ruby
consti has joined #ruby
nobodyzzz has joined #ruby
FarLight has joined #ruby
amacou has quit [Remote host closed the connection]
grump has joined #ruby
amacou has joined #ruby
<FarLight>
serialized_values = ''
<FarLight>
array_to_serialize { |value| serialized_values += value }
tvw has quit []
bradleyprice has quit [Ping timeout: 240 seconds]
tvw has joined #ruby
<FarLight>
Is there anyway I can access a variable outside of the block scope?
<FarLight>
to achieve that serialization?
<FarLight>
Or is there a better way to achieve the same thing?
Photism_ has joined #ruby
jack_rabbit has joined #ruby
amacou has quit [Ping timeout: 255 seconds]
Photism has quit [Ping timeout: 264 seconds]
sixxy has joined #ruby
ddv has quit [Changing host]
ddv has joined #ruby
Photism_ has quit [Client Quit]
noop has joined #ruby
pygospa has joined #ruby
j416_ is now known as j416
oo_ has quit [Remote host closed the connection]
timonv_ has quit [Remote host closed the connection]
<FarLight>
Oh it already works
oo_ has joined #ruby
kirun has joined #ruby
namxam_ has joined #ruby
GriffinHeart has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
DaniG2k has joined #ruby
SCHAAP137 has joined #ruby
ramfjord has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rylev has quit [Remote host closed the connection]
DaniG2k_ has joined #ruby
namxam has quit [Ping timeout: 272 seconds]
lkba has quit [Ping timeout: 272 seconds]
GriffinHeart has quit [Ping timeout: 260 seconds]
DaniG2k has quit [Ping timeout: 250 seconds]
DaniG2k has joined #ruby
cgj has quit [Quit: moving]
roolo has joined #ruby
dseitz has joined #ruby
jeaye has joined #ruby
DaniG2k_ has quit [Ping timeout: 240 seconds]
<jeaye>
What is the 'self' param of a global function defined via rb_define_global_function supposed to be?
dangerousdave has quit [Read error: No route to host]
dangerousdave has joined #ruby
timonv_ has joined #ruby
asmodlol has quit [Ping timeout: 255 seconds]
mike32 has quit [Quit: Leaving]
craigbowen3 has quit [Ping timeout: 260 seconds]
arup_r has quit [Ping timeout: 272 seconds]
jeaye was kicked from #ruby by apeiros [if you cross post, at least tell every channel that you are cross posting. you're not banned. consider this a warning.]
tjr9898_ has quit [Remote host closed the connection]
mr-foobar has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
arup_r has joined #ruby
marr has joined #ruby
Bira has joined #ruby
Guest56459 has quit [Ping timeout: 250 seconds]
roodee has joined #ruby
roodee is now known as Guest24182
FarLight has quit [Quit: Leaving]
Bira has quit [Ping timeout: 240 seconds]
caveat- has quit [Ping timeout: 260 seconds]
Umang has joined #ruby
ninegrid has quit [Quit: leaving]
ninegrid has joined #ruby
ninegrid has quit [Client Quit]
sixxy has quit [Remote host closed the connection]
ninegrid has joined #ruby
amacou has joined #ruby
caveat- has joined #ruby
jack_rabbit has quit [Ping timeout: 260 seconds]
thumpba_ has joined #ruby
nonnatus has quit [Ping timeout: 240 seconds]
thumpba has quit [Read error: Connection reset by peer]
kmels has quit [Ping timeout: 240 seconds]
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
nateberkopec has joined #ruby
thumpba_ has quit [Read error: Connection reset by peer]
diegoviola has quit [Quit: WeeChat 0.4.3]
asmodlol has joined #ruby
amystephen has joined #ruby
caveat- has quit [Ping timeout: 250 seconds]
lsmola has joined #ruby
wallerdev has quit [Quit: wallerdev]
sepp2k has quit [Quit: Leaving.]
Martxel has joined #ruby
DaniG2k_ has joined #ruby
DaniG2k has quit [Read error: Connection reset by peer]
spider-mario has joined #ruby
jeaye has joined #ruby
rylev has joined #ruby
mike32 has joined #ruby
caveat- has joined #ruby
parduse has joined #ruby
fgo has quit [Remote host closed the connection]
techsethi has joined #ruby
Lewix has quit [Remote host closed the connection]
<shevy>
fly2web you know the name, go and google for torrents
<fly2web>
oh
<fly2web>
torrent download
<fly2web>
good
techsethi has quit [Quit: techsethi]
<shevy>
anyone has an idea how I can remember #assoc on Array
<fly2web>
shevy: it is too many page.
<fly2web>
i want just 300 page.
<shevy>
fly2web god man why are you trolling
<jeaye>
Only read the first 300.
<shevy>
fly2web read 300 pages, then stop
<shevy>
fly2web stop being such a baby
<fly2web>
:(
<fly2web>
thanks
<shevy>
the only real way to learn ruby is to write ruby code on your own anyway
tvw has quit []
<shevy>
class Cat
<shevy>
end
<fly2web>
i see :(
<shevy>
that is the basis of all
<shevy>
you transform the outside world into the ruby world
<arup_r>
I have a problem in understanding one OOP logic :-0(
<shevy>
which one
techsethi has joined #ruby
<arup_r>
I am reading a book, where author is saying "duplication increases the dependency" -- But I am not able to guess or think, how so.. Any help from you guys on this regard ?
<shevy>
you are saying "it is fun but useless" essentially
<shevy>
arup_r he always wants more :(
<shevy>
arup_r login and write one comment "It is good book." :)
<wasamasa>
no, I rather wanted to say that I couldn't understand what the heck the author tried to convey
<arup_r>
fly2web: Avdi Grimm bought the book...
chipotle has quit [Client Quit]
<shevy>
yeah same here wasamasa
<shevy>
but some people loved it
<arup_r>
shevy: which one.?
<wasamasa>
his other work about shoes was more understandable
<fly2web>
i just want see ruby in the web for freee
chipotle has joined #ruby
<shevy>
arup_r I meant in regards to when he wants a customer review haha
<shevy>
"It is perfect book."
caveat- has joined #ruby
<shevy>
there you go fly2web
<shevy>
actually, the pickaxe is better
<shevy>
but you only want tiny books
<shevy>
which you can then read on the toilet
MartinCleaver has quit [Ping timeout: 250 seconds]
kachi8 has joined #ruby
chipotle has quit [Client Quit]
<wasamasa>
hmm, I've read a 200 page one
GriffinHeart has quit [Ping timeout: 255 seconds]
<wasamasa>
can't remember its name though
<shevy>
haha
<shevy>
it was too small to remember
MartinCleaver has joined #ruby
<wasamasa>
exactly
chipotle has joined #ruby
<wasamasa>
the only thing I remember is that I might adapt that writing style if I shall ever release something longer than your average rant on a forum
<arup_r>
"which you can then read on the toilet" LOLzzzzzzzzzzz
pandaant has quit [Remote host closed the connection]
<shevy>
so it was that good wasamasa hmm
<shevy>
to make a creative rant
<fly2web>
letter is too small.
chipotle has quit [Client Quit]
<arup_r>
there are also ways when you don't have money to purchase a book. Learn that... :-) Don't ask me how.. If I do sin, I wouldn't teach you how to do *sin*.. :-)
namxam_ has quit [Remote host closed the connection]
<fly2web>
python have many data of learning, but i think that ruby have short data.
nopolitica has quit [Ping timeout: 240 seconds]
<Wolland>
fml
fgo has joined #ruby
chipotle has quit [Client Quit]
MartinCleaver has quit [Quit: MartinCleaver]
<wasamasa>
care to elaborate?
<Wolland>
unless you have some specific ruby questions, I think you should hit google and start learning it just you have done with other 12 languages that you know.
chipotle has joined #ruby
banisterfiend has quit [Ping timeout: 250 seconds]
<arup_r>
lol
consti has joined #ruby
<AntelopeSalad>
if i gem install with --deployment, is it safe to just copy that dir over to a different machine and have it all work as long as the OS/architecture is the same?
<AntelopeSalad>
i'm not sure how the compiled gems are handled in that sense
<AntelopeSalad>
*bundle install
chipotle has quit [Client Quit]
chipotle has joined #ruby
banister has quit [Ping timeout: 256 seconds]
spider-mario has quit [Read error: Connection reset by peer]
MartinCleaver has joined #ruby
chipotle has quit [Client Quit]
banister has joined #ruby
chipotle has joined #ruby
fgo has quit [Ping timeout: 256 seconds]
gattuso has quit [Read error: Connection reset by peer]
<centrx>
fly2web, Looks okay, a little old, but it looks like it covers all the important points
<fly2web>
a little old?
<fly2web>
then give me new.
<fly2web>
plz
<SergioAtHome>
hi guys... I have a question. Why debugger2 gem start from the beginning (rails) showing **every** line instead of run to defined breakpoint?
namxam has quit [Read error: Connection reset by peer]
<fly2web>
then why you say that i must stop studying ruby to me?
yfeldblum has quit [Ping timeout: 255 seconds]
Dreamer3 has joined #ruby
<shevy>
because you want to learn it for filthy reasons
dingus_khan has joined #ruby
CircleDot has joined #ruby
mehlah has joined #ruby
Bira has joined #ruby
<pontiki>
fly2web: you'd be best to stop talking to shevy about learning ruby and go learn ruby :)
<basiclaser>
hey guys you know anything about compatibility with bourbon? :(
namxam_ has quit [Ping timeout: 264 seconds]
jshultz has joined #ruby
<basiclaser>
I had to install an older version because the newer bourbon didnt work with my sass, and now the older version won't seem to accept neat, bourbon's grid system
<pontiki>
it really hurts when someone seems like they want to learn something, i get enthusiastic about new learners. they turn out to be trolls and i just want to say screw this place
dnhwgx has joined #ruby
<riddled>
I am a new learner
thumpba_ has joined #ruby
<pontiki>
really?
<pontiki>
i've just been burned
<riddled>
I am looking for advice
<elaptics>
riddled: ask away
<shevy>
hehehe
fgo_ has quit [Ping timeout: 255 seconds]
<shevy>
riddled, we just had to fight against a troll here, fly2web is his nick
<riddled>
best book to start with
<pontiki>
fuck me
<riddled>
i am no troll
<shevy>
ohhhh now you ask the same questions that fly2web asked
<shevy>
nonono that is too obvious
<riddled>
I want to learn
<shevy>
lol
<pontiki>
riddled: google
<shevy>
fly2web can't you get a job?
Petru has joined #ruby
<elaptics>
riddled: what's your current level of programming knowledge?
<riddled>
and I wanted to introduce myself to the room, maybe was a bad time to do that with the troll and all
<shevy>
you two sound 100% the same
<riddled>
no not the same
<shevy>
yeah precisely the same
<riddled>
i have volunteered to help with an open source site that uses ruby and rails to help learn too
<shevy>
riddled, go speak to fly2web
<riddled>
dont wanna talk to the troll
<fly2web>
you too, riddled
<shevy>
you mean you dont wanna talk to yourself there
<riddled>
I am no troll
<fly2web>
me too
<riddled>
i am an honest newbie who wants to learn
<shevy>
lol
<fly2web>
me too
<shevy>
that you use the word "honest"
<shevy>
is a dead give away
elikem has joined #ruby
<riddled>
for real
<shevy>
no newbie normally has to confirm his honesty
<Petru>
better call the ruby police
<riddled>
well most newbies dont start talking when people just dealt with a troll either
<shevy>
not true
<shevy>
people happily ask away questions here regardless of trolls
dawkirst has quit [Remote host closed the connection]
<apeiros>
pontiki: what a sad page :(
cantonic has quit [Read error: Connection reset by peer]
<fly2web>
this room is strange a little
noop has quit [Ping timeout: 250 seconds]
cantonic has joined #ruby
<fly2web>
python room member help always, but this room isn’t
Kricir has joined #ruby
mehlah has quit [Ping timeout: 240 seconds]
<shevy>
fly2web we are smarter and see through your trolling
<riddled>
ok nevermind
<apeiros>
riddled: ##new2ruby is dedicated to people new to ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<riddled>
thank you apeiros
<apeiros>
riddled: I didn't read your backlog, but if you've got a question about code, just ask
<riddled>
I dont understand objects and methods
SCHAAP137 has quit [Ping timeout: 250 seconds]
<riddled>
They dont have them in C
<apeiros>
you know what a struct is?
centrx has quit [Quit: Mead error: Connection reset by beer]
<riddled>
yes
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lw has joined #ruby
banister has joined #ruby
<apeiros>
an object is like a struct. it stores data at places with names. in rubys case, instance variables. additionally to structs, it also stores to which class it belongs.
<apeiros>
the class stores methods. when you call a method on an object, the method knows on which object it was called. that is, self is the object itself, and all its instance variables are accessible to it.
jmbrown412 has quit [Remote host closed the connection]
<apeiros>
there is a bit more to it. but this covers ~80% of the use-cases of objects and methods.
mgorbach has joined #ruby
jmbrown412 has joined #ruby
<apeiros>
in other words: an object is data + methods (through its class). and methods are functions which are aware on what object they've been called.
<riddled>
Thanks apeiros that is helping a lot
mehlah has joined #ruby
<fly2web>
what is comment in ruby?
mr_foobar_baz has joined #ruby
<apeiros>
fly2web: #
<fly2web>
thanks apeiros
<fly2web>
:)
<fly2web>
there exist kind ruby programmar.
jmbrown4_ has joined #ruby
Zebroid has joined #ruby
pskosinski has joined #ruby
<riddled>
what do you mean fly2web
<riddled>
a comment is a line of code that begins with a "#"
<fly2web>
you are good ruby programmar.
<fly2web>
multi line?
Slavox is now known as Slavox|AFK
oo_ has quit [Remote host closed the connection]
<riddled>
I think you can use C comment style too /*.....*/
<Petru>
nope
<Mon_Ouie>
No you can't
<Mon_Ouie>
Just have several lines that begin with #
jmbrown412 has quit [Ping timeout: 260 seconds]
<riddled>
oh my mistake
<apeiros>
there's =begin/=end, but nobody uses it
<elaptics>
unless you like ugly code :)
Fire-Dragon-DoL has joined #ruby
<shevy>
haha
<shevy>
you guys are funny
<riddled>
yeah i can see where =begin/=end would make for some ugly code
<shevy>
riddled you could use it!
oo_ has joined #ruby
<riddled>
use what
jmbrown4_ has quit [Ping timeout: 272 seconds]
mehlah has quit [Ping timeout: 245 seconds]
<shevy>
=begin
<shevy>
This is my
<shevy>
super long
<shevy>
comment
<shevy>
=end
skysploit has joined #ruby
<matrixdevuk>
that's you make a comment?!
<matrixdevuk>
I use #'s
<Mon_Ouie>
As mentioned, no one uses that syntax ever, but it is valid
<shevy>
oh I don't use =begin
<shevy>
apeiros is absolutely right, nobody uses it
<matrixdevuk>
That is the ugliest thing in the world
<shevy>
it's also kinda unnecessary
<shevy>
adding some # goes quickly
<shevy>
disable code can often happen via:
<shevy>
if false
* apeiros
ponders # for comment, #> for start comment and #< for end comment in his language
<Mon_Ouie>
Also the =begin and =end have to be at the very beginning of a line, you can't indent them
IceDragon has joined #ruby
<matrixdevuk>
o.e
<Petru>
yay, more languages :P
<fly2web>
"I am a Rubyist".index 'R' <— why nothing happened?
mehlah has joined #ruby
<Mon_Ouie>
>> "I am a Rubyist".index 'R'
<Mon_Ouie>
Oh
b00stfr3ak has quit [Ping timeout: 245 seconds]
<banister>
>> 'alut
<riddled>
well it is nice to know more than one way to do something
<apeiros>
Mon_Ouie: bot dead again?
Mon_Robot has joined #ruby
<Mon_Ouie>
Odd coincidence, he was just reconnecting
Kricir has quit [Remote host closed the connection]
yfeldblum has joined #ruby
<banister>
Mon_Ouie you're breaking all of sandi metz's rules! methods only 5 lines long!!
<banister>
Mon_Ouie you need to refactor the whole thing according to the hexagonal pattern, and ensure you delegate, delegate, delegate, and inject all your dependencies!
<foobarbaz_>
What's the best way to pass a function without invoking it in ruby?
<foobarbaz_>
I understand functions aren't first class citizens...
Kricir has quit [Ping timeout: 260 seconds]
Kricir has joined #ruby
<foobarbaz_>
decided to pass a symbol in, then call method(symbol).call
<foobarbaz_>
D:
namxam has quit [Remote host closed the connection]
mostlybadfly has quit [Quit: Connection closed for inactivity]
pandaant has joined #ruby
<wasamasa>
<fly2web> if i know rubymonk.com then i m skilled ruby programmar?
<wasamasa>
rofl
<wasamasa>
also, the answer is "No, now get out"
sepp2k has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
<fly2web>
:(
<wasamasa>
this just has to be an elaborate troll
<fly2web>
:(
<wasamasa>
inb4 how do I shot web
<fly2web>
i m very sorrowful
danijoo has joined #ruby
<wasamasa>
close your irc client and learn without any distractions
<wasamasa>
if you're actually learning that is
grump has quit [Remote host closed the connection]
razum2um has quit [Quit: Leaving.]
<fly2web>
but i want have question to ruby programmar.
IceDragon has quit [Ping timeout: 240 seconds]
IceDragon has joined #ruby
<Mon_Ouie>
foobarbaz_: proc { … } are first class citizens (and there's the block as well)
<foobarbaz_>
Yeah, really verbose though
<foobarbaz_>
symbol turned out really nice
<foobarbaz_>
Will post up later, so i can get feedback from anyone that's free to check it out :)
<Mon_Ouie>
Also passing a symbol :foo and passing { foo } aren't the same thing, because with a symbol, each object can decide to implement that method differently
Hanmac has left #ruby [#ruby]
tjr9898 has quit [Remote host closed the connection]
<Mon_Ouie>
While the behavior of the proc is determined by the context in which it was created
Kricir has quit [Ping timeout: 250 seconds]
<foobarbaz_>
:o
GriffinHeart has joined #ruby
<foobarbaz_>
The semantic differences shouldn't matter too much in this context, i think
fold has joined #ruby
<foobarbaz_>
it's just a basic class atm
seitensei has quit [Read error: Connection reset by peer]
<foobarbaz_>
thanks btw :)
helpa has quit [Read error: Connection reset by peer]
CorpusCallosum has quit [Ping timeout: 264 seconds]
seitensei has joined #ruby
mostlybadfly has joined #ruby
thumpba_ has joined #ruby
Bira has quit [Remote host closed the connection]
GriffinHeart has quit [Ping timeout: 255 seconds]
fgo has quit [Remote host closed the connection]
yfeldblum has joined #ruby
hectorrr has joined #ruby
<foobarbaz_>
is there a way to get ruby formatting of or blocks to be on two lines?
<foobarbaz_>
predicate1
<foobarbaz_>
|| predicate2
<foobarbaz_>
rather than the alternative of predicate1 || (new line) predicate2
<Mon_Ouie>
No, new-line are significant in Ruby. You could escape it if you're really intent on having them on the next line.
<sjouke>
i didn't know it was possible until just now
TheAtomicGoose has left #ruby ["WeeChat 0.4.3"]
<sjouke>
i'm a young programmer, i've always though private methods were there as a security feature
<sjouke>
what's the point of hiding methods if not for security reasons?
<benzrf>
ummmmmmmmm
<benzrf>
why would it be a security feature
<sjouke>
i just figured you could hide implementation details from an attacker or something, how the attacker already has access to calling methods on your project, i do not know
<benzrf>
dude
<Mon_Ouie>
It's not about "security" (it doesn't stop attackers from finding any flaws in your program), it's about communicating to the programmers who are using your code which methods they should use and which ones are implementation details
foobarbaz_ has quit [Ping timeout: 246 seconds]
<benzrf>
if an attacker has access
kmels has joined #ruby
<benzrf>
then they can do whatever the hell they want
<benzrf>
it doesnt matter if they can call private methods
<Hanmac>
in ruby you can do VERYthing!!
<sjouke>
Mon_Ouie: I like that explanation
<Hanmac>
EVERYTING
<sjouke>
i like VERYTHING better :)
enebo has quit [Quit: enebo]
oo_ has quit [Remote host closed the connection]
techsethi has quit [Quit: techsethi]
oo_ has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
bosworth has joined #ruby
mikepack has joined #ruby
Shidash has quit [Quit: Leaving.]
danijoo has joined #ruby
macclearich has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie>
You do realize it sets it to true in both cases, btw? :p
<shevy>
I am wondering where to put it... if I put it outside the class, I seem to have a conflict with another constant right now, which has the same name but is defined from another project
<shevy>
okies, thanks!
<shevy>
that was a slipup :P
einarj has joined #ruby
<basiclaser>
hey, are there any drawbacks to building websites with ruby?
<benzrf>
basiclaser: yes
<benzrf>
basiclaser: depending on what youre comparing it to
<shevy>
basiclaser you would be faster if you write it in C probably
<havenwood>
basiclaser: deployment is often pointed to as one of the pains, though these days there are more nice options
LadyRainicorn has quit [Read error: Connection reset by peer]
<shevy>
I mean, faster at execution time
LadyRainicorn has joined #ruby
LadyRainicorn has quit [Read error: Connection reset by peer]
<benzrf>
basiclaser: everything has drawbacks
<havenwood>
^
LadyRainicorn has joined #ruby
<benzrf>
your question is too unqualified to get much more specific
mercwithamouth has joined #ruby
hectorrr has quit [Read error: Connection timed out]
timonv_ has joined #ruby
jay__ has joined #ruby
einarj has quit [Ping timeout: 250 seconds]
jay__ is now known as rubyonrailed
JohnFord has joined #ruby
kirun has quit [Quit: Client exiting]
cobakobodob has joined #ruby
except has joined #ruby
baweaver has joined #ruby
timonv_ has quit [Ping timeout: 245 seconds]
poguez_ has quit [Quit: Connection closed for inactivity]
tylerkern has joined #ruby
charliesome has joined #ruby
Zebroid has quit [Remote host closed the connection]
<apeiros>
krainboltgreene: since I don't read herokus docs, I can't tell :)
Channel6 has joined #ruby
oo_ has joined #ruby
jonr22 has joined #ruby
<krainboltgreene>
I'm assuming since their example worked and it's the same as havenwood's with the new line...I'm assuming it's what they want.
<krainboltgreene>
Ho hum.
Pharaoh2 has quit [Remote host closed the connection]
tectonic has quit []
hsps_ has quit [Ping timeout: 245 seconds]
arya_ has quit [Ping timeout: 260 seconds]
oo_ has quit [Ping timeout: 255 seconds]
ramfjord has quit [Ping timeout: 245 seconds]
hectorrr has quit [Read error: Connection timed out]
theo has quit []
fgo has joined #ruby
rylev has joined #ruby
banisterfiend has quit [Quit: Computer has gone to sleep.]
b00stfr3ak has quit [Ping timeout: 240 seconds]
popo has joined #ruby
tectonic has joined #ruby
<popo>
hi, i want to install forem (https://github.com/radar/forem/), but the instlaation instructions are not clear enough for someone new to rails like me, any help?
<popo>
or is there a rails channel i should ask in?
<havenwood>
popo: the rails channel is #rubyonrails
<popo>
thanks
<havenwood>
popo: nick reg required
<popo>
ok
tjr9898 has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 256 seconds]
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fold has joined #ruby
rylev has quit [Remote host closed the connection]
banisterfiend has joined #ruby
phutchins has quit [Ping timeout: 264 seconds]
rylev has joined #ruby
sam113101 has joined #ruby
jimms has quit [Remote host closed the connection]
Gadgetoid has quit [Ping timeout: 250 seconds]
bosworth has quit [Ping timeout: 240 seconds]
Kricir has joined #ruby
wallerdev has joined #ruby
TrueJet has quit [Ping timeout: 260 seconds]
nateberkopec has joined #ruby
jonr22 has quit [Quit: leaving]
<mechanicalduck>
hi
<mechanicalduck>
So some ruby gems have to be compiled during gem install.
<mechanicalduck>
Can I do this compiling on a build server and deploy the compiled artifacts?
<mechanicalduck>
Or would this be too complicated?
rylev has quit [Remote host closed the connection]
jonr22 has joined #ruby
hectorrr_ has joined #ruby
rylev has joined #ruby
<AntelopeSalad>
mechanicalduck, i asked that same question earlier and never got a reply
riddled has quit [Quit: Leaving]
xiq has joined #ruby
andrewjanssen has joined #ruby
<AntelopeSalad>
i'm not sure if the necessary compiled files end up vendor/bundle
<AntelopeSalad>
*in
Gadgetoid has joined #ruby
chipotle has quit [Quit: cya]
oo_ has joined #ruby
jonr22 has quit [Client Quit]
CaptainJet has joined #ruby
lsmola has joined #ruby
jonr22 has joined #ruby
Kricir has quit [Ping timeout: 264 seconds]
tectonic has quit []
Pharaoh2 has joined #ruby
fwaokda has quit [Ping timeout: 272 seconds]
rylev has quit [Ping timeout: 240 seconds]
<apeiros>
mechanicalduck: it's possible. I've never done it, though
<Hanmac>
AntelopeSalad & mechanicalduck only if the build server and the client are 10000% identical in the software ... specially if the gem bould bind against an external lib
hashsmokermike has quit [Ping timeout: 246 seconds]
<apeiros>
Hanmac: well, you can cross-compile
chipotle has joined #ruby
<apeiros>
Hanmac: and there are even precompiled gems for different platforms. rare, though.
Lewix has quit [Remote host closed the connection]
<AntelopeSalad>
so everything that's necessary for it to work would end up in vendor/bundle if you bundle instal --deployment ?
arup_r has quit [Ping timeout: 264 seconds]
arup_r1 has joined #ruby
<Hanmac>
yes thats possible but then you might hit the spot that some libs have a different version .. or a different compiler and everything does not work ...
centrx has quit [Quit: Mead error: Connection reset by beer]
kotk_ has joined #ruby
oo_ has quit [Ping timeout: 250 seconds]
<AntelopeSalad>
how about for example
<AntelopeSalad>
if you were using the pg gem, would the build server need libpg-dev?
Photism has joined #ruby
kotk has quit [Ping timeout: 255 seconds]
Zebroid has joined #ruby
Pharaoh2 has quit [Ping timeout: 260 seconds]
jottr has quit [Ping timeout: 260 seconds]
lkba has joined #ruby
<shevy>
if you must compile it there, then yes
tjr9898 has joined #ruby
hjlsteffens has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dbasch has joined #ruby
lsmola has quit [Ping timeout: 250 seconds]
Zebroid has quit [Ping timeout: 272 seconds]
fwaokda has joined #ruby
cashnguns has quit [Ping timeout: 240 seconds]
Advocation has joined #ruby
dnhwgx has quit [Remote host closed the connection]
memph1s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kireevco has quit [Quit: Leaving.]
havenwood has quit [Remote host closed the connection]
phutchins has quit [Ping timeout: 240 seconds]
basiclaser has joined #ruby
tylersmith has joined #ruby
baroquebobcat_ has joined #ruby
skysploit has quit [Ping timeout: 272 seconds]
JStoker has quit [K-Lined]
_whitelogger has quit [K-Lined]
_whitelogger has joined #ruby
reprazent has joined #ruby
drPoggs has joined #ruby
leslie has joined #ruby
elektronaut has joined #ruby
canton7 has joined #ruby
Umang__ has joined #ruby
fly2web has joined #ruby
Umang has quit [Ping timeout: 256 seconds]
tylersmith has quit [Remote host closed the connection]
m8 has quit [Ping timeout: 245 seconds]
m8 has joined #ruby
lolmaus has joined #ruby
andrewjanssen has quit [Quit: Leaving...]
xiq has quit [Read error: Connection reset by peer]
<lolmaus>
I would like to create an utility that should display certain information in the console. Not simply appending lines, but rather drawing a table with data and updating individual values in that table. Is there a gem for that?
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
m8 has quit [Max SendQ exceeded]
Dreamer3 has joined #ruby
einarj has joined #ruby
<lolmaus>
Similar to how `top` Unix utility works.
m8 has joined #ruby
yfeldblum has joined #ruby
<tectonic>
you'll need to use VT100 or VT220 terminal emulation
<tectonic>
there's probably a gem that makes that easy
tenseiten has joined #ruby
dvb_ua has quit [Ping timeout: 240 seconds]
seitensei has quit [Ping timeout: 240 seconds]
<pipework>
lolmaus: You actually need to use ncurses.
m8 has quit [Max SendQ exceeded]
einarj has quit [Ping timeout: 245 seconds]
m8 has joined #ruby
phutchins has joined #ruby
Takle has joined #ruby
Umang__ has quit [Ping timeout: 264 seconds]
fwaokda has joined #ruby
kirillov has joined #ruby
<shevy>
damn it
<shevy>
he did it
<shevy>
he did suggest to use ncurses
tenseiten has quit [Remote host closed the connection]
<shevy>
did you forget about the documentation to ncurses pipework
<shevy>
I can't find a link to the ncurses API docu there hmm
xmad has quit [Ping timeout: 250 seconds]
<mozzarella>
speaking of ncurses
<lolmaus>
pipework: i don't need pseudographical interface. Just raw text that outputs data without any interaction with user. It's just that appending data doesn't suit me, i need to display the data in a `top` manner.
seitensei has joined #ruby
<mozzarella>
does anyone have a tutorial on using ncurses with ruby?
<Hanmac>
banisterfiend: you are still the pry developer ne? found this: http://rubygems.org/gems/pry-full but cant install it because "debugger" does not like my ruby version ;P
<mozzarella>
I can find tutorials for C, but…
<mozzarella>
the API is not exactly the same
<shevy>
mozzarella it is awful
<pipework>
lolmaus: You could make it with some pretty lame clearing of the screen and redrawing the whole page, but you still need to either have a defined size or dynamically get it from somewhere for the size of the terminal.
<mozzarella>
shevy: what is?
<pipework>
But you can't just redraw lines in a terminal arbitrarily. You can redraw the current line with readline, but a one-line table seems... pointless?
Martxel has joined #ruby
dscrd has joined #ruby
fgo has joined #ruby
Hobogrammer has joined #ruby
<mozzarella>
lolmaus: what does your app do?
<pipework>
mozzarella: Not much yet
<shevy>
mozzarella the ncurses docu
tyfighter has joined #ruby
<shevy>
Ncurses.endwin
<shevy>
Ncurses.noecho
<pontiki>
err, um, err
<shevy>
when Ncurses::KEY_UP
<shevy>
Ncurses::Form.form_driver()
<shevy>
look at that mozzarella
mehlah has joined #ruby
<shevy>
you may want to stab your eyes out after using ncurses
<pontiki>
top uses *curses
kirillov has quit [Quit: Leaving]
<apeiros>
lolmaus: if you don't want to use ncurses, you can use ansi escape sequences
<mozzarella>
shevy: why? is it that bad?
<apeiros>
you can do about everything necessary with it. hide the cursor & position the cursor would probably be the most important
<mozzarella>
apeiros: but it's not portable
<lolmaus>
mozzarella: i would like to create a ping utility that displays a line of statistical information and a list of pending pings. Once a ping is complete or timed out, it should disappear from the list.
<shevy>
do you find it beautiful mozzarella?
<apeiros>
mozzarella: I don't think ncurses is more portable
<apeiros>
actually probably even less.
<apeiros>
ansi escape sequences work on most terminals
cashnguns has quit [Ping timeout: 245 seconds]
<lolmaus>
The reason to do such a tool is that i'm using a wireless broadband connection that has unstable latency: from 20ms to 15s to downtime. When i use the normal ping tool and it outputs no data, i can't tell whether it's downtime or just a very long latency.
fgo has quit [Ping timeout: 255 seconds]
<pontiki>
you can always set a time limit on the ping command
claymore has quit [Quit: Leaving]
j_mcnally_ has joined #ruby
<mozzarella>
lolmaus: maybe you could have a client-server architecture, have the client talk to the server, print whatever the server sends, and you could run the client with "watch"
<lolmaus>
mozzarella: ain't that an unnecessary complication?
<mozzarella>
it is
<lolmaus>
Actually, the clear screen idea looks like an obvious answer that i was missing.
baroquebobcat_ has quit [Quit: baroquebobcat_]
phutchins has quit [Ping timeout: 245 seconds]
<fly2web>
there is no append method? just << and push?
<apeiros>
clear screen and redraw? depending on how you clear the screen, that'll give a nice history :)
havenwood has joined #ruby
<apeiros>
don't forget to trap SIGWINCH (change of window size)
<apeiros>
unless you use (n)curses. that does that for you I think
a46_ is now known as a46
iamjarvo has joined #ruby
mehlah has quit [Ping timeout: 260 seconds]
noop has quit [Ping timeout: 264 seconds]
Rahul_Roy has quit [Quit: Connection closed for inactivity]
thams has quit [Quit: thams]
noop has joined #ruby
St_Marx has joined #ruby
jimms_ has joined #ruby
doev has quit [Ping timeout: 264 seconds]
jimms has quit [Ping timeout: 245 seconds]
<toretore>
anyone else having problems connecting to https://github.com ?
thams has joined #ruby
mr-foobar has quit [Quit: Leaving...]
gondalier has joined #ruby
<mozzarella>
the obvious problem with the clear screen solution is the scrolling…
andrewjanssen has joined #ruby
andrewjanssen has quit [Client Quit]
andrewjanssen has joined #ruby
tjr9898 has joined #ruby
tjr9898 has quit [Remote host closed the connection]
melik_ has quit [Quit: Computer has gone to sleep.]
havenwood has joined #ruby
melik_ has joined #ruby
nectarys has joined #ruby
Zebroid has quit [Ping timeout: 260 seconds]
chrishough has quit [Quit: chrishough]
melik_ has quit [Ping timeout: 255 seconds]
a46 has left #ruby [#ruby]
<lolmaus>
I'm kinda used to the asynchronous coding style of JS. But when i try thinking in Ruby, i can only come up with synchronous code. I tried googling this but all results involve either threads or starting a server with an IP and port. Am i missing something obvious?
<pipework>
lolmaus: Probably how nodejs implements their asynchronous architecture.
<lolmaus>
pipework: wut?
<lolmaus>
I'm asking about Ruby, not Node.
<havenwood>
lolmaus: forking, threading, evented, actor model, you name it
<pipework>
lolmaus: I'm telling you that if you don't know why you're writing synchronous code in ruby, you probably don't understand node's async architecture.
<lolmaus>
What i'm asking about is whether i can do something like `$(document).ready( callback );` in Ruby without having the trouble of learning threads or starting servers.
<havenwood>
lolmaus: EventMachine is still pretty popular for the evented model, but Celluloid has nice options using nio4r.
andrewlio has quit [Remote host closed the connection]
<pipework>
lolmaus: You can pass around callbacks in ruby just fine, but that doesn't make it async.
tylersmith has joined #ruby
<lolmaus>
pipework: so what's the simplest way of going async with Ruby, without multithreading or starting servers?
<lolmaus>
Reading about `concurrent-ruby` now.
<pipework>
lolmaus: Probably using eventmachine.
<pipework>
I don't know a lot about concurrent-ruby
Bumptious has joined #ruby
<pipework>
lolmaus: Personally, I prefer jruby and using the JVM.
<lolmaus>
pipework: event machine requires me to start a server with an IP and port.
<havenwood>
lolmaus: Celluloid and Celluloid::IO are quite nice.
noop has quit [Ping timeout: 240 seconds]
OffTheRails has joined #ruby
Advocation has quit [Quit: Advocation]
chrishough has joined #ruby
<pipework>
lolmaus: Mmm, if you require to not start a server, even if you bind to localhost only, then I'd say celluloid like havenwood suggested. But again, I haven't used concurrent-ruby, and I prefer jruby.
<apeiros>
23:26 pipework: lolmaus: You can pass around callbacks in ruby just fine, but that doesn't make it async.
<apeiros>
that's how JS does it, though. lolmaus is correct. JS in browsers is single threaded.
<apeiros>
you don't need concurrency for async
<apeiros>
/2c
<pipework>
apeiros: I know how browsers typically are single-threaded, but he was asking about async and then talking about callbacks.
<pipework>
You don't need any library for callbacks in ruby.
tylersmith has quit [Ping timeout: 255 seconds]
<lolmaus>
So what's the simplest way to code in this `$(document).ready( callback );` async manner with Ruby?
ra4king has quit [Remote host closed the connection]
<apeiros>
correct. neither for async. but the core libs don't provide a convenient async interface.
<lolmaus>
pipework: apeiros: but wouldn't this pause execution of the script until the proc is complete? E. g. in `my_object.work { sleep 10; puts 'bar' }; puts 'foo'` i want 'foo' to be printed before 'bar'.
asmodlol has quit [Quit: Leaving]
<apeiros>
lolmaus: no
<apeiros>
lolmaus: I said "store it", not "run it right away"
Ilyas has quit [Quit: Leaving]
<pipework>
lolmaus: Only when it's called/ran
jshultz has quit [Quit: Connection closed for inactivity]
<fly2web>
array = [1, 2, 3, 4, 5]
<fly2web>
for i in array
<apeiros>
you can choose to execute a block at whatever time you want
<fly2web>
puts i
<fly2web>
end
<fly2web>
== puts array
<pipework>
fly2web: no.
St_Marx has quit [Remote host closed the connection]
<fly2web>
no?
<havenwood>
fly2web: that's a negative, alpha niner
<apeiros>
fly2web: use gist.github.com for > 3 lines of code
<pipework>
Don't paste to the channel. Go read Array's documentation.
<havenwood>
fly2web: #puts already iterates and prints each line
<havenwood>
fly2web: puts [1, 2, 3]
<havenwood>
fly2web: try it
<havenwood>
fly2web: never use `for`, iterate
<Mon_Ouie>
I think he was asking if the two were the same
<havenwood>
oh
<havenwood>
oops
<fly2web>
Mon_Ouie: yes
<fly2web>
two is same?
postmodern has joined #ruby
GriffinHeart has quit [Ping timeout: 260 seconds]
<Mon_Ouie>
Yes, that's how puts handles arrays
<lolmaus>
apeiros: pipework: i don't understand how to write the `work` method so that it branches off asynchrounously. In JS, it's intuitive for me, but with Ruby i seem to be missing something.
tyfighter has quit [Quit: tyfighter]
<pipework>
lolmaus: It's not async, it's handling a callback.
<pipework>
There's a very large difference.
<havenwood>
lolmaus: what are you actually trying to do.
Pumukel has quit [Quit: ChatZilla 0.9.90.1 [Firefox 31.0/20140716183446]]
<apeiros>
pipework: def work(&stuff); @work = stuff; end
gondalier has quit [Client Quit]
<apeiros>
do @work.call whenever work should be done
<pipework>
apeiros: Thanks, I had absolutely no clue how to do that.
<apeiros>
in js too, when the callback is executed, it will block the rest of the script (at least in the browser, but as far as I understood it, it's the same in node too)
<lolmaus>
havenwood: i have a `work` method that takes a long time to finish and accepts a callback that is expecuted once the method is complete. I want to run this method multiple times so that instances of that method work in parrallel (asynchonously? concurrently? i'm not familiar with terminology) and without blocking main script execution.
<apeiros>
fly2web: yes, they'll generate the same output
<fly2web>
thanks apeiros
<fly2web>
i will give up ruby. there is no proper free book
<pipework>
lolmaus: Then you need concurrency and callbacks.
<shevy>
fly2web GOOD
<havenwood>
fly2web: there are many proper free books ;)
<pipework>
lolmaus: But a lot of us just use more than one process to do work that should be backgrounded.
<fly2web>
havenwood: introduce good one
<Wolland>
fly is back eh
xiq has quit [Read error: Connection reset by peer]
<shevy>
sadly yes
<shevy>
he will never abandon us now
<miah>
dude, thepiratebay.se, its not hard
<havenwood>
fly2web: If you're not familiar with programming, Learn to Program by Chris Pine.
<miah>
just download all the books if you find it too difficult
<lolmaus>
pipework: so is there a way to do it in Ruby as simple as it's done with JS, i. e. without involving complicated libraries like Celluloid or EventMachine? They look like it will take me weeks to learn them.
<shevy>
he will find it too difficult
<Wolland>
or pay for a "proper" book like a normal person
<miah>
right
<shevy>
you will trigger this reply
<miah>
i mean, thats clearly the best option
<shevy>
"I am poor"
<pipework>
lolmaus: In ruby? Not particularly.
<fly2web>
havenwood: i m good at programming. i know c, c++, java and python , and perl.
<pipework>
I mean, you could use Thread, but there's the GVL.
<miah>
but if you are too poor, torrent all the things
<Wolland>
i wonder how all these people learned ruby without "proper" resources
xiq has joined #ruby
<shevy>
not this again ... we have been through this before fly2web ...
<miah>
lets all just /ignore
<apeiros>
lolmaus: Thread.new do …do your work… end
<apeiros>
does not block the rest of the script
<lolmaus>
pipework: using threads would require me to take care of synchronizing them, which is a difficult thing to do.
<miah>
i am juggling ruby projects
fgo has quit [Ping timeout: 240 seconds]
<miah>
trying to clean up some internals codes
<pipework>
lolmaus: Egh, not particularly.
<Wolland>
fly2web: do you have a trolling schedule of some sort? Like Ruby at 2-3pm, 3:30-4pm C++, etc
<lolmaus>
pipework: race condition or something.
<apeiros>
lolmaus: as far as I can see, node does not have threads
maximski has joined #ruby
<apeiros>
lolmaus: a node process blocks once you do stuff. whether asynchronously or not
<pipework>
apeiros: but he has some large units of work to complete.
<fly2web>
no Wolland i m good person
maximski has quit [Max SendQ exceeded]
<pipework>
He wants to process that unit of work multiple times concurrently.
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<fly2web>
i just find good one, but now i study it in the rubymonk site
<apeiros>
lolmaus: node does not magically make synchronization issues go away
<Wolland>
good people don't schedule I guess
maximski has joined #ruby
<apeiros>
you either have no threads and don't need to sync, or you have threads and need to sync
<miah>
node doesn't have threads natively
<pipework>
That's the third person to mention that.
<shevy>
node doesn't have threads natively
<apeiros>
(of course, unless you don't have state to actually synchronize, that is)
<miah>
well, some people said they "dont think"
<pipework>
That's the third person and a shevy to say that.
<lolmaus>
apeiros: i don't need threads. I don't need the instances of my method to run on different CPU cores. I just want to pass a proc to a method and say: here, take this callback and run it when you're ready, but now please go away and don't block my script.
<pipework>
apeiros: Nobruv, I was in the 'no threads' group.
<pipework>
lolmaus: Do you know how "Don't block my script" is implemented?
<miah>
"This is in contrast to today's more common concurrency model where OS threads are employed. Thread-based networking is relatively inefficient and very difficult to use."
<havenwood>
who is arguing node has threads?
<havenwood>
hehe
<pipework>
havenwood: No one at all.
<apeiros>
lolmaus: that's done the way I showed you
<havenwood>
oh node..
<pipework>
miah: I'm very skeptical of the drivel they put on their website.
<apeiros>
lolmaus: by storing it and calling it whenever
<pipework>
It used to be really funny.
<miah>
as we all should be, but they are basically saying they dont think threads are a good idea
<apeiros>
lolmaus: but it seems to me you're changing your requirement…
<pipework>
lolmaus: Look, you have a large unit of work and a callback. If you have that unit of work run, it will block your main program. Javascript and Ruby behave the same way.
<fly2web>
do i must but this book?
<apeiros>
lolmaus: if it's reasonably simple, that's a good approach
<miah>
rather than arguing what is known or unknown. i find it generally better to review the material at hand to ensure i do understand things the way i think i do
<pipework>
lolmaus: well, good luck
<pipework>
have fun
riotjones has joined #ruby
<apeiros>
lolmaus: but you're omitting that the browser provides a run-loop for the javascript engine. you have to do that yourself in ruby (because you're not in a browser, you're in a green field)
<pipework>
apeiros: I'm pretty sure that the bikeshed is brown.
<apeiros>
pipework: that only matters if it comes with a razor
<pipework>
apeiros: But is the razor a safety razor?
<apeiros>
lolmaus: you replaced magical get with magical setTimeout
tectonic has joined #ruby
<lolmaus>
apeiros: setTimeout is built-in JS feature.
<apeiros>
lolmaus: yes. which is enabled by the run-loop around your code. already written about that.
<lolmaus>
apeiros: it is THE way to branch off a callback so that it runs concurrently, non-blockingly
xiq has quit [Remote host closed the connection]
tylersmith has quit [Ping timeout: 240 seconds]
spastorino has joined #ruby
<apeiros>
lolmaus: you do realize that your timeout code is only ever run after all the code in your script tags in the head, right?
dbasch has quit [Quit: dbasch]
zipace has quit [Ping timeout: 256 seconds]
<apeiros>
i.e. if you have an infinite loop there, it doesn't matter what value you set for the timeout. it'll wait.
<lolmaus>
apeiros: yes, why?
drakciR has quit [Read error: Connection reset by peer]
xmad has quit [Ping timeout: 245 seconds]
tectonic has quit [Client Quit]
<apeiros>
lolmaus: see run-loop
<apeiros>
lolmaus: either you reimplement it. or you use threads.
<apeiros>
the difference with threads will be that you have to ensure that all threads are run before your program terminates.
mikepack has quit [Remote host closed the connection]
<apeiros>
the other difference is that it can be run concurrently
vsoftoiletpaper has joined #ruby
<apeiros>
(if you don't want that, you're back at: reimplement the browsers run-loop)
<apeiros>
which isn't hard, btw.
mikepack has joined #ruby
<apeiros>
it'd probably be some ~20 LoC
tectonic has joined #ruby
mgberlin has quit [Remote host closed the connection]
zerosNones has quit [Ping timeout: 250 seconds]
mgberlin has joined #ruby
tectonic has quit [Client Quit]
<dmarr>
whats status of ruby sass lately. any speedup plans
linojon has quit [Quit: linojon]
namxam has joined #ruby
lxsameer has joined #ruby
melik_ has quit [Quit: Computer has gone to sleep.]
<lolmaus>
apeiros: tried to google `run-loop` and `ruby "run-loop"`, didn't find anything that i can understand. :(
j_mcnally_ has quit [Ping timeout: 255 seconds]
thams has quit [Quit: thams]
<pipework>
lolmaus: Do you know what an infinite loop is?
gr33n7007h has joined #ruby
<lolmaus>
pipework: sure.
melik_ has joined #ruby
tylersmith has joined #ruby
<pipework>
Do you know that you can run things in a loop?
<pipework>
That's a run loop.
<pipework>
Often they have 'tickers' that get called every n of some measure of time.
<pipework>
Or ticks.
<apeiros>
it's the outermost loop around your program
<pipework>
apeiros: Not necessarily.
<apeiros>
it handles inputs, outputs
<lolmaus>
pipework: it's synchronous. Just using `loop { ... }` will not magically branch iterations like JS setTimeout does.
<pipework>
It's often the outermost loop though.
<apeiros>
pipework: show me a run-loop which is not the outermost and I show you a loop which is not a run-loop :-p
<pipework>
apeiros: Any program which uses multiple run-loops.
<apeiros>
pipework: yes. but in sequence.
lxsameer has quit [Client Quit]
<apeiros>
if nested, the outermost is your run-loop
<apeiros>
the inner is just a loop
<pipework>
lolmaus: In ruby, set timeout might use a thread to start the timeout, thus letting main execution continue until the timeout ends, which then calls whatever it must.
jmbrown412 has joined #ruby
Pharaoh2 has joined #ruby
<lolmaus>
In JS, it is common to use setTimeout with zero as time argument, so that it just branches off your callback without waiting
fgo has joined #ruby
melik_ has quit [Ping timeout: 255 seconds]
namxam has quit [Remote host closed the connection]
<pipework>
lolmaus: I'm pretty sure your function still gets called within the main thread.
<lolmaus>
pipework: so?
<pipework>
lolmaus: Then what's the point of mentioning it?
<apeiros>
lolmaus: yeah, poor man's "do this after my code"
DrCode has quit [Ping timeout: 264 seconds]
<apeiros>
utterly pointless
<apeiros>
and in most cases it is simply misapplied
<apeiros>
havenwood: f = Future do sleep(5) end; sleep 5; f.call # will take 10s
<pipework>
But ruby 2.1.x is CoW, right?
<benzrf>
apeiros: the work doesnt start until you call, though
<havenwood>
apeiros: ah, yup
<apeiros>
havenwood: which is defeating the purpose of future. it should take 5s in total, not 10. as it starts to work immediately and only blocks when you want the value.
<apeiros>
havenwood: hence: split up starting the thread and getting the value from it. you'll end up with my code ;-)
<havenwood>
apeiros: ifuture is my futures over processes thingy
<apeiros>
lolwhat?
<apeiros>
should be Object…
<havenwood>
IPC
<Mon_Ouie>
No, that's how it's implemented
<Mon_Ouie>
Nearly all methods are in Kernel
<Mon_Ouie>
(all methods that are documented as being in Object, that is)
<apeiros>
havenwood: take a look at the fork gem
<havenwood>
looking now
<apeiros>
Fork.future do sleep 5; 43 end
<lolmaus>
pipework: i don't care if it's truly concurrent, multi-threaded or whatever. I know it's singe-threaded. Practically, it results in parallel execution and i don't care that it runs sequentially under the hood. When i launch multiple GET requests with callbacks, i know that each of them will fire a callback when it's ready, no sooner no later. It is not multithreading but it is a powerful instrument to organize my code.
<apeiros>
works via processes to (via forking, as said)
timonv_ has joined #ruby
jonr22 has quit [Quit: Lost terminal]
<pipework>
lolmaus: It's not parallel though.
<pipework>
It's just deffered evaluation.
<Mon_Ouie>
If it runs sequeentially under the hood it doesn't result in parallel execution, the two are mutually exclusive
<pipework>
That's all, and that's trivial in ruby.
<apeiros>
lolmaus: found your link. btw., you can leave the ; away in JS in almost all cases.
subtwo has joined #ruby
subtwo has quit [Quit: Computer has gone to sleep.]
<pipework>
apeiros: Good JS developers don't.
<robscormack>
yaye, I learned I'm a good JS developer
<apeiros>
pipework: you and I have varying definitions for "good JS developer" then
<lolmaus>
apeiros: you should never leave the semicolon because JS is a shitty language and will mess your code one day.
<lolmaus>
apeiros: my link was in CoffeeScript. I started rewriting it to JS but didn't finish.
<apeiros>
the second seems to be JS
<lolmaus>
apeiros: JSBin overwritten my initial example with unfinished one. :(
qw3rtman has quit [Quit: Computer has gone to sleep.]
thams has joined #ruby
Kricir has joined #ruby
linojon has joined #ruby
andrewjanssen has quit [Quit: Leaving...]
<mozzarella>
why isn't "puts" atomic?
<lolmaus>
apeiros: this "deferred evaluation" feature of JS, as pipework has called it (dunno if that's the official term for how `setTimeout` and Ajax do pseudo-concurrency in JS), it has become an essential feature for me. Once i got used to it, i can't imagine coding stuff without it. And the fact that this functionality is lacking in Ruby stdlib kinda causes raised eyebrows.
<havenwood>
apeiros: nice, i like that
<mozzarella>
if I puts two things in two different threads they can end up on the same line
<apeiros>
lolmaus: really, you should learn how that stuff works. it is trivial.
<mozzarella>
isn't deferred evaluation basically what blocks do?
<robscormack>
mozzarella: no.
<apeiros>
mozzarella: can be used for that
<mozzarella>
or is that lazy evalution?
Panicky has quit [Remote host closed the connection]
<apeiros>
mozzarella: but setTimeout also includes scheduling
Zebroid has joined #ruby
Panicky has joined #ruby
<apeiros>
mozzarella: it's not atomic because they chose not to make it atomic. which is good.
<apeiros>
an IO might be slow, blocking all your threads.
lkb has quit [Quit: Wychodzi]
tjr9898 has quit [Read error: Connection reset by peer]
<apeiros>
havenwood: thanks :)
Kricir has quit [Ping timeout: 245 seconds]
tjr9898 has joined #ruby
St_Marx has quit [Quit: Ex-Chat]
Zebroid_ has joined #ruby
<lolmaus>
apeiros: looking at your code, i've understood that my example was a bad one. Thinking of a better one.
dangerou_ has quit [Ping timeout: 260 seconds]
* apeiros
senses reimplementation of browsers IO handling upcoming
baweaver has quit [Ping timeout: 255 seconds]
motto has joined #ruby
robscormack has quit [Quit: Leaving]
Zebroid has quit [Ping timeout: 240 seconds]
parduse has quit [Killed (hobana.freenode.net (Nickname regained by services))]
Maitiu has quit [Ping timeout: 240 seconds]
Wayneoween has quit [Ping timeout: 240 seconds]
parduse has joined #ruby
Maitiu has joined #ruby
lw has quit [Ping timeout: 240 seconds]
Kruppe has quit [Ping timeout: 240 seconds]
certainty has quit [Ping timeout: 240 seconds]
parduse is now known as Guest70805
<Jamo>
hey, Im looking for easy string templating solution - i think ruby has it built in but I cant remember how to do it. Not just "%s" % ["foo"] but something where I could define the order of these bu names et smthing
armyriad has joined #ruby
vlad_starkov has quit [Ping timeout: 240 seconds]
mhenrixon has quit [Ping timeout: 240 seconds]
GeekOnCoffee has quit [Ping timeout: 240 seconds]
<Jamo>
like I have a "param2: %param2% and param1: %param1%" % {param1: "foo", param2: "bar"}
qw3rtman has joined #ruby
<Jamo>
that doesnt work but as an example what I would like to do
m8 has quit [Ping timeout: 240 seconds]
<havenwood>
mozzarella: you mean why isn't the newline synchronized?
<machty>
question about the GIL in MRI and thread stuff in general: does the presence of the GIL prevent ruby threads from executing on different cores? or just that the mutexes around the interpreter would thwart actual parallelism?
OffTheRails has quit [Ping timeout: 255 seconds]
<toretore>
lolmaus: what you're looking for is an event loop. eventmachine is an event loop implementation for ruby
<apeiros>
lolmaus: you may want to read and understand the Runner class. that's almost precisely what your browser does.
<apeiros>
toretore: he doesn't want concurrency
<toretore>
what does he want then?
neruda has joined #ruby
<apeiros>
toretore: that said - what they want seems to change from time to time
St_Marx has joined #ruby
<apeiros>
toretore: just ordered/deferred execution
<apeiros>
again, show me JS code you think runs concurrently.
<machty>
havenwood: cool i'll give that a ready
<havenwood>
machty: part 2 explains in some detail
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<machty>
havenwood: i guess i'm asking: does the OS actually prevent the ruby interpreter code from multiple cores, or is it just that the interpreter, which might be running on multiple cores, is prevented from being truly parallel due to a mutex b/w cores ?
<machty>
i think the answer is the latter
<toretore>
apeiros: ok, here's some using jquery: $.each([1,2,3,4,5], function(){ $.ajax('www.example.com').then(function(res){ console.log(res); }) })
kaspergrubbe_ has quit [Read error: Connection reset by peer]
kaspergr_ has joined #ruby
tjr9898 has quit [Remote host closed the connection]
<toretore>
that's not real code, but it would be
<toretore>
could*
<apeiros>
toretore: and now tell me which part runs concurrent to what other part
<toretore>
the requests
<havenwood>
machty: The answer is a bit tricky because not all threads need to hold the GVL to run.
<toretore>
$.ajax() will return immediately, allowing the next request to start
<apeiros>
I can tell you what will run concurrently there - the browser performing the request. the javascript code itself - none of it.
<toretore>
haha
tjr9898_ has joined #ruby
<toretore>
this is a waste of time
<havenwood>
machty: Concurrency is always available, parallelism isn't when both threads happen to need to acquire the GVL at the same time.
<apeiros>
toretore: the `function(res){ console.log(res); }` will only run after *all* of your code in that script has run
<apeiros>
no concurrency
centrx has joined #ruby
<havenwood>
machty: The timer thread allows concurrency in any case.
<apeiros>
i.e. only parts outside of jS are concurrent. and even then it depends on the browser. e.g. some browsers even stop taking user input while JS runs.
<havenwood>
Two concurrency discussions at once. :P
<machty>
havenwood: lol
<machty>
havenwood: right, but it's totally possible/likely that two threads, each on a separate core, are trying to run interpreter code, only that one will be blocked by a mutex
<toretore>
oh, but the browser code isn't concurrent either, only the cpu can issue interrupts
<machty>
havenwood: in other words, mutexes can be use cross-core
<machty>
havenwood: sorry for all the noise, i think something just clicked for me, but i think i shall read that article first to verify
<apeiros>
toretore: you're confusing deferred code and concurrent code. really, look up the difference. JS has no concurrency.
<toretore>
and this so-called "concurrency" that the kernel implements is just a loop
<apeiros>
I wish terminology courses were mandatory for programmers…
<apeiros>
along with courses about encodings, how date/time works, and what representation is.
<havenwood>
machty: article explains in good detail
<machty>
havenwood: thanks, reading
robscormack has joined #ruby
<lolmaus>
Thank you, apeiros. I appreciate your patience and effort.
<toretore>
it's not concurrent, those calls are all happening serially and EM just defers them until some condition becomes true
<toretore>
it is *exactly* the same
SCHAAP137 has quit [Read error: Connection reset by peer]
tjr9898_ has quit [Remote host closed the connection]
<apeiros>
toretore: no. and that you don't understand the difference is precisely the same problem as you not understanding the difference between deferred and concurrent code.
<toretore>
the truth is, concurrency is not something that can be defined precisely
tjr9898 has joined #ruby
CaptainJet has joined #ruby
<apeiros>
but it's almost 0200 and I'm tired of trying to give CS lessons to people who don't even try.
<havenwood>
toretore: serially would be one completing before the next is run
fgo has joined #ruby
<lolmaus>
toretore: eventmachine requires starting some server with an ip address and a port. To me it looks like either an overkill or an inappropriate instrument for the task.
<toretore>
lolmaus: anything inside EM.run{ ... } behaves like js would in a browser
<apeiros>
toretore: btw., depending on your browser, even the non-JS part of performing the request is done sequentially.
<robscormack>
still on deferred v/s concurrent?
<havenwood>
truth or interleavings, pick one. ;P
<toretore>
god are you still on about this
<apeiros>
no, I'm done.
Guest70805 has quit []
matrixdevuk is now known as momma
parduse has joined #ruby
<mozzarella>
I think you guys are thinking of "parallel" ( ͡° ͜ʖ ͡°)
parduse is now known as Guest29593
<robscormack>
I'm thinking women right now but nice try
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<toretore>
all concurrency is done sequentially. the part that makes it concurrent is the interleaving of different "threads" of code
x1337807x has joined #ruby
Guest_ has joined #ruby
<toretore>
(not including parallelism here for the sake of argument)
<machty>
concurrency is about code structure, parallelism is about execution. programming in a concurrent style/model enables but doesn't guarantee parallelism.
<machty>
(thanks for that, machty)
* havenwood
flees
fgo has quit [Ping timeout: 250 seconds]
Guest29593 has quit [Client Quit]
<apeiros>
toretore: the deciding part is whether you have a say in what is interleaved
<apeiros>
if you have a say in it, it's just deferring code. if you don't, it's concurrent.
parduse has joined #ruby
parduse is now known as Guest41672
<toretore>
you're just describing preemted threads
<toretore>
preempted*
<apeiros>
really, just read the Runner class in the gist. it's *precisely* what the browser does. and that's *not* concurrent.
Guest41672 has quit [Client Quit]
<toretore>
so anything that's not a preempted thread is not concurrent?
<robscormack>
where's the gist, again?
<apeiros>
toretore: no. you can't yield mid-term in JS. you can't directly access the scheduler.
<apeiros>
the first one will run forever, prohibiting the scheduler from ever scheduling the second timeout
<czaks>
apeiros: em is mostly single threaded
<czaks>
so with EM you will have the same effect
<apeiros>
czaks: oh…
<apeiros>
ah right, EM is a reactor
j_mcnally has quit [Remote host closed the connection]
<benzrf>
its a nuclear reactor !
<czaks>
unless you use em::synchrony and use em::s.sleep in the loop
<apeiros>
toretore: ok. remove all things I said with regards to EM.
<czaks>
you may want to look at celluloid, which is a different design, but allows you to do the sort of code you described
<apeiros>
so when you asked for a concurrent example and I repasted your "EM.run{ 5.times{ puts http_get('www.example.com') } }", make that "5.times do Thread.new do puts http_get('www.example.com') end; end"