apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p385: http://ruby-lang.org (ruby-2.0.0-rc2) || Paste >3 lines of text on http://gist.github.com
mmitchell has quit [Remote host closed the connection]
<shevy> Vulix ruby tries to make you happy while coding
<shevy> Vulix that means you have more freedom to do things how you want to do, in some ways. example: cat.meow is the same as cat.meow(), in python it would be a dictator cat, and only cat.meow() would be allowed
Virunga has quit [Remote host closed the connection]
garbagecollect-1 has quit [Quit: garbagecollect-1]
niklasb has quit [Ping timeout: 245 seconds]
DrShoggoth has joined #ruby
garbagecollectio has joined #ruby
bricker`LA has quit [Ping timeout: 256 seconds]
zoonfafer has joined #ruby
mockra has joined #ruby
mxweas has joined #ruby
<epitron> chairman meow
<epitron> the dictator cat
gosshedd has quit [Read error: Connection reset by peer]
kristofers has quit []
ryanf has quit [Ping timeout: 256 seconds]
toekutr has quit [Remote host closed the connection]
V8Energy has joined #ruby
lethjakman has quit [Ping timeout: 276 seconds]
octoberry has joined #ruby
<V8Energy> I can access the localhost with the same credentials using a web browser but not with NET::HTTP. any ideas why? uri = URI('http://localhost') req = Net::HTTP::Get.new(uri.request_uri) req.basic_auth 'admin', 'password' res = Net::HTTP.start(uri.hostname, uri.port) {|http| http.request(req) } data = res.body
<V8Energy> i am getting: #<Net::HTTPUnauthorized 401 Unauthorized readbody=true>
benlieb has quit [Quit: benlieb]
colonolGron has quit [Quit: leaving]
<banister_> l
banister_ is now known as banisterfiend
koopa_ has joined #ruby
otherj has quit []
cctv43 has quit [Ping timeout: 255 seconds]
nanothief has joined #ruby
w|t has quit [Quit: Cya.]
Elhu has quit [Quit: Computer has gone to sleep.]
wallerdev has quit [Quit: wallerdev]
w|t has joined #ruby
w|t has quit [Changing host]
w|t has joined #ruby
wallerdev has joined #ruby
<canton7> V8Energy, tried the "Basic Auth" section of http://www.rubyinside.com/nethttp-cheat-sheet-2940.html?
lushious has quit [Ping timeout: 252 seconds]
<canton7> I seem to remember that working for me at some point
msuszczy has joined #ruby
<canton7> also check your server logs
arturaz has quit [Remote host closed the connection]
<Vulix> is ruby really readable because everyone can just code stuff in different ways
jjbohn has joined #ruby
<canton7> sorry?
<canton7> you can code things in different ways in all languages
<apeiros_> Vulix: no. ruby is readable. and ruby allows more than just one way.
<apeiros_> canton7: well, pythons philosophy is somewhat "there is one true way"
cctv43 has joined #ruby
<apeiros_> and ruby leans more towards "there's more than one way"
<apeiros_> but IMO that's not a very important point
<Vulix> i mean in terms of simple things like method calls
beilabs has quit [Ping timeout: 244 seconds]
<canton7> "one obvious way to do it", wasn't it? and yeah, the obvious way was invariable a number of lines, whereas rub usually has a single funciton to do the same :P
<Vulix> hm im coming from java..python is easier to learn it seems but ruby intrigues me for some reason
<Vulix> cant say im having the easiest time getting used to some parts of it
<nosleep77> Vulix: me too
lushious has joined #ruby
<canton7> you'll get sick of the contents 'self' and the ton of first-class functions, I'll bet
spaceships has quit [Quit: Lost terminal]
stevechiagozie has quit [Quit: Computer has gone to sleep.]
jslowe has quit [Read error: Connection reset by peer]
jeffreybaird has joined #ruby
stevechiagozie has joined #ruby
<Vulix> i feel like ruby could lose some syntax
<Vulix> like why do for loops require | for something do |x|
Vulix has left #ruby [#ruby]
dEPy has quit []
Vulix has joined #ruby
backjlack has quit [Remote host closed the connection]
miskander has quit [Quit: miskander]
octoberry has quit [Ping timeout: 248 seconds]
RonScagz has quit [Quit: Linkinus - http://linkinus.com]
jjbohn has quit [Ping timeout: 248 seconds]
<canton7> Vulix, C has almost the same with its lambdas
<Vulix> hm well right now im comparing py to ruby
<canton7> and java for that matter
<Vulix> main reason im leaning ruby to be honest is because django seems to not be developing well right now
<canton7> python's lambas have a colon, but python has much much shittier lambdas
<canton7> and no concept of a block
miskander has joined #ruby
<canton7> s/of a block/of blocks
mmitchell has joined #ruby
<canton7> and s/C/C# way above
<Vulix> Blocks is another thing im having to get used too
<Vulix> i like the procedural nature of python, i feel the language stays out of the way and doesnt force form on me
<Vulix> rubys a bit different, not bad just different
nat_home has joined #ruby
etcetera has joined #ruby
<canton7> the functional style is making quite an impression outside of functional languages atm. C#'s LINQ is taking off in a big way, and java's catching up iirc
pavilionXP has quit [Ping timeout: 248 seconds]
<banisterfiend> Vulix: you're appreciate it when u 'get' ruby
<canton7> when you see how much less syntax using functional style requires, and how much clearer it is, you'll agree
<canton7> (loosely defining "functional style" to mean chaining method which take lambas as arguments, give or take)
etcetera has quit [Client Quit]
<Vulix> Yup I definitely plan to dive deeper and hang out here for the next few weeks\months, I want to actually get to know the language as well as I know python or better before I decide what to stick with for most of my work
<canton7> python has list comprehensions which are ok, but a lot less clear and have limited power
<banisterfiend> Vulix: you should buy "metaprogramming ruby" do get a sense of what's possible
<Vulix> I do a lot of text minign work so I'm also interested to see how ruby handles string encodings because Python sucks at that sometimes depending on the encoding
<nat_home> what is a rubyich way to do a program that check if there is something in stdin and then use that as an input else display a prompt and do something like gets.chomp ?
<canton7> Vulix, good man. I wish more people had that level of patience :P
bricker`LA has joined #ruby
<Vulix> i saw matz's interview about encodings and japanese characters so it seems like its something considered more deeply here
<jrabbit> Vulix: japan and ruby don't like utf8 sort story
beilabs has joined #ruby
<jrabbit> better story: utf8 is getting better
wyhaines has joined #ruby
pyrac has quit [Quit: pyrac]
jeffreybaird has quit [Quit: jeffreybaird]
<Vulix> also is there any gem that is the equivalent of SciPy\NumPy
tjbiddle has quit [Quit: tjbiddle]
<Skofo> All that takes to find out is a simple Google search :)
ryez has joined #ruby
ryez has quit [Max SendQ exceeded]
<nanothief> nat_home: STDIN.tty? could be what you want. ruby -e 'p $stdin.tty?' prints true, while echo 'hello' | ruby -e 'p $stdin.tty?' prints false
<V8Energy> canton7: same problem: #<Net::HTTPUnauthorized 401 Unauthorized readbody=true>
ryez has joined #ruby
PanPan_ has joined #ruby
ryez has quit [Max SendQ exceeded]
admin0 has quit [Quit: admin0]
ryez has joined #ruby
ryez has quit [Max SendQ exceeded]
elaptics is now known as elaptics`away
ryez has joined #ruby
ryez has quit [Max SendQ exceeded]
vlad_starkov has quit [Remote host closed the connection]
jeffreybaird has joined #ruby
jeffreybaird has quit [Remote host closed the connection]
pdamer has joined #ruby
ryez has joined #ruby
jeffreybaird has joined #ruby
wyhaines has quit [Remote host closed the connection]
PanPan_ has quit [Ping timeout: 252 seconds]
mxweas has quit [Remote host closed the connection]
mengu has joined #ruby
jonathanwallace1 has joined #ruby
jonathanwallace has quit [Ping timeout: 264 seconds]
pskosinski has quit [Ping timeout: 248 seconds]
Banistergalaxy has quit [Ping timeout: 252 seconds]
nari has quit [Ping timeout: 264 seconds]
mmitchell has quit [Remote host closed the connection]
<nanothief> Is there any mixins that automatically define the ==, eql? and hash that works using the instance variables of the class?
msuszczy has quit [Remote host closed the connection]
ssds has joined #ruby
hybris has joined #ruby
alx- has quit [Quit: alx-]
ssds has quit [Read error: Connection reset by peer]
maletor has quit [Quit: Computer has gone to sleep.]
<canton7> nanothief, that's not an easy problem. are we talking about comparing all the instance variables? sounds a bit iffy if not all of them are exposed
<nanothief> it is fairly simple with the instance_variables method, ie self.class == other.class && instance_variables == other.instance_variables && <compare instance variable values>
<cmyers> seems like you could be easily broken by other mixins too - like say something inserted the "last_accessed" field, then two different copies would no longer be equal
<cmyers> and you'd never realize why
<nat_home> nanothief: thanks, let me read more about that
<nanothief> cmyers: true, but you can always reimplement it yourself it that becomes a problem in the future
<cmyers> yeah, just a gotcha to watch out for
r0bby has joined #ruby
bricker`1A has joined #ruby
<ner0x> Can I use nokogiri to add a class to a node?
ryanf has joined #ruby
r0bby_ has joined #ruby
bean has quit [Quit: Computer has gone to sleep.]
agarie has joined #ruby
SeanLazer has quit [Quit: SeanLazer]
angusiguess has quit [Ping timeout: 255 seconds]
<canton7> ner0x, yes
SeanLazer has joined #ruby
mockra has quit [Remote host closed the connection]
robbyoconnor has quit [Ping timeout: 248 seconds]
bricker`LA has quit [Ping timeout: 252 seconds]
<ner0x> canton7: I've read the docs a bunch of times. Can you show me how?
etcetera has joined #ruby
chichou has quit [Ping timeout: 248 seconds]
<canton7> ner0x, node['class'] << ' mynewclass'
<canton7> (assuming the node already has a class)
r0bby has quit [Ping timeout: 252 seconds]
<canton7> if not, node['class'] = 'foo'
kaen has joined #ruby
<ner0x> I tried that.
<ner0x> It didn't work.
matchaw has joined #ruby
<ner0x> Let me get the code.
kaen has quit [Max SendQ exceeded]
matchaw___ has quit [Ping timeout: 248 seconds]
generalissimo has quit [Remote host closed the connection]
CraHan is now known as CraHan|out
ryez has quit [Ping timeout: 276 seconds]
Lemtzas is now known as ZombieMoses
<canton7> hmm modifying the class using << doens't work
ZombieMoses is now known as Lemtzas
Lemtzas is now known as ZombieMoses
<canton7> ner0x, http://pastie.org/6199893
<canton7> and I'm going to bed
marr has quit [Ping timeout: 252 seconds]
chendo_ has quit [Ping timeout: 252 seconds]
ZombieMoses is now known as Lemtzas
chendo_ has joined #ruby
skattyadz has quit [Quit: skattyadz]
vlad_starkov has joined #ruby
SCommette has joined #ruby
beliveyourdream has quit [Read error: Connection reset by peer]
hybris has quit [Quit: hybris]
pavilionXP has joined #ruby
mark___ has joined #ruby
radosch has quit [Quit: radosch]
eka has quit [Quit: Computer has gone to sleep.]
<mark___> Hi everyone, I am a Ruby newbie trying to use HTTParty in a Ruby script to authenticate into different web services like Hacker News. Unfortunately I haven't been able to post the request correctly. What here looks wrong?
vlad_starkov has quit [Read error: Connection reset by peer]
SeanLazer has quit [Quit: SeanLazer]
LouisRoR has joined #ruby
bigmac has quit [Quit: Leaving]
<mark___> hackernews = Hackernews.new(username, password)
<mark___> def initialize(username, password)
<mark___> @username = username
<mark___> @auth = { :u => username, :p => password }
<mark___> @profile_url = @update_url = "/user?id=#{username}"
<mark___> @password_url = "/changepw"
<mark___>
<mark___> response = self.class.post(LOGIN_URL, :body => { :basic_auth => @auth })
<mark___> log_response(response)
<mark___> end
otherj has joined #ruby
<mark___> LOGIN_URL is defined as LOGIN_URL = "/newslogin"
joofsh has joined #ruby
jjbohn has joined #ruby
LouisRoR has quit [Client Quit]
ephemerian has quit [Quit: Leaving.]
SeanLazer has joined #ruby
<garbagecollectio> what does the @mean?
spaceships has joined #ruby
<garbagecollectio> @
jjbohn has quit [Ping timeout: 248 seconds]
adeponte has joined #ruby
beilabs has quit [Ping timeout: 245 seconds]
LouisRoR has joined #ruby
Banistergalaxy has joined #ruby
m8 has quit [Quit: Sto andando via]
Michael__ has joined #ruby
<matchaw> hi, does optparse allow you to use a single hyphen for specifying arguments? I.e ./script -myarg foobar instead of ./script --myarg foobar
Trudko has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
LouisRoR has quit [Client Quit]
samphippen has quit [Quit: Computer has gone to sleep.]
shadowshell has quit [Remote host closed the connection]
timols has joined #ruby
toekutr has joined #ruby
chrisramon has joined #ruby
thufir_ has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
maletor has joined #ruby
maletor has quit [Client Quit]
thinkclay has joined #ruby
PanPan_ has joined #ruby
<thinkclay> what's the best fix for this: Unable to activate cocoapods-0.16.2, because rake-10.0.3 conflicts with rake (~> 0.9.4)
miskander has quit [Quit: miskander]
beilabs has joined #ruby
<ner0x> thinkclay: Use a different version.
<thinkclay> for cocoapods? How do i go about doing so?
<thinkclay> (still somewhat new to ruby)
adkron has joined #ruby
adkron_ has joined #ruby
atal421 has joined #ruby
<havenwood> Crystal looks like an interesting Ruby-derived language. https://github.com/manastech/crystal
PanPan_ has quit [Ping timeout: 240 seconds]
<mark___> Hi havenwood, have you used HTTParty to log into a site? I'm a Ruby newbie and trying to but have not been able to successfully.
tylersmith has joined #ruby
<mark___> Unfortunately HTTParty's documentation is not robust...
pyrac has joined #ruby
<havenwood> mark___: Yeah, I've used HTTParty. There are many alternatives to it though. Nakamura san gave a great talk comparing the options at the last RubyConf: http://www.confreaks.com/videos/1271-rubyconf2012-ruby-http-clients-comparison
thufir_ has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 248 seconds]
ben_h has joined #ruby
<mark___> havenwood, thanks, what do you recommend for a newbie?
ahokaomaeha has quit [Ping timeout: 245 seconds]
Kuifje has quit [Ping timeout: 240 seconds]
<havenwood> mark___: Hrmm. A couple good options, HTTParty amongst them depending on what you're doing. Good, very detailed comparison here: http://bit.ly/RubyHTTPClients2012
hbpoison has joined #ruby
<havenwood> mark___: httparty, rest-client, mechanize, httpclient and faraday are all nice options
havenwood has quit [Remote host closed the connection]
<mark___> That's quite helpful, thanks. I'll try mechanize.
tenmilestereo has quit [Quit: Leaving]
dallasm has joined #ruby
pyrac has quit [Ping timeout: 240 seconds]
<spaceships> Is there an easy way to speed up Spreadsheet?
ahokaomaeha has joined #ruby
<banisterfiend> spaceships: !spreadsheet.speed_up
monkegjinni has quit [Remote host closed the connection]
mockra has joined #ruby
max_ has joined #ruby
yxhuvud has joined #ruby
ahokaomaeha has quit [Ping timeout: 260 seconds]
<Vulix> if you are going to make a new programming language (why would you anyway?) why in the hell would you base it off ruby lol
atal421 has quit [Quit: atal421]
nignaztic has quit [Ping timeout: 255 seconds]
<Vulix> C++ is easy enough and will give you more flexibility
<jrajav> "if you are going to make a new programming language (why would you anyway?)" <-- well that's kind of a stupid mindset.
<Vulix> not really
<Vulix> its the same problem with linux
<Vulix> too many distros\languages that are scarcely used
<jrajav> Why the hell does anyone try to make new cars? ICEs work great, are extremely well tested, very efficient, etc. etc.
<Vulix> developers re-inventing the wheel instead of working to make just a few projects better
<ben_h> not all work has to be productive
pdamer has quit [Quit: pdamer]
<ben_h> "because i want to" is as good a reason as any
xardas has quit [Ping timeout: 244 seconds]
<Vulix> i cant honestly think of how i could write a programming language that would be better than an already existing language in any one task
angusiguess has joined #ruby
<jrajav> Therefore, by extension, it's a futile gesture for literally anyone.
<ben_h> Vulix: sometimes the journey is more important than the destination. :)
Myk267 has quit [Quit: Whee!]
<Vulix> Fair enough I know what you guys are saying
<Vulix> why was I set as an operator lol
atal421 has joined #ruby
<Vulix> i will eventually be writing a machine learning algorithm library in either Ruby or Python when I pick one to stick with, i suppose i find applications like that more interesting
Banistergalaxy has joined #ruby
angusiguess has quit [Ping timeout: 255 seconds]
SIFTU has quit [Quit: WeeChat 0.3.8]
chrishough has quit [Quit: chrishough]
chico_chicote has quit [Read error: Connection reset by peer]
reactormonk has quit [Ping timeout: 252 seconds]
postmodern has joined #ruby
yxhuvud has quit [Ping timeout: 256 seconds]
Starrfish has joined #ruby
Myconix has joined #ruby
charliesome has joined #ruby
Hanmac1 has joined #ruby
nat_home has quit [Quit: Leaving.]
SCommette has quit [Quit: SCommette]
Hanmac has quit [Ping timeout: 248 seconds]
nat_home has joined #ruby
atal421 has quit [Quit: atal421]
nomenkun_ has quit [Remote host closed the connection]
adkron_ has quit [Ping timeout: 264 seconds]
Takehiro has joined #ruby
adkron has quit [Ping timeout: 264 seconds]
daniel_- has joined #ruby
Konboi has joined #ruby
subbyyy has quit [Quit: none 0.3.9.2]
subbyyy has joined #ruby
c0rn has joined #ruby
subbyyy has quit [Client Quit]
Takehiro has quit [Ping timeout: 252 seconds]
subbyyy has joined #ruby
vlad_starkov has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
subbyyy has quit [Client Quit]
Myconix has quit [Quit: Leaving]
tylersmith has quit [Quit: tylersmith]
Starrfish is now known as Myconix
jonathanwallace1 has quit [Ping timeout: 252 seconds]
adamjleonard has joined #ruby
emmanuelux has joined #ruby
caleb_io has joined #ruby
jonathanwallace1 has joined #ruby
hashtree has joined #ruby
jimeh has joined #ruby
mark___ has quit [Remote host closed the connection]
subbyyy has joined #ruby
stormetrooper has quit [Quit: Leaving]
DanKnox has quit [Remote host closed the connection]
mengu has quit [Quit: Leaving]
billiam has joined #ruby
generalissimo has joined #ruby
atal421 has joined #ruby
chrishough has joined #ruby
nat_home has quit [Quit: Leaving.]
hashtree has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
lethjakman has joined #ruby
xaq has joined #ruby
atal421 has quit [Quit: atal421]
apoch632 has joined #ruby
nat_home has joined #ruby
PanPan_ has joined #ruby
aedorn has quit [Ping timeout: 240 seconds]
chrisramon has quit [Quit: chrisramon]
ben_h_ has joined #ruby
ben_h has quit [Read error: Connection reset by peer]
ben_h_ is now known as ben_h
Takehiro has joined #ruby
PanPan_ has quit [Ping timeout: 276 seconds]
eric|eh has joined #ruby
<eric|eh> Does anyone here know how to compile a ruby app to a self executable on linux
etcetera has quit [Ping timeout: 256 seconds]
yacks has joined #ruby
mlr has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9.2]
Takehiro has quit [Ping timeout: 240 seconds]
mark___ has joined #ruby
<eric|eh> Does anyone here know how to compile a ruby app to a self executable on linux
vierja has quit [Ping timeout: 244 seconds]
chrishough has quit [Quit: chrishough]
etcetera has joined #ruby
<d_roge> eric|eh: you can try https://github.com/jruby/warbler
<eric|eh> I know about that
<eric|eh> But it doesnt do its job right
daniel_- has joined #ruby
daniel_- has quit [Changing host]
daniel_- has joined #ruby
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
mockra has quit [Remote host closed the connection]
<Vulix> you know whats great
<Vulix> bulgar wheat
cisco has quit [Quit: Leaving.]
aedorn has joined #ruby
Beoran has joined #ruby
noxoc has quit [Quit: noxoc]
ferdev is now known as ferdev|away
pdamer has joined #ruby
skrewler has quit [Quit: skrewler]
otherj has quit []
ner0x has quit [Quit: Leaving]
angusiguess has joined #ruby
<Vulix> what are some good gui libs for ruby
dallasm has quit [Remote host closed the connection]
<eric|eh> shoes
eric|eh has quit [Remote host closed the connection]
mattbl has joined #ruby
angusiguess has quit [Ping timeout: 256 seconds]
heftig has quit [Quit: leaving]
Vulix has left #ruby [#ruby]
billiam has quit [Read error: Connection reset by peer]
Vulix has joined #ruby
etcetera has quit []
crackfu has joined #ruby
otherj has joined #ruby
otherj has quit [Client Quit]
mockra has joined #ruby
otherj has joined #ruby
otherj has quit [Max SendQ exceeded]
mockra has quit [Ping timeout: 252 seconds]
mark____ has joined #ruby
mark___ has quit [Read error: Connection reset by peer]
v0n has joined #ruby
bricker`LA has joined #ruby
<Dwarf> Hello folks
<Dwarf> Can anyone help me with something?
<Dwarf> I have an array with data, and I want to add another array to it, but only keep the non-unique values
heftig has joined #ruby
heftig is now known as Guest67633
Guest67633 has quit [Changing host]
Guest67633 has joined #ruby
Guest67633 is now known as heftig
TheFuzzball has joined #ruby
bricker`1A has quit [Ping timeout: 276 seconds]
nilobject has joined #ruby
mark____ has quit [Read error: Connection reset by peer]
mark___ has joined #ruby
mark___ has quit [Remote host closed the connection]
heftig has quit [Client Quit]
heftig has joined #ruby
stormetrooper has joined #ruby
emergion has joined #ruby
jonathanwallace1 has quit [Ping timeout: 240 seconds]
ahokaomaeha has joined #ruby
nomenkun has joined #ruby
mockra has joined #ruby
adeponte has quit [Remote host closed the connection]
<apeiros_> Dwarf: the non-unique values after combining or before?
crackfu has quit [Remote host closed the connection]
ahokaomaeha has quit [Ping timeout: 248 seconds]
jonathanwallace1 has joined #ruby
jetblack has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
<Dwarf> After combining
stkowski has joined #ruby
crackfu has joined #ruby
nomenkun has quit [Ping timeout: 248 seconds]
mercwith1mouth has quit [Ping timeout: 256 seconds]
mercwithamouth has quit [Ping timeout: 256 seconds]
wiiw has joined #ruby
<apeiros_> Dwarf: do you have an approach at keeping only non-unique values from a single array?
mockra has quit [Ping timeout: 244 seconds]
<Dwarf> No, that's what I was wondering on how to do
<apeiros_> use a "seen"-hash (seen = Hash.new(0)), count occurrences, remove any with <1, get the keys
nilobject has quit [Quit: nilobject]
<Dwarf> I don't think I understand, I'm quite new to ruby I guess
<apeiros_> do you know what a Hash is?
crackfu has quit [Ping timeout: 256 seconds]
<apeiros_> (should have been <2, not <1 before, my fault)
kyle__ has quit [Disconnected by services]
<Boohbah> <3
beilabs has quit [Ping timeout: 252 seconds]
jimeh has joined #ruby
toekutr has quit [Remote host closed the connection]
caleb_io has quit [Quit: caleb_io]
sailias has joined #ruby
Konboi has quit [Remote host closed the connection]
<apeiros_> Dwarf: I'm going to bed soon. so hurry up if you want the help.
PanPan_ has joined #ruby
otherj has joined #ruby
<Dwarf> I know what a hash is
otherj has quit [Client Quit]
<Dwarf> I believe. It's an associative array
<apeiros_> it's similar
<apeiros_> you store key/value pairs. lookup by key is very fast.
<Dwarf> Yup
nat_home has quit [Quit: Leaving.]
<apeiros_> Hash.new(0) creates a hash with 0 instead of nil as the default value
<Dwarf> Mhm
nat_home has joined #ruby
<apeiros_> seen[key] += 1 # works now without having to add `seen[key] ||= 0` first
<nat_home> what's a good way to find the index of the first element of an array A that exists in an array B ?
halfie has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
<halfie> hi, the variable I am creating / assigning to inside if block does not exist outside the if block. any tips to make this work?
<apeiros_> so you create the `seen` hash like that, you iterate over both arrays and do += 1 for each item. then you use Hash#reject! to remove keys with a value less than 2 (<2)
<apeiros_> and at the end you use Hash#keys to get the remaining keys (which are the non-unique values after combining)
Takehiro has joined #ruby
<banisterfiend> halfie: r u telling lies
<apeiros_> halfie: if does not introduce a new lexical scope. lvars should be visible
beilabs has joined #ruby
<halfie> banisterfiend: apeiros_ http://dpaste.com/939724/
<apeiros_> halfie: $vars are globals
<banisterfiend> halfie: it's cos u enclose it in a block
<apeiros_> also, it's not the `if`, it's the block which creates a new scope
<banisterfiend> lvars defined in a block dont exist after it
<banisterfiend> apeiros_: y r u still awake
<apeiros_> halfie: a) don't use $, b) define the variables before the block, e.g. by assigning nil
emmanuelux has quit [Remote host closed the connection]
<apeiros_> banisterfiend: played starbase orion
<halfie> so, what is the solution, I want those variables outside block
<apeiros_> halfie: see above
<halfie> apeiros_: banisterfiend: thanks! $vars works
ogonec has quit [Read error: Operation timed out]
<banisterfiend> apeiros_: did u have fun
<apeiros_> nat_home: depends. if B is potentially large you should convert it to a set first. for the rest: Array#find_index
<wiiw> how to write this in ruby : https://gist.github.com/esperlu/943776
<apeiros_> halfie: aaaaaah, dude, READ, $vars are GLOBALS. you do NOT use globals.
chendo_ has quit [Ping timeout: 252 seconds]
zodiak has joined #ruby
<halfie> apeiros_: in this particular case using them makes sense
<apeiros_> wiiw: bad question.
<nat_home> apeiros_: both arrays have around 20 elements
<apeiros_> wiiw: this is not a "we work for you for free" channel. work on it yourself and when you hit a problem, come back and ask.
_justin has joined #ruby
<banisterfiend> halfie: just set the lvars to nil outside the block
<banisterfiend> they'll exist after it
Takehiro has quit [Ping timeout: 256 seconds]
<apeiros_> halfie: no, it does not. globals never make sense.
<halfie> banisterfiend: aah, okay, thanks
<wiiw> apeiros_: ok...
chendo_ has joined #ruby
reactormonk has joined #ruby
Michael__ has quit [Ping timeout: 252 seconds]
mockra has joined #ruby
<apeiros_> nat_home: I'd expect using a Set for the test to already be faster with 20 elements. but feel free to bench yourself.
macmartine has joined #ruby
wiiw has left #ruby [#ruby]
prophile has joined #ruby
PanPan_ has quit [Remote host closed the connection]
mercwith1mouth has joined #ruby
mercwithamouth has joined #ruby
mockra has quit [Ping timeout: 248 seconds]
wiiw has joined #ruby
<wiiw> apeiros_: sequel mysql://user:password@host/database -C sqlite://db.sqlite
Beoran_ has joined #ruby
<prophile> aloha
ahokaomaeha has joined #ruby
<apeiros_> wiiw: nice
<wiiw> :)
<prophile> so I'm trying to shrink down a fizzbuzz snippet as much as I can, for codegolfy reasons
<prophile> I've got it down to (1..100).map{|k|puts %W[#{k} Fizz Buzz FizzBuzz][3&19142723>>k%15*2]}
<prophile> any suggestions for further shrinkage?
ben_h has quit [Quit: ben_h]
SeanLazer has quit [Quit: SeanLazer]
Beoran has quit [Ping timeout: 248 seconds]
angusiguess has joined #ruby
wiiw has left #ruby [#ruby]
<apeiros_> 3&19142723>>k%15*2 # interesting technique
maletor has joined #ruby
ogonec has joined #ruby
nat_home has quit [Quit: Leaving.]
<prophile> figured i'd encode the lookup table into a constant
nat_home has joined #ruby
<prophile> and it just so happens that it needs no brackets
<apeiros_> yeah, lucky precedence :)
<apeiros_> parens btw., brackets are []
meoblast001 has quit [Read error: Connection reset by peer]
<apeiros_> sad, Integer#[] doesn't take slices… would be nice
<prophile> ah, slip of the tongue
<garbagecollectio> does the rails new command do the same thing as the generate command
<apeiros_> otherwise you could have done 19142723[k%15,2], which saves 2 chars
<apeiros_> garbagecollectio: compare `rails new -h` and `rails generate -h`
Es0teric has quit [Remote host closed the connection]
<prophile> ah, that would have been nice
heftig has quit [Quit: Quitting]
maletor has quit [Quit: Computer has gone to sleep.]
maletor has joined #ruby
maletor has quit [Client Quit]
heftig has joined #ruby
thinkclay has quit [Quit: Leaving.]
maletor has joined #ruby
maletor has quit [Client Quit]
thinkclay has joined #ruby
jonathanwallace1 has quit [Ping timeout: 256 seconds]
<garbagecollectio> hey
<garbagecollectio> does application/layouts have to be something
<garbagecollectio> it can't just be blank
<garbagecollectio> even though I'm routing to a certain controller?
emergion has quit [Quit: Computer has gone to sleep.]
emergion has joined #ruby
bricker`LA has quit [Ping timeout: 255 seconds]
miskander has joined #ruby
idkazuma has quit [Remote host closed the connection]
cableray has quit [Quit: cableray]
mockra has joined #ruby
miskander has quit [Client Quit]
Ouroboros has joined #ruby
PanPan_ has joined #ruby
fruers has joined #ruby
moshee has quit [Ping timeout: 248 seconds]
<Ouroboros> can anyone recommend a good book on database design for web apps? could be rails focused or just general.
moshee has joined #ruby
mockra has quit [Ping timeout: 244 seconds]
<fruers> Can someone please explain the difference between "class Thor; module Base; end; end" and "module Thor; class Base; end; end"
<fruers> I'm new to Ruby and in some code I see the former, in other code the latter
heftig has quit [Quit: Quitting]
<fruers> Is it just namespace sugar?
heftig has joined #ruby
heftig has quit [Client Quit]
<apeiros_> fruers: uh? that's not possible. Thor can either be a module or a class, not both
<apeiros_> >> class X; end; module X; end
<eval-in> apeiros_: Output: "/tmp/execpad-d229d25b6075/source-d229d25b6075:1:in `<main>': X is not a module (TypeError)\n" (http://eval.in/10352)
heftig has joined #ruby
Takehiro has joined #ruby
adeponte has joined #ruby
pac1 has quit [Ping timeout: 248 seconds]
nfk has quit [Quit: yawn]
Konboi has joined #ruby
adeponte has quit [Ping timeout: 248 seconds]
hbpoison has quit [Ping timeout: 240 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
jonathanwallace1 has joined #ruby
angusiguess has quit [Ping timeout: 248 seconds]
<Vulix> So I deicded learning rails is not a good way to learn ruby
atal421 has joined #ruby
mockra has joined #ruby
mark___ has joined #ruby
mlr has quit [Ping timeout: 252 seconds]
<garbagecollectio> "A singular resourceful route generates these helpers:"
<garbagecollectio> are these helpers explicit in the helpers folder or what?
<_justin> Vulix, shouldn't have taken this long.
<fruers> apeiros_: Perhaps I didn't ask my question properly, the code I'm refering to is here https://github.com/wycats/thor/blob/master/lib/thor/shell.rb
<_justin> Ruby > Rails
<fruers> apeiros_: I'm not talking about using the declarations together, just trying to understand the difference between the two (and which one I should use)
<apeiros_> fruers: `class X` opens (or in case it doesn't exist already: creates) the class X
Guest16060 has quit [Ping timeout: 245 seconds]
twoism has joined #ruby
<apeiros_> fruers: `module X` opens (or in case it doesn't exist already: creates) the module X
<apeiros_> module X; end; X.class # => Module
<apeiros_> class X; end; X.class # => Class
thibauts has quit [Quit: leaving]
idkazuma has joined #ruby
<garbagecollectio> facebook is offline
<fruers> apeiros_: That makes more sense the way you've said it
vierja has quit [Read error: Connection reset by peer]
<apeiros_> modules and classes both are containers for instance methods. a class can be instantiated, a module can't. a module can be included into a class or module, an object can be extended with a module. include/extend does not work with a class.
<fruers> apeiros_: So the Thor code I posted, why does it open the class first?
<apeiros_> other traits shared by modules/classes: both serve as namespaces, both are objects
<apeiros_> fruers: because wycats does the right thing and puts all his code into a single namespace: Thor
pdamer has quit [Quit: pdamer]
mark___ has quit [Remote host closed the connection]
<apeiros_> so he gets the modules Thor::Base and Thor::Shell instead of toplevel Base and Shell (which are likely to create collisions)
clooth has quit [Quit: clooth]
danneu has quit [Remote host closed the connection]
mark___ has joined #ruby
jonathanwallace1 has quit [Ping timeout: 256 seconds]
ryanf has quit [Ping timeout: 248 seconds]
<fruers> apeiros_: Sweet, got it
<fruers> Thanks
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
dallasm has joined #ruby
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
twoism has quit [Remote host closed the connection]
mark___ has quit [Ping timeout: 252 seconds]
sandGorgon has joined #ruby
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
mark___ has joined #ruby
ryanf has joined #ruby
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
twoism has joined #ruby
vierja has joined #ruby
twoism has quit [Remote host closed the connection]
ben_h has joined #ruby
davetherat has quit [Remote host closed the connection]
davetherat has joined #ruby
nari has joined #ruby
cableray has joined #ruby
chrishough has joined #ruby
daniel_- has quit [Ping timeout: 252 seconds]
xemu has quit [Quit: Nettalk6 - www.ntalk.de]
adeponte has joined #ruby
vikhyat has joined #ruby
danneu has joined #ruby
TheFuzzball has quit [Quit: Computer has gone to sleep.]
joofsh has quit [Remote host closed the connection]
rippa has joined #ruby
lethjakman has quit [Quit: WeeChat 0.3.9]
hbpoison has joined #ruby
mark___ has quit [Remote host closed the connection]
mark___ has joined #ruby
mark___ has quit [Remote host closed the connection]
SDr has quit [Ping timeout: 246 seconds]
beachandbytes has joined #ruby
twoism has joined #ruby
stormetrooper has quit [Ping timeout: 248 seconds]
jekotia has quit [Quit: ChatZilla 0.9.90-rdmsoft [XULRunner 18.0.2/20130201065344]]
twoism has quit [Remote host closed the connection]
Fezzler has joined #ruby
ddd has joined #ruby
IceDragon has quit [Quit: Space~~~]
ddd is now known as Guest87249
Fezzler has quit [Client Quit]
Spooner has quit [Remote host closed the connection]
jrajav has quit [Quit: I tend to be neutral about apples]
qubit has quit [Ping timeout: 245 seconds]
tommyvyo has joined #ruby
wmoxam has quit [Remote host closed the connection]
qubit has joined #ruby
PanPan_ has quit [Ping timeout: 256 seconds]
flexd has quit [Ping timeout: 244 seconds]
PanPan has joined #ruby
thufir_ has joined #ruby
kn330 has joined #ruby
angusiguess has joined #ruby
garbagecollectio has quit [Quit: garbagecollectio]
angusiguess has quit [Ping timeout: 252 seconds]
<fruers> If I had "module Foo; module Bar; class Baz" how would I reference Baz?
<fruers> Foo::Bar::Baz?
<ben_h> fruers: exactly :)
jpfuentes2 has joined #ruby
garbagecollectio has joined #ruby
<fruers> ben_h: ...and if I had require "foo/bar", would I still explicitly reference it?
<fruers> Or could I just say Baz?
<ben_h> no, require doesn't alter that
<fruers> Ok
<ben_h> require is purely concerned with files on disk. it just loads code
sailias has quit [Quit: Leaving.]
<ben_h> to refer to it as just Baz, you'd have to include Foo::Bar into your current scope -- but it's generally good to avoid that unless you have a good reason to.
<fruers> Ok, thanks
<ben_h> keeping separate scopes separate is one part of keeping things decoupled, which is very important
<fruers> Is there some kind of autoloader, I am looking at code that refers to Net::HTTP.new without any require
<ben_h> it was most likely just required from a different file
<ben_h> (if this is a rails app, then yeah there's an autoloader it hooks methods like #const_missing and requires them inline.)
<fruers> yes it looks like it, it's not rails
yacks has quit [Quit: Leaving]
<ben_h> but once a file is required, it's loaded globally. there's no per-file context like python and friends
<ben_h> another reason why keeping namespaces separate is important :)
v0n has quit [Ping timeout: 252 seconds]
<fruers> Ah I see, so it doesn't even matter if it was required in another module namespace?
<fruers> At the moment my interpretation of module is purely for namespacing, it doesn't do any isolation or anything else
<ben_h> no it makes no difference
<ben_h> yep. modules are purely for namespacing. you can turn them into a class-like structure where their methods are directly callable, but in general they're for e.g. wrapping your gem's code up inside a single constant
garbagecollectio has quit [Quit: garbagecollectio]
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
dallasm has quit [Remote host closed the connection]
hashmal has quit [Quit: Computer has gone to sleep.]
<Vulix> wow ruby regex is easy
<Vulix> especially since you dont have to definite you patterns and matchers separetly
<Vulix> im impressed
<fruers> ben_h: If I had an app called myapp, would it be normal to put all the require's in lib/myapp.rb
<fruers> ben_h: That's what I'm seeing in the project I'm looking at
<ben_h> fruers: there's no one convention. i think the best way is for each file to require the things it needs, at the top of the file
<ben_h> but then if your gem uses Net::HTTP all over, it might be neater to just require it once in lib/myapp.rb
<ben_h> my rule is to require per-file, but if i find myself doing a lot of typing them i move it to the top level.
<fruers> ben_h: ...and if two files need something they both have the require "net/http"?
<ben_h> two, yeah. ten, i'd just say it once at the top
<fruers> I did read that require knows not to require modules twice
<ben_h> it doesn't check modules, it checks paths
<ben_h> like i said -- it's purely concerned with files.
fixl has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<ben_h> require expands the path to an absolute, and only requires each absolute path once.
<fruers> How does that work with editors, how do they know you have undeclared names if the require is in another file?
<fruers> Heh, I'm probably asking too specific questions... I can work it out from there
<fruers> Very helpful, thanks. Ruby language is easy to understand... just getting my head around the idioms
garbagecollectio has joined #ruby
thone has joined #ruby
mahmoudimus has joined #ruby
psyprus has quit [Ping timeout: 248 seconds]
macmartine has joined #ruby
_justin has quit [Quit: _justin]
thone_ has quit [Ping timeout: 248 seconds]
Skofo has quit [Remote host closed the connection]
ogonec has quit [Quit: Leaving]
sandGorgon has quit [Ping timeout: 248 seconds]
Es0teric has joined #ruby
<Vulix> i have wet dreams about ruby
Xeago has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
icole has quit [Remote host closed the connection]
icole has joined #ruby
ben_h has quit [Read error: Connection reset by peer]
ben_h has joined #ruby
<ben_h> fruers: the editors don't know, for the most part :) rubymine does because it loads and parses the whole source tree
malealone has joined #ruby
<malealone> saliref cndht salidgo wgaug refcndht salidgo wsaliref cndht salidgo wgaug refcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgaug real idg o wgaug rdgo wgaug refcddht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug rexgaug refcndht sal digo wgaug reccndht sa l idg o wgaug real idg o wgaug rdgo wgaug refcndht salidgo wgaugsalirefsaliref cndht salidgo fgaug
<malealone> refcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgau real idg o wga rdgu wgaug refcndht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug ref cndht salidgo wolf iefcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgaugsaliref cndht salidgo wgaug refcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgaug real idg o wgaug rdgo wgaug
<malealone> wgaug refcddht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug rexgaug refcndht sal digo wgaug reccndht sa l idg o wgaug real idg o wgaug rdgo wgaug refcndht salidgo wgaugsalirefsaliref cndht salidgo fgaug refcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgau real idg o wga rdgu wgaug refcndht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug ref
<malealone> cndht salidgo wolf iefcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgaugsaliref cndht salidgo wgaug refcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgaug real idg o wgaug rdgo wgaug refcndht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug ref real idg o wgaug rdgo wgaug refcndht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug
<malealone> refcndht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug ref real idg o wgaug rdgo wgaug refcndht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug ref refcn dht salidgo wgaug refcndht salidgo wgaug refsaliref cndht salidgo wgaug refcndht salidgo wsaliref cndht salidgo wgaug refcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgaug real idg o wgaug rdgo
<malealone> ref refcn dht salidgo wgaug refcndht salidgo wgaug refsaliref cndht salidgo wgaug refcndht salidgo wsaliref cndht salidgo wgaug refcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgaug real idg o wgaug rdgo wgaug refcddht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug rexgaug refcndht sal digo wgaug reccndht sa l idg o wgaug real idg o wgaug rdgo wgaug refcndht
<malealone> salidgo wgaugsalirefsaliref cndht salidgo fgaug refcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgau real idg o wga rdgu wgaug refcndht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug ref cndht salidgo wolf iefcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgaugsaliref cndht salidgo wgaug refcndht salidgo wgaug refcndht sal digo wgaug refcndht
<malealone> sa l idg o wgaug real idg o wgaug rdgo wgaug refcndht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug ref real idg o wgaug rdgo wgaug refcndht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug ref refcn dht salidgo wgaug refcndht salidgo wgaug refsaliref cndht salidgo wgaug refcndht salidgo wsaliref cndht salidgo wgaug refcndht salidgo wgaug refcndht sal digo wgaug
<malealone> refcndht sa l idg o wgaug real idg o wgaug rdgo wgaug refcddht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug rexgaug refcndht sal digo wgaug reccndht sa l idg o wgaug real idg o wgaug rdgo wgaug refcndht salidgo wgaugsalirefsaliref cndht salidgo fgaug refcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgau real idg o wga rdgu wgaug refcndht salidgo wgaug
<malealone> refcn dht salidgo wgaug refcndht salidgo wgaug ref cndht salidgo wolf iefcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgaugsaliref cndht salidgo wgaug refcndht salidgo wgaug refcndht sal digo wgaug refcndht sa l idg o wgaug real idg o wgaug rdgo wgaug refcndht salidgo wgaug refcn dht salidgo wgaug refcndht salidgo wgaug ref real idg o wgaug rdgo wgaug refcndht salidgo
<malealone> wgaug refcn dht salidgo wgaug refcndht salidgo wgaug ref refcn dht salidgo wgaug refcndht salidgo wgaug refsaliref cndht salidgo wgaug refcndht salidgo wsali
malealone was kicked from #ruby by apeiros_ [malealone]
qubit has quit [Ping timeout: 252 seconds]
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
emergion has joined #ruby
<fruers> emergion: You working weekends?
<Vulix> File.open('textfile.txt','r') do |line|
<Vulix> is that proper
<Vulix> the thing inside the | | marks is a line of the file?
<emergion> fruers looks like you are :)
<emergion> fruers editing some photos
stormetrooper has joined #ruby
<fruers> emergion: Photos of your Ruby code?
<emergion> Photos of Gong Harbour :)
<fruers> I'm learning Ruby
alanp has joined #ruby
<ben_h> Vulix: yep. line is the block argument
<emergion> fruers I just learned pyhthon, took about 20 minutes
ahokaomaeha has joined #ruby
<ben_h> File.open() will yield that block for each line
<ben_h> wait
<fruers> I kinda asked this before, but what is the difference between namespacing with module and class
<Vulix> Ok so that's what a block is
<ben_h> no sorry i'm talking out my arse. :)
<fruers> emergion: That would be a compliment, you meant it that way didn't you?
<Vulix> Sorry I come from Java land
<emergion> fruers, sure did
<ben_h> the method is File.open('textfile.txt') {|file| ... }
<Vulix> and python
<Vulix> nifty it defaults to looping through the text file line by line for the block
<emergion> fruers, modules can encapsulate classes
<ben_h> but if what you want is the lines of the file, your best bet is
<ben_h> IO.readlines('textfile.txt') #=> an array of lines
<emergion> classes cannot encapsulate modules
<emergion> they are probably like "packages" in python
<Vulix> so just assign someArray = IO.readlines...
<Vulix> nice
<fruers> emergion: The Thor code looks like the class does encapsulate the module
<Vulix> i do a lot of text mining work, so far Im liking what ruby has for string manipulation and regex
<apeiros_> emergion: yes, classes can namespace
yacks has joined #ruby
<ben_h> Vulix: yep that will do the trick. but it will bloat the ruby process if you read a huge file.
<apeiros_> class X; module Y; end; end # X::Y is the full name of the module
<emergion> never sen that
<apeiros_> a class IS a module, Class < Module
<emergion> I know that
<Vulix> ben_h i assume the better way for big files is to read it line by line and process only what you need?
alanp_ has quit [Ping timeout: 276 seconds]
<ben_h> yep. something like
<Vulix> so avoid IO.readlines?
<emergion> Meaning essentially everything is a module
<fruers> apeiros_: Can you explain the difference between those two projects and when/why I'd choose each pattern?
<apeiros_> fruers: you're looking at the wrong thing ;-)
<ben_h> File.open('textfile.txt') {|f| f.each_line {|l| ... } }
<apeiros_> you don't decide "I namespace using a class" or "I namespace using a module"
<apeiros_> you decide "X must be a class" or "X must be a module". it then "just happens" to also serve as a namespace.
fedza_ has quit [Ping timeout: 248 seconds]
<apeiros_> and whether you use a class or a module depends on how you want to use "X". scroll back, I told you the differences and commonalities of modules and classes
<fruers> Perhaps I should ask why Thor encapsulates everything in the Thor class and Vagrant encapsulates everything in the Vagrant module
* fruers goes back
<emergion> Why would you do that, module inside a class? Maybe if you wanted to call a init method every time you created new class?
<emergion> fruers, that is probably why, is there an initialize method ?
<apeiros_> -_-
<emergion> he wants to setup a bunch of stuff every time a Thor.new happens
<apeiros_> the decision class/module is independent of the namespacing part
<apeiros_> namespacing is not part of the considerations whether Thor should be a class or a module. simply because to the namespacing aspect, it doesn't matter whether it is a class or a module.
<apeiros_> again, looking in the wrong direction.
Hanmac1 is now known as Hanmac
fedza_ has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<fruers> I'm kinda getting it, or at least seeing the differences
<emergion> fruers, have you read this ? http://www.rubycentral.com/pickaxe/classes.html
fedza_ has quit [Client Quit]
<ben_h> fruers: it's not really important; either can be used to wrap things up. if it's just grouping (like Vagrant) then a module makes sense; perhaps the Thor class is something that's instantiated on its own (i've never used thor). but if not, a module would also have worked for Thor.
<emergion> ben_h, that's true
<emergion> From what I have seen that pattern used in Thor is a bit of an exception
<apeiros_> not at all
<apeiros_> there's plenty of code with constants in classes.
<emergion> apeiros_, eh ?
<apeiros_> Foo::Bar is first and foremost a constant
xscc_ has joined #ruby
<apeiros_> iff the code is `class Foo; module Bar`, then it happens to reference a module.
<apeiros_> (well, or `module Foo; module Bar`)
<apeiros_> the common case is `class Foo; Bar = "some value"`
<apeiros_> iow, classes as namespaces are quite widespread.
mlr has joined #ruby
<emergion> I don't recall saying there is never constants in classes ? All I said is I've so rarely seen a module encapsulated in a class I didn't know it was possible or people did it. But I stand corrected on that.
Jeaye has quit [Quit: reboot]
<emergion> I'm not as advanced as some and I would generally use modules for name spacing and to contain a bunch of mixin methods. Happy to find out what else people use them for ;)
PanPan has quit [Remote host closed the connection]
<apeiros_> you're stuck on thinking a module was a special case. it isn't. it's just a constant nested in a class/module.
<emergion> apeiros_, nope I can accept it, just haven't seen a lot of it is all
fixl has joined #ruby
garbagecollectio has quit [Quit: garbagecollectio]
xscc_ has quit [Ping timeout: 252 seconds]
Nisstyre-laptop has quit [Quit: Leaving]
angusiguess has joined #ruby
<danneu> emergion: active record itself is a good example of a monolithic library with classes within modules within classes!
adeponte has quit [Remote host closed the connection]
<danneu> always a fun saturday night clicking around active record source!
<emergion> It looks like a train wreck or something
v0n has joined #ruby
<danneu> interesting didn't know train wrecks looked like pure fun then!
<emergion> haha
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<emergion> Rails...
Jeaye has joined #ruby
<danneu> active record has a lot of nice features. one of my favorites is that it's an ORM but you still type out string queries
<danneu> not many other orms have that feature!
<emergion> danneu, yup I've seen that come in handy before
<danneu> i bet
<emergion> Never looked at the rails source code, I actually never felt really confident enough to dig around source code like that until a little while ago.
cyong has joined #ruby
<danneu> User.where(name: names). wait I need a NOT IN. User.where("names NOT IN ?", names). nice!
<danneu> i love strings!
<danneu> emergion: Yeah, and it's no trivial matter
ben_h has quit [Read error: Connection reset by peer]
octoberry has joined #ruby
<emergion> danneu, what isn't ?
<danneu> emergion: rails source
<apeiros_> File::Constants, IO::WaitReadable, IO::WaitWritable # <- modules nested in classes in ruby core
<apeiros_> ruby -e 'p(ObjectSpace.each_object(Class).select { |c| c.constants(false).any? { |o| c.const_get(o).instance_of?(Module) }}.flat_map { |c| c.constants(false).map { |o| c.const_get(o) }.select { |o| o.instance_of?(Module) && o.name =~ /::/ }})'
<danneu> nothin to trifle about, there
<apeiros_> that's the code I used to find them
dmiller has joined #ruby
<danneu> |o|
flexd has joined #ruby
<emergion> danneu, sure! I actually learned ruby initially from working with rails, I think that was the worst way EVER to learn ruby.
<apeiros_> sad that the =~ /::/ bit is needed
<danneu> emergion: dunno, i learned them concurrently. only thing i remember throwing me off a few times was thinking that some ActiveSupport niceties were part of ruby stdlib
<cmyers> I am confused about how to call methods in other packages. in lib.rb, I have module A; Module B; def some_method ... end; end; end; the in some other file, i require that file, then have def foo; some_method(); end. How do I call some method? A::B::some_method?
<danneu> but other than that, can't say i would recommend against it from my own experience
nat_home has quit [Quit: Leaving.]
<apeiros_> cmyers: you can't directly call methods defined in modules
<cmyers> uh...oh.
<emergion> Fair enough
<apeiros_> if you have `module A; module B; def self.bar; end; end; end`, then it is `A::B.bar`
<danneu> emergion: just sharin. what gave u the most trouble
<apeiros_> but that `self.` part is important
stevechiagozie has quit [Quit: Computer has gone to sleep.]
<emergion> Know when the line was being crossed between what ruby did and what rails did :)
<emergion> *Knowing
<cmyers> apeiros_: I see - I use the methods in some places by including the module, but in this script I don't have an enclosing class to include it. maybe I should just make one
<apeiros_> if you have `module A; module B; def bar; end; end; end`, then you can't call the method on the module directly. you have to either include the module into a class, instantiate that class and call it there, or extend an object with the module
uris has quit [Quit: Leaving]
<Hanmac> apeiros_ you could even do: object.singleton_class::B.bar when you defined the class/module :P
<apeiros_> emergion: I love how rails makes it almost impossible for newbies to understand @ivars, by "magically" passing them around (controllers -> views, e.g.)
dmiller has quit [Ping timeout: 252 seconds]
<emergion> apeiros_, I totally agree with that
<danneu> emergion: ah, i guess i had some trivial background in programming that probably helped
<emergion> It wasn't till I played with Capistrano and Puppet till I started to get it more.
<apeiros_> a lot of the magic which rails uses is unecessary, and unecessary confusing too
<emergion> danneu, I had a whole bunch of self taight Perl Bash and C mess
<emergion> *taught
Nisstyre-laptop has joined #ruby
<emergion> Object orientation was a totally new thing and on top of that all that rails wizardry was confusing, but anyway working out ok now
<danneu> ive had some luck recommending newbies to padrino
<emergion> I know some fairly "proficient" rails programmers that would not be able to right much "Ruby"
<emergion> *write
macmartine has quit [Quit: Computer has gone to sleep.]
<emergion> Ah ok never checked it out
<danneu> emergion: yeah but that's the thing about large frameworks. it's about learning framework idiosyncrasies. average rails developer isn't having to do ruby backflips
Edward_ has quit [Ping timeout: 248 seconds]
<emergion> danneu, yup that's right
<emergion> I think it's also why they abuse things like Active Record
<danneu> what do you mean
ben_h has joined #ruby
ben_h has quit [Client Quit]
<emergion> Ah look, I can just look 5000000 objects and manipulate them, not actually knowing under the hood it might be using a poorly optimised query, because most of the time it just does stuff.
<emergion> and does a good job of it ;)
<apeiros_> it can even be a good query, but deserializing the whole table just to get a couple of records using a bit of ruby code - and then complain because ruby is slow…
nari has quit [Ping timeout: 276 seconds]
<danneu> how poor AR is at query generation is one of my pain points with rails
<emergion> apeiros_, yup
<emergion> Anyway, cheers, learned something new again today :)
<apeiros_> danneu: don't use ORMs to generate complex queries
skcin7 has joined #ruby
<apeiros_> not really an AR issue, ORMs are a leaky abstraction.
<danneu> why
<danneu> query algebra isn't leaky at all
<danneu> it's what sql is
<apeiros_> no, the ORM part is
<emergion> fruers, how's it going over there ?
<apeiros_> objects don't always map that well to rdbms
<danneu> i'm talking about AR being built on top of Arel, yet it's painful to use Arel, and Arel is hardly documented
<apeiros_> yes, that part is sad
<danneu> compare AR to Sequel for instance
<danneu> it's just unfortunate the AR is THE orm
<danneu> that AR*
<danneu> i'm just letting off steam after spending some time today trying to convert large sql strings to AR
<apeiros_> anyway, I've used Sequel too for complex query generation. I won't do it again.
<danneu> it depends what complex is
<apeiros_> I move more stuff to the DB nowadays, using e.g. views
<danneu> yeah, i'd like to learn more about postgres-specific things for example
<apeiros_> that's usually magnitudes less complex than building the query on the ruby side
<danneu> rails doesn't even have a convention for things like foreign keys and constraints
<apeiros_> as said, leaky abstraction :-p
<danneu> yeah but it's not even leaky. it seems like orm failure in that regard.
PanPan has joined #ruby
nidhimj22 has joined #ruby
<fruers> emergion: Good, just heading out... see you at work tomorrow
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<emergion> fruers, cool, have a good one
nidhimj22 has left #ruby [#ruby]
Slivka has joined #ruby
fruers has quit [Quit: leaving]
<Es0teric> question -- so observable makes ruby evented?
mercwith1mouth has quit [Ping timeout: 248 seconds]
mercwithamouth has quit [Ping timeout: 248 seconds]
<Es0teric> the observable library
<danneu> no id say that you can write something in an event-driven way
<emergion> Is it possible to completely destroy a class once it has been instantiated ?
<emergion> Sorry I should say decaled
<emergion> *declared
<apeiros_> emergion: a class is like any other object there
<apeiros_> if there are still references to it, it won't be GCed
<Es0teric> oh, i see danneu
<emergion> Ok cool :)
Vulix has left #ruby [#ruby]
PanPan has quit [Ping timeout: 255 seconds]
xaq has quit [Remote host closed the connection]
<Es0teric> danneu is there anything that makes ruby behave like nodejs? as in recieving information in real time?
<danneu> Es0teric: dunno what your context is but when people speak of evented code they generally are referring to leaning on evented libraries like ruby's eventmachine
<Es0teric> reciving/sending
xaq has joined #ruby
<apeiros_> >> class X; end; x = X.new; Object.send :remove_const, :X; p x.class
<danneu> Es0teric: hell yeah check out Celluloid
<eval-in> apeiros_: Output: "X\n" (http://eval.in/10354)
<Es0teric> danneu that is compatible with rails, right?
xaq has quit [Remote host closed the connection]
<danneu> Es0teric: well, it's a different thing
thufir_ has quit [Quit: Leaving.]
<Es0teric> danneu what do you mean?
<danneu> Es0teric: dunno what you mean by compatible with rails, but your rails app could certainly call out to processes that leverage something like Celluloid
<danneu> Es0teric: for instance http://mperham.github.com/sidekiq/ uses Celluloid.
<danneu> Es0teric: that's message-passing right there you might be interested in
<danneu> lots of Rails apps use Sidekiq for worker processes
<Es0teric> danneu well i am building a booking system
<Es0teric> so i would want all events that users make to notify the people associated with those events in real time
CreativeEmbassy has joined #ruby
<danneu> Es0teric: sure, you could do that with a pub/sub system like Faye
chrishough has quit [Quit: chrishough]
<Es0teric> ah ha danneu so faye does work for this
<Es0teric> ok
<danneu> Es0teric: even a railscast on Rails + Faye http://railscasts.com/episodes/260-messaging-with-faye
<Es0teric> i wouldnt need nginx, right?
mattbl has quit [Quit: This computer has gone to sleep]
atal421 has quit [Quit: atal421]
<danneu> need? i mean you could use rails' dev server if you wanted. not sure what youre askin
Vulix has joined #ruby
Vulix is now known as Vuxil
<Es0teric> danneu well thats irrlevant because i can always switch from nginx to apache
<danneu> right that really has nothin to do with this
sandGorgon has joined #ruby
<Es0teric> danneu good good
benlieb has joined #ruby
mlr has quit [Ping timeout: 252 seconds]
rippa has joined #ruby
<danneu> Es0teric: well im heading home. if youve got any questions, danrodneu@gmail
danneu has quit [Quit: WeeChat 0.3.8]
shadowshell has joined #ruby
budmang has quit [Read error: Connection reset by peer]
ananthakumaran has joined #ruby
timols has quit [Quit: timols]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
budmang has joined #ruby
mattbl has joined #ruby
timols has joined #ruby
dmiller has joined #ruby
mockra has quit [Remote host closed the connection]
zzing has quit [Quit: Computer has gone to sleep.]
relix has joined #ruby
dmiller has quit [Read error: Operation timed out]
V8Energy has quit [Ping timeout: 252 seconds]
Umren has joined #ruby
octoberry has quit [Ping timeout: 248 seconds]
cyong has quit [Quit: Leaving.]
OliverJAsh has joined #ruby
<OliverJAsh> I've got a shell script that is executed via SSH. The trouble is, the SSH script doesn't load my bash_profile, and my script needs access to Ruby gems. I have installed Ruby with RVM.
<OliverJAsh> What's the easiest way of sourcing the binaries I need in the shell script? Do I have to provide the absolute paths to each binary?
rburton- has joined #ruby
adeponte has joined #ruby
shock_one has joined #ruby
<Hanmac> OliverJash you may put the stuff in .bashrc
cyong has joined #ruby
joeycarmello has quit [Remote host closed the connection]
mityaz has joined #ruby
<OliverJAsh> Is .bashrc always loaded when bash loads?
adeponte has quit [Ping timeout: 252 seconds]
<OliverJAsh> Always get confused with bash profile, etc.
Banistergalaxy has quit [Ping timeout: 248 seconds]
agarie has quit [Remote host closed the connection]
PanPan has joined #ruby
<shock_one> OliverJAsh, I think they're just synonyms. But don't use both
icole has quit [Remote host closed the connection]
<Hanmac> i thought that they may react different
icole has joined #ruby
<shock_one> Hanmac, what do you mean?
benlieb has quit [Quit: benlieb]
<Hanmac> i have seen a problem that some file was not loaded when opening an new terminal, or login on one of the 6 console shells ...
<Hanmac> but i dont use rvm so i can not say it
Banistergalaxy has joined #ruby
mockra has joined #ruby
<shock_one> On my mac .bashrc didn't work and on Ubuntu the same with .bash_profile. So, I had to use different names for the same file on this systems (ln to dropbox). But then I opened for myself ZSH and world became a better and brighter place
icole has quit [Ping timeout: 255 seconds]
Ouroboros has left #ruby ["Leaving"]
browndawg has joined #ruby
mockra has quit [Ping timeout: 244 seconds]
crackfu has joined #ruby
PanPan has quit [Remote host closed the connection]
<shock_one> opened for myself → discovered. Don't translate idioms literally, idiot.
halfie has quit [Quit: Changing server]
Mon_Ouie has joined #ruby
stormetrooper has quit [Ping timeout: 260 seconds]
vlad_starkov has joined #ruby
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Remote host closed the connection]
koopa_ has quit [Read error: Operation timed out]
nicoulaj has joined #ruby
OliverJAsh has quit [Quit: OliverJAsh]
danneu has joined #ruby
agarie has joined #ruby
agarie has quit [Remote host closed the connection]
icole has joined #ruby
toekutr has joined #ruby
lkba has quit [Ping timeout: 248 seconds]
Banistergalaxy has quit [Ping timeout: 248 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
Banistergalaxy has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
vierja has quit [Read error: Connection reset by peer]
zzing has joined #ruby
joeycarmello has joined #ruby
Takehiro_ has joined #ruby
pyrac has joined #ruby
angusiguess has quit [Ping timeout: 244 seconds]
stormetrooper has joined #ruby
Takehiro has quit [Ping timeout: 248 seconds]
Konboi has quit [Remote host closed the connection]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
Asher has quit [Quit: Leaving.]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
bluOxigen has joined #ruby
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
Asher has joined #ruby
vierja has joined #ruby
wallerdev has quit [Quit: wallerdev]
ryanf has quit [Quit: leaving]
lkba has joined #ruby
emergion has joined #ruby
qubit has joined #ruby
icole has quit [Remote host closed the connection]
bricker`LA has joined #ruby
Vuxil has left #ruby [#ruby]
pepee has joined #ruby
<pepee> hi. is this for ruby in windows too?
Es0teric has quit [Quit: Computer has gone to sleep.]
icole has joined #ruby
icole has quit [Remote host closed the connection]
<shock_one> pepee, yes
EPIK has quit [Ping timeout: 276 seconds]
toekutr has quit [Read error: Connection reset by peer]
<pepee> hi shock_one
<shock_one> aloha, pepee
matled has joined #ruby
<pepee> well, I recently installed windows on a xp sp3 vm, and I'm getting an error: ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Errno::EMFILE: Too many open files - socket(2) (http://rubygems.org/specs.4.8.gz)
<pepee> dunno what that means, but I can't install gems, or well, do anything with the gem command...
mpfundstein has joined #ruby
decoponio has joined #ruby
<pepee> installer: rubyinstaller-1.8.7-p371.exe
Xeago has quit [Remote host closed the connection]
Takehiro_ has quit [Remote host closed the connection]
DrShoggoth has quit [Quit: Leaving]
Takehiro has joined #ruby
<pepee> also, is there any way to check what in what version of ruby can an script run? (other than running them)
OliverJAsh has joined #ruby
<Hanmac> pepee: you can do ruby -c file ... this checks if the syntax is valid
pdamer has joined #ruby
pdamer has quit [Client Quit]
<pepee> ah, thanks Hanmac
sandGorgon has quit [Ping timeout: 248 seconds]
elkclone has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
<pepee> I guess it has something to do with my system, win xp sp3 "FLP"...
spaceships has quit [Quit: leaving]
rburton- has quit [Quit: Linkinus - http://linkinus.com]
<shock_one> pepee, It sure does. Are you installing gems using bundler or separately?
<pepee> bundler?
<pepee> I'm using the cli
<shock_one> pepee, maybe installing one by one will help.
<pepee> you mean, manually?
<shock_one> gem install rails; gem install paperclip
<pepee> yeah, that's what I'm doing
PanPan has joined #ruby
<pepee> uses bash :(
jgrevich has quit [Quit: jgrevich]
<pepee> I mean, the rvm.io script
<shock_one> pepee, you can find RVM installation instructions for win somewhere else.
<pepee> ok, thanks shock_one
Xeago has joined #ruby
braoru has joined #ruby
cyong has quit [Quit: Leaving.]
mockra has joined #ruby
Xeago has quit [Remote host closed the connection]
timols has quit [Quit: timols]
OliverJAsh has left #ruby [#ruby]
subbyyy has quit [Ping timeout: 256 seconds]
Trudko has joined #ruby
<Trudko> Guys I am confused. I am using rails app and I have simple class and I would like to have class variable -> it is share between all instances and I would like to have default value for it. so i dont have nil exception when i first access it
kja has joined #ruby
<Trudko> Problem is that it is number , i want to set it to 0, so if I can use it in code like this my_object.some_number_attr += 2
ntzrmtthihu777 has joined #ruby
thinkclay has quit [Quit: Leaving.]
<ntzrmtthihu777> quic question, nothing more: in a html webpage you can use javascript; can you do the same with ruby?
bluOxigen has quit [Read error: Connection reset by peer]
mockra has quit [Ping timeout: 256 seconds]
bluOxigen has joined #ruby
yxhuvud has joined #ruby
<Trudko> not in same way
<Trudko> ntzrmtthihu777: ruby could be server side it cant be on front end AFAIK
vikhyat has quit [Remote host closed the connection]
* Hanmac thinks the browser should add something like that .P
<Trudko> javascript is compiled in browsers but browsers does not have support for ruby - they dont have ruby compiler built in
admin0 has joined #ruby
kja is now known as SilverKey
<Trudko> I think having one buil in language which is as good as javascript is good enough :D
<Trudko> btw I found answer to my question I should either doo foo.age = foo.age.to_i + 1 or foo.age = foo.age.to_i.succ
<shock_one> Wow, there is ruby to javascript compiler http://opalrb.org/
<Trudko> hh
<Trudko> but it cant be implemented into browser can it?
<Trudko> it will probably generate js files which you can then included in webpage
<shock_one> No, it's like coffeescript
<Hanmac> Trudko wounld it be cool if brower can do ruby? :D
emergion has joined #ruby
<SilverKey> you can compile anything to js these days. http://github.com/kripken/emscripten
<shock_one> Hanmac, it would be cool it browser can do anything but javascript
<ntzrmtthihu777> Trudko: I'm thinkind a local html application
<Trudko> Hanmac: I am fan of javascript so I dont care :D
<Trudko> btw now thinking about it you could provide ruby syntax in javascript something like cofeescript
pepee_ has joined #ruby
vikhyat has joined #ruby
BrianJ has joined #ruby
pepee has quit [Disconnected by services]
pepee_ is now known as pepee
shock_one has quit [Quit: Ex-Chat]
angusiguess has joined #ruby
SegFaultAX has quit [Quit: ZNC - http://znc.in]
mlr has joined #ruby
relix has quit [Quit: relix]
mpfundstein has quit [Ping timeout: 252 seconds]
himsin has joined #ruby
adambeynon has joined #ruby
bluOxigen has quit [Read error: Connection reset by peer]
mpfundstein has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
bluOxigen has joined #ruby
SegFaultAX has joined #ruby
Jackneill has joined #ruby
angusiguess has quit [Ping timeout: 256 seconds]
<ntzrmtthihu777> anyone?
<Trudko> try to ask in javascript channel
mlr has quit [Ping timeout: 252 seconds]
<Trudko> as i said maybe there is something which compiles ruby to js
<pepee> thank google
<ntzrmtthihu777> no, I think you are all missing my question, lol
<pepee> apparently, there are lots of software that does that, lol
<ntzrmtthihu777> I don't want to use javascript, I want to make a local "website" with ruby code in it, in a manner similar to how javascript is used, not to convert ruby to javascript
<pepee> anyway, I can't run 'gem' in windows. cool... :not (
<pepee> err * not :(
<ntzrmtthihu777> linux +1
<pepee> yeah, but in this case I need it on windows
<ntzrmtthihu777> why, exactly?
mpfundstein has quit [Ping timeout: 252 seconds]
jeffreybaird has quit [Quit: jeffreybaird]
<pepee> I need it for some windows app
<pepee> gonna try installing manually
<pepee> but gem is throwing this error...
<ntzrmtthihu777> what ap? what's it do?
<pepee> an app run tracer
<ntzrmtthihu777> ah, ok. not my area of knowledge, carry on
<ntzrmtthihu777> hmm, eruby seems to be what I need
maxmanders has quit [Ping timeout: 248 seconds]
relix has joined #ruby
PanPan has quit [Ping timeout: 248 seconds]
PanPan has joined #ruby
maxmanders has joined #ruby
nomenkun has joined #ruby
bluOxigen has quit [Read error: Connection reset by peer]
mpfundstein has joined #ruby
beachandbytes has quit []
bluOxigen has joined #ruby
Hecatic has joined #ruby
niklasb has joined #ruby
bluOxigen has quit [Read error: Connection reset by peer]
ntzrmtthihu777 has left #ruby [#ruby]
bradleyprice has quit [Remote host closed the connection]
tchebb has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
tchebb has joined #ruby
hbpoison has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby
shock_one has joined #ruby
marr has joined #ruby
nomenkun has quit [Remote host closed the connection]
<cmyers> I have a complex acyclic directed graph (like software dependencies). I'd like to draw it. Any advice for what a good package is to use in my rails app? There seem to be a lot (https://www.ruby-toolbox.com/categories/graphing )
<Trudko> GUys I have hashmap and I put there object of class Foo and then I want to sort it by integer value age what should I do? this didnt work http://pastie.org/6201830
Elhu has joined #ruby
<shock_one> Trudko, sory_by!
<cmyers> also, I don't think the args are key,value, they are |a, b|, right?
<shock_one> or you can chain each to sort_by
emergion has joined #ruby
<shock_one> cmyers, it doesn't matter how you name them
nari has joined #ruby
<cmyers> right, but if you use them wrong...
adamjleonard has quit [Quit: Leaving...]
<shock_one> cmyers, the first is usually the best (talking about graphing)
<cmyers> shock_one: thanks, I will check it out first
<Trudko> shock_one: so what is the solution?
<Trudko> not sure what chaining of sort by means
seich- has quit [Ping timeout: 245 seconds]
<cmyers> none of these seem to do directed graphs. Seems most are for making charts and bar graphs and stuff =(
crackfu has quit [Remote host closed the connection]
<cmyers> must not be a very common use case
<Trudko> shock_one: but in my case i need to usse the hash map later
<Trudko> so I want to sort it, leave it loike that and then use it
<shock_one> Trudko, updated
kristofers has joined #ruby
seich- has joined #ruby
<Trudko> well i get undefined method sort_by! for hash
<canton7> yeah, hash only has #sort_by
radosch has joined #ruby
<canton7> since the sort family return a 2d array, it doesn't make sense to mutate the original hash into an array
mockra has joined #ruby
<Trudko> so what can I do?
<cmyers> rubyvis seems to do what I need
<Hanmac> Trudko it does not make sense to try to sort an hash ... it is not designed for that
<shock_one> Trudko, use the version without band. Then you can make new hash from that. Hash constructor can take 2d array.
<Trudko> i see so what if I transform hash to array and then I can sort
<Hanmac> do Hash[*yourhash.sort]
elaptics`away is now known as elaptics
<shock_one> Trudko, if you don't need named keys, it'll work.
<Trudko> I dont need them afterwards
<Trudko> after my hash is complete I dont need them
mockra has quit [Read error: Operation timed out]
daniel_- has joined #ruby
hbpoison has joined #ruby
razibog has joined #ruby
<Trudko> ok this worked http://pastie.org/6201899
<Trudko> thing is i need to have hash map first
<Trudko> becaus in my real code, i am doing some computing , my pseudo code did not reflect that properly
timhaines has quit [Quit: timhaines]
pyrac has quit [Quit: pyrac]
workmad3 has quit [Ping timeout: 248 seconds]
<shock_one> Trudko, this should work https://gist.github.com/shockone/f65233f1268bc85e3dce
<Trudko> yeah but i think i can drop hash map because after sorting i dont really need it to be hash
<shock_one> Why do you need it to be a hash before sorting? Because of letters? Try this https://gist.github.com/shockone/f65233f1268bc85e3dce/c9142148289793437040ebc7fe229cbc049d2b7a
SilverKey has quit [Quit: Linkinus - http://linkinus.com]
mengu has joined #ruby
angusiguess has joined #ruby
<shock_one> Actually it was unexpected that there is no sort_by! method for hash.
nari has quit [Ping timeout: 244 seconds]
<shock_one> Should I write a bugreport?
akemrir has joined #ruby
samphippen has joined #ruby
codezombie has quit [Quit: Leaving...]
<canton7> shock_one, I stronly suspect it's for the reason I gave above
<shock_one> canton7, it can return a hash.
<canton7> none (almost none) of Hash's Enumerable functions return hashes, no?
<shock_one> canton7, select does. Why sorting a hash should return an array?
<canton7> plus, having sort_by return an array, but sort_by! give a hash as the result, would be very confusing
<canton7> in ruby 1.8, hashes weren't ordered
<shock_one> what is a problem? It could return another unordered hash
<canton7> then it hasn't done any sorting has it? that would confuse the hell out of people - a sort function that doesn't do anythign
<shock_one> canton7, lol, right.
<canton7> I get where you're coming from - having to wrap by sorts with Hash[] is very annoying
pyrac has joined #ruby
<canton7> s/by/my
<canton7> but I can see why it's so
<canton7> and iirc ruby 2.0 has #to_hash or something similar, which helps a bit
<shock_one> Thank god we don't use 1.8 anymore. Why don't make the behavior in 2.0 unfamiliar, but more logical.
spider-mario has joined #ruby
akemrir has quit [Quit: WeeChat 0.4.0]
<canton7> it's the whole problem of backwards compat I guess
nari has joined #ruby
<cmyers> nice...rgl is what I actually needed: http://rgl.rubyforge.org/rgl/index.html
<cmyers> gem for dealing with graph data, includes (ugly, but functional) visualizations
<shock_one> cmyers, this one looks nicer https://code.google.com/p/ruby-dot-interpreter/wiki/Example1
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
PanPan has quit [Ping timeout: 252 seconds]
PanPan has joined #ruby
apoch632 has quit [Quit: Leaving.]
CraHan|out is now known as CraHan
kristofers has quit []
d3vic3 has joined #ruby
<cmyers> *looks*
nari has quit [Ping timeout: 255 seconds]
d3vic3 has quit [Ping timeout: 256 seconds]
danneu has quit [Quit: WeeChat 0.3.8]
Matip has quit [Read error: Connection reset by peer]
pyrac has quit [Quit: pyrac]
Matip has joined #ruby
d3vic3 has joined #ruby
dmonjo has joined #ruby
Catbuntu has joined #ruby
d3vic3 has quit [Client Quit]
workmad3 has joined #ruby
nomenkun has joined #ruby
SegFaultAX has quit [Quit: ZNC - http://znc.in]
dusag has joined #ruby
<dusag> what is the advantage of ruby over python?
<dusag> which one is simpler?
<cmyers> python makes me want to stab myself in the face
<cmyers> ruby programers make me want to stab myself in the face - but not hte language itself =)
d3vic3 has joined #ruby
ahokaomaeha has joined #ruby
francisfish has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
<dusag> is this true?
<cmyers> (more usefully - python only allows 4-space indents, and is white-space sensitive, which is a sin uncomparable among sins programming languages can make)
nomenkun has quit [Ping timeout: 248 seconds]
mockra has joined #ruby
<cmyers> dusag: the documentation is versioned, but it is shitty and hard to find... a few other things on that list I wouldn't call bad
<cmyers> but generally, I agree with most things on it
<dusag> cmyers: so python wins?
<dusag> whatis the advantage of ruby over python
emergion has quit [Quit: Computer has gone to sleep.]
<cmyers> fuck no
<cmyers> every language has bad things
<cmyers> see python in that same list?
pskosinski has joined #ruby
<Hanmac> dusag: this page sucks because: "Redundant operators: ||/or, &&/and, !/not. " this is not true, they react totaly different
<cmyers> I don't understand why the first, second, third, and fourth thing in the python list isn't "whitespace sensitive what the frucking fuck motherfuckers??????"
answer_42 has joined #ruby
<canton7> and it's a bad idea to interchange them
xardas has joined #ruby
<canton7> foo = bar and baz is utterly different to foo = bar && baz
<cmyers> dusag: suffice to say, anyone who asks "which is better, X or Y" is obviously a novice. The real unbiased answer is always "it depends on what you are trying to do"
<Hanmac> " Standard containers (Array, Hash) have a very big interfaces that make them hard to emulate. " thats wrong too, the most of the stuff cames from the Enumerable module
<cmyers> also, everything is easy to emulate in ruby, it's simple duck typing.
noxoc has joined #ruby
colonolGron has joined #ruby
<cmyers> the only language I would literally never defend in any situation ever, no matter what, and I am absolutely positive should die in a fire immediately and with extreme prejudice, is php.
workmad3 has quit [Ping timeout: 276 seconds]
TheFuzzball has joined #ruby
niklasb has quit [Ping timeout: 252 seconds]
PanPan has quit [Remote host closed the connection]
lkba has quit [Read error: Connection reset by peer]
mockra has quit [Ping timeout: 252 seconds]
pepee has quit [Quit: goto Quit;]
staafl has joined #ruby
blacktulip has joined #ruby
Dwarf has quit [Ping timeout: 256 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
companion has quit [Ping timeout: 246 seconds]
<dusag> they say hackers use ruby a lot right
<dusag> with metasploit and stuff
ferdev|away is now known as ferdev
<dusag> its the hackers language
companion has joined #ruby
<cmyers> a real hacker uses the best tool for the job. it isn't always the same tool.
Xeago has joined #ruby
<Xeago> shock_one: Indeed, setting the sticky bit — If you didn't receive the memo.
_bart has joined #ruby
m8 has joined #ruby
<shock_one> Xeago, no I didn't.
<Xeago> You are shock_one at nickserv right?
<shock_one> Xeago, yes.
<Xeago> never used MemoServ before, but that is how I send it
<Xeago> 4115 Xeago: SEND shock_one Indeed, setting the sticky bit.
<Xeago> 4116 MemoServ: The memo has been successfully sent to shock_one.
<Xeago> that was last night after you timed out
Hecatic has quit [Quit: Àá¼ö]
<shock_one> Xeago, I still didn't get it. So, this sticky bit should set the user or anyone from the group?
himsin has quit [Quit: Leaving]
<postmodern> dusag, "hackers" who use metasploit don't really use Ruby, they just use metasploit's console or GUI
companion has quit [Ping timeout: 248 seconds]
<postmodern> dusag, if you want to use Ruby for writing exploits or automating tasks, might checkout Ronin: http://ronin-ruby.github.com/
niklasb has joined #ruby
himsin has joined #ruby
d3vic3 has quit [Ping timeout: 264 seconds]
companion has joined #ruby
<shock_one> Xeago, If I understand correctly, The owner sets default permissions using setfacl -d -m g::rw. So, if you're group, you can't change anything.
staafl has quit [Quit: Leaving]
Elhu has joined #ruby
Umren|2 has joined #ruby
<shock_one> Xeago, I have two questions — why two colons and why do I need to set this sticky bit?
hbpoison has quit [Ping timeout: 252 seconds]
Umren has quit [Ping timeout: 264 seconds]
backjlack has joined #ruby
senayar has joined #ruby
<Xeago> shock_one: I haven't done more than obtain that information
<Xeago> haven't tried applying the fix
<Xeago> shock_one: to all your other questions, no idea
jean-louis has joined #ruby
kraljev has joined #ruby
senayar has quit [Remote host closed the connection]
<kraljev> Is anyone familiar with HAML?
<kraljev> how to set :ugly option?
<kraljev> code:
<kraljev> Haml::Engine.new(File.read(fileName)).render binding
Catbuntu has quit [Quit: <Bradford> ILVerano: acabo de instalar algunso temas nuevo para mi windows7 (------------8 <-- AHAHAHAHAHHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAH ROFLMAO]
<kraljev> tried googling, nothing
<shock_one> kraljev, rails?
<kraljev> no, ruby
<kraljev> simple line of code:
<kraljev> Haml::Engine.new(File.read(fileName)).render binding
pac1 has joined #ruby
<kraljev> tried this:
<kraljev> temp = Haml::Engine.new(File.read(fileName))
senayar has joined #ruby
<kraljev> Haml::Template.options[:ugly] = true
<kraljev> temp.render binding
<shock_one> Haml::Template::options[:ugly] = true
<shock_one> oops, you don't have template, do you?
dusag has quit [Quit: Page closed]
Jackneill has quit [Read error: Operation timed out]
<kraljev> I did include this: require 'haml/template/options'
<apeiros_> kraljev: Haml::Engine.new("!!!\n%html\n %body\n %h1 Foo!", ugly: true).render
<kraljev> lemme try that :)
<kraljev> apeiros, thanks! :)
<kraljev> i have been trying for 2 hours, so i decided to ask on irc
Catbuntu has joined #ruby
admin0 has quit [Quit: admin0]
<Xeago> kraljev: sometimes it is easier to look up the source of the method
<Xeago> then to search for an answer
eka has joined #ruby
<apeiros_> actually the options param of Haml::Engine#initialize is documented
<apeiros_> well, at least its presence
<Xeago> pry makes this easy, you would have seen something like this: def initialize(inputstring, options)
<kraljev> hm, thanks
<kraljev> however
<kraljev> When I set :ugly to true, rendering time fell from 73ms to 54ms
<kraljev> that is still too slow
<apeiros_> kraljev: *render* time or full time?
<kraljev> just render
<apeiros_> hm, that's indeed slow
<kraljev> i was thinking maybe haml could be preprocessed to IRB
<apeiros_> well, depending on how big your template is
<kraljev> 300 lines
<apeiros_> and/or what it contains
<apeiros_> I'd profile
<apeiros_> it might be the code in the template which is slow, not haml
<kraljev> just prints of object variables
<apeiros_> the render of that primitive template above is 0.1ms
zorbyte has joined #ruby
admin0 has joined #ruby
<kraljev> so, haml is indeed ment to be run in production? over and over again, on each request?
samphippen has quit [Quit: Computer has gone to sleep.]
v0n has quit [Ping timeout: 256 seconds]
<kraljev> The request generation, including database query is 6ms
<kraljev> then haml adds additional 54ms
<kraljev> even if i strip all dynamic code from template
backjlack has quit [Remote host closed the connection]
<kraljev> also, I am sorry to having been asking this here, but #haml is inactive
cableray has quit [Quit: cableray]
<apeiros_> well, there is Haml::Engine#precompiled
<apeiros_> hm, no
<apeiros_> Haml::Engine#render uses precompiled
hbpoison has joined #ruby
<apeiros_> so yes, the #render part is meant to be run every time. of course if you know it'll always be the same, you can cache its output
<kraljev> I have been thinking... IRB needs no preprocessing, it is the most simple thing
<apeiros_> or even better - you can just send a 304 not modified
<kraljev> and every haml template should be able to be converted to IRB
mockra has joined #ruby
<apeiros_> IRB?
<apeiros_> do you mean ERB?
<kraljev> ERB :)
<kraljev> apeiros, if the content weren't dynamic, then i'd just cache HAML output
Dwarf has joined #ruby
<apeiros_> I don't see how ERB does not need preprocessing…
<apeiros_> of course ERB must be parsed first too
emergion has joined #ruby
<apeiros_> and ERB is an eval expression in the end too
pavilionXP has quit [Read error: Connection reset by peer]
<kraljev> yes, sure, I mean not as heavy one
<apeiros_> but if you think it's faster, then convert it and bench?
<kraljev> that could be done, thx
browndawg has quit [Ping timeout: 245 seconds]
fixl has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
backjlack has joined #ruby
monkegjinni has joined #ruby
mockra has quit [Ping timeout: 244 seconds]
Chinorro has quit [Remote host closed the connection]
<kraljev> ERB took 11.5ms
<kraljev> completely equivalent output
hbpoison has quit [Ping timeout: 256 seconds]
pyrac has joined #ruby
<e-dard> While the topic of discussion is on caching templates output for static pages. What are the typical approaches here? Something inbuilt in framework, Redis, Memcached? Or Varnish on web-server?
samphippen has joined #ruby
<kraljev> Currently, I am using a "global" ruby variable for that
<kraljev> this way, there is no connection overhead
<e-dard> kraljev: so you're checking for a key in a hash of strings or something before calling tempting engine?
wereHamster has quit [Changing host]
wereHamster has joined #ruby
<kraljev> yes, or any other resource for that matter
<apeiros_> kraljev: that surprises me. good to know.
<kraljev> you get rid of all connection overheeads
<kraljev> but downside - it is not scallable
<e-dard> kraljev: one issue with that I guess is if you (say) modify a blog post later on - expiring the cache
<kraljev> multiple servers, etc...
browndawg has joined #ruby
<apeiros_> hm? local caching scales well
<kraljev> then one of the requests has to delete the key
<apeiros_> caching's N is the amount of data to cache, not amount of requests
<kraljev> that means your cache is in fact part of memory for ruby process
<e-dard> yeah that makes sense. My use-case is different (file-based pages maintained via git). I think i will make a post-receive hook maybe to release associated post from cache :)
<kraljev> if you have multiple servers, then you have to use connection-based solution, like memcached
<apeiros_> kraljev: I disagree
<kraljev> feel free to say why you disagree :(
<kraljev> :)
<apeiros_> as said, caching's scaling factor is the amount of data to cache. and usually that's connected to the app, not to the requests.
Asher has quit [Quit: Leaving.]
<kraljev> e-dard, my solution example
dangerousdave has joined #ruby
<kraljev> @shared is a class variable, that is preserved across RACK requests
beiter has joined #ruby
Guest87249 has quit [Ping timeout: 245 seconds]
<apeiros_> kraljev: require './sfw.rb' should be equivalent to require 'sfw'
<apeiros_> (requiring is always relative to $LOAD_PATH dirs)
<shock_one> to require the file from the current dir user require_relative 'sfw'
<shock_one> s/user/use/
F1skr has joined #ruby
Virunga has joined #ruby
Asher has joined #ruby
<kraljev> thanks!
<kraljev> And if someone knows why haml (with :ugly = true) takes 54ms and equivalent ERB just 11ms, please tell :)
jetblack has quit [Ping timeout: 244 seconds]
<shock_one> kraljev, because it has to substitute more strings, I believe
<kraljev> despite i like HAML so much, I'm going to use ERB, i guess
<kraljev> It would be nice if HAML had an option to compile to ERB
<kraljev> s/compile/precompile/
jetblack has joined #ruby
hbpoison has joined #ruby
<apeiros_> well, it precompiles to plain ruby code
<apeiros_> so the generated code isn't good
chico_chicote has joined #ruby
admin0 has quit [Quit: admin0]
<shock_one> apeiros_, So does ERB, right?
PanPan has joined #ruby
ferdev is now known as ferdev|away
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
undersc0re97 has joined #ruby
<apeiros_> shock_one: yes
Inoperable is now known as zz_Inoperable
<apeiros_> which is why my conclusion is that ERB's generated code is better than HAML's
<apeiros_> I might take a look when I'm at work tomorrow. I'm curious now.
khismetix has joined #ruby
<kraljev> yes, sure, eventually, they are both eval'd
<shock_one> apeiros_, and it does it only once and then just pass the variables to precompiled code?
<kraljev> but you could say that ERB is the simplest preprocessor possible
BrianJ has quit [Quit: Computer has gone to sleep.]
<apeiros_> shock_one: yes
<apeiros_> kraljev: but preprocessing does not matter
<apeiros_> that's a one-off
<shock_one> kraljev, how many times have you run the test?
<apeiros_> kraljev: that's why I asked whether you meant full time or only #render
<kraljev> 100 times
<apeiros_> and at #render time, preprocessing is already over
dangerousdave has quit [Quit: Leaving...]
<shock_one> I don't believe the haml code is so bad that it's 4 times slower.
admin0 has joined #ruby
<apeiros_> that's why I'm surprised
<apeiros_> the precompiled ruby code should not be that much worse
idkazuma has quit [Remote host closed the connection]
<kraljev> here you have both .erb and .haml file
<shock_one> kraljev, how do you know that ugly mode works?
johnmilton has quit [Quit: Leaving]
<kraljev> see source
<apeiros_> that one takes 50ms? o0
<kraljev> just for .ERB, I switched it off
dangerousdave has joined #ruby
<kraljev> so i could make erb template
<apeiros_> kraljev: anyway, more interested in the output of Haml::Engine#precompiled
<apeiros_> and don't know the corresponding ERB method
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lkba has joined #ruby
<kraljev> 50ms, also my computer is not the fastest
Jackneill has joined #ruby
ahokaomaeha has joined #ruby
xardas has quit [Ping timeout: 245 seconds]
cisco has joined #ruby
Morrolan has quit [Ping timeout: 264 seconds]
Virunga has quit [Remote host closed the connection]
cisco1 has joined #ruby
Dwarf has quit [Ping timeout: 264 seconds]
codecop has joined #ruby
<shock_one> According to this gem, it works slower, but only a little https://github.com/klaustopher/hamlerbslim
ferdev|away is now known as ferdev
cisco has quit [Ping timeout: 240 seconds]
pandawarrior has joined #ruby
Al__ has joined #ruby
sayan has joined #ruby
Mchl has quit [Ping timeout: 252 seconds]
mengu has quit [Quit: This computer has gone to sleep]
walterheck has joined #ruby
Mo0O has joined #ruby
<Mo0O> hi
<walterheck> hi, I'm seeign the following error: https://gist.github.com/walterheck/4971387 Can anyone help me? Google returns 0 results
<Mo0O> my ruby is 1.9.2 and my gem is 1.8.25, is it normal ?
<shock_one> walterheck, make sure you don't have rack in Gemfile twice
<apeiros_> walterheck: according to your error, you're not using your 1.9.2 ruby
<apeiros_> "from /usr/lib/ruby/1.8/rubygems.rb"
<apeiros_> see that 1.8 in the path?
<apeiros_> not ruby 1.9
<apeiros_> also, 1.9.2 is somewhat dated, I'd upgrade to 1.9.3
wf2f has quit []
<walterheck> @shock_one it's not even in my gemfile once (total n00b, following http://ruby.railstutorial.org/chapters/static-pages#top)
Morrolan has joined #ruby
<walterheck> my development environmetn is a squeeze vm, it comes with 1.8 by default
<apeiros_> oh you and Mo0O interleaved
<apeiros_> Mo0O: yes, gem version is independent from ruby
<walterheck> hehe :)
<apeiros_> Mo0O: irb is even 0.9.whatever
emergion has quit [Quit: Computer has gone to sleep.]
<Mo0O> apeiros_: thanks, what a good news :)
ahokaomaeha has quit [Ping timeout: 255 seconds]
<shock_one> apeiros_, haml works even faster on my pc.
<apeiros_> shock_one: curious… maybe he has a pathological case?
francisfish has quit [Remote host closed the connection]
<shock_one> apeiros_, Maybe, but I rather believe he's doing something wrong.
<kraljev> hm, where is haml storing precompiled files
khismetix has quit [Quit: Computer has gone to sleep.]
sayan has quit [Read error: Connection reset by peer]
<kraljev> maybe i don't have a writable directory?
<shock_one> kraljev, If I was haml, I would store them in memory.
<apeiros_> kraljev: it doesn't store any files
<apeiros_> neither does erb
<apeiros_> Haml::Engine#precompiled, and that stores it in @precompiled
mockra has joined #ruby
<kraljev> oh, and my @precompiled is per request
<kraljev> so that'd mean it compiles it on every request?
hashmal has joined #ruby
<apeiros_> aaaand we're back at "do you mean *full time* or just *#render*?"
<kraljev> i'll move it to the global scope
<kraljev> and see :)
<apeiros_> you do the Haml::Engine.new(blabla) stuff *once*, store that in a variable
<apeiros_> and then only do #render per request
<apeiros_> of course if you parse the template on every request, ERB *will* be faster.
<apeiros_> because of course HAMLs parser is quite a bit more complex than ERBs
robustus has quit [Ping timeout: 255 seconds]
<kraljev> and thanks, haml is now 9ms, erb is 6ms
<shock_one> (:
<kraljev> I would never have imagined
<kraljev> so it was me, doing something wrong after all :)
robustus has joined #ruby
<shock_one> Human factor...
<kraljev> :)
mockra has quit [Ping timeout: 248 seconds]
<kraljev> and ERB isn't doing anything similar?
<apeiros_> kraljev: …
<apeiros_> I was asking that question like 3 times… for a reason, yknow? :-p
<apeiros_> ERB does it exactly the same way.
<apeiros_> ERB.new parses the template, .result evals it
abdulqabiz has joined #ruby
idkazuma has joined #ruby
<kraljev> i didn't even imagine things would work like this, so i didn't understand your question in a right way, sorry
<apeiros_> Haml::Engine.new parses the template, .render evals it
Hanmac has quit [Quit: Leaving.]
<kraljev> one clueless haml man less walking on earth, i guess :)
<apeiros_> and yes, of course, ERB.new is much less complex than Haml::Engine.new
Hanmac has joined #ruby
<shock_one> apeiros_, about 4 times, I would say.
<apeiros_> yeah, didn't think "do you only do #render in the loop" was misunderstandeable, but well :)
<apeiros_> (k, didn't ask that verbatim)
cisco has joined #ruby
Matip has quit [Quit: Leaving]
idkazuma has quit [Ping timeout: 245 seconds]
cisco1 has quit [Ping timeout: 255 seconds]
<walterheck> apeiros_ / shock_one seems like upgrading to ruby 1.9.2 didn't help much: https://gist.github.com/walterheck/4971456
<shock_one> walterheck, did you do «bundle»?
abdulqabiz has quit [Quit: abdulqabiz]
<apeiros_> walterheck: ah, I said what I said because I thought you said your ruby version was 1.9, while the error said it was 1.8. but then I noticed that it was Mo0O asking something entirely unrelated, and it was him who said he was using 1.9
<apeiros_> walterheck: what does `rails -v` say?
<walterheck> apeiros_: oh right, haha. Well, i'm now on 1.9.2 either way :)
<apeiros_> walterheck: well, if you upgraded, you should have gone for 1.9.3 :-p
cisco has quit [Client Quit]
<walterheck> apeiros_: see my previous gist
<walterheck> 1.9.2 is what comes with squeeze
<apeiros_> walterheck: d'oh, rails -v errors already
<walterheck> yeah, something is messed up
<apeiros_> but it seems to be rails 3.2.12
<apeiros_> which should run Bundler.setup on its own when/if a Gemfile is present
<apeiros_> walterheck: try upgrading rubygems
<apeiros_> 1.3.7 isn't exactly fresh
<walterheck> it's weird though, it says can't actiavte rack ~> 1.4.5 for railties, already activated 1.5.2 for railties
<apeiros_> gem upgrade --system
<apeiros_> hm, upgrading rubygems won't solve that
<apeiros_> seems actionpack and rack-ssl want different rack versions
<shock_one> rack-ssl has rack (>= 0) as dep, so it shouldn't be a problem
<walterheck> we're going downhill it seems: https://gist.github.com/walterheck/4971480
<apeiros_> ah debian
<shock_one> walterheck, it's always worse before it becomes better.
<walterheck> probably should have listened to that warning at the top :)
<walterheck> shock_one: yeah, I just hate being out of my depth :S
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
<shock_one> walterheck, what if you remove rack and install version 1.4.5
himsin has quit [Remote host closed the connection]
x0F_ is now known as x0F
<walterheck> gem list was empty after that rubygems update, so i'm just running `gem install rails` again, let's see what happens :)
Kuifje has joined #ruby
Kuifje has quit [Changing host]
Kuifje has joined #ruby
lazee has joined #ruby
lazee has quit [Client Quit]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<walterheck> hooray: root@megatron-dev:/var/www/megatron# rails -v
<walterheck> Rails 3.2.12
RurouniJones has joined #ruby
browndawg has quit [Read error: Connection reset by peer]
cisco has joined #ruby
<apeiros_> debian…
* apeiros_ leaves it at that
user666 has joined #ruby
<user666> Hello folks
therod has joined #ruby
cisco1 has joined #ruby
cisco1 has quit [Read error: Connection reset by peer]
cisco2 has joined #ruby
<user666> I'm getting an error installing the ncurses gem, I'm guessing I need ncurses-dev?
<apeiros_> hard to tell from "an error"
cisco has quit [Read error: Connection reset by peer]
<user666> Right
<user666> Hold on mate
Elhu has quit [Quit: Computer has gone to sleep.]
<apeiros_> but quite possible
<_bart> For the first version of a gem, should I use 0.1 or 1.0
<apeiros_> _bart: there are no rules.
<user666> checking for unistd.h... yes
<user666> checking for ncurses.h... no
<user666> checking for curses.h... no
<user666> checking for ncurses/curses.h... no
<user666> I'm pretty sure now
<apeiros_> 0.1 implies to me that "not there yet"
<shock_one> _bart, http://semver.org/
<user666> However, it seems there is no ncurses-dev package
<apeiros_> i.e., that you've not yet stabilized on the API
<apeiros_> user666: may be just ncurses
<user666> ncurses-base I presume
<apeiros_> no idea how your distro names its packages
<walterheck> apeiros_: of course that wasn't the end of it. Now my rails app has rails 2.3.5 in configuration.rb, can I blindly update that to 3.2.12 and hope it all works? Seems unlikely :)
<zorbyte> user666: libncurses-dev ?
<apeiros_> walterheck: absolutely not
<user666> zorbyte, probably yea
Elhu has joined #ruby
<apeiros_> walterheck: rails 2.3 -> 3.2 is quite an upgrade, many things changed. depending on the size of your app, you have a couple of days of work ahead of you upgrading it to 3.2…
Dwarf has joined #ruby
<apeiros_> there are a couple of guides on how to properly migrate a rails app
<user666> Might as well install libncurses-ruby1.9.1
<apeiros_> there even is a gem
<walterheck> pff, considering I was following a tutorial and I was on chapter 3 I'll just redo what I did so far ;)
<apeiros_> ah, in that case - yes
<apeiros_> but if your tutorial is for rails 2.3, you can can it
Elhu has quit [Client Quit]
<walterheck> so, 2 hours of versioning mess and I'm back to scratch. Not super-excited here :)
<shock_one> apeiros_, can can? Seems like a gem.
<walterheck> seems like a decent tutorial so far
<apeiros_> can trash
dmonjo has quit [Remote host closed the connection]
<user666> Alright a new error: http://pastebin.com/hPAqR9t5
skattyadz has joined #ruby
<user666> Might as well install libncurses-ruby
apoch632 has joined #ruby
<user666> Instead of the gem
Al__ has quit [Quit: Al__]
angusiguess has quit [Ping timeout: 248 seconds]
<shock_one> walterheck, Michael uses the latest version in this tutorial https://dl.dropbox.com/u/608214/scrn/1361108297.png
<_bart> shock_one: ah good one, thanks. The gem is production ready, so that's a 1.0
<shock_one> _bart, should be 1.0.0
<walterheck> shock_one: yeah, was probably just my ignorance that led me down the 1.8.7 / 2.3.5 path. Debian comes with that, I didn't know :)
<apeiros_> debian (or apt) is the enfant terrible in the ruby community
<apeiros_> I wished they'd to solve to mess they create themselves - maybe that'd change their attitude.
<apeiros_> *have to solve
cousine has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
Dave has joined #ruby
Dave is now known as Guest21629
<shock_one> apeiros_, what OS do you use?
<apeiros_> osx
arya has joined #ruby
<whitequark> apeiros_: packaging gems with native extensions as debs is a good idea
<whitequark> especially given that ruby infrastructure handles that (almost) well
<apeiros_> whitequark: I'd rather not discuss that topic. IMO the whole packaging idea is completely messed up in *nix world.
beilabs has quit [Ping timeout: 260 seconds]
<whitequark> meh
<walterheck> apeiros_: well, I view the rpoblem the other way around as a sysadmin. Why can't these languages not just stick to the rpm/apt paradigms. Managing servers with three different package management systems is a nightmare
postmodern has quit [Quit: Leaving]
<whitequark> walterheck: there is a simple answer: because there is too much OS-specific package managers
<whitequark> not even talking about OSes without one.
<walterheck> but yeah, 20 people = 45 opinions, noone is completely right or wrong :)
<apeiros_> walterheck: because people work around problems. it's not like I was happy with the situation.
<apeiros_> the "language" itself doesn't do anything. there is ruby for apt. there are gems repackaged as apt packages.
<walterheck> whitequark: well, if we look at production environments for ruby on rails specific, i'll bet that 90% is on yum or apt.
<apeiros_> but walterheck, if you wrote a library, would you repackage it for every OS and package manager?
<apeiros_> or by what rationale do you pick some?
<whitequark> walterheck: first, that's already two. second, if you're ignorant about non-rails envs, it doesn't mean that everyone is
tk_ has joined #ruby
<apeiros_> walterheck: 90% of rails dev envs is not apt/yum
<walterheck> whitequark: true and true. As I said, I see the points being made on both sides of the table here, and I'm not sure who is right. I just know I'm sitting on the sysadmin side of the table, and it doesn't look pretty when you run a server with perl, ruby and nodejs apps
<whitequark> bundler would solve the deployment problem, albeit in OS X way, if only it wasn't for native extensions
<apeiros_> go to a railsconf, you'll see like 95% macs there (of course, they might run a debian or whatever, I think it's unlikely that the number is in the high percentages, though)
wmoxam has joined #ruby
<whitequark> apeiros_: the majority of developers don't go to conferences
<whitequark> neither the devs who do a representative slice of the entire population
<whitequark> *neither are
<walterheck> apeiros_: yeah, so then the discussion is more about what is more important: catering to devs or to ops? I personally am a big fan of devops, which is why I'm trying to develop in a system equal to production
<apeiros_> walterheck: there is no one or the other. it's all about communication. the moment it is a versus situation, both lose.
<walterheck> anyway, megatron isn't coming any close to life with this discussion. Thanks for all the help, I imagine I'll be back :)
<apeiros_> and I don't know where the problem lies with apt, but it has been a notoriously bad experience wrt ruby. no idea who is the culprit there.
<whitequark> apeiros_: I've read some communication logs in the debian bug tracker
spider-mario has quit [Remote host closed the connection]
<whitequark> it seems that the packaging was, and still is, done by people who don't understand how is it commonly done in Ruby.
Virunga has joined #ruby
<apeiros_> so communication issues indeed…
<whitequark> also a lot of people hate (literally) them, which creates even more problems.
<whitequark> as in hate mail.
<shock_one> I was removing gstreamer1.0 using apt-get yesterday and it removed like half of my system including, for example, software-center and indicator-date.
<apeiros_> why am I not surprised
<whitequark> shock_one: the question is why were you removing gstreamer
<whitequark> I wouldn't be surprised if removing libc removed your *entire* system.
<shock_one> whitequark, because mplayer don't use it
<whitequark> shock_one: that is not an answer
<whitequark> or, in other words, APT removed half of your system because you told it to do so.
<shock_one> Right. I wanted to reinstall it because it didn't work correctly. In totem I was seeing vertical coloured lines.
arya_ has joined #ruby
<shock_one> whitequark, I had no idea indicator-date depends on gstreamer
jpfuentes2 has joined #ruby
<whitequark> shock_one: AFAIK gtk depends on gstreamer
<whitequark> for various reasons having all to do with debian not being gentoo
<whitequark> or probably s,gtk,gnome,
colonolGron has quit [Quit: leaving]
<whitequark> and for reinstalling, there is `aptitude reinstall X'
<whitequark> it's not like it would help anyway.
arya has quit [Ping timeout: 248 seconds]
beilabs has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
<shock_one> whitequark, I'm not exactly in delight with Ubuntu, but unity is the only DE in linux I can use without shuddering
<Hanmac> shock_one ubuntu has better ones than unity ...
<apeiros_> DE?
<whitequark> apeiros_: desktop environment
<apeiros_> ah
<whitequark> KDE, Gnome, Unity, etc
<apeiros_> thx
<shock_one> I tried Arch with Gnome3 for about a month, but it's so slow. And KDE looks like shit.
khismetix has joined #ruby
zerba has joined #ruby
<whitequark> *whispers* KDE has themes...
<shock_one> whitequark, I'm about to try something new. Do you know any decent themes?
<Hanmac> there are gnome-classic and cinnamon(with ppa) too
<whitequark> shock_one: I'm fine with oxygen-dark
<whitequark> shock_one: http://imgur.com/zV2w5ML
<shock_one> whitequark, this one looks nice? Is there something similar for desktops?
pyrac has quit [Quit: pyrac]
vlad_starkov has joined #ruby
<whitequark> shock_one: well, it's just plasma
nfk has joined #ruby
<whitequark> I can't stand it, actually.
<whitequark> too much glitter and animations.
angusiguess has joined #ruby
<shock_one> whitequark, what's with your tabs?
<whitequark> shock_one: a bug in Sublime Text
<banisterfiend> shock_one: btw, whitequark speaks russian (i think you were asking about russian ruby programmers the other day)
<shock_one> whitequark, действительно?
atmosx has quit [Quit: WeeChat 0.4.0-rc1]
<whitequark> shock_one: I prefer to only use english on the internet, but yes
atmosx has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
mockra has joined #ruby
<shock_one> whitequark, I like your desktop. Is it awesome?
<kraljev> i like it too, just too big font IMO
cisco2 has quit [Quit: Leaving.]
<kraljev> i prefer more working space
<whitequark> shock_one: i3 actually. it's like awesome after I've configured it for a month, but it works properly out of the box
<whitequark> kraljev: that's DPI 170
uris has joined #ruby
<whitequark> Full-HD 13"
kirun has joined #ruby
<kraljev> i get it :)
zorbyte has quit [Quit: Lost terminal]
<whitequark> kraljev: plus I have myopia. so the font is somewhat big even with that in mind, yes.
xemu has joined #ruby
<_bart> Let's say I have this: [ [1, 1], [1, 1], [1, 1, 1] ] and [ [1, 1], [1, 1] ]
<_bart> Now how do I create a method that checks the array for inconsistent child array size?
<_bart> The latter one is correct, the first one is malformed
Agis__ has joined #ruby
<whitequark> _bart: arr.map(&:size).uniq.count == 1
Agis__ has quit [Client Quit]
<_bart> whitequark: that's great, thanks!
<kraljev> omg :) so fast
Xeago has quit [Ping timeout: 256 seconds]
mockra has quit [Ping timeout: 252 seconds]
<apeiros_> 1 week of holidays + 1 open pack of bacon = lots of bacon that needs to be eaten immediately
<apeiros_> awesomo breakfast, here I come :D
pyrac has joined #ruby
<whitequark> apeiros_: I heard it's bad for your heart to eat too much bacon
<whitequark> (which is a pity)
<apeiros_> lots of things are bad
<apeiros_> never stopped me either :)
* whitequark doesn't want to have a heart attack at 45
joofsh has joined #ruby
Xeago has joined #ruby
deodu has joined #ruby
deodu is now known as Agis_
skattyadz has quit [Ping timeout: 244 seconds]
Agis_ is now known as deodu
deodu is now known as artofraw
PanPan has quit [Ping timeout: 276 seconds]
PanPan has joined #ruby
* apeiros_ won't have one
skattyadz has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
skattyadz has quit [Client Quit]
<whitequark> apeiros_: there isn't a lot of reasons to be so sure about your fate
arya has joined #ruby
* apeiros_ doesn't need any :)
<apeiros_> overall, I live pretty healthy
<whitequark> oblivion is bliss :D
<apeiros_> I'm not afraid of getting a heart attack at 45 due to a bit of bacon
<shock_one> whitequark, do you use some script to upload to imgur?
<kraljev> i do too, except I'm smoking
* whitequark was mostly trolling
<whitequark> shock_one: fingers
arya has quit [Client Quit]
<apeiros_> I was rather surprised how well that one week of holidays went
arya has joined #ruby
<apeiros_> I was skiing for a week, and I raced the tracks
<shock_one> Holidays?
<whitequark> apeiros_: hey, why did you have a week of holidays? no country I know of has them officially
<apeiros_> whitequark: switzerland has official school holidays
<apeiros_> but I'm not bound by school holidays anyway ;-)
<whitequark> I would be rather surprised :D
<apeiros_> I have 22 days I can take whenever I want (as long as bigboss agrees)
<apeiros_> I'm also pondering to reduce my work contract to ~92%, and take a full month off each year. no idea whether I get that.
<apeiros_> *I'll
* whitequark has some colleagues working remotely from Thailand
<whitequark> because that's how they roll
<apeiros_> I'd love to do that, but even if was allowed to, I wouldn't
<apeiros_> I'm too easily distracted
<apeiros_> and thailand… full of distractions :D
<whitequark> apeiros_: Earth is full of islands which are boring as fuck
<apeiros_> ok, let me put it differently - it's good if somebody else is working in the same room :)
<whitequark> this is why I'm still in Russia, yeah.
<Hanmac> whitequark: "Universe is full of Planets which are boring as fuck" :P
<whitequark> or else: what's the point of going 10Mm to the south if all you're going to do is stare to the screen
<whitequark> Hanmac: that is indeed very true
<shock_one> whitequark, still saving for a traktor?
arya has quit []
<apeiros_> whitequark: well, living costs in thailand are like *waaay* lower than here, so remote work with the same salary == awesome
<apeiros_> also I'd probably get a massage twice a day
arya has joined #ruby
* atmosx cooking and watching depeche mode documentary
<whitequark> apeiros_: I'm more concerned about outdoor temperature
<whitequark> because COLD AS FUCK and crap all over the roads is very uncool
<apeiros_> oh, just work in an air conditioned room
<apeiros_> ah, in russia you mean?
<whitequark> ... not in Thailand :)
<whitequark> yea
<atmosx> Or work from a Greek island
ananthakumaran has quit [Quit: Leaving.]
<atmosx> Crete for example
<atmosx> When you are working remotely, how do taxes apply?
admin0 has quit [Quit: admin0]
ananthakumaran has joined #ruby
<atmosx> you pay taxes in Thailand or elsewhere?
<apeiros_> good question - no idea
<apeiros_> probably depends on the law of both countries
<whitequark> atmosx: our folks just re-enter thailand every month
<whitequark> you get the idea
<atmosx> ah i see
<atmosx> That would be awesome though, work remotely. I had some friends that worked on github and another almost-famous company… remotely but they can't disclose any info no their contract.
<apeiros_> hm, actually… that 1 month off… I could spend that in any country…
<apeiros_> could combine that with language studies
<atmosx> although they didn't seem to do anything *of outter importance*
<atmosx> apeiros_: you study languages?
<apeiros_> s/study/learning/
jonathanwallace1 has joined #ruby
<apeiros_> I'm trying to pick up languages again, yes. failing at getting my work morale up, though. it's a wonder I'm still following in classes :)
user666 has quit [Quit: dwarf <3]
pskosinski has quit [Quit: Red Eclipse, game of racist admins/devs: http://pawelk.pl/racist-red-eclipse-quin-zeroknight-gingerbear/]
<atmosx> apeiros_: But your swiss so you should speak Italian, English, German and French right? :-P
<apeiros_> atmosx: I do
<banisterfiend> atmosx: you're*
<apeiros_> my french and italian are rather rusty, though
<apeiros_> atmosx: also latin ;-)
* whitequark can listen to german, like, forever. it just sounds good.
Guest21629 has quit [Read error: Connection reset by peer]
<apeiros_> seriously? funny :D
<whitequark> apeiros_: totally
dangerousdave has joined #ruby
khismetix has quit [Quit: Computer has gone to sleep.]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<apeiros_> interesting… I think the only language I found remotely pleasant to listen to was latin.
* whitequark looks at this database where an equivalent period has a length of 1 day, 23:59:59 and 23:59:59.99999.
* whitequark cries.
<whitequark> well, either of those in different rows.
<apeiros_> "but it works!" :)
<whitequark> I want to fucking kill that guy with a spade and then dig him a grave with my bare hands, after working with this codebase for half a year.
zoonfafer has quit [Ping timeout: 248 seconds]
tensil_ has joined #ruby
gyre007 has joined #ruby
tensil has quit [Ping timeout: 248 seconds]
tensil_ is now known as tensil
<kraljev> 0.999(9) == 1
<whitequark> kraljev: this isn't math
<kraljev> sure :)
<kraljev> Does anyone know a good resource on ruby (operator) precendece?
francisfish has joined #ruby
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
<apeiros_> kraljev: zenspiders quickref
ferdev is now known as ferdev|away
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<kraljev> return a ||= function param if condition param
<kraljev> to know in what order are things like this executed
<apeiros_> why assign when you return
<kraljev> well it could be class variable
<kraljev> @a
<apeiros_> that's an instance variable ;-)
<apeiros_> @@cvars are class variables
<kraljev> jaja, thx :)
<kraljev> :)
<kraljev> i was wondering if there is a resource that would explain things like this
<apeiros_> well, as said, zenspiders quickref lists the precedence for each operator
<whitequark> kraljev: return and if are not operators
<apeiros_> and from there on it's puzzling anyway :)
<kraljev> hence I put "operator" in parenths
<apeiros_> quotes ;-)
<apeiros_> sry for being teachy
<kraljev> nop, parenthases
<kraljev> Does anyone know a good resource on ruby (operator) precendece?
francisfish has quit [Read error: Connection reset by peer]
<kraljev> I don't mind
<kraljev> :)
nicoulaj has quit [Read error: Connection reset by peer]
<apeiros_> ah, you switched
<apeiros_> I see
<banisterfiend> whitequark: what about his wife and kids, who will support them
<apeiros_> oooh, haha, haven't visited for years, funny: "NOTE: 1.9 has a horrible extension to allow you to define != and !~. A special place in hell is reserved for you if you define those."
<whitequark> banisterfiend: what
<whitequark> ah, that guy
<apeiros_> life insurance
<whitequark> he's single and a drug addict, which is IMMEDIATELY CLEAR from his code
<apeiros_> :D
<banisterfiend> whitequark: drug addict ==> occasionally smokes weed? :)
F1skr has quit [Quit: WeeChat 0.4.0]
<whitequark> banisterfiend: weed, cocaine, meth... afaik. maybe more
<banisterfiend> krokodil
<apeiros_> weed is bad enough for the brain
<whitequark> apeiros_: weed doesn't do anything irreversible
<sam113101> is it?
<apeiros_> whitequark: yes it does
<apeiros_> it renders your short term memory rather useless
TMM has quit [Quit: Bye]
<whitequark> apeiros_: yea, that effect fades off after a year
<apeiros_> no
<apeiros_> it is reduced
<apeiros_> but not removed
meoblast001 has joined #ruby
nanothief has quit [Ping timeout: 264 seconds]
<whitequark> last time I searched pubmed, the consensus seemed to be that it does. *shrugs* maybe you know better
ferdev|away is now known as ferdev
<apeiros_> I'd love to see how a guy I knew fares
<apeiros_> he smoked ~400$/week of weed
<apeiros_> he had literally no short term memory at all. you could tell him something and he'd not remember it 5min later if his life depended on it
<apeiros_> I have no idea how that guy manages his life
<whitequark> apeiros_: note that while THC itself is, to my knowledge, pretty harmless, byproducts aren't; in particular, heavy metals and remains of pesticides.
miskander has joined #ruby
<apeiros_> whitequark: ah, that may be. I haven't read the full study, only excerpts.
<whitequark> which is why you should only smoke good weed :D
mpfundstein has quit [Remote host closed the connection]
kn330 has quit [Ping timeout: 240 seconds]
<whitequark> banisterfiend: if he did _that_, it'd render him pretty harmless. which at least could save our codebase.
<whitequark> unfortunately he didn't.
solidoodlesuppor has joined #ruby
<kraljev> i doubt pesticides play any role here
spider-mario has joined #ruby
zz_chrismcg is now known as chrismcg
<kraljev> if you see what kind of food we eat
<kraljev> we'd all be brainless up to time
<whitequark> kraljev: it's not good to inhale organosulphur compounds. at any circumstances and any level
miskander has quit [Read error: Connection reset by peer]
miskander has joined #ruby
<kraljev> and tobacco is without it?
mpfundstein has joined #ruby
<apeiros_> tobacco being legal is regulated
<whitequark> eating is one thing; acidic and then basic environment in your digestive tract is kinda hardcore
<apeiros_> that's one of the issues with illegal substances - no regulation, no tests
<whitequark> also what apeiros_ said.
<kraljev> legalize weed! :)
punkrawkR^Home has joined #ruby
hbpoison has quit [Ping timeout: 276 seconds]
io_syl has joined #ruby
<apeiros_> our government started to provide drug tests free of prosecution due to that
enebo has joined #ruby
RurouniJones has quit [Remote host closed the connection]
<whitequark> yeah, it's like needle exchange programs. far easier to make it way more harmless than to deal with results.
<whitequark> and thousands times cheaper
<shock_one> apeiros_, you don't remember whether you did drugs and want to test?
enebo has quit [Client Quit]
<apeiros_> kraljev: It'd probably be better to legalize all drugs and regulate it instead. it's not like prohibition ever managed to limit availability
<apeiros_> shock_one: hu?
<apeiros_> shock_one: no, drug tests, as in, you bring the drugs, they test it and tell you whether it's clean
<whitequark> apeiros_: it did/does limit availability, but at enormous cost
<apeiros_> and they do that under the promise not to legally prosecute you
<kraljev> wow, that is amazing
<apeiros_> it's a cost/benefit thing
<shock_one> apeiros_, can they clean them for me?
<apeiros_> and yes, it's amazing. because it means somebody used rational thinking in government.
<apeiros_> shock_one: no
<apeiros_> they only test
<whitequark> mass spectrometry is cheap nowadays :D
arya has quit [Ping timeout: 248 seconds]
<apeiros_> they do not want to support your drug use. they want to reduce the costs incurred through dirty drugs.
<whitequark> "Somebody in government uses rational thinking. It is not very effective."
<whitequark> or, in this case, it is...
baker_ has joined #ruby
Z_Mass has joined #ruby
sayan has joined #ruby
baker_ has left #ruby [#ruby]
kofno has quit [Remote host closed the connection]
Al__ has joined #ruby
kofno has joined #ruby
mockra has joined #ruby
evenix_ has quit [Read error: Connection reset by peer]
garbagecollectio has joined #ruby
evenix has joined #ruby
ferdev is now known as ferdev|away
<Sp4rKy> :D
kraljev3 has joined #ruby
arya has joined #ruby
ahokaomaeha has joined #ruby
ahokaomaeha is now known as Guest31528
jean-louis has quit [Ping timeout: 252 seconds]
mockra has quit [Ping timeout: 248 seconds]
kraljev has quit [Ping timeout: 276 seconds]
Spooner has joined #ruby
<apeiros_> whitequark: I did a bit of superficial googling. it might be that reversability of the effect depends on the age when you start smoking
kirun has quit [Ping timeout: 245 seconds]
yfeldblum has quit [Ping timeout: 248 seconds]
<artofraw> people using iTerm, do you use tmux with it?
yfeldblum has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
tk_ has quit [Quit: ばいばい]
<whitequark> apeiros_: AIUI, from the biochemistry POV, THC reversibly binds to GABA neurons
<whitequark> so the THC itself simply cannot cause irreversible effects on that level.
<apeiros_> AIUI = as I understand it?
<whitequark> yea
eldariof has joined #ruby
<apeiros_> now I'm curious, I wish I could get my hands at what I read again… :-/
<apeiros_> well, if it's reversible, great. I understood that it would only be partially restored. maybe I misremember.
<whitequark> why would it be used as a medical drug otherwise? note that you don't get to smoke weed; what you inhale is basically vaporized THC--and pretty pure one.
<whitequark> exactly because the harmful part is byproducts of burning tons of unknown (in the case of illegal drugs) substances.
<shock_one> whitequark, how to translate «bored grunt»?
<whitequark> shock_one: slovari.yandex.ru
jrajav has joined #ruby
<shock_one> whitequark, I believe it's some sort of idiom. It can't just mean «похрюкивание от скуки»
<kraljev3> zdolgočasen kmet
fedza has joined #ruby
octoberry has joined #ruby
ferdev|away is now known as ferdev
<whitequark> shock_one: I don't know it any better than you
<shock_one> whitequark, OK, sorry.
ddd has joined #ruby
CreativeEmbassy has joined #ruby
ddd is now known as Guest54235
monkegjinni has quit [Remote host closed the connection]
V8Energy has joined #ruby
bulldog1 has joined #ruby
bulldog1 has left #ruby [#ruby]
<apeiros_> wow, iphone's panorama functionality is amazing
<apeiros_> seamless even for some things which were moving
<whitequark> apeiros_: I guess those things didn't cross the internal photo boundary
<apeiros_> probably
<apeiros_> still amazing
browndawg has joined #ruby
arya has quit [Ping timeout: 248 seconds]
hbpoison has joined #ruby
b1rkh0ff has joined #ruby
xaq has joined #ruby
kn330 has joined #ruby
arya has joined #ruby
Neomex has joined #ruby
AndChat| has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
vierja has quit [Ping timeout: 252 seconds]
banisterfiend has quit [Ping timeout: 255 seconds]
Al__ has quit [Quit: Al__]
<Mo0O> hi, I've an error: bundle: command not found unicorn.
Banistergalaxy has quit [Ping timeout: 248 seconds]
vierja has joined #ruby
baroquebobcat has joined #ruby
vierja has quit [Max SendQ exceeded]
<Mo0O> but I've install it with: gem install unicorn
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
miskander has quit [Quit: miskander]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
maxmanders has joined #ruby
hbpoison has quit [Ping timeout: 256 seconds]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
xaq has quit [Remote host closed the connection]
vierja has joined #ruby
nomenkun has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
pyro111 has joined #ruby
_md has joined #ruby
timonv has joined #ruby
vierja has joined #ruby
sayan has quit [Quit: Leaving]
pavilionXP has joined #ruby
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
SDr has joined #ruby
carloslopes has joined #ruby
Slivka has quit [Ping timeout: 248 seconds]
adambeynon has joined #ruby
visof has joined #ruby
visof has left #ruby [#ruby]
jekotia has joined #ruby
crackfu has joined #ruby
backjlack_ has joined #ruby
pskosinski has joined #ruby
stevechiagozie has joined #ruby
backjlack has quit [Read error: Operation timed out]
zorbyte has joined #ruby
k610 has joined #ruby
miskander has joined #ruby
_nitti has joined #ruby
himsin has joined #ruby
x0F_ has joined #ruby
x0F has quit [Disconnected by services]
vikhyat has quit [Remote host closed the connection]
x0F_ is now known as x0F
mockra has joined #ruby
zz_Inoperable is now known as Inoperable
shock_one has quit [Ping timeout: 252 seconds]
cousine has quit [Ping timeout: 256 seconds]
Edward_ has joined #ruby
banisterfiend has joined #ruby
atmosx has quit [Quit: And so the story goes…]
mattbl has joined #ruby
octoberry has quit [Ping timeout: 248 seconds]
mockra has quit [Ping timeout: 252 seconds]
swex_ has joined #ruby
mattbl has quit [Client Quit]
adeponte has joined #ruby
<_bart> How do I turn [ 1, 1, 1, 1] into [ [ 1, 1], [1, 1] ] by specifying that it should be in parts of 2?
motto has joined #ruby
a_a_g has joined #ruby
<Mon_Ouie> each_slice(2).to_a
<V8Energy> any ideas why using this code to retrieve data from a page that requires authentication, i get authentication error? http://pastebin.com/Ni67QZfb
<V8Energy> it works for me if i user browser to connect with the same credentials
<V8Energy> but in ruby i get: #<Net::HTTPUnauthorized 401 Unauthorized readbody=true>
<_bart> Mon_Ouie: thanks!
miskander has quit [Quit: miskander]
m8 has quit [Ping timeout: 256 seconds]
<Mon_Ouie> V8Energy: I don't really know, but another issue with that code is that the response variable is not defined.
swex has quit [Ping timeout: 256 seconds]
kirun has joined #ruby
yshh has joined #ruby
Neomex has quit [Quit: Neomex]
Z_Mass has quit [Quit: WeeChat 0.4.0]
<V8Energy> my bad, i am missing a line in pastebin
<V8Energy> response = http.request(request)
mattbl has joined #ruby
kraljev3 has left #ruby [#ruby]
pandawarrior has quit [Quit: Leaving.]
vikhyat has joined #ruby
mattbl has quit [Client Quit]
SCommette has joined #ruby
atal421 has joined #ruby
Guest31528 has quit [Ping timeout: 256 seconds]
generalissimo has quit [Ping timeout: 260 seconds]
ndboost has quit [Remote host closed the connection]
<V8Energy> anybody?
braoru has quit [Ping timeout: 260 seconds]
francisfish has joined #ruby
dallasm has joined #ruby
sn0wb1rd has joined #ruby
jpfuentes2 has joined #ruby
dmiller has joined #ruby
hbpoison has joined #ruby
AndChat| has quit [Ping timeout: 240 seconds]
Banistergalaxy has joined #ruby
<V8Energy> :[
sepp2k1 has quit [Remote host closed the connection]
matchaw___ has joined #ruby
<V8Energy> it's really quiet here lol
matchaw has quit [Ping timeout: 248 seconds]
Mon_Ouie has quit [Ping timeout: 276 seconds]
SCommette has quit [Quit: SCommette]
pandawarrior has joined #ruby
browndawg has quit [Quit: Leaving.]
EPIK has joined #ruby
<canton7> sunday - no-one's at work:P
timhaines has joined #ruby
cousine has joined #ruby
tommyvyo has joined #ruby
carloslopes has quit [Remote host closed the connection]
Mchl has joined #ruby
browndawg has joined #ruby
PanPan has quit [Ping timeout: 256 seconds]
a_a_g_0 has joined #ruby
a_a_g has quit [Ping timeout: 248 seconds]
jekotia has quit [Quit: ChatZilla 0.9.90-rdmsoft [XULRunner 18.0.2/20130201065344]]
benlieb has joined #ruby
spychalski has joined #ruby
budmang has quit [Read error: Operation timed out]
cousine_ has joined #ruby
PanPan has joined #ruby
monkegjinni has joined #ruby
spychalski has left #ruby [#ruby]
cousine has quit [Ping timeout: 256 seconds]
tvw has joined #ruby
pavilionXP has quit [Read error: Connection reset by peer]
otherj has joined #ruby
admin0 has joined #ruby
adamjleonard has joined #ruby
<zorbyte> V8Energy: your code works for me (tested on a httpd basic auth)
Pandaen has quit [Read error: Connection reset by peer]
<V8Energy> strange
LouisRoR has joined #ruby
<V8Energy> why doesn't it work for me then?
<zorbyte> no typo in url or login/passwd?
<V8Energy> nope.. i tried over and over with different browsers
<V8Energy> and it is localhost
joofsh has quit [Remote host closed the connection]
dallasm has quit [Remote host closed the connection]
<V8Energy> hmm, when i am trying to open the same page from IE, it tries to open it as a file for some reason
<_bart> How do I load all the pixels of a png in a 2D array using chunky png?
<V8Energy> but it's a json response
pyrac has quit [Quit: pyrac]
<_bart> ah think I got it -.- just file[x, y]
meoblast001 has quit [Remote host closed the connection]
budmang has joined #ruby
dallasm has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
thufir_ has joined #ruby
hbpoison has quit [Ping timeout: 264 seconds]
mockra has joined #ruby
dallasm has quit [Remote host closed the connection]
pskosinski has quit [Quit: silly dwm reexec…]
chrismcg is now known as zz_chrismcg
benlieb has quit [Quit: benlieb]
pskosinski has joined #ruby
beiter has quit [Quit: beiter]
dallasm has joined #ruby
pskosinski has quit [Client Quit]
kofno has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
tvw has quit []
pyro111 has quit [Quit: Leaving]
pskosinski has joined #ruby
backjlack_ has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 244 seconds]
backjlack has joined #ruby
nonchalanto has joined #ruby
<nonchalanto> does anyone know if sidekiq is run per project or if it can be used like a daemon for the entire system (i.e. other ruby projects on the same box)
ferdev is now known as ferdev|away
<apeiros_> I'd suspect that it's a daemon. I'm sure its website tells the full story.
benlieb has joined #ruby
ferdev|away is now known as ferdev
<nonchalanto> https://github.com/mperham/sidekiq is a bit ambiguous
ephemerian has joined #ruby
Banistergalaxy has quit [Ping timeout: 240 seconds]
LouisRoR has quit [Disconnected by services]
n8888 has joined #ruby
<nonchalanto> apeiros_: (i always google before bothering here)
IrishGringo has quit [Quit: ChatZilla 0.9.90 [Firefox 18.0.2/20130201065344]]
<apeiros_> nonchalanto: sadly that's not necessarily the norm ;-)
<nonchalanto> oh dont i know it ;-)
Banistergalaxy has joined #ruby
<nonchalanto> i think my question my be better framed in #RoR because that is the context i am using it in...sorry to bother :-D
<nonchalanto> might*
LouisRoR has joined #ruby
<apeiros_> mhm, or tweet @mperham directly
<apeiros_> he's quite active on twitter
spaceships has joined #ruby
pyrac has joined #ruby
subbyyy has joined #ruby
n8888 has quit [Ping timeout: 248 seconds]
cousine_ has quit [Ping timeout: 256 seconds]
<_bart> I think it's because I'm testing on an image file with charlie sheen in it, I can't think of another explanation
shock_one has joined #ruby
sandGorgon has joined #ruby
<_bart> any idea why image[x, y] is not allowed?
<apeiros_> _bart: you're missing a line from the backtrace I think
<apeiros_> usually it states the class the method is called upon
<_bart> apeiros_: no this is it
<apeiros_> ah, no, it doesn't - bad ruby, bad
joofsh has joined #ruby
<apeiros_> _bart: emit `image.class` prior to that line
LouisRoR has quit [Disconnected by services]
<apeiros_> then check that class' docs
n8888 has joined #ruby
<_bart> good one
<apeiros_> well, should be ChunkyPNG::Image
<apeiros_> given the last part of your code :)
joofsh has quit [Remote host closed the connection]
<_bart> apeiros_: ChunkyPNG::Image
<_bart> Fixnum
emmanuelux has joined #ruby
<_bart> so the very first time it runs properly, the second loop it's a fixnum
<_bart> that's weird
d3vic3 has joined #ruby
<_bart> ah it's not weird, haha
LouisRoR has joined #ruby
<apeiros_> line 15 & 17 ;-)
<_bart> I forgot the [x, y] below on line 15, 17, gah
<_bart> Pff, I feel stupid
joofsh has joined #ruby
<apeiros_> it'd really help if rubys default ArgumentError included the class :(
nicoulaj has joined #ruby
sailias has joined #ruby
n8888 has quit [Ping timeout: 256 seconds]
joofsh has quit [Remote host closed the connection]
sailias has quit [Client Quit]
hbpoison has joined #ruby
<apeiros_> _bart: also take a look at ChunkyPNG::Canvas#pixels + Array#map
timonv has quit [Read error: Connection reset by peer]
timonv_ has joined #ruby
havenwood has joined #ruby
GuidovanPossum has joined #ruby
hbpoison has quit [Ping timeout: 260 seconds]
<apeiros_> _bart: btw., red/green/blue have different intensities on the human eye. if you want to do it well, you should multiply the values accordingly :)
<apeiros_> WOW
<_bart> apeiros_: yes good advice, but this is just for a quick joke
<_bart> :)
<apeiros_> gist editor has collapsable thingies now
caleb_io has joined #ruby
timhaines has quit [Quit: timhaines]
kofno has joined #ruby
syamajala has joined #ruby
kokainepizza has joined #ruby
ToTo has quit [Quit: Leaving...]
a_a_g_0 has quit [Quit: Leaving]
kokainepizza has quit [Client Quit]
a_a_g has joined #ruby
mercwith1mouth has joined #ruby
mercwithamouth has joined #ruby
CreativeEmbassy has joined #ruby
a_a_g1 has joined #ruby
a_a_g has quit [Client Quit]
Xeago has quit [Remote host closed the connection]
Xeago has joined #ruby
<_bart> How do I find the deepness of a multidimensional array in ruby?
decoponio has quit [Ping timeout: 244 seconds]
<Hanmac> _bart i think you cant :P
Xeago has quit [Remote host closed the connection]
<shevy> _bart perhaps try to compare via .flatten
<shevy> would be nice if you could give .flatten an argument
decoponio has joined #ruby
<shevy> oh
<shevy> you actually can
<shevy> _bart, you can try to run several .flatten with different arguments to it
shock_one has quit [Ping timeout: 276 seconds]
matchaw___ has quit [Quit: No Ping reply in 180 seconds.]
matchaw has joined #ruby
syamajala has quit [Quit: leaving]
francisfish has quit [Remote host closed the connection]
mmitchell has joined #ruby
eldariof has quit []
jekotia has joined #ruby
vikhyat has quit [Remote host closed the connection]
generalissimo has joined #ruby
maycon_ has joined #ruby
xardas has joined #ruby
a_a_g1 has quit [Quit: Leaving.]
colonolGron has joined #ruby
yshh has quit [Read error: Connection reset by peer]
maycon has quit [Ping timeout: 245 seconds]
jgrevich has joined #ruby
maycon__ has joined #ruby
KevinSjoberg has joined #ruby
_nitti has quit [Remote host closed the connection]
JohnBat26 has joined #ruby
adeponte has quit [Remote host closed the connection]
timhaines has joined #ruby
whowantstolivef1 has joined #ruby
maycon_ has quit [Ping timeout: 252 seconds]
a_a_g has joined #ruby
a_a_g has quit [Client Quit]
blueOxigen has joined #ruby
atno has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<apeiros_> _bart: by recursion
elaptics is now known as elaptics`away
vikhyat has joined #ruby
<apeiros_> _bart: don't forget to check against circular references
bluOxigen has quit [Ping timeout: 264 seconds]
kofno has quit [Remote host closed the connection]
kofno has joined #ruby
igor_ has quit [Remote host closed the connection]
mockra has joined #ruby
noxoc has quit [Quit: noxoc]
Vuxil has joined #ruby
velCzupa has joined #ruby
shock_one has joined #ruby
velCzupa is now known as czupa
czupa has quit [Quit: Leaving]
mockra has quit [Ping timeout: 252 seconds]
stevechiagozie has quit [Quit: Computer has gone to sleep.]
czupa has joined #ruby
baroquebobcat has joined #ruby
<apeiros_> oh, _bart - completely forgot to save this and link: https://gist.github.com/apeiros/c738c8a91f37adbe7978
arturaz has joined #ruby
Xeago has joined #ruby
maletor has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
maletor has quit [Client Quit]
tjbiddle has joined #ruby
d3vic3 has quit [Quit: leaving]
Xeago has quit [Remote host closed the connection]
browndawg has left #ruby [#ruby]
Bry8Star has quit [Remote host closed the connection]
muminz has quit [Remote host closed the connection]
end_guy has quit [Write error: Broken pipe]
answer_42 has quit [Write error: Connection reset by peer]
DrCode has quit [Write error: Connection reset by peer]
pepee has joined #ruby
<Hanmac> shevy image i would be an architect that build buildings :P
jgrevich_ has joined #ruby
zph has joined #ruby
jgrevich has quit [Ping timeout: 256 seconds]
jgrevich_ is now known as jgrevich
zph has quit [Client Quit]
mmitchell has quit [Remote host closed the connection]
mmitchell has joined #ruby
meoblast001 has joined #ruby
erlingur has joined #ruby
<_bart> apeiros_: ah cool
erlingur has left #ruby [#ruby]
<_bart> apeiros_: it's part of this just for fun project: https://github.com/bartolsthoorn/hopfield-ruby
<_bart> just released it
<pepee> so... I'm tryint to install a gem, and I get this error from the devkit: http://pastebin.com/eJdhR6kV
decoponio has quit [Quit: Leaving...]
Xeago has joined #ruby
<Hanmac> _bart image an array like a=[]; a << a
<pepee> but there is no AutoRun key (there was one, I deleted it), and COMSPEC is: ComSpec=C:\Windows\system32\cmd.exe
<pepee> can anyone help me? please :/
Littlex has joined #ruby
<Littlex> hey, what ide would you recommend for development?
<Xeago> Littlex: ruby.
<_bart> Hanmac: ?
<Xeago> oh misreas
<Xeago> Littlex: any that isn't cumbersome
gyre008 has joined #ruby
<Littlex> ;) yeah but i cant find one that has autocompletion for starters
Nisstyre-laptop has quit [Read error: Connection reset by peer]
<Xeago> vim with plugins
<Xeago> textmate, sublime text
<Xeago> emacs
gyre007 has quit [Ping timeout: 252 seconds]
<zorbyte> ed
<Xeago> might aswell go with sed then
miskander has joined #ruby
timhaines has left #ruby [#ruby]
hbpoison has joined #ruby
beaky has joined #ruby
<beaky> hello
mengu has joined #ruby
<beaky> why is composition better than inheritance?
Xeago has quit [Remote host closed the connection]
zerba has quit [Remote host closed the connection]
james__ has joined #ruby
jwang has quit [Read error: Connection reset by peer]
jwang has joined #ruby
hbpoison has quit [Ping timeout: 248 seconds]
k610 has quit [Quit: Leaving]
<whitequark> beaky: it isn't
rowsdower has joined #ruby
carloslopes has joined #ruby
Xeago has joined #ruby
<Xeago> beaky: has your question been answered?
monkegjinni has quit [Remote host closed the connection]
<beaky> yeah :D
<shock_one> beaky, you can compose from many classes, but inherit only from one, for example
<whitequark> ^ he put "why composition is better than inheritance" in google
s1n4 has joined #ruby
<whitequark> shock_one: not true in ruby
<beaky> well, I guess I want to know when must I use inheritance over composition and vice-versa
<whitequark> mixins are more or less multiple inheritance.
<whitequark> (subverted by the way `super' works, but still)
himsin has quit [Remote host closed the connection]
DrShoggoth has joined #ruby
<beaky> ah
monkegjinni has joined #ruby
kofno has quit [Remote host closed the connection]
<Xeago> whitequark: mixins are not inheritance tho.. similar functionality can be achieved however
<banisterfiend> Xeago: they are inheritance
koopa_ has joined #ruby
<whitequark> Xeago: mixins *are* inheritance
<whitequark> literally
<whitequark> >> Object.ancestors
<eval-in> whitequark: Output: "" (http://eval.in/10402)
<beaky> mixins are like multiple inheritance
<shock_one> beaky, if it's has-a relationship, use composition. If it's is-a — composition
<Xeago> ""
<beaky> ah
<banisterfiend> Xeago: even the ruby implementation will show you, they're implemented nearly exact same way, by changing the super chain
<shock_one> beaky, makes sense?
<whitequark> Xeago: it's "" because eval-in is crap and charliesome doesn't care to fix it :/
Nisstyre-laptop has joined #ruby
<apeiros_> 19:45 shock_one: beaky, if it's has-a relationship, use composition. If it's is-a — composition
<Xeago> whitequark: I know, it was a pun xD
<beaky> well, my main use of inheritance is to do polymorphic behavior
<apeiros_> I assume you meant "if it's is-a - inheritance"
<beaky> but if I use delegates and composition, can't I do the same thing?
<shock_one> apeiros_, right.
james__ has quit [Quit: Textual IRC Client: www.textualapp.com]
<Xeago> beaky: yes, there is no fixed way of doing things
<Hanmac> with ruby2.0 and prepend you can manipulate the ancestor chain even worse :P
jimeh has joined #ruby
<Hanmac> information: the module itself and the module that is included into an class or extended to an Object are two different C structs ...
<whitequark> Hanmac: please, don't overcomplicate this
<beaky> I like the idea of message-passing
<beaky> because the message can be the one that does all the work
<apeiros_> for one way of doing composition in ruby, take a look at Forwardable
<shock_one> Hanmac, where can I find an overview of new ruby 2 features?
<apeiros_> less cumbersome than that C# example on WP IMO
<whitequark> ruby delegation isn't true delegation
<beaky> ah
<beaky> ah thanks
jonathanwallace1 has quit [Ping timeout: 256 seconds]
<beaky> I thought delegation was like having a big object respond to messages by dispatching that message to subordinate object(s)
gyre008 has quit [Remote host closed the connection]
<Hanmac> beaky & whitequark i had wrote an delegator that is totaly hidden, so when you call dele.class it returns the class of the object :P ... but with my delegator you can call to_s!(2) :P
admin0 has quit [Quit: admin0]
workmad3 has joined #ruby
<apeiros_> whitequark: given that ruby is not prototypal, I see no reason why one wouldn't use the term "delegate". terms do mean different things in different contexts.
<whitequark> apeiros_: well, delegation does mean that thing in CS.
<whitequark> what you're thinking about is "indirection".
<beaky> all problems in CS can be solved by applying an extra layer of indirection ^^
punkrawkR^Home has quit [Read error: Connection reset by peer]
<apeiros_> beaky: or xml
<apeiros_> or force
<apeiros_> or a power cycle
<apeiros_> hehe, starts zed style
<Hanmac> shock_one http://globaldev.co.uk/2012/11/ruby-2-0-0-preview-features/ but the list and the samples may be old
<apeiros_> I somehow like it
<whitequark> delegation isn't a form of abstraction as far as I understand it, but it's related nevertheless
arietis has joined #ruby
<shock_one> Hanmac, thank you.
sandGorgon has quit [Ping timeout: 252 seconds]
<apeiros_> well, I'm a fan of proper terminology. so thanks for the hint whitequark
razibog has quit [Quit: Leaving.]
<apeiros_> and the links, oc
<beaky> wow those links cleared up lots for me :D thanks
<pepee> I get these erros when I try to install any gem (for example, gem install rdiscount): ERROR: Could not find a valid gem 'rdiscount' (>= 0) in any repository ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Errno::EMFILE: Too many open files - socket(2) (http://rubygems.org/latest_specs.4.8.gz)
<beaky> didn't know that delegation was really related to prototype OOP
<shock_one> whitequark, navigation on the zedshaw site is mindblowing
<apeiros_> whitequark: but the WP example looks like it was message forwarding too then, not delegation - no?
Takehiro has quit [Remote host closed the connection]
razibog has joined #ruby
razibog1 has joined #ruby
razibog has quit [Client Quit]
carloslopes has quit [Remote host closed the connection]
carloslopes has joined #ruby
<whitequark> apeiros_: WP example?
<apeiros_> the C# code. I never coded C#, so I'm not sure
<whitequark> ah, I skipped it over. any pattern-related example that is longer than 20 LOC is not worth reading.
<apeiros_> but things like `void update() { _u->update(); };` looks like message forwarding to me
<whitequark> yea
<shock_one> apeiros_, does compiler optimize these calls?
<whitequark> shock_one: yes
<whitequark> unless they're both virtual, in which case no
<apeiros_> shock_one: as said, no C# coder here. no idea what the compiler does.
<whitequark> apeiros_: I find the whole delegation<>forwarding part be problematic for languages like Ruby
<whitequark> and Python and JS and etc
<shock_one> apeiros_, is it C#?
garbagecollectio has quit [Quit: garbagecollectio]
<whitequark> it basically means that *all* abstractions cost you something
<apeiros_> shock_one: the article says 'In C#:'
<apeiros_> oooh, the upper one is C++
<whitequark> so it discourages you from using abstractions to write better code, if you need to get good performance out of it
<apeiros_> but not coding that either :)
<whitequark> apeiros_: whereas templates or nonvirtual (inlined) calls in C++ are 'free'
codezombie has joined #ruby
miskander has quit [Quit: miskander]
<apeiros_> I thought message forwarding was indirection, not abstraction ;-)
<apeiros_> but yes
<apeiros_> I know the feeling. and IMO it's one you have to ignore.
<shock_one> whitequark, thank you, I was always afraid that this forwarding reduces my performance.
<apeiros_> ruby *is* slow. you don't use it for its speed.
<whitequark> apeiros_: actually no
<apeiros_> and while you can make ruby code run faster by coding ugly, it's not something one should do IMO.
miskander has joined #ruby
DaltonUS has joined #ruby
<whitequark> if such forwarding is truly used to create an abstraction, chances that the call site is actually monomorphic
dangerousdave has quit [Read error: Connection reset by peer]
Dave has joined #ruby
maxmanders has joined #ruby
<whitequark> and monomorphic (incidentally, also bimorphic) call sites get optimized by jruby pretty nicely.
Dave is now known as Guest96945
joeycarmello has quit [Ping timeout: 256 seconds]
<apeiros_> so the feeling is even misleading then?
<apeiros_> all the more a reason not to give in to it
<whitequark> *shrugs* no
<whitequark> you trade off RAM for perf
pepee has quit [Quit: goto Quit;]
garbagecollectio has joined #ruby
ryanf has joined #ruby
pepee has joined #ruby
<whitequark> this world doesn't need more dynamically typed languages; it needs more dynamic (and easy to use) statically typed ones.
yacks has quit [Quit: Leaving]
<shock_one> whitequark, use Scala, Luke
<whitequark> shock_one: JVM
<whitequark> it's basically a vendor lock-in.
benlieb has quit [Quit: benlieb]
<shock_one> whitequark, do you think they'll close HotSpot?
<whitequark> I don't consider anything intrinsically tied to JVM a language on its own
pskosinski has quit [Read error: Connection reset by peer]
<whitequark> it's a DSL for writing Java bytecode.
<whitequark> shock_one: no
carloslopes has quit [Ping timeout: 248 seconds]
<whitequark> well, yes, but to replace it with Maxine
<apeiros_> how can a language be dynamically statically typed?
<apeiros_> or typo?
atmosx has joined #ruby
wallerdev has joined #ruby
<whitequark> apeiros_: "more dynamic"
<apeiros_> ah
<shock_one> whitequark, actually, one can write Scala compiler for .NET
<whitequark> then go and write one
<shock_one> whitequark, are you going to use it then?
spider-mario has quit [Remote host closed the connection]
<whitequark> while we're at it; .net is indeed a better platform than JVM due to a variety of reasons
<whitequark> mainly value types
_nitti has joined #ruby
<shock_one> whitequark, windows only.
<whitequark> shock_one: not even opening it; .ch domain? research? not interested
kofno has joined #ruby
<whitequark> windows only? discover mono
thinkclay has joined #ruby
<whitequark> the real problem is that it's patented to death
<whitequark> and MS 'promised' not to sue
<whitequark> well, it's the best they can do, since patents cannot be undone
adeponte has joined #ruby
Guest54235 has quit [Read error: Connection reset by peer]
<whitequark> value types and no type erasure, yeah.
workmad3 has quit [Read error: Operation timed out]
grzywacz has joined #ruby
grzywacz has quit [Changing host]
grzywacz has joined #ruby
LouisRoR has quit [Disconnected by services]
n8888 has joined #ruby
<Hanmac> you can break the type of an object ... but this is very black magic code ...
_nitti has quit [Ping timeout: 248 seconds]
atno has quit [Read error: No route to host]
<whitequark> break?
ddd has joined #ruby
ddd is now known as Guest41942
swex has joined #ruby
<Hanmac> whitequark i mean normally an object cant change its type ... with a bit blackest magic its possible
miskander has quit [Quit: miskander]
LouisRoR has joined #ruby
atno has joined #ruby
<whitequark> Hanmac: I'd wish that each time someone 'invents' such 'black magic' one'd be hit with a proverbial ruler over their fingers
<whitequark> or maybe a literal ruler...
adeponte has quit [Ping timeout: 276 seconds]
n8888 has quit [Ping timeout: 252 seconds]
blf has joined #ruby
<V8Energy> I just tried using rest-client gem and I am still getting the same error 401 unauthorized. here is the line i use in IRB: RestClient.get 'http://admin:password@localhost:80/index.html', {:accept => :json}
<V8Energy> I am able to copy the link and paste it into the browser and it works just fine
<V8Energy> http://admin:password@localhost:80/index.html
<whitequark> for some reason people tend to mistake the scope of their language for some artifical restriction, or rather, restraint
<whitequark> and feel they should go and 'break' it
<V8Energy> and just to clear up, the script is located locally. any ideas?
swex_ has quit [Ping timeout: 248 seconds]
<Hanmac> whitequark look at this https://github.com/yugui/evil-ruby/blob/master/lib/evil.rb and whine :P
<whitequark> Hanmac: you wanna what, surprise me?
<whitequark> yeah I know one can hook via ffi to ruby from inside ruby code
<whitequark> you are missing the point completely
LouisRoR has quit [Ping timeout: 244 seconds]
<Hanmac> the reason why someone would write something that can break the "restriction" its because they can :P thats the reason why someone would push red buttons
<whitequark> Hanmac: there is a reason you won't go around and hammer the nails with the side of your hammer, or your bare hands, right?
<whitequark> and if you do, you won't then brag about it
<blf> Do Ruby methods tend toward nesting greater than 3 levels deep? I'm wondering if there is a cleaner way of writing something like this: https://gist.github.com/blfisher/aff289b56c27869deb49
mklappstuhl has quit [Ping timeout: 252 seconds]
thufir_ has quit [Quit: Leaving.]
miskander has joined #ruby
<whitequark> yeah, you can do pointless unexpected. that is not an achievement in engineering.
<whitequark> *pointless unexpected things.
T|ASK has joined #ruby
DaltonUS has quit [Quit: DaltonUS]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
<whitequark> Hanmac: something like this http://bellard.org/dvbt/ is
<apeiros_> blf: I'd start with removing the unecessary code
<whitequark> or even better, http://bellard.org/lte/
<apeiros_> blf: like that `done` variable, which isn't being used
<V8Energy> helllp
kofno has quit [Remote host closed the connection]
<apeiros_> and then you can suddenly use inline ifs, e.g. `next if @queue.empty?`
<blf> apeiros_: Yes, it is being used. Let me fix that. I was changing some things around and forgot about the while true.
kofno has joined #ruby
<apeiros_> and then you can start putting stuff like that in a separate method
<apeiros_> next if done?
<apeiros_> and put all conditions in there
caleb_io has quit [Quit: caleb_io]
<shock_one> blf, you don't use done variable anywhere
<apeiros_> also you can easily decompose more
blueOxigen has quit [Ping timeout: 248 seconds]
<blf> Hm.. I updated the gist. Maybe you need a new link? https://gist.github.com/blfisher/aff289b56c27869deb49
<apeiros_> e.g. @workers << Thread.new { working_loop }
rowsdower has left #ruby ["Konversation terminated!"]
<shock_one> blf, merge two ifs
trent1 has quit [Quit: WeeChat 0.3.2]
chico_chicote has quit [Remote host closed the connection]
<apeiros_> mhm
Takehiro has joined #ruby
<apeiros_> the code has quite enough options for improvements
budmang_ has joined #ruby
<shock_one> blf, if you put job = ... into else clause, you won't need next
pyrac has quit [Quit: pyrac]
budmang has quit [Ping timeout: 255 seconds]
<shock_one> blf, sorry, else clause won't work
<blf> shock_one: I think I'd still need the next. I don't want to short-circuit the processing if I happen to also be running an immediate request.
joeycarmello has joined #ruby
atno has quit [Ping timeout: 255 seconds]
<shock_one> blf, my bad, it's just gist code highlighting isn't good enough.
<blf> shock_one: I was thinking the same thing :)
eka has quit [Quit: Computer has gone to sleep.]
bluOxigen has joined #ruby
kofno has quit [Ping timeout: 256 seconds]
s1n4 has quit [Quit: leaving]
<blf> https://gist.github.com/blfisher/aff289b56c27869deb49 Okay, here is the updated version. So I guess 5 levels of nesting isn't a big deal then?
pskosinski has joined #ruby
miskander has quit [Quit: miskander]
<apeiros_> until done
<apeiros_> no, 5 levels isn't a big deal. but as said, you can easily better decompose the parts.
az7ar has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
Takehiro has quit [Ping timeout: 252 seconds]
joeycarmello has joined #ruby
<blf> apeiros_: Ah, I missed that. So maybe make the synchronization a method of its own.. Things of that nature?
lizzin has joined #ruby
GuidovanPossum has left #ruby [#ruby]
kofno has joined #ruby
<blf> shock_one: I like the job.callback.call(result) if job.has_callback? :)
<V8Energy> argh.. my problem is so strange and I've beeen gooling for hours, can't find any solution
<shock_one> blf, looks like English, doesn't it?
<blf> yes, a little bit :)
davetherat has quit [Read error: Connection reset by peer]
hbpoison has joined #ruby
davetherat has joined #ruby
pyrac has joined #ruby
Slivka has joined #ruby
shevy has quit [Ping timeout: 248 seconds]
mklappstuhl has joined #ruby
ahokaomaeha has joined #ruby
trumpeter2003 has quit [Quit: Leaving]
<az7ar> hi, I was going through camping source code and finding it difficult to understand the Object like hash's implementation >> https://gist.github.com/az7arul/4973012 , can any one explain how the chaining works here ?
mlr has joined #ruby
kofno has quit [Remote host closed the connection]
<whitequark> az7ar: it is not a miracle :D
<whitequark> camping source code is difficult to understand indeed.
<apeiros_> fun, `undef id, type if ?? == 63` - not 1.9 compatible
<apeiros_> ah
<apeiros_> it actually is
<apeiros_> funny abuse of implementation differences…
<blf> shock_one: Ah, much nicer. You removed a layer of nesting :) Thanks indeed. I'm going to play around with it a little more. But again, thanks!
<az7ar> whitequark, I dont understand how m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m.to_s]:super part is working
<shock_one> blf, no problem
<apeiros_> az7ar: if it's a method ending with =, assing
kofno has joined #ruby
<apeiros_> if not, test whether arguments were passed, if not, access hash element
<apeiros_> if there was, call super
<apeiros_> *assign, not assing
miskander has joined #ruby
hbpoison has quit [Ping timeout: 264 seconds]
pothibo has joined #ruby
LouisRoR has joined #ruby
<shock_one> what the heck does the last line mean?
<apeiros_> I typoed
<az7ar> apeiros_, I thanks, got it, I did not see the 'condition ? x : y' pattern
<apeiros_> I wrote assing instead of assign and corrected that
<shock_one> I mean «undef id, type if ?? == 63»
<apeiros_> shock_one: remove id and type if it's ruby 1.8
relix has quit [Quit: relix]
<az7ar> shock_one, me 2
<apeiros_> *remove id and type +method
<az7ar> apeiros_, thanks again
jarjar_prime has quit [Quit: Ready? Set? Go!]
<apeiros_> in 1.9, ?? != 63
<apeiros_> in 1.8, ?? == 63
<apeiros_> ("?".ord == 63)
<whitequark> if you'd only seen the blasphemous depths ruby lexer has to go to correctly parse all the possible meanings of ?...
<shock_one> apeiros_, oh, everybody should know that. Very readable code.
<apeiros_> I don't even want to know :D
<az7ar> apeiros_, should I try any other frameworks source code to learn instead of camping ?
mattbl has joined #ruby
<apeiros_> shock_one: camping isn't supposed to be readable
<apeiros_> it's supposed to be <4k
<whitequark> it still gives me nightmares, even months after
<apeiros_> anybody using it as role model code should be flayed :-p
<apeiros_> (except for golfed code)
<apeiros_> whitequark: see, that's why I don't even want to know :D
mmitchell has quit [Remote host closed the connection]
atno has joined #ruby
marcopod has joined #ruby
cisco has joined #ruby
cisco has left #ruby [#ruby]
<whitequark> apeiros_: consider that ? (QUESTION MARK, SPACE) and a ?b:c (LATIN LETTER A, SPACE, QUESTION MARK, LATIN LETTER B, SPACE, COLON, LATIN LETTER C)
jarjar_prime has joined #ruby
<whitequark> are separate and valid occurences
<apeiros_> I said I don't wanna know!!!!! AAAAAAAAAAH
* apeiros_ runs
<whitequark> (with the former giving you a warning)
atmosx has quit [Remote host closed the connection]
* apeiros_ plays HOTS
<whitequark> apeiros_: watch FLCL
<banisterfiend> apeiros_: what's hots
atmosx has joined #ruby
<apeiros_> banisterfiend: sc2, second part
<banisterfiend> oh ok
<apeiros_> btw., how do you like sc2?
<banisterfiend> haven't played it still
<banisterfiend> :)
<atmosx> camping!
<apeiros_> (HOTS = heart of the swarm)
<Hanmac> whitequark: NO-Channel is the coolest way to travel :D
<havenwood> Then there is almost-sinatra, Sinatra in 7 lines: https://github.com/rkh/almost-sinatra/blob/master/almost_sinatra.rb
<atmosx> I like camping generally
<apeiros_> banisterfiend: you have to play with me and xeago once
<atmosx> sinatra is barebones enough imho
<whitequark> apeiros_: it'll be all good, I promise :D
<apeiros_> whitequark: *lalalala*
<apeiros_> :)
* apeiros_ gone
caleb_io has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
* Hanmac thinks that whitequark does not know what an NO-Channel is …
shevy has joined #ruby
mattbl has quit [Client Quit]
adambeynon has quit [Ping timeout: 244 seconds]
erlingur has joined #ruby
mattbl has joined #ruby
<whitequark> Hanmac: of course I do
etcetera has joined #ruby
<whitequark> Hanmac: you might want to read the essays. http://www.avclub.com/articles/fooly-cooly,66724/ and so on.
erlingur has left #ruby [#ruby]
<Hanmac> its like your own stargate inside your head :D
<banisterfiend> whitequark: why did you delete your blog post about ruby types
<whitequark> banisterfiend: because it was ignorant bullshit
<whitequark> almost entirely factually incorrect.
<banisterfiend> oh i never got a chance to read it
<whitequark> nah you didn't miss anything
<banisterfiend> but i saw a few reactions on reddit ;) but that doesn't say a lot, since people on reddit are often confused and aggressive
<Hanmac> whitequark i allready watched the series, i dont need this essay ..
<Hanmac> whitequark: what YOU need to watch is AdventureTime and GravityFalls
<whitequark> Hanmac: you actually do, because I didn't understand it in its entirety even after, I dunno, seventh time I watched it?..
<whitequark> and it's a series of six essays
<whitequark> and you want to read the comments too :D
<Xeago> "Sinatra refactored, only seven lines now. More popular than a pair of socks."
<Xeago> xD
Mon_Ouie has joined #ruby
<havenwood> I like the coding guidelines: "use map instead of each, it's shorter"
<whitequark> Hanmac: mhm. american animation. for some reason it never really went well with me.
<whitequark> havenwood: wait what?
<Hanmac> whitequark AdventureTime is different :P
<havenwood> whitequark: "don't include tests. tests just bloat the code base. just commit, the users will complain if you break anything."
<az7ar> thnx again guys, bye
az7ar has quit [Quit: Leaving]
muminz has joined #ruby
<whitequark> Hanmac: well, maybe. but given my unfortunate tendency to watch the entire series straight, it doesn't seem that I will get to do it any time soon
<whitequark> I've code to write and features to deliver.
<whitequark> 113 episodes is... somewhat a lot.
adkron has joined #ruby
adkron_ has joined #ruby
apoch632 has quit [Quit: Leaving.]
adambeynon has joined #ruby
<V8Energy> I just tried using rest-client gem and I am still getting the same error 401 unauthorized. here is the line i use in IRB: RestClient.get 'http://admin:password@localhost:80/index.html', {:accept => :json}. it works fine in my browser when i paste this into the address bar: http://admin:password@localhost:80/index.html
v0n has joined #ruby
gyre007 has joined #ruby
pothibo has quit [Quit: pothibo]
otherj has quit []
entrenador has joined #ruby
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
sn0wb1rd has quit [Quit: sn0wb1rd]
entrenador has quit [Client Quit]
<marcopod> Why does Rack::Response.finish return an array with `self' as the last element?
sn0wb1rd has joined #ruby
kofno has quit [Remote host closed the connection]
etcetera has quit []
<marcopod> well, as of 1.4.4 it's BodyProxy.new(self), but basically the same thing.
<banisterfiend> Hanmac: you are lemongrab
emocakes has joined #ruby
cousine has joined #ruby
<marcopod> The problem is, Rack::Response itself doesn't respond to join.
<marcopod> Am I missing something?
cousine has quit [Remote host closed the connection]
banisterfiend has quit [Read error: Connection reset by peer]
gyre007 has quit [Ping timeout: 276 seconds]
chrisramon has joined #ruby
_md has quit [Quit: Linkinus - http://linkinus.com]
octoberry has joined #ruby
Morkel has joined #ruby
banisterfiend has joined #ruby
<marcopod> Oh ok, the spec says it has to respond to *each*, not join. Don't mind me guys
Mchl has joined #ruby
s0ber has quit [Read error: Connection reset by peer]
s0ber has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
atmosx has quit [Quit: And so the story goes…]
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
arya has quit [Ping timeout: 248 seconds]
marcopod has quit [Remote host closed the connection]
SeanLazer has joined #ruby
SeanLazer has quit [Client Quit]
Catbuntu has quit [Quit: MrTeenSmoking = <3]
mityaz has quit [Quit: See ya!]
<pepee> can anyone help me please :(
havenwood has quit [Remote host closed the connection]
relix has joined #ruby
razibog1 has quit [Ping timeout: 256 seconds]
chrisramon has left #ruby [#ruby]
arya has joined #ruby
ElderFain has joined #ruby
havenwood has joined #ruby
<pepee> I get these erros when I try to install any gem (for example, gem install rdiscount): ERROR: Could not find a valid gem 'rdiscount' (>= 0) in any repository ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Errno::EMFILE: Too many open files - socket(2) (http://rubygems.org/latest_specs.4.8.gz)
ferdev is now known as ferdev|away
lizzin has left #ruby [#ruby]
banisterfiend has quit [Remote host closed the connection]
br4ndon has joined #ruby
octoberry has quit [Ping timeout: 248 seconds]
stkowski has quit [Quit: stkowski]
relix has quit [Ping timeout: 256 seconds]
arya has quit [Ping timeout: 248 seconds]
ElderFain has quit [Quit: I'm Gone]
banisterfiend has joined #ruby
havenwood has quit [Remote host closed the connection]
entrenador has joined #ruby
maletor has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
arya has joined #ruby
adambeynon has joined #ruby
tylersmith has joined #ruby
alienaut has joined #ruby
ahokaomaeha has joined #ruby
elico has quit [Quit: elico]
hbpoison has joined #ruby
koopa_ has quit [Ping timeout: 252 seconds]
entrenador has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
adambeynon has quit [Client Quit]
T|ASK has left #ruby [#ruby]
T|ASK has joined #ruby
kofno has joined #ruby
shock_one has quit [Ping timeout: 248 seconds]
hbpoison has quit [Ping timeout: 252 seconds]
Guest96945 has quit [Quit: Linkinus - http://linkinus.com]
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
maletor has quit [Quit: Computer has gone to sleep.]
<alienaut> lol, i just realized if you pass an array argument to puts it prints all values in a new line
<alienaut> like this
<alienaut> 1
<alienaut> 2
havenwood has joined #ruby
max_ has quit [Remote host closed the connection]
relix has joined #ruby
<apeiros_> alienaut: mhm, docs++, "If called with an array argument, writes each element on a new line."
<apeiros_> straight from `ri IO#puts` ;-p
<alienaut> i gave me a headache why this print like this https://gist.github.com/alienaut/4973332
<alienaut> apeiros_, yes, my english is awful
Jackneill has quit [Ping timeout: 245 seconds]
<alienaut> you described better it for me.
<whitequark> apeiros_: what the doc *doesn't* mention is that puts is basically defined as this
ferdev|away is now known as ferdev
<whitequark> def puts(*args); args.flatten.each { |s| write "#{s}\n" }; end
<apeiros_> hm, indeed
<apeiros_> bad IMO
<apeiros_> should use to_s, not flatten
<apeiros_> I find it a bad special case anyway
<apeiros_> it's not hard to use `puts *ary` instead of `puts ary`
<apeiros_> but it means yet another special case…
fedza has quit [Read error: Connection reset by peer]
maletor has joined #ruby
jpoz has joined #ruby
<whitequark> apeiros_: the actual implementation is somewhat more evil
fedza has joined #ruby
<apeiros_> =(
jpoz has left #ruby [#ruby]
arya has quit [Ping timeout: 248 seconds]
<apeiros_> wth is Thread.guarding?
<apeiros_> oh, this is your ruby implementation?
<whitequark> apeiros_: rubinius ><
<apeiros_> ok
<Trudko> guys anyidea why Date.current().strftime('%m.%d.%Y %H:%M') is returning 00:00 for time
<whitequark> apeiros_: Thread.guarding? is the thing which prevents a=[];a<<a from hanging the interpreter
<apeiros_> whitequark: horrible :(
<whitequark> Trudko: because you're requesting the date.
<apeiros_> why not just `def puts(*args); args.each { |s| print s.to_s, DEFAULT_RECORD_SEPARATOR }; end`
<Trudko> whitequark: ou ok
<whitequark> apeiros_: BANANAS
<apeiros_> or actually, rather String(s) instead of s.to_s
<havenwood> Trudko: DateTime.now.strftime('%m.%d.%Y %H:%M') #=> "02.17.2013 12:53"
Umren|2 has quit [Read error: Connection reset by peer]
* apeiros_ hopes that String() behaves similarly to Integer(), i.e., that it raises if stuff behaves bad
<Hanmac> apeiros_ i dont think so ... String(Object.new) #=> "#<Object:0x000000019614b8>"
jonahR has joined #ruby
stevechiagozie has joined #ruby
<apeiros_> hm, actually 2 special cases are still needed: args.empty? and arg.suffix?(DEFAULT_RECORD_SEPARATOR)
<apeiros_> Hanmac: AAAAAAAH! bad ruby, bad!
<apeiros_> Hanmac: ah, well, Object#to_s exists
<apeiros_> sadly…
<Hanmac> it prefers to_str if defined
* apeiros_ finds to_s a bad method name anyway
<apeiros_> #printable
<apeiros_> or somesuch
<whitequark> apeiros_: there's inspect for that
<apeiros_> say what you mean…
<apeiros_> whitequark: different intent
kirun has quit [Quit: Client exiting]
<whitequark> well, strings are for printing anyway.
<apeiros_> yes, strings
<whitequark> using them as byte arrays is abuse.
<apeiros_> but not objects which have a printable representation
<Hanmac> apeiros_ you know about *args and maybe about **keyargs, do you know that it works in an each block too?
<apeiros_> Hanmac: is **keyargs ruby 2.0-ism?
forced_request has joined #ruby
<whitequark> yes
<apeiros_> k
<Hanmac> yeah its a second way for key args
<apeiros_> haven't spent any time on 2.0 yet
zastern has joined #ruby
LouisRoR has quit [Ping timeout: 256 seconds]
<whitequark> keyword arguments is a neat way to codify an already existing concept
arya has joined #ruby
<whitequark> namely, options={}
<Hanmac> >> class A; def to_ary; [1,2]; end;end; p [A.new,A.new].map {|*args| args}
<eval-in> Hanmac: Output: "[[#<A:0x8b36ef8>], [#<A:0x8b36ee4>]]\n" (http://eval.in/10403)
<whitequark> inconsistencies in splat are sad :/
<Hanmac> >> class A; def to_ary; [1,2]; end;end; p [A.new,A.new].map {|(*args)| p args}
<eval-in> Hanmac: Output: "[1, 2]\n[1, 2]\n[[1, 2], [1, 2]]\n" (http://eval.in/10404)
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<Hanmac> *args inside || is funny :P
<whitequark> no
T|ASK has left #ruby [#ruby]
<whitequark> it works exactly as in def
miskander has quit [Quit: miskander]
<Hanmac> yeah but they are still funny ...
<Hanmac> and i think **keyarg inside each || will call to_h too
pyrac has quit [Quit: pyrac]
SeySayux has quit [Ping timeout: 276 seconds]
matchaw___ has joined #ruby
Villadelfia has quit [Ping timeout: 245 seconds]
matchaw has quit [Ping timeout: 244 seconds]
<whitequark> to_hash?
<blf> I cannot call a protected method from a class initializer?
toekutr has joined #ruby
<whitequark> blf: #send
SeySayux has joined #ruby
Villadelfia has joined #ruby
<blf> whitequark: Hm... Is it considered bad practice to call a protected method from a class initializer?
<apeiros_> actually, IO#puts should always use "\n", or have IO#record_separator=
kofno has quit [Remote host closed the connection]
<apeiros_> global values for such things == bad IMO
<Hanmac> whitequark there will be a to_h method for nice stuff
<whitequark> Hanmac: I guess it should be #to_hash for consistency
<whitequark> like to_ary and to_str
<whitequark> IIRC to_hash will be introduced in 2.1
Hanmac has quit [Read error: Connection reset by peer]
solidoodlesuppor has quit [Remote host closed the connection]
Hanmac has joined #ruby
jpfuentes2 has joined #ruby
v0n has quit [Ping timeout: 244 seconds]
<Vuxil> Is there a machine learning package for Ruby
miskander has joined #ruby
francisfish has joined #ruby
Vuxil is now known as Vulix
<Vulix> typo'd my name lol
kofno has joined #ruby
txdv has quit [Read error: Connection reset by peer]
txdv has joined #ruby
bluOxigen has quit [Ping timeout: 248 seconds]
Starrfish has joined #ruby
Myconix has quit [Ping timeout: 256 seconds]
Starrfish is now known as Myconix
atno has quit [Ping timeout: 264 seconds]
ferdev is now known as ferdev|away
maletor has quit [Quit: Computer has gone to sleep.]
shock_one has joined #ruby
eka has joined #ruby
caleb_io has quit [Quit: caleb_io]
otherj has joined #ruby
athst has joined #ruby
<Vulix> So no one knows?
<Hanmac> what kind of "machine learning"?
<Vulix> similar to WEKA for Java http://www.cs.waikato.ac.nz/ml/weka/
Neomex has joined #ruby
Neomex has quit [Client Quit]
stevechiagozie has quit [Quit: Computer has gone to sleep.]
<Vulix> decision trees, SVMs, regression models
<heftig> you could use WEKA from jruby
<Vulix> yeah I know that is an option
<Vulix> I am actually considering writing everything in ruby as a hobby project which is why I am asking =P
acriax has joined #ruby
bluOxigen has joined #ruby
codezombie has quit [Read error: Connection reset by peer]
<acriax> Uh, I'm having a brainfreeze right now and can't figure out how to google my problem. I have a key-value-pair hash, and the values are integers. How can I multiply these values by 100? I already have the each-loop set up
mike has joined #ruby
maletor has joined #ruby
<acriax> But like, if i do value *= 100, it doesn't save it to the value
kofno has quit [Remote host closed the connection]
ctp has joined #ruby
arturaz has quit [Remote host closed the connection]
mike is now known as Guest26351
Guest26351 has quit [Client Quit]
<acriax> as soon as the loop ends it reverts back
zodiak has quit [Quit: Leaving]
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
v0n has joined #ruby
<ctp> Hi folks. How to replace 'ab' by 'a/b', 'abc' by 'a/b/c' etc. but 'a' should remain 'a'. a,b,c are any alphanumerical chars.
<havenwood> acriax: require 'hashy'; hash.map_value { |v| v * 100 }
<ryanf> twitter-concrete.herokuapp.com
<ryanf> oops, wrong window
<ryanf> and wrong url
sk87 has joined #ruby
atno has joined #ruby
<apeiros_> ctp: split & join
<havenwood> acriax: or: your_hash.each_pair.with_object({}) do |(key, value), result|; result[key] = yield value; end
`p has joined #ruby
<apeiros_> alternatively gsub with a clever regex
<apeiros_> e.g. one using a lookaround
Spooner has quit [Remote host closed the connection]
gommo has joined #ruby
<acriax> havenwood: wow, that stuff looks advanced.
<havenwood> acriax: The normal way I see people do it though is: hash.each { |k, v| hash[k] = v * 100 }
<ctp> apeiros_: exactely looking for the regex :)
mehwork has joined #ruby
<apeiros_> acriax: or just Hash[hash.map(&block)]
<acriax> havenwood: and is that a bad way_
<acriax> ?
<Hanmac> ctp. str.each_char.join('/') ?
Spooner has joined #ruby
<havenwood> acriax: seems fine to me :)
<apeiros_> Hanmac: iirc Enumerable does not define join, does Enumerator?
<acriax> Great :)
<apeiros_> ctp: what regex have you tried?
<Hanmac> ach fu you are right
eka has quit [Quit: Computer has gone to sleep.]
<Hanmac> ctp. str.each_char.to_a.join('/')
<apeiros_> Hanmac: well, str.chars.join is shorter anyway
noxoc has joined #ruby
<Hanmac> i often like the each_
<acriax> ctp, the regex /\w+/ matches all groups of alphanumeric chars
<apeiros_> yeah, but here it'll be slower, is more to write and IMO harder to follow :)
<havenwood> acriax: It has been proposed to add Hash#map_value to the language in 2.1, but Matz hasn't said whether it will be or not. The hashy gem is tiny if you want Hash#map_pair, Hash#map_key, and Hash#map_value before then.
<Hanmac> so it shows that it does with enumerator ... chars should be an Array
<apeiros_> acriax: he wants single chars, so no +
<acriax> oh, but he pulls in the groups, then splits the chars and adds slashes in between
jonathanwallace1 has joined #ruby
<apeiros_> Hanmac: it is. but each_*.to_a is a verbose way for *
<Hanmac> inst chars only a alias for each_char ?
<acriax> havenwood: alright, good to know
<ctp> cool, thanks guys. "abc".each_char.to_a.join('/') works fine
<apeiros_> Hanmac: ach fu you are right
* apeiros_ thinks String#chars should == String#each_char.to_a
beaky has quit [Quit: leaving]
<apeiros_> ctp: I have a gsub solution also, but I'd like to know first how you tried :)
ryanf has quit [Ping timeout: 252 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
nicoulaj has quit [Remote host closed the connection]
ahokaomaeha has quit [Ping timeout: 256 seconds]
hbpoison has joined #ruby
<acriax> havenwood: I get "can't add a new key into hash during iteration (RuntimeError)" using the last method you mentioned
* Hanmac has also a gsub solution
<acriax> using wordPairs[word] = value * 100
miskander has quit [Quit: miskander]
<ctp> apeiros_: something like that: "abc".gsub(/(?=\w)/, '/')
<havenwood> acriax: Not sure what is happening - might want to paste a gist of the code? It *should* work: hash = { one: 1, two: 2 }; hash.each { |k, v| hash[k] = v * 100 }; hash; #=> {:one=>100, :two=>200}
Morkel has quit [Quit: Morkel]
<ctp> but a / is added at str[0] too
maletor has quit [Quit: Computer has gone to sleep.]
<Hanmac> ctp he had str.gsub(/.(?=.)/, '\0/') and my was str.gsub(/(\w?)(\w)/,'\1/\2')
BRMatt has joined #ruby
ryanf has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
hbpoison has quit [Ping timeout: 252 seconds]
<Hanmac> ctp but my was wrong, so use his variant
<ctp> ok, cool, str.gsub(/.(?=\w)/, '\0/') is what i was looking for
staafl has joined #ruby
<Hanmac> acriax what is your ruby version?
Es0teric has joined #ruby
<alienaut> is there a ruby interpreter that runs on browser, and i want to save my simple ruby scripts. a site just like jsfiddle.
Hecatic has joined #ruby
<acriax> 2.0.0-dev
atal421 has quit [Quit: atal421]
pettsson has joined #ruby
<acriax> Hmm, but running the gist works fine for me though
<Hanmac> alienaut you mean like http://eval.in/ ?
jbw has quit [Ping timeout: 260 seconds]
<havenwood> acriax: Your gist works fine for me in 2.0.0-rc2
<acriax> Oh, wait, in the real code i use wordPairs = Hash.new(0)
kofno has joined #ruby
<acriax> would that make a difference?
garbagecollectio has quit [Quit: garbagecollectio]
<acriax> then the wordpairs are generated by reading from a file. Running puts on that hash gives me the same result as I entered in the gist though
Spooner has quit [Read error: Connection reset by peer]
<havenwood> alienaut: http://repl.it/languages/Ruby
ctp_ has joined #ruby
miskander has joined #ruby
<alienaut> awesome! thanks guys.
mikeycgto has quit [Read error: Connection reset by peer]
garbagecollectio has joined #ruby
<acriax> Ah, I figured out the problem.
shock_one has quit [Ping timeout: 255 seconds]
ferdev|away is now known as ferdev
garbagecollectio has quit [Client Quit]
jbw has joined #ruby
dallasm has quit [Remote host closed the connection]
ctp has quit [Ping timeout: 260 seconds]
whowantstolivef1 has quit [Ping timeout: 276 seconds]
blf has quit [Quit: Page closed]
rh1n0 has joined #ruby
`p has quit [Remote host closed the connection]
colonolGron has quit [Quit: leaving]
<Hanmac> acriax and where was it?
mockra has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
stevechiagozie has joined #ruby
jbw has quit [Ping timeout: 255 seconds]
<acriax> It's embarrasing, but earlier in the same loop I had deleted the pair if certain conditions were true, and when it tried to do the multiplication on those deleted values using that line, it got confused. So now I call next after I had deleted a pair.
agarie has joined #ruby
jbw has joined #ruby
zoonfafer has joined #ruby
dagnachew has joined #ruby
emergion has joined #ruby
czupa has quit [Read error: Connection reset by peer]
danneu has joined #ruby
garbagecollectio has joined #ruby
rh1n0 has quit [Quit: Linkinus - http://linkinus.com]
ryanf has quit [Ping timeout: 256 seconds]
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ruby
francisfish has quit [Remote host closed the connection]
Takehiro has joined #ruby
Vulix has left #ruby [#ruby]
etcetera has joined #ruby
ctp_ has quit [Ping timeout: 245 seconds]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
jbw has quit [Ping timeout: 255 seconds]
wmoxam has quit [Ping timeout: 252 seconds]
`p has joined #ruby
vabenjamin has joined #ruby
etcetera has quit [Client Quit]
<miskander> Anyone low how to telnet to a mail server with net/telnet?
Elhu has joined #ruby
<miskander> I am getting timeout with that code there
Takehiro has quit [Ping timeout: 256 seconds]
<miskander> Here is the connection call: https://gist.github.com/miskander/b9ee57a6c472cbf8c405
<garbagecollectio> whats the equivalent of this in haml" <%= link_to "My Blog", posts_path %>
ZachDragon has joined #ruby
<miskander> =link_to "My Blog", posts_path
<havenwood> = link_to "My Blog", posts_path
skrewler has joined #ruby
etcetera has joined #ruby
idkazuma has joined #ruby
workmad3 has joined #ruby
alienaut has quit [Quit: Leaving]
etcetera has quit [Client Quit]
monkegjinni has quit [Remote host closed the connection]
arya has quit [Ping timeout: 248 seconds]
etcetera has joined #ruby
moos3 has joined #ruby
monkegjinni has joined #ruby
jbw has joined #ruby
codecop has quit [Remote host closed the connection]
arya has joined #ruby
wmoxam has joined #ruby
ahokaomaeha has joined #ruby
Nisstyre-laptop has quit [Quit: Leaving]
etcetera has quit []
tjbiddle has joined #ruby
stormetrooper has quit [Quit: Leaving]
<vabenjamin> So gem == user created library?
dagnachew has quit [Remote host closed the connection]
miskander has quit [Quit: miskander]
syamajala has joined #ruby
v0n has quit [Ping timeout: 252 seconds]
<havenwood> vabenjamin: yes, RubyGems is Ruby's package manager and packages are called gems.
Nisstyre-laptop has joined #ruby
<vabenjamin> Is it the most common way, or do people distribute packages in other ways more commonly?
adambeynon has joined #ruby
<hashmal> vabenjamin it's the most common way, by far
<vabenjamin> ty
<hashmal> iirc the default library has been moved to gems for ruby 2.0 (can someone confirm or correct me?)
emergion has quit [Ping timeout: 264 seconds]
ryanf has joined #ruby
<vabenjamin> im going to be rewriting some of my java code in ruby just to learn the language, was wondering what the best way to package it is, tyvm
staafl has quit [Read error: Connection reset by peer]
miskander has joined #ruby
`p has quit [Quit: Leaving]
staafl has joined #ruby
adambeynon has quit [Client Quit]
Littlex has quit [Quit: Littlex]
`p has joined #ruby
lazyguru has quit [Ping timeout: 252 seconds]
Elhu has quit [Quit: Computer has gone to sleep.]
TheFuzzball has quit [Quit: Computer has gone to sleep.]
staafl has quit [Read error: Connection reset by peer]
staafl has joined #ruby
`p has quit [Client Quit]
artofraw has quit [Remote host closed the connection]
maxmanders has joined #ruby
TheFuzzball has joined #ruby
syamajala has quit [Quit: leaving]
moos3 has quit [Quit: Computer has gone to sleep.]
lazyguru has joined #ruby
`p has joined #ruby
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
<danneu> vabenjamin: you could port maven to ruby so we dont miss out on that fun
ryanf has quit [Ping timeout: 255 seconds]
TheFuzzball has quit [Client Quit]
banister_ has joined #ruby
blacktulip has quit [Remote host closed the connection]
Takehiro has joined #ruby
ahokaomaeha has joined #ruby
ahokaomaeha is now known as Guest18304
chrishough has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<havenwood> vabenjamin: Yes, gems are the One True Way. A really nice Ruby implementation on the JVM is JRuby if you haven't checked it out yet! (Uses gems as well, but native extensions in Java rather than C.)
<havenwood> Most gems don't have native extensions.
<havenwood> I guess.
Guest18304 has quit [Client Quit]
Playground has joined #ruby
kofno has quit [Remote host closed the connection]
james has joined #ruby
Playground is now known as ahokaomaeha
ryanf has joined #ruby
james is now known as Guest41034
ninp0 has joined #ruby
v0n has joined #ruby
Takehiro has quit [Ping timeout: 255 seconds]
justsee has joined #ruby
staafl has quit [Read error: Connection reset by peer]
staafl has joined #ruby
hbpoison has joined #ruby
plotter has quit [Remote host closed the connection]
benlieb has joined #ruby
adamjleonard has quit [Quit: Linkinus - http://linkinus.com]
benlieb has quit [Client Quit]
hbpoison has quit [Ping timeout: 248 seconds]
relix has quit [Quit: relix]
vierja has quit [Ping timeout: 252 seconds]
fedza has quit [Ping timeout: 252 seconds]
joofsh has joined #ruby
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
grzywacz has quit [Read error: Connection reset by peer]
xardas has quit [Ping timeout: 245 seconds]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vikhyat has quit [Remote host closed the connection]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
mercwith1mouth has quit [Ping timeout: 252 seconds]
mercwithamouth has quit [Ping timeout: 252 seconds]
andrewhl has joined #ruby
vierja has joined #ruby
mockra has quit [Remote host closed the connection]
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
miskander has quit [Quit: miskander]
<garbagecollectio> how does this work
<garbagecollectio> @posts = Post.all
dmonjo has joined #ruby
<havenwood> garbagecollectio: looks like rails?
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
<garbagecollectio> yeah
<havenwood> garbagecollectio: Try #RubyOnRails
<garbagecollectio> they won't answer my questions
<garbagecollectio> im quieted there
miskander has joined #ruby
vierja has joined #ruby
<havenwood> garbagecollectio: How bout?: #RailsNoob
vierja has quit [Max SendQ exceeded]
vierja has joined #ruby
<garbagecollectio> u don't want to tell me?
vierja has quit [Max SendQ exceeded]
rh1n0 has joined #ruby
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
erlingur has joined #ruby
<dcope> lol
brian___ has joined #ruby
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
<epochwolf> havenwood: garbagecollectio was +q'd on #rubyonrails for not reading documentation and arguring with people.
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
<havenwood> epochwolf: aha
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
<epochwolf> havenwood: just fyi, not trying to get him banned here. He'll do that to himself.
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
<havenwood> epochwolf: Roger that. :)
<epochwolf> garbagecollectio: a hint, people who really like ruby tend to hate rails and the people assocated with it.
jtharris has joined #ruby
vierja has joined #ruby
banister_ has quit [Read error: Connection reset by peer]
vierja has quit [Max SendQ exceeded]
<epochwolf> the feeling is pretty mutual
SilverKey has joined #ruby
vierja has joined #ruby
<havenwood> epochwolf: That really does seem to kinda be true...! Hehe.
banisterfiend has joined #ruby
_veer is now known as lolsuper_
lolsuper_ is now known as _veer
<epochwolf> havenwood: I got my ass chewed out by the Seattle Ruby Brigade for working on a rails project at thier working meetup. I didn't even ask questions.
<havenwood> epochwolf: rofl...
<epochwolf> havenwood: more than once, I'm not a smart wolf.
jtharris has quit [Client Quit]
mlr has quit [Ping timeout: 256 seconds]
alanp_ has joined #ruby
alanp_ has quit [Read error: Connection reset by peer]
brian___ has left #ruby [#ruby]
crackfu has quit [Remote host closed the connection]
alanp_ has joined #ruby
<garbagecollectio> right
<garbagecollectio> rails programers are conformists
Rizzle has joined #ruby
<garbagecollectio> they like constraints and boundaries
<garbagecollectio> its a weird scene
<vabenjamin> not necessarily
<garbagecollectio> its like the frat scene of programming
<garbagecollectio> thats what i think
<vabenjamin> I like rails because its quick
<garbagecollectio> thats why i like it
<vabenjamin> if I want something very customizable I will use java spring
<garbagecollectio> but I'm talking about the community
<banisterfiend> epochwolf: they're anti-rails there?
mattbl has joined #ruby
<vabenjamin> the community if full of a lot of ruby-only programmers is why
<vabenjamin> or rails-only people
<epochwolf> banisterfiend: this happened about 18 months ago.
<Xeago> 0323 vabenjamin: if I want something very customizable I will use java spring
<Xeago> rofl, I'd go with html :3
<epochwolf> banisterfiend: I went 3~4 times. They weren't nice to me.
<vabenjamin> Xeago not really sure what you mean, Java Spring is a very powerful framework
<banisterfiend> epochwolf: they're anti rails there i takeit?
goraxe has joined #ruby
<epochwolf> banisterfiend: that group was.
mercwithamouth has joined #ruby
mercwith1mouth has joined #ruby
<banisterfiend> epochwolf: doesn't it include tenderlove ?
<epochwolf> banisterfiend: no idea.
<banisterfiend> epochwolf: zenspider etc?
<epochwolf> banisterfiend: zensider yes.
<garbagecollectio> why are rails people so crazy?
<Xeago> vabenjamin: even if it is powerful, so is html5 :P
<banisterfiend> garbagecollectio: i will ban you from this channel if you dont shut up
<epochwolf> garbagecollectio: because we deal with fuck ups like you every day of the week.
<garbagecollectio> exactly
<garbagecollectio> ruby people don't like rails people and vice versa
<garbagecollectio> according to ruby peple
<garbagecollectio> and then if you criticize rails you get threatened with a ban
alanp has quit [Ping timeout: 276 seconds]
<garbagecollectio> no other programming environment does this
<vabenjamin> garbage rails is what it is, a very linear way to create a web application. that is by design - if you want something that lets you play more, that goes against the rails philosophy
<garbagecollectio> not on free node or in real life
<vabenjamin> hence its on rails
<epochwolf> garbagecollectio: python does
<banisterfiend> garbagecollectio: i'm not a rails programmer, i just find you annoying
<banisterfiend> garbagecollectio: you just babble incessantly and do not contribute anything interesting to the conversation
<garbagecollectio> i think i do
<garbagecollectio> has anyone actually had this conversation about the rails world
<Xeago> garbagecollectio: yes
<epochwolf> garbagecollectio: hundreds of times.
<garbagecollectio> I'm new to it, what was the discussion?
<epochwolf> garbagecollectio: it's a frequent topic and you don't know enough to add anything to it
<garbagecollectio> i dont
<garbagecollectio> what are the themes of the discussion?
<vabenjamin> garbagecollectio you would be more productive going to a framework that suits your needs instead of trying to force rails to do the exact opposite of what it is designed to do
<garbagecollectio> I'm not doing that it all
<garbagecollectio> what are u talking about lol
arya has quit [Ping timeout: 248 seconds]
<garbagecollectio> I'm asking about the social community
<epochwolf> vabenjamin: he's been hired to work at a startup with no ruby or rails experience.
<havenwood> garbagecollectio: Have you tried hanging out in #python or #php, or #django or #cakephp?
<dmonjo> *calling garbage collection*
<garbagecollectio> yeah they are all cool
<havenwood> garbagecollectio: Really??
<garbagecollectio> yeah
<vabenjamin> ah you were talking about rails being too constrained
<garbagecollectio> javascript is also really nice
<vabenjamin> maybe i misinterpreted
<garbagecollectio> php is definitely
<garbagecollectio> cakephp is
<garbagecollectio> python idk
SilverKey has quit [Read error: Connection timed out]
<epochwolf> vabenjamin: he was talking about the community being restrictive because Radar +q'd him
kja has joined #ruby
<garbagecollectio> no i wasnt
<garbagecollectio> this is my experience with rails devs
<garbagecollectio> they are dicks and don't actually care about learning and stuff
<garbagecollectio> and often times very linear minded
mockra has joined #ruby
<epochwolf> garbagecollectio: we don't care to spend the 3 months it takes to learn the framework holding your hand.
<garbagecollectio> thats not the issue
<garbagecollectio> its your attitude
<garbagecollectio> epoch wolf i will go toe to toe with you in programming fundamentals anytime
<garbagecollectio> and destroy you
kja is now known as SilverKey
<garbagecollectio> because i am smarter
<garbagecollectio> you don't talk to other devs the way rails devs talk to ppl
<garbagecollectio> its a cult
<havenwood> I like the idea of a cult headed by DHH, but I don't think it is. :P
<garbagecollectio> and i don't get why
<havenwood> I get _why.
<garbagecollectio> its definitely turned into that
<garbagecollectio> why?
jpoz_mobile has joined #ruby
<vabenjamin> garbage do you know ruby or are you trying to jump into rails directly
<epochwolf> garbagecollectio: sure, you just graduated from college so you probably have the theory memorized. I haven't used much theory for the last 3 years I've spent out of college.
<garbagecollectio> epochwolf: actually I'm 5 years out
<havenwood> garbagecollectio: http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CEEQFjAB&url=http%3A%2F%2Fwww.cs.uni.edu%2F~wallingf%2Fteaching%2F188-agile%2Fruby%2Fwhys-poignant-guide-to-ruby.pdf&ei=2mMhUcXBLeH6igKGzoCYBg&usg=AFQjCNH0C2pZdyS8B8hss_FUXgxX230Fcw&sig2=CMbVfgxfom33oGandPS9oQ&bvm=bv.42661473,d.cGE
<havenwood> eek, long link
<epochwolf> lol
wmoxam has quit [Ping timeout: 248 seconds]
<epochwolf> havenwood: I hate the new hijacked links from google. :/
<garbagecollectio> wtf
skcin7 has quit []
Bosox20051 has joined #ruby
DaltonUS has joined #ruby
<Xeago> epochwolf: I actually used a surprising amount of theory during my crypto programming :P
<Xeago> and cryptanalysis
<Xeago> and related stuff
jpoz_mobile has left #ruby [#ruby]
<epochwolf> Xeago: never got into crypto. I did learn how to do public key encryption but that's 4 years ago.
<Xeago> I am graduating the first of next month
<epochwolf> Xeago: I do insurnace software right now. Enterprise stuff. Architecture, etc.
<epochwolf> since I'm on a small team I have a lot of authority to make design changes.
<garbagecollectio> if i do = render 'form'
<garbagecollectio> it automatically takes _form out of the view?
<garbagecollectio> _form.html.haml
<garbagecollectio> ?
<havenwood> Please, please no Rails stuff in the sacred bastion of #Ruby!
<havenwood> :P
<epochwolf> havenwood: I am sorry. I'll avoid talking about it in the future.
miskander has quit [Quit: miskander]
<pandawarrior> havenwood: what other roles out ther
<pandawarrior> there* i love ruby but when i look for ruby dev roles, i only see rails roles
<epochwolf> pandawarrior: devops perhaps?
<pandawarrior> i've seen dev ops and dev in test roles
<epochwolf> pandawarrior: sinatra was popular until node.js arrived and a thousand startups moved to it
Edward_ has quit [Ping timeout: 252 seconds]
gabrielrotbart has joined #ruby
<pandawarrior> sinatra is for restul apps, right?
erlingur has quit [Ping timeout: 245 seconds]
<epochwolf> rails is for restful apps..
<epochwolf> sinatra is a light wieght framework.
generalissimo has quit [Remote host closed the connection]
<pandawarrior> no sure what that actually means..
<havenwood> epochwolf: j/k :P just jesting
<epochwolf> it doesn't have any of the rails tooling, it's a limited dsl on top of rack
<epochwolf> havenwood: awww <3 I love being jested.
<havenwood> jest not lest ye be jested!
<epochwolf> that's funny because I need to leave for church in 10 minutes./
<havenwood> hehe
pettsson has quit [Remote host closed the connection]
<havenwood> pandawarrior: I dunno, I think there are a growing number of Ruby jobs for non Railsists. Sinatra, DevOps, etc. But yeah, Rails is huge!
<Boohbah> why am i getting undefined method `readline_nonblock' for IO:Class (NoMethodError)? http://pastie.org/6207288
miskander has joined #ruby
<epochwolf> Boohbah: your realine_nonblock is an instance method, you're calling a class method
justsee has quit [Quit: Leaving...]
<julian-delphiki> Boohbah, you need def self.readline_nonblock if you want to call it like IO.readline_nonblock
<garbagecollectio> can someone explain what this is doing
<garbagecollectio> respond_to do |format|
skrewler has quit [Quit: skrewler]
<garbagecollectio> format.html # index.html.erb
<garbagecollectio> format.json { render :json => @posts }
<epochwolf> garbagecollectio: clearly you haven't been on irc long enough to learn not to paste code into an active channel.
<garbagecollectio> epochwolf: the rule is more than
<garbagecollectio> 3
<garbagecollectio> I've been on for like 15 years now ?
<garbagecollectio> thanks
zoonfafer has quit [Ping timeout: 248 seconds]
<garbagecollectio> and stop talking about conventions
<garbagecollectio> jesus
<epochwolf> you called?
Virunga has quit [Read error: Connection reset by peer]
stormetrooper has joined #ruby
<X-Jester> does anyone have any ideas why when i dump a hash to yaml, some keys are being single-quote escaped, while others aren't? any way to control the format of that output with psych?
vierja has quit [Ping timeout: 252 seconds]
erlingur has joined #ruby
maletor has joined #ruby
<X-Jester> it's happening for hashes i construct from a BSON::OrderedHash
justsee has joined #ruby
mlr has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
arya has joined #ruby
zorbyte has quit [Ping timeout: 264 seconds]
Spooner has joined #ruby
<Xeago> X-Jester: the only thing I can think of, that said I have never used haml or bson, is that symbols are serialized differently than strings
<epochwolf> garbagecollectio: sorry, I missed the topic. I've been in here for over a year. I've kind of stopped reading it.
vierja has joined #ruby
<garbagecollectio> ?
vierja has quit [Max SendQ exceeded]
<garbagecollectio> this shit is so funny
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
<garbagecollectio> i don't know how i can own nyc
<garbagecollectio> if I'm just starting out in rails and coffee and haml
<garbagecollectio> why are they having me do that shit i just want to hack on javascript
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
samphippen has quit [Quit: Computer has gone to sleep.]
<Boohbah> now i get in `readline_nonblock': undefined method `read_nonblock' for IO:Class (NoMethodError) http://pastie.org/6207368
alolalol has joined #ruby
vierja has joined #ruby
<epochwolf> Boohbah: you haven't changed anything?
vierja has quit [Max SendQ exceeded]
<epochwolf> Boohbah: change line 4 to def self.readline_nonblock
danneu has quit [Quit: WeeChat 0.3.8]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
<X-Jester> Xeago: now that you mention it, it's only happening for symbols
motto has quit [Quit: Sto andando via]
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
<Boohbah> epochwolf: i changed line 3
miskander has quit [Quit: miskander]
<Boohbah> epochwolf: now i have a different undefined method
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
<Boohbah> also line 7
vierja has joined #ruby
vierja has quit [Max SendQ exceeded]
<pepee> so... to install rvm from https://rvm.io/ , you need bash 3.2.5, but mingw distributes 3.1.17...
vierja has joined #ruby
Takehiro has joined #ruby
<pepee> I will have to build ruby by myself, only to install a couple gems
<epochwolf> pepee: mingw is for windows, right?
<pepee> yeah
<epochwolf> pepee: don't use rvm, there is a windows ruby picker available
<pepee> or msys, or whatever is called
kofno has joined #ruby
<pepee> epochwolf, gems gives me errors when I try to install gems...
<havenwood> pik is the Windows version manager, never used it though
heftig has quit [Quit: Quitting]
arya has quit [Ping timeout: 248 seconds]
heftig has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
<pepee> ok, gonna try pik
<havenwood> Githubs down...
<pepee> yah, it's down :/
maletor has quit [Quit: Computer has gone to sleep.]
noxoc has quit [Quit: noxoc]
Hecatic has quit [Quit: HecAtic]
<havenwood> pepee: I suggest moving to posix and using chruby! :P
nari has joined #ruby
<ZachDragon> github is not down for me at the moment.
<pepee> anyway, if someone could help me to fix that error, I'd be very happy
<pepee> havenwood, I just need ruby to run some scripts
<pepee> *ruby and some gems that use the davekit
<pepee> *devkit
<X-Jester> Xeago: thank you, your advice was exactly what i needed. if i have a symbol name in a literal from bson, i strip the : and run to_sym() on it, and it works splendidly. thank you.
Takehiro has quit [Ping timeout: 252 seconds]
<havenwood> pepee: Have you tried RailsInstaller for Windows? http://railsinstaller.org/windows
<pepee> woohoo, github is back
hbpoison has joined #ruby
<pepee> I don't need rails...
Hecatic has joined #ruby
werdnativ has joined #ruby
<havenwood> pepee: Yeah, but their script is pretty nice to get you going. Then: gem uninstall rails
<havenwood> :P
wargasm1 has joined #ruby
<havenwood> garbagecollectio: Yeah, why be a rockstar developer when you can be a wizard or ninja?!
<garbagecollectio> damn what did i get myself into
<pepee> pik won't help me, because the error comes from gem...
<pepee> "Exception `Errno::EMFILE' at C:/Ruby187/lib/ruby/1.8/net/http.rb:560 - Too many open files - socket(2)"
<havenwood> pepee: Ruby 1.8?!?
DaltonUS has quit [Quit: DaltonUS]
<epochwolf> havenwood: I'm not a rockstar. I don't make enough. I just settle for being awesome.
<pepee> google says, it's a problem related to the compiler used to compile ruby
Mon_Ouie has quit [Ping timeout: 252 seconds]
<havenwood> epochwolf: Ninjas are like more lethal rockstars that make much less, methinks. :P
<havenwood> pepee: RailsInstaller with gem uninstall rails might speed you up a ton.
rh1n0 has quit [Quit: Linkinus - http://linkinus.com]
<epochwolf> havenwood: ninjas end up getting crucified.
<pepee> havenwood, I get the same error from 1.9.2
tjbiddle has joined #ruby
<havenwood> epochwolf: \o/T
<epochwolf> havenwood: 1700s Japan was not a nice place to live. The japanese really feel in love with crucifixion.
Virunga has joined #ruby
wargasm has quit [Ping timeout: 252 seconds]
<pepee> ok, I'm gonna try that, thanks havenwood
<havenwood> pepee: Lemme know what you think, if it works well. I'm curious!
<vabenjamin> so as I build my data mining library, is there any string manipulation tasks or text mining tasks anyone would like to see implemented in ruby?
<epochwolf> now wizard… I can do that. I played a sorcerer in a DnD campanion
<epochwolf> *
hbpoison has quit [Ping timeout: 255 seconds]
<havenwood> I am a developer Paladin, lvl 28.
<epochwolf> campaign*
<epochwolf> hehe 2d8 Wolf + 5d4 Dev + 1d6 SysAdmin
<Xeago> for what it is worth, I have over 2 years of ingame time on my warlock?
<Xeago> damn I played the shit out of wow..
<epochwolf> Xeago: ouch
<epochwolf> okay, church time, laterz!
caleb_io has joined #ruby
<havenwood> Xeago: I hired a gnome, irl! Don't play wow anymore but asked for a dev in IronForge, inspected his equipment, and hired em.
eka has joined #ruby
<havenwood> Xeago: Had a masters in cs, but his gear choice helped me see his competence.
<Xeago> true story?
<havenwood> Xeago: yup
<Xeago> cool xD :)
<havenwood> Xeago: Still works for the company. Asked me not to tell them how he was hired, embarassed.
ZachDragon has quit [Quit: Leaving]
<Xeago> I do agree, gear (and optimizations) tends to be a good indicator of competence :P
Monie has joined #ruby
<Xeago> bummer :<
Mattix has joined #ruby
<Xeago> "I asserted his skills, knowledge and expertise, through unconventional means. I was immediately convinced and derp.. :"
<havenwood> Xeago: haha, indeed!
<havenwood> Explain your offhand to my satisfaction, and you're hired!
<Xeago> xD
<Xeago> got 1 realm first, killed the 'ol naxx before patches
kofno has quit [Remote host closed the connection]
<havenwood> Xeago: Did you see the D3 Ruby bot talk at RubyConf?
<Xeago> after vanilla I became gm, and really sinked time
<Xeago> havenwood: no, got a link?
<havenwood> Sikuli is kinda cool.
chimmy has joined #ruby
arya has joined #ruby
blf has joined #ruby
dmiller has quit [Read error: Connection reset by peer]
adeponte has joined #ruby
chrishough has quit [Quit: chrishough]
tjbiddle has quit [Quit: tjbiddle]
havenwood has quit [Remote host closed the connection]
<garbagecollectio> = javascript_include_tag 'somefile'
benlieb has joined #ruby
pavilionXP has joined #ruby
<garbagecollectio> will that do coffee scripts to?
<garbagecollectio> too*
sk87 has quit [Quit: Computer has gone to sleep.]
zzing has quit [Quit: Computer has gone to sleep.]
arya has quit [Ping timeout: 252 seconds]
crackfu has joined #ruby
monkegjinni has quit [Remote host closed the connection]
<erlingur> garbagecollectio It's a view helper from Rails. Google maybe?
<garbagecollectio> huh
<garbagecollectio> not helpful
<garbagecollectio> does asset pipeline take coffee
crackfu has quit [Remote host closed the connection]
crackfu has joined #ruby
zzing has joined #ruby
wmoxam has joined #ruby
zzing has quit [Client Quit]
arya has joined #ruby
<erlingur> garbagecollectio I'm not in this channel much so I don't know how they like you asking Rails specific questions here but http://guides.rubyonrails.org/asset_pipeline.html