Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
workmad3 joined #ruby-lang
WhiteHorse joined #ruby-lang
headius joined #ruby-lang
steph021 joined #ruby-lang
steph021 joined #ruby-lang
sodani1 joined #ruby-lang
tomzx joined #ruby-lang
havenn joined #ruby-lang
Manhose_ joined #ruby-lang
Manhose__ joined #ruby-lang
amerine joined #ruby-lang
wyhaines joined #ruby-lang
jbwiv_ joined #ruby-lang
r0bby joined #ruby-lang
FylGood joined #ruby-lang
dhoss_ joined #ruby-lang
oilpastels left #ruby-lang
brianpWins joined #ruby-lang
yfeldblum joined #ruby-lang
srbaker joined #ruby-lang
tallship joined #ruby-lang
slyphon joined #ruby-lang
neoesque joined #ruby-lang
lsegal joined #ruby-lang
tjgillies joined #ruby-lang
savage- joined #ruby-lang
adambeynon joined #ruby-lang
takaokouji joined #ruby-lang
livinded joined #ruby-lang
jmontross1 joined #ruby-lang
jmontross joined #ruby-lang
jkyle joined #ruby-lang
banisterfiend joined #ruby-lang
taf2 joined #ruby-lang
igotnolegs joined #ruby-lang
replore joined #ruby-lang
jbwiv_ joined #ruby-lang
woollyams joined #ruby-lang
FylGood joined #ruby-lang
neoesque joined #ruby-lang
CodeWrangler joined #ruby-lang
CodeWrangler joined #ruby-lang
ryanf joined #ruby-lang
wyhaines joined #ruby-lang
flip_digits joined #ruby-lang
scottschecter joined #ruby-lang
flip_digits joined #ruby-lang
Rakko joined #ruby-lang
edwardsharp joined #ruby-lang
retro|cz joined #ruby-lang
Weems joined #ruby-lang
mdel joined #ruby-lang
fvollero joined #ruby-lang
woollyams joined #ruby-lang
banisterfiend joined #ruby-lang
dr0id joined #ruby-lang
jkyle joined #ruby-lang
rob joined #ruby-lang
<rob> Any way to open urls in open-uri without requiring a trailing slash?
<rue> rob: You're getting an error suggesting you can't?
<rue> Should work just fin.
<rue> e
<rob> rue: you're right, A) my issue was with Net::HTTP and B) I seem to have been hallucinating :D
<rue> Technically there's always a trailing slash, but that's added for yo
<rue> u
andrewhl joined #ruby-lang
<envygeeks> It depends on your context >.<
x0F_ joined #ruby-lang
<oddmunds> I'm using MongoDb and want to sort my query first by one field, and then by another one. How do I do that?
tomzx joined #ruby-lang
<envygeeks> This isn't MongoDB help
headius joined #ruby-lang
towski joined #ruby-lang
dr0id joined #ruby-lang
<oddmunds> i know, but I asked over at #mongodb with no luck, and I think that I just have the syntax wrong. :/
comboy joined #ruby-lang
banisterfiend joined #ruby-lang
<bnagy> don't suppose anyone is good at fixing rvm stuff on linux? It's dead over at #rvm and it's blocking some stuff I need to get done
<envygeeks> oddmunds: http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsort%28%29%7D%7D << have you tried that?
comboy joined #ruby-lang
dr0id joined #ruby-lang
<oddmunds> envygeeks: yes, and it works. my problem is how i would sort first by one field, and then by another.
<oddmunds> let's say i have one field for year, and one for month, i want to sort first for year, and then for month. if that makes sense.
jkyle joined #ruby-lang
srbaker joined #ruby-lang
comboy joined #ruby-lang
<envygeeks> have you tried chaining them?
<envygeeks> myDB.find().sort({field: vale}).sort({field: value})
<envygeeks> oh I see what you mean now
WhiteHorse joined #ruby-lang
<envygeeks> oddmunds: hmmm...in that case I would probably use Ruby's builtin http://www.ruby-doc.org/core-1.9.3/Enumerable.html#method-i-sort_by after doing a collect on the intial return
jimmy1980 joined #ruby-lang
dhoss joined #ruby-lang
<oddmunds> i guess i could. but i'd rather do it properly.
<envygeeks> Well proper is subjective for flat data sets
<rue> oddmunds: Maybe [:year, :month] or something similar? Mongo docs should presumably have some pointers
<oddmunds> this is where it ought to say, and i guess it kind of does, but it didn't work for me: http://api.mongodb.org/ruby/current/Mongo/Collection.html#find-instance_method
comboy joined #ruby-lang
<rue> an array of [key, direction] pairs to sort by
<rue> So :sort => [[key1, asc], [key2, asc]] or whatever
srbaker joined #ruby-lang
comboy joined #ruby-lang
Nisstyre joined #ruby-lang
banisterfiend joined #ruby-lang
JosephRuby joined #ruby-lang
looopy joined #ruby-lang
comboy joined #ruby-lang
rippa joined #ruby-lang
comboy joined #ruby-lang
wyhaines joined #ruby-lang
comboy joined #ruby-lang
dnjaramba joined #ruby-lang
tomzx joined #ruby-lang
jkyle joined #ruby-lang
kitallis joined #ruby-lang
woollyams joined #ruby-lang
looopy joined #ruby-lang
bougyman joined #ruby-lang
bougyman joined #ruby-lang
csherin joined #ruby-lang
kyrylo joined #ruby-lang
artOfWar joined #ruby-lang
srbaker joined #ruby-lang
oilpastels joined #ruby-lang
ryanf joined #ruby-lang
flak joined #ruby-lang
r0bby joined #ruby-lang
slyphon_ joined #ruby-lang
io_syl joined #ruby-lang
io_syl joined #ruby-lang
jimmy1980 joined #ruby-lang
phaedrix joined #ruby-lang
yxhuvud joined #ruby-lang
JohnBat26 joined #ruby-lang
ryanf joined #ruby-lang
Defusal joined #ruby-lang
jimmy1980 joined #ruby-lang
csherin joined #ruby-lang
andrewhl joined #ruby-lang
Defusal joined #ruby-lang
RomyEatsDrupal joined #ruby-lang
ryanf joined #ruby-lang
towski joined #ruby-lang
<dkannan> how can i find the docs for the '?' operator
<rue> dkannan: There is no ?-operator
RomyEatsDrupal_ joined #ruby-lang
<livinded> dkannan: conditional ? code if true:code if false
<drbrain> dkannan: `a ? b : c` or `char = ?a`
<dkannan> ?a
<drbrain> corundum: quickref?
<drbrain> it's a quick way of getting a character value
<rue> Aww, I'm sure I could've convinced him it didn't exist
<drbrain> in 1.9 it returns a character
<rue> A string, really
<drbrain> in 1.8 it returns the ASCII encoding
<drbrain> sorry, a single-character string
<rue> Awesome, it's 9:48 and almost light outside :/
<dkannan> what is '?', it is an operator?
replore joined #ruby-lang
<dkannan> also does defined? +
<dkannan> not show up operators eg. + can be overwritten
<drbrain> dkannan: it is syntax
<dkannan> ok
<drbrain> like if or case or class
solars joined #ruby-lang
<drbrain> dkannan: I take it you're looking at docs.rubygems.org's source?
<drbrain> be sure to bring extra batteries for your flashlight and wear a hard-hat
<drbrain> it's scary in there
<Rakko> You're likely to be eaten by a grue.
workmad3 joined #ruby-lang
RomyEatsDrupal joined #ruby-lang
<shevy> rue you live in a scary place
<shevy> why not relocate to a bikini town?
ris joined #ruby-lang
Defusal joined #ruby-lang
Defusal joined #ruby-lang
ris joined #ruby-lang
<drbrain> shevy: remember the photo of the man breaking ice in a frozen lake with nothing more than an axe?
<drbrain> I'm pretty sure they break out the bikinis as soon as all the sea ice is gone
jimmy1980 joined #ruby-lang
neoesque joined #ruby-lang
<drbrain> if you can break ice with nothing but an axe you probably also think 10℃ is suntan on the beach weather
<Rakko> I didn't know there was a precomposed ℃ character
<shevy> drbrain hmm dont really know that photo
<drbrain> shevy: "brake ice with axe naked" will find it on google
<shevy> I usually like snow... but like only 1 week in one year :)
<shevy> "Killing fish naked with an axe in the dead of winter" argh
<drbrain> Rakko: there's one for ℉ and a character for Kelvin: K
headius joined #ruby-lang
JosephRuby joined #ruby-lang
<drbrain> oops, I typo'd
<drbrain> fortunately google fixes it
<Rakko> those are fully in this fixed-width font
<Rakko> I'm gonna start using the Kelvin one everywhar
<headius> drbrain: did I reply to you? today is a bit of a blur, and I don't know if I sent it
<drbrain> headius: I saw a reply for the rdoc thing
<headius> ok..was doing a dozen things at the same time
yorickpeterse joined #ruby-lang
takaokouji joined #ruby-lang
Defusal_ joined #ruby-lang
Defusal_ joined #ruby-lang
csherin joined #ruby-lang
<erikh> hello ruby users
<rue> Meh
cyri_ joined #ruby-lang
<erikh> exactly.
dc5ala joined #ruby-lang
sepp2k joined #ruby-lang
jbwiv_ joined #ruby-lang
<Guest59085> [12:09:07] <drbrain> if you can break ice with nothing but an axe
<Guest59085> it's not so hard
<yorickpeterse> Anybody else find this somewhat gross? https://github.com/sunaku/binman/blob/master/lib/binman/gemspec.rb#L4
<drbrain> rippa: sure, but it can get a bit cold when you're thigh-deep in a lake and aren't wearing pants
<drbrain> yorickpeterse: I find it somewhat gross
kitallis joined #ruby-lang
<drbrain> yorickpeterse: this is exactly why you should not package from a gemspec
<yorickpeterse> It's a perfect example of abusing monkey patching :)
<drbrain> yorickpeterse: with hoe you can integrate such a tool in a clean, readable, way that doesn't violate the internals of RubyGems
<yorickpeterse> Haven't really looked into Hoe, never really needed it
<rue> yorickpeterse: I find your use of “somewhat” somewhat gross in that context!
<yorickpeterse> ha
<drbrain> you just think you don't need it :D
<rue> Well, there's a small up-front cost of learning a new tool
<drbrain> if you have one gem, sure, I understand
<dkannan> i have applied for an account on http://ruby-versions.net/. can someone share theirs in the meantime?
<drbrain> if you have two, fine, but five? ten? more? hoe is simply the best
<yorickpeterse> drbrain: Hoe is somewhat opionated in my opinion, also the things it offer don't have a lot of benefits for me
<drbrain> yorickpeterse: it has default opinions, but you can change them fairly easily
<rue> dkannan: What did you need? That site's largely for historical versions, rvm works for new stuff
<rue> Although actually I think you can install any revision from MRI anyway
<drbrain> rue: installing older versions of ruby can be annoying while you round up the appropriate versions of autoconf (or patch configure.in)
<rue> 'Tis
<rue> But also not usually a necessary activity
<dkannan> rue: ruby_dev -ve 'p "abc".encode("UTF-32BE")' does not give me the output as given. thought of maybe trying on an older version
<drbrain> dkannan: 1.8.7 == 1.8.6 for the purposes of the examples, and you really, really don't care about 1.9.0
<rue> dkannan: Unless for some reason you want .8.6 and .9.0 specifically, you can use .8.7 and .9.3 as stand-ins
<rue> dkannan: What does it give? Is your LANG set correctly?
<dkannan> rue: do not understand locale. my LANG is blank. https://gist.github.com/c5f06b1d858154a29cb3
<drbrain> dkannan: it's probably your terminal
<manveru> so C
<drbrain> p "abc".encode("UTF-32BE").force_encoding Encoding::BINARY
<manveru> oO
<drbrain> gives me: "\x00\x00\x00a\x00\x00\x00b\x00\x00\x00c"
<drbrain> so if you see "abc" your terminal is probably ignoring the NUL bytes
zmack joined #ruby-lang
<dkannan> drbrain: thx :-)
<drbrain> dkannan: also, puts will transcode to Encoding.default_external
<drbrain> (nowadays)
<manveru> that's more like it :)
<drbrain> it's probably default_external
<manveru> yeah
<manveru> for him that's US-ASCII
<manveru> still not sure why that wouldn't show a thing
havenn joined #ruby-lang
<erikh> chef is so, so very awesome
<manveru> dkannan: so what kinda terminal do you use?
gnufied joined #ruby-lang
<rue> What's the correct output anyway?
<manveru> "abc"
<manveru> ooh
<manveru> 1.9.0
<manveru> nm :)
<rue> We can assume 1.9.0 output is incorrect ;)
<manveru> 1.9.0 didn't have the Encoding.default_external yet
<manveru> well, that version anyway
<dkannan> manveru: i use the default osx terminal with bash
<manveru> dkannan: and what output do you get?
<manveru> the behaviour of inspect or puts has changed since 1.9.0
<manveru> but nobody uses that version anyway
<manveru> yeah, that's perfect
<manveru> let's try something a bit more challenging
<manveru> ruby -e 'p "\u20ac"'
<manveru> that should output "\u20AC" on your terminal
<dkannan> shows the euro symbol "€"
molgrew joined #ruby-lang
<manveru> so ruby only considers LC_CTYPE
Mon_Ouie joined #ruby-lang
<manveru> LC_CTYPE=C ruby -e 'p "\u20ac"'
<dkannan> manveru: my LC_* and LANG vars are at https://gist.github.com/c5f06b1d858154a29cb3#L27
<dkannan> manveru: yes works
<manveru> yeah, you probably should adjust your locale sometime
<dkannan> manveru: any short doc on the usage/meaning of the LC_* vars?
<manveru> man locale
<manveru> man localedef
<manveru> might be nicer
vikoren joined #ruby-lang
<dkannan> manveru: thx
adambeynon joined #ruby-lang
gnufied joined #ruby-lang
gnufied1 joined #ruby-lang
gnufied1 joined #ruby-lang
gnufied joined #ruby-lang
gnufied2 joined #ruby-lang
csherin joined #ruby-lang
tvl joined #ruby-lang
benanne joined #ruby-lang
jasox joined #ruby-lang
dr0id joined #ruby-lang
pbjorklund joined #ruby-lang
saLOUt joined #ruby-lang
workmad3 joined #ruby-lang
geoffw8_ joined #ruby-lang
csherin_ joined #ruby-lang
srbartlett joined #ruby-lang
<erikh> drbrain: making chef rg 1.8 compliant
<erikh> be excited and stuff
jimmy1980 joined #ruby-lang
hebz0rl joined #ruby-lang
csherin joined #ruby-lang
csherin joined #ruby-lang
jimmy1980 joined #ruby-lang
WhiteHorse joined #ruby-lang
toretore joined #ruby-lang
looopy joined #ruby-lang
yfeldblum joined #ruby-lang
dnjaramba joined #ruby-lang
Manhose joined #ruby-lang
empity joined #ruby-lang
Manhose_ joined #ruby-lang
csherin joined #ruby-lang
hebz0rl joined #ruby-lang
geoffw8_ joined #ruby-lang
steeljav joined #ruby-lang
saLOUt joined #ruby-lang
Manhose joined #ruby-lang
lele joined #ruby-lang
cyndis_ joined #ruby-lang
Pupeno joined #ruby-lang
chrismcg joined #ruby-lang
cyndis joined #ruby-lang
shaman42 joined #ruby-lang
cyndis joined #ruby-lang
benanne joined #ruby-lang
fridim_ joined #ruby-lang
petercooper joined #ruby-lang
Neil joined #ruby-lang
looopy_ joined #ruby-lang
saLOUt joined #ruby-lang
andrewhl joined #ruby-lang
jimmy1980 joined #ruby-lang
alim joined #ruby-lang
saLOUt_ joined #ruby-lang
alim joined #ruby-lang
jasox joined #ruby-lang
wyhaines joined #ruby-lang
retro|cz joined #ruby-lang
mark_locklear joined #ruby-lang
Spooner joined #ruby-lang
leopard_me joined #ruby-lang
sym- joined #ruby-lang
tommyvyo joined #ruby-lang
gearaholic joined #ruby-lang
malev joined #ruby-lang
rippa joined #ruby-lang
imperator joined #ruby-lang
mnoble joined #ruby-lang
hhatch joined #ruby-lang
slyphon_ joined #ruby-lang
malev joined #ruby-lang
Pupeno left #ruby-lang
ritzq joined #ruby-lang
<ritzq> Now that there is #respond_to_missing? how is one supposed to find out if a method is really there ?
RomD` joined #ruby-lang
dv310p3r joined #ruby-lang
<rippa> flip a coin
steeljav joined #ruby-lang
WhiteHorse joined #ruby-lang
yfeldblum joined #ruby-lang
<shevy> that method got added to 1.9.x?
<shevy> what about #respond_to?
<shevy> User.respond_to?('name')
Pip joined #ruby-lang
Pip joined #ruby-lang
Sailias joined #ruby-lang
tomzx joined #ruby-lang
<gearaholic> is a,b=1234 the same as doing a=1234 b=1234
<gearaholic> actually never mind, braid fart
<gearaholic> brain*
<manveru> a = b = 1234 == a, b = 1234, 1234
<ritzq> shevy: Object#respond_to? is calling #respond_to_missing?
<manveru> but only for immutable stuff
<shevy> hmmm
<imperator> ritzq, do you have a specific example where it's a problem?
<ritzq> imperator: yeah, e.g if a 'missing' method relys on an actual method, but then when using #respond_to? inside #respond_to_missing? you get a loop (I suppose)
imajes joined #ruby-lang
dave_miles_cf joined #ruby-lang
<burgestrand> ^.-
<imperator> you suppose?
<burgestrand> shevy: respond_to? calls respond_to_missing? if it were going to return false
<burgestrand> so, in a way, implementation is: super || respond_to_missing?
<burgestrand> but respond_to_missing? adds a few perks you don’t get implementing respond_to? yourself, so use the former if you can afford to only target 1.8, or implement both if you want to support both
<burgestrand> … to only target 1.9*
j`ey joined #ruby-lang
Manhose joined #ruby-lang
JEG2 joined #ruby-lang
takaokouji joined #ruby-lang
agilous joined #ruby-lang
daglees joined #ruby-lang
daglees joined #ruby-lang
agilous left #ruby-lang
jkyle joined #ruby-lang
RickHull joined #ruby-lang
<imperator> trying to make ffi functions private, but failing: https://gist.github.com/1451811
agilous joined #ruby-lang
leonL joined #ruby-lang
slyphon joined #ruby-lang
slyphon joined #ruby-lang
shevy joined #ruby-lang
mnoble joined #ruby-lang
InHeGoBr joined #ruby-lang
<InHeGoBr> Using Regexp.new, escaping [] with \ doesn't seem to work. : /
cyndis joined #ruby-lang
Manhose_ joined #ruby-lang
<burgestrand> imperator: I’m taking a guess here, but FFI uses define_method/define_singleton_method and they won’t pick up the visibility setting you’ve set
<shevy> hmmm
<shevy> when I run a command like ... 'usermod'
<burgestrand> imperator: you’ll want to add “private :methodname” and “private_class_method :methodname” after if you really want it private
<shevy> what is an easy way to obtain stdout and stderr from that at the same time?
<shevy> I guess using `` alone won't be enough here
chriskentfield joined #ruby-lang
<burgestrand> imperator: if you want to do this on a lot of methods might I suggest you do it with a attach_private_function (that you write yourself) instead
<burgestrand> shevy: you want to catch them separately?
InHeGoBr left #ruby-lang
AlHafoudh joined #ruby-lang
<shevy> burgestrand hmm I want to catch them at the same time... for instance, when I run usermod, I want to store both the stdout result to a variable, and also stderr... and if stderr is not empty, report to user
<shevy> and otherwise, report the stdout result
kennyp joined #ruby-lang
<burgestrand> shevy: open3: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/open3/rdoc/Open3.html — I do recall it having issues with windows though
MistyM joined #ruby-lang
<imperator> burgestrand, good suggestion, thanks
<burgestrand> imperator: :)
valcker joined #ruby-lang
<shevy> hmm
<shevy> burgestrand that is kinda odd
<shevy> Open3.capture3 Open3.capture2e ... those are odd method names
tylergillies joined #ruby-lang
<shevy> how does one remember those strange names?
outoftime joined #ruby-lang
<tylergillies> I see people use instance variables outside of method scopes like @foo = Foo.new, is there a reason for that?
<shevy> tylergillies, if you want to reuse @foo in your project, sure
<shevy> @foo.clean_world
<tylergillies> clearn_world?
<tylergillies> clean_world rather
j`ey joined #ruby-lang
<shevy> tylergillies that was just an example
<shevy> hmm actually
<shevy> what do you mean with outside of method scopes
<tylergillies> like traditionally you see class Foo def bar(biz); @biz = biz; end; end;
<tylergillies> but this is like #in global scope; @foo = Foo.bar
Manhose joined #ruby-lang
niklasb_ joined #ruby-lang
<manveru> there is no global scope
<manveru> that's the instance of Object called main
<shevy> I really don't know what you mean with global scope here, @bla is available within that class
<manveru> no, within that instance
Spooner joined #ruby-lang
kennyp joined #ruby-lang
necromancer joined #ruby-lang
kitallis joined #ruby-lang
chulan joined #ruby-lang
jasox joined #ruby-lang
jkyle joined #ruby-lang
saLOUt joined #ruby-lang
nofxx joined #ruby-lang
<tylergillies> manveru: i guess so, then why not make every variable prefixed with @ since they're all in the scope of main
<tylergillies> well every variable "on the outside"
<chriskentfield> It looks like ruby's default constructor takes variable arguments. For example, "class Ninja; end; n = Ninja.new 1,2,3" is valid. Are those extra arguments used or are they just thrown out?
<burgestrand> chriskentfield: which ruby version are you running, 1.8?
chulan left #ruby-lang
<manveru> tylergillies: which outside?
<burgestrand> Heh, nevermind, appears 1.9.2 allows that too. 1.9.3 does not.
<molgrew> my 1.8.7 doesn't allow it
<tylergillies> manveru: http://cl.ly/3t3X3Z3g1s061d0l3i39
<manveru> tylergillies: some people are strange
<manveru> it makes sense if you also define methods on main
<manveru> but in this case there's no reason
<tylergillies> manveru: so is "main" == what im calling "outside"?
<manveru> χ ~ % ruby -e 'puts self'
<manveru> main
<tylergillies> gotcha
<tylergillies> thnx
<manveru> np
<chriskentfield> I'm using 1.9.2
Manhose_ joined #ruby-lang
<workmad3> seems to be a 1.9.2-ism
saLOUt joined #ruby-lang
mnoble1 joined #ruby-lang
lightcap joined #ruby-lang
dustacio joined #ruby-lang
rayners joined #ruby-lang
Oloryn_lt2 joined #ruby-lang
slyphon joined #ruby-lang
kitallis joined #ruby-lang
kleech joined #ruby-lang
Silowyi joined #ruby-lang
looopy joined #ruby-lang
jxie joined #ruby-lang
shajith_ joined #ruby-lang
RomD`` joined #ruby-lang
shajith_ left #ruby-lang
Axsuul joined #ruby-lang
outoftime joined #ruby-lang
io_syl joined #ruby-lang
Pupeno joined #ruby-lang
<petercooper> Is there a reason why MRI doesn't adopt UTF-8 as the default source encoding?
<petercooper> I'm guessing something to do with 50% .jp-ness and 50% history
<shevy> probably history
jimmy1980 joined #ruby-lang
looopy joined #ruby-lang
<burgestrand> petercooper: another guess is that failing on anything not ASCII and throwing an error is better than silently eating bytes that *looks* like it’s valid UTF8 but might not be
<burgestrand> like… violently complaining vs possibly silently failing
Indian joined #ruby-lang
<MistyM> petercooper: The SJIS/EUC split *still* being a going concern really doesn't help things :(
saLOUt joined #ruby-lang
AlHafoudh joined #ruby-lang
<shevy> People should be beat with fists until consensus is reached.
* shevy is preparing for that day ...
gnufied joined #ruby-lang
outoftime joined #ruby-lang
goshakkk joined #ruby-lang
ascarter joined #ruby-lang
* shevy is bored and begins to randomly beat up people here.
dnjaramba joined #ruby-lang
mksm_ joined #ruby-lang
slackstation joined #ruby-lang
saLOUt_ joined #ruby-lang
ascarter joined #ruby-lang
srbaker joined #ruby-lang
uniqanomaly_ joined #ruby-lang
hahuang65 joined #ruby-lang
<manveru> petercooper: people used all kinds of encodings in source files before 1.9
<manveru> just ask our ISO-shevy here
<shevy> LONG LIVE ISO!
<shevy> hmm
<manveru> 1.9 tries to make the transition as painless and egalitarian as possible, just stick that comment in there
<shevy> can everyone use UTF-8?
andrew_ joined #ruby-lang
<manveru> no
<shevy> hmmm
<shevy> I knew it!
<shevy> UTF-8 sucks
<petercooper> Is it even possible to specify default source encoding via an option or param? (Like -E does for internal/external)
<burgestrand> Japanese have some issues with it; I never quite understood the details though
ascarter joined #ruby-lang
<MistyM> It's the han unification.
<manveru> petercooper: not that i know of
<manveru> burgestrand: also like 80% of systems still in use don't use utf-8 by default
<manveru> there are 3 different encodings just to send mobile mail
<MistyM> There are some symbols with Chinese origins used in China, Japan, and Korea. They have common historical backgrounds and look similar, but are written differently and have different pronunciations and meanings. Unicode treats them as variations of a single character instead of distinct characters, which not everyone was happy about.
<manveru> depending which carrier you're with
<petercooper> heh -E did set string literal encoding in 1.9.0, now doesn't.
<burgestrand> manveru: aye, I was thinking mainly of pure incompatibilities setting legacy/in-use systems aside
frangiz joined #ruby-lang
<petercooper> seems Dave Thomas already questioned the sanity of this on ruby-core years ago
<manveru> burgestrand: well, we could've done the python thing and transcode everything before it enters
<manveru> but apparently oniguruma had a big influence on the design of the current behaviour
<shevy> hey did you read the rant against python 3 from ...
<shevy> "all in all I have to argue that the Unicode support in Python 3 is causing me tons more problems than it ever did in Python 2."
<shevy> DIE UNICODE, DIE!!!
<shevy> die, legacy chinese symbols, die!
<manveru> lol
<petercooper> Well yeah, ideally all non English speakers would convert
<petercooper> I can't hide that'd be my #1 preference
<shevy> yeah!
<shevy> one language to bind them
<petercooper> but #2 is everyone use utf-8 :P
<petercooper> The US is not producing enough hit TV shows or decent music right now to keep English growing.
<manveru> utf is coming, but it'll take another decade or so before we can say that it's the most common thing
<imperator> and yet somehow we got along with transliteration and 3rd party libs for *years*
looopy_ joined #ruby-lang
<manveru> imperator: and i hated every hour of it
<imperator> thank god we added encodings so i would have to add encoding pragmas and explicitly convert strings to binary so that we can use symbols in code
<MistyM> petercooper: Well, when you can't even get people to everyone on a single *legacy* encoding (see the ongoing SJIS/EUS split)... never underestimate the power of legacy!!
ascarter joined #ruby-lang
<shevy> standardize!
<shevy> down with inches and yard and fahrenheit!
<manveru> shevy: there'll always be people like you
j`ey left #ruby-lang
<shevy> manveru I know. We are the 99%.
<manveru> shevy: the who?
<shevy> Everyone else basically!
<shevy> Our numbers are Legion!
<shevy> We are the Borg.
* manveru waits for the FSM reference
<shevy> hmm FSM?
thone joined #ruby-lang
Nisstyre joined #ruby-lang
<shevy> hmm
dejongge joined #ruby-lang
<shevy> I heard of that Pastafari guy
AlHafoudh joined #ruby-lang
<shevy> but not of a flying spaghetti monster
<manveru> people can't even understand that nano is clearly the most superior editor, or that FSM is the only truly sauced religion, how do you suppose they standardize other stuff?
savage- joined #ruby-lang
RickHull joined #ruby-lang
<shevy> manveru because it makes life simpler!
<shevy> easier!
<shevy> better!
<manveru> do you want a universe embedded in XML?
<shevy> never!
<shevy> XML is complicated, ugly, complex, it's terrible
<manveru> it's a standard
pabloh joined #ruby-lang
<MistyM> manveru: ed is the standard text editor. http://www.gnu.org/fun/jokes/ed.msg.html
<manveru> just like ISO, EBCDIC, EUC, ASCII, UTF, and so on
butchanton joined #ruby-lang
<manveru> at some point they all were the only wait to input and store data
<manveru> *way
<manveru> now that even your headphones run 128bit, who cares?
<manveru> it's just that our now and the now of the rest of the world are a decade or so apart
RickHull joined #ruby-lang
heppy joined #ruby-lang
<manveru> future being unevenly distributed and all that
<manveru> that's why we're using ruby, and not whatever the current flavor of visual basic may be
<shevy> but PHP is more popular than ruby on TIOBE!
<shevy> hmm
<shevy> I wonder how they deal with Encodings in PHP
<manveru> the concepts in ruby are 30 years and older
fridim_ joined #ruby-lang
<manveru> they use iconv, i guess
<shevy> well, ruby packaged them neatly
<shevy> the concepts in PHP are from a 3 years old
<workmad3> manveru: a lot of them are approaching 60 years old
<workmad3> shevy: nice phrasing :D
<manveru> shevy: you ever heard the creator of php talk about it? :)
<shevy> manveru hmm no
looopy joined #ruby-lang
<shevy> I cant even remember his name without looking at google :/
<workmad3> manveru: he hates programming
<workmad3> I remember that much from his quotes :)
<shevy> hmm he hates programming but creates a programming language?
<shevy> well actually
<shevy> I can identify with parts of that. I hate bugs for instance.
<manveru> he didn't intend to
<manveru> in the beginning, it was just a bunch of perl scripts
<workmad3> heh :) PHP... the language that 'just happened' :)
<workmad3> certainly explains a lot... like the standard library 'design'
<shevy> oh
<manveru> the trouble began when he published them
<lianj> "I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say "yeah it works but you're leaking memory everywhere. Perhaps we should fix that." I'll just restart apache every 10 requests."
<shevy> it started from a bunch of perl scripts? really?
<shevy> sometimes I wonder whether perl did more harm than good
<workmad3> shevy: a lot of languages start as a bootstrap from another language... C++ started as a library of C preprocessor directives for example
<shevy> cool
<manveru> C++, or how to make a language from gsub
Manhose joined #ruby-lang
<workmad3> manveru: :D
<manveru> i still can't figure out why it's faster than C in some cases
csherin joined #ruby-lang
arooni-mobile joined #ruby-lang
<workmad3> manveru: because the compiler can actually do some pretty smart stuff thanks to the stronger typing
AlHafoud_ joined #ruby-lang
<manveru> ah, so c++ actually does typing?
<yxhuvud> could also be that sometimes the cache profile ends up different
<manveru> i hate that part about C
<shevy> kinda cool
<workmad3> manveru: yeah, it's got a much stronger type system than C :)
<shevy> a set of perl scripts created a new language :)
<manveru> C is all like "yeah, let's pretend we care about types, because they are supposed to be cool"
<workmad3> manveru: it can be bypassed because it still has C heritage... but it's really awful C++ practice (as opposed to it being accepted practice in C )
<lianj> when doing ffi, i like that types are just sizes on the stack :D
<workmad3> and compilers throw warnings and errors on them at times too :)
<workmad3> lianj: you like that types are just a buffer overflow waiting to happen?
<lianj> yep :P
<workmad3> :)
<manveru> well, it does make interoperation possible
retro|cz joined #ruby-lang
<manveru> difficult thing is just knowing when and where and how long things are
outoftime joined #ruby-lang
<workmad3> manveru: yeah... which is what the compiler is meant to deal with IMO :)
sepp2k joined #ruby-lang
<manveru> yeah
<manveru> see, the type system is one of the things i like about go :)
<manveru> except that it lacks generics, so you have to copy&paste like it's 1995
<manveru> StringVector Int32Vector PeopleVector WhateverVector..
<MistyM> Vaguely related, speaking of FFI and C/C++... what's the best way to interface with an external C++ lib? FFI doesn't work; oldskool C extension the best? Does SWIG work OK?
<manveru> MistyM: SWIG as a starting point
<manveru> it at least lists most of the functions, structs, and constants
<MistyM> Right.
<MistyM> OK, I'll look into doing that. Thanks!
<MistyM> I've used that for plain C libs! It is incredibly nifty. FFI doesn't do C++ though.
<lianj> manveru: so it generates a c wrapper for you?
<manveru> lianj: kinda
<manveru> swig generates one of those massive xml files describing all the C
<shevy> XML!!!
<manveru> the ffi-swig-generator parses that and outputs something resembling ruby
<MistyM> Which is nicer than SWIG's builtin Ruby support, which makes standard C extensions which need to be compiled.
<manveru> but it's neither syntactically nor logically correct in about 20% of cases
<lianj> i wonder how it works for c++ though
<manveru> but swig can find out the mangled c++ names
<lianj> oh
<imperator> ffi doesn't work with c++ ?
srbaker joined #ruby-lang
<MistyM> Really? I was under the impression FFI just didn't do C++ at all.
<imperator> oof
<shevy> hmmm how comes manveru knows so much about ffi
<manveru> c++ symbols are c symbols
tomdebenning joined #ruby-lang
<manveru> they just don't look at all sane
jimmy1980 joined #ruby-lang
<manveru> and depend on platform
<lianj> shevy: because ffi is awesome :)
<imperator> ffi is a mixed bag
desmovalvo joined #ruby-lang
<manveru> see an example
<manveru> int Fxyxy_i(x fnptr, y fnptr2, x fnptr3, y fnptr4) ?Fxyxy_i@@YAHP6AHH@ZP6AHF@Z01@Z
<manveru> first the function, then the mangled name
cschneid joined #ruby-lang
jmontross joined #ruby-lang
towski joined #ruby-lang
<manveru> not sure if c++11 finally standardized that
<manveru> that'd be huge
<shevy> ?Fxyxy_i@@YAHP6AHH@ZP6AHF@Z01@Z
<shevy> that makes perl code look so much nicer
<shevy> thank you C++
<manveru> "the Annotated C++ Reference Manual (also known as ARM, ISBN 0-201-51459-1, section 7.2.1c) actively encourages the use of different mangling schemes to prevent linking when other aspects of the ABI, such as exception handling and virtual table layout, are incompatible."
<lianj> enough of that insanity ;)
<manveru> agreed
ivanoats joined #ruby-lang
heppy_ joined #ruby-lang
benanne joined #ruby-lang
nowthatsamatt joined #ruby-lang
jkyle joined #ruby-lang
amerine joined #ruby-lang
<imperator> is it impossible to resubscribe to ruby-talk or ruby-core if you've unsubcribed?
guns joined #ruby-lang
ilyam joined #ruby-lang
Natch| joined #ruby-lang
rushed joined #ruby-lang
srbaker joined #ruby-lang
outoftime joined #ruby-lang
Pupeno- joined #ruby-lang
Pupeno- joined #ruby-lang
nuclearsandwich joined #ruby-lang
jasox joined #ruby-lang
<shevy> hehe
<shevy> The Return of the imperator !
<shevy> imperator can't you strangle someone with jedi mind tricks... like you know, that claw that remotely suffocates someone
RomyEatsDrupal joined #ruby-lang
heppy joined #ruby-lang
darkf joined #ruby-lang
<imperator> the imperator strikes back
<imperator> on that note, time to do christmas cards
Manhose_ joined #ruby-lang
<shevy> lol
csherin joined #ruby-lang
taf2 joined #ruby-lang
butchanton joined #ruby-lang
<arooni-mobile> is there a nice and easy way to import a spreadsheet full of username, password into ruby hashes such that {username => password, user2 => pass2} etc...
pangur joined #ruby-lang
yorickpeterse joined #ruby-lang
pangur left #ruby-lang
jasox joined #ruby-lang
<MistyM> arooni-mobile: There are multiple spreadsheet gems that give you array access to spreadsheet contents. Wouldn't be hard to transform that into a hash like you're looking for.
seydar joined #ruby-lang
<MistyM> (Passwords in spreadsheets though? :( )
seydar left #ruby-lang
flip_digits joined #ruby-lang
saLOUt joined #ruby-lang
<jsaak> is there any function like this: 'aaXaaXaa'.count_regex(/X/) => returns 2?
Oloryn_lt2 joined #ruby-lang
Swimming_Bird joined #ruby-lang
Fretta joined #ruby-lang
<Mon_Ouie> scan(…).size
sepp2k joined #ruby-lang
slyphon joined #ruby-lang
RickHull joined #ruby-lang
<jmontross> anyone know good resources for meta-programming API's into your own class to use?
<jsaak> o yes, i found .split.size, thx
IoGA joined #ruby-lang
<jsaak> scan is better tho
RickHull joined #ruby-lang
guns joined #ruby-lang
<TTilus> 'aaXaaXaa'.scan(/X/).size # => 2
<TTilus> 'aaXaaXaa'.split(/X/).size # => 3
<TTilus> jsaak: judging by your example you do not want .split
<jsaak> yep scan is what i was looking for thank you too
<TTilus> jmontross: you mean something like http://pragprog.com/book/ppmetr/metaprogramming-ruby
<arooni-mobile> MistyM, can you recommend a gem you like
<MistyM> arooni-mobile: I haven't used them much, but spreadsheet (creative name!) seems to be the most popular.
<arooni-mobile> MistyM, cool; thanks
<lianj> 'aaXaaXaa'.count('X') #=> 2
outoftime joined #ruby-lang
looopy_ joined #ruby-lang
Pupeno joined #ruby-lang
igotnolegs joined #ruby-lang
csherin joined #ruby-lang
looopy joined #ruby-lang
bjensen joined #ruby-lang
<bjensen> rubygems.org down?
<arooni-mobile> trying to install a gem but running into this trouble: https://gist.github.com/1452873 ... any ideas on what to do?
<arooni-mobile> is that why i cant install gems?
<drbrain> bjensen: qrush is working on it
<bjensen> arooni-mobile: Yeah
<arooni-mobile> a ha
<arooni-mobile> thought it had been my fault
<bjensen> drbrain: ok thanks
taf2 joined #ruby-lang
<bjensen> drbrain: any idea how long it has been down so far?
<drbrain> no
<arooni-mobile> is there an alternate way for me to install a ruby gem?
<arooni-mobile> so i'm not blocked by downtime?
<bjensen> arooni-mobile: you can get it off github if you can find its repo
ascarter_ joined #ruby-lang
<arooni-mobile> bjensen, i found it and put it in /vendor/gems/fastercsv; and added: "gem 'fastercsv', :path => 'vendor/gems/fastercsv'" but now i get: "./script/../config/../config/preinitializer.rb:18: Bundler couldn't find some gems.Did you run `bundle install`? (RuntimeError)"
<bjensen> arooni-mobile: just point to its github repo instead
<RickHull> isn't fastercsv the default now?
<RickHull> stdlib's csv?
agilous joined #ruby-lang
JohnBat26 joined #ruby-lang
nuclearsandwich joined #ruby-lang
<shevy> hmm
<shevy> what would be an easy way to write a ruby to (insert other language here) converter?
<shevy> I don't need 100% correctness. Just a basic and primitive scaffolding
<shevy> like, to convert a ruby class into a PHP class
<jmontross> TTilus: thanks for meta-prog link…. i was hoping for some free examples of taking an API and implementing
<jmontross> WSDLFactory seems famimliar as something like im trying to do, but there is no wsdl
voker57 joined #ruby-lang
voker57 joined #ruby-lang
nofxx joined #ruby-lang
mrsolo joined #ruby-lang
jkyle joined #ruby-lang
<arooni-mobile> ruby gem list --local ... lists 'fastercsv'. but when i try within irb to 'require 'faster_csv'' ==> LoadError: no such file to load -- fastercsv
duckinator left #ruby-lang
Sailias joined #ruby-lang
RORgasm joined #ruby-lang
ascarter joined #ruby-lang
<yorickpeterse> Anybody played around with this? https://github.com/soba1104/CastOff
<yorickpeterse> For an experiment it looks pretty cool
ascarter joined #ruby-lang
<arooni-mobile> how do i search for the character ^M within a text file?
slyphon joined #ruby-lang
dv310p3r joined #ruby-lang
<jmontross> arooni-mobile : what version of ruby are you using? it is just csv in 1.9.2
<arooni-mobile> im running 1.8.7
vicegrip joined #ruby-lang
<jmontross> did you do require 'rubygems' first?
ttilley joined #ruby-lang
headius joined #ruby-lang
<arooni-mobile> ah npoe
Nisstyre joined #ruby-lang
<arooni-mobile> jmontross, when i do in irb : 'require rubygems' then 'require faster_csv' it works. but when i have it inside a regular ruby script file i'm writing; i get the not ofund error
queequeg1_ joined #ruby-lang
<manveru> isn't faster_csv in stdlib?
<manveru> oh, 1.8
<manveru> that error message doesn't make any sense
<jmontross> use rvm
<manveru> why would it tell you it can't find fastercsv if you require faster_csv
<jmontross> did you gem install it?
romain1189 joined #ruby-lang
<manveru> arooni-mobile | ruby gem list --local ... lists 'fastercsv'
<manveru> oh wait
<manveru> ruby gem is not a command
<manveru> arooni-mobile: maybe you can show us the source
<jmontross> gem list … not ruby gem list
<manveru> oh great, dropbox: downloading 7,712 files (0.3 KB/sec, 50 days left)
<ReinH> heheh
<ReinH> o_O
<manveru> yeah... don't upgrade your dropbox on 3G
theconartist joined #ruby-lang
<yxhuvud> then you have crappy 3g.
<manveru> dropbox only uses a fraction of the bandwidth
<yxhuvud> latency bound then?
srbaker joined #ruby-lang
romain1189 joined #ruby-lang
<Pip> Is dropbox written in Ruby?
<manveru> i think python
lsegal joined #ruby-lang
outoftime joined #ruby-lang
<Pip> ok
woollyams joined #ruby-lang
<TTilus> jmontross: factory sounds a bit java'ish ;)
wyhaines joined #ruby-lang
hagabaka joined #ruby-lang
curtism joined #ruby-lang
ilyam joined #ruby-lang
srbaker joined #ruby-lang
alim joined #ruby-lang
<shevy> LONG LIVE RUBY!
<RickHull> ME RUBYOU RONG TIME!
<shevy> lol
IoGA joined #ruby-lang
adambeynon joined #ruby-lang
skyraid joined #ruby-lang
<yorickpeterse> ha
outoftime joined #ruby-lang
gearaholic joined #ruby-lang
wmoxam joined #ruby-lang
queequeg1 joined #ruby-lang
<arooni-mobile> how do i get more information about a ruby function like rand
<RickHull> ri
<RickHull> on the command line
jimmy1980 joined #ruby-lang
<arooni-mobile> ah forgot about ri
<arooni-mobile> thakns
jondot joined #ruby-lang
<MistyM> If you don't like the manpage style formatting there's also ruby-doc.org and rubydoc.info online. Same contents, different formatting.
<jondot> hi guys. i'm looking for a library to do NLP for ruby. specifically document stemming, tf-idf, tf. i know i have it easy with Python/NTLK but i like ruby.
<jondot> anyone doing such a thing?
spuk joined #ruby-lang
bougyman joined #ruby-lang
<drbrain> there's a couple
<jondot> (i know i have the option for JRuby/existing Java lingpipe/etc - but i think i'll then be taxed with getting into the Java state of mind)
<jondot> yea, i saw linguistics and i think back a while i saw that it is starting to take off again - any idea if that's still the case?
<drbrain> documentation: http://deveiate.org/code/linguistics/
<drbrain> ged: ^^
<jondot> ah. the guy is here :)
bougyman joined #ruby-lang
<headius> java state of mind?
<jondot> headius: yes. i realize that even with sweetness of JRuby, when i decide to use lingpipe, WEKA, Carrot2 or the such, I won't have idiomatic ruby at my side at all times.
<jondot> in terms of how those libraries are built.
gfarfl joined #ruby-lang
<headius> I don't really understand that
<headius> idiomatic ruby for what?
woody2shoes joined #ruby-lang
<jondot> well if i decide to integrate against say WEKA, even if jruby gives me snake_casing and great type conversion, i still have to deal with java-centric way of doing things (the library itself is java).
<jondot> in any case, while we're discussing, it looks like i'm heading that way regardless :)
<headius> as opposed to the C-centric way for MRI exts? :)
<headius> I guess I understand...if there's a pure-ruby alternative I always recommend that direction too
<headius> they're just usually garbage
<jondot> no, as opposed to using a pure ruby library, where i can get DSLs, blocks etc.
<headius> well not usually
<headius> just more often than I'd like :(
<jondot> which is garbage? i didn't follow
<headius> it's not hard to wrap some lib with a ruby layer, in any case, if you want those DSLs etc
<headius> garbage = many ruby libs
<headius> there's a lot of bad or abandoned stuff
hebz0rl joined #ruby-lang
<jondot> well, i guess the same is true for any ecosystem, no?
lenilson_dias joined #ruby-lang
Indian joined #ruby-lang
<jondot> headius: i'm heading towards jruby then. http://project.carrot2.org/ <-- should be a nice weekend project. thanks for jruby btw :)
<headius> cool, have fun :) and yet, it's true for any ecosystem, but the larger it is the more likely at least one lib will be maintained
<headius> for a lot of library domains in the Ruby world, it's just not big enough yet
outoftime joined #ruby-lang
<jondot> well, if you're talking about nlp, i agree, thats sad.
postmodern joined #ruby-lang
kyrylo joined #ruby-lang
tenderlove joined #ruby-lang
benanne joined #ruby-lang
scottschecter joined #ruby-lang
s0ber_ joined #ruby-lang
y3llow_ joined #ruby-lang
edwardsharp joined #ruby-lang
bougyman joined #ruby-lang
bougyman joined #ruby-lang
gfarfl joined #ruby-lang
petercooper joined #ruby-lang
outoftime joined #ruby-lang
RickHull left #ruby-lang
boodle joined #ruby-lang
gix joined #ruby-lang
shivamib joined #ruby-lang
wyhaines joined #ruby-lang
singpolyma joined #ruby-lang
<jmontross> http.send(method,{:uri => "#{@HOST}/#{@APIPATH}/#{resource}?access_token=#{@TOKEN}"})
<jmontross> how does one use .send and pass more than one parameter?
<lianj> send :method, :arg1, :arg2
fahadsadah joined #ruby-lang
saLOUt joined #ruby-lang
jasox joined #ruby-lang
nofxx joined #ruby-lang
yfeldblum joined #ruby-lang
saLOUt joined #ruby-lang
jimmy1980 joined #ruby-lang
bougyman joined #ruby-lang
Radar left #ruby-lang
livinded joined #ruby-lang
srbaker joined #ruby-lang
saLOUt_ joined #ruby-lang
jimmy1980 joined #ruby-lang
looopy joined #ruby-lang
outoftime joined #ruby-lang
Manhose joined #ruby-lang
cored joined #ruby-lang
cored joined #ruby-lang
looopy_ joined #ruby-lang
Pip joined #ruby-lang
srbaker joined #ruby-lang
burgestrand joined #ruby-lang
Sailias joined #ruby-lang
Manhose_ joined #ruby-lang
twittard joined #ruby-lang
fridim_ joined #ruby-lang
jimmy1980 joined #ruby-lang
workmad3 joined #ruby-lang
roha joined #ruby-lang
outoftime joined #ruby-lang
towski joined #ruby-lang