apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
<eph3meral> but overall, I still like Qt a lot, at least compared to the alternatives, which are basically GTK and WX
<seanstickle> For cross platform yeah
<seanstickle> And HTML!
<eph3meral> heh, right
<seanstickle> The most cross platformish
<seanstickle> wx looks like crap, but still better than tk
<eph3meral> yeah actually, on my latest project, I was about to write a Qt frontend, but then both my partners are on mac and I'm on *nix and we were having a helluva time getting them to get qtruby compiled
<eph3meral> it was like sudo apt-get to libs here
<eph3meral> and i was done
<eph3meral> for me anyway
compara20 has quit [Quit: Ex-Chat]
binaryplease has quit [Ping timeout: 244 seconds]
<seanstickle> Ok, I'm done with QtRuby
<seanstickle> Now it can't find some QtDbus thing
<seanstickle> Fuck this.
<eph3meral> heheh, yeh it's kind of messed up on OSX, for sure
kevinbond has quit [Quit: kevinbond]
<eph3meral> so, point is, I actually ended up just making a sinatra based UI for the app
<eph3meral> works quite well
<seanstickle> eph3meral: ah, awesome
<seanstickle> eph3meral: that seems to be my path too
dv_ has quit [Read error: Connection reset by peer]
<seanstickle> That and Mac-specific apps using Cocoa
<eph3meral> actually, probably even better than Qt, because I needed graphing, and D3 leaves a lot to be desired, but at the same time, D3 still has far better docs than Qwt
tomzx has joined #ruby
iocor has quit [Quit: Computer has gone to sleep.]
dv_ has joined #ruby
<eph3meral> it's kind of sad actually, it seems like the qt and qtruby folks would be all about making sure that shit works on OSX really easily
<eph3meral> but I guess not
bbttxu has quit [Quit: bbttxu]
fflush has joined #ruby
<seanstickle> I was looking for the same thing for Python
<seanstickle> A good Mac (and other system) GUI toolkit
<seanstickle> There's shit-all
<seanstickle> Resigned myself to making local web apps with Python
<eph3meral> yeh, all I can say is I love Qt ruby, the main problem with it is how much of a bitch it is to get it working on OSX, so since you're on OSX, I guess that puts you out :(
<eph3meral> it's one of those things where, so far, I have not found a single complete comprehensive or correct source of detailed instructions on how to guaranteed get qtruby to work on OSX
workmad3 has quit [Ping timeout: 245 seconds]
<eph3meral> so, either you have to be a dev on the qtruby project, or... you have to be a dev on the qtruby project
<eph3meral> (in order to get it to work on OSX)
<seanstickle> Which certainly makes it infeasible to deploy apps built on QtRuby
<seanstickle> (for the mac)
<seanstickle> Damn shame
itnomad has joined #ruby
yugui_zzz is now known as yugui
jhunter has quit [Ping timeout: 248 seconds]
ryanf has quit [Quit: leaving]
<shevy> <seanstickle> Fuck this.
<shevy> I like those expressions of love :)
<shevy> it makes me feel fuzzy inside
<seanstickle> Give me an easy-to-install QtRuby and I wouldn't have to resort to such banal expressions of contempt and derision.
NodoLomas has joined #ruby
<seanstickle> Alas, I am but a mortal man.
jhunter has joined #ruby
<shevy> hehe easy to install
<shevy> I failed to compile latest qt4+kde4+qtruby4 from source :(
NodoLomas has quit [Quit: Leaving.]
<shevy> I'd even recommend HTML5 and the rest simply because it gives less headache installing
b1rkh0ff has quit [Ping timeout: 245 seconds]
<seanstickle> Yeah, HTML5 is where I am going for my local machine Python and Ruby apps.
savage- has joined #ruby
<seanstickle> The downside is that I have to learn JavaScript in addition to Python & Ruby.
just_some_guy has quit []
<seanstickle> But that's also, I guess, an upside
counterbeing has joined #ruby
jimeh has quit [Ping timeout: 244 seconds]
NodoLomas has joined #ruby
akem has quit [Quit: Forget progress by proxy. Land on your own moon.]
perryh_away is now known as perryh
kil0byte has quit [Ping timeout: 252 seconds]
akem has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
jimeh has joined #ruby
NodoLomas has quit [Client Quit]
kevinbond has joined #ruby
pk1001100011 has quit [Quit: Bredząc trzy po trzy oznajmiłeś, że Ty; Dasz im Władcę Snów; Nie pojęli Twych słów; Więc zginęły miliony – ich słowa brzmiały dziwnie; Ten sam Bóg nosił inne imię (…)]
replore has joined #ruby
baroquebobcat has joined #ruby
stephenjudkins has joined #ruby
<krz> rubyists. i need our help. i have this hash: {"24"=>{"visits_count"=>2}, "27"=>{"visits_count"=>1}, "28"=>{"visits_count"=>4}} how do i grab the items lower than 28 and sum up the visits_count
<krz> so its this case its 2+1. should return 3
<seanstickle> krz: {"24"=>{"visits_count"=>2}, "27"=>{"visits_count"=>1}, "28"=>{"visits_count"=>4}}.select{|k,v| k.to_i < 28}.map{|k,v| v["visits_count"]}.reduce(:+)
<krz> wow
jenrzzz-mac has joined #ruby
sv- has joined #ruby
sv-- has quit [Read error: Connection reset by peer]
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
ipoval has quit [Quit: ipoval]
<seanstickle> krz: or {"24"=>{"visits_count"=>2}, "27"=>{"visits_count"=>1}, "28"=>{"visits_count"=>4}}.reduce(0){|sum, x| sum += x[1]["visits_count"] if x[0].to_i < 28; sum}
SimSala has quit [Ping timeout: 248 seconds]
BrokenCog has joined #ruby
S2kx has joined #ruby
kil0byte has joined #ruby
<krz> eek. i think i prefer the former :-) thanks seanstickle
S1kx has quit [Ping timeout: 244 seconds]
i8igmac has joined #ruby
cousine has quit [Remote host closed the connection]
<i8igmac> can File.read cause a buffer over flow
ciastek has joined #ruby
sterNiX has quit [Ping timeout: 246 seconds]
diegoviola has quit [Read error: Operation timed out]
jonathanwallace has joined #ruby
<i8igmac> or can you overflow uniq?
Apocalypse has quit [Ping timeout: 248 seconds]
hamfz_ has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
fserb has joined #ruby
shadoi has quit [Remote host closed the connection]
<dekz> anyone else think methods with question marks look weird in ternary operations?
<seanstickle> foo? ? bar : baz
<seanstickle> I agree, it looks weird
liluo has quit [Remote host closed the connection]
Cache_Money has quit [Quit: Leaving]
Apocalypse has joined #ruby
elshaka has joined #ruby
rudle has joined #ruby
<rudle> howdy. when using homebrew on OSX, how does `gem` decide which gcc to use?
<audy> rudle you mean brew?
<dekz> does gem decide? or does it pipe it out?
kevinbond has quit [Quit: kevinbond]
<rudle> audy: i guess so
<rudle> dekz: i'm not sure. all i know is that it's using the wrong one :(
<ciastek> how to test gem's executable?
<dekz> rudle: what command are you running?
<ciastek> another words: how to run gem's executable from within gem's test :)
<rudle> dekz: `gem install sqlite3`
<rudle> the fact that i'm using homebrew might've been too much information
<dekz> rudle: so the gem installation process is attempting to build libsqlite3?
<dekz> and failing?
<rudle> it's trying to build a native extension
<rudle> it's trying to link against sqlite3.h, but it's using a compiler path that doesn't even exist
sbanwart has joined #ruby
akhkharu has joined #ruby
<krz> seanstickle: this also seems to work: {"24"=>{"visits_count"=>2}, "27"=>{"visits_count"=>1}, "28"=>{"visits_count"=>4}}.select{|k,v| k.to_i < 28}.map{|k,v| v["visits_count"]}.sum
yoklov has quit [Quit: bye!]
<dekz> rude: ok that shouldn't touch homebrew per se, it should only look in your environment
<dekz> rudle*
<dekz> damn autocorrect
<krz> seanstickle any specific reason why you chose to use reduce. just curious
<rudle> dekz: got it. here's a paste of mkmf.log http://pastie.org/3985882
<seanstickle> Sometimes I forget about sum
<rudle> so that path is coming from env somewhere?
amalvagomes has joined #ruby
<dekz> rudle: most likely it's a simple pipe out. Is your default gcc the 'right' one?
<rudle> seanstickle: real men #inject(:+) :)
<seanstickle> inject is for the losers
<rudle> dekz: if i just type gcc? i get a *third* one, which is not right at all
<rudle> i seem to remember something about setting CC, but that doesn't seem to work
<dekz> rudle: I am fairly sure it's a simply pipe out process. So if your default path points to the wrong gcc then so will gem.
<rudle> dekz: what do you mean by default path? how can i set a gcc as the default one?
adeponte has joined #ruby
adeponte has quit [Remote host closed the connection]
linoj has quit [Quit: linoj]
Hanmac has quit [Read error: Operation timed out]
vitor-br has joined #ruby
Hanmac has joined #ruby
savage- has quit [Remote host closed the connection]
<dekz> rudle: do you know the location of the correct one?
<rudle> yup
<dekz> rudle: what is it?
<rudle> dekz: / usr/local/Cellar/gcc/4.7.0/bin/gcc-4.7
pdtpatrick has quit [Quit: pdtpatrick]
liluo has joined #ruby
<dekz> rudle: but it's getting the 4.6.2? Am I correct?
L-----D has joined #ruby
<rudle> dekz: gem is saying that, but i haven't had that version installed for a while. i'm really not sure why it thinks that
<dekz> rudle: If you open up a new shell, what does `which gcc` output?
<rudle> dekz: /usr/bin/gcc, which is the gcc-llvm that apple provides version 4.2
<rudle> i think this might be a homebrew issue, i really messed up my setup not long ago
vitoravelino`afk is now known as vitoravelino
horseman has quit [Ping timeout: 265 seconds]
<dekz> Do you know why it says checking for sqlite3 no, is libsqlite3 a dependency that is also missing (homebrew)?
savage- has joined #ruby
pac1 has quit [Quit: I got it one line of code at a time]
jimeh has quit [Ping timeout: 265 seconds]
<rudle> i suspect that the gem is dumb. if you look at http://pastie.org/3985882, you'll see it write a simple program that tries to include sqlite.h. that header *is* on the path, so it should be all good. my guess is that because the path to gcc is invalid, it gives a non-zero exit code and the gem claims "missing sqlite.h"
Urth|Away is now known as Urthwhyte
mengu has quit [Remote host closed the connection]
itnomad has quit [Ping timeout: 240 seconds]
alegacyreborn has joined #ruby
libertyprime has quit [Ping timeout: 244 seconds]
<krz> seanstickle @activity_feeds.each{ |activity_feed| activity_feed.visits.select{|k,v| k['minute'] <= @minutes_ago } }.entries returns https://gist.github.com/2822052 i would like to go through each country in "visits", group them up and provide a sum for each country. mind helping me out with this one?
mikepack has joined #ruby
<alegacyreborn> I am learning Ruby :).
zodiak has quit [Quit: Leaving]
adeponte has joined #ruby
<krz> or anyone?
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
alegacyreborn has quit [Quit: Leaving]
horseman has joined #ruby
kevinbond has joined #ruby
Tref has quit [Quit: Tref]
cryptfu has joined #ruby
yannis has quit [Ping timeout: 256 seconds]
looopy has quit [Remote host closed the connection]
<krz> ok easier question. how would i group this and provide a sum: {:foo => 'foo', :foo => 'asdf', :bar => 'bar'}
libertyprime has joined #ruby
<krz> so should return something like foo: 2, bar:1
<horseman> krz: that code doesn't do what u think
<horseman> krz: you can only have one value for a key, so 'asdf' ovewrites 'foo'
<krz> hm
<horseman> krz: and so you can't perform the 'count' that u want
<krz> ok let me redo the hash
Haydos has left #ruby ["Leaving"]
dbgster has joined #ruby
<krz> so should return something like canada:1, italy: 1, russian federation: 1, united kingdom: 2
looopy has joined #ruby
Fezzler has joined #ruby
andrew__ has quit [Remote host closed the connection]
hippieha` has joined #ruby
zinjacoder has quit [Remote host closed the connection]
yosinof has quit [Quit: Leaving]
<bnagy> group_by map inject(:+)
<bnagy> morning
ipoval has joined #ruby
<bnagy> coffee :<
bambanx has joined #ruby
<eph3meral> seanstickle, javascript is actually pretty easy, and kind of nice
<seanstickle> eph3meral: I know it somewhat
<eph3meral> seanstickle, there's plenty of libs to make your life easy too and the prototype model of "OO" is actually kind of interesting and fresh
<eph3meral> cool
<seanstickle> And with Twitter Bootstrap, pretty easy to get reasonable effects in CSS
albemuth has quit [Quit: Computer has gone to sleep.]
hayon has joined #ruby
kenneth has quit [Quit: kswizz.com]
choffstein has quit [Remote host closed the connection]
kil0byte has quit [Ping timeout: 252 seconds]
kil0byte has joined #ruby
hayon has left #ruby [#ruby]
<eph3meral> seanstickle, hey, so do you know much about require path and gems? I've got my gem in a git repo, and I set the Gemfile to use :git => "path/to/my/repo" but then doing a require 'mygem' still wasn't working for me
<eph3meral> even after require 'rubygems'
<eph3meral> seanstickle, I've solved this problem in the short term by simply doing a require '../mygem/lib/mygem'
<seanstickle> eph3meral: require "bundler/setup"
<seanstickle> eph3meral: do you have that as well?
<eph3meral> ahh, nope
<seanstickle> Bundler.require(:default)
<seanstickle> Also
x0F has quit [Disconnected by services]
<eph3meral> yeah this is just a plain ruby app, i started with rails mostly, so I'm not super familiar with how to make bundler/gemfile work from a "from scratch" perspective
x0F_ has joined #ruby
x0F_ is now known as x0F
<eph3meral> cool, let me try that require setup line
<hippieha`> if I'm doing a 'bundle install' and it hangs, is there a way to turn on verbosity in order to see what connections are being made?
<krz> bnagy: group_by map inject(:+) in that order?
<rudle> hippieha`: man strace, if you're on linux
<audy> hippieha` bundle --verbose
<audy> or that
<audy> :)
<eph3meral> seanstickle, awesome, thanks so much, that's great :)
<seanstickle> eph3meral: :D
<eph3meral> makes total sense, I just hadn't had time to go research that part
busybox42 has quit [Ping timeout: 265 seconds]
<hippieha`> audy: I tried --verbose... sticks on "Fetching source index for http://gemcutter.org/"
<eph3meral> seanstickle, so I still have require 'rubygems'; and though it doesn't seem to hurt, is that technically still required/necessary if I'm using require 'bundler/setup' ?
ryanf has joined #ruby
ZachBeta has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Apocalypse has quit [Ping timeout: 260 seconds]
<audy> hippieha` try adding `source :rubygems` in your Gemfile
<seanstickle> eph3meral: not needed at all if you're using 1.9
<eph3meral> great
<eph3meral> yeah i'm on 1.9
<eph3meral> I couldn't imagine using 1.8, unless maybe I was supporting a legacy app
<seanstickle> require "rubygems" is implied by 1.9
<eph3meral> thank FSM that I'm not :)
<eph3meral> ok cool
adeponte has quit [Remote host closed the connection]
<eph3meral> seanstickle, ok and here's something else that I've used a lot that I've never gotten clarity on... I am using require 'date'; and now I'm pretty sure this is not a ruby gem correct? it's part of the "core lib"?
<eph3meral> if it's part of core then why do I need to require it?
<seanstickle> eph3meral: yeah
<seanstickle> eph3meral: the entire std lib isn't loaded all the time
<krz> bnagy: foo.map{|x| x['country_name']}.group_by{|c| c}.inject(:+) returns: ["Canada", ["Canada"], "Italy", ["Italy"], "United Kingdom", ["United Kingdom", "United Kingdom", "United Kingdom"], "Russian Federation", ["Russian Federation"]]
<seanstickle> Just like stdio.h is part of the c lib
<eph3meral> also, require 'date' is needed for iirc, both Date and DateTime?
<krz> not sure what I'm doing wrong
<seanstickle> But you still need to include it
<eph3meral> where do I see what I need to "require" in order to get a given thing in the core lib?
multiHYP has joined #ruby
<multiHYP> hi
<bnagy> krz: paste (or pastie) p foo so I can see how it's laid out
<multiHYP> what does this command do? `>(ruby -rtm_parser -eTextMate.parse_errors)`
<multiHYP> more precisely `sometext &> >(ruby -rtm_parser -eTextMate.parse_errors)`
<multiHYP> hey krz have you solved the mongodb issue?
jimeh has joined #ruby
urlwolf has quit [Ping timeout: 246 seconds]
<eph3meral> krz, what's the error?
<eph3meral> (and or problem)
<krz> multiHYP: getting there
<bnagy> krz and what output do you want?
<krz> eph3meral: need to group by country and return sum for each country
<bnagy> sum of what?
urlwolf has joined #ruby
<krz> so should return something like canada:1, italy: 1, russian federation: 1, united kingdom: 2
<eph3meral> krz, sounds like you should do that in your DB layer, no?
<krz> united kingdom: 3
<eph3meral> krz, as in use a mongo query, in which case you should probably ask #mongoid, or whatever you're using
Tref has joined #ruby
<krz> eph3meral: well. mongodb does not make it easy with map reduce + real time reporting
<eph3meral> krz, well that was your perogative to use mongo :)
noodletraveler has joined #ruby
<eph3meral> it would be pretty easy in postgres
<krz> so I'm doing some of the processing on the app layer
<krz> eph3meral: tell me about it. easy to collect and aggregate data. I've done it with pg
<eph3meral> krz, well, how bout you go write some code first - without you actually trying, I doubt many people in here are going to be willing to just hold your hand and walk you through making that
<krz> problems is if i have to load the records from the db every 10 seconds. its quite a load on pg
rmascarenhas has quit [Quit: leaving]
<krz> eph3meral: your last comment is annoying
pdtpatrick has joined #ruby
jimeh has quit [Ping timeout: 244 seconds]
<krz> eph3meral: what do you think i just posted a while ago? looks like code to me
<bnagy> krz: a.group_by {|h| h['country_name']}.each.with_object({}) {|(k,v),new| new[k]=v.size}
<krz> the wrong kind of code. buy i tried. didn't i?
<eph3meral> krz, hahah, uh, I meant code that does something, that's just an object/hash
<eph3meral> krz, so that's great, you tried, now try again :)
Progster has joined #ruby
<bnagy> there's probably a shorter way, coffee hasn't kicked in yet
<eph3meral> cool, i guess hashes have group_by or maybe it's enumerable
<bnagy> eph3meral: Enumerable. All Enumerable All The Time.
<eph3meral> heh
s0ber has quit [Read error: Operation timed out]
s0ber_ has joined #ruby
s0ber_ is now known as s0ber
busybox42 has joined #ruby
TandemAdam has joined #ruby
multiHYP has left #ruby [#ruby]
uris has joined #ruby
cableray has joined #ruby
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
ghosTM55 has joined #ruby
Apocalypse has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
<krz> and for the record. i am using pg
<krz> for many things
<bnagy> wow, I only use it as a database
<krz> yea many things database relevant :-)
zeromodulus has quit [Remote host closed the connection]
nlc has quit [Quit: Leaving]
sec_ has joined #ruby
<sec_> what is small IDE for ruby?
<krz> some guy comes into the channel. observes. has nothing better to do and tells someone who needs assistance to go read and try more (as if trying and reading wasn't in the agenda already)
<krz> annoys the fuck out of me
<seanstickle> sec_: vim
<sec_> krz: do you want fsk?
<sec_> seanstickle: ok
replore has quit [Remote host closed the connection]
<bnagy> sec_: he's joking, vim is not an IDE.
bglusman_ has quit [Remote host closed the connection]
<bnagy> sec_: but you should use it anyway, it rules
<krz> sec_: try sublime text editor. forget your ide
<bnagy> IDEs are for sissies
brianpWins has joined #ruby
<krz> sublime text 2 + vintage = power
bglusman has joined #ruby
akhkharu has quit [Ping timeout: 260 seconds]
<seanstickle> sublime is a trashy bit of kit
<bnagy> the nice thing about vim is that once you know it you have an editor you can use on every single OS from VMS through to Windows 8
<seanstickle> vim is your friend
<krz> terminal vim?
radic has quit [Disconnected by services]
td123 has quit [Quit: WeeChat 0.3.7]
radic_ has joined #ruby
<seanstickle> MacVim & terminal vim
<bnagy> there are gui versions as well, for when you have a wm
<krz> too slow
radic_ is now known as radic
<seanstickle> What is too slow?
<krz> vim and all its plugins
<bnagy> hahaha
<seanstickle> Haha
<krz> :-P
<seanstickle> Yes, and sex is too painful.
<krz> <3 vim
<sec_> krz: has Run button in st2? and builtin terminal output?
<seanstickle> And chocolate is too sour
elshaka has quit [Quit: Saliendo]
<bnagy> there is no way 'vim' is slower than any editor you're thinking of except maybe ed
<krz> used to be on macvim, till some minor glitches in outdated plugins added up. sublime + vintage gives you enough vim usage as a text editor
<krz> plus. sublime just works
<krz> vim… well
<krz> bnagy: was being sarcastic
<sec_> bnagy: in vim , scrool page to show class, function is slower :(
<krz> i have nothing but love for vim
bglusman has quit [Ping timeout: 245 seconds]
<bnagy> sec_: learn how to use it then :)
<krz> bnagy: plugins make it slow
cordoval has joined #ruby
<bnagy> I have no idea what plugins you're loading, I don't use any personally
cordoval has left #ruby [#ruby]
<bnagy> but I am breaking one of my core IRC rules (don't argue about editors, because idiots that don't use vim will disagree with you)
<krz> i like a bit of visual in my text editors. not too much to make it bloated. sublime + vintage does it for me :-)
<sec_> how about his course http://ruby.learncodethehardway.org/
<sec_> ?
<krz> sec_: look for the janus package
<bnagy> sec_: I like the course but I don't like some of the way he writes ruby
<bnagy> sec_: it's mainly good if you're new to programming, but there is some good stuff in there for all people new to ruby
akhkharu has joined #ruby
<sec_> okie okie
bglusman has joined #ruby
<sec_> i am new to ruby, using for do homework
<bnagy> that course is a direct port of the python course
<bnagy> and some of the ruby still reads a bit like python :/
<seanstickle> Just read the proposed ISO spec for Ruby.
<seanstickle> Much clearer, I think.
<krz> sec_: always good to have stored somewhere: http://www.amazon.com/The-Ruby-Way-Second-Edition/dp/0672328844
<seanstickle> Brilliant bit of reading
<seanstickle> Very clear, I think
balazs has joined #ruby
<krz> sec_: are you developing for the web?
<sec_> yes krz
<sec_> krz: iam in saas in coursa class
gtuckerkellogg has joined #ruby
<krz> you might want rails 3 in action by ryan bigg too
<seanstickle> They have classes in SaaS ?
<seanstickle> The world has gone mad
yonggu has quit [Remote host closed the connection]
yonggu has joined #ruby
<sec_> yea seanstickle
frishi has quit [Quit: Leaving...]
jenrzzz-mac has quit [Quit: jenrzzz-mac]
fserb has quit [Quit: ttyl]
<bnagy> seanstickle: Buzzword Development II
<seanstickle> I like that the class has a section called "1.3 - Development Processes: Waterfall vs. Agile"
<seanstickle> So we can perpetuate the myth that there is a thing called waterfall development
TheHunter_1039 has quit [Quit: TheHunter_1039]
<bnagy> I don't know what any of that means :<
kevinbond has quit [Quit: kevinbond]
nu7hatch has left #ruby [#ruby]
zeromodulus has joined #ruby
mikeycgto has quit [Read error: Connection reset by peer]
AnarchoTroll has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
andrew__ has joined #ruby
choffstein has joined #ruby
<ciopte7> If anyone has experience with thinking sphinx and rails I would appreciate it if you could look at this problem I am having: http://stackoverflow.com/questions/10770140/drilling-down-with-thinking-sphinx-facets
pastjean has quit [Remote host closed the connection]
ciopte7 has quit [Quit: ciopte7]
ciopte7 has joined #ruby
fukushima has quit [Quit: Leaving...]
<bambanx> hi
williamcotton has quit [Quit: williamcotton]
<bnagy> morning
fbernier has joined #ruby
sbanwart has quit [Ping timeout: 252 seconds]
<jrajav> seanstickle: Um, there isn't?
<seanstickle> jrajav: no, except in the same way that Darth Vader exists
<jrajav> I guess that CS prof of mine who used it at 3M was a Jedi then
<seanstickle> jrajav: a fictional villain meant to highlight the virtue of the other approaches
<seanstickle> jrajav: could be
<jrajav> I have to admit I would love to believe that nobody could envision something so inane and bureaucratic
<jrajav> But after reading a few pages of my roommates management textbook I'm relieved that they managed to make something that can at least be represented with a simple flowchart
vitor-br has quit [Quit: Saindo]
counterbeing has quit [Ping timeout: 245 seconds]
urlwolf has quit [Ping timeout: 245 seconds]
dbgster has quit [Quit: dbgster]
urlwolf has joined #ruby
bglusman has quit [Remote host closed the connection]
bglusman has joined #ruby
looopy has quit [Remote host closed the connection]
thepathsn has joined #ruby
<dekz> Can anyone drop a clue on how to access module globals when extending a module (or including)? https://gist.github.com/433863e02d8d47e9c24b
amalvagomes has quit [Quit: amalvagomes]
fukushima has joined #ruby
urlwolf has quit [Read error: Connection reset by peer]
urlwolf has joined #ruby
<eph3meral> can I redirect the output of a forked process to a different TTY?
bglusman has quit [Ping timeout: 246 seconds]
choffste_ has joined #ruby
test34 has quit [Ping timeout: 260 seconds]
choffstein has quit [Ping timeout: 245 seconds]
choffstein has joined #ruby
Fezzler has quit [Quit: Leaving]
choffste_ has quit [Ping timeout: 245 seconds]
fbernier has quit [Ping timeout: 246 seconds]
<bnagy> dekz: Modname::CONSTANT
<dekz> bnagy: but is there a point in then using the include/exclude?
prtksxna_ has joined #ruby
prtksxna has quit [Read error: Connection reset by peer]
<bnagy> dekz: yes
<bnagy> :)
mxweas_ has joined #ruby
<bnagy> dekz: include will get you all the instance methods of the thing you include
L-----D has quit [Ping timeout: 260 seconds]
<dekz> bnagy: ok thanks. So it's pretty much the same either way if there are no methods and only globals in that module.
<bnagy> if you just need it for namespacing then yeah, include does nothing
Tref has quit [Quit: Tref]
seanstickle has quit [Quit: Nihil sub sole novum]
urlwolf has quit [Ping timeout: 246 seconds]
pdtpatrick has quit [Quit: pdtpatrick]
digital-ghost has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
<bnagy> eph3meral: interesting.. there are probably lots of ways
<bnagy> pid=spawn( command, :out=>'/dev/ttyxxx' )
albemuth has joined #ruby
uris has quit [Quit: leaving]
thepathsn has quit []
Urthwhyte is now known as Urth|Away
<krz> bnagy: I'm struggling to get this to work. my data set looks like: https://gist.github.com/2822101 any way i can group and sum up all countries with this kind of data?
emmanuelux has quit [Ping timeout: 264 seconds]
<bnagy> krz: just take it one step at a time
<bnagy> have you got pry / irb?
<krz> irb
one8zero has joined #ruby
<bnagy> ok, so get all that data into a var in irb
triptec has quit [Quit: triptec]
<bnagy> so looks like you have an array of ActivityFeed objects?
<krz> bnagy: roger that
<bnagy> so, first step is to transform that to an array of arrays of visits
<bnagy> which is going to be some kind of map
<krz> via an each loop?
<bnagy> looks like visits might just be a method on the activityobj
<bnagy> nah just a straight map - map transforms a collection
<krz> but i have to map it for each ActivityFeed object though right?
<bnagy> ['a','b','c'].map &:upcase
<bnagy> => ["A", "B", "C"]
adeponte has joined #ruby
<krz> because visits is nested inside each activity feed object
<bnagy> just try act_obj_array.map(&:visits) and see if that works
khakimov has joined #ruby
dhaskew has quit [Quit: dhaskew]
<krz> bnagy: activity_feeds.act_obj_array.map(&:visits) returns: NoMethodError: undefined method `act_obj_array' for #<Array:0x007ff0ce739530>
<bnagy> I can't read whatever format that paste is in. Basically, inside the block do whatever you would do to get one visits array out of one activityobj
pdtpatrick has joined #ruby
<bnagy> krz: XD that was an example variable name
<bnagy> activity_feeds.map ...
<krz> oh right!
pdtpatrick has quit [Client Quit]
ghosTM55 has quit [Quit: leaving]
<krz> err
<krz> let me format it for you
<bnagy> ok no that's fine
<bnagy> so now you have a big array of array oh hash_of_one_visit
<bnagy> right?
amacgregor_osx has quit [Remote host closed the connection]
<krz> these are all visits of each activity feed object right?
<bnagy> I hope so :)
<krz> ok. let me take it from here
<bnagy> flatten is next
<bnagy> then you should be back on track
<krz> let me try this out on me self
davidpk has quit [Quit: Computer has gone to sleep.]
hemanth has quit [Remote host closed the connection]
<krz> @activity_feeds.map(&:visits).flatten.group_by {|h| h['country_name']}.each.with_object({}) {|(k,v),new| new[k]=v.size} :-D :-D :-D
<bnagy> niice :)
<krz> returns {"Canada"=>6, "United States"=>3, "Italy"=>1, "United Kingdom"=>1, "Russian Federation"=>2, "Germany"=>1}
<krz> awesome. thanks for that
<bnagy> achievement unlocked: 5 method chain
<krz> lol
andrew__ has quit [Remote host closed the connection]
<bnagy> so the map(&:meth) shortcut syntax will send the method 'meth' to every object in the collection and store the return value in the new array
<bambanx> wassup guys
choffstein has quit [Remote host closed the connection]
<bnagy> nm, trying to work out which visual studio I need for VC10 nmake
<bnagy> barf
<bnagy> 2010 apparently
<bnagy> screw it, I'm using vc8
<bnagy> </3 windows dev
<krz> bnagy: lets add one more chain to it. select: @activity_feeds.map(&:visits).select{|k,v| k['minute'] <= @minutes_ago }.flatten.group_by {|h| h['country_name']}.each.with_object({}) {|(k,v),new| new[k]=v.size}
<krz> @minutes_ago = 210
<krz> its still returning the same results
<bnagy> uh
<bnagy> what output do you want?
hakunin_ has quit [Read error: Connection reset by peer]
<bnagy> oh recent visits
hakunin has joined #ruby
<bnagy> flatten first
<krz> perfect
<krz> don't ask. it has to be done on the app layer. until the aggregation framework for mongodb comes out
rippa has joined #ruby
<krz> cuz map reduce on mongodb don't play nicely
jgrevich has quit [Read error: Connection reset by peer]
<bnagy> why?
<krz> too slow for huge data sets
<krz> especially if i want to display it in realtime. every 10 seconds
<bnagy> huh. If ruby is faster than your DB then something is seriously screwed
<bnagy> then again it does seem to use javascript for MR blocks
<krz> thats how bad map reduce is in this instance
<bnagy> which would be enough for me to set it on fire right there
zeromodulus has quit [Remote host closed the connection]
<krz> The price of using MapReduce is speed: group is not particularly speedy, but MapReduce is slower and is not supposed to be used in “real time.” You run MapReduce as a background job, it creates a collection of results, and then you can query that collection in real time.
mxweas_ has quit [Quit: Computer has gone to sleep.]
<i8igmac> can this over flow? buff=file.read.uniq
<i8igmac> data=file.read.map.uniq
thomas is now known as tdubella
<bnagy> i8igmac: nothing in standard ruby script can 'overflow' in the sense you probably mean
<bnagy> you could run out of RAM though
mxweas_ has joined #ruby
<bnagy> but read is normally going to return a huge string, so there is nothing to uniq on
mxweas_ has quit [Client Quit]
wookiehangover has quit [Ping timeout: 244 seconds]
<bnagy> depending on what the data looks like there is almost certainly a much better way to do that though, if the infile is huge
jgrevich has joined #ruby
wookiehangover has joined #ruby
<bnagy> File.foreach(fname).with_object({}) {|line,hsh| hsh[line]=true].keys for example
<bambanx> h=File.foreach("typeid2.txt").with_index.with_object({}) {|(l,i),hsh| k,v=l.split("\t");hsh[k]=v if i > 1}
<bambanx> p h['34']
<bambanx> other example
<bambanx> thanks to my friend bnagy
<bambanx> :P
<bnagy> bambanx: uh except that does something completely different :)
<bambanx> well...
zeromodulus has joined #ruby
<bambanx> bnagy, why mongdb and not mysql or postgres? i mean is better?
<bnagy> by the sounds of it I wouldn't piss on mongo if it were on fire
<bnagy> databases are a bit like religion and text editors though
<bambanx> but the paradigm
<bnagy> for relational I use postgres, for local KV stores I use tokyocabinet and for network KV stores I use redis
<bambanx> "document oriented"
<bambanx> is more faster than mysql or postgres?
<bnagy> no idea
williamcotton has joined #ruby
CheeToS has joined #ruby
<bnagy> speed is the last thing I look at
deobald__ has joined #ruby
<bambanx> yeah
<bambanx> i like postgres
_adeponte has joined #ruby
adeponte has quit [Read error: Connection reset by peer]
<bnagy> I kind of don't, but for very relational data it's awesome
davidpk has joined #ruby
tdubella is now known as thomas
<bnagy> if you can afford to be more laid back almost anything is more fun to use
<bnagy> imvho, I don't do a lot of db stuff
noodletraveler has quit [Ping timeout: 244 seconds]
kenperkins has quit [Quit: Computer has gone to sleep.]
_adeponte has quit [Ping timeout: 256 seconds]
AnarchoTroll has quit [Quit: Leaving]
noodletraveler has joined #ruby
williamcotton has quit [Quit: williamcotton]
tomb_ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
ananthakumaran has joined #ruby
williamcotton has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
kaneda__ has quit [Quit: Leaving]
kaneda has joined #ruby
kaneda is now known as Guest57325
mdw has joined #ruby
cantonic has quit [Remote host closed the connection]
cantonic has joined #ruby
L-----D has joined #ruby
mucker has quit [Quit: leaving]
jgrevich has quit [Quit: jgrevich]
fukushima has quit [Ping timeout: 246 seconds]
sterNiX has joined #ruby
thecreators has joined #ruby
Solnse has joined #ruby
<dekz> Anyone know of a proper/clean way to pass configuration variables from a Sinatra route down to another Controller in another file?
sterNiX has quit [Client Quit]
moted has quit [Remote host closed the connection]
<dekz> Avoiding sticking an instance object @@ on Sinatra class
tonini has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
<bnagy> don't use @@ vars
<bnagy> I know nothing about sinatra or webstuff, but class ivars are good places to store stuff that subclasses want access to
cantonic_ has joined #ruby
billiamii has quit [Quit: billiamii]
cantonic has quit [Ping timeout: 252 seconds]
cantonic_ is now known as cantonic
tewecske has joined #ruby
tomzx has quit [Ping timeout: 246 seconds]
macmartine has quit [Quit: macmartine]
<horseman> dekz: Yeah, just the @vars
macmartine has joined #ruby
rlankfo_ has quit [Ping timeout: 240 seconds]
mohits has joined #ruby
<krz> any reason why {"google.com"=>2, nil=>3, "foobar.com"=>3, "twitter.com"=>2}.first works and {"google.com"=>2, nil=>3, "foobar.com"=>3, "twitter.com"=>2}.last doesnt?
yxhuvud has joined #ruby
choffstein has joined #ruby
joppe has quit [Ping timeout: 272 seconds]
<bnagy> cause there's no #last method for Hash?
werdnativ has quit [Read error: Connection reset by peer]
werdnativ has joined #ruby
wallerdev has quit [Read error: Connection reset by peer]
wallerdev has joined #ruby
choffstein has quit [Ping timeout: 245 seconds]
burgestrand has quit [Quit: Leaving.]
albemuth has quit [Quit: Computer has gone to sleep.]
<bnagy> or did you want the why of the why?
<krz> well yea
<krz> why of the why sounds interesting
<krz> i mean if there is first. shouldn't there be last?
Morkel has joined #ruby
<bnagy> Hash includes Enumerable
tayy has joined #ruby
<bnagy> Enumerable is for open ended collection that respond to map each etc etc
<bnagy> first(n) on Enumerable does each and breaks after n entries
nobitanobi has joined #ruby
counterbeing has joined #ruby
<bnagy> last would have to walk the whole thing
<bnagy> and last(n) would have to have some crazy ringbuffer or something
brianpWins has quit [Quit: brianpWins]
davidpk has quit [Ping timeout: 244 seconds]
<krz> hm so how would obtain last in a hash?
<bnagy> and finally, treating a Hash like an ordered collection, even though it is one, is slightly dodgy
hamfz_ has quit [Ping timeout: 248 seconds]
<bnagy> .to_a[-1] ?
<nobitanobi> I am having problems trying to install the pg gem under MAC. I keep getting checking for pg_config... no No pg_config... trying anyway. If building fails, please try again with
<bnagy> oh! no no!
<nobitanobi> any thoughts please?
<bnagy> reverse_each.first :D
<krz> well might as well do to_a.last
<bnagy> krz: reverse each is much better for big hashes
<bnagy> nobitanobi: do you have postgres etc installed?
ghosTM55 has joined #ruby
<nobitanobi> bnagy: that's a good point...I believe I first need to install postgres... as the gem relies on it...
<bnagy> krz: oh, no it's not :( they're the same. Damn.
<krz> I'm actually trying to do <% @foos.each_with_index do |foo, index| %><li class="clearfix <%= 'last' if @foos.last == foo %>">
djdb has joined #ruby
<bnagy> krz: where did you use index there?
<krz> forget the index part. its not supposed to be there
<krz> :-)
nobitanobi has quit [Quit: Page closed]
TandemAdam has quit [Quit: Leaving]
<krz> <li class="clearfix <%= 'last' if @foos.to_a.last == foo %>">
demian`_ has quit [Quit: demian`_]
<krz> works :-)
polysics has joined #ruby
<bnagy> ow, no, bad
<bnagy> array creation with every run of the block
<krz> unless i convert @foos to an array to begin with
<bnagy> better
petercs has joined #ruby
<krz> good point though
<bnagy> doesn't that only output one line?
<bnagy> no need to use each, right?
<krz> what outputs one line?
<krz> @foos = [["google.com", 2], [nil, 3], ["foobar.com", 3], ["twitter.com", 2]]
<krz> seems to work now
<bnagy> that code, it only outputs anything when it hits the last entry
davidpk has joined #ruby
polysics has quit [Remote host closed the connection]
<bnagy> Receiving objects: 33% (64131/192465), 43.79 MiB | 9 KiB/s
<krz> it'll apply the 'last' css class to the li element if its the last
<bnagy> I hate my ISP :<
brianpWins has joined #ruby
<bnagy> krz: but in every other case it does nothing, right?
<krz> yeap
<bnagy> so don't use each
<bnagy> just access the last element directly
<krz> bnagy: I'm doing: https://gist.github.com/2822485
<krz> so i need to each :-)
<krz> @foos = @top_referers
<bnagy> ok erb means nothing to me sorry
<bnagy> but walking a collection in a way that only produces output for one item is wrong
<bnagy> if it's 'do this for every item but do this other thing for the last one' it's ok
vectorshelve has joined #ruby
<bnagy> foo[1..-2].each {|notlast| #do stuff}; do stuff with foo.last
<bnagy> is ok too
<krz> hm
Eldariof59-ru has joined #ruby
<krz> bnagy: not sure i get that. if I'm iterating over the object. and would need a class="last" if the object is the last element. how else would i do it?
JohnBat26 has joined #ruby
macmartine has quit [Quit: macmartine]
<bnagy> it's fine, as long as you're doing stuff with all the things that are NOT the last as well
<krz> yeap :-)
<vectorshelve> shevy: :)
<krz> finally i think my mongodb architecture is set
<krz> just a few more tweaks!
<vectorshelve> laughed my heart out
jhunter has quit [Ping timeout: 252 seconds]
adeponte has joined #ruby
jhunter has joined #ruby
aetaric has quit [Quit: Got ZNC?]
libertyprime has quit [Ping timeout: 256 seconds]
bambanx has quit [Read error: Connection reset by peer]
bambanx has joined #ruby
aetaric has joined #ruby
mdw has quit [Remote host closed the connection]
williamcotton has quit [Quit: williamcotton]
savage- has quit [Remote host closed the connection]
libertyprime has joined #ruby
<krz> bnagy: thanks for the help. really appreciate it
nilg has joined #ruby
areil has joined #ruby
<bnagy> np
<pradeepto> bnagy: hi, got the dsl stuff working, thanks for all the help yesterday.
<pradeepto> definitely need to learn more / better ruby.
twqla has quit [Ping timeout: 244 seconds]
bondar has joined #ruby
maesbn has joined #ruby
balazs_ has quit [Read error: Operation timed out]
balazs has quit [Ping timeout: 245 seconds]
<bnagy> pradeepto: fwiw I am dubious about your dsl approach for that code, but I'm glad it's working :)
Gavilan has left #ruby [#ruby]
<bambanx> gn guys
bambanx has quit [Quit: Saliendo]
dhruvasagar has joined #ruby
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
cezar has joined #ruby
ipoval has quit [Quit: ipoval]
kil0byte has quit [Remote host closed the connection]
cezar has quit [Client Quit]
<pradeepto> bnagy: i am not too happy with it as well
<pradeepto> bnagy: but which part did you find it dubious? I can try and fix maybe.
fukushima has joined #ruby
kil0byte has joined #ruby
indy3 has joined #ruby
<indy3> ruby sucks php rules
<indy3> php +1
<indy3> ruby is for unproductive twats
<indy3> who never meet the deadline
<indy3> mwahaha
<TTilus> how do i set executable name, $0 that is, on jruby command line?
<TTilus> id love to preserve $0 from wrapper shell script to jruby process
jenrzzz-mac has joined #ruby
burgestrand has joined #ruby
<Hanmac> in ruby you can avoid errors, in php you can hide errors
<bnagy> pradeepto: I just didn't see what you gained over either using a config file in YAML or something (human readable) or just calling those methods on an instance of your object
workmad3 has joined #ruby
<bnagy> but I can't say I invested huge amounts of time on my analysis, so I'm probably missing something
<pradeepto> bnagy: agreed @ yaml, i wanted to go that route for a brief moment, but thought I should try and write it on my own. You can call it NIH.
S2kx has quit [Read error: Connection reset by peer]
senny has joined #ruby
S2kx has joined #ruby
<TTilus> hum, if somebody at #ruby-lang would know...
fr0gprince_ has quit [Read error: Connection reset by peer]
fr0gprince_ has joined #ruby
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
danheberden has quit [Ping timeout: 245 seconds]
rcs has quit [Ping timeout: 245 seconds]
<horseman> TTilus: probably #jruby
burgestrand has quit [Quit: Leaving.]
danheberden has joined #ruby
yugui has quit [Ping timeout: 245 seconds]
graspee has joined #ruby
gmci has quit [Ping timeout: 245 seconds]
rcs has joined #ruby
<TTilus> horseman: already tried, pretty quiet there currently
yugui has joined #ruby
wallerdev has quit [Quit: wallerdev]
<horseman> TTilus: tweet @headius
prtksxna has joined #ruby
prtksxna_ has quit [Read error: Connection reset by peer]
<TTilus> horseman: not a bad idea
TheHunter_1039 has joined #ruby
<vectorshelve> horseman: still bored riding the horse ? :)
<Hanmac> TTilus: horseman is baned at ruby-lang ... i let you guess why
<horseman> vectorshelve: Yeah, can i ride u
<vectorshelve> horseman: Fuck You :D
<vectorshelve> Hanmac: coz they found out that he is animal oriented :D ryt ?
thecreators has quit [Quit: thecreators]
<Hanmac> no, because he keep trolling
davidpk has quit [Quit: Computer has gone to sleep.]
bglusman has joined #ruby
<horseman> vectorshelve: actually Hanmac is completely wrong, i was banned because i posted one naughty image. It had nothing to do with trolling, i didnt troll much there
<vectorshelve> horseman: u r a nice guy
Eldariof59-ru has quit []
dnyy has quit [Remote host closed the connection]
banghouse has joined #ruby
<horseman> vectorshelve: thanks, i know. can u give me the recipe for an interesting (i.e non cliche like chicken tikka) indian curry
<eph3meral> is there an easy "builtin" way to get a string that consists of a repeated character n times?
<horseman> eph3meral: "a" * n
<horseman> vectorshelve: no, NOT chicken tikka :)
<Hanmac> eph3meral: "a" * 5 #=> "aaaaa"
<vectorshelve> horseman: try this -> http://www.aayisrecipes.com/2009/04/08/paneer-butter-masala/ I love paneer
<eph3meral> hep, thanks horseman and Hanmac
<horseman> vectorshelve: can u give me a recipe for a pork curry
<eph3meral> s/hep/yep/
<vectorshelve> horseman: is there a ruby method that wu return the count of substring present in a string like "ababab" should return 3 for input "ab"
<vectorshelve> Hanmac: ^^
<vectorshelve> horseman: ok countSubstring would do it
<vectorshelve> "the three truths".scan("th").length
<vectorshelve> would return 3
dnyy has joined #ruby
prtksxna_ has joined #ruby
<horseman> vectorshelve: what is paneer
<horseman> vectorshelve: can you describe it in english
prtksxna has quit [Read error: Connection reset by peer]
<vectorshelve> horseman: fresh cheese
c0rn has joined #ruby
<indy3> fuck returns shit from your asshole if its anal
<vectorshelve> horseman: Cottage cheese
<vectorshelve> horseman: http://en.wikipedia.org/wiki/Paneer
<indy3> now im speaking your language
tormar has joined #ruby
<horseman> vectorshelve: can you give me the recipe for a pork curry
<indy3> trololololo
<horseman> vectorshelve: i want it frm u
igotnolegs has quit [Quit: Computer has gone to sleep.]
<indy3> anyway, i just want to say, anyone who is a mod of #ruby sucks big fat dick
<indy3> in freenode
<horseman> vectorshelve: your fellow indian brother, indy3, is being naughty. try to calm him
twqla has joined #ruby
<indy3> ahahaha
kaspernj has joined #ruby
indy3 has quit [Read error: Connection reset by peer]
MrGando has joined #ruby
tormar has left #ruby [#ruby]
harukomoto has quit [Ping timeout: 245 seconds]
kil0byte has quit []
jprovazn_away is now known as jprovazn
alanp has quit [Read error: Operation timed out]
omry has quit [Ping timeout: 245 seconds]
azm has quit [Ping timeout: 256 seconds]
<horseman> vectorshelve: do u eat pig
<vectorshelve> horseman: occasionally
alanp has joined #ruby
tayy has quit [Remote host closed the connection]
yuka has joined #ruby
<horseman> vectorshelve: i thought they were considered dirty animals in india
<horseman> vectorshelve: http://i.imgur.com/OEYen.gif
<vectorshelve> horseman: they are I rarely eat them and when I do.. I make sure I have them from 5 star hotels :P
gmci has joined #ruby
Bish has quit [Ping timeout: 245 seconds]
kstephens has quit [Ping timeout: 245 seconds]
jmeeuwen has quit [Ping timeout: 245 seconds]
_whitelogger has quit [Ping timeout: 245 seconds]
_whitelogger has joined #ruby
xsdg has quit [Ping timeout: 245 seconds]
moeSeth has quit [Ping timeout: 245 seconds]
SeanTAllen has quit [Ping timeout: 245 seconds]
Dr4g has quit [Ping timeout: 245 seconds]
jeedey has quit [Ping timeout: 245 seconds]
dtang_ has joined #ruby
dross_ has joined #ruby
jmeeuwen_ has joined #ruby
philcrissman_ has joined #ruby
bglusman_ has joined #ruby
krzkrzkrz has joined #ruby
moosya_ has joined #ruby
UNIXgod_ has joined #ruby
krzkrzkrz has quit [Client Quit]
Bish_ has joined #ruby
kstephens_ has joined #ruby
deobald__ has quit [Ping timeout: 260 seconds]
indy3 has joined #ruby
<indy3> fuck
benwoody_ has joined #ruby
ryanf has quit [Quit: leaving]
<vectorshelve> horseman: u r dirty
rpgsimmaster has joined #ruby
<indy3> vectorshelve, you are dirty
icyfenix has joined #ruby
adeponte has quit [Remote host closed the connection]
kenneth has joined #ruby
gilead has joined #ruby
moosya_ is now known as moosya
conceal_rs_ has joined #ruby
akem has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
jmeeuwen_ is now known as jmeeuwen
gabrtv- has joined #ruby
charliesome has joined #ruby
kmwhite has joined #ruby
fred has joined #ruby
KitsuneDrag0n has joined #ruby
Mon_Ouie has joined #ruby
kalleth has joined #ruby
eam has joined #ruby
robbyoconnor has quit [Ping timeout: 244 seconds]
<indy3> vectorshelve, you are very dirty
xsdg has joined #ruby
<kenneth> hey, so i know it's considered bad practice, but has anybody actually tried patching NilClass to allow for nil-chaining?
freakazoid0223 has joined #ruby
cid404 has joined #ruby
fred is now known as Guest48957
Guedes has joined #ruby
<kenneth> in a production setting that is
madhatter has joined #ruby
<indy3> kenneth, I wouldn't allow nil chaining because it means nil to me
jeedey has joined #ruby
sec_ has joined #ruby
graspee has joined #ruby
asuka_ has joined #ruby
araujo has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
linduxed has joined #ruby
<bnagy> kenneth: why on earth would you want that?
epochwolf has joined #ruby
<indy3> seriously
<indy3> what a noob
<yuka> :) i got a noby question aswell
<indy3> yuka, go please
<kenneth> bnagy: because i'm used to it in objective-c, and it's a fantastic feature.
<yuka> i cant get this redmine to work gettin this stupid error The directory "/var/www" does not appear to be a valid Ruby on Rails application root.
<yuka> i know its not right channel but
<yuka> redmine channel is bummer
<bnagy> kenneth: what's the ruby snippet you're thinking of?
<yuka> and nobody wants to help
hoelzro|away is now known as hoelzro
<indy3> yuka, that is because ruby has a limitation with that, sorry
<kenneth> i've read plenty of articles discussing it, and saying it's a bad idea, but i haven't seen of any examples actually breaking because of it
<yuka> indy3 what u mean?
keyvan has joined #ruby
<bnagy> yuka: ignore indy3 :) However, you want to try #rails or #rubyonrails, probably
Facefox has quit [Ping timeout: 250 seconds]
<kenneth> bnagy: class NilClass; def method_missing(n); self; end; end
<kenneth> the short version
UNIXgod_ has quit [Quit: leaving]
<yuka> bnagy i tried but the OP guy on those channels, is very egoistic and when i asked question he just said go to redmine , and there nobody answers
_whitelogger_ has joined #ruby
elake has joined #ruby
<kenneth> the best i can imagine is doing something like something = forgivingly { {}[:hello][:world] }
_whitelogger has quit [Remote host closed the connection]
epochwolf has joined #ruby
TTilus has joined #ruby
madhatter has joined #ruby
nilg` has joined #ruby
blacktulip has joined #ruby
<kenneth> where def forgivingly &block; return block.call(); rescue NoMethodError => e; return nil; end
<indy3> FUck you'
<bnagy> kenneth: no that's horrible :)
pigoz has joined #ruby
<indy3> FUCK YOUUUUUUUU
<kenneth> (something like that, i have not tried it)
<bnagy> kenneth: if you want to go through rescue you can just put it inline foo[:bar][:baz] rescue nil
<bnagy> but I think rescue will be really slow
<kenneth> bnagy: right, but then i'm rescuing everything, not just NoMethodError
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsfsdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsfsdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<kenneth> ideally i'd prefer rescuing just NoMethodError for nil
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
<thomas> indy3: please stop
<indy3> sdfsdfsdfdsfsdfsdfdsfsdfsdfsdfsdfsafsdfsdafsafasdfdsf
indy3 has quit [K-Lined]
<kenneth> ahh, some air :)
<bnagy> kenneth: not sure what else could go wrong, but you can still rescue subtypes inline, can't you?
<kenneth> oh, probably
<bnagy> hm maybe not?
<kenneth> i'm kind of surprised it isn't default behavior for ruby to behave this way, since ruby is in most ways usually a pretty concise language
<kenneth> one of my favorite objc features, i must say
<bnagy> well that's kind of one of the things nil is there for - to have no methods
<bnagy> shows up a lot of errors that would otherwise be very hard to debug
<horseman> bnagy: hey naggy, do u love me
Ammar01 has joined #ruby
<bnagy> is it 'crazy day' and I missed the memo?
<kenneth> right, but it also turns my beautiful one liner into something a little more annoyingly complex
<Hanmac> bnagy rescue nil is bad ... because some expeptions are not designed for being rescued siliencety
<kenneth> bnagy: here's my current use case (ignore my use of a global) https://gist.github.com/f15484c5c3aaa7e69276
<bnagy> Hanmac: rescue nil is fine if you use it carefully, the really bad exceptions are StandardErrors
SeanTAllen has joined #ruby
bluOxigen has joined #ruby
<relix> hey guys, I have a question about the best way to do something
anildigital_work has joined #ruby
<bnagy> kenneth: you can always use a Hash and give it a default value, btw
<hoelzro> relix: go nuts
<kenneth> bnagy: you mean something à-la python's defaultdict?
<relix> I have a class Plan, and a class Subscription. They're both abstract classes, meant to be inherited from to create e.g. FreePlan with corresponding FreeSubscription class, and then FastspringPlan and FastspringSubscription class (Fastspring is a payment gateway)
<Hanmac> bnagy and as far as i knew StandardErrors are captured too with rescue nil
<relix> they'll contain specific logic for e.g. talking to the Fastspring API
<bnagy> kenneth: h=Hash.new(nil)
<bnagy> Hanmac: I meant are _not_ StandardErrors, sorry
<relix> what's the best way to connect FreeSubscription with FreePlan, and FastspringSubscription with FastspringPlan as DRY as possible
<relix> I'm wording this weird
benyarb has joined #ruby
berkes has joined #ruby
cesario has joined #ruby
<relix> I want to be able, in an instance of FreeSubscription, to write code like "self.master_plan_class" and that would point to FreePlan, while in FastspringSubscription instances it would point to FastspringPlan
<hoelzro> relix: what exactly do you mean by "connect"?
MrGando has quit [Quit: Bye]
omry has joined #ruby
<relix> I got as far as "@@plan_class = FreePlan"
<kenneth> relix: wouldn't you have some kind of relationship between the objects? shouldn't that be enough?
<hoelzro> relix: if a plan object has a subscription, you shouldn't have to care what clas that subscription is, or?
<hoelzro> as long as it acts like a subscription
<bnagy> relix: @@vars will completely break what you're trying to do, for a start
<relix> bnagy: right because of the inheritence thingy?
<Hanmac> reklix: class FreeSubscription; def self.plan_class; return FreePlan;end;end
poindontcare has joined #ruby
Ben__ has quit [Ping timeout: 248 seconds]
<kenneth> relix: plan = new FreePlan; plan.subscription = new FreeSubscription; isn't that sufficient? or have it be reciprocal if you must
<relix> kenneth, hoelzro, the use case I'm imagining right now is a method FreeSubscription#can_upgrade_to?(plan) that returns true if plan is FreePlan, and false otherwise,
L-----D has quit [Quit: Leaving]
<relix> a FreePlan*
<bnagy> hm this sounds architecture broken
<relix> Hanmac: is there a better way though, using the name of FreeSubscription (e.g. extract "Free", put "Plan" after it) or is that not recommended
<Hanmac> class Plan; def free; false;end;end; class FreePlan <Plan ; def free; true;end;end;
<Hanmac> then you chould check for plan.free
<bnagy> relix: I would go back and really think about if you need inheritance here
<kenneth> bnagy: i think in my case the easiest solution is to just rescue; 0 at the end of the method. it's dirty, but it will take care of the rare issue
Dr4g has joined #ruby
<bnagy> relix: I don't see why you can't have one base class and then differentiate with attributes on the objects
<bnagy> this kind of twisty inheritance and linking "smells" wrong to me
<relix> bnagy: there's a lot of specific code related to payment gateways
<bnagy> delegate it
<relix> hmm
TheFuzzb_ has quit [Ping timeout: 260 seconds]
bondar has quit [Remote host closed the connection]
<bnagy> or mix in the gateway specific stuff
TheFuzzball has joined #ruby
jimeh has joined #ruby
<relix> yeah, it could work, I'll have to think about it
<relix> thanks for the help guys!
ziyadb has joined #ruby
<bnagy> no worries
<kenneth> oh i was wondering why my code did not match that from the book
<kenneth> looks like the book has a freakin' error in it
<eph3meral> relix, use active_merchant, call it a day, rinse repeat :)
<eph3meral> relix, sry, just came back, what was your question?
bondar has joined #ruby
<relix> eph3meral: heh, active_merchant has zilch documentation, I'm hesitant to use it, plus it doesn't support Fastspring I think, also I'm just delegating the CC shit to Fastspring because as a european instance it's hard to get a merchant-account to get CC support, and paypal sucks
bondar has quit [Client Quit]
<kenneth> btw, i absolutely love how ruby supports map and reduce
<kenneth> FUCK YES
<kenneth> :)
<relix> fistpump
<kenneth> you can do a lot of neat functional programming type stuff in ruby, it's fantastic
<horseman> kenneth: are you new to ruby?
cha1tanya has quit [Ping timeout: 246 seconds]
<kenneth> horseman: no, i've be using it for 3 years or so now, but very sparingly
<bnagy> he's just new to mdma
<kenneth> horseman: my day job is still mostly in objective-c (yay) and php (eww)
<yuka> :S cant make it work
<kenneth> these days i try to use ruby and clojure as much as i can, but it's still not quite enough for my tastes
<kenneth> bnagy: MDMA is pretty great
<yuka> is there any valid tutorial on how to make ruby on rails work on apache
<relix> <3 MDMA
<relix> (get it?)
<kenneth> bnagy: not quite sure how it relates to programming tho
cha1tanya has joined #ruby
<horseman> kenneth: objc is pretty cool
<relix> I'm planning on learning objc sometime in the near future
<horseman> kenneth: osx os ios dev?
<horseman> or*
<kenneth> horseman: it's neat. in many ways, i love it. great language design. apis are annoyingly verbose, though
<relix> is it hard? I've done C/C++
<horseman> relix: if u know C and Ruby, you pretty much already know objc
<horseman> objc is like a bastard child of C + Ruby
<Hanmac> yuka you are in the wrong channel, read the topic
<yuka> i tried in al lchannels
<yuka> no answers
<kenneth> horseman: started osx before iOS existed, but the money is mostly in iOS these days, so that's where i am
<yuka> i bet there is alot of people in this channel who could help but they cba
<Hanmac> in rubyonrails too?
<kenneth> horseman: i'm architect at chartboost.com
<relix> horseman: sweet.
<yuka> yeah i did ask there
<yuka> they said its redmine problem as in redmine
<yuka> and when i ask there nobody replies
hoelzro is now known as hoelzro|away
<horseman> relix: objc has pretty much the same object model as ruby, it derives from smalltalk too
<yuka> its always same shit :(
<horseman> so it feels very rubyish
<kenneth> relix: if you have a good C foundation, you'll be better than 75% of the objc devs out there. ruby will be a great complement to that. objc is somewhere in between the two
<UNIXgod> horseman: I'm look for a tutorial on unit/test. Do you have any recomendations?
<bnagy> yuka: the internet is a horrible place, how dare people not give you instant help?
<relix> awesome, looks like I'm halfway there hah
<yuka> its not about instant help
<bnagy> yuka: personally if I could help I would, but all I would be doing is going to google, so
<horseman> UNIXgod: no sorry, but just look at the docs for minitest or rspec, it's pretty straight forward
<relix> yuka yes #rubyonrails is hit and miss, more miss than hit imo, and sometimes they can be very, very patronising
<yuka> it stun me how people can be egoistic, if i could help somebody i would no matter the channel
cha1tanya has quit [Excess Flood]
<kenneth> objective-c does some things right that ruby doesn't and vice-versa. but both are awesome dynamic languages. in c you can drop down to c and get down and dirty if you'd like, which is awesome. and you also don't have to deal with a silly garbage collector doing silly things
<horseman> kenneth: have you considered rubymotion for ios dev?
cha1tanya has joined #ruby
<kenneth> horseman: i've looked at it, it looks very well done
<UNIXgod> horseman: ok
<horseman> kenneth: have you tried to roll up in Tiffany Owyang, she looks cute
<Hanmac> kenneth: if you want you could write C and even C++ stuff to increase the power of ruby
<relix> yuka: checked out your Q on #ror, can't help you I'm afraid
<kenneth> horseman: but i'm more comfortable in objc anyway
<bnagy> yuka: yeah but the rest of the people that aren't here to read about you helping some guy with his electrical wiring would be upset
<bnagy> which is why we have different channels
<horseman> kenneth: do you have much experience with xcode 4?
heftig has quit [Quit: leaving]
<kenneth> horseman: she is cute. she has a boyfriend :p but who knows, once one of us quits, i will do it
<yuka> i dont mind asking in different chan, but everytime i got some problem, there seem to be same shit over and over, people just directing me to another channel, and on the end i spend 4hours before i find one person who tells me this lame little trick like add "/" at end and it works
<horseman> kenneth: goodluck there! i'd put her on toast and have her for breakfast
<kenneth> bnagy: there's some truth to what yuka said though. i find some channels to have very unpleasant members. when i have to discuss objc issue, i always head to the #macdev channel, for example, because people in the #iphonedev channel tend to be mostly dicks who think they're smarter than you are
<Hanmac> yuka you could ask/look there : http://www.ruby-forum.com/forum/rails :P
cha1tanya has quit [Client Quit]
<horseman> kenneth: i have trouble with autolayout, are you skilled with it?
mdw has joined #ruby
<kenneth> bnagy: i guess it comes with the territory when you're dealing with newbies all the time. but then again, i've asked newbie questions in pretty much every channel, and some are much nicer than others. (#ruby is one of the good ones ;)
<Hanmac> kenneth: you most know ... iphone users are mostly dicks ... because they have enough money to by an iphone
<Hanmac> to buy
<kenneth> Hanmac: money <-> douchiness is a false correlation
khakimov has quit [Quit: Computer has gone to sleep.]
<kenneth> horseman: auto layout is a nightmare. i gave up IB in general, i lay out all my views in code now. much cleaner and bug-free
<bnagy> kenneth: and that is a bad thing, I agree, and --karma to those communities
<bnagy> but that's a different argument to 'you guys are friendly so it's OK if I just ask OT questions here'
<kenneth> true
<seoaqua> anyone can contact Matz ,the author of Ruby? i want him to help combine the two channels #ruby and #ruby-lang
<horseman> kenneth: but how do you set rules for resizing?
<horseman> kenneth: you're sitll using the constraint API?
<bnagy> seoaqua: that is not Matz' job
<Hanmac> the problem is in a big comiunity like ruby you have someone like shevy, bnagy, and maybe me .P .... but on the other hand you have someone like horseman ...
<seoaqua> bnagy, he has the power
<bnagy> seoaqua: people have tried etc
<horseman> kenneth: or do you just use springs and struts?
<bnagy> seoaqua: wtf, no he doesn't
<bnagy> what does writing a programming language have to do with IRC politics?
<kenneth> horseman: nope, i just set frames in code. when i need flexible resizing, i'll use springs and struts
<Hanmac> seoaqua: he is on github https://github.com/matz
<seoaqua> bnagy, or the person that can revise the webpage of ruby-lang.org will help too
<horseman> kenneth: ok,last off-topic question :) do you use NSSplitView? what's you opinion of it? i have trouble with it, and wondering if there is a better solution or if im just using it wrong
Jb_ has quit [Ping timeout: 244 seconds]
<kenneth> but most of the time i will just do some quick math on the frame instead of using spring / struts
<seoaqua> Hanmac, i sent him an email to matz@ruby-lang.org a week ago, with no reponse.
Morkel has quit [Quit: Morkel]
<bnagy> I'm stunned :)
<kenneth> horseman: couldn't tell you, i don't recall using nssplitview in what must be like 4 years
<kenneth> :p
Helius has joined #ruby
<Hanmac> he is busy writing a new ruby interpreter (mruby) ... maybe so that rails does not work anymore :P
petercs has quit [Ping timeout: 252 seconds]
seoaqua has left #ruby ["Leaving"]
seoaqua has joined #ruby
<seoaqua> Hanmac, isn't mruby only for mobile devices? what is the connection to rails?
<relix> yo dawg, I heard you like rails, so I'm building mruby so you can rails while you rails
<Hanmac> mruby should work on other hardware too.
<Hanmac> the rails part was maybe a joke :P (i dont like rails)
* bnagy writes in his logbook. "Day 2548: Hanmac made a joke today."
elhu has joined #ruby
<seoaqua> Hanmac, got it:)
<seoaqua> what's the msg of logbook? how did he do that?
* Hanmac tries to be funny ... it was not very effective
<seoaqua> ok, some kind of actions ? what's the code?
<Hanmac> begin your message with /me and it looks like a status message
yankov has quit [Quit: yankov]
bambanx has joined #ruby
<bambanx> sup
<bambanx> am back ii cannot sleep :/
<bnagy> Hanmac is doing pokemon standup
gregorg has joined #ruby
<bnagy> get popcorn ;)
<bambanx> lol
<bambanx> nice
<bambanx> i was trying my vim looks like this http://desintegr.free.fr/dokuwiki/lib/exe/fetch.php?cache=cache&media=linux:vim:monokai:monokai.png
* seoaqua looking for Matz
<seoaqua> similar with my theme
<bnagy> looking for Matz in all the wrong places, no fine codes just ugly braces {}{}{}
hoelzro|away is now known as hoelzro
francisfish has joined #ruby
Helius has quit [Ping timeout: 245 seconds]
<kenneth> Hanmac: i think anybody who's a sensible developer dislikes rails
<kenneth> bambanx: meh, i don't like split views, i like tabs better :)
CheeToS has quit [Ping timeout: 265 seconds]
<bambanx> :P
<bnagy> yay tabs
<bnagy> split views suck, that's what monitors are for
<bambanx> i like hot girls
MrGando has joined #ruby
<kenneth> getting some nice shortcuts setup for vim tabs and quick opening of files using the ctrl-p plugging (remapped to <leader>p) made my vim productivity increase 10x
<horseman> kenneth: who does the design-side of your cocoa apps? (who makes it look nice)
bashdy has joined #ruby
<kenneth> i have \o set to open new tab, \w to close buffer (but not :quit on last buffer), \[ \] to switch tabs, and \p load up my ctr-p fuzzy file finder
<kenneth> horseman: depends, some i do myself, some i've worked with designers
<kenneth> i technically have a graphic design degree :p
<horseman> kenneth: dont the designers need to be competent with IB? it seems a bit much to ask most designers..
omry has quit [Ping timeout: 246 seconds]
<kenneth> or quasi-degree, dropped out 3 years in
<kenneth> horseman: nah, they just need to have a basic understanding of how assets are cut up and used
<bambanx> kenneth, show me your cocoa
asuka is now known as asuka_
<kenneth> if they can prepare assets for web, they can prepare assets for cocoa
<kenneth> bambanx: http://bit.ly/KSt0OM
ukwiz has joined #ruby
<bambanx> lol
<kenneth> bambanx: kswizz.com getmacchiato.com ilaughapp.com
<bambanx> thanks
bashdy has quit [Client Quit]
Dreamer3 has joined #ruby
Dreamer3 has quit [Remote host closed the connection]
<bambanx> i was see macchiato a few time ago :) , nice
Vainoharhainen has joined #ruby
<_br_> Someone here has some experience with Apache Thrift + http + rack? Everythings works dandy, but when I'm trying to integrate Rack::Throttle I get this should react to each error. According to some posts the body needs to be responding to #each and returning strings. Fair enough, but when I do wrap it in [] the rack shuts up but thrift complains that it doesn't know the protocol anymore D:
<_br_> Whats the right choice now? Wrap the client interface in rack? Mess around with the thrift implementation? *sign*
<kenneth> _br_: since were are thrift and http supposed to be compatible? they serve completely different purposes
tango73 has joined #ruby
<tango73> ciao
<_br_> kenneth: thrift has several layers and allows you to switch out the transport as you need. Exposing thrift over http is the best way if you want to expose some thrift api to the public world.
<bambanx> nice work kenneth
tango73 has left #ruby [#ruby]
<kenneth> _br_: hmm, interesting, i'd never heard of exposing thrift over http. can't really help you there, unfortunately. I stay as far away from thrift as possible, it has only caused me pain in the past
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
<kenneth> bambanx: thanks
<_br_> kenneth: wow, really? Interesting, please do tell. What kind of problems did you have?
<_br_> kenneth: Switched to plain rest now? Or protobuf?
<yuka> gave up on rails, using webrick works instantly
<yuka> :o
<kenneth> _br_: these days i'm more into zeromq
bashdy has joined #ruby
<_br_> yuka: webrick and rails? Thats apples and oranges in terms of production server quality.
<kenneth> protobufs have their own issues, and rest is really lousy for internal apis
<yuka> _br_ i know i couldnt make passenger to run with my redmine
<yuka> always some error
<yuka> using webrick works. .
<_br_> kenneth: Ah, I see. hm, interesting I had the opposite opinion, the thrift api works quite well for me. Hm depends probably on the usage scenario. ZeroMQ is nice as well.
<kenneth> yeah, it probably depends. i still have to use thrift because of scribe, so i'm not completely clear of it, unfortunately
diegoviola has joined #ruby
<_br_> yuka: Try mongrel should be at least better for production than webrick. Webrick is slooooooww
<yuka> i disabled some avashi daemon
<kenneth> thrift is especially awful in php, where it auto-generates some really awful classes for you that you're supposed to use
<yuka> and its faster then my new website
<yuka> :D
ephemerian has joined #ruby
<kenneth> and coding thrift services (in java) is kind of a huge pain. anything that causes me to use eclipse makes me sad, though.
<_br_> kenneth: Ah, I see. Well, its true the client libs need a lot of development.
<yuka> is there a good tutorial _br_ how to make mongrel work on apache2 (ubuntu 11.10)
<_br_> yuka: I would suggest unicorn + mongrel. That thing is fast.
zz_chrismcg is now known as chrismcg
cha1tanya has quit [Ping timeout: 252 seconds]
mdw has quit [Remote host closed the connection]
c0rn has quit []
<_br_> yuka: There is plenty just search a bit. I'm running a site here on NGINX + Unicorn + Rack etc. and its ridicoulous, because it works nicely over all processors. And nifty feature, you can do hot-code deploys.
joppe has joined #ruby
<_br_> kenneth: Eclipse for thrift? Really? Eclipse is just a glorified editor why would you need it for thrift?
bosphorus has joined #ruby
cha1tanya has joined #ruby
<yuka> _br_ i understand but i am just gonna use redmine for simple bug report by my users.. i dont want such complex installations i already spent 2 hours installing this thingie.. and trying to make stupid passenger to work.. now the tutorials i find on google, have like 15steps and 10 different installs for making stuff work
<yuka> isnt there anything simpler
<_br_> kenneth: hm, wonder if I'm running into these issues later as well. Currently I've just touched Python, C++, Ruby, ObjetiveC with Thrift and I'm fine so far.
roolo has joined #ruby
<_br_> kenneth: thanks for the heads up tough!
<kenneth> _br_: because the service i was working on was in java. it was a service based on cassandra, which is also a pain to use. didn't pick java, but coding java without having eclipse to auto-complete all the stupid shit you have to type is insane :p
<kenneth> _br_: as for making an api public to the world, i'd use either HTTP or socket.io personally, and have a thin app layer to wrap the internal api
<_br_> yuka: if you expose redmine to the world using webrick, then threre might also be a security issue. Not sure about it though.
<yuka> _br_ i just want to make it avail in internal network
<_br_> yuka: Its weird that you can't get the apache2 passenger combo to work, worked for me out of the box
<_br_> yuka: that should be fine then I guess
<yuka> as for passenger i got the : The directory "/var/www" does not appear to be a valid Ruby on Rails application root
<yuka> and i tried thousand things to fix
<yuka> asked in 10 channels
<yuka> nobody could help me
<wereHamster> so, what should I do if my script requires ruby1.9? Using 'env ruby1.9' in the shebang line won't always work (rvm for example).
<bnagy> wereHamster: fail if RUBY_VERSION < "1.9"
<_br_> kenneth: hehe, totally agree, java is kind of verbose.
<kenneth> _br_: http is my use case is req/resp or rest/crud type traffic, socket.io for real-time communication
<wereHamster> I could check the ruby version at runtime and simply exit with an error if it's not 1.9.. but then I'm delegating work to the user. Is there no better solution?
kil0byte has joined #ruby
tatsuya_o has joined #ruby
<_br_> kenneth: HTTP is fine, I'm wrapping my thrift through http, since the httpd are nice and allow me to do alot of things
<bnagy> wereHamster: what's your proposal? Go digging through their filesystem until you find a 1.9 runtime at any cost?
<_br_> kenneth: socket.io scales? I heared bad stories about it being slow?
berserkr has joined #ruby
<bnagy> use a local privesc, install 1.9 and then run it?
<wereHamster> bnagy: no idea, that's why I'm asking :)
workmad3_ has joined #ruby
<yuka> _br_ you maybe know how to fix the error
<bnagy> wereHamster: Just fail if they don't have the version you need. :) The rest is the user's problem / decision
<kenneth> _br_: i've never gotten to use it at large scale, so i can't really attest to that. but i mean, what's the alternative if you want to support javascript clients?
<_br_> wereHamster: I suppose the best practice, is /usr/bin/env ruby ?
cha1tanya has quit [Ping timeout: 240 seconds]
tatsuya_o has quit [Read error: Connection reset by peer]
tatsuya_o has joined #ruby
<_br_> yuka: dunno, maybe. Try the #channel, there are alot of smart peeps here :)
<wereHamster> _br_: yes, that's what I have right now.
<kenneth> _br_: good thing about socket.io is i don't really have to worry if my client is a native app or a browser app, and if the browser supports web sockets
MrGando has quit [Quit: Bye]
fabrice31 has joined #ruby
<_br_> kenneth: javascript? True, http is the way to go then yes. Well, its not perfect I give you that. Hope I don't run into the same issue otherwise there'll be alot of recoding. Just found it interesting that evernote exposed there services via http and its works quite well. NGINX + Unicorn for load balancing etc.
<shevy> wereHamster well simplest solution would be to check for RUBY_VERSION in a script, but it seems you want an even earlier check? the problem is, shebang is usually not versioned at all
<wereHamster> I'll go with the version check at runtime
<shevy> :)
<_br_> kenneth: Thats pretty neat yep. Did you see meteor framework ?
<kenneth> if i really need to scale and socket io didn't cut it, and http didn't either (for a real-time app like a game), i'd probably write my own protocol on top of sockets
<_br_> kenneth: ahh reinventing the wheel? Dunno, if thats the right path.
gyre007 has joined #ruby
<kenneth> sometimes it's the best option, just don't do it until you absolutely have to
<_br_> Thats true. Btw. did you see the api documentation from zencoder? Really, nice work those guys did there.
<kenneth> but yeah, i mean most apis are perfectly fine under http, and there's tons of tool for scaling http, like you said
<kenneth> i use nginx + haproxy for load balancing our http api at chartboost
bambanx has quit [Ping timeout: 260 seconds]
<kenneth> have not seen it, will check it out
<_br_> nginx and haproxy is something I got running here too, pretty nice combo.
<shevy> apache forever!!!
<_br_> unicorn as an app server is quite interesting though
<kenneth> yep, i wish i could do everything in nginx, but it's just not good enough at load balancing
<kenneth> it's better at routing, which is what i use it for
<_br_> shevy: lol, nginx is apache1 with ripped out guts and added eventmachine.
<_br_> shevy: welcome to the future ;D
<shevy> I wouldn't mind if apache would go back to its root
workmad3 has quit [Ping timeout: 246 seconds]
<kenneth> apache is a mess
<shevy> they changed the httpd.conf format file. I tried for an hour to fiddle around with it and have it work like it used to work... then I gave up and stopped looking for "change"
<_br_> kenneth: Well, its still pretty young give it some time. But haproxy is pretty battle tested wonder if you ever what to get rid of it.
<kenneth> it's ridiculous, we have like 30 app servers and waste tens of thousands every month all because apache scales so awfully
<_br_> shevy: reinventing the wheel is a common sickness unfortuantely :(
<shevy> I am tired of all the different formats in use. I am going to write a ruby script that generates the config format I need (for whatever... httpd, nginx, lightppd, cherokee) and store the shit in a yaml file instead
Morkel has joined #ruby
<kenneth> but our bad codebase relies on apache's mod_php and we can't switch to nginx for the final app nodes :(
<_br_> shevy: wow that would be pretty cool. Please do tell where I can send patches.
<shevy> hehehe _br_ :)
<hoelzro> shevy += 1
<_br_> kenneth: ah, php ... yeah its a joy.
<kenneth> _br_: it's not that i want to get rid of haproxy, it's more that i don't like having 4 proxy hops for the request to get to the final app node
Guest28433 has joined #ruby
<relix> shevy: there's a relevant XKCD about that
<relix> as always
<relix> let me find it for you
<kenneth> right now we have ssl termination and lb failover on EBS, -> then nginx router/lb -> then haproxy lb -> finally apache2/mod_php app node
sepp2k has joined #ruby
<relix> shevy: http://xkcd.com/927/
<_br_> kenneth: hm, its too much yes.. well, not sure what's the best solution there. As long as the request stay reasonable fast.
<kenneth> it works fine, it's just kinda dirty
<shevy> yeah relix
snearch has joined #ruby
<_br_> kenneth: urk. too many hops yeah I understand now
adambeynon has joined #ruby
<kenneth> we could probably remove EBS, but that'd at the expense of of adding risk of significant downtime in case of a nginx failover
bashdy has quit [Quit: leaving]
<kenneth> (basically having to wait for DNS propagation)
<kenneth> and manual failover
<_br_> hm, well it depends for how many 9's you are aiming.
<kenneth> we need nginx for routing, so that must stay. we need haproxy for reliable load balancing and failover, so that must stay
ph^ has joined #ruby
<kenneth> and then there's the final apache nodes
<_br_> Can you simplify the mod_php ?
<kenneth> we tried moving to nginx + php-fpm but that didn't work because we rely on some apache-specific things
<kenneth> like apache_fetch_headers
counterbeing has quit [Read error: Connection reset by peer]
<kenneth> anyway, it's a mess
<_br_> kenneth: puh. well no use then
<kenneth> we're re-architecting our entire backend anyway to be distributed zeromq services
<_br_> I think I have to take a closer look at zeromq if you think is so much nicer than $rpc stuff out there.
<kenneth> hopefully we'll be able to have super-thin api endpoints whose only job it is to use zeromq services
ph^ has quit [Remote host closed the connection]
<kenneth> and can scale back from 30 or so app nodes to a handful or less
<_br_> any opinion on zeromq vs rabbitmq?
<kenneth> it's very different
<kenneth> the MQ is a misnomer
<_br_> Interesting
<kenneth> because zeromq is not really a messaging queue, it
<kenneth> s more of a messaging library
prtksxna has joined #ruby
<bnagy> it's very easy to replace rabbitmq with zmq though
prtksxna_ has quit [Read error: Connection reset by peer]
<bnagy> but zmq supports many other patterns as well
<_br_> kenneth: nice, thanks will watch that later :)
<kenneth> i highly recommend watching this talk. it's in php because it was a php conference, but the language is irrelevant and it's a fantastic introduction to the zmq concepts
<_br_> well, these days who cares about the languages. It should just work properly and not be braindamaged.
<bnagy> or just read the 0mq guide, it's my new nigh watermark for lib documentation
<bnagy> *high
nilg` has quit [Remote host closed the connection]
<kenneth> yeah the docs are fantastic, too
<kenneth> and you know what, i absolutely love the fact that they're in c
<kenneth> :p instead of being in python by default like pretty much everything else out there
akem has quit [Ping timeout: 250 seconds]
<_br_> Well, these days the C people have it difficult :(
<kenneth> _br_: php is pretty brain damaged
<_br_> kenneth: harhar, I love the bugs they always find. Recently, it turns out that arithmetic was broken in PHP. :D
<kenneth> yeah
ananthakumaran1 has joined #ruby
<kenneth> jesus
<kenneth> picking php has probably cost us > $1M in stupid mistakes and scalability issues
<kenneth> and lost revenue
ananthakumaran has quit [Ping timeout: 245 seconds]
<kenneth> and i used to fucking defend php back in the day
<_br_> Well, as usual its a learning process never mind it
ananthakumaran has joined #ruby
<kenneth> i got so fed up i made a public commitment to never use php again, to the tune of $50 :p
prtksxna has quit [Remote host closed the connection]
<kenneth> unfortunately i must still use it every day for legacy stuff, but i haven't started anything new with it since
<_br_> hehe, let me rt that. :D
<_br_> kenneth: hope it dies, but it seems that these languages will stick with us forever...
ananthakumaran1 has quit [Ping timeout: 252 seconds]
<kenneth> sadly
<kenneth> anyway, i must sleep
<kenneth> ciao all
<_br_> gn8 :)
kenneth has quit [Quit: kswizz.com]
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
tvw has joined #ruby
etehtsea has joined #ruby
gyre007 has quit [Quit: Ex-Chat]
BrianE has joined #ruby
sec_ has left #ruby [#ruby]
rushed has joined #ruby
Morkel has quit [Quit: Morkel]
wilmoore has quit [Remote host closed the connection]
dekroning has joined #ruby
<dekroning> hi
tvw has quit [Ping timeout: 256 seconds]
keanehsiao has joined #ruby
<keanehsiao> hi
<keanehsiao> anybody knows how to batch insert with sequel
Helius has joined #ruby
perryh is now known as perryh_away
ramblex has joined #ruby
jbw has quit [Ping timeout: 240 seconds]
kaspernj has quit [Quit: Leaving]
omry has joined #ruby
<hoelzro> is sequel a library?
* hoelzro is new to Ruby
<bnagy> it's a relational db wrapper
<hoelzro> I see
robertondc has quit [Remote host closed the connection]
Helius has quit [Ping timeout: 245 seconds]
pk1001100011 has joined #ruby
<keanehsiao> yes
<keanehsiao> a gem
tonini has quit [Remote host closed the connection]
Jb_ has joined #ruby
remmy444 has joined #ruby
foofoobar has joined #ruby
b1rkh0ff has joined #ruby
gilead has quit [Read error: Connection reset by peer]
berkes has quit [Quit: Ex-Chat]
gilead has joined #ruby
gyre007 has joined #ruby
ghosTM55 has quit [Quit: Lost terminal]
jbw has joined #ruby
<bnagy> keanehsiao: the methods you probably want look like they're in Dataset
<keanehsiao> bnagy: ok. thanks.. let me look it up right now.. :D
<bnagy> but I think insert will probably just work
foofoobar has quit [Quit: Computer has gone to sleep]
<keanehsiao> is there any similar like this in sequel?? http://www.postgresql.org/docs/9.1/interactive/populate.html
ramblex has quit [Quit: ramblex]
<bnagy> insert
<keanehsiao> @@
crankycoder has quit [Remote host closed the connection]
nkvorn_ has joined #ruby
<bnagy> well all that says is use COPY, plus some postgres stuff
Shrink has quit [Ping timeout: 250 seconds]
<bnagy> sequel is just a wrapper - if you're using postgres you can still do all the rest of that stuff
<keanehsiao> u means insert_multi right?
<bnagy> no I mean insert, by the looks
<keanehsiao> @@
etehtsea has quit [Ping timeout: 256 seconds]
francisfish has quit [Read error: Connection reset by peer]
fjfish has joined #ruby
<keanehsiao> but insert only deal with one record at one time
<keanehsiao> inset_multi looks more like batch
kaiwren has joined #ruby
<bnagy> sorry, I meant import not insert
<keanehsiao> ohoh..
<keanehsiao> :D
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
gyre007 has quit [Quit: Ex-Chat]
seoaqua has quit [Quit: Leaving]
lunchub has joined #ruby
Ammar_iD has joined #ruby
Shrink has joined #ruby
lunchub has left #ruby [#ruby]
PragCypher has joined #ruby
Asher has quit [Remote host closed the connection]
Ammar01 has quit [Ping timeout: 260 seconds]
SPYGAME has joined #ruby
blueOxigen has joined #ruby
amacgregor_osx has joined #ruby
akem has quit [Ping timeout: 265 seconds]
Asher has joined #ruby
bluOxigen has quit [Ping timeout: 244 seconds]
amacgregor_osx has quit [Read error: Connection reset by peer]
amacgregor_osx has joined #ruby
fermion has joined #ruby
hoelzro is now known as hoelzro|away
nu7hatch has joined #ruby
wargasm has quit [Read error: Connection reset by peer]
<keanehsiao> bangy: is that possible to return some result after import?? ex.. return the id of created objects
<bnagy> looks like it returns a Dataset
filipeamoreira has joined #ruby
<bnagy> I'm just reading the docs, keanehsiao I have no knowledge of Sequel
<keanehsiao> bangy: oh… sorry.. :p
blueOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
<eph3meral> ruby doesn't have ++ does it?
<bnagy> no
<keanehsiao> +=
<eph3meral> yeah i want it to be a latent addition though
<eph3meral> i want the original value to be evaluated to, but i still want the increment to happen
<eph3meral> so, x = 0; foo_bar(x++); should still call foo_bar(0)
<bnagy> I do not think that word means what you think it means
<eph3meral> foo_bar(x += 1) doesn't do what I want
<eph3meral> bnagy, yeah i was too lazy to backspace over my typing to say it correctly :P
<Hanmac> you need to call it extra ... :( foo_bar(x); x+= 1
<workmad3_> eph3meral: ruby just doesn't provide that at the language level
<bnagy> smells a bit like poor control flow though
<eph3meral> hmm, ok, any ideas on how to do this better -> http://pastie.org/private/jowhns3ji0dkclabd3eia
<eph3meral> workmad3_, Hanmac, bnagy ^
<bnagy> .with_index ?
<workmad3_> eph3meral: how about rs.each_with_index.map do |row, index|
<eph3meral> bnagy, so if it smells, I'd gladly take suggestions on how to "unsmell" it :P ... pastie right here ^
<workmad3_> or .with_index, yeah
<eph3meral> workmad3_, i didn't know that worked for map
<eph3meral> i usually use each_with_index
<eph3meral> i thought that wouldn't work with map for some reason
<eph3meral> i guess I'll try it
<workmad3_> ruby 1.9 with chainable enumerators rock :)
<workmad3_> .map.with_index is a nicer way
<eph3meral> er, so what's the diff between .each_with_index and .with_index ?
<eph3meral> k, yeah that's what i actually want
<eph3meral> map with index
<bnagy> with_index is 1.9
<workmad3_> Hanmac: you don't need the -1
<eph3meral> yep, works like a charm
<eph3meral> thx guys
<bnagy> I like rows.map.with_index just because it reads like text
<workmad3_> Hanmac: the original started at -1 so that the first += 1 changed it to 0 :)
<Hanmac> workmad3 ... oh you are right
heftig has joined #ruby
kil0byte_ has joined #ruby
<Hanmac> bnagy ... sometimes map.with_index does not work as i want, but each.with_index.map do ...
kil0byte has quit [Ping timeout: 240 seconds]
horseman has quit [Ping timeout: 244 seconds]
zinjacoder has joined #ruby
<bnagy> Hanmac: ahhh yeah you're right, the return value is screwed
<bnagy> not it's not, I'm high
<bnagy> ok, when are they different?
burgestrand has joined #ruby
horseman has joined #ruby
hoelzro|away is now known as hoelzro
ramblex has joined #ruby
heftig has quit [Quit: leaving]
heftig has joined #ruby
Alantas has quit [Quit: The sum of the universe is zero.]
yuka has left #ruby [#ruby]
chrismcg is now known as zz_chrismcg
zz_chrismcg is now known as chrismcg
Dreamer3 has joined #ruby
Retistic has quit [Read error: Operation timed out]
<vectorshelve> shevy: hai I got a nice idea for making a gem
<horseman> vectorshelve: curry recipes?
<horseman> vectorshelve: gem install curry_recipes
<vectorshelve> how abt a gem to remove all comments from ruby files ? (# and begin end stuff) ?
<vectorshelve> horseman: shut up dude b4 I kick ban u
<horseman> vectorshelve: gem install vindaloo
<vectorshelve> horseman: there is no gem like that :D
<bnagy> vectorshelve: 1. why would you want to remove comments 2. man sed
<_br_> vectorshelve: How would that be useful?
chrismcg is now known as zz_chrismcg
<vectorshelve> bnagy: just an imagination... sought of a clean up work after completing a project..
slikts has joined #ruby
slikts has left #ruby [#ruby]
<horseman> vectorshelve: i think it's a great idea, i'd use it
<horseman> vectorshelve: yeah, comments are just annoying and get in the way of reading code, agree 100%
<vectorshelve> _br_: bnagy ppl normally would add comments for later reference and then would want them removed after the work...
serroba has joined #ruby
zz_chrismcg is now known as chrismcg
<bnagy> vectorshelve: it's clear you have extensive experience in the software development industry
<hoelzro> I only add comments when people need to read them in the future...
<hoelzro> they're like a letter to Future Rob.
<vectorshelve> bnagy: wierd
<_br_> Wow, I nearly typed an answer. Never mind.
<vectorshelve> _br_: wt ?
<_br_> vectorshelve: Good luck with that Gem.
<bnagy> vectorshelve: while you're at it, you should add code to translate variables to one or two letter random variables
SPYGAME has quit [Ping timeout: 244 seconds]
<shevy> vectorshelve yeah but give the gem a good name
<bnagy> and possibly alias methods to random strings of garbage, and hide all the aliases in a module
<shevy> vectorshelve require 'remove_comments'; RemoveComments.new('/foo/bla.rb')
<shevy> vectorshelve it's only about 3 lines of ruby code btw, you really should find larger projects :P
<shevy> start an obfuscator project in ruby
<shevy> though that would also be useless to 99,9999%
<shevy> vectorshelve what I would do is, identify where there is really a need for something. ideally because it does not really exist at all
<bnagy> vectorshelve: and then let someone who knows what they're doing know so they can write a gem for it
<vectorshelve> shevy: but hoelzro had a point what if I need some comments retained ?
<shevy> vectorshelve you need to find rules to determine that
<workmad3_> vectorshelve: if you're obfuscating, you don't need comments retained
<vectorshelve> shevy: RemoveComments cool name :)
<shevy> vectorshelve the thing is, removing some comments, but not other comments, just seems insanely complicated for no real gain
sbanwart has joined #ruby
<vectorshelve> workmad3_: discussion takes u out of obfuscation .. got the point
<shevy> It is like giving people cans with food inside, but no way to open it. and even when they manage to open it, they realize ... there is no food inside!!!
werdnativ has quit [Quit: werdnativ]
<dekroning> I'm using a Gemfile in my library to manage dependencies, however i've got one gem that I install via a :git source in the Gemfile, but it doesn't seem to update when a new version is available, anyone have a clue how to force updating of the gem ?
<vectorshelve> shevy: so u mean to say the idea isnt worth a gem ?
<workmad3_> dekroning: bundle update <gemname>
<dekroning> workmad3_: but that seems to update everything instead of only the <gemname>
<workmad3_> vectorshelve: a source parser to remove comments? no, not worth it
<workmad3_> vectorshelve: other than as a learning exercise
<shevy> vectorshelve the idea to remove comments from .rb files alone does not seem useful at all. it is also a VERY small project, it's like really ... 5 lines of ruby code. not useful at all man.
<workmad3_> dekroning: that's the only way I know to update a specific gem via bundler, I'm afraid
<vectorshelve> shevy: but is it judicious to compare the use of a gem from its lines of code ? thats wierd.. :) aint it ? as long as it does something good
<Hanmac> shevy: for remove_comments an extra class? are you kidding me? XD
<workmad3_> dekroning: are you sure it's actually updating everything? or is it just that the bundle command shows you all the 'using' output again?
<vectorshelve> workmad3_: any good suggestions.. a gem which is unique and cute by its purpose ? :)
<shevy> Hanmac I always use classes when possible. it is 100% nicer to reuse them
<workmad3_> vectorshelve: nope
<vectorshelve> workmad3_: why ?
<Hanmac> use an module and this: RemoveComments['/foo/bla.rb']
<shevy> vectorshelve you could have one gem per class. but what useful is it to make a gem for one class alone?
<workmad3_> vectorshelve: a) unique ideas are almost impossible to come by, b) why do you care about cute? surely useful would be better :P
<workmad3_> vectorshelve: and c) stop looking for others to validate your ideas beforehand... if you have an idea that you'd find useful, just code it for crying out loud
<vectorshelve> workmad3_: cute meant the same.. :) Its just that I made it sound a lil better
emmanuelux has joined #ruby
<workmad3_> vectorshelve: if you release it and people start using it, you created something useful, if you release it and it's not used, then you created something with only one user...
<vectorshelve> workmad3_: naah shevy and other mates are experienced.. I dont wanna end up coding that doesnt really benefit anyone.. got it
<workmad3_> vectorshelve: either way, you don't need us to validate your ideas in advance
<shevy> vectorshelve you need to find a problem that you want to solve but existing tools to solve them either dont exist or suck
<vectorshelve> workmad3_: it helps a lot.. it helps me understand if that idea would help u as a ruby programmer.. thats a very valuable feedback got it ?
<shevy> vectorshelve a package manager in ruby. now that would be something :)
<vectorshelve> shevy: package manager means ? what does it do /
<workmad3_> vectorshelve: I don't see it... my needs as a developer are very different from your needs, or shevy's needs, or even the needs of my work colleague sat next to me also doing ruby
<dekroning> workmad3_: indeed running the complete 'bundle update' works
<shevy> vectorshelve like RVM but for all programs instead
<vectorshelve> shevy: like rubygems
<dekroning> workmad3_: it actually update other gems as well, fyi
<shevy> how can you use rubygems to install glibc please?
<vectorshelve> shevy: RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries
BrianE has quit [Quit: Linkinus - http://linkinus.com]
<shevy> again
<shevy> how can you use rubygems to install glibc please?
<shevy> but yeah, like rubygems, just not constrained to ruby-programs alone
<shevy> like machomebrew, but runnable on any OS :D
<workmad3_> dekroning: yes, I know 'bundle update' updates other gems, but 'bundle update nokogiri' updates only nokogiri
<bnagy> whee, shevy planet!
<vectorshelve> shevy: I dont know.. the answer to it -> how can you use rubygems to install glibc ?
<dekroning> workmad3_: hmmm ok let me verify my command
<workmad3_> shevy: chef!!! (although that's configuration management)
<shevy> vectorshelve of course you can't. hmm well perhaps in theory you could... you could probably install just binaries, via rubygems alone... I dont know. I never tried to have anything installed via rubygems that does not end up in ruby's site dir
<dekroning> workmad3_: indeed, i was just running 'bundle update' i should have specified the gem indeed :)
<vectorshelve> shevy: so where are we moving to now from an idea for the birth of my first gem ? ;)
<Hanmac> shevy i looked at machomebrew code ... 1) its old 1.8 2) its used functions wich are not dokumented (as far as i see) ... and 3) i would not call it good code
ph^ has joined #ruby
<bnagy> shevy: if you can do that it's a fairly important bug
<shevy> bnagy hehehe
<workmad3_> shevy: you could package the source tarballs into a ruby gem, wrap it up and build it sort of as a native extension :)
<shevy> workmad3_, bnagy would tag it as a bug and report it so that it gets fixed... ;(
<workmad3_> shevy: but it would go into the rubygems repo, not into the site dir
<bnagy> wat? No way I'd kill a bug like that :)
<vectorshelve> can anyone help me with a link blog or article something that explains from scratch what are the similarities and differences b/w UNIX, LINUX, what is GNU what has all of these got to do with C/C++ libraries and stuff.. to gain a good hold of stuffs
<workmad3_> shevy: and certainly wouldn't get intstalled to /usr/lib or anything funky :)
davidcelis has quit [Read error: Connection reset by peer]
niklasb has joined #ruby
<shevy> vectorshelve ONE link that holds ALL that information???
<workmad3_> vectorshelve: http://catb.org/~esr/writings/taoup/
<workmad3_> shevy: easy: http://catb.org/~esr/writings/taoup/
<shevy> hehe
<vectorshelve> shevy: workmad3_ thanks
<workmad3_> shevy: he never said it couldn't be a link to an online version of a book :)
burgestrand has quit [Quit: Leaving.]
<keanehsiao> hihi… if I use sequel import.. is that possible to avoid the duplicate records???
mohits has quit [Remote host closed the connection]
<workmad3_> keanehsiao: you typed words... they're all definitely words... but I'm afraid that in that particular arrangement I'm failing to extract any meaning
<workmad3_> keanehsiao: sorry :(
<keanehsiao> err....
<keanehsiao> ok… sorry for poor english.. let me clear it..
<bnagy> workmad3_: he has run import twice and now the underlying table has got dupes in it
<shevy> vectorshelve linux is the successor to unix. GNU is the GPLified notion of "enforced free, reusable and modifiable software" (BSD can not enforce the release of changed software) and C is the origin and reason of Unix and explains why you have directories like /usr or /bin or /boot or /sys or /dev, because they are lazy and never want to type too long directory names with their shell)
davidcelis has joined #ruby
thecreators has joined #ruby
<keanehsiao> I use sequel gem with Model.import([:x,:y],[[1,2],[3,4]])
<workmad3_> shevy: nah, linux is a stopgap while we wait for the true opensource unix kernel, GNU/HURD
ph^ has quit [Remote host closed the connection]
<shevy> perl6 on GNU Hurd PURE AWESOMENESS
<horseman> workmad3_: is hurd still bing devloped
<vectorshelve> shevy: I think GNU is like the UI for UNIX ryt in a way ?
<shevy> while you play duke nukem
<vectorshelve> shevy: what is GPLified
liluo has quit [Remote host closed the connection]
<shevy> vectorshelve did you read what I typed. where do you get the word "UI"
<workmad3_> shevy: and I can probably find lots and lots of freebsd, netbsd, etc users who would hunt you down and gut you for suggesting that linux is the successor to unix ;)
<workmad3_> vectorshelve: not at all
<vectorshelve> shevy: ok
<bnagy> vectorshelve: reading your stuff is actually making me stupider
<workmad3_> vectorshelve: you're just stringing words together now
<bnagy> go and code something
<shevy> workmad3_ yeah but linux kinda works better :)))
<bnagy> or in fact just go
<keanehsiao> workmad3_: and it works… yet it won't avoid the duplicate records… if I do something like Model.import([:x,:y],[[1,2][1,2]]) .. there will be 2 [1,2] exist in table
<workmad3_> shevy: I'm on a unix machine that arguable works better than any of the linux machines in this office ;)
<shevy> workmad3_ yeah, OSX rocks
<shevy> :P
ChampS666 has joined #ruby
<workmad3_> :)
<shevy> but I mean linux... not the distributions... the distributions should all die. Linus should become the steve jobs of linux
<shevy> I dont think he has any interest in that though
<workmad3_> fragmentation, the bane of all unixes
<shevy> perhaps we could hire ballmer
<shevy> then at least we'd have a cheerleader
tvw has joined #ruby
<shevy> workmad3_, I agree, fragmentation stinks
<bnagy> shevy: well apart from the fact that the kernel is retarded
<bnagy> I mean...where do you go from there?
nfk has joined #ruby
tayy has joined #ruby
Solnse has quit [Read error: No route to host]
<vectorshelve> workmad3_: I will kickban you :P
<workmad3_> horseman: I'm sure stallman is still plugging away at it in his spare time :P
<workmad3_> vectorshelve: if I thought you had that power, I'd possibly worry :P
<vectorshelve> workmad3_: and if I ban.. it wouldnt be less that for a month :D
<vectorshelve> workmad3_: then its time for u to worry
Sgeo_ has joined #ruby
<workmad3_> vectorshelve: here's the amount I care
workmad3_ has quit [Quit: leaving]
<horseman> vectorshelve: u SCARED HIM
nopper has quit [Ping timeout: 244 seconds]
museun has quit [Ping timeout: 240 seconds]
<vectorshelve> horseman: lol...
dhruvasagar has quit [Ping timeout: 248 seconds]
Sgeo has quit [Ping timeout: 240 seconds]
nopper has joined #ruby
preller has quit [Ping timeout: 244 seconds]
zeroXten has quit [Ping timeout: 240 seconds]
companion_ has quit [Ping timeout: 240 seconds]
zeroXten has joined #ruby
<horseman> vectorshelve: we should do this some time http://i.imgur.com/s3KQi.gif
Axsuul has quit [Ping timeout: 240 seconds]
foofoobar has joined #ruby
vectorshelve_ has joined #ruby
dhruvasagar has joined #ruby
jacobw has quit [Ping timeout: 244 seconds]
Guest81751 has joined #ruby
<vectorshelve_> ..
vectorshelve_ has quit [Client Quit]
Mohan__ has quit [Ping timeout: 244 seconds]
vectorshelve has quit [Ping timeout: 245 seconds]
al-ol_ has quit [Ping timeout: 240 seconds]
jacobw has joined #ruby
al-ol has joined #ruby
Mohan has joined #ruby
preller has joined #ruby
preller has joined #ruby
preller has quit [Changing host]
workmad3 has joined #ruby
Axsuul has joined #ruby
companion_ has joined #ruby
Shrink has quit [Ping timeout: 245 seconds]
vectorshelve has joined #ruby
<vectorshelve> /msg NickServ identify web2labs
<bnagy> epic
looopy has joined #ruby
<vectorshelve> shevy: :)
noodletraveler has quit [Quit: leaving]
<vectorshelve> bnagy: doesnt really matter :P
<vectorshelve> workmad3: u back ?
iocor has joined #ruby
Facefox has quit [Ping timeout: 240 seconds]
ben_alman has quit [Ping timeout: 244 seconds]
horseman is now known as vectorshelv_
<vectorshelv_> vectorshelve: sup
<vectorshelv_> vectorshelve: u should change your nick to copy my old one
vectorshelve_ has joined #ruby
Facefox has joined #ruby
<vectorshelve_> ?
vectorshelv_ is now known as vectorshelve__
devdazed has quit [Ping timeout: 244 seconds]
nanderoo has joined #ruby
crankycoder has joined #ruby
Ammar_iD has quit [Quit: Leaving]
jdahm has quit [Ping timeout: 244 seconds]
vectorshelve has quit [Ping timeout: 245 seconds]
jdahm has joined #ruby
hakunin has quit [Remote host closed the connection]
devdazed has joined #ruby
vectorshelve_ has quit [Ping timeout: 245 seconds]
petercs has joined #ruby
<shevy> dont think Stallman is doing much these days other than speaking at conventions
<_br_> and getting slight heart attacks
vectorshelve__ is now known as vectorshelv
vectorshelv is now known as vectorshelve_
vectorshelve__ has joined #ruby
nfk has quit [Quit: yawn]
<vectorshelve__> ..
liluo has joined #ruby
vectorshelve__ is now known as vectorshelve
<vectorshelve> ...
vectorshelve_ is now known as horseman
ben_alman has joined #ruby
<vectorshelve> shevy: u there ?
<shevy> yes
<vectorshelve> shevy: server went down for a while
pcboy___ has quit [Quit: leaving]
nanderoo has quit [Quit: Leaving.]
<shevy> that's bad
<vectorshelve> shevy: or something else ? :P
nanderoo has joined #ruby
Guest28433 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
Shrink has joined #ruby
ben_alman has quit [Excess Flood]
<vectorshelve> shevy: ?
looopy has quit [Remote host closed the connection]
ben_alman has joined #ruby
fixl has joined #ruby
ananthakumaran1 has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
<shevy> vectorshelve something else what?
dhruvasagar has joined #ruby
<shevy> do we use few words only
<shevy> hello vectorshelve
<shevy> how do you do
<shevy> the weather is nice here
ananthakumaran has quit [Ping timeout: 244 seconds]
<vectorshelve> shevy: whats wrong ?
<shevy> vectorshelve nothing but you use so few words, and question marks
<shevy> I have no idea what you are trying to say or what you want :)
<vectorshelve> shevy: :( something seems wrong.. I can only see ur chats nobody else's :'(
<graspee> no-one else is talking
geekbri has joined #ruby
<shevy> lol
<shevy> graspee, this is epic
<shevy> should almost make it on bash org
pcboy_ has joined #ruby
<graspee> go ahead and submit it
<Hanmac> i see you both talking and i think i should be silent or otherwise i pulled into that
<graspee> i already appear in a different quote from a decade ago
bglusman_ has quit [Ping timeout: 246 seconds]
<shevy> graspee yeah man, you made it to epic status already
<shevy> I still have to work on it
<shevy> Hanmac, you ignore vectorshelve ? :P
SimSala has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
<Hanmac> not per flag but currently yeah
<vectorshelve> shevy: <3 :)
devrath has joined #ruby
<shevy> vectorshelve Hanmac hates you
<vectorshelve> Hanmac: I like him... he has helped me a lot :)
<Hanmac> i dont hate him but he is so noisy
<vectorshelve> devrath: hai buddy :)
jdripper has joined #ruby
looopy has joined #ruby
<devrath> hi vectorshelve
<shevy> yeah
linoj has joined #ruby
<shevy> vectorshelve is extremely noisy
<shevy> much more so than becom33
<shevy> vectorshelve, we already trained becom33 quite well, he is on a good way now
<vectorshelve> hmm
<shevy> cooooooool
<shevy> the same function/method in 20 different languages:
<shevy> the java way: toUpperCase
<graspee> what's that? some kind of micro version of rosetta stone thing?
<graspee> rosetta code*
<shevy> well
<shevy> workmad3 can explain this level of fragmentation :)
<shevy> people can never agree on anything
<workmad3> shevy: I can?
<shevy> look at the perl solution! uc ...
<workmad3> shevy: I disagree
<shevy> see? people disagree, all the time :)
<graspee> no they don't
<workmad3> shevy: no they don't
<shevy> lol
Husel has joined #ruby
linoj has quit [Client Quit]
<graspee> a good bash quote would be you saying people disagree all the time, then a whole room of people saying no they don't then you saying, well you lot all seem to agree
devrath has left #ruby [#ruby]
<graspee> or something. nvm i messed up the logic
<graspee> that's why bash quotes are real and not made up. lesson over
<workmad3> graspee: the logic would be shevy saying people agree all the time, a whole room of people saying 'no they don't' and then shevy just saying something like 'I think you proved my point'
jrist-out is now known as jrist
mxweas_ has joined #ruby
diegok has joined #ruby
<shevy> graspee, I disagree
<shevy> graspee agrees with workmad3
<shevy> you two agreers disgust me :P
<workmad3> shevy: yes, we do, don't we
<shevy> it's a bait!
<workmad3> :D
<shevy> I will disagree with all of you out of principle!
ken_barber has joined #ruby
<workmad3> shevy: that's exactly what you want to do
<shevy> when I look at my old ruby code, I disagree with my decisions that I made back then
mxweas_ has quit [Client Quit]
<horseman> Asher: you're the premier film buff, can u recommend me a good horror
<Asher> event horizon
TTilus has quit [Ping timeout: 244 seconds]
lxsameer has joined #ruby
<horseman> Asher: is this true: "It's disheartening to see how quickly this movie degenerates from an intriguing premise into an absurd gore-a-thon."
TTilus has joined #ruby
devrath has joined #ruby
<shevy> it was not a very good one
<shevy> a bit spooky... but not really worth remembering
<horseman> shevy: you recommend one
<shevy> I dunno... most are crap. the only ones I still like are Blade Runner and Alien
<shevy> horseman Serenity is worth seeing once perhaps
<graspee> the japanese original ring move
<graspee> movie even
cha1tanya has quit [Ping timeout: 246 seconds]
<shevy> hmm more horror ... let me think...
devrath has quit [Quit: Page closed]
<shevy> horseman, did you watch The Village already? http://www.imdb.com/title/tt0368447/
<graspee> i'm a ruby noob but this silly function i wrote amuses me no end
<graspee> class Fixnum
<graspee> def percentof x
<graspee> end
<graspee> ((x/100.0)*self).round
<Asher> Serenity is not horror - it's the finale to FireFly
<graspee> end
devrath has joined #ruby
<Asher> horseman - Event Horizon is one of the better/more intelligent horror films
<shevy> graspee, and you do what with it? 80.percenteof 25 ?
devrath has quit [Client Quit]
<graspee> ya! :D
<graspee> then i introduce lots of method calling overhead into my otherwise simple programs!
<graspee> ftw!
<Asher> horseman - how about The Abyss?
<shevy> I'd wish there would be a simple way to undo modifications to core classes
<hoelzro> graspee: I wouldn't worry about it until your benchmarks show things aren't fast enough
<Asher> horseman - i assume you've seen The Shining?
<horseman> Asher: Yeah.
choffstein has joined #ruby
g0bl1n has joined #ruby
test34 has joined #ruby
test34 has quit [Changing host]
test34 has joined #ruby
<horseman> shevy: there is
<horseman> shevy: check all methods that have non-nil source_location and remove them
<horseman> shevy: though if it's overriding a core method u might have a time getting it back
<Asher> horseman - how about Dawn of the Dead, 28 Days Later, 28 Weeks Later
<Asher> horseman - The Lost Highway
test34- has joined #ruby
test34- has quit [Changing host]
test34- has joined #ruby
<graspee> hoelzro: i don't run benchmarks so i suppose i'm safe
<graspee> 28 days later is good. i didn't enjoy the sequel that much though
nacengineer has joined #ruby
<horseman> Asher: hhaha lost highway
SPYGAME has joined #ruby
test34 has quit [Ping timeout: 252 seconds]
devrath has joined #ruby
<horseman> Asher: im in your house
kaiwren has quit [Quit: kaiwren]
<graspee> Black Christmas
<graspee> another horror film which i've just ruined
igaiga has joined #ruby
nu7hatch has left #ruby [#ruby]
fflush has quit [Quit: This computer has gone to sleep]
<devrath> ..
aibo has joined #ruby
<shevy> lol
<Hanmac> Asher: yeah Event Horizon was very creapy ... but it has an interesting device xD
jwbuurlage has joined #ruby
<Hanmac> Asher: another good Horror movie was dream Catcher ...
<devrath> '/msg NickServ VERIFY REGISTER devrath heqnytssxrol
devrath has quit [Quit: Page closed]
kuranai|off is now known as kuranai
kaiwren has joined #ruby
serroba has quit [Quit: This computer has gone to sleep]
igaiga has quit [Remote host closed the connection]
<graspee> oh dear
<graspee> did you just print your password on the channel or were you joking?
<shevy> he shamefully quitted after that
jwbuurlage has left #ruby [#ruby]
<graspee> oh i have join quits on another window so i never notice
jwbuurlage has joined #ruby
<workmad3> invalid password
<workmad3> boo :(
LMolr has joined #ruby
dv310p3r has joined #ruby
<shevy> lol
<shevy> how can people be so curious!
<graspee> ebil*
<workmad3> shevy: how can they not?
<workmad3> shevy: besides, if it was a valid password, you can have fun ghosting someone :)
jwbuurlage_ has joined #ruby
<shevy> lol
wangr has joined #ruby
jwbuurlage has quit [Quit: jwbuurlage]
jwbuurlage_ is now known as jwbuurlage
pcboy_ has quit [Quit: leaving]
devrath has joined #ruby
kaiwren has quit [Quit: kaiwren]
* Hanmac is curious only on mondays
kevinbond has joined #ruby
kaiwren has joined #ruby
devrath has left #ruby [#ruby]
krusty_ar has joined #ruby
ilya has joined #ruby
cha1tanya has joined #ruby
kevinbond has quit [Quit: kevinbond]
gift has quit [Remote host closed the connection]
fbernier has joined #ruby
hynkle has joined #ruby
<horseman> Asher: raffles, this looks good http://www.rottentomatoes.com/m/the_cabin_in_the_woods/
ilya has left #ruby ["Leaving"]
<horseman> Asher: seen it?
looopy has quit [Remote host closed the connection]
amacgregor_osx has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
choffstein has quit [Remote host closed the connection]
petercs has quit [Quit: Leaving.]
kaiwren has quit [Quit: kaiwren]
ananthakumaran1 has quit [Ping timeout: 244 seconds]
t0mmyvyo has quit [Quit: http://twitter.com/tommyvyo]
kil0byte has joined #ruby
jwbuurlage has quit [Read error: Connection reset by peer]
jwbuurlage has joined #ruby
<Asher> not yet
<Asher> but joss whedon is awesome
dhaskew has joined #ruby
amalvagomes has joined #ruby
<LMolr> Hello, i need to switch rvm environment from a ruby script. I am trying to use 'rvm-gem' to achieve this, but i cannot understand why RVM::Environment#use! doesn't work. Any clue? Thanks. Paste: http://pastebin.com/BfxRL3zB
iamjarvo has joined #ruby
noganex has quit [Ping timeout: 260 seconds]
noganex has joined #ruby
kil0byte_ has quit [Ping timeout: 245 seconds]
simao_ has joined #ruby
bglusman has joined #ruby
fbernier has quit [Ping timeout: 246 seconds]
chson has quit [Remote host closed the connection]
simao_ is now known as simao
<_br_> LMolr: Well, isn't the needed ruby version normally defined in the .rvmrc file?
fbernier has joined #ruby
<_br_> LMolr: Normally, the user you has RVM installed, cd's into the directory and RVM will complain or not if the right ruby version is available or not. If not the user will install it. Also the only command necessary for bundler is "bundle install"
<_br_> Asher: Did you watch Firefly?
kil0byte has quit [Ping timeout: 240 seconds]
bbttxu has joined #ruby
<Asher> yup
<Asher> firefly was awesome
<Asher> i've seen most recent serial television shows
tomzx has joined #ruby
fixl has quit [*.net *.split]
davidw has quit [*.net *.split]
epitron has quit [*.net *.split]
dnyy has quit [*.net *.split]
Guest57325 has quit [*.net *.split]
tewecske has quit [*.net *.split]
cscribble has quit [*.net *.split]
alindeman has quit [*.net *.split]
SeySayux has quit [*.net *.split]
idoru has quit [*.net *.split]
Eldariof-ru has quit [*.net *.split]
Corey has quit [*.net *.split]
psino has quit [*.net *.split]
rasbonics has quit [*.net *.split]
Shamgar has quit [*.net *.split]
_marvin has quit [*.net *.split]
voodoofish has quit [*.net *.split]
statix has quit [*.net *.split]
randym has quit [*.net *.split]
patricksroberts has quit [*.net *.split]
thorncp has quit [*.net *.split]
notbrent has quit [*.net *.split]
Icehawk78 has quit [*.net *.split]
stroem has quit [*.net *.split]
niv has quit [*.net *.split]
RubyPanther has quit [*.net *.split]
daed has quit [*.net *.split]
Urth|Away has quit [*.net *.split]
mahlon has quit [*.net *.split]
iaj has quit [*.net *.split]
pingveno has quit [*.net *.split]
limed has quit [*.net *.split]
epitron has joined #ruby
epitron has joined #ruby
psino has joined #ruby
snearch has quit [Quit: Verlassend]
<LMolr> _br_: i need to automate the gem installation in the target project and, after that, i will need to execute some ruby files into the target project. Is that achievable with .rvmrc file as you suggest? Thank you
kil0byte has joined #ruby
jwbuurlage has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
jgarvey has joined #ruby
choffstein has joined #ruby
alesguzik has joined #ruby
Helius has joined #ruby
jnoob22 has joined #ruby
foofooba1 has joined #ruby
SeySayux has joined #ruby
alindeman has joined #ruby
Corey has joined #ruby
carloslopes has joined #ruby
davidw has joined #ruby
idoru has joined #ruby
dnyy has joined #ruby
tewecske has joined #ruby
Guest57325 has joined #ruby
cscribble has joined #ruby
Eldariof-ru has joined #ruby
voodoofish has joined #ruby
rasbonics has joined #ruby
Shamgar has joined #ruby
_marvin has joined #ruby
statix has joined #ruby
thorncp has joined #ruby
randym has joined #ruby
patricksroberts has joined #ruby
notbrent has joined #ruby
Icehawk78 has joined #ruby
stroem has joined #ruby
Urth|Away has joined #ruby
niv has joined #ruby
RubyPanther has joined #ruby
daed has joined #ruby
mahlon has joined #ruby
iaj has joined #ruby
limed has joined #ruby
pingveno has joined #ruby
fbernier has quit [Ping timeout: 246 seconds]
SeySayux has quit [Max SendQ exceeded]
Corey is now known as Guest10091
alindeman is now known as Guest92523
shevy has quit [Ping timeout: 252 seconds]
jwbuurlage has joined #ruby
itnomad has joined #ruby
Husel has left #ruby [#ruby]
ximarin has joined #ruby
jrist is now known as jrist-mtg
foofoobar has quit [Ping timeout: 265 seconds]
<_br_> LMolr: automate gem installation is taken care of by bundler. Ruby installation is taken care of by RVM via the .rvmrc. But I'm wondering if you are looking for a solution via Capistrano or Chef.
ChampS666 has quit []
<ximarin> hi all, ruby-newbie-question: (('a'..'z').to_a + ('A'..'Z').to_a).sort <-- how can I get this to print out ["a", "A", "b", "B", ...] istead of printing all uppercase chars first and then all lowercase chars?
jrajav has quit [Quit: jrajav]
alem0lars has joined #ruby
<workmad3> ximarin: ('a'..'z').zip('A'..'Z').flatten
<hoelzro> ximarin: .sort { |a,b| a.downcase <=> b.downcase }
<ximarin> workmad3: hm, can you explain in short what zip and flatten do?
fr0gprince_mac has joined #ruby
<ximarin> uh, I'm just getting to blocks ;)
<hoelzro> hmm
<workmad3> ximarin: .zip makes a new array out of two or more arrays, each item in the new array is of the form [arr1[n], arr2[n]]
* hoelzro wonders if you can do .sort :downcase
<hoelzro> boooo
<hoelzro> you cannot.
<workmad3> ximarin: and then .flatten will take an array of arrays and flatten it to one array
<workmad3> hoelzro: try .sort_by(&:downcase)
dhaskew has quit [Quit: dhaskew]
dnyy has quit [Remote host closed the connection]
albemuth has joined #ruby
<LMolr> _br_: thank you, i'm considering it
SeySayux has joined #ruby
<ximarin> ah ok, thats the zip, got it. what if if tone part of the zipper is shorter than the other? do all array need the same length?
<hoelzro> workmad3: sorry, I'm starting out as well. I assume that &:symbol creates a block that simply sends the given symbol?
<workmad3> hoelzro: basically, yeah
<hoelzro> neat
<workmad3> ximarin: blanks are filled with nils, iirc
<ximarin> ah yeah, tried that right now
jwbuurlage has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
rippa has quit [Quit: derp herp]
uris has joined #ruby
ananthakumaran1 has joined #ruby
bwlang has joined #ruby
<ximarin> hoelzro, I dont really get what your block does. is it like "take two elements from the array and if they are equivalent, sort them"?
bwlang has left #ruby [#ruby]
shevy has joined #ruby
<workmad3> ximarin: <=> is the 'spaceship' operator
<ximarin> oO wtf
niku4i has joined #ruby
<workmad3> ximarin: it's behaviour is to do a comparison... if a < b, return -1, if a == b, return 0, if a > b, return 1
crankyco_ has joined #ruby
<ximarin> ah ok, thats cool
pu22l3r has joined #ruby
pu22l3r has quit [Remote host closed the connection]
td123 has joined #ruby
pu22l3r has joined #ruby
ananthakumaran has quit [Ping timeout: 244 seconds]
vectorshelve has quit [Quit: Page closed]
chrisja has joined #ruby
crankycoder has quit [Ping timeout: 252 seconds]
<shevy> :)
<shevy> you can sort collections with that
ananthakumaran1 has quit [Quit: Leaving.]
crankyco_ has quit [Remote host closed the connection]
hydrozen has joined #ruby
tomzx has quit [Ping timeout: 256 seconds]
joch_n has joined #ruby
crankycoder has joined #ruby
pcboy_ has joined #ruby
<ximarin> ok, to understand blacks a bit more... bblocks with one argument are pretty simple, but I now have this: (0..9).each{ |a,b| puts "#{a}, #{b}" }. b is always nil. Where does the b come from in the .sort { |a,b| a.downcase <=> b.downcase }?
<ximarin> blocks
lxsameer has quit [Quit: Leaving]
ElitestFX has joined #ruby
<workmad3> ximarin: .sort takes a block with two arguments
<hoelzro> simao: sort provides it
<workmad3> ximarin: .each takes a block with a single argument
<ximarin> oh
hippieha` has quit [Ping timeout: 244 seconds]
Progster has joined #ruby
mtfk has left #ruby [#ruby]
erikstraub has joined #ruby
univers has joined #ruby
wallerdev has joined #ruby
kaiwren has joined #ruby
* ximarin would like to rtfm, but hates ruby-doc for today
savage- has joined #ruby
billdami has joined #ruby
luxurymode has joined #ruby
mohits has joined #ruby
td123 has quit [Quit: WeeChat 0.3.7]
flip_digits has joined #ruby
fr0gprince_mac has quit [Quit: Leaving...]
erikstraub has left #ruby [#ruby]
awarner has joined #ruby
benatwork has joined #ruby
<horseman> ximarin: everyone groovy and cool in this world uses pry for docs anyway, and if you want to join that crowd, u better get it too, homie
filipeamoreira has quit [Remote host closed the connection]
<graspee> you can get ruby doc for ios as a free app too
<graspee> learn about ruby on the bus!
larissa has joined #ruby
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
g0bl1n has quit [Quit: Leaving]
nilg has quit [Remote host closed the connection]
flip_digits has joined #ruby
itnomad has quit [Ping timeout: 252 seconds]
<Hanmac> ximarin: maybe you sort an hash you can do this: hash.sort{|(ak,av),(bk,bv)| ... } notic the ()
<ximarin> ah, so if I sort an array (in general, the a is for the key and the b for the val? Thats what I dont get in the docs
<bnagy> it passes pairs of values into the block and then compares them
prtksxna has joined #ruby
JohnBat26 has quit [Remote host closed the connection]
Urth|Away is now known as Urthwhyte
<workmad3> ximarin: when you sort an array with .sort, you get passed two items from the array each time that require comparison
<workmad3> ximarin: and the block returns whether item 1 is greater, equal to, or less than, item 2
Neil___ has joined #ruby
<graspee> if you use pry you just type "ri sort"
<ximarin> sounds like bubblesort
<graspee> and it tells you right on the first page about the a and b
nilg has joined #ruby
<bnagy> it's not bubblesort :)
<ximarin> sounds like it a bit
<bnagy> all sorting algorithms need a primitive to compare pairs of values
<workmad3> ^^
<workmad3> the block is the comparison functor for the sorting algorithm
<workmad3> don't know what the algorithm is (probably something like quicksort), but it's not bubble sort :)
digitalcakestudi has joined #ruby
<hoelzro> is the sort algorithm stable?
<workmad3> (well, it could be I guess... there are actually cases where a bubble-sort is quicker than a quicksort)
roolo has quit [Quit: Linkinus - http://linkinus.com]
<horseman> graspee: no, 'ri' is a bad approach, use show-doc sort
<horseman> IMO
<graspee> i couldn't find non-destructive sort in the pickaxe book under the array information but then i realized it was a mixin
<horseman> show-doc Enumerable#sort
<graspee> thanks for the info horseman
<bnagy> workmad3: well I guess if the collection is already sorted :)
<horseman> graspee: also try: show-source Enumerable#sort :)
<graspee> from indeed, as horseman showed "enumerable"
<workmad3> bnagy: yeah, quicksort is absolutely atrocious with a sorted collection, but it's O(n) for bubble sort :)
uris has quit [Ping timeout: 252 seconds]
<horseman> though it's not much
<graspee> bubble sort gives me flashbacks to 'o' level computer science
cdempsey has joined #ruby
<workmad3> graspee: it gives me flashbacks to optimising ASM by hand to reduce the cycles in it :)
joshman_ has joined #ruby
Manhose has joined #ruby
<Manhose> Hey dudes
<bnagy> I guess quicksort would be n(n-1)/2 or something
<Manhose> and dudettes
<Manhose> How can I get delete_at to return the array and not the deleted element?
<graspee> "manhose"?
<Manhose> Yes.
<JonnieCache> lol
<Manhose> long story
<graspee> not being rude but "you sound like a dick"
<Manhose> rather not talk about it
ChampS666 has joined #ruby
<Manhose> it's from planet of the apes
<Manhose> the movie
<graspee> you could always change nick
<Manhose> I quite like it
<graspee> or are you in some .... strange channel somewhere else too
<eph3meral> so, I need some ideas for how to about designing an app, right now I have it forking in to two processes (well, 3 if you include the master process) and I'm using Process.waitall in the master
<JonnieCache> Manhose: well you can redefine any method in ruby no problem. but that would break everything that uses it everywhere
<eph3meral> my main issue, is that I want to be able to communicate with each fork, independently
<Manhose> graspee: depends on your definition of strange i suppose
<JonnieCache> Manhose: better to make your own delete_at_and_return_self method that just calls delete_at and returns self
<Manhose> JonnieCache: yep, my phrasing was off. I want an alternative, s'what I meant.
<JonnieCache> maybe dont call it that though
<eph3meral> so, I want to be able to run the main "engine" which spawns each process, and then somehow communicate with each process, I don't need to share resources *or* data between the processes
<eph3meral> but I do want to be able to communicate with them
internet_user has joined #ruby
<Manhose> JonnieCache: 1. your nickname is funny. 2. what would you call it by curiosity?
roolo has joined #ruby
<v0n> hi
<JonnieCache> well some people would call it delete_at! because the ! does not have a very rigid meaning in practice
<Manhose> what would be an idiomatic name for it
Ankhers has joined #ruby
<JonnieCache> i probably wouldnt though
<workmad3> JonnieCache: ! has a pretty rigid meaning IMO
<JonnieCache> workmad3: in theory yes. out there in the big bad real world, not so much
<workmad3> JonnieCache: ! is for 'this version of the method does something surprising that you need to be aware of'
<Manhose> workmad3: really?
<Manhose> it means "side effects" to me
<JonnieCache> yeah i suppose so. people strech it though
khakimov has joined #ruby
<workmad3> JonnieCache: yeah, but within the standard lib, it's pretty much just 'be careful of this version' :)
jrist-mtg is now known as jrist
<JonnieCache> some rails gems use it seemingly at random
charliesome has quit [Ping timeout: 265 seconds]
<JonnieCache> well not quite at random but certainly often enough to dilute its meaning
<workmad3> yeah, some people use it for emphasis
<workmad3> those people are stupid :P
<workmad3> Manhose: that's its meaning in LISP
Borg- has joined #ruby
<Borg-> hi
<Borg-> im trying to make a staticaly linked ruby build using mingw
billiamii has joined #ruby
<Borg-> I was able to build ruby-1.8.7-p330 on mingw.
<Borg-> but I have problem using Sockets for example...
<Borg-> how I can initialize it? normaly its done on require "socket"
<workmad3> O.o
<Borg-> but since its static build... it should be initialize already?
<v0n> will Dir.entries('.') work on windows?
<v0n> (I mean '.' as the current directory)
<bnagy> yes
<Borg-> yes
<TTilus> ive got a pid (from pid file) and need to check if theres a process running with that pid or not
<Borg-> im googling about that issue from some time.. but no luck..
<TTilus> i can psgrep, but is there a more portable way?
<hoelzro> TTilus: I think kill 0 $PID should work
<hoelzro> but I can't guarantee its portability
<workmad3> isn't psgrep POSIX?
roams has joined #ruby
C0deMave_ has joined #ruby
<workmad3> and if so... you want more portable than POSIX?
<Manhose> workmad3: TIL
C0deMave_ is now known as C0deMaver1cj
C0deMaver1cj is now known as C0deMaver1ck
C0deMaver1ck has quit [Changing host]
C0deMaver1ck has joined #ruby
<TTilus> aa-ha, Process.getpgid throws Errno::ESRCH if process does not exist
<Manhose> quick question
<bnagy> so does Process.kill pid, 0
<Manhose> joining an array
<Manhose> returns a string with newlines between the array's elements
<workmad3> Manhose: by default, yes
<Manhose> anyway to not make it do that
<Manhose> the newlines I mean
<bnagy> and if you want portable I wouldknow for sure kill is implemented on windows, dunno about getpgid
<Manhose> just concat the elements
<workmad3> Manhose: .join('')
<TTilus> Manhose: arr.join("whateveryouwant")
<Manhose> aight
<Manhose> the side-effect version is join!?
<workmad3> Manhose: there isn't a side-effect version
<Manhose> aight
<workmad3> Manhose: because that would require an array to change to a string (which you can't do)
<Manhose> thanks workmad3 bnagy TTilus
<TTilus> workmad3: unless you are on clos =D
<Borg-> ha! it works :)
<workmad3> TTilus: stop muddying the water :P
SPYGAME has quit [Ping timeout: 248 seconds]
<Borg-> I just had to read README more carrefull
<Borg-> bye
savage- has quit [Remote host closed the connection]
seanstickle has joined #ruby
nilg` has joined #ruby
Borg- has quit [Quit: leaving]
kevinbond has joined #ruby
<bnagy> TTilus: just checked, btw, Process.kill 0 works on windows, getpgid doesn't
<bnagy> ok dinner. o/
Synthead has joined #ruby
chson has joined #ruby
awarner has quit [Remote host closed the connection]
billdami has quit [Quit: Linkinus - http://linkinus.com]
niku4i has quit [Remote host closed the connection]
cousine has joined #ruby
Urthwhyte is now known as Urth|Away
kil0byte_ has joined #ruby
cousine has quit [Remote host closed the connection]
zodiak has joined #ruby
workmad3_ has joined #ruby
philcrissman has joined #ruby
keppy has joined #ruby
ananthakumaran has joined #ruby
kil0byte has quit [Ping timeout: 250 seconds]
mikepack has quit [Ping timeout: 252 seconds]
tcopp has quit [Disconnected by services]
mikepack has joined #ruby
balazs has joined #ruby
balazs_ has joined #ruby
gtuckerkellogg has joined #ruby
<pk1001100011> Can someone tell me what is wrong here? https://gist.github.com/2828788 As result of "new" I get 12345 instead of 120
williamcotton has joined #ruby
<hoelzro> pk1001100011: what does '12345'.to_a[0].to_i return?
khakimov has quit [Quit: Computer has gone to sleep.]
<hoelzro> or even '12345'.to_a
<pk1001100011> :o
<pk1001100011> Thank you. :)
baroquebobcat has joined #ruby
<hoelzro> np
<Synthead> in a class, if I have a def whatever ... end, would you call that a "function"? or is there a more appropriate name?
<hoelzro> Synthead: method?
<seanstickle> Synthead: method
<Hanmac> dont use String#to_a ... use split
<shevy> Synthead method is like a function attached to an object
<hoelzro> Hanmac: what about #each_char?
<shevy> though you could use methods like objects too
<Hanmac> hoelzro each_char works too but maybe not for 1.8
ben_alman has quit [Excess Flood]
<hoelzro> I just tried it on 1.8
<hoelzro> I think each_char is ok
Manhose has quit [Ping timeout: 245 seconds]
<Synthead> hoelzro, seanstickle, shevy: great! thanks! making sure my terminology is correct. What about a def x ... end outside of a class y ... end?
<hoelzro> but each_byte and others may not be
<shevy> could be for the 1.8.7 branch
<hoelzro> ah
<Synthead> hoelzro, seanstickle, shevy: would that be a method too?
<seanstickle> Synthead: function
<hoelzro> Synthead: still technically a method
albemuth has quit [Quit: Computer has gone to sleep.]
<hoelzro> but you can call it a function
<shevy> Synthead no it is still a method, bound to either class Object or to some pseudo-class
LtHummus has joined #ruby
<seanstickle> Only technically a method in Ruby because even the default scope is part of an object
<shevy> banister wrote something... wonder if I will find it...
<Synthead> seanstickle: ahhhh, okay
<seanstickle> In Python it would be a function
cousine has joined #ruby
<Hanmac> methods can have methods too :P
<Synthead> seanstickle: are there even functions in ruby?
<seanstickle> Synthead: not really so much.
<shevy> horseman, where is that thing you wrote about toplevel classes and that? or where is your blog... I forgot
<seanstickle> Synthead: but for convenience, methods not explicitly in a class are sometimes referred to as functions
joch_n has quit [Quit: Linkinus - http://linkinus.com]
CheeToS has joined #ruby
<horseman> shevy: banisterfiend.wordpress.com/2010/11/23/what-is-the-ruby-top-level/
bluOxigen has quit [Ping timeout: 265 seconds]
twqla has quit [Ping timeout: 244 seconds]
chomp has joined #ruby
<graspee> is that like "what is the matrix?"
<horseman> graspee: no u
akem has joined #ruby
<graspee> syntax error in horseman line 1
rippa has joined #ruby
<seanstickle> Ruby is a world that has been pulled over your eyes to blind you to the truth.
<seanstickle> That you are programming Smalltalk.
<graspee> whoah
Jake232 has joined #ruby
linoj has joined #ruby
tvw has quit [Remote host closed the connection]
ipoval has joined #ruby
bosphorus has quit [Remote host closed the connection]
djdb has quit [Remote host closed the connection]
Vert has joined #ruby
ben_alman has joined #ruby
andrew__ has joined #ruby
Divinite has joined #ruby
yankov has joined #ruby
* UNIXgod thought it was awk simulating smalltalk with lisp like syntax wrapped into one.
ank has joined #ruby
<seanstickle> Nah, that's Perl 6.
<UNIXgod> lol
keanehsiao_ has joined #ruby
<UNIXgod> tr came from multics. At least it has heritage
ph^ has joined #ruby
celm has joined #ruby
workmad3_ has quit [Ping timeout: 246 seconds]
keanehsiao has quit [Ping timeout: 248 seconds]
eurek has joined #ruby
alesguzik has quit [Quit: leaving]
baroquebobcat has quit [Quit: baroquebobcat]
kil0byte has joined #ruby
jackiechan0 has joined #ruby
bosphorus has joined #ruby
jackiechan0 has quit [Max SendQ exceeded]
jackiechan0 has joined #ruby
jprovazn is now known as jprovazn_away
<roolo> Is there simple way to force Pow to care only about requests on his domain?
jenrzzz-mac has quit [Quit: jenrzzz-mac]
C0deMaver1ck is now known as Gold|Leader
kil0byte_ has quit [Ping timeout: 265 seconds]
jenrzzz-mac has joined #ruby
<roolo> It is swallowing my requests for Apache
zinjacoder has quit [Remote host closed the connection]
<workmad3> roolo: sounds more like a port issue
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<workmad3> roolo: if you've got pow on port 80, I'm surprised apache even managed to start
<hoelzro> roolo: you're not doing anything crazy like using iptables to rewrite the port number of a request, are you?
<roolo> hoelzro: I am not doing anything with iptables
<hoelzro> just checking =)
<roolo> hoelzro: Why? It's time to do something crazy and stupid?
<roolo> ;)
<hoelzro> roolo: what does netstat have to say?
twqla has joined #ruby
foofooba1 has quit [Quit: Computer has gone to sleep]
MasterIdler has joined #ruby
adambeynon has joined #ruby
<roolo> hoelzro: Lot of things. On what should i focus?
<hoelzro> try netstat -nlpt -A inet
<hoelzro> (assuming you only care about IPv4)
<hoelzro> and see who's listening on 80
zinjacoder has joined #ruby
<graspee> a real life demon on the internet
Gold|Leader is now known as C0deMaver1ck
Guest81751 has quit [Quit: ばいばい]
<graspee> his mouth open to a certain port
<graspee> ; ; why do you guys always manage to trick me into saying off-topic things?!
hoelzro is now known as hoelzro|away
<roolo> hoelzro|away: My netstat is not happy with your params
<lectrick> What is the thing that will do a binary search through your git commits to find which commit fails a test?
<JonnieCache> roolo: try lsof -i
<lectrick> git-bisect
eurek has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Divinite has quit [Quit: Divinite has left :(]
virunga has quit [Read error: Connection reset by peer]
<roolo> JonnieCache: I can see only http-alt listening. I temporarily move apache to 8080 to get it work
robacarp has quit [Quit: leaving]
daniel_hinojosa has joined #ruby
twelvechairs has joined #ruby
albemuth has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
brianpWins has quit [Quit: brianpWins]
<Synthead> is Logger a built-in class in ruby?
<seanstickle> Yup
DrShoggoth has joined #ruby
<seanstickle> Standard library
<Synthead> seanstickle: ah, that explains it
lkba has joined #ruby
kenperkins has joined #ruby
twelvechairs has quit [Quit: Leaving]
nyuszika7h has quit [Read error: Connection reset by peer]
demian`_ has joined #ruby
cousine has quit [Remote host closed the connection]
wangr_ has joined #ruby
sits has quit [Quit: sits]
davidcelis has quit [Quit: K-Lined]
nyuszika7h has joined #ruby
nyuszika7h has quit [Client Quit]
nyuszika7h has joined #ruby
Urth|Away is now known as Urthwhyte
maesbn has quit [Remote host closed the connection]
williamcotton has quit [Quit: williamcotton]
maletor has joined #ruby
wangr has quit [Ping timeout: 245 seconds]
jcromartie has joined #ruby
kaiwren has quit [Quit: kaiwren]
ukwiz has quit [Quit: Leaving]
fermion has quit [Ping timeout: 245 seconds]
hydrozen has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
nyuszika7h has quit [Quit: WeeChat 0.3.8-rc2]
statix has quit [Remote host closed the connection]
statix has joined #ruby
nyuszika7h has joined #ruby
dekroning has quit [Ping timeout: 250 seconds]
jxpx777 has joined #ruby
williamcotton has joined #ruby
robbyoconnor has joined #ruby
fserb has joined #ruby
larissa has quit [Quit: Saindo]
williamcotton has quit [Client Quit]
ipoval has quit [Quit: ipoval]
abra has joined #ruby
foofoobar has joined #ruby
fermion has joined #ruby
fbernier has joined #ruby
tvw has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
Jake232 has quit [Read error: Connection reset by peer]
hoelzro|away is now known as hoelzro
<hoelzro> roolo: OS?
areil has quit [Remote host closed the connection]
<roolo> hoelzro: OSX
kenperkins has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<hoelzro> ah, sorry
zommi has quit [Remote host closed the connection]
carloslopes has quit [Ping timeout: 240 seconds]
Retistic has joined #ruby
thone_ has joined #ruby
liluo has quit [Remote host closed the connection]
digitalcakestudi has quit [Quit: Leaving.]
kenperkins has joined #ruby
dhruvasagar has joined #ruby
chrismcg is now known as zz_chrismcg
foofoobar has quit [Quit: bb]
lorandi has joined #ruby
d3vic3 has joined #ruby
fmcgeough has joined #ruby
thone has quit [Ping timeout: 248 seconds]
nnp_tnp has joined #ruby
nnp_tnp has quit [Client Quit]
imami|afk is now known as banseljaj
Nowaker has quit [Ping timeout: 248 seconds]
baroquebobcat has joined #ruby
SegFaultAX|work2 has joined #ruby
bosphorus has quit [Remote host closed the connection]
schovi has quit [Remote host closed the connection]
LMolr has quit [Ping timeout: 245 seconds]
Helius has quit [Remote host closed the connection]
nnp_nnt has joined #ruby
digitalcakestudi has joined #ruby
KL-7 has joined #ruby
PragCypher has quit [Read error: Connection reset by peer]
SimSala has quit [Ping timeout: 250 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
senny has quit [Remote host closed the connection]
davidcelis has joined #ruby
Roel3q4 has joined #ruby
hoelzro is now known as hoelzro|away
savage- has joined #ruby
nilg has quit [Read error: Connection reset by peer]
Roel3q4 has quit [Remote host closed the connection]
yannis has joined #ruby
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
Roel3q4 has joined #ruby
Roel3q4 has quit [Remote host closed the connection]
Roel3q4 has joined #ruby
burgestrand has joined #ruby
alem0lars has quit [Quit: quit]
celm has quit [Remote host closed the connection]
tcopp has joined #ruby
williamcotton has joined #ruby
pdtpatrick has joined #ruby
gilead has quit [Quit: Leaving]
cousine has joined #ruby
Norrin__ has joined #ruby
linoj has quit [Quit: linoj]
icooba has joined #ruby
Norrin_ has quit [Ping timeout: 265 seconds]
CheeToS has quit [Ping timeout: 245 seconds]
friskd has joined #ruby
Mchl has joined #ruby
<regedarek> Hi, how to set ruby to use US date format
<regedarek> s = Search.new(headed: "Waw", rooms: 1, adults: 1, arriving_date: "05/25/2012", leaving_date: "05/30/2012")
one8zero has quit [Quit: one8zero]
<regedarek> for now leaving and arriving date is nil
<seanstickle> monkeypatch!
msaffitz has joined #ruby
PragCypher has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
roolo has quit [Quit: Linkinus - http://linkinus.com]
bier has quit [Ping timeout: 248 seconds]
yannis has quit [Quit: yannis]
jxpx777 has quit [Quit: Mac is sleeping…]
Morkel has joined #ruby
rasbonics has quit [Quit: rasbonics]
PragCypher has quit [Client Quit]
kenichi has joined #ruby
artOfWar has joined #ruby
roolo has joined #ruby
ChampS666 has quit [Ping timeout: 256 seconds]
workmad3 has quit [Quit: leaving]
workmad3 has joined #ruby
ofcan has joined #ruby
jnoob22 has quit [Quit: Leaving]
moted has joined #ruby
emmanuelux has quit [Ping timeout: 264 seconds]
<ofcan> How to iterate through class hierarchy recursively until certain class is reached?
fjfish has quit [Remote host closed the connection]
<Hanmac> ofcan what direction do you mean? from the one class to its parents, or from the parrent over ther children?
bosphorus has joined #ruby
<ofcan> Hanmac: from one class to its parents
Nowaker has joined #ruby
<Hanmac> ClassName.ancestors
cmarques has joined #ruby
n1x has joined #ruby
stkowski has joined #ruby
carloslopes has joined #ruby
bier has joined #ruby
<keanehsiao_> hi there. I wonder.. is there something like multiple update for sequel gem??
adeponte has joined #ruby
lxsameer has joined #ruby
walbert has joined #ruby
<davidcelis> ClassName.superclass
<davidcelis> for the direct superclass
fr0gprince_ has quit [Read error: Connection reset by peer]
<keanehsiao_> hi there. I wonder.. is there something like multiple update for sequel gem??
philips has quit [Excess Flood]
Araxia_ has joined #ruby
yankov has quit [Quit: yankov]
petercs has joined #ruby
imsplitbit has joined #ruby
Aaton_off is now known as Aaton
philips has joined #ruby
jrajav has joined #ruby
jrajav has quit [Client Quit]
Araxia_ has quit [Read error: Connection reset by peer]
Araxia_ has joined #ruby
ananthakumaran1 has joined #ruby
Vendethiel has joined #ruby
artOfWar has quit [Ping timeout: 265 seconds]
AlbireoX`Laptop has joined #ruby
ananthakumaran has quit [Ping timeout: 244 seconds]
yannis has joined #ruby
strcrzy_ is now known as strcrzy
yonggu has quit [Quit: yonggu]
ephemerian has quit [Quit: Leaving.]
fr0gprince_ has joined #ruby
uris has joined #ruby
brianpWins has joined #ruby
stephenjudkins has joined #ruby
artOfWar has joined #ruby
Roel3q4 has quit []
n1x has quit [Quit: Ex-Chat]
fserb has quit [Quit: ttyl]
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
alexim has joined #ruby
amacgregor_osx has joined #ruby
gregorg has quit [Ping timeout: 245 seconds]
Mchl has joined #ruby
amacgregor_osx_ has joined #ruby
amacgregor_osx has quit [Read error: Connection reset by peer]
jgrevich has joined #ruby
<ofcan> Hanmac: hm.. think I need to clarify my question a bit. I have written it on SO so please take a look > http://stackoverflow.com/questions/10803539/iterating-through-rails-relationships-recursively-to-find-specific-parent-class
<eam> win 7
<ofcan> I have a question regarding finding specific parent class ( I have posted all to SO ), please be awesome and take a look > http://stackoverflow.com/questions/10803539/iterating-through-rails-relationships-recursively-to-find-specific-parent-class
<eam> eventmachine question: I have several thousand descriptors and I'd like to use EM to replace my current select() loop (since ruby builds with a fixed FD_SETSIZE). I can't find any docs on how to add already-opened fds to the EM
<arturaz> ofcan, "foo".class.ancestors
<eam> looking for a pointer to docs on how to add a fd to EM and service it
jackiechan0 has quit [Quit: Sto andando via]
Vainoharhainen has quit [Quit: Leaving...]
Eiam has joined #ruby
yankov has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
chomp[1] has joined #ruby
cousine has quit [Remote host closed the connection]
SPYGAME has joined #ruby
Vendethiel` has joined #ruby
luckyruby has joined #ruby
Vainoharhainen has joined #ruby
crankycoder has quit [Remote host closed the connection]
AzizLight has joined #ruby
<AzizLight> Hi everybody
<AzizLight> I just saw this line of code in a project: require 'tempfile'. Is tempfile part of the ruby standard library? What does it do?
chomp has quit [Ping timeout: 260 seconds]
Vendethiel has quit [Ping timeout: 248 seconds]
<shevy> AzizLight yes it is part of standard ruby
<shevy> it allows one to somehow use the memory for tempfile purpose
<Hanmac> shevy i thought it uses the /tmp path under linux
<shevy> hmm
<shevy> probably uses what is set to $TEMP
<shevy> :(
<shevy> I thought it uses only memory
<shevy> yeah indeed you are right, it makes real files:
<shevy> "When a Tempfile object is garbage collected, or when the Ruby interpreter exits, its associated temporary file is automatically deleted."
ObjLn has joined #ruby
<eam> $TMPDIR
<AzizLight> shevym, Hanmac: thanks
<Hanmac> on my system /tmp is using tmpfs so its used memory
<AzizLight> other question: I want to convert an audio file to .wav, is there a ruby solution for this or my best bet is to use ffmpeg?
ObjLn has left #ruby [#ruby]
msaffitz has quit [Quit: Computer has gone to sleep.]
lxsameer has quit [Quit: Leaving]
one8zero has joined #ruby
xbayrockx has quit []
<_br_> AzizLight: The ruby-audio thing is not cutting it for you? If I remember correctly its using libsndfile no?
cha1tanya has quit [Quit: Leaving]
<ofcan> arturaz: that doesn't show Project in 'task'.class.ancestors
pk1001100011 has quit [Ping timeout: 244 seconds]
<AzizLight> _br_: can ruby-audio convert mp3 to wav?
beneggett has joined #ruby
azm has joined #ruby
c0rn has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
<_br_> AzizLight: did you check it?
remmy444 has quit [Ping timeout: 244 seconds]
rmascarenhas has joined #ruby
dkissell has quit [Read error: Connection reset by peer]
dkissell has joined #ruby
<shevy> AzizLight if ffmpeg is available then sure
<AzizLight> shevy: ok I'll go with ffmpeg
<AzizLight> thanls
<AzizLight> thanks
<shevy> ffmpeg is cool
<shevy> anything I throw at it, it tries to process
<shevy> .mp3, .avi and .monkeys
jackiechan0 has joined #ruby
simao has quit [Read error: Operation timed out]
iocor has quit [Quit: Computer has gone to sleep.]
jackiechan0 has quit [Read error: Connection reset by peer]
ofcan has quit [Quit: leaving]
Urthwhyte is now known as Urth|Away
elhu has quit [Ping timeout: 246 seconds]
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
fserb has joined #ruby
headius has joined #ruby
chomp[1] has quit [Quit: Leaving]
chomp has joined #ruby
fserb has quit [Client Quit]
wallerdev has quit [Quit: wallerdev]
jjjj has joined #ruby
jmontross has joined #ruby
awarner has joined #ruby
xbayrockx has joined #ruby
freakazoid0223 has quit [Ping timeout: 246 seconds]
cableray has quit [Quit: cableray]
Urth|Away is now known as Urthwhyte
davidw has quit [Ping timeout: 240 seconds]
shaman42 has quit [Ping timeout: 248 seconds]
d34th4ck3r has joined #ruby
jackiechan0 has joined #ruby
crankycoder has joined #ruby
roolo has quit [Quit: Linkinus - http://linkinus.com]
Doobie_ has quit [Quit: No Ping reply in 180 seconds.]
Urthwhyte is now known as Urth|Away
AlbireoX`Laptop has quit [Remote host closed the connection]
freakazoid0223 has joined #ruby
Squarepy has joined #ruby
friskd has quit [Ping timeout: 252 seconds]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
nw has quit [Ping timeout: 276 seconds]
Doobie has joined #ruby
itnomad has joined #ruby
jeebster has joined #ruby
KL-7 has quit [Ping timeout: 240 seconds]
AlbireoX`Laptop has joined #ruby
ramblex_ has joined #ruby
Doobie has quit [Quit: No Ping reply in 180 seconds.]
ximarin has quit [Ping timeout: 245 seconds]
cbuxton has quit [Quit: Leaving.]
Guest10091 is now known as corey
Squarepy_ has joined #ruby
corey is now known as Corey
ramblex has quit [Ping timeout: 265 seconds]
s0ber_ has joined #ruby
thecreators has quit [Quit: thecreators]
Squarepy has quit [Read error: Connection reset by peer]
Jb_ has quit [Read error: Operation timed out]
pk1001100011 has joined #ruby
ByteCrunch has quit [Read error: Operation timed out]
ByteCrunch has joined #ruby
Morkel has quit [Quit: Morkel]
Jb_ has joined #ruby
nw has joined #ruby
ramblex_ has quit [Ping timeout: 244 seconds]
pk1001100011 has quit [Client Quit]
pk1001100011 has joined #ruby
sonicpond has joined #ruby
krusty_ar has quit [Ping timeout: 256 seconds]
s0ber has quit [Ping timeout: 256 seconds]
s0ber_ is now known as s0ber
Neil___ has quit [Remote host closed the connection]
i8igmac has quit [Ping timeout: 256 seconds]
krusty_ar has joined #ruby
cbuxton has joined #ruby
Eldariof59-ru has joined #ruby
werdnativ has joined #ruby
adamkittelson has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
maletor has joined #ruby
shaman42 has joined #ruby
beneggett has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
Solnse has joined #ruby
voodoofish430 has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
Urth|Away is now known as Urthwhyte
t0mmyvyo has joined #ruby
xnm has joined #ruby
jackiechan0 has quit [Quit: Sto andando via]
i8igmac has joined #ruby
<Synthead> if I fork a job (like job = fork { loop do; sleep 1; end }) and then do a Process.kill(:SIGTERM, job), it shouldn't restart the forked process, right? it should just die?
mk03 has joined #ruby
Squarepy_ has quit [Quit: Leaving]
<Mon_Ouie> Unless that code where you call fork is in a loop, it should just die
AlbireoX`Laptop has joined #ruby
pu22l3r has quit [Ping timeout: 248 seconds]
Eldariof27-ru has joined #ruby
friskd has joined #ruby
diegoviola has quit [Remote host closed the connection]
diegoviola has joined #ruby
eph3meral has quit [Quit: Leaving]
Eldariof59-ru has quit [Ping timeout: 245 seconds]
td123 has joined #ruby
kaiwren has joined #ruby
prtksxna has quit [Remote host closed the connection]
kaiwren has quit [Client Quit]
williamcotton has quit [Ping timeout: 245 seconds]
C0deMaver1ck has quit [Ping timeout: 265 seconds]
C0deMaver1ck has joined #ruby
C0deMaver1ck has quit [Changing host]
C0deMaver1ck has joined #ruby
brandonsatrom has joined #ruby
btanaka has joined #ruby
jdripper has quit [Quit: Leaving.]
SPYGAME has quit [Quit: Leaving]
williamcotton has joined #ruby
brandonsatrom has left #ruby [#ruby]
tfitts has quit [Ping timeout: 252 seconds]
kil0byte_ has joined #ruby
twinturbo has joined #ruby
one8zero has quit [Quit: one8zero]
mrsolo has joined #ruby
chomp[1] has joined #ruby
jxpx777 has joined #ruby
fermion has quit [Quit: P]
one8zero has joined #ruby
kil0byte has quit [Ping timeout: 260 seconds]
chomp has quit [Ping timeout: 248 seconds]
ciopte7 has quit [Quit: ciopte7]
kenyabob has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
Urthwhyte is now known as Urth|Away
becom33 has joined #ruby
choffstein has quit [Remote host closed the connection]
Urth|Away is now known as Urthwhyte
ananthakumaran1 has quit [Quit: Leaving.]
twinturbo has quit [Quit: twinturbo]
jrist is now known as jrist-lunch
mnaser_ has quit [Quit: Computer has gone to sleep.]
ramblex has joined #ruby
dekroning has joined #ruby
dekroning has quit [Client Quit]
mikepack has joined #ruby
dEPy has joined #ruby
tomb_ has joined #ruby
stephenjudkins has joined #ruby
ZifreCL has joined #ruby
dnyy has joined #ruby
<dEPy> Hi, I have a question, I'm kinda new to ruby..
<jeebster> can nil be passed as an argument to ruby methods?
<dEPy> Can I conditionaly include a mixin?
<dEPy> I have a User class with kinda has 2 subclasses with some unique methods and without additional properties
<horseman> dEPy: yes u can
<sepp2k> dEPy: Sure. include Foo if do_i_want_to_include_foo?
<dEPy> I somehow want to determine on login which kind of user it is and conditionaly mix some methods in
a_a_g has joined #ruby
<dEPy> is this a proper way to do it even?
jackiechan0 has joined #ruby
<sepp2k> That doesn't sound as if you want conditionally include a mixin. It sounds like you just want to return one or the other subclass from the login method.
<carloslopes> jeebster: yes
`brendan has joined #ruby
<dEPy> sepp2k I thought that also but wasnt sure how to deal with this since my user is an ActiveRecord entity :S
<dEPy> I kinda want to decouple my domain logic away from active record
<jeebster> carlos, do I need to specify that I'm passing a nil value in the arguments. like some_method(arg = nil)
<jeebster> I want to pass in any value
a_a_g1 has joined #ruby
<carloslopes> jeebster: no, when you use 'def method(arg = nil)'
<carloslopes> jeebster: is the same to use def method(arg)
<jeebster> ok, thanks
a_a_g has quit [Ping timeout: 246 seconds]
a_a_g1 has quit [Client Quit]
<carloslopes> jeebster: the only difference is that with 'method(arg = nil)', the method accept that you call him without any argument
Urthwhyte is now known as Urth|Away
<carloslopes> jeebster: and using 'method(arg)', you always need to call it and pass an argument
ChampS666 has joined #ruby
ChampS666 has quit [Client Quit]
mnaser has joined #ruby
ciopte7 has joined #ruby
a_a_g has joined #ruby
luxurymode has quit [Quit: Computer has gone to sleep.]
headius has quit [Quit: headius]
cableray has joined #ruby
williamcotton_ has joined #ruby
a_a_g has left #ruby [#ruby]
counterbeing has joined #ruby
williamcotton has quit [Ping timeout: 244 seconds]
williamcotton_ is now known as williamcotton
KL-7 has joined #ruby
harukomoto has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
axl_ has joined #ruby
jimeh has quit [Ping timeout: 244 seconds]
S2kx has quit [Quit: Leaving]
banghouse is now known as banghouseAFK
S1kx has joined #ruby
quuxman has quit [Quit: leaving]
AlbireoX`Laptop has joined #ruby
apeiros_ has joined #ruby
harukomoto has quit [Ping timeout: 252 seconds]
KL-7 has quit [Quit: Leaving]
williamcotton has quit [Ping timeout: 248 seconds]
williamcotton has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
rramsden has joined #ruby
rramsden has quit [Client Quit]
harukomoto has joined #ruby
tomb_ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
azm has quit [Ping timeout: 244 seconds]
c0rn has quit [Quit: Computer has gone to sleep.]
fr0gprince_mac has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
kirun has joined #ruby
friskd has quit [Quit: friskd]
mneorr_ has joined #ruby
friskd has joined #ruby
Urth|Away is now known as Urthwhyte
friskd has quit [Client Quit]
<Azure> question: For comparing a value with multiple values, is (0.001 || 0.20 || 0.10) >= 1.00 valid?
bosphorus has quit [Remote host closed the connection]
<rippa> no
davidcelis has quit [Quit: K-Lined]
cbuxton1 has joined #ruby
<Hanmac> Azure: [0.001,0.2,0.1].any? {|o| o >= 1.0}
<rippa> [0.001, 0.20, 0.10].all? {|i| i >= 1.00}
<rippa> yeah
<rippa> any?
mneorr has quit [Ping timeout: 252 seconds]
jenrzzz-mac has joined #ruby
<Azure> I see
<shevy> hah
<shevy> beat that haskell!
<seanstickle> Perl's Quantum::Superposition does that too
kevinbond has quit [Quit: kevinbond]
<shevy> lol
davidpk has joined #ruby
lorandi has quit [Ping timeout: 245 seconds]
cbuxton2 has joined #ruby
cbuxton has quit [Ping timeout: 265 seconds]
iamjarvo has quit [Quit: Leaving.]
<Hanmac> if you have more complicated obects then float use something like this [0.001,0.2,0.1].to_enum(:any?).each_with_object(1.0,&:>=)
cbuxton1 has quit [Ping timeout: 256 seconds]
gmcinnes has joined #ruby
rramsden has joined #ruby
<shevy> hmm
<shevy> but arent these all floats
Urthwhyte is now known as Urth|Away
<Hanmac> shevy is this example yes
chienpo has joined #ruby
chico_chicote has joined #ruby
abra has quit [Remote host closed the connection]
mnaser has quit [Quit: Computer has gone to sleep.]
robertondc has joined #ruby
rramsden has quit [Quit: leaving]
lorandi has joined #ruby
Morkel has joined #ruby
jesly has joined #ruby
cmarques has quit [Quit: Get MacIrssi - http://www.sysctl.co.uk/projects/macirssi/]
rushed has quit [Quit: rushed]
Urth|Away is now known as Urthwhyte
tomb_ has joined #ruby
schovi has joined #ruby
Urthwhyte is now known as Urth|Away
etehtsea has joined #ruby
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
PaciFisT has left #ruby [#ruby]
etehtsea has quit [Client Quit]
Vert has joined #ruby
jackiechan0 has quit [Ping timeout: 244 seconds]
jesly has quit [Quit: Leaving]
kil0byte_ has quit [Remote host closed the connection]
crankycoder has quit [Remote host closed the connection]
jimeh has joined #ruby
francisfish has joined #ruby
<gmcinnes> has anyone had a problem with mysql gem on mysql 5.5 ?
sts_ is now known as sts
iamjarvo has joined #ruby
ph^ has quit [Remote host closed the connection]
dtolj has joined #ruby
cdempsey has quit [Quit: Quitting!]
<dtolj> using ruby-informix, I get following error when using prepared statement: Informix::DatabaseError: Prepared statement is not a cursor specification:
jimeh has quit [Ping timeout: 246 seconds]
tomb_ has quit [Quit: Computer has gone to sleep.]
itnomad has quit [Ping timeout: 256 seconds]
itnomad has joined #ruby
jackiechan0 has joined #ruby
becom33 has quit [Quit: Leaving]
lorandi has quit [Quit: Leaving]
tatsuya_o has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
tatsuya_o has quit [Read error: Connection reset by peer]
tatsuya_o has joined #ruby
ph^ has joined #ruby
one8zero has quit [Quit: one8zero]
pastjean has joined #ruby
davidcelis has joined #ruby
kuranai is now known as kuranai|off
ciopte7 has quit [Quit: ciopte7]
one8zero has joined #ruby
nanderoo has quit [Quit: Leaving.]
workmad3 has joined #ruby
one8zero has quit [Client Quit]
Criztian has joined #ruby
<keppy> can you specify a range as a block parameter in ruby?
pastjean has quit [Remote host closed the connection]
<keppy> { |n*i to n*(i + 1) | ... }
petercs has quit [Ping timeout: 240 seconds]
jamesaxl has joined #ruby
<Hanmac> keppy: i dont think so
tfitts has joined #ruby
patsplat has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
td123 has quit [Quit: WeeChat 0.3.7]
<workmad3> keppy: what would that even mean? :/
<dEPy> are there any gems for method/function level authorization?
<dEPy> So I can say this Class can access this methods and not others
xaq has joined #ruby
kenyabob has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
<Hanmac> imo i would use something like that for keppys problem (n*i).upto(n*(i + 1)) {|x| ... }
<Hanmac> depy i dont think so ... in ruby everything is very dynamic
kil0byte has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
<Synthead> stating "rescue" without a parameter means catching all exceptions, right?
one8zero has joined #ruby
nfluxx has joined #ruby
<carloslopes> Synthead: yes, all standard error exceptions iirc
<workmad3> Synthead: no
<workmad3> Synthead: all exceptions that have StandardError in their ancestors, not all exceptions
<Hanmac> some errors like syntax error ar not rescured
<workmad3> or LoadError :)
<Synthead> what about Timeout::Error with net-ssh?
<workmad3> Synthead: pass, maybe have a look at its ancestors?
<carloslopes> Synthead: it probably catches
<carloslopes> catch*
cbuxton2 has quit [Read error: Connection reset by peer]
itnomad has quit [Quit: Leaving]
<Synthead> carloslopes: it's not catching with just "rescue" atm
meal has joined #ruby
cbuxton has joined #ruby
Eldariof27-ru has quit []
<dEPy> How do I then deal with a scenario wher I have a different users where user A can add tasks, end tasks, ... and user B can only apply for those tasks
<Synthead> is there a way to say "every standard exception and this other exception"?
<workmad3> Synthead: multiple rescues
<Synthead> workmad3: with repeated code?
<carloslopes> Synthead: i said catch but i mean rescue hahaha :p
Urth|Away is now known as Urthwhyte
<workmad3> Synthead: you could also do rescue Timeout::Error, StandardError I suspect
jenrzzz-mac has joined #ruby
<carloslopes> yes, i think you can catch multiple types in the same rescue
<carloslopes> s/catch/rescue (aaarrgg, sorry) :p
<meal> simple question about xmlrpc - I want to create a gem - in connection.rb I'd like to create a connection object (of Connection class) and make call on it in another class, let's call it User. how can I make this connection available in other class?
<meal> should I create module and use mattr_accessor? (it'll be rails plugin)
seanstickle has quit [Quit: Nihil sub sole novum]
jonathanwallace has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Synthead> is there a way I can catch multiple exceptions to run the same chunk of code, but still reference the exception it caught for accurate logs?
peregrine81 has joined #ruby
sepp2k has quit [Quit: Leaving.]
<peregrine81> anyone have any experience with ruby-webmachine? In production?
sepp2k has joined #ruby
bricker88 has joined #ruby
<bricker88> Hey, can I get the month from a Time object WITH 0 padding, without using strftime?
celm has joined #ruby
celm has quit [Remote host closed the connection]
<Hanmac> bricker88 "%0.2d" % time.month
<meal> simple question about xmlrpc - I want to create a gem - in connection.rb I'd like to create a connection object (of Connection class) and make call on it in another class, let's call it User. how can I make this connection available in other class?
<apeiros_> that . is unecessary
<meal> should I create module and use mattr_accessor? (it'll be rails plugin)
<carloslopes> Synthead: rescue ArgumentError, RuntimeError => e
<Hanmac> rescue SyntaxError, NameError => boom
<bricker88> Hanmac: Thank you. Can you explain the syntax to me? I am not familiar with that substitution syntax except from python, I didn't know it was a thing in Ruby.
<carloslopes> Synthead: and use the e will be the exception object :)
rippa has quit [Ping timeout: 252 seconds]
jenrzzz-mac has quit [Quit: jenrzzz-mac]
sepp2k has quit [Ping timeout: 246 seconds]
<Hanmac> bricker88 its the same as format("%0.2d",time.month) but only shorter
mneorr_ has quit [Remote host closed the connection]
jrist-lunch is now known as jrist
<apeiros_> Hanmac: "%02d" works the same as "%0.2d"
<apeiros_> just sayin
<bricker88> Hanmac: I see. So I get that it's only including the 0 if time.month isn't one character… but what ruby syntax is this? I've never come across it.
wallerdev has joined #ruby
maletor has joined #ruby
<workmad3> bricker88: % is a way to do string formatting (it's very like the python stuff too)
<apeiros_> sure you have. you did do something like 1 + 2? :)
<apeiros_> % is just a method like +.
<bricker88> apeiros_: Oh, yes I am familiar with the % operator, I didn't know that's how the symbol was being used here
<workmad3> bricker88: I believe the source of the syntax is buried in the days of C and printf (or maybe beyond :) )
sepp2k has joined #ruby
<bricker88> I see
<bricker88> Okay, thank you!
jchauncey has joined #ruby
<Hanmac> apeiros_ ri shows it with a dot so i keep using it: %[flags][width][.precision]type
platzhirsch has joined #ruby
<workmad3> Hanmac: I believe %02 is giving the 2 as the width, not as the precission
<workmad3> *precision
jxpx777 has quit [Quit: Be back later]
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
<platzhirsch> I have a piece of Ruby code here using rand.call where rand is the input of a variable is rand, what coudl rand be? An object of Random?
fmcgeough has quit [Quit: fmcgeough]
ken_barber has quit [Remote host closed the connection]
<workmad3> platzhirsch: reading between the lines, I'd guess that 'rand' (very bad name btw, conflicts with Kernel#rand) is a proc-like object
<workmad3> platzhirsch: or, more precisely, a callable
<platzhirsch> workmad3: yes, that at least
<workmad3> platzhirsch: it could be anything though, as long as it responds to a .call method
jackiechan00 has joined #ruby
<apeiros_> platzhirsch: just run the code and inspect it?
<apeiros_> p rand.class
<platzhirsch> first code snippet in the accepted answer
jackiechan0 has quit [Ping timeout: 248 seconds]
jackiechan00 is now known as jackiechan0
<apeiros_> platzhirsch: rand_helper = lambda { Kernel.rand }
<platzhirsch> oh indeed
<platzhirsch> Kernel.rand, can't I just use rand() ?
<workmad3> platzhirsch: you can, but this way gives you a method to inject different types of randomness
<apeiros_> of course. but the way he gave it, you can substitute the prng
peregrine81 has quit [Quit: Goodbye.]
<workmad3> platzhirsch: for example, you could wrap up a way to read entropy from the microphone input into a proc and pass that in
<apeiros_> Kernel.rand is e.g. not of cryptographical strength
A124 has joined #ruby
<platzhirsch> obviously, sorry I didn't get it :)
<Hanmac> no you cant because you have an other rand method with has more priority maybe
counterbeing has quit []
A124 has left #ruby [#ruby]
counterbeing has joined #ruby
meal has quit [Quit: leaving]
seivan has joined #ruby
snearch has joined #ruby
<workmad3> incidentally, when I've done that sort of injection, I've tended to prefer Kernel.method(:rand)...
apok has joined #ruby
yxhuvud has quit [Ping timeout: 244 seconds]
jimeh has joined #ruby
fbernier has quit [Ping timeout: 246 seconds]
Criztian has quit [Read error: Connection reset by peer]
Criztian has joined #ruby
artOfWar has quit [Ping timeout: 245 seconds]
waxjar has joined #ruby
dv310p3r has quit [Ping timeout: 246 seconds]
<keppy> I'm trying to deal poker hands and doing it wrong.
<keppy> git://gist.github.com/2830540.git
<workmad3> keppy: html link plz?
<workmad3> (I can't be bothered to translate manually)
TheHNIC has joined #ruby
fr0gprince_ has quit [Ping timeout: 252 seconds]
<TheHNIC> hey guys, just read that :sym is faster than strings for hashes. Does anyone know if symbols are on the heap or stack?
<waxjar> don't use for .. in, rubyists dislike it strongly
<workmad3> keppy: that looks... like python
mneorr has joined #ruby
<TheHNIC> or does that even matter in ruby?
davidw has joined #ruby
davidw is now known as Guest25175
<workmad3> TheHNIC: symbols are value objects
<waxjar> TheHNIC, symbols are only stored once in memory, strings multiple times
fr0gprince_ has joined #ruby
<workmad3> and what waxjar just said :)
<Hanmac> but on the other hand symbols cant be GC'd
dnyy has quit [Remote host closed the connection]
<workmad3> Hanmac: well, considering a symbol, once created, always has a reference, that's not surprising :)
<waxjar> string = "key"; string2 = "key" gets you two objects, sym = :sym; sym2 = :sym gets you one
<Hanmac> i only want to say it, what he should be VERY carefull if he create symbols with user input
<workmad3> Hanmac: oh, yeah, fair point... don't use symbols for arbitrary data input
<waxjar> there was an article about it on r/ruby this week
<TheHNIC> workmad3: warjar thanks
<workmad3> they don't take up much space, but if you start creating millions of them then it's noticable :)
<TheHNIC> Wait a minute
<TheHNIC> Symbols cant be GC'd?
<waxjar> that should be helpful
mischief has left #ruby [#ruby]
<workmad3> TheHNIC: a symbol object never gets a reference count of 0
<TheHNIC> thanks
<workmad3> TheHNIC: so they're never eligible for GC
d34th4ck3r has quit [Ping timeout: 265 seconds]
<TheHNIC> workmad3: is there a way to get them in GC?
<TheHNIC> no way to force it?
<workmad3> TheHNIC: no... it's sort of like saying 'what? an integer isn't garbage collected?'
sudobear has joined #ruby
<workmad3> TheHNIC: or 'what? a class can't be garbage collected?' (although I'm pretty sure that you can GC a class... but the point sort of stands :) )
<Mon_Ouie> And you can garbage collect a Bignum too, btw :p
fr0gprince_ has quit [Ping timeout: 260 seconds]
<workmad3> :)
<TheHNIC> workmad3: let me read more on symbols. ive used them a lot in my ruby apps but i never really sat down and learned the innard.
<TheHNIC> I worked a lot in C# before
<Mon_Ouie> Also searched for interned strings
<Mon_Ouie> search*
<TheHNIC> so there were destruct methods.
<TheHNIC> interend strigns. k
<workmad3> yeah, symbols are close to interned strings in a C program, but in a dynamic language
<TheHNIC> ok
<TheHNIC> thanks
<Hanmac> information: shorter ruby strings are stored different then bigger strings ...
<workmad3> Mon_Ouie: I'd never really made that connection before btw, thanks :)
<workmad3> Hanmac: that's true in several languages
Solnse has quit []
<TheHNIC> thanks guys. i guess i gotta learn the internals of ruby a bit more before i start training this guy who is sitting next to me. we mostly work on WATIR and Sinatra, so the lower level stuff really wasnt a priority until now
<Hanmac> theHnic: i think the best thing in C that is like a ruby symbol is a enum value
<TheHNIC> Hanmac: that is starting to make some sense to me
Criztian has quit [Remote host closed the connection]
Criztian has joined #ruby
sudobear has quit [Client Quit]
<TheHNIC> so symbols are reference types that dont get GC'd like instance types. so when they are out of scope they are just gone...
Urthwhyte is now known as Urth|Away
<workmad3> TheHNIC: no, they don't go out of scope
<TheHNIC> really?
BrianE has joined #ruby
<workmad3> TheHNIC: the first time you do ':some_symbol' then every time you then do ':some_symbol' without restarting the VM you get exactly the same object
<TheHNIC> oh shit.
<TheHNIC> sorry
<TheHNIC> it just hit me.
<workmad3> heh :)
<workmad3> (internally, your ruby runtime maintains a table of all symbols created and does a lookup)
<TheHNIC> so create a symbol, references can drop but symbols dont. but they are reused immediately. woah.
TheHNIC is now known as enroxorz
<workmad3> something like that, yeah
<enroxorz> ok
<workmad3> because you're guaranteed to get the same object though, you get much faster comparison, as you can just compare the object id
<enroxorz> now i gotta think about when i use symbols or not. i dont want to get too crazy and have a ton of symbols in memory that will never be used...
<workmad3> as opposed to strings, where "str" == "str" creates two string objects and has to do a string comparison :)
<workmad3> just don't do crazy things like create symbols from arbitrary user input
ryannielson has joined #ruby
ryannielson has quit [Remote host closed the connection]
Criztian has quit [Ping timeout: 246 seconds]
<workmad3> things like user_input.to_sym == :some_symbol are bad
geekbri has quit [Remote host closed the connection]
<enroxorz> well that wouldnt make much sense anyway. still, its good to know these things for best practices.
<workmad3> but if you avoid the .to_sym method and only ever create symbols with literals... you're not practically going to write enough symbol literals to cause an issue :)
<enroxorz> i see..
<Mon_Ouie> user_input.to_sym gets used more commonly than you'd think
<workmad3> ^^
<Hanmac> you dont need to_sym ... :"key#{i}" works too :P
emmanuelux has joined #ruby
<workmad3> Mon_Ouie: how big is a symbol object btw?
<enroxorz> so, from a C# perspectiove (for me) treat symbols liek enums
<workmad3> I can't remember that sort of thing :)
<workmad3> enroxorz: sounds like a plan :)
<workmad3> Hanmac: good point :)
<enroxorz> ok
GhettoCode has joined #ruby
<enroxorz> thanks
<Mon_Ouie> Not sure, but I think you should also consider the size of the hash table (or, in YARV at least, hash tables) to store symbols
atmosx has joined #ruby
<workmad3> 1000000.times {|i| :"key#{i}" } would probably do bad things for your memory :)
phantasm66 has joined #ruby
phantasm66 has quit [Client Quit]
fr0gprince_ has joined #ruby
<workmad3> Mon_Ouie: for some reason the figure 40 bytes sprang to mind
<enroxorz> workmad3: what kind of mad man would do that?
btanaka has quit [Remote host closed the connection]
<workmad3> enroxorz: someone wondering how much memory their ruby process could grab?
<Hanmac> workmad3: symbol size is: usigned long ... or maybe unsigned longlong ... its the same size as void*
banghouseAFK is now known as banghouse
<enroxorz> workmad3: you got a point. benchmark time!
<workmad3> Hanmac: ah, smaller than I thought then :)
ph^ has quit [Remote host closed the connection]
<Hanmac> each ruby object VALUE is also an void* ...
Guest25175 is now known as davidw
<Mon_Ouie> That's the size of a reference to the object
snearch has quit [Quit: Verlassend]
davidw has quit [Changing host]
davidw has joined #ruby
krz has joined #ruby
mengu has joined #ruby
williamcotton_ has joined #ruby
<enroxorz> now, what book/site can help understand ruby internals better?
libertyprime has quit [Quit: Lost terminal]
<workmad3> enroxorz: github.com/ruby/ruby :D
apok has quit [Remote host closed the connection]
rasbonics has joined #ruby
williamcotton has quit [Ping timeout: 244 seconds]
williamcotton_ is now known as williamcotton
libertyprime has joined #ruby
walbert has quit []
Vendethiel` has quit [Quit: je ne suis plus là, tqvu]
wallerdev has quit [Quit: wallerdev]
werdnativ has quit [Quit: werdnativ]
<enroxorz> workmad3: lol. ok, I will look at the source code from now on. but warning, I will get lost easily.
<Hanmac> dont look at the mruby code .. its more confusing and not finish yet
stkowski_ has joined #ruby
Ankhers has quit [Remote host closed the connection]
kylemcgill has joined #ruby
stkowski has quit [Read error: Operation timed out]
stkowski_ is now known as stkowski
choffstein has joined #ruby
hynkle has quit [Quit: hynkle]
c0rn has joined #ruby
libertyprime has quit [Quit: Lost terminal]
kylemcgill has quit [Remote host closed the connection]
jmkeyes_ has joined #ruby
libertyprime has joined #ruby
mneorr has quit [Remote host closed the connection]
alegacyreborn has joined #ruby
<Mon_Ouie> workmad3: It seems Ruby creates an actual frozen String object when you create a symbol
<jmkeyes_> Is a class (MyClass) with attr_accessor :foobar the equivalent of Struct.new "MyClass", :foobar ?
<Mon_Ouie> str = "foobar" + 3.to_s; ObjectSpace.each_object(String).find { |s| s == str && !(s.equal? str) && s.frozen? }
linoj has joined #ruby
<Mon_Ouie> (if you use a string literal, Ruby will create a symbol at parse time)
td123 has joined #ruby
graspee has quit [Quit: leaving]
wargasm has joined #ruby
wilmoore has joined #ruby
chico_chicote has quit [Quit: Page closed]
compara20 has joined #ruby
apok has joined #ruby
pro has quit [Quit: leaving]
linoj has quit [Quit: linoj]
werdnativ has joined #ruby
pygospa has quit [Quit: leaving]
pygospa has joined #ruby
workmad3 has quit [Ping timeout: 245 seconds]
rmascarenhas has quit [Quit: leaving]
<davidcelis> a Symbol is technically implemented as a frozen String?
jchauncey has quit [Quit: jchauncey]
platzhirsch has left #ruby [#ruby]
<Mon_Ouie> Yes, stored in a hash table to be looked up easily, and to ensure unicity
<davidcelis> That's cool
<davidcelis> Didn't know that.
imsplitbit has quit [Quit: Linkinus - http://linkinus.com]
<carloslopes> davidcelis: after i discovered the real power of symbols, i wasn't the same :)
<davidcelis> This is all in the string.c file, eh?
schovi has quit [Remote host closed the connection]
<Mon_Ouie> parser.y
<Mon_Ouie> Go figure why
<davidcelis> wtf
<Mon_Ouie> Specifically rb_intern3
jackiechan0 has quit [Ping timeout: 245 seconds]
flip_digits has joined #ruby
Norrin has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
hakunin has joined #ruby
<davidcelis> Yeah that seems a weird place for it, but thanks for teaching me that
<davidcelis> I've been wanting to educate myself more on the Ruby internals, but IANA C Dev
jenrzzz-mac has joined #ruby
aibo has quit [Quit: Leaving]
Norrin__ has quit [Ping timeout: 252 seconds]
<davidcelis> I can comprehend C well enough and have written basic C, but it still takes a while to parse through stuff, and obviously an entire programming language would be quite a codebase to look through
laen_ has quit [Ping timeout: 244 seconds]
<Mon_Ouie> I'd be unable to find anything in the Ruby source code without ack/grep
vaelen has joined #ruby
amalvagomes_ has joined #ruby
<davidcelis> speaking of which, since I don't think I've asked in here yet, if I want to get more into the internals of Ruby, are there good resources to do this at a higher level than reading the C source?
mk03 has quit [Remote host closed the connection]
kylemcgill has joined #ruby
carlyle has joined #ruby
piotr_ has joined #ruby
Redbad72 has joined #ruby
Morkel has quit [Quit: Morkel]
albemuth has quit [Quit: Computer has gone to sleep.]
amalvagomes has quit [Ping timeout: 244 seconds]
dEPy has quit []
amalvagomes_ has quit [Ping timeout: 252 seconds]
stewart_ has joined #ruby
albemuth has joined #ruby
<cscribble> davidcelis: there's a standard draft spec, http://www.ipa.go.jp/osc/english/ruby/Ruby_final_draft_enu_20100825.pdf
<davidcelis> Shit.
<davidcelis> cscribble: Thanks. I think I love you
jenrzzz-mac has quit [Ping timeout: 250 seconds]
jamesaxl has quit [Ping timeout: 248 seconds]
Urth|Away is now known as Urthwhyte
wvms has joined #ruby
tvw has quit [Ping timeout: 246 seconds]
jamesaxl has joined #ruby
<davidcelis> Hmm, what about diving deeper, like how Ruby implements garbage collection and stuff? Conceptually
krusty_ar has quit [Remote host closed the connection]
axl_ has quit [Quit: axl_]
fserb has joined #ruby
jmkeyes_ has quit [Ping timeout: 246 seconds]
jmkeyes has joined #ruby
larissa has joined #ruby
libertyprime has quit [Quit: Lost terminal]
jmkeyes has left #ruby [#ruby]
sspiff has quit [Ping timeout: 246 seconds]
libertyprime has joined #ruby
jenrzzz-mac has joined #ruby
nej has joined #ruby
hadees has joined #ruby
flip_digits has quit [Ping timeout: 244 seconds]
wangr_ has quit [Ping timeout: 245 seconds]
<carloslopes> davidcelis: this is nice, but the translation is incomplete http://rhg.rubyforge.org/
libertyprime has quit [Client Quit]
sspiff has joined #ruby
enroxorz has quit [Quit: Leaving]
cantonic has quit [Remote host closed the connection]
jonathanwallace has quit [Remote host closed the connection]
GhettoCode has quit [Ping timeout: 248 seconds]
cantonic has joined #ruby
jetblack has quit [Ping timeout: 244 seconds]
<davidcelis> yeah i dont' know japanese hahaha; it's pretty incomplete
b1rkh0ff has quit [Ping timeout: 265 seconds]
<davidcelis> I mean I can of course google for articles on specific areas, but I can't google what I don't know to google; hence my hope that there was some place I get get an overview
libertyprime has joined #ruby
libertyprime has quit [Client Quit]
dlaniger99 has joined #ruby
<davidcelis> The hacker's guide seems like it's just what I'm looking for, unfortunately
platzhirsch has joined #ruby
libertyprime has joined #ruby
<platzhirsch> Ruby was the best programming language to learn for my Machine learning course, just perfect :)
dnyy has joined #ruby
<carloslopes> davidcelis: hacker's guide?
jonathan_ has joined #ruby
<davidcelis> Hacking Guide*
<davidcelis> your link
<carloslopes> davidcelis: ah yes :)
<burgestrand> davidcelis: http://patshaughnessy.net/ has a nice series of blog posts about ruby internals, from various implementations but focused on MRI
conceal_rs_ has quit [Ping timeout: 246 seconds]
mdw has joined #ruby
<davidcelis> burgestrand: Thanks!
jmccune has quit [Ping timeout: 246 seconds]
tcopp has quit [Ping timeout: 244 seconds]
<carloslopes> burgestrand: thanks ++ :)
<burgestrand> :)
werdnativ has quit [Quit: werdnativ]
conceal_rs_ has joined #ruby
<carloslopes> burgestrand: he is working on an ebook :)
chson has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
flip_digits has joined #ruby
jmccune has joined #ruby
libertyprime has quit [Quit: Lost terminal]
macmartine has joined #ruby
libertyprime has joined #ruby
<davidcelis> aha that ebook also looks like just what i'm looking for
nilg` has quit [Remote host closed the connection]
<carloslopes> davidcelis: yes.. i like to study ruby internals.. i always read some articles and watch videos about it.. but this ebook will be nice :)
desireco has joined #ruby
b1rkh0ff has joined #ruby
<carloslopes> burgestrand: did you finish the compilators course?
bglusman has quit [Read error: Connection reset by peer]
bglusman has joined #ruby
internet_user has quit [Remote host closed the connection]
niku4i has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
waxjar has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
dhaskew has joined #ruby
bbttxu has quit [Quit: bbttxu]
apeiros_ has quit [Remote host closed the connection]
carlyle has quit [Remote host closed the connection]
hadees has quit [Quit: hadees]
C0deMaver1ck has quit [Remote host closed the connection]
jonathan_ has quit [Remote host closed the connection]
benatwork has quit [Remote host closed the connection]
billiamii has quit []
benatwork has joined #ruby
kirun has quit [Quit: Client exiting]
benatwork has quit [Read error: Operation timed out]
mikepack has quit [Read error: Connection reset by peer]
chomp[1] has quit [Quit: Leaving]
carloslopes has quit [Quit: Leaving]
stephenjudkins has joined #ruby
hadees has joined #ruby
atmosx has quit [Ping timeout: 252 seconds]
pzol has quit [Read error: Operation timed out]
pzol has joined #ruby
werdnativ has joined #ruby
wargasm has left #ruby [#ruby]
atmosx has joined #ruby
igaiga has joined #ruby
dlanige109 has joined #ruby
chienpo has left #ruby [#ruby]
dlaniger99 has quit [Read error: Connection reset by peer]
fr0gprince_mac has quit [Quit: Leaving...]
desireco has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
piotr_ has quit [Ping timeout: 246 seconds]
mikepack has joined #ruby
francisfish has quit [Remote host closed the connection]
amalvagomes has joined #ruby
Urthwhyte is now known as Urth|Away
klip has quit [Ping timeout: 260 seconds]
Redbad72 has quit [Ping timeout: 265 seconds]
joshman_ has quit [Quit: Computer has gone to sleep.]
klip has joined #ruby
sepp2k has quit [Quit: Leaving.]
dlanige109 has quit [Quit: leaving]
bglusman has quit [Remote host closed the connection]
nicksmith has quit [Remote host closed the connection]
bglusman has joined #ruby
jtrudeau has joined #ruby
platzhirsch has left #ruby [#ruby]
minute_maid00 has joined #ruby
Rubinista has quit [Ping timeout: 245 seconds]
<minute_maid00> exit
minute_maid00 has quit [Client Quit]
Urth|Away is now known as Urthwhyte
Beoran__ has quit [Ping timeout: 248 seconds]
gmcinnes has quit [Ping timeout: 246 seconds]
t0mmyvyo has quit [Quit: http://twitter.com/tommyvyo]
bglusman has quit [Ping timeout: 245 seconds]
aantix has joined #ruby
mdhopkins has joined #ruby
mdw has quit [Remote host closed the connection]
amalvagomes_ has joined #ruby
ciopte7 has joined #ruby
daniel_hinojosa has quit [Ping timeout: 245 seconds]
amalvagomes has quit [Ping timeout: 240 seconds]
amalvagomes_ is now known as amalvagomes
jamesaxl has quit [Ping timeout: 265 seconds]
jamesaxl has joined #ruby
nicksmith has joined #ruby
<davidcelis> i love it when people think IRC is their shell
zeromodulus has quit [Remote host closed the connection]
libertyprime has quit [Quit: Lost terminal]
awarner has quit [Remote host closed the connection]
libertyprime has joined #ruby
cantonic_ has joined #ruby
daniel_hinojosa has joined #ruby
<shevy> lol
awarner has joined #ruby
fumduq has joined #ruby
awarner has quit [Remote host closed the connection]
Beoran__ has joined #ruby
jgarvey has quit [Quit: Leaving]
perryh_away has quit [Read error: Operation timed out]
iocor has joined #ruby
perryh has joined #ruby
cantonic has quit [Ping timeout: 246 seconds]
cantonic_ is now known as cantonic
kinesis has quit [Read error: Operation timed out]
kinesis has joined #ruby
kinesis has quit [Excess Flood]
jtrudeau has quit [Quit: Leaving]
kinesis has joined #ruby
passbe has quit [Ping timeout: 256 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
fbernier has joined #ruby
Rubinista has joined #ruby
passbe has joined #ruby
diegoviola has quit [Ping timeout: 252 seconds]
headius has joined #ruby
kenneth has joined #ruby
flip_digits has quit [Ping timeout: 244 seconds]
flip_digits has joined #ruby
amalvagomes has quit [Read error: Connection reset by peer]
jeebster has quit [Quit: Leaving.]
amalvagomes_ has joined #ruby
headius has quit [Client Quit]
fserb has quit [Quit: ttyl]
dbgster has joined #ruby
davidw has quit [Ping timeout: 260 seconds]
<Rubinista> Why does this not work? It says UndefinedConversionError "\xD1" despite the string being valid UTF-8 before the force-encoding. "\xd1\x8e".force_encoding('ASCII-8BIT').encode('UTF-8')
<Rubinista> In the case where I ran into it the string came to me in ASCII-8BIT already.
daniel_hinojosa has quit [Ping timeout: 248 seconds]
liluo has joined #ruby
fbernier has quit [Ping timeout: 246 seconds]
kevinbond has joined #ruby
lrfurtado has joined #ruby
flip_digits has quit [Quit: Computer has gone to sleep.]
krusty_ar has joined #ruby
akem has quit [Ping timeout: 250 seconds]
mdhopkins has quit [Quit: mdhopkins]
jamesaxl has joined #ruby
mdhopkins has joined #ruby
uris has quit [Quit: leaving]
mdhopkins has quit [Client Quit]
banseljaj is now known as imami|afk
jmontross has left #ruby [#ruby]
igaiga has quit [Remote host closed the connection]
jjjj has left #ruby [#ruby]
flip_digits has joined #ruby
gtuckerkellogg has joined #ruby
serroba has joined #ruby
Aaton is now known as Aaton_off
niku4i has quit [Remote host closed the connection]
<keppy> Help writing values into hashes which are nested in an array | a poker game : https://gist.github.com/2831339
axl_ has joined #ruby
BrokenCog has quit [Quit: leaving]
amalvagomes_ has quit [Quit: amalvagomes_]
daniel_hinojosa has joined #ruby
freakazoid0223 has quit [Quit: Leaving]
Chryson has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
Asher has quit [Ping timeout: 252 seconds]
akem has joined #ruby
compara20 has quit [Quit: Ex-Chat]
robdodson has joined #ruby
chrisja has quit [Quit: leaving]
serroba has quit [Quit: This computer has gone to sleep]
Asher has joined #ruby
jgrevich has quit [Read error: Connection reset by peer]
Urthwhyte is now known as Urth|Away
flip_digits has quit [Quit: Computer has gone to sleep.]
<dekz> Anyone had problems with rubygems-bundler, RVM and 1.7.0 jruby preview1?
<dekz> "Gem::LoadError: Could not find rubygems-bundler (>= 0) amongst" on install
jgrevich has joined #ruby
nobitanobi has joined #ruby
<nobitanobi> Whats a good way of comparing a value with two other values? Like this: if value == 1||true
<dekz> what's wrong with if value == 1 && value == true ?
looopy has joined #ruby
pdtpatrick has quit [Ping timeout: 240 seconds]
tomb_ has joined #ruby
<Muz> dekz: that doesn't fulfill what the logic desired.
<Muz> That checks if value is both "1" and "true".
<dekz> The question doesn't match the logic desired
<dekz> a value with two other values
<Muz> nobitanobi: There're multiple ways to do it. You could create an array and check if it includes your item. [true, 1].include?(value)
<Muz> The || would suggest that it's a broken attempt at "or". ;)
<Rubinista> Keppy: Two problems. First, you're trying to put something into a hash as if it were an array, with <<. In line 17 do h << [] instead. Then, in line 19 you say h << card_stack[z], where you mean to say h[x] << ....
stephenjudkins has quit [Quit: stephenjudkins]
<nobitanobi> if value == '1' || value == true -- is what I have. I was just wondering a shorter way.
looopy has quit [Remote host closed the connection]
Asher has quit [Ping timeout: 256 seconds]
<nobitanobi> Muz: thanks
albemuth has quit [Quit: Computer has gone to sleep.]
<Rubinista> keppy: In fact, you probably want to rewrite the line to be h.each {|hand| .... hand << card }, instead of saying hands.times
<dekz> nobitanobi: you may want 'tricks' to make things shorter. But it may end up being harder to read. Keep that in mind
<Rubinista> keppy: So, at that, you should use num_hands or something for the number so that hands can be the array, instead of having to use h.
<nobitanobi> dekz: you are right.
yonggu has joined #ruby
<dekz> Theres a fine line between obscurity and clean precise code
<nobitanobi> I use to tend to the other way, but yes, it makes sense to keep it like this.
<nobitanobi> dekz: thanks for your suggestion
billiamii has joined #ruby
Asher has joined #ruby
<dekz> nobitanobi: if you find you have a lot of values to check against it might start to make sense. It helps a lot when checking hash members instead of having if hash[:a] && hash[:b] && hash[:c].
headius has joined #ruby
Retistic has left #ruby [#ruby]
billiamii has left #ruby [#ruby]
billiamii has joined #ruby
<nobitanobi> ok
<nobitanobi> sweet!
<dekz> to do a [:a, :b, :c].all? { |key| h.member key.member?
<dekz> }
tomb_ has quit [Quit: Computer has gone to sleep.]
<Rubinista> Does anyone know why I can't encode the ascii-8bit string "\xD1\x8E" into UTF-8? Everything (unicode character lists, etc) shows the character as being valid, and a natively UTF-8 Ruby prints that string as the proper unicode character.
<dekz> Anyone here have suggestions with sinatra, splitting out controller methods on instance objects (and avoiding @@ on sinatra app base)
Foxandxss has joined #ruby
DrShoggoth has quit [Quit: Leaving]
hakunin has quit [Read error: Connection reset by peer]
<Muz> dekz: regarding jruby-1.7.0-preview, and rubygem-bundler I can't reproduce your aforementioned issue.
<Muz> Then again, you hardly provided a valid testcase to attempt reproducing the issue.
seivan has quit [Remote host closed the connection]
stephenjudkins has joined #ruby
mrbrdo has quit [Ping timeout: 260 seconds]
one8zero has quit [Quit: one8zero]
atmosx has quit [Ping timeout: 245 seconds]
<dekz> Did you install through RVM? It was simply a quick question to gauge if it is some known issue. It is fixed by removing bundler and rubygems-bundle from jruby-1.7.0.preview1@global/gems/
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
one8zero has joined #ruby
atmosx has joined #ruby
MasterIdler has quit [Ping timeout: 256 seconds]
fumduq has quit [Read error: Connection reset by peer]
fumduq has joined #ruby
<Muz> Yes, I installed it through RVM. I did create a new gemset as a sandbox for it though.
one8zero has quit [Client Quit]
jgrevich has quit [Read error: Connection reset by peer]
turmeric has joined #ruby
jgrevich has joined #ruby
seanstickle has joined #ruby
ilyam has joined #ruby
turmeric has left #ruby [#ruby]
turmeric has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
cableray has quit [Quit: cableray]
hakunin has joined #ruby
serroba has joined #ruby
macmartine has quit [Quit: macmartine]
turmeric has left #ruby [#ruby]
ciopte7 has quit [Quit: ciopte7]
cousine has joined #ruby
shadoi has joined #ruby
mrsolo has quit [Quit: Leaving]
ericcoleman has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
emmanuelux has quit [Read error: No route to host]
jenrzzz-mac has joined #ruby