spastorino has quit [Quit: Connection closed for inactivity]
yfeldblum has joined #ruby-lang
yugui_zzz is now known as yugui
diegoviola has quit [Quit: WeeChat 1.0]
omosoj has quit [Quit: Leaving]
abhishekkr has quit [Read error: Connection reset by peer]
yugui is now known as yugui_zzz
yfeldblu_ has joined #ruby-lang
yugui_zzz is now known as yugui
karamazov has quit [Remote host closed the connection]
Xney2 has joined #ruby-lang
karamazov has joined #ruby-lang
diegoviola has joined #ruby-lang
nisstyre has quit [Quit: WeeChat 1.0]
jhass is now known as jhass|off
nisstyre has joined #ruby-lang
nisstyre has joined #ruby-lang
nisstyre has quit [Changing host]
yfeldblum has quit [Ping timeout: 260 seconds]
Xney has quit [Ping timeout: 272 seconds]
yfeldblu_ has quit [Ping timeout: 260 seconds]
karamazov has quit [Ping timeout: 245 seconds]
SuMo_D has joined #ruby-lang
TheToad has quit [Read error: Connection reset by peer]
Phrogz_ has joined #ruby-lang
rizwanreza has joined #ruby-lang
mistym has joined #ruby-lang
yatish27_ has joined #ruby-lang
Phrogz_ has quit [Ping timeout: 245 seconds]
yatish27 has quit [Ping timeout: 272 seconds]
spastorino has joined #ruby-lang
bsvineeth has joined #ruby-lang
emmesswhy has joined #ruby-lang
yugui is now known as yugui_zzz
tstrokes has joined #ruby-lang
rizwanreza has quit [Remote host closed the connection]
bsvineeth has quit [Remote host closed the connection]
TheToad has joined #ruby-lang
yatish27 has joined #ruby-lang
bsvineeth has joined #ruby-lang
yatish27_ has quit [Ping timeout: 260 seconds]
shubhamgoyal has joined #ruby-lang
<shubhamgoyal>
Guys, what is the best way to template a div element that I want to add to a page when used does some action? Is it possible to append slim template to another template?
charliesome has quit [Quit: zzz]
charliesome has joined #ruby-lang
imkmf has joined #ruby-lang
gix has quit [Ping timeout: 245 seconds]
yatish27_ has joined #ruby-lang
diegoviola has quit [Remote host closed the connection]
yatish27 has quit [Ping timeout: 245 seconds]
imkmf has quit [Ping timeout: 260 seconds]
gix has joined #ruby-lang
stardiviner has joined #ruby-lang
diegoviola has joined #ruby-lang
yatish27_ has quit []
yatish27 has joined #ruby-lang
j4cknewt has joined #ruby-lang
yatish27_ has joined #ruby-lang
kgrz has joined #ruby-lang
yatish2__ has joined #ruby-lang
yatish27 has quit [Ping timeout: 272 seconds]
wallerdev has joined #ruby-lang
yatish27_ has quit [Ping timeout: 258 seconds]
TheToad has quit [Read error: Connection reset by peer]
yatish2__ is now known as yatish27
shinnya has quit [Ping timeout: 244 seconds]
kgrz has quit [Ping timeout: 246 seconds]
wkoch has joined #ruby-lang
wkoch has quit [Remote host closed the connection]
gjaldon has joined #ruby-lang
Ben__ has joined #ruby-lang
diegoviola has quit [Quit: WeeChat 1.0]
ecnalyr has joined #ruby-lang
Phrogz_ has joined #ruby-lang
Ben__ has left #ruby-lang [#ruby-lang]
diegoviola has joined #ruby-lang
TheToad has joined #ruby-lang
ecnalyr has quit [Remote host closed the connection]
Phrogz_ has quit [Ping timeout: 260 seconds]
j4cknewt has quit [Remote host closed the connection]
j4cknewt has joined #ruby-lang
j4cknewt has quit [Ping timeout: 260 seconds]
symm- has quit [Ping timeout: 245 seconds]
karamazov has joined #ruby-lang
j4cknewt has joined #ruby-lang
|jemc| has quit [Quit: WeeChat 0.4.3]
haraoka has joined #ruby-lang
karamazov has quit [Ping timeout: 272 seconds]
tylersmith has joined #ruby-lang
|jemc| has joined #ruby-lang
yatish27 has quit [Remote host closed the connection]
tectonic has joined #ruby-lang
yatish27 has joined #ruby-lang
|jemc| has quit [Client Quit]
|jemc| has joined #ruby-lang
karamazov has joined #ruby-lang
gjaldon has quit [Remote host closed the connection]
yatish27 has quit [Ping timeout: 258 seconds]
karamazov has quit [Read error: Connection reset by peer]
gjaldon has joined #ruby-lang
karamazov has joined #ruby-lang
robbyoconnor has joined #ruby-lang
gjaldon has quit [Ping timeout: 240 seconds]
tkuchiki has quit [Remote host closed the connection]
emmesswhy has quit [Quit: This computer has gone to sleep]
TheToad has quit [Read error: Connection reset by peer]
gjaldon has joined #ruby-lang
emmesswhy has joined #ruby-lang
chouhoul_ has quit [Remote host closed the connection]
bsvineeth has quit [Remote host closed the connection]
bsvineeth has joined #ruby-lang
gjaldon has quit [Remote host closed the connection]
gjaldon has joined #ruby-lang
emmesswhy has quit [Quit: This computer has gone to sleep]
sepp2k1 has quit [Read error: Connection reset by peer]
<elico>
now I have started in a search for the optimal DB.
yfeldblum has joined #ruby-lang
<elico>
MySQL is fine and works but exceeds the space requirements.
<elico>
A 17 MB flat file becomes about 100MB of MySQL DB file.
<havenwood>
ahh
<elico>
Else then that it's fine :D
<elico>
CouchDB uses 408 MB for the same data..
<elico>
Now the other options are memcacheDB, KyotoTycoon and maybe others.
TheToad has joined #ruby-lang
<yxhuvud>
elico: sqlite perhaps?
yfeldblum has quit [Ping timeout: 244 seconds]
<elico>
yxhuvud: Do you know about any network server that uses sqlite??
<elico>
I was thinking about sqlite4 based server.
<elico>
Maybe even OpenLDAP if it works and fast enough.
shubhamg_ has joined #ruby-lang
<yxhuvud>
I'm not even certain what you mean by network server.
<elico>
tcp\udp accessed
<elico>
A server that can receive query over tcp or udp..
<elico>
and also respond..
<yxhuvud>
well, if that is a requirement then sqlite probably doesn't fit. however, putting a server in front of the database would still work.
elia has joined #ruby-lang
<elico>
yxhuvud: you are right but I would need to either find\acquire\write one..
<yxhuvud>
also, why change database? Can't you regenerate the data in a different directory while the old is still being served and then simply flip them when it is done?
[spoiler] has quit [Quit: Leaving]
<elico>
yxhuvud: it requires too much overhead :\
<elico>
I will need to create a whole new procedure to do that.
<elico>
to even allow that..
<elico>
Also I am using multiple read clients on these files.
elia has quit [Quit: Computer has gone to sleep.]
hakunin has quit [Remote host closed the connection]
hakunin has joined #ruby-lang
Guest76834 has quit [Quit: Lost terminal]
hakunin has quit [Ping timeout: 245 seconds]
TheToad has quit [Read error: Connection reset by peer]
Phrogz_ has joined #ruby-lang
Phrogz_ has quit [Ping timeout: 240 seconds]
<elico>
ok so KyotoTycoon uses 69 M file for storage.
<elico>
This is not that far from MySQL. 30 MB difference.
AlJaMa has quit [Quit: No Ping reply in 180 seconds.]
AlJaMa has joined #ruby-lang
toretore has joined #ruby-lang
bruno- has joined #ruby-lang
TheToad has joined #ruby-lang
<elico>
Something is going on!!!
<elico>
When I run dig on api.rubygems.com it returns a blank A record!!
yfeldblum has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
sush24 has quit [Quit: This computer has gone to sleep]
<canton7>
I get a property A record :P
<elico>
can you run dig against the NS itself ? 198.241.10.53?
<jhass>
don't do unsolicited queries, just ask in public if you have any questions ;)
<jhass>
memocool: ^
<jhass>
and right
<memocool>
ok iam sorry bro
<jhass>
no worries
<memocool>
can i ask somthing related to ruby codes or you will kick me hhhh ??
<memocool>
something *
<jhass>
just ask ;)
chouhoulis has joined #ruby-lang
<memocool>
i have something with .each method
<memocool>
my assignment is to print double values for a variable called odds
chouhoulis has quit [Remote host closed the connection]
<memocool>
odds = [1,3,5,7,9]
chouhoulis has joined #ruby-lang
lun_ has joined #ruby-lang
<memocool>
so i write that code
<jhass>
memocool: best make a gist (gist.github.com) with your assignment, what you tried so far, what output you expect from your code and what output it gives
<lun_>
Good day, coding people. Any one know any self-hosted alternative for http://codeclimate.com ? I found only one projects, but it's almost dead - last commit almost year ago.
chouhoulis has quit [Remote host closed the connection]
<Steve_Jobs>
hi.. having an some issues passing a function or block as a parameter. I'm a n00b to ruby and know the C# syntax
Lewix has joined #ruby-lang
<memocool>
plz help iam a beginner coder in ruby :(
<Steve_Jobs>
would a method call look like this:
<jhass>
memocool: okay, do you understand that odds is an array?
<memocool>
yeah
<jhass>
memocool: do you want 1) a new array with the new values 2) modify the existing array (replace the current values) 3) just print the new values
<Steve_Jobs>
some_function 1, 2, "hello", { | a, b | puts a + b }, "another param"
<Steve_Jobs>
the 4th parameter is a function that some_function will make use of somewhere in it's code
<Steve_Jobs>
is that correct? can that be written on multiple lines if puts a + b is a very long one-liner?
<jhass>
Steve_Jobs: no, the implicit anonymous function (block) you can pass to a method always needs to be at the end of a method
<jhass>
and you can then put newlines into the block, yes
<Steve_Jobs>
jhass: thanks.. what if I need to pass in 2 blocks?
<jhass>
Steve_Jobs: you wouldn't, you would pass two procs or a block and a proc
<memocool>
sorry man i can't underdstand :( all i want the write code to make odds numbers * 2
<Steve_Jobs>
jhass: ok.. so is there a way to pass in a proc instead of a block on one line?
elia has quit [Quit: Computer has gone to sleep.]
centrx has joined #ruby-lang
<Steve_Jobs>
some_function 1, 2, "hello", { | a, b | puts a + b }, { | a, b| puts a - b }, "another param"
<jhass>
memocool: that's a rather imprecise requirement, that I could come up with 3 very different alternatives to do that should show you that. Being precise is an important part of being a programmer
<Phrogz>
memocool: jhass asked you a pretty simple question: do you want a new array with the *2 values, do you want to modify the existing array to have *2 values, or do you just want to print *2 values?
<Phrogz>
Given that you said "print", I assume you want the third option.
<Phrogz>
memocool: odds.each{ |value| puts value*2 } would be one way to do it. So that you can learn, if you do not understand how that works, please ask for additional help.
SuMo_D has quit [Remote host closed the connection]
<Steve_Jobs>
jhass: thanks. I was missing the proc. Very helpful room
<memocool>
print *2 values odds = [1,3,5,7,9] i want [2,6,10,14,18]... iam sorry guys but iwas writting codes for training 6 hours please excuse me
hachiya has quit [Ping timeout: 240 seconds]
Voker57 has quit [Read error: Connection reset by peer]
Voker57 has joined #ruby-lang
<memocool>
phrogz i gonna try what you told me right now
SuMo_D has joined #ruby-lang
emmesswhy has quit [Quit: Leaving]
Cyrano has quit [Quit: Cyrano]
<memocool>
iam sorry guys but i think i can't explian because of my bad english
<jhass>
memocool: look at Phrogz code again, it's very close to what the assignment wants
<ihme-TTilus>
an actual picture of code, lol
devgiant_ has joined #ruby-lang
<ihme-TTilus>
try pastie.org or something alike next time
<jhass>
memocool: look at Phrogz code and read the second paragraph again
<ihme-TTilus>
a tad bit easier
nisstyre has quit [Quit: WeeChat 1.0]
nisstyre has joined #ruby-lang
ihme-TTilus is now known as TTilus
nisstyre has quit [Client Quit]
<memocool>
finally i wrote my code well .. thnx to all of you guys :)
<Phrogz>
memocool: When you write odds.each do |xxx| … end what happens is that for each value in the array Ruby will "do" what is in the "do...end" block. Whatever you put in "xxx" is the name you want to give the value.
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
devgiant has quit [Ping timeout: 258 seconds]
<memocool>
iam gonna share my right code with you now
<Phrogz>
memocool: pastie.org or gist.github.com please, not an image. :)
<Phrogz>
I added another comment illustrating what jhass is saying.
<memocool>
i saw it bro :)
apt-get_ has quit [Ping timeout: 272 seconds]
<memocool>
but my last question why print "#{x}" why not print "x" ??
<jhass>
it's not the same
<jhass>
print "x" is more equivalent to print "#{"x"}"
<Phrogz>
memocool: print "#{x}" print "x" print x The middle one is not the same as the ends.
<jhass>
"x" is not the same as just x
<memocool>
thnx :)
<memocool>
but i'm really disappointed .. it took my 3 h to know the right code :(
Phrogz has quit [Read error: Connection reset by peer]
<jhass>
well, how long have you been into programming?
Phrogz_ has joined #ruby-lang
<memocool>
hhhhh just 5 days
bsvineeth has quit [Remote host closed the connection]
<memocool>
but i love it too much what i want to build my one website with ruby and java s :)
dabradley has quit [Ping timeout: 272 seconds]
<memocool>
so iam taking ruby cours via codeacademy
<jhass>
always say js or javascript please :)
<memocool>
but iam really have great passion towrd scripting lang :) and programming in general
<memocool>
okay
<jhass>
java is a completely different language ;)
<Phrogz_>
java is to javascript as car is to carpet
<memocool>
hhhhhhh
<Phrogz_>
Which is to say: they are basically unrelated :)
<jhass>
so, don't worry too much, 5 days is nothing ;)
Phrogz_ is now known as Phrogz
spastorino has joined #ruby-lang
<memocool>
i study it on my own and i have studied english by myself so my english not good :)
<Phrogz>
It certainly isn't bad, though!
<jhass>
yeah, I've seen much worse english here ;)
apt-get_ has joined #ruby-lang
<memocool>
than me ?? i don't think so hhhhhhh
<jhass>
you don't seem to be copy pasting google translate. So that's a win already ;)
<memocool>
yeah i know that iam trying as much as i can :)
<memocool>
am also a security researcher i am providing an essays to help people be more secure that is the hero part in me hhhhhhhh
dabradley has joined #ruby-lang
<memocool>
but i went through programming because i loving it and i want to build my project :)
<memocool>
on my own too ;)
elia has joined #ruby-lang
<memocool>
but i don't know after i complete ruby course .. iwill be able to build my web with ruby and html,css or iam gonna need something more :)
<jhass>
depends a bit on what "your web" is ;)
<jhass>
you'll certainly need some libraries like sinatra or even rails
workmad3 has joined #ruby-lang
<jhass>
after you finished the course I'd suggest trying to find some regular problems you have in your daily life and (partially) automating them using plain ruby scripts
<memocool>
sure i'll but also after i finished i'll try to write codes for open source projects i think that will improve my programming skills
diegoviola has joined #ruby-lang
<memocool>
everyday i'm learning a lot as i am trying to be a programmer :) so i am grateful to ruby hhh
<memocool>
<jhass> when i complete my course i will be able to use sinatra or iam nedd to learn something in addtion ??
<jhass>
I'm pretty sure you'll need to learn how to use sinatra at least ;)
<memocool>
:)
<jhass>
but let's talk about that again when you're at that point
<memocool>
i am really appreciate your help you trying to help me again and again you and phrogz :)
<memocool>
okay no problem :)
imkmf has quit [Ping timeout: 245 seconds]
chussenot has quit [Quit: chussenot]
kgrz has quit [Remote host closed the connection]
nofxx has joined #ruby-lang
seamon has joined #ruby-lang
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jhass is now known as jhass|off
<memocool>
see you guys :)
dagda1 has joined #ruby-lang
memocool has quit []
jhass|off is now known as jhass
Missphoenix has joined #ruby-lang
workmad3 has quit [Ping timeout: 246 seconds]
Miphix has quit [Ping timeout: 246 seconds]
dagda1 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dagda1 has joined #ruby-lang
imkmf has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
<nofxx>
Hm, so I get this right... in my beautiful classes, if a want json representation of their objects, I should provide only #as_json, correct?
<nofxx>
Should I add the #to_json inside that one?
<nofxx>
def as_json; {foo: foo}.to_json;
<yxhuvud>
No.
yatish27 has quit [Ping timeout: 272 seconds]
<nofxx>
yxhuvud, foo.to_json will call the as_json?
<yxhuvud>
afaik, yes
yatish27 has joined #ruby-lang
<nofxx>
yxhuvud, thank you
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
imkmf has quit [Ping timeout: 245 seconds]
bobbinnumerous has joined #ruby-lang
postmodern has joined #ruby-lang
devgiant_ has quit [Quit: Leaving]
Phrogz has quit [Read error: Connection reset by peer]
Phrogz has joined #ruby-lang
TrebleChef has quit [Ping timeout: 245 seconds]
jtperreault has joined #ruby-lang
pabloh has quit [Remote host closed the connection]
Lewix has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
Phrogz has quit [Ping timeout: 258 seconds]
seamon has quit [Quit: Zzzzzzz]
Phrogz_ has joined #ruby-lang
Phrogz_ has quit [Changing host]
Phrogz_ has joined #ruby-lang
Phrogz_ has quit [Read error: Connection reset by peer]
Phrogz__ has joined #ruby-lang
Phrogz__ has quit [Read error: Connection reset by peer]
Phrogz_ has joined #ruby-lang
Phrogz_ has quit [Ping timeout: 260 seconds]
diegoviola has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 244 seconds]
havenwood has joined #ruby-lang
pskosinski has joined #ruby-lang
apt-get_ has quit [Quit: Quitte]
havenwood has quit [Remote host closed the connection]
nofxx_ has joined #ruby-lang
nofxx has quit [Ping timeout: 260 seconds]
Phrogz_ has joined #ruby-lang
<nofxx_>
#each_with_object ?? wtf is wrong with #reduce ??
hagabaka has quit [Ping timeout: 245 seconds]
hagabaka has joined #ruby-lang
yfeldblum has quit [Ping timeout: 272 seconds]
<Phrogz_>
reduce ?? wtf is wrong with #inject ??
<jhass>
nofxx_: in many cases you always need the same object, so with inject/reduce you write .inject(hash) {|hash, item| hash[item.k] = item.v; hash } whereas with each_with_object it's just each_with_object({}) {|hash, item| hash[item.k] = item.v }
omosoj has quit [Quit: Leaving]
bruno- has joined #ruby-lang
<jhass>
forgetting to return the right object with inject is a common oversight in my experience, so using each_with_object for these cases makes your code more tolerant to modification and declares intent better
<nofxx_>
Phrogz_, #inject is ugly... reduce is more rubyesque. Or do you still use #collect ???
<jhass>
mmh, I use #inject and #map :P
<Phrogz_>
:) I've always been a #map and #inject guy.
<nofxx_>
jhass, yeah, was reading after ranting here.... at first I taught it was just an alias
<nofxx_>
incredible stupid one it'll be... now I get
<Phrogz_>
inject/reduce, though, is such a crazy concept, I don't think there's any method name that makes sense. :)
<nofxx_>
heh map & reduce here
<Phrogz_>
That's all Google, neh? Map/Reduce.
<nofxx_>
Phrogz_, true...
<jhass>
and I thought couchdb inveted it! :P
Phrogz_ is now known as Phrogz
<nofxx_>
I think it says what's happening more... like, map this, reduce to this
<nofxx_>
map this, inject into this
<nofxx_>
well, not bad too
<Phrogz>
I want to defend my #inject choice, but I'm afraid you're right. I may never use #reduce, but I do think it's actually a better term than #inject.
<Phrogz>
#inject sounds like it's inserting into the array
<nofxx_>
Phrogz, yeah.. inject feels 'serial' ... reduce is more abstract
SuMo_D has quit [Remote host closed the connection]