apeiros_ changed the topic of #ruby-lang to: Ruby 2.0.0-p0: http://ruby-lang.org (Ruby 1.9.3-p392) || Paste >3 lines of text on http://gist.github.com
slyphon has quit [Quit: slyphon]
krohrbaugh has quit [Quit: Leaving.]
cored has quit [Ping timeout: 260 seconds]
krohrbaugh has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
sandbags1138 has joined #ruby-lang
datanoise has quit [Ping timeout: 240 seconds]
krohrbaugh has quit [Read error: Connection reset by peer]
krohrbaugh has joined #ruby-lang
sandbags has quit [Ping timeout: 248 seconds]
anonymuse has quit [Quit: Leaving...]
torrieri has quit [Ping timeout: 248 seconds]
MehLaptop has quit [Remote host closed the connection]
enebo has quit [Quit: enebo]
tbuehlmann has quit [Remote host closed the connection]
tbuehlmann has joined #ruby-lang
mercwithamouth has joined #ruby-lang
slyphon has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
justinmcp has quit [Ping timeout: 245 seconds]
<yfeldblum> how can i get the unix timestamps for when the current process and current thread were created?
kurko_ has joined #ruby-lang
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
krz has quit [Quit: krz]
runeb has joined #ruby-lang
torrieri has joined #ruby-lang
datanoise has joined #ruby-lang
<darix> yfeldblum: why do you care?
runeb has quit [Ping timeout: 245 seconds]
idkazuma has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 240 seconds]
cmckni3 has joined #ruby-lang
datanoise has joined #ruby-lang
tomzx_mac has joined #ruby-lang
Domon has joined #ruby-lang
RickHull has joined #ruby-lang
tbuehlmann has quit [Ping timeout: 252 seconds]
<yfeldblum> darix, i want to cache something on the filesystem for the duration of each thread-process-pair in a multithreaded and multiprocessed program
Stilo has joined #ruby-lang
<yfeldblum> darix, i can use the pids and tids, but i'd like to prevent any stupid nonsense race conditions, whether hypothetical or real
slyphon has quit [Quit: slyphon]
sailias has joined #ruby-lang
plusk has joined #ruby-lang
justinmcp has joined #ruby-lang
kurko_ has quit [Ping timeout: 252 seconds]
cirenyc has joined #ruby-lang
Banistergalaxy has quit [Ping timeout: 245 seconds]
Banistergalaxy has joined #ruby-lang
Domon has quit [Remote host closed the connection]
KU0N has quit [Quit: Leaving...]
marr has quit [Ping timeout: 248 seconds]
thone has quit [Ping timeout: 252 seconds]
havenn has quit [Remote host closed the connection]
thone has joined #ruby-lang
kurko_ has joined #ruby-lang
mrsolo has quit [Quit: Leaving]
slyphon has joined #ruby-lang
slyphon has quit [Client Quit]
Domon has joined #ruby-lang
Domon has quit [Remote host closed the connection]
Domon has joined #ruby-lang
sebasoga has quit [Quit: Computer has gone to sleep.]
sailias has quit [Quit: Leaving.]
mjio has quit []
mistym has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
plusk has quit [Quit: plusk]
cirenyc has quit [Quit: Leaving...]
jackhammer2022 has joined #ruby-lang
Domon has quit [Remote host closed the connection]
Honeycomb has joined #ruby-lang
krz has joined #ruby-lang
gregmoreno has quit [Ping timeout: 245 seconds]
torrieri has quit [Quit: Leaving...]
slyphon has joined #ruby-lang
cirenyc has joined #ruby-lang
cirenyc has quit [Client Quit]
krohrbaugh has quit [Quit: Leaving.]
sn0wb1rd has quit [Quit: I will be right back]
dous has quit [Changing host]
dous has joined #ruby-lang
mjio has joined #ruby-lang
torrieri has joined #ruby-lang
justinmcp has quit [Ping timeout: 245 seconds]
datanoise has quit [Ping timeout: 264 seconds]
lsegal` has joined #ruby-lang
lsegal` has quit [Client Quit]
lsegal has joined #ruby-lang
torrieri has quit [Quit: Leaving...]
datanoise has joined #ruby-lang
joevandyk has quit [Quit: joevandyk]
slyphon has quit [Quit: slyphon]
Honeycomb has quit [Quit: Leaving.]
mistym has joined #ruby-lang
Domon has joined #ruby-lang
sebasoga has joined #ruby-lang
sebasoga has quit [Read error: Connection reset by peer]
sebasoga has joined #ruby-lang
dhruvasagar has joined #ruby-lang
sebasoga has quit [Read error: Connection reset by peer]
torrieri has joined #ruby-lang
sebasoga has joined #ruby-lang
justinmcp has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
dhruvasagar has quit [Ping timeout: 252 seconds]
sebasoga has quit [Ping timeout: 248 seconds]
havenwood has joined #ruby-lang
sebasoga has joined #ruby-lang
joooooo has joined #ruby-lang
setmeaway2 has quit [Read error: Connection reset by peer]
<kith> is there something like "hash.map!"?
sebasoga has quit [Read error: Connection reset by peer]
sebasoga has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
Honeycomb has joined #ruby-lang
agile has quit [Ping timeout: 248 seconds]
havenwood has joined #ruby-lang
sebasoga_ has joined #ruby-lang
sebasoga has quit [Ping timeout: 256 seconds]
torrieri has quit [Quit: Leaving...]
chuenjin has joined #ruby-lang
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
sebasoga_ has quit [Ping timeout: 256 seconds]
sebasoga has joined #ruby-lang
agile has joined #ruby-lang
gregmoreno has joined #ruby-lang
<drbrain> kith: no
chuenjin has quit [Quit: leaving]
<kith> if i wanted to .to_s all values within a hash how'd i do that best?
rsl has quit [Quit: Computer has gone to sleep.]
sebasoga has quit [Ping timeout: 256 seconds]
sebasoga_ has joined #ruby-lang
<RickHull> hsh.each { |k, v| hsh[k] = v.to_s }
<kith> geez..
<kith> why didnt i think of it?
<RickHull> i dunno about best. it's a little stinky to alter the hash within its own loop
sebasoga_ has quit [Read error: Connection reset by peer]
gregmoreno has quit [Ping timeout: 250 seconds]
krohrbaugh has joined #ruby-lang
sebasoga has joined #ruby-lang
madish has quit [Quit: ChatZilla 0.9.90 [Firefox 16.0.1/20121026125834]]
tdy_ has quit [Ping timeout: 256 seconds]
sebasoga has quit [Read error: Connection reset by peer]
mk03 has quit [Remote host closed the connection]
sebasoga has joined #ruby-lang
<drbrain> yeah
<drbrain> but you can do it
<RickHull> kith: also you can do hsh = hsh.map { ... }
<RickHull> which returns an array, uhelpfully
<RickHull> but you can easily convert that back to a hash
<RickHull> i just forget the exact incantation
dhruvasagar has joined #ruby-lang
torrieri has joined #ruby-lang
sebasoga has quit [Ping timeout: 252 seconds]
sebasoga has joined #ruby-lang
sebasoga has quit [Read error: Connection reset by peer]
sebasoga has joined #ruby-lang
<havenwood> kith: Or: require 'hashy'; hsh.map_value &:to_s
mwjcomputing has joined #ruby-lang
<havenwood> kith: Don't need the gem if you just want to borrow the method (whole gem is about 20 lines).
mwjcomputing has left #ruby-lang [#ruby-lang]
<kith> too late ;) thx anyway
pr0ton has quit [Quit: pr0ton]
sebasoga has quit [Ping timeout: 264 seconds]
<RickHull> what are the recommended ways to manage ruby versions these days?
<RickHull> i lost touch around when rbenv seemed to be taking over from rvm
<RickHull> on amazon ec2 FWIW
<postmodern> RickHull, apt-get
<postmodern> RickHull, ec2 Ubuntu VMs were updated, there's no a 1.9.2 package in there
brianpWins has joined #ruby-lang
<RickHull> yeah but like rbx and jruby
<RickHull> has debian really adjusted to the ruby world?
sebasoga has joined #ruby-lang
<RickHull> it wasn't like that a few years ago
<RickHull> as it happens, i'm stuck on a 10.04 instance
<postmodern> RickHull, then probably rvm or chruby's instructions
<RickHull> ah, chruby, that's the one i couldn't remember
<RickHull> i think there are another few players as well?
sebasoga has quit [Read error: Connection reset by peer]
<postmodern> RickHull, rbfu was the other serious one, but was deprecated in favor of chruby
sebasoga has joined #ruby-lang
<firefux> wow that ubuntu article is dumb
<postmodern> lol how is an article dumb?
* drbrain facepalms at "hopefully I'm not missing anything"
<drbrain> it sure inspires confidence that the users of a package system aren't sure they have all of ruby or not
Kuukunen has quit [Ping timeout: 276 seconds]
<firefux> postmodern: try using gem with it, it will shout at you that you shouldn't use gem from rubygems.org and instead use the .deb gem packages
<postmodern> drbrain, i've used those instructions before, works just fine
<postmodern> drbrain, if he did miss anything, should probably comment
wallerdev has joined #ruby-lang
<drbrain> postmodern: maybe I'm misinterpreting the comment then
<postmodern> firefux, sudo gem install works just fine
<firefux> yes it works, but you never until when ;)
<firefux> +know
<postmodern> firefux, it's still working now
<firefux> postmodern: they discourage using gem install
<drbrain> postmodern: I see "missing anything" as "missing part of ruby"
<postmodern> firefux, they dont now
Mawk has quit [Quit: Mawk]
<drbrain> … and I remember when not only was that possible, it was the default
<firefux> postmodern: the other dumb is he assumes everyone has ruby1.8 installed by default on ubuntu
<postmodern> firefux, ruby1.8 is the default version, this will change soon
<firefux> so instead of doing all that and not having 1.8 installed all you need to do is apt-get ruby1.9.3
<postmodern> firefux, I literally copy/pasted those instructions on a clean ubuntu vm image, worked fine
<postmodern> firefux, perhaps you should test the instructions for yourself
<postmodern> firefux, update-alternatives is to ensure there's symlinks pointing to the 1.9 suffixed files
<postmodern> /etc/alternatives/ruby -> /usr/bin/ruby1.9.1
<postmodern> /usr/bin/ruby -> /etc/alternatives/ruby
<firefux> right, if you don't have 1.8 you don't have to do that, ruby will be ruby1.9.1
Kuukunen has joined #ruby-lang
geopet has joined #ruby-lang
<postmodern> firefux, i don't have 1.8 installed and apparently I had to do that
<firefux> on 12.04?
<postmodern> firefux, yup
<postmodern> firefux, sshed in right now
davidbalber|away is now known as davidbalbert
datanoise has quit [Ping timeout: 245 seconds]
klebervi_ has joined #ruby-lang
slyphon has joined #ruby-lang
klebervirgilio has quit [Ping timeout: 264 seconds]
tdy_ has joined #ruby-lang
klebervi_ has quit [Remote host closed the connection]
klebervirgilio has joined #ruby-lang
<firefux> postmodern: I just did apt-get install ruby1.9.3 on a fresh 12.04 VM and ruby -v showed 1.9.3p0
<postmodern> firefux, ah excellent
<firefux> so don't know why you had to do that if you didn't had 1.8 installed
<postmodern> firefux, than i guess the author assumed or added it as a safety measure
<postmodern> firefux, maybe ruby1.8 got depped in at some point, and i uninstalled it later
<postmodern> firefux, think vim requires ruby for highlighting/indentation
lcdhoffman has quit [Quit: lcdhoffman]
<postmodern> *libruby
bzalasky has joined #ruby-lang
<drbrain> no, its separate
<drbrain> vim's syntax highlighting and indentation is regular-expression based
<firefux> not sure, I think vim only requires it if you plan to script vim in ruby
<firefux> otherwise you don't anything ruby related for vim
klebervirgilio has quit [Ping timeout: 245 seconds]
soypirate has joined #ruby-lang
geopet has quit [Quit: geopet]
wmoxam has joined #ruby-lang
ryanf has quit [Quit: leaving]
banister`sleep has quit [Read error: Connection reset by peer]
bzalasky has quit [Remote host closed the connection]
spuk has quit [Ping timeout: 255 seconds]
datanoise has joined #ruby-lang
spuk has joined #ruby-lang
jxie has quit [Quit: leaving]
kvs has quit [Ping timeout: 246 seconds]
bzalasky has joined #ruby-lang
pkondzior__ has quit [Read error: Operation timed out]
wycats__ has quit [Write error: Broken pipe]
beawesomeinstead has quit [Read error: Operation timed out]
bzalasky has quit [Remote host closed the connection]
thejspr_ has quit [Read error: Operation timed out]
dreinull_ has quit [Ping timeout: 252 seconds]
guilleiguaran has quit [Ping timeout: 255 seconds]
randym has quit [Ping timeout: 264 seconds]
Guest85414 has quit [Ping timeout: 264 seconds]
herpless has quit [Ping timeout: 256 seconds]
akahn has quit [Ping timeout: 256 seconds]
anildigital_work has quit [Ping timeout: 245 seconds]
akamike has quit [Ping timeout: 245 seconds]
lectrick has quit [Ping timeout: 264 seconds]
UziMonkey has quit [Read error: Operation timed out]
L0rdShrek____ has quit [Ping timeout: 272 seconds]
grandy has quit [Ping timeout: 252 seconds]
Spaceghost|cloud has quit [Ping timeout: 245 seconds]
mroth_ has quit [Ping timeout: 256 seconds]
bpot has quit [Ping timeout: 260 seconds]
amdprophet has quit [Ping timeout: 245 seconds]
pnr has quit [Ping timeout: 256 seconds]
<rking> Hrm. What's the right way to install libruby.a in such a way that compiling vim/subtle/etc can bind to it, if you're using something like ruby-build?
<rking> Do you just point all the way into ~/.rbenv/versions/etc ?
<rking> s/bind to it/link it/
scrr has quit [Ping timeout: 264 seconds]
sush24 has joined #ruby-lang
<postmodern> rking, install it into /usr/local
gregmoreno has joined #ruby-lang
<postmodern> rking, or pass special --with-ruby-dir flags to vim/subtle/etc
<postmodern> rking, ruby-build $RUBY /usr/local/
datanoise has quit [Ping timeout: 260 seconds]
gregmoreno has quit [Remote host closed the connection]
gregmoreno has joined #ruby-lang
kvs has joined #ruby-lang
JonsonXP has quit [Ping timeout: 250 seconds]
<rking> Ahh, nice.
<rking> postmodern: Thanks.
justinmcp has quit [Remote host closed the connection]
<rking> I tried being cheeky and just symlinking libruby-static.a into /usr/lib, but it gave an error about needing to compile with -fPIC.
Kuukunen has quit [Ping timeout: 264 seconds]
<rking> I'm not sure if that referred to the .a or to subtle. I tried hacking -fPIC into both, with no success.
shirokuro11 has joined #ruby-lang
sush24 has quit [Client Quit]
<rking> postmodern: Thanks for the PSA re grumpy IRC people. Chance of hitting the intended audience: 0.0000001%, but still.
<postmodern> rking, thanks, keep running into them on linux/lang channels
<postmodern> rking, and they are never official support people
scrr has joined #ruby-lang
sonne has quit [Ping timeout: 276 seconds]
mercwithamouth has quit [Quit: leaving]
mercwithamouth has joined #ruby-lang
jxie has joined #ruby-lang
djwonk has quit []
justinmcp has joined #ruby-lang
chendo_ has quit [Ping timeout: 256 seconds]
shirokuro11 has quit [Remote host closed the connection]
chendo_ has joined #ruby-lang
Kuukunen has joined #ruby-lang
bzalasky has joined #ruby-lang
kurko_ has quit [Quit: Computer has gone to sleep.]
valeri_ufo has quit [Ping timeout: 276 seconds]
torrieri has quit [Quit: Leaving...]
valeri_ufo has joined #ruby-lang
vbatts has quit [Quit: WeeChat 0.3.6]
torrieri has joined #ruby-lang
gregmor__ has joined #ruby-lang
jasiek_ has quit [Ping timeout: 248 seconds]
Artheist has joined #ruby-lang
sepp2k has joined #ruby-lang
gregmoreno has quit [Ping timeout: 264 seconds]
vbatts has joined #ruby-lang
his_shadow has quit [Ping timeout: 260 seconds]
justinmcp has quit [Remote host closed the connection]
jasiek has joined #ruby-lang
ryanf has joined #ruby-lang
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
sonne has joined #ruby-lang
davidbalbert is now known as davidbalber|away
amerine has quit [Quit: Computer has gone to sleep.]
justinmcp has joined #ruby-lang
meatballhat has quit [Quit: leaving]
meatballhat has joined #ruby-lang
Artheist has quit [Remote host closed the connection]
nXqd has joined #ruby-lang
robbyoconnor has joined #ruby-lang
wycats__ has joined #ruby-lang
wmoxam has quit [Quit: leaving]
Artheist has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
<hakunin> I wonder why Net::HTTPResponse doesn't just provide #each, instead naming it #read_body...
torrieri has quit [Read error: Connection reset by peer]
drumond19 has joined #ruby-lang
djwonk has joined #ruby-lang
<hakunin> If I wanted to stream from Net::HTTPResponse to Rails' send_data (which accepts objects responding to #each) I guess i'd have to wrap it just to rename that method
mercwithamouth has quit [Ping timeout: 248 seconds]
mercwithamouth has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
Honeycomb has quit [Quit: Leaving.]
glebm has joined #ruby-lang
drbrain has quit [Ping timeout: 264 seconds]
Domon has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
trappist_ is now known as trappist
noop has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 255 seconds]
MSU_ has quit [Ping timeout: 248 seconds]
mroth_ has joined #ruby-lang
MSU has joined #ruby-lang
anildigital_work has joined #ruby-lang
Guest85414 has joined #ruby-lang
bpot has joined #ruby-lang
<yfeldblum> hakunin, `http_response.enum_for(:read_body).each do |part| ... end`
pkondzior__ has joined #ruby-lang
thejspr_ has joined #ruby-lang
guilleiguaran has joined #ruby-lang
iamjarvo has quit [Quit: Leaving.]
skade has joined #ruby-lang
akahn has joined #ruby-lang
dreinull_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
L0rdShrek____ has joined #ruby-lang
pnr has joined #ruby-lang
lectrick has joined #ruby-lang
drumond19 has quit [Read error: Connection reset by peer]
Spaceghost|cloud has joined #ruby-lang
akamike has joined #ruby-lang
ruby-lang114 has joined #ruby-lang
randym has joined #ruby-lang
mjio has quit []
UziMonkey has joined #ruby-lang
UziMonkey has joined #ruby-lang
UziMonkey has quit [Changing host]
<hakunin> yfeldblum: i knew there must be a way to turn anything into an enumerator, thanks
jerrytgarcia has joined #ruby-lang
herpless_ has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
Domon has joined #ruby-lang
amdprophet has joined #ruby-lang
grandy has joined #ruby-lang
io_syl has quit [Ping timeout: 245 seconds]
JohnBat26 has joined #ruby-lang
rippa has joined #ruby-lang
ruby-lang114 has quit [Ping timeout: 245 seconds]
datanoise has joined #ruby-lang
beawesomeinstead has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 248 seconds]
Mon_Ouie has joined #ruby-lang
datanoise has quit [Ping timeout: 256 seconds]
rc- has joined #ruby-lang
rue|w has joined #ruby-lang
drbrain has joined #ruby-lang
krz has quit [Ping timeout: 248 seconds]
Domon has quit [Remote host closed the connection]
rue|w has quit [Ping timeout: 276 seconds]
tonni has quit [Remote host closed the connection]
krz has joined #ruby-lang
charliesome has joined #ruby-lang
Honeycomb has joined #ruby-lang
noop has quit [Read error: Connection reset by peer]
nXqd has quit [Ping timeout: 276 seconds]
earthquake has joined #ruby-lang
justinmcp has joined #ruby-lang
noop has joined #ruby-lang
rc- has quit [Ping timeout: 245 seconds]
wallerdev has quit [Quit: wallerdev]
charliesome_ has joined #ruby-lang
charliesome has quit [Disconnected by services]
charliesome_ is now known as charliesome
chendo_ has quit [Ping timeout: 252 seconds]
xalei has joined #ruby-lang
justinmcp has quit [Ping timeout: 245 seconds]
tonni has joined #ruby-lang
chendo_ has joined #ruby-lang
nXqd has joined #ruby-lang
gnufied has joined #ruby-lang
lun_ has quit [Ping timeout: 264 seconds]
musl has quit [Ping timeout: 255 seconds]
<hakunin> Relatedly, in ruby it seems you can only read or write to the pipe, not both. So if I want to pipe a bunch of data through an external command (I write and I read), must I first write everything before starting to read?
noop has quit [Ping timeout: 264 seconds]
<hakunin> and if yes, is there some workaround to have actual stream going?
<drbrain> hakunin: you need two pipes
<drbrain> pipes only go one way
<hakunin> drbrain: hm, and you can have 2 pipes to the same command? I need to write to its one end and read from the other
noop has joined #ruby-lang
<drbrain> hakunin: yes
jayne has quit [Ping timeout: 612 seconds]
<drbrain> you write to the pipe the command reads from and read from the pipe the command writes to
<drbrain> popen does this for you automatically, with spawn you need to set it up yourself
<hakunin> drbrain: makes sense, i just need a pointer to a class/method i should look at, something like popen4 (i actually wanted to use rtomayko's posix-spawn, but not 100% necessary)
<drbrain> spawn is built-in to 1.9.3 and newer
<drbrain> oops, 1.9 and newer
<hakunin> drbrain: whoops, wrote before reading that
<drbrain> I think posix-spawn is only needed on ruby 1.8
dhruvasagar has joined #ruby-lang
<drbrain> yeah, according to the README, of posix spawn, use it on 1.8
<hakunin> really, that's pretty serious news to me....
bzalasky has quit [Remote host closed the connection]
musl has joined #ruby-lang
<hakunin> drbrain: as in - in 1.9 the forking is already implemented without copy-on-write madness?
ryez has joined #ruby-lang
<drbrain> hakunin: it's a property of spawn, not ruby
jackhammer2022 has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<hakunin> drbrain: oh perhaps you misread that readme, posix-spawn changes sys calls, not just interface
skade has quit [Quit: Computer has gone to sleep.]
rippa has quit [Ping timeout: 240 seconds]
<hakunin> it's a peculiar issue with ruby's GC triggering CoW on all of memory by flipping dirty bit
<drbrain> hakunin: ruby now uses bitmap marking
|Vargas| has joined #ruby-lang
|Vargas| has quit [Client Quit]
<hakunin> drbrain: i did not know that
<drbrain> hakunin: but, it doesn't look like posix-spawn reimplements system, `, etc.
jayne has joined #ruby-lang
|Vargas| has joined #ruby-lang
<hakunin> drbrain: it's fully isolated, i just wanted to use that to avoid wasting ram in shell-outs to imagemagick and friends
lun_ has joined #ruby-lang
<hakunin> but apparently it is not as much of an issue anymore
<drbrain> looks like 1.9 uses spawn for system and `
<hakunin> drbrain: fwiw, i also wrote my imagemagick wrapper skeptick based on posix spawn, and advertised it as an advantage: github.com/maxim/skeptick
<drbrain> likely for popen too
<hakunin> maybe should start downplaying that
<havenwood> Kinda seems like Enumerable#to_h would be handy. Any downsides I'm not thinking of for a simple implementation like this?: https://gist.github.com/havenwood/5088442
<hakunin> drbrain: appreciate pointers, will figure it out from here
<drbrain> Enumerable#to_h seems perilous
<drbrain> such as: system ['echo', 'hello'], 'rm', '-i', '/'
<hakunin> drbrain: all of which led me to believe that 1.9 still had the problem
<drbrain> 1.9 did, but it is not the latest production release
<drbrain> … 1.9 did not use bitmap marking for GC to avoid the CoW problem
<hakunin> drbrain: just read a bit further in here: http://www.infoq.com/news/2012/01/bitmap-marking-gc looks like it's part of 2.0, and still relevant in 1.9, phew.
<drbrain> yes
<drbrain> for spawn, system, ` and popen, 1.9 won't suffer from CoW when invoking a program
nXqd has quit [Ping timeout: 255 seconds]
pepper_chico has quit [Quit: Computer has gone to sleep.]
bzalasky has joined #ruby-lang
lun_ has quit [Read error: Connection reset by peer]
<hakunin> drbrain: i'm a bit more confused now, i thought all of them relied on fork, and once you fork in ruby <2.0 - you will suffer from CoW because GC changes are not deployed as part of 1.9
<whitequark> drbrain: wait, _avoid_ CoW?
fgsfdsfgsfds has joined #ruby-lang
<whitequark> isn't it that bitmap marking GC makes CoW much more efficient? like, REE implemented it specifically for that reason?
<drbrain> whitequark: when you use fork + exec you still get a copy of the memory on some OSes
Mon_Ouie has quit [Ping timeout: 276 seconds]
<drbrain> so ruby uses spawn if the OS supports it to avoid the extra copying
<hakunin> so spawn in and of itself _is_ that other thing besides fork, that doesn't copy memory? this is probably the source of my confusion
atrocitas has joined #ruby-lang
<drbrain> hakunin: yes
<hakunin> i thuoght there were different spawns
<hakunin> :(
<drbrain> same system call, separate implementations
<drbrain> whitequark: specifically, page tables, posix-spawn has some explanation: https://github.com/rtomayko/posix-spawn#posix-spawn
<hakunin> so why woudl posix-spawn offer to replace 1.9's spawn
<drbrain> hakunin: it is for ruby 1.8
<hakunin> drbrain: i don't see where it says that
<drbrain> "The posix-spawn library aims to implement a subset of the Ruby 1.9 Process::spawn interface in a way that takes advantage of fast process spawning interfaces when available and provides sane fallbacks on systems that do not."
<eam> posix_spawn is done with vfork
<whitequark> drbrain: nono, I was talking about bitmap marking. I understand how fork and spawn and CoW relate
<eam> on linux, at least
<whitequark> drbrain: but I don't get how the bitmap marking adds to the mix
<drbrain> whitequark: 1.9 and earlier stores marks on each object so you touch (and copy) all of memory on first GC
amerine has joined #ruby-lang
<drbrain> the bitmaps put those marks into fewer pages
<whitequark> drbrain: indeed, so bitmap marking is _good_ for CoW. no?
<drbrain> so you won't have multiple copies of all your instruction sequences
<drbrain> correct
<whitequark> ah
<whitequark> I simply misunderstood your sentence
<whitequark> nevermind
<hakunin> drbrain: that piece of doc only says they're adhering to 1.9's interface
<drbrain> eam: I bet vfork() came before posix_spawn()
<hakunin> drbrain: i don't think there is any low level spawn, it's all fork, or as eam points out, looks like vfork makes all the diff
<drbrain> hakunin: also, "A largish compatible subset of Ruby 1.9's Process::spawn interface and enhanced versions of Kernel#system, Kernel#`, etc. under Ruby >= 1.8.7 (currently MRI only)."
<hakunin> or i'm an idiot and don't know anything about computers
<hakunin> (not saying it's unlikely)
<drbrain> hakunin: all of what's written in the README says "we are copying 1.9's Process::spawn"
<hakunin> drbrain: again, i searched through all mentions of 1.8 and all they say is that it's _also_ useful in 1.8
<hakunin> drbrain: as in "despite being in 1.8, you will get 1.9's interface"
fgsfdsfgsfds has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby-lang
<hakunin> drbrain: but the underlying system calls differ
<hakunin> from vanilla spawn
<eam> drbrain: probably. vfork is the nonstandard call and posix_spawn() is the portable version
<drbrain> hakunin: I would be surprised if there were a serious functional difference between the different calls
<hakunin> drbrain: that difference is in entirely ignoring CoW, and only useful for forking when you will never need parent process' memory
<hakunin> which is perfect for shell-outs
<whitequark> (not that the forking overhead actually matters that much in practice. I recall reading an article about that.)
<eam> fork vs vfork is huge on linux at least, I had an app which shelled out many times, we plotted a clear linear cost as resident memory grew
<hakunin> whitequark: with problematic GC it matters, because on some of my servers i'm literally "only room for one more Rails process in ram"
jerrytgarcia has quit [Read error: Connection reset by peer]
<whitequark> I see
<eam> at MB sized processes the CoW cost vanishes into the noise of making a syscall. But at GB sized or bigger it becomes a dominant cost
<eam> for us it added tens of minutes to a job
vlad_starkov has quit [Ping timeout: 256 seconds]
chendo__ has joined #ruby-lang
<drbrain> hakunin: they're the same
<drbrain> posix-spawn and 1.9's Process.spawn/system/`/popen use the equivalent system calls
<eam> for our particular purpose we ended up writing a small daemon we could ipc to, to fork/exec for us
nXqd has joined #ruby-lang
<drbrain> ruby 1.9 only forks when you don't have spawn/posix_spawn/vfork
<hakunin> drbrain: if vfork doesn't let child use parent's memory how can this work
<drbrain> hakunin: I thought you said that was the whole point
<hakunin> drbrain: but sometimes you fork for other reasons than shell out
<eam> hakunin: the child must exec() immediately or undefined
<drbrain> hakunin: then posix-spawn still does nothing for you
<drbrain> and you should use ruby 2
jerrytgarcia has joined #ruby-lang
<hakunin> drbrain: i'm asking, if ruby 1.9 always uses vfork on systems that support it, then you can never fork and have parent process memory
<hakunin> drbrain: that seems weird
<drbrain> hakunin: it does the appropriate thing for what you are doing
beho has joined #ruby-lang
<hakunin> (on those systems)
<eam> hakunin: it only would use it for creating child processes (fork/exec) not for fork itself
<drbrain> fork do ruby code end uses "regular" fork
* hakunin is processing
ykk has quit [Remote host closed the connection]
<drbrain> fork do exec 'some', 'other', 'program' end uses "regular" fork
<drbrain> system 'some', 'other', 'program' uses the spawn family, where available
gregmor__ has quit [Remote host closed the connection]
<drbrain> same for using shell execution
justinmcp has joined #ruby-lang
<drbrain> (system "some other program", but you should avoid that where possible
<hakunin> drbrain: ok i think it's hitting me: these methods you keep listing, they are only for exec, so obviopusly they can safely use vfork on supporting systems, and ruby 1.9 already does that. Bear with me, I'm connecting.
<hakunin> their purpose is shell-outs, so yes, they can forget parent
<hakunin> now it makes sense
<drbrain> yay!
<hakunin> drbrain: i seriously appreciate the time you took to explain this
<hakunin> eam: thanks a lot for clarifications
chendo__ has quit [Quit: Computer has gone to sleep.]
lun_ has joined #ruby-lang
huydx has joined #ruby-lang
apeiros_ has joined #ruby-lang
vmoravec has joined #ruby-lang
tonni has quit [Remote host closed the connection]
chendo_ has quit [Ping timeout: 252 seconds]
bluepojo has quit [Remote host closed the connection]
justinmcp has quit [Remote host closed the connection]
bluepojo has joined #ruby-lang
justinmcp has joined #ruby-lang
chendo_ has joined #ruby-lang
kgrz has joined #ruby-lang
bluepojo has quit [Ping timeout: 252 seconds]
seoaqua has joined #ruby-lang
imperator has joined #ruby-lang
<hakunin> drbrain: sorry to bother you again, above you mentioned that "popen does this for you automatically" about 2 pipes. but given a block with out, err, in - how can i write to in and read from out simultaneously? just do it in order in.write(chunk); yield(out.read) type of thing?
<drbrain> hakunin: yes
<drbrain> hakunin: if you need to interleave reading and writing you can use IO.select or threads
<hakunin> drbrain: so it's a blocking write, and a blocking read
<hakunin> drbrain: ok i see, thanks
beho has quit [Remote host closed the connection]
datanoise has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
<whitequark> any channel mods/ops here?
<drbrain> whitequark: hi
<hakunin> drbrain: eam: just got reply from rtomayko: https://twitter.com/hakunin/status/308843671372038144
<shachaf> hi drbrain
<drbrain> hakunin: 1.9.3 seems to, maybe 1.9.2 does not
<drbrain> shachaf: hi
retro|cz has quit [Ping timeout: 248 seconds]
<whitequark> drbrain: we've been talking with @charliesome about eval-in bot from #ruby
<whitequark> and I thought that maybe it was a good idea to have it at #r-l
<drbrain> we can give it a shot
<whitequark> 'k, thanks!
* imperator goes back to 1.9.3 for now
<whitequark> imperator: something broken on 2.0?
ryanf has quit [Quit: leaving]
<imperator> extension building seems fucked up
<drbrain> imperator: there's some rubygems bugs
<drbrain> should have a fix out tomorrow
tonni has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
<imperator> oic
datanoise has quit [Ping timeout: 276 seconds]
djwonk has quit [Ping timeout: 248 seconds]
<drbrain> changes in mkmf.rb were made to fix some bugs, but they exposed other bugs in rubygems :?
<drbrain> :/
<imperator> strange
torrieri has joined #ruby-lang
postmodern has quit [Quit: Leaving]
tbuehlmann has joined #ruby-lang
maxmanders has joined #ruby-lang
djwonk has joined #ruby-lang
<imperator> huh, even after reverting i can't install ffi
<drbrain> imperator: can you try rubygems trunk?
<seoaqua> has anyone successfully installed ruby2.0? there are some problems with mine. i've installed the gem bson_ext, but system keep warning of it. i think it's related to the require path, but i don't know how to debug:S
chekcmate has joined #ruby-lang
<drbrain> seoaqua: it's a RubyGems bug, there should be a release tomorrow
<seoaqua> drbrain, O_O thanks,but ...
<drbrain> seoaqua: you can try using rubygems trunk
<seoaqua> drbrain, it was on a centos. on my mac, i can't even install any gems
<drbrain> I'm on a mac and haven't had any problems (but I don't use bson)
djwonk has quit [Ping timeout: 245 seconds]
beho has joined #ruby-lang
<imperator> ran rake install_gem, still says I have 2.0.0
<seoaqua> drbrain, https://gist.github.com/seoaqua/5088778 could you take a look
<drbrain> imperator: ruby setup.rb
<drbrain> seoaqua: can you show output of `gem install`?
<drbrain> imperator: I don't think rake install_gem works properly because rubygems is "special"
<imperator> ok, i'll try that, thanks
justinmcp has quit [Ping timeout: 245 seconds]
<drbrain> imperator: you can also just do ruby -Ilib bin/gem install ffi
<imperator> ok, gem -v reports 2.0.1
<drbrain> :D
<imperator> but....still can't install ffi
<drbrain> what error do you get?
<imperator> it's an mkmf error, can't find ffi.h now
<drbrain> which FFI?
<drbrain> version?
djwonk has joined #ruby-lang
Domon has joined #ruby-lang
mistym has joined #ruby-lang
<imperator> trying to install the latest version
<imperator> but i just tried a ruby i had installed in another directory and that's not working now either
<imperator> ffi 1.4.0 btw
ykk has joined #ruby-lang
<drbrain> odd, it worked for me
<drbrain> (with rubygems trunk)
<imperator> i don't know wtf is going on any more
adambeynon has joined #ruby-lang
<imperator> everything got fucked up when i installed 2.0
<drbrain> … but I can't see the build log
<drbrain> I think the extension building fixes broke it ☹
kevinfagan has joined #ruby-lang
kevinfagan has quit [Client Quit]
eval-in has joined #ruby-lang
<charliesome> >> RUBY_DESCRIPTION
<eval-in> charliesome => "ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]" (http://eval.in/11738)
<charliesome> aw old
sush24 has joined #ruby-lang
<lianj> yay for not using tryruby sandbox
<drbrain> is p194 vulnerable to HashDoS?
noop_ has joined #ruby-lang
<charliesome> hmm dunno
<charliesome> not too concerned, computation is limited to 1 second
<lianj> aw, make it 5 :P
<charliesome> hah no way
<seoaqua> drbrain, pls check the comment https://gist.github.com/seoaqua/5088778, i was afk
<charliesome> lianj: is try ruby sandbox the one that does static analysis?
concernedcitizen has joined #ruby-lang
<drbrain> seoaqua: you should install OpenSSL
<lianj> charliesome: no, some jruby thing
<charliesome> ah
<drbrain> seoaqua: 2.0.1 will fix this, but that gives you 0 MITM protection
<seoaqua> drbrain, openssl-1.0.1e already installed
<drbrain> seoaqua: then rebuild ruby
<charliesome> i had jruby on eval.in (it was called rbpad at the time) but i removed it because i got scared of the jvm
<drbrain> … with openssl
kgrz has quit [Quit: Computer has gone to sleep.]
noop has quit [Ping timeout: 245 seconds]
tbuehlmann has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
<seoaqua> drbrain, first i build the ruby without the notice of openssl, then i installed ruby with rbenv with openssl option, do i need to restart the machine?
<drbrain> seoaqua: no
<drbrain> if you're building by hand, ./configure --with-openssl-dir=/path/to/openssl/
<seoaqua> drbrain, actually after building without openssl, it was running ok until i changed some path configs
<seoaqua> drbrain, i'll try this one
noop_ has quit [Ping timeout: 264 seconds]
judofyr has joined #ruby-lang
<seoaqua> drbrain, but it was strange when i run ruby with subliem
<seoaqua> drbrain, *sublime. in that RUBY VERSION is 1.9.3 and GEM VERSION is 2.0.0
ykk has quit [Ping timeout: 240 seconds]
<seoaqua> drbrain, configure: WARNING: unrecognized options: --with-openssl-dir
<drbrain> I only know how to build ruby with ./configure
<drbrain> seoaqua: it is configure complaining, ruby still uses it
jstemmer has joined #ruby-lang
<drbrain> autoconf may not be flexible enough
<imperator> have_header("ffi.h", "/usr/include/ffi" => "conftest.c:3:28: error: /usr/include/ffi: No such file or directory"
<imperator> bullshit
<seoaqua> drbrain, got it:)
<drbrain> seoaqua: there is a bug open for it
<seoaqua> drbrain, i should really not upgrade ruby
marr has joined #ruby-lang
<drbrain> seoaqua: then rebuild 1.9.3
<seoaqua> drbrain, i really should not
torrieri has quit [Quit: Linkinus - http://linkinus.com]
datanoise has joined #ruby-lang
<drbrain> whichever version, ruby was not built with the OpenSSL extension
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby-lang
<charliesome> whitequark: we have eval-in running ruby-2.0.0-p0
<seoaqua> drbrain, can i simple copy /usr/local/lib/ruby/gems/1.9.1/gems/* to /usr/local/lib/ruby/gems/2.0.0/gems/ ?
<drbrain> seoaqua: nope
<seoaqua> drbrain, O__O maybe that's the problem , it was ok before this
<imperator> welp, dead in the water on osx now, guess i'll use the linux vm for development for now
* imperator goes to bed
<drbrain> one of the first thing in the release notes is "don't copy extension libraries"
<seoaqua> drbrain, i can install gems now ^_^
<drbrain> I need to go to bed too
imperator has left #ruby-lang ["Leaving"]
<seoaqua> drbrain, nice dreams
<seoaqua> drbrain, i followed u on github:) actually i went to seattle last oct
kgrz has joined #ruby-lang
datanoise has quit [Ping timeout: 252 seconds]
kevinfagan has joined #ruby-lang
solars has joined #ruby-lang
<whitequark> charliesome: thanks, neat!
<whitequark> >> "foo"
<eval-in> whitequark => "foo" (http://eval.in/11746)
<whitequark> great for one-off demonstrations
tbuehlmann has joined #ruby-lang
beiter has joined #ruby-lang
Domon has quit [Remote host closed the connection]
retro|cz has joined #ruby-lang
rue|w has joined #ruby-lang
xalei has quit [Remote host closed the connection]
babinho_ has quit [Quit: leaving]
ykk has joined #ruby-lang
babinho has joined #ruby-lang
zmack has joined #ruby-lang
mistym has quit [Remote host closed the connection]
sebasoga has quit [Quit: Computer has gone to sleep.]
Artheist has quit [Remote host closed the connection]
amerine has quit [Quit: Computer has gone to sleep.]
jerrytgarcia has quit [Read error: Connection reset by peer]
jerrytgarcia has joined #ruby-lang
ykk has quit [Ping timeout: 252 seconds]
fire has joined #ruby-lang
Wardrop has quit [Ping timeout: 256 seconds]
wardrop_ is now known as wardrop
Wardrop_ has joined #ruby-lang
noop has joined #ruby-lang
glebm has joined #ruby-lang
noop has quit [Read error: Connection reset by peer]
skade has joined #ruby-lang
thebastl has joined #ruby-lang
zorbyte has joined #ruby-lang
<yorickpeterse> morning
<seoaqua> yorickpeterse, the globe is round, dude, good evening
<dbussink> seoaqua: round like a pancake
<seoaqua> dbussink, you win
<seoaqua> yorickpeterse, so geek
<chekcmate> it acutally makes sense
<chekcmate> we had this conversation about timezones not only once
huydx has quit [Quit: huydx]
mercwithamouth has quit [Ping timeout: 245 seconds]
Domon has joined #ruby-lang
idkazuma has joined #ruby-lang
ykk has joined #ruby-lang
noop has joined #ruby-lang
runeb has joined #ruby-lang
beiter has quit [Quit: beiter]
noop has quit [Ping timeout: 252 seconds]
runeb has quit [Remote host closed the connection]
concernedcitizen has quit [Remote host closed the connection]
jerrytgarcia has quit [Quit: Linkinus - http://linkinus.com]
ykk has quit [Ping timeout: 256 seconds]
<chekcmate> gosh
<chekcmate> people pissing themselves about 32 cents
<yorickpeterse> only 32 cents?
<chekcmate> a friend to be precise
<chekcmate> he often forgets that I don't ask for certain amounts he eventuallyl consumes at my appartment or whereever
<chekcmate> which I pay
<chekcmate> but complaining about getting 32 cents too less
<chekcmate> i could rip his skull open and shit in his head
<chekcmate> those things make me angry
kgrz has quit [Ping timeout: 252 seconds]
<yorickpeterse> send him a bill
<chekcmate> pff... it's something about being friends too
<chekcmate> about not being the bitch
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
toretore has joined #ruby-lang
<yorickpeterse> well clearly it's an issue
<ggreer> sounds like a healthy relationship
<tbuehlmann> incident management, go!
<chekcmate> friendship stops when it comes to money
AndChat| has joined #ruby-lang
<chekcmate> but stopping at 32 cents?
<chekcmate> that's just miserable
<chekcmate> sad and miserable
<ggreer> yeah I've been friendly about wayyy more money than that. like when one of my friends wanted to go on a wine tour in south america
<yorickpeterse> chekcmate: then what exactly is your problem?
<apeiros_> chekcmate: give him a dollar and forget about it
<chekcmate> it's principles!
<chekcmate> i dont give a fuck about 32 cents and that's what he should do too
<chekcmate> 32 cents are wasted when I buy beer and don't ask for money
Banistergalaxy has quit [Ping timeout: 248 seconds]
<yorickpeterse> oh wait, you owe him 32 cents? I thought it was the other way around
<chekcmate> no, I OWE him
<apeiros_> yeah, so no value in getting all worked up about it. over-return just to show, and forget it.
<chekcmate> now come on... then I'd call myself greatest bitch on earth
noop has joined #ruby-lang
<chekcmate> I asked if he wanted 32 punches in the face the next time I see him... no answer on that yet...
<chekcmate> I always get worked up on those things
<chekcmate> it's so little
<chekcmate> but fucks things up big time
<yorickpeterse> chekcmate: get 32 cents in 1 cent coins
<yorickpeterse> then throw it at him while yelling "HERE PEASANT"
<chekcmate> hahaha
<yorickpeterse> "GO FEIST ON MY MONEY"
<lianj> if the 32 were for drugs it is serious
<chekcmate> nope, I give away enough drugs for free
<chekcmate> so that does not count
<chekcmate> the thing is that friendship is about giving and taking
klebervirgilio has joined #ruby-lang
<chekcmate> and he obviously thinks he is the only one giving
<chekcmate> which is absoluetly not true
<chekcmate> but well,... fuck it
<chekcmate> dont wanna make bad mood here
<chekcmate> spam
<chekcmate> it
<chekcmate> away
<chekcmate> I encountered a nasty bot yesterday
<yorickpeterse> Go take a run for a few minutes already
<chekcmate> which was funny, when you sent anything including "spam" in it, the bot would state he was vegetarian haha
<chekcmate> yorickpeterse: good idea.. going for a smoke
<lianj> take a run -> going for a smoke
<lianj> close enough
lun_ has quit [Ping timeout: 252 seconds]
<whitequark> hm
<whitequark> has anyone encountered a sanitizer for rack which strips out all invalid utf-8?
atrocitas has quit [Remote host closed the connection]
<whitequark> postgres really doesn't like it when I attempt to insert that filthy stuff in it
klebervirgilio has quit [Read error: Operation timed out]
vlad_starkov has joined #ruby-lang
<dbussink> whitequark: i've always found it to be a bug in the uploaded data, ended up doing character encoding detection and then converting when necessary
<dbussink> whitequark: with uploaded csv files etc.
<whitequark> dbussink: it is indeed a bug in data
<whitequark> some weird bots, and weird IE-using people send invalid requests which eventually result in 500's
sush24 has quit [Read error: Connection reset by peer]
<whitequark> what I want is to just strip invalid characters / change them to U+FFFD
musl has quit [Ping timeout: 255 seconds]
<whitequark> eg Opera 9 for some reason sends a strange character in useragent, which explodes when I log it in DB
sush24 has joined #ruby-lang
<whitequark> as ruby lazily verifies utf-8 validity and postgres does that on INSERT
<lianj> ha
<dbussink> whitequark: ah, right, i only had the cases with for example the csv uploads, where we had to properly convert it anyway
<dbussink> no generic "ignore all"
klebervirgilio has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
<whitequark> dbussink: found this: https://gist.github.com/pithyless/3639014
<judofyr> whitequark: can't you use encode! with the :replace option?
ykk has joined #ruby-lang
<whitequark> dbussink: do you think it's any good? there is some nontrivial logic in that middleware
<whitequark> I don't know Encoding that well
<dbussink> whitequark: dunno how it would handle mime uploads? i think that should be safe, dunno for sure
<whitequark> dbussink: well it doesn't touch the body
<whitequark> I'm not sure about L38-L43
<dbussink> whitequark: you don't have issues with the body?
<whitequark> dbussink: nope, just URI and headers
<whitequark> I should note that our websites don't really handle POST requests, which simplifies things
<dbussink> ah ok
<whitequark> (or anything except GET, for that matter.)
<dbussink> well, ruby encodings is such a tricky thing that i've found experimenting to be often the only resort :(
<whitequark> dbussink: I don't quite understand if checking for valid_encoding? *and* rescuing EncodingError is the right way to go
<whitequark> seems like defensive programming
<whitequark> dbussink: oh ok :/
jayne has quit [Ping timeout: 612 seconds]
<whitequark> maybe I should make a gem
<whitequark> "utf8_or_gtfo"
musl has joined #ruby-lang
Spaceghost|cloud has quit [Ping timeout: 255 seconds]
<rue|w> GTF8
<whitequark> rue|w: haha that's excellent
ykk has quit [Ping timeout: 252 seconds]
musl has quit [Ping timeout: 255 seconds]
brianpWins has quit [Quit: brianpWins]
Spaceghost|cloud has joined #ruby-lang
dzhulk has joined #ruby-lang
dzhulk has quit [Client Quit]
cultureulterior_ has joined #ruby-lang
datanoise has joined #ruby-lang
<yorickpeterse> BOOM, OPEN SORES
<yorickpeterse> A commit that adds 1 character and replaces 1
<yorickpeterse> and it fixes a bug, fuckyeah
<judofyr> yorickpeterse: how long time did you spend debugging it?
<yorickpeterse> 2 seconds
<yorickpeterse> or so, didn't benchmark it
<yorickpeterse> well, I added 2 characters
<judofyr> dbussink: I've found that encodings in 1.9 just make it more explicit. in 1.8 you just got invalid data in your database…
<judofyr> whitequark: the rescue EncodingError is for the encoding 1250
<dbussink> judofyr: i don't mind the explicitness, i do mind the adhoc implementation, where in certain cases you do get exceptions / errors and in others not (while they are seemingly the same)
<dbussink> judofyr: and postgres rejecting invalid utf-8 has saved my ass a few times :)
<judofyr> dbussink: examples? I haven't had much problems with it (other than libraries not tagging strings correctly)
<dbussink> even with 1.8.x apps
<dbussink> judofyr: behavior like this for example: https://github.com/rubinius/rubinius/issues/2163
<soahccc> When I need a Hash like construct but with own handling should I subclass hash or include something like enumerable?
<dbussink> soahccc: composition over inheritance :)
datanoise has quit [Ping timeout: 256 seconds]
<soahccc> okay clear enough :)
glebm has quit [Ping timeout: 252 seconds]
musl has joined #ruby-lang
kgrz has joined #ruby-lang
huydx has joined #ruby-lang
<yorickpeterse> whitequark: clearly what you need to do is use a very bad pun/innuendo in your name
<yorickpeterse> e.g. rack-utf8-balls
<yorickpeterse> Apparently that's acceptable these days so it seems
ykk has joined #ruby-lang
huydx has quit [Client Quit]
Domon has quit [Remote host closed the connection]
beho_ has joined #ruby-lang
beho has quit [Ping timeout: 260 seconds]
jerrytgarcia has joined #ruby-lang
<whitequark> yorickpeterse: rack-utf8_sanitizer actually
<yorickpeterse> there's no innuendo in that
<whitequark> yea
<whitequark> I'm not into that
<yorickpeterse> In case I wasn't already super clear: I'm trying to be "funny"
<yorickpeterse> (I'm usually not very good at it)
<whitequark> yorickpeterse: I've read your comment and all
<yorickpeterse> heh, figured
bzalasky has quit [Remote host closed the connection]
ykk has quit [Ping timeout: 245 seconds]
jerrytgarcia has quit [Read error: Connection reset by peer]
jerrytgarcia has joined #ruby-lang
beho_ has quit [Remote host closed the connection]
KU0N has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
* whitequark just used # encoding:ascii-8bit
<judofyr> whitequark: isn't that the default in 1.9.3?
<whitequark> judofyr: but not in 2.0
realDAB has joined #ruby-lang
glebm has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
robbyoconnor has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby-lang
nkr has joined #ruby-lang
gregmoreno has joined #ruby-lang
Xzyx987X has quit [Ping timeout: 256 seconds]
robbyoconnor has quit [Ping timeout: 264 seconds]
jbsan has quit [Quit: jbsan]
gregmoreno has quit [Ping timeout: 256 seconds]
Xzyx987X has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
<whitequark> hm
<whitequark> dbussink: [6] pry(main)> "foo\xe0".encode('UTF-8', undef: :replace, invalid: :replace)
<whitequark> => "foo\xE0"
<whitequark> if the string is already in UTF-8, for some reason encode doesn't clean it up
<whitequark> or am I doing it wrong?
socialcoder has joined #ruby-lang
socialcoder has left #ruby-lang [#ruby-lang]
sn0wb1rd has quit [Quit: sn0wb1rd]
<charliesome> whitequark: it might just no-op if you're encoding to the same as the source encoding
ykk has joined #ruby-lang
bob_ has joined #ruby-lang
bob_ has left #ruby-lang [#ruby-lang]
rubybob has joined #ruby-lang
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<whitequark> charliesome: seems so
<rubybob> hey
<rubybob> i have a problem with the returnvalues/types of sqlite executes
<rubybob> it looks like sometimes i get an array and sometimes its and array in an array
rue_XIV has joined #ruby-lang
JohnBat26 has quit [Ping timeout: 276 seconds]
<rubybob> could someone give me a hint how to handle that?
rue has quit [Ping timeout: 256 seconds]
ykk has quit [Ping timeout: 255 seconds]
beho has joined #ruby-lang
jxie has quit [Quit: leaving]
realDAB has quit [Ping timeout: 256 seconds]
krz has quit [Quit: krz]
<yorickpeterse> rubybob: start by posting some code in a pastebin along with some example data
robbyoconnor has quit [Ping timeout: 245 seconds]
kgrz has quit [Quit: Computer has gone to sleep.]
<whitequark> awesome, wrote it
<whitequark> dbussink: could you take a quick peek at the code? just in case I missed something glaringly obvious
<dbussink> whitequark: no issue glaring me in the face directly :p
<whitequark> dbussink: thanks. releasing 1.0.0 then!
<dbussink> whitequark: haha, i hope i'm not instilling this confidence :p
workmad3 has joined #ruby-lang
ykk has joined #ruby-lang
MehLaptop has joined #ruby-lang
carloslopes has joined #ruby-lang
mercwithamouth has joined #ruby-lang
<judofyr> whitequark++
vlad_starkov has joined #ruby-lang
ykk has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 276 seconds]
ykk has joined #ruby-lang
datanoise has joined #ruby-lang
MehLaptop has quit [Remote host closed the connection]
DEac-_ has quit [Ping timeout: 260 seconds]
dhruvasagar has quit [Ping timeout: 255 seconds]
dhruvasagar has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 256 seconds]
dustint has joined #ruby-lang
DEac- has joined #ruby-lang
justinmcp has joined #ruby-lang
santosh has joined #ruby-lang
seoaqua has quit [Quit: 离开]
<santosh> What is name of the ruby on rails channel?
dhruvasagar has quit [Ping timeout: 264 seconds]
<santosh> #rails or #rubyonrails or any another?
vlad_starkov has quit [Remote host closed the connection]
santosh has left #ruby-lang [#ruby-lang]
vlad_starkov has joined #ruby-lang
sebasoga has joined #ruby-lang
<judofyr> soahccc: #rubyonrails I think
<oddmunds> he left :(
vlad_starkov has quit [Remote host closed the connection]
<judofyr> oops
<judofyr> autocomplete fail
vlad_starkov has joined #ruby-lang
sebasoga has quit [Ping timeout: 252 seconds]
krz has joined #ruby-lang
sebasoga has joined #ruby-lang
dblack_ has joined #ruby-lang
dblack__ has joined #ruby-lang
sebasoga has quit [Read error: Connection reset by peer]
dblack_ has left #ruby-lang [#ruby-lang]
dblack__ has left #ruby-lang [#ruby-lang]
sebasoga has joined #ruby-lang
nertzy has joined #ruby-lang
rsl has joined #ruby-lang
idkazuma has joined #ruby-lang
apeiros_ has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
S1kx has joined #ruby-lang
S1kx has joined #ruby-lang
rippa has joined #ruby-lang
mytrile has joined #ruby-lang
soypirate has quit [Quit: Leaving]
<yorickpeterse> Fucking Rails, if I press ^C I expect you to fucking stop running
<oddmunds> what does rails expect you to expect?
<yorickpeterse> I expect it to work like pretty much everything else: quit
<oddmunds> yeah, i meant, what happens then you ^C rails?
<yorickpeterse> It says "Stopping..." and then just sits there like a fat fuck doing nothing
<gnufied> it is webrick
<yorickpeterse> Takes about 10-20 seconds for it to actually shut down, even when it's idling
<yorickpeterse> gnufied: plot twist: I use Thin
<gnufied> alright then, it is the app server, not rails which causes that
<gnufied> :-)
<yorickpeterse> bullshit, that would imply it does that for every other Thin based app as well
<yorickpeterse> there's probably some shutdown handler being a slow cunt
djwonk has quit []
Asher has quit [Quit: Leaving.]
skade has quit [Quit: Textual IRC Client: www.textualapp.com]
Asher has joined #ruby-lang
sush24_ has joined #ruby-lang
sush24 has quit [Ping timeout: 245 seconds]
idkazuma has quit [Remote host closed the connection]
<gnufied> I will be surprised, but afaik rails does not install a shutdown handler.
<gnufied> there are handlers in webrick & thin
<gnufied> rails delegates to rack handler
<gnufied> which in turn calls thin or webrick or whatever app server you are using
dzhulk has joined #ruby-lang
<gnufied> thin shutdown handler, closes all open active connections rather than abruptly killing the process
vlad_starkov has quit [Ping timeout: 264 seconds]
lele has quit [Quit: Coyote finally caught me]
kevinfagan has quit [Quit: Leaving...]
thebastl has quit [Read error: Operation timed out]
chekcmate has quit [Ping timeout: 245 seconds]
jondot has joined #ruby-lang
herpless_ is now known as herpless
rippa has quit [Ping timeout: 240 seconds]
sailias has joined #ruby-lang
justinmcp has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
sandbags1138 has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
iamjarvo has joined #ruby-lang
benlovell has joined #ruby-lang
plusk has joined #ruby-lang
soypirate has joined #ruby-lang
idkazuma has joined #ruby-lang
kevinfagan has joined #ruby-lang
soypirate has quit [Read error: Connection reset by peer]
tomzx_mac has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 264 seconds]
srbaker has joined #ruby-lang
anonymuse has joined #ruby-lang
dorei has joined #ruby-lang
wmoxam has joined #ruby-lang
ioga_wrk has quit [Read error: Operation timed out]
imperator has joined #ruby-lang
ioga_wrk has joined #ruby-lang
gustavnils has joined #ruby-lang
Squarepy has joined #ruby-lang
outoftime has joined #ruby-lang
adam12 has quit [Ping timeout: 240 seconds]
adam12 has joined #ruby-lang
slyphon has quit [Quit: slyphon]
jonahR has joined #ruby-lang
fire has quit [Quit: WeeChat 0.4.0]
lun_ has joined #ruby-lang
srbaker has quit [Quit: Computer has gone to sleep.]
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby-lang
beiter has joined #ruby-lang
breakingthings has joined #ruby-lang
vlad_starkov has joined #ruby-lang
MrZYX has joined #ruby-lang
nibbo has quit [Ping timeout: 260 seconds]
nibbo has joined #ruby-lang
lun_ has quit [Remote host closed the connection]
rue|w has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
slyphon has joined #ruby-lang
sebasoga has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Remote host closed the connection]
slyphon_ has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 276 seconds]
Squarepy has quit [Changing host]
Squarepy has joined #ruby-lang
slyphon has quit [Ping timeout: 250 seconds]
slyphon_ is now known as slyphon
tylersmith has joined #ruby-lang
__Big0__ has joined #ruby-lang
SquadronROE has joined #ruby-lang
davidbalber|away is now known as davidbalbert
noop has quit [Remote host closed the connection]
agnitio has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
methods has joined #ruby-lang
volume has joined #ruby-lang
methods has left #ruby-lang [#ruby-lang]
jxie has joined #ruby-lang
sebasoga has joined #ruby-lang
enebo has joined #ruby-lang
jerrytgarcia has quit [Read error: Connection reset by peer]
jerrytgarcia has joined #ruby-lang
io_syl has joined #ruby-lang
jondot has quit [Ping timeout: 256 seconds]
rippa has joined #ruby-lang
SquadronROE has left #ruby-lang [#ruby-lang]
DingusGrunty has joined #ruby-lang
io_syl has quit [Client Quit]
slyphon has quit [Ping timeout: 240 seconds]
fire has joined #ruby-lang
<DingusGrunty> Is there a way to hide the channel join/quit notifications?
<injekt> DingusGrunty: probably
rubybob has quit [Quit: Page closed]
<badeball> DingusGrunty: most decent clients can do that for you.
<certainty> but in many channels that's the only messages you see for some time xD
<DingusGrunty> ha, yeah. I'm using webchat so... maybe. I'll dig around.
<DingusGrunty> ah ha
<DingusGrunty> there we go.
<badeball> certainty: decent client will let you specify which channels to hide notifications in ;)
<certainty> badeball: yeah, i have that setup for my irssi
<badeball> me too. no way I'm reading through joins and quits here and in #rails.
beho_ has joined #ruby-lang
pepper_chico has quit [Quit: Computer has gone to sleep.]
beho has quit [Ping timeout: 240 seconds]
dzhulk has quit [Quit: Leaving.]
ykk has quit [Remote host closed the connection]
fire is now known as nerd
drumond19 has joined #ruby-lang
sush24_ has quit [Quit: This computer has gone to sleep]
plusk has quit [Quit: plusk]
tonni has quit [Remote host closed the connection]
soypirate has joined #ruby-lang
ykk has joined #ruby-lang
gregmoreno has joined #ruby-lang
wyhaines has joined #ruby-lang
zmack has quit [Remote host closed the connection]
fn_ has joined #ruby-lang
tbuehlmann has joined #ruby-lang
rue|w has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
lbb has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
gnufied has quit [Quit: Leaving.]
zmike123 has joined #ruby-lang
hapster has joined #ruby-lang
rue|w has quit [Ping timeout: 240 seconds]
kristofferrr has joined #ruby-lang
sush24 has joined #ruby-lang
dhruvasagar has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
|Vargas| has quit [Quit: ...]
krohrbaugh has quit [Quit: Leaving.]
fn_ has quit [Remote host closed the connection]
joevandyk has joined #ruby-lang
vlad_starkov has joined #ruby-lang
lbb has quit [Remote host closed the connection]
tonni has joined #ruby-lang
fire has joined #ruby-lang
nerd has quit [Ping timeout: 256 seconds]
benlovell has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Ping timeout: 255 seconds]
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
judofyr has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 276 seconds]
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
nertzy has quit [Ping timeout: 248 seconds]
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
carloslopes has joined #ruby-lang
pepper_chico has joined #ruby-lang
wallerdev has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
Stilo has joined #ruby-lang
idkazuma has joined #ruby-lang
apeiros_ has joined #ruby-lang
gnufied has joined #ruby-lang
beho_ has quit [Remote host closed the connection]
<injekt> drbrain: when you have time could you review the last show-stoppers on mechanize, looks like we're almost ready for a release once they're figured out
madish has joined #ruby-lang
ykk has quit [Remote host closed the connection]
plusk has joined #ruby-lang
joevandyk has quit [Quit: joevandyk]
glebm has quit [Quit: Computer has gone to sleep.]
shiningblue has joined #ruby-lang
pepper_chico has quit [Quit: Computer has gone to sleep.]
sailias has quit [Ping timeout: 255 seconds]
joevandyk has joined #ruby-lang
shiningblue has quit [Client Quit]
krohrbaugh has joined #ruby-lang
ryez has quit [Ping timeout: 245 seconds]
nXqd has quit [Ping timeout: 252 seconds]
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
idkazuma has quit [Remote host closed the connection]
Mon_Ouie has quit [Quit: WeeChat 0.4.0]
pepper_chico has joined #ruby-lang
solars has quit [Ping timeout: 245 seconds]
nXqd has joined #ruby-lang
sepp2k1 has joined #ruby-lang
sepp2k has quit [Ping timeout: 248 seconds]
glebm has joined #ruby-lang
pepper_chico has quit [Quit: Computer has gone to sleep.]
amerine has joined #ruby-lang
jerrytgarcia has quit [Read error: Connection reset by peer]
jerrytgarcia has joined #ruby-lang
sailias has joined #ruby-lang
tonni has quit [Read error: Connection reset by peer]
jonahR has quit [Quit: jonahR]
gnufied has quit [Quit: Leaving.]
aedorn has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
tdy_ has quit [Ping timeout: 255 seconds]
<mehwork> is there a way to assign to non-existing class variables? e.g., class Foo; end f=Foo.new ; f.bar=5
<mehwork> right now, that would say 'undefined method bar='
fn_ has joined #ruby-lang
<apeiros_> mehwork: you're probably looking for method_missing
<apeiros_> see Object#method_missing
<apeiros_> the whole thing is quite unrelated to class variables, though (@@cvars are class variables, they're usually to be avoided)
<mehwork> thanks
beho has joined #ruby-lang
klebervirgilio has quit [Remote host closed the connection]
jacktrick has joined #ruby-lang
jacktrick has quit [Client Quit]
benlovell has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
krohrbaugh has joined #ruby-lang
skade has joined #ruby-lang
tdy_ has joined #ruby-lang
agnitio has quit [Read error: Operation timed out]
fn_ has quit [Remote host closed the connection]
sn0wb1rd has joined #ruby-lang
tylersmith has quit [Quit: tylersmith]
dblack_ has joined #ruby-lang
pkrnj has joined #ruby-lang
tylersmith has joined #ruby-lang
scampbell has joined #ruby-lang
sebastiansier has joined #ruby-lang
sepp2k1 has quit [Remote host closed the connection]
maxmanders has quit [Quit: Computer has gone to sleep.]
mrsolo has joined #ruby-lang
io_syl has joined #ruby-lang
beiter has quit [Quit: beiter]
sn0wb1rd has quit [Quit: sn0wb1rd]
bantic has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
lele has joined #ruby-lang
Mon_Ouie has quit [Read error: Connection reset by peer]
pepper_chico has joined #ruby-lang
kevinfagan has quit [Quit: Leaving...]
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
MaddinXx_ has joined #ruby-lang
pepper_chico has joined #ruby-lang
retro|cz has quit [Ping timeout: 248 seconds]
breakingthings has quit []
Mon_Ouie has joined #ruby-lang
workmad3 has quit [Ping timeout: 252 seconds]
dhruvasagar has joined #ruby-lang
torrieri has joined #ruby-lang
havenwood has joined #ruby-lang
sebastia_ has joined #ruby-lang
benlovell has quit [Quit: Zzz]
krohrbaugh has quit [Read error: Connection reset by peer]
krohrbaugh has joined #ruby-lang
jerrytgarcia has quit [Quit: Linkinus - http://linkinus.com]
sebastiansier has quit [Ping timeout: 255 seconds]
thone_ has joined #ruby-lang
pr0ton has joined #ruby-lang
jonahR has joined #ruby-lang
creese has joined #ruby-lang
thone has quit [Ping timeout: 264 seconds]
<creese> Does ruby-build install rubygems by default?
<manveru> rubygems is part of ruby, so yeah?
pepper_chico has quit [Quit: Computer has gone to sleep.]
klebervirgilio has joined #ruby-lang
<havenwood> creese: The latest stable release or Ruby (2.0.0) comes with RubyGems 2.0.0.
<manveru> only some insane distros label things without rubygems "ruby"
<creese> thanks
fire has quit [Quit: WeeChat 0.4.0]
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
io_syl has quit [Quit: Computer has gone to sleep.]
<havenwood> s/or/of
beho has quit [Remote host closed the connection]
zmike123 has quit [Quit: Выходжу]
kevinfagan has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
sush24 has quit [Quit: This computer has gone to sleep]
agnitio has joined #ruby-lang
nertzy has joined #ruby-lang
krohrbaugh has joined #ruby-lang
skade has quit [Quit: Computer has gone to sleep.]
skade has joined #ruby-lang
tbuehlmann is now known as tovias
krohrbaugh1 has joined #ruby-lang
krohrbaugh has quit [Read error: Connection reset by peer]
tbuehlmann has joined #ruby-lang
slyphon has joined #ruby-lang
skade has quit [Client Quit]
bantic has quit [Quit: bantic]
Stilo has joined #ruby-lang
fire has joined #ruby-lang
fire has quit [Client Quit]
kevinfagan has quit [Quit: Leaving...]
MaddinXx_ has quit [Remote host closed the connection]
io_syl has joined #ruby-lang
outoftime has quit [Ping timeout: 264 seconds]
carloslopes has joined #ruby-lang
outoftime has joined #ruby-lang
hapster has quit [Remote host closed the connection]
torrieri has quit [Quit: Leaving...]
DingusGrunty has quit [Quit: Page closed]
benlovell has joined #ruby-lang
torrieri has joined #ruby-lang
justinram has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
brianpWins has joined #ruby-lang
<cschneid> what does Array#=~ do? I don't see it in the docs. .method(:=~) tells me its on kernel, but I don't see it there either.
<cschneid> ahh, it's on object. Why is it a noop on object.
<cschneid> that's silly
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<apeiros_> cschneid: by default it just returns nil
<apeiros_> no, that's not silly
<apeiros_> it allows you to call =~ without second guessing
<cschneid> secondary question then: is there a good comparison operator for "sorta equal". In my case, I want [1,2,3] <op> [2,3,1] to be true
<apeiros_> nothing out of the box
pr0ton has quit [Quit: pr0ton]
<cschneid> right. which is why I was looking at Array#=~, which already means 'sorta equal' or 'matches', but I worried about overwriting it
maxmanders has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<havenwood> cschneid: [1,2,3].all? { |e| [2,3,1].include? e }
pepper_chico has joined #ruby-lang
<havenwood> Or sort-then-compare, or Set?
<cschneid> havenwood: ohh yeah, we have an implementation of it, just want to get rid of the method with a monkey patch on Array to be cleaner
<havenwood> cschneid: Gotcha.
<apeiros_> havenwood: bad implementation :-p
<cschneid> tsou: yes, I'm aware of set as well. Set.new(a1) == Set.new(a2) is an option but I'd rather do `a1 <op> a2` to make the code that calls it clearer
<apeiros_> havenwood: also, depending on what cschneid wants, wrong
<apeiros_> cschneid: https://gist.github.com/apeiros/f34b3a1f61f37670786d my implementation of unordered-equal
<havenwood> apeiros_: I dunno what he wants! Just a guess. :P
<cschneid> nah, that'd return the right value I believe.
<apeiros_> using sets is a good idea too
<cschneid> "exact same members, but possibly shuffled"
<apeiros_> see, then it's wrong
<cschneid> ahh, sure enough
<apeiros_> [1,1,1,2,3].all? { |e| [2,3,1].include? e }
pr0ton has joined #ruby-lang
<apeiros_> true
<havenwood> cschneid: Is there a possibility of dup elements?
<cschneid> ohh, interesting, so would any sort of boolean ops on it `&` and such.
<tsou> cschneid: so what would [2,2] <op> [2] be?
<cschneid> false in my world.
jigfox has joined #ruby-lang
<cschneid> but that's just a detail of what I need.
<tsou> cschneid: then what you need is a multiset :)
<cschneid> good call, a set impl wouldn't work either with that requirement.
<apeiros_> Set.new(a1) == Set.new(a2) # won't care about number of occurrences either
<apeiros_> the implementation I linked does
<apeiros_> it simply uses a counting hash
<apeiros_> line 4-8 are the relevant ones
<cschneid> so back to operators. Is =~ a reasonable thing to override? Will that screw stuff up that expects it to something else?
<cschneid> I want a looser == basicaly
<apeiros_> you should not override methods on core classes
<apeiros_> if you use ruby2, you might use a refinement
retro|cz has joined #ruby-lang
<cschneid> so I should give up on trying to make it cleaner, and just go with unordered_compare(a1, a2) and move on?
<tsou> cschneid: why not define a new operator instead of overriding this one?
<apeiros_> I'd define it as Enumerable#unordered_equal?
agnitio has quit [Read error: Connection reset by peer]
<cschneid> tsou: ruby can't do that afaik? You're limited to what operators exist
<havenwood> cschneid: class Array; def same_as other; self.sort == other.sort end end
<apeiros_> which allows you to do: a1.unordered_equal?(a2)
<havenwood> cschneid: [1,2,3].same_as [3,2,1,1]; #=> false
<cschneid> apeiros_: yeah, I'll do that, biggest thing is to get the generic function out of this class. Thanks for helping me talk though this.
<tsou> havenwood: that would impose a great overhead of sorting..
<havenwood> tsou: Yup.
vlad_starkov has joined #ruby-lang
<havenwood> tsou: Just meant to show adding a new method via monkey patching rather than overriding core method.
<cschneid> am I right that you can't invent new operators?
<cschneid> (other than the silly stacking trick of unary ops)
<havenwood> cschneid: You can invent new methods.
<havenwood> cschneid: === is a method
<apeiros_> === is an existing method which shouldn't be overridden either (on core classes) ;-)
rue|w has joined #ruby-lang
cored has quit [Ping timeout: 248 seconds]
<cschneid> right, new operators give compile errors. === is magic (along with =~, and all the others). Gotta follow method naming rules otherwise
<apeiros_> there is superators, but why? a named method is just fine IMO
rue|w has quit [Read error: Connection reset by peer]
<havenwood> apeiros_: I said that badly, I didn't mean to override threequals!
<apeiros_> cschneid: nah, google for "ruby superators"
<apeiros_> but personally, I don't like that
rue|w has joined #ruby-lang
<cschneid> well, that scares me. :) I'm certainly going to just add the method to enumerable, just was verifying you couldn't easily make up new "operator" methods
<cschneid> ahh, yeah, it's the silly unary stacking trick there.
<apeiros_> I think it's cool. but nothing for serious.
cored has joined #ruby-lang
<cschneid> agreed, it's cool, but I wouldn't use it in a real project
<cschneid> thanks for the help guys
heftig has quit [Ping timeout: 245 seconds]
<tsou> what's wrong with it?
MaddinXx has joined #ruby-lang
rue|w has quit [Ping timeout: 260 seconds]
torrieri has quit [Quit: Leaving...]
cultureulterior_ has quit [Quit: cultureulterior_]
torrieri has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
slyphon has quit [Quit: slyphon]
MartynKe- has joined #ruby-lang
bantic has joined #ruby-lang
slyphon has joined #ruby-lang
joevandyk has quit [Quit: joevandyk]
volume has quit [Quit: Textual IRC Client: www.textualapp.com]
pepper_chico has quit [Quit: Computer has gone to sleep.]
outoftime has quit [Ping timeout: 252 seconds]
outoftime has joined #ruby-lang
benlovell has quit [Quit: Zzz]
workmad3 has joined #ruby-lang
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby-lang
bluepojo has joined #ruby-lang
dankest has joined #ruby-lang
Rubennn has quit [Ping timeout: 276 seconds]
krohrbaugh has joined #ruby-lang
lsegal has joined #ruby-lang
krohrbaugh1 has quit [Ping timeout: 240 seconds]
davidbalbert is now known as davidbalber|away
Cicloid has quit [Remote host closed the connection]
sebastia_ has quit [Remote host closed the connection]
zmack has joined #ruby-lang
tovias has quit [Remote host closed the connection]
sebastiansier has joined #ruby-lang
mercwithamouth has joined #ruby-lang
workmad3 has quit [Read error: Operation timed out]
benlovell has joined #ruby-lang
slyphon has quit [Quit: slyphon]
davidbalber|away is now known as davidbalbert
pepper_chico has quit [Quit: Computer has gone to sleep.]
krohrbaugh has quit [Quit: Leaving.]
davidbalbert is now known as davidbalber|away
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
slyphon has joined #ruby-lang
pepper_chico has joined #ruby-lang
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby-lang
bryanl has quit [Ping timeout: 240 seconds]
Rubennn has joined #ruby-lang
Squarepy has quit [Read error: Connection reset by peer]
pepper_chico has quit [Quit: Computer has gone to sleep.]
havenwood has quit [Ping timeout: 245 seconds]
jondot has joined #ruby-lang
bantic has quit [Quit: bantic]
rue|w has joined #ruby-lang
bantic has joined #ruby-lang
bluepojo has quit [Remote host closed the connection]
bluepojo has joined #ruby-lang
benanne has joined #ruby-lang
pr0ton has quit [Ping timeout: 256 seconds]
__butch__ has joined #ruby-lang
sebastiansier has quit [Remote host closed the connection]
zmack has quit [Remote host closed the connection]
rue|w has quit [Ping timeout: 255 seconds]
dhruvasagar has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby-lang
krohrbaugh has joined #ruby-lang
bluepojo has quit [Ping timeout: 240 seconds]
bryanl has joined #ruby-lang
tonni has joined #ruby-lang
dustint has quit [Remote host closed the connection]
caen23 has joined #ruby-lang
MaddinXx has quit [Remote host closed the connection]
Nisstyre-laptop has quit [Quit: Leaving]
MaddinXx has joined #ruby-lang
MaddinXx has quit [Read error: Connection reset by peer]
MaddinXx has joined #ruby-lang
bantic has quit [Quit: bantic]
cirenyc has joined #ruby-lang
ryanf has joined #ruby-lang
dustint has joined #ruby-lang
bantic has joined #ruby-lang
MaddinXx has quit [Remote host closed the connection]
Nisstyre-laptop has joined #ruby-lang
MaddinXx_ has joined #ruby-lang
bantic has quit [Client Quit]
torrieri has quit [Quit: Leaving...]
intellitech has quit [Quit: intellitech]
slyphon_ has joined #ruby-lang
swav_ has joined #ruby-lang
torrieri has joined #ruby-lang
swav has quit [Ping timeout: 276 seconds]
slyphon has quit [Ping timeout: 260 seconds]
slyphon_ is now known as slyphon
benlovell has quit [Quit: Zzz]
MaddinXx_ has quit [Read error: Connection reset by peer]
bluepojo has joined #ruby-lang
MaddinX__ has joined #ruby-lang
El_loco has joined #ruby-lang
justinseiter has joined #ruby-lang
mistym has quit [Remote host closed the connection]
davidbalber|away is now known as davidbalbert
<whitequark> rails' find_each does not do that enum_for trick. bleah :/
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<whitequark> dominikh: ping
drumond19 has quit [Remote host closed the connection]
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
heftig has joined #ruby-lang
workmad3 has quit [Ping timeout: 245 seconds]
<yorickpeterse> whitequark: ping (pong imminent)
drumond1_ has joined #ruby-lang
jonahR has quit [Quit: jonahR]
nXqd has quit [Remote host closed the connection]
<whitequark> yorickpeterse: pong
drumond1_ has quit [Remote host closed the connection]
<yorickpeterse> So I've bumped into an issue with building my instruction set: statements and conditions. In particular if/elsif/else statements are tricky [...]
* whitequark sighs
<yorickpeterse> I'm trying to not end up making a single dimensional AST (one that's basically a multi dimensional one in disguise) but I end up getting overly verbose instructions
<yorickpeterse> For example:
rippa has quit [Ping timeout: 240 seconds]
<yorickpeterse> http://pastie.org/6396649 I haven't actually implemented this yet, but I've been banging my head against a wall for 3 days now because I can't really seem to figure out what a nice way for it would be
<yorickpeterse> The Rbx bytecode isn't very helpful either sadly (it has been before this problem)
pepper_chico has joined #ruby-lang
<yorickpeterse> Any suggestions?
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby-lang
xalei has joined #ruby-lang
mercwithamouth has quit [Ping timeout: 245 seconds]
El_loco has quit [Remote host closed the connection]
Mon_Ouie has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby-lang
<yorickpeterse> hmmm...maybe I've found something
<whitequark> yorickpeterse: mm
* whitequark reads
<whitequark> yorickpeterse: you obviously have no idea what a bytecode *is*
<whitequark> why is there even elsif? you only need three things
<whitequark> a label, an unconditional jump and a conditional jump
<whitequark> btw `and` desugars to a conditional
<yorickpeterse> heh, that's literally just what I wrote down
<whitequark> well, that's how it works
<yorickpeterse> lemme pastie it
<whitequark> yorickpeterse: no `and'
<whitequark> also label isn't really an instruction
<whitequark> it's an index into an array of instructions
<yorickpeterse> What would be used instead of `and` then? Something like `instruction(:conditional, 'and')`?
plusk has quit [Quit: plusk]
<whitequark> yorickpeterse: a short-circuiting `and` is just a syntactic sugar for a conditional and a temporary variable
krz has quit [Quit: krz]
<whitequark> or a stack slot
jonahR has joined #ruby-lang
<yorickpeterse> stack slot?
tbuehlmann has quit [Read error: Connection reset by peer]
<whitequark> push some_local_var; iftrue 1; push :foo; goto 2; 1: push :bar; 2: send :p, 1
<whitequark> p some_local_var && :foo || :bar
<yorickpeterse> hmm
<whitequark> yorickpeterse: could you please read the LLVM tutorial?
<yorickpeterse> Which particular one?
<whitequark> that would really speed up your development process by sparing you from inventing all sorts of well-known stuff all over again
<whitequark> kaleidoscope
apeiros_ has quit [Remote host closed the connection]
<yorickpeterse> http://www.llvm.org/docs/tutorial/ this one?
<yorickpeterse> (obvious URL btw)
<whitequark> you can even implement the thing, with my recent patches to ruby-llvm, though that's not really needed
<whitequark> yes
<whitequark> it will leave you enlightened
apeiros_ has joined #ruby-lang
<yorickpeterse> Thanks, I'll take a look at it
<yorickpeterse> I had this feeling of "This shit has been done before, I'm missing something". Guess I was right :)
<whitequark> yeah, you ask about very basic concepts
<whitequark> also #llvm is quite helpful
pr0ton has joined #ruby-lang
<whitequark> (oftc.net)
<whitequark> they'll answer all sorts of SSA questions and so
tbuehlmann has joined #ruby-lang
dankest has quit [Quit: Linkinus - http://linkinus.com]
kevinfagan has joined #ruby-lang
havenwood has joined #ruby-lang
outoftime has quit [Ping timeout: 245 seconds]
Mon_Ouie has quit [Ping timeout: 276 seconds]
<yorickpeterse> hmmm, this is pretty interesting stuff
<injekt> anyone here good with SQL? (PostgreSQL) I have a query i've written in rails and I'm trying to merge the executed queries into one (writing it in SQL)
<yorickpeterse> I can see myself reading this on a sunny day in the park
torrieri has quit [Quit: Leaving...]
<yorickpeterse> unless I fall asleep, which wouldn't be very uncommon
kristofferrr has quit [Quit: ❤]
torrieri has joined #ruby-lang
<yorickpeterse> injekt: what's your issue exactly?
<injekt> yorickpeterse: here's some code to explain it a little better https://gist.github.com/injekt/d8614e8370c2a43b7307 I'm avoiding an n+1 query by eager loading the photos, BUT that still executes more queries than I'd like, and it eager loads ALL photos when I only want one
<injekt> stuff like this AR sucks for, im trying to write it in sql but apparently i suck and i keep doing it wrong :)
<yorickpeterse> Will this be Pg specific?
<injekt> yessir
Nisstyre-laptop has quit [Ping timeout: 250 seconds]
<yorickpeterse> because I recall seeing this pretty baller Pg presentation that will probably help you out, lets see if I can find it
<injekt> I've read it
<yorickpeterse> either way, lets proceed
<injekt> yeah it's nice but doesn't help much right here
<yorickpeterse> At least you'll need 2 queries
<injekt> why?
<yorickpeterse> One for all the projects and one to retrieve the associated photos
<injekt> why cant i use sub-queries
<yorickpeterse> Unless you use JOIN statements, but those can quickly become a mess for these things
<yorickpeterse> injekt: same story
<yorickpeterse> you're still executing two queries
<injekt> I started with something like these https://gist.github.com/injekt/cd0d27e810f85099be08
MaddinX__ has quit [Remote host closed the connection]
<injekt> yorickpeterse: sure but it avoids any pre-cache and object initialization
dblack_ has quit [Quit: dblack_]
<yorickpeterse> What I usually do is the following:
Mon_Ouie has joined #ruby-lang
<yorickpeterse> 1. Retrieve all the projects since you'll need them anway, store the project IDs in a separate array
<yorickpeterse> 2. Use these IDs to retrieve the associated photos and sort them based on created_at
<yorickpeterse> Then the last step is to map them to the projects
<yorickpeterse> (this is like 5-8 LOC)
<yorickpeterse> Note that this doesn't work for lots of data (thousands, etc)
<injekt> as opposed to one sql statement and 1 loc? :D
<injekt> right
<injekt> which is what i have
<yorickpeterse> how many?
<injekt> about 14k
<yorickpeterse> meh
<yorickpeterse> side answer: another way of solving this is by marking photos as the active one whenever they are modified (for example)
<yorickpeterse> That way you can just do something like `SELECT * FROM photos WHERE project_id = X AND active = true;
<injekt> yeah i thought about that too
<yorickpeterse> It requires some extra logic but it's probably the most roflscale solution
_whitelogger has joined #ruby-lang
<injekt> i kinda just want to be good enough with pg to be able to at least figure out how to write this
<injekt> but alas, time is of the essence
<yorickpeterse> well, you could (ab)use views probably
tonni has quit [Remote host closed the connection]
<injekt> in what sense?
<yorickpeterse> create a view for storing the primary project photos, then based on some action you'd shove a new row into it for a project
Honeycomb has quit [Quit: Leaving.]
<yorickpeterse> Though that's more or less the same as using an extra column in the photos table
<injekt> yeah
<yorickpeterse> or the projects one, depends on what you want
<injekt> probably the project one, and avoid hitting another table at all
Honeycomb has joined #ruby-lang
<injekt> i hate tables with lots of columns
madish has quit [Quit: ChatZilla 0.9.90 [Firefox 16.0.1/20121026125834]]
whitequark has joined #ruby-lang
outoftime has quit [Ping timeout: 276 seconds]
pepper_chico has quit [Quit: Computer has gone to sleep.]
mercwithamouth has joined #ruby-lang
davidbalbert is now known as davidbalber|away
mercwithamouth has quit [Ping timeout: 272 seconds]
jbsan has joined #ruby-lang
gustavnils has quit [Quit: Textual IRC Client: www.textualapp.com]
__butch__ has quit [Quit: Leaving.]
yalue has quit [Quit: Leaving]
<yorickpeterse> heh, searched for "bytecode condition" in Duckduckgo, first result is from the Rubinius docs
scampbell has quit [Remote host closed the connection]
outoftime has joined #ruby-lang
sailias has quit [Ping timeout: 264 seconds]
pr0ton has quit [Ping timeout: 245 seconds]
tbuehlmann has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
Axsuul has joined #ruby-lang
dRbiG has quit [Quit: ZNC - http://znc.in]
justinseiter has quit [Ping timeout: 245 seconds]
gregmore_ has joined #ruby-lang
slyphon has quit [Quit: slyphon]
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 260 seconds]
gregmoreno has quit [Ping timeout: 276 seconds]
wobblini has joined #ruby-lang
breakingthings has joined #ruby-lang
hahuang65 has joined #ruby-lang
sockmonk has joined #ruby-lang
kurko_ has quit [Quit: Computer has gone to sleep.]
intellitech has joined #ruby-lang
benanne has quit [Quit: kbai]
justinseiter has joined #ruby-lang
<dominikh> whitequark: pong
davidbalber|away is now known as davidbalbert
<whitequark> dominikh: what if I want to restore colors in received text?
<dominikh> "restore colors"?
<whitequark> right now cinch seems to eat some control codes or something
<whitequark> yes
<dominikh> Cinch doesn't eat them, no.
<whitequark> hm
mr_white has joined #ruby-lang
<whitequark> might be mysql
<whitequark> they show up in database in a weird way. red `text` becomes `4text`
<dominikh> Cinch has a method to filter all non-printable characters, but the user has to use that explicitly.
<whitequark> dominikh: I don't actually want to filter them
<whitequark> rather, I want to convert them to markup. <span>s, anyone?
<dominikh> whitequark: well, 4 is the color code for red. mysql seems to be stripping the escape code
<dominikh> whitequark: or whatever you use for talking to mysql. Cinch should preserve them
wobblini is now known as realDAB
idkazuma has joined #ruby-lang
<whitequark> dominikh: anything handy for working with them?
<dominikh> nope
musl has quit [Ping timeout: 255 seconds]
<whitequark> not even a regexp? a pity
musl has joined #ruby-lang
kain has quit [Quit: exit]
kain has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
Weems has quit [Read error: Connection reset by peer]
mr_white has quit [Remote host closed the connection]
sailias has joined #ruby-lang
nkr has quit [Quit: Linkinus - http://linkinus.com]
cored has quit [Ping timeout: 272 seconds]
slyphon has joined #ruby-lang
toretore has quit [Quit: Leaving]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
iamjarvo has quit [Ping timeout: 252 seconds]
pr0ton has joined #ruby-lang
musl has quit [Ping timeout: 255 seconds]
musl has joined #ruby-lang
dustint has quit [Quit: Leaving]
jondot has quit [Ping timeout: 240 seconds]
wmoxam has quit [Ping timeout: 240 seconds]
tonni has joined #ruby-lang
klebervirgilio has quit [Remote host closed the connection]
klebervirgilio has joined #ruby-lang
musl has quit [Read error: Connection reset by peer]
musl has joined #ruby-lang
mjio has joined #ruby-lang
kevinfagan has quit [Quit: Leaving...]
cirenyc has quit [Quit: Leaving...]
klebervirgilio has quit [Ping timeout: 272 seconds]
sailias has quit [Quit: Leaving.]
breakingthings has quit []
charliesome has joined #ruby-lang
<charliesome> yorickpeterse: so you're doing a compiler and vm, aye
krohrbaugh has quit [Quit: Leaving.]
gregf has joined #ruby-lang
gregf is now known as Guest23542
krohrbaugh has joined #ruby-lang
tenderlove has joined #ruby-lang
sockmonk has quit [Ping timeout: 245 seconds]
torrieri has quit [Quit: Leaving...]
kurko_ has joined #ruby-lang
kurko_ has quit [Max SendQ exceeded]
kurko_ has joined #ruby-lang
Guest23542 has quit [Client Quit]
r0bgleeson has joined #ruby-lang
slyphon has quit [Ping timeout: 276 seconds]
hackeron_ has left #ruby-lang [#ruby-lang]
justinseiter has quit [Ping timeout: 272 seconds]
anonymuse has quit [Read error: Connection reset by peer]
apeiros_ has quit [Remote host closed the connection]
__butch__ has joined #ruby-lang
torrieri has joined #ruby-lang
Stilo has quit [Quit: Textual IRC Client: www.textualapp.com]
mjio has quit []
mercwithamouth has joined #ruby-lang
jonahR has quit [Quit: jonahR]
yawniek_ has left #ruby-lang [#ruby-lang]
outoftime has quit [Quit: Leaving]
Stilo has joined #ruby-lang
mjio has joined #ruby-lang
torrieri has quit [Quit: Leaving...]
beho has joined #ruby-lang
intellitech has quit [Ping timeout: 240 seconds]
krohrbaugh has quit [Quit: Leaving.]
maxmanders has quit [Quit: Computer has gone to sleep.]
Y_Ichiro has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
cirenyc has joined #ruby-lang
Y_Ichiro has joined #ruby-lang
Y_Ichiro has quit [Changing host]
Y_Ichiro has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
crudson has joined #ruby-lang
nXqd has joined #ruby-lang
krohrbaugh has joined #ruby-lang
datanoise has quit [Ping timeout: 252 seconds]
mjio has quit []