ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
ilyam_ has joined #ruby-lang
seanstickle has joined #ruby-lang
gsav has joined #ruby-lang
Joeysomo has joined #ruby-lang
gryfft has joined #ruby-lang
slaytanic has joined #ruby-lang
Torrieri has joined #ruby-lang
<gryfft> I am spacing on how to do something.
<gryfft> I am attempting to remove a string from an array. I have the string, I have the array, I know the string is in the array. I want it out of the array. I forget how.
fgomez has joined #ruby-lang
Beticious has joined #ruby-lang
<corsican> gryfft: array.slice[array.find_index("string")]
<corsican> or, rather
<corsican> array.slice![array.find_index("string")]
<jmontross> pop?
<drbrain> gryfft: or: %w[a b c] - %w[b]
<gryfft> corsican: I love you
<seanstickle> or array.delete("a")
<gryfft> hahaha oh god
<gryfft> i love ruby so hard
Clordio has joined #ruby-lang
<corsican> oh yeah seanstickle's is way simpler :)
<gryfft> it's like having a pantry of options for any given problem
<drbrain> gryfft: or: a = %w[a b c]; a.delete "b"; p a
<gryfft> stop it, you're going to make me love ruby at simply inappropriate levels.
<drbrain> gryfft: if you have multiple items, delete will remove all of them
<gryfft> hmmm
<drbrain> gryfft: a = %w[a b c b]; a.delete "b"; p a
<gryfft> Ineed to learn this %w wizardry
<gryfft> Wait, I think I just got it through context
* gryfft runs off to irb
<corsican> I never understood the % thing :(
<corsican> I'm kind of a noob
<drbrain> you can use other characters than [] to delimit the array %w creates, but I like [] over the other choices like {} (which is also popular)
<rue> I like [], too, since it produces an Array
<corsican> what is the advantage to, say
rdavila has joined #ruby-lang
<corsican> %w[a b c d]
<corsican> versus ['a','b','c','d']
<rue> corsican: Which took longer to type?
<drbrain> corsican: less typing
<corsican> haha
<corsican> okay
<drbrain> that is all
<corsican> I just figured it was something more complicated ;)
<gryfft> there's readability to account for too, but what are comments for?
<drbrain> there's also %W which lets you interpolate
<deryl> documentation within the file for explaining something that might be a bit complicated
<drbrain> command = %w[#{Gem.ruby} something -mumble]; system(*command)
<gryfft> I know what comments are for :P
<deryl> oh hehe, misread your comment then :)
<gryfft> I was saying using drbrain's super succint code might be less readable but that's easily fixed with commenting ^_^
<deryl> gotcha
<fgomez> is %w[] like perl's qw[] ?
<erikh> fgomez: yes
shevy has joined #ruby-lang
<zenspider> corundum: quickref?
tomzx has joined #ruby-lang
wmoxam has joined #ruby-lang
tomzx has joined #ruby-lang
<zenspider> hoe 3.0.1 released
nofxx has joined #ruby-lang
QoQOoO has joined #ruby-lang
QoQOoO has quit [#ruby-lang]
jmontross has quit [#ruby-lang]
takaokouji has joined #ruby-lang
takaokouji has joined #ruby-lang
neoesque has joined #ruby-lang
takaokouji has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
ilyam has joined #ruby-lang
Luxx_ has joined #ruby-lang
QoQOoO has joined #ruby-lang
ilyam has joined #ruby-lang
yuroyoro has joined #ruby-lang
rdavila has joined #ruby-lang
S1kx has joined #ruby-lang
S1kx has joined #ruby-lang
tomzx has joined #ruby-lang
gryfft has joined #ruby-lang
looopy has joined #ruby-lang
dfr|mac has joined #ruby-lang
dfr|mac_ has joined #ruby-lang
jacobwg has joined #ruby-lang
macmartine has joined #ruby-lang
WillMarshall has joined #ruby-lang
shtirlic has joined #ruby-lang
Karmaon has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
ilyam has joined #ruby-lang
gabeanzelini has joined #ruby-lang
dave_miles_cf has joined #ruby-lang
pygmael has joined #ruby-lang
RORgasm has joined #ruby-lang
eadz has joined #ruby-lang
eadz has joined #ruby-lang
kitallis has joined #ruby-lang
reeze_xia has joined #ruby-lang
MopMopperton14 has joined #ruby-lang
wallerdev has joined #ruby-lang
Karmaon has joined #ruby-lang
ramonmaruko has joined #ruby-lang
brianpWins has joined #ruby-lang
jmfcool has joined #ruby-lang
dr0id has joined #ruby-lang
ramonmaruko has joined #ruby-lang
brianpWins has joined #ruby-lang
seoaqua has joined #ruby-lang
S1kx has joined #ruby-lang
fayimora has joined #ruby-lang
eadz has quit [#ruby-lang]
gianlucadv has joined #ruby-lang
pygmael has joined #ruby-lang
Jade has joined #ruby-lang
Dogleaf has joined #ruby-lang
<Dogleaf> Howdy
krz has joined #ruby-lang
havenn has joined #ruby-lang
wyhaines has joined #ruby-lang
gokul has joined #ruby-lang
rippa has joined #ruby-lang
Joeysomo has joined #ruby-lang
nataraj has joined #ruby-lang
<nataraj> Hi
<nataraj> trouble with fxruby
<nataraj> may i have some help?
fgomez has joined #ruby-lang
postmodern has joined #ruby-lang
gix has joined #ruby-lang
wyhaines_ has joined #ruby-lang
fgomez has joined #ruby-lang
wyhaines has joined #ruby-lang
reeze_xia has joined #ruby-lang
H2H has joined #ruby-lang
gabeanzelini has joined #ruby-lang
brownies has quit ["..."]
havenn has joined #ruby-lang
divins_ has joined #ruby-lang
<nataraj> on 1.9.3p125
<shevy> nataraj fxruby died a while ago
<nataraj> shevy, yes i know
<nataraj> need an alternative
<shevy> ruby-gtk is still alive
<nataraj> used to code on fx 2 years back, on angstrom linux on an Arm handheld
yxhuvud has joined #ruby-lang
<nataraj> but as of now, we dont use Xwindows on the handheld, just the framebuffer device for Qt Apps
<nataraj> need ruby + Gui that works on fbdev
<erikh> isn't there a qt toolkit for ruby as well?
<erikh> dunno if it's still maintained; ruby generally doesn't lend itself well to gui applications
<erikh> there's also libgosu, if banisterfiend is around he can tell you more.
<nataraj> fx was too good for words
<erikh> but that's more for gaming-style drawing
<shevy> when ruby-gtk is available it is very nice, but on things like Arm handhelds I dunno, I can understand why you want to use fxruby :D
<nataraj> rapid prototyping i suppose is what you guessed
<shevy> why, that would work in ruby-gtk or ruby-qt just as well
<nataraj> fx with X was damn cool, got a major order using it for prototyping
<nataraj> Qt-embedded works well on framebuffer
<nataraj> "Found qtruby4 (2.1.0), but was for platform mswin32"
<nataraj> means, dont work on linux?
<shevy> I dont know what that works. Qtruby however works on linux.
<shevy> *means, not works
havenn has joined #ruby-lang
<drbrain> nataraj: it means that the author didn't release a C-extension-only version
<drbrain> just precompiled versions for windows ☹
reeze_xia has joined #ruby-lang
<nataraj> drbrain, any way to get it fixed ?
<drbrain> nataraj: contact the author and ask them to release just the source
<drbrain> nataraj: reading the scroll back, it appears your fxruby error is due to fxtwitter not loading twitter4r properly
<nataraj> so reinstall fxtwitter after installing twitter4r gem?
tenderlove has joined #ruby-lang
<erikh> haha so DateTime\#- subtracts days when integer
<erikh> man I just optimized the hell out of a sql query
francisfish has joined #ruby-lang
|Vargas| has joined #ruby-lang
<tenderlove> zenspider: where did you get the syntax.css file for coderay?
looopy has joined #ruby-lang
<zenspider> tenderlove: you know I'm on IM, right?
<tenderlove> :-P
<zenspider> I just _happened_ to look at IRC... prolly wouldn't have seen this otherwise
H2H has joined #ruby-lang
x0F__ has joined #ruby-lang
<drbrain> nataraj: you'll probably have to fix fxtwitter, I doubt reinstalling will help if it didn't work the first time
burgestrand has joined #ruby-lang
kitallis has joined #ruby-lang
rue has joined #ruby-lang
<shevy> in other words, you are quite doomed nataraj :)
<shevy> a dead toolkit, an application that no longer works
<shevy> but as long as you are not out of beer, things can still be good
darkf_ has joined #ruby-lang
JohnBat26 has joined #ruby-lang
<nataraj> well, twitter aint so important
<nataraj> but a ruby extension for a gui toolkit is
RORgasm has joined #ruby-lang
<nataraj> interesting, there's a thing called ruby/fltk
solars has joined #ruby-lang
gryfft has joined #ruby-lang
nofxx has joined #ruby-lang
darkf_ has joined #ruby-lang
<erikh> #<Sequel::SQLite::Dataset: "SELECT 'distinct(nodes.id)', 'nodes.*' FROM `nodes` INNER JOIN `reports` ON (`reports`.`node_id` = `nodes`.`id`) WHERE (('reports.created_at' >= '2012-03-26 22:57:49.086504-0700') AND ('reports.created_at' <= '2012-03-26 23:57:49.086561-0700')) GROUP BY 'nodes.id'">
* erikh cries
<erikh> it won't stop quoting those column names.
olesu has joined #ruby-lang
zmack has joined #ruby-lang
<erikh> or the distincT()
dhruvasagar_ has joined #ruby-lang
wubino has joined #ruby-lang
srbartlett has joined #ruby-lang
looopy has joined #ruby-lang
tjadc has joined #ruby-lang
takaokou_ has joined #ruby-lang
gryfft has joined #ruby-lang
lperry65 has joined #ruby-lang
darkf has joined #ruby-lang
olesu has joined #ruby-lang
apeiros_ has joined #ruby-lang
Guest92496 has joined #ruby-lang
dhruvasagar has joined #ruby-lang
gokul has joined #ruby-lang
thrcka has joined #ruby-lang
havenn has joined #ruby-lang
kain has joined #ruby-lang
tekin has joined #ruby-lang
francisfish has joined #ruby-lang
gnufied has joined #ruby-lang
gianlucadv has joined #ruby-lang
judofyr has joined #ruby-lang
dc5ala has joined #ruby-lang
rue has joined #ruby-lang
heftig has joined #ruby-lang
futurechimp has joined #ruby-lang
woollyams has joined #ruby-lang
qwerxy has joined #ruby-lang
adambeynon has joined #ruby-lang
adambeynon has joined #ruby-lang
takaokouji has joined #ruby-lang
ando has joined #ruby-lang
pygmael has joined #ruby-lang
<Tasser> erikh, distinct? Does it return sets?
akamike has joined #ruby-lang
gnufied has joined #ruby-lang
heftig_ has joined #ruby-lang
olesu has joined #ruby-lang
brushbox has joined #ruby-lang
mytrile has joined #ruby-lang
<judofyr> erikh: how's the Sequel going?
heftig has joined #ruby-lang
<manveru> wow... wc has some really crazy source
<chris2> heh
beiter has joined #ruby-lang
<Defusal> what is the best way to unescape a string like phps stripslashes()?
rue has joined #ruby-lang
<Defusal> i have done a fair amount of searching and have not found a satisfactory answer, which seems strange for such a trivial question
<manveru> Defusal: example?
<zenspider> chris2: maybe it's just me... but when you put a link to "New Condoms" next to a link for "one tiny hand"... well...
<Defusal> manveru, it just unescapes one level, so "\\" becomes "\", "\\n" becomes "\n"
<Defusal> im embedding installation of sql files into my platform and the normal php install script reads the sql file, substitutes template stuff, splits on ";" and then runs each query
morozovm has joined #ruby-lang
<Defusal> err, i missed the "stripslashes()" step
<Defusal> ideally i'd like to do it as one query, but im not sure if thats possible with the ruby mysql driver, but either way, i need to unescape the sql first
morozovm has joined #ruby-lang
<manveru> >> s = '\\\\ and \\\\n'; puts [s, s.gsub(/\\\\/, '\\')].join(' => ')
<manveru> \\ and \\n => \ and \n
rohit has joined #ruby-lang
<Defusal> hmm i guess i was overthinking it
<Defusal> simple gsub should do the job, thanks
pygmael has joined #ruby-lang
<Defusal> any idea on bulk querying with the MySQL driver manveru?
<manveru> Defusal: uh, no
<manveru> i use sequel, usually with sqlite or postgres
morozovm has joined #ruby-lang
daglees has joined #ruby-lang
daglees has joined #ruby-lang
<Defusal> yea, i'm using mongodb for my platform, but i need to create and configure the mysql databases for the daemons it installs
RORgasm has joined #ruby-lang
<Defusal> it seems terribly inefficient to split on ";" and make each query seperately to create the schema
<apeiros_> load data infile
<apeiros_> must be enabled serverside iirc, or requires a special grant
<apeiros_> been a while since mysql
<apeiros_> @Defusal
<manveru> mysql and mongodb... what is the world coming to?
<Defusal> hmm, i'll look into that, thanks apeiros_
<Defusal> mongodb is awesome manveru
<Defusal> faster and more convenient than sql
shtirlic_ has joined #ruby-lang
<manveru> as long as you don't need persistence :P
<andrewvos> Aww can we not do the mongo argument? It's to early for me to get unhappy about something.
<andrewvos> too*
<manveru> heh
fayimora_ has joined #ruby-lang
shtirlic_ has joined #ruby-lang
morozovm has quit [#ruby-lang]
morozovm has joined #ruby-lang
<Defusal> oh right apeiros_
<Defusal> i would use the mysql command line application if i wanted to use a sql file
<Defusal> but i dont really want to write a file
<Defusal> i'd rather do each query seperately :/
morozovm has quit [#ruby-lang]
<Defusal> oh well, this will have to do
fayimora has joined #ruby-lang
morozovm has joined #ruby-lang
morozovm has quit [#ruby-lang]
morozovm has joined #ruby-lang
morozovm has joined #ruby-lang
morozovm has quit [#ruby-lang]
morozovm has joined #ruby-lang
morozovm has joined #ruby-lang
<zenspider> Defusal: popen4
* zenspider goes to bed
morozovm has joined #ruby-lang
burgestrand has joined #ruby-lang
dhruvasagar has joined #ruby-lang
dfr|mac has joined #ruby-lang
fayimora_ has joined #ruby-lang
gianlucadv has joined #ruby-lang
srbartlett has joined #ruby-lang
srbartle_ has joined #ruby-lang
<Defusal> zenspider, i have no problem spawing stuff...
rue has joined #ruby-lang
<Defusal> manveru, while i was out i just realized that isnt the same as stripslashes
<Defusal> strip slashes will also turn "\'" into "'"
<apeiros_> stripslashes… that's something from before the time of sane database interfaces, right?
<Defusal> apeiros_, it's still used in php today
<Defusal> i havnt needed to even read php code in years
<Defusal> but now i need to rewrite some in ruby
<apeiros_> Defusal: I think I said *sane* already… :-p
<Defusal> and one of the things this does before executing the sql is stripslashes()
<Defusal> so i need a way to do the same from ruby apeiros_
<apeiros_> how archaic
<judofyr> Defusal: special = { 'n' => "\n" }; str.gsub(/\\(.)/) { special[$1] || $1 }
<Defusal> judofyr, you are missing the point
<apeiros_> Defusal: if you want to replicate the php code bug for bug, you'll use something like stripslashes
<Defusal> apeiros_, which is why i am here, asking what the best way to do the same in ruby is...
<judofyr> Defusal: oh? :S
<apeiros_> using stripslashes before performing a query is weird, though. usually, you added slashes (in order to escape data)
<Defusal> judofyr, i need to simulate php's stripslashes(), and i sure as hell am not going to create a hash with every possible character in it
<apeiros_> later people realized, that db drivers had escape mechanisms of their own, and started using those (like mysql_blabla_quote_blabla or something like that)
<apeiros_> and even later, people realized, that there's bind variables, which obviates the need for escaping altogether
<judofyr> Defusal: you don't need "every possible character". it falls back to the string if it's not found
<Defusal> apeiros_, sure... but that doesnt chance the fact that this is how this is done
<Defusal> judofyr, sigh.
<apeiros_> "it is done this way, however stupid, lets do it that stupid again"
<apeiros_> great
<apeiros_> meh
<apeiros_> not my problem
<Defusal> judofyr, php does not use a hash of every char possible, so neither will i
<judofyr> Defusal: then read stripslashes' source :)
<Defusal> apeiros_, i don't have time to waste with this...
<Defusal> i just need it to work, its for installing the database of a php application
<Defusal> i couldnt care what it does, as long as it works
<Defusal> i wouldn't have fcgi php installed on my server at all if i didn't need to provide these php applications
<judofyr> Defusal: popen then
<Defusal> popen what?
<Defusal> spawn php to unescape a string?
<Defusal> i have never heard of something so rediculous
<judofyr> Defusal: write a PHP script and runs stripslashes on ARVG[0] :)
<Defusal> good god
<Defusal> i am not quite *that* lazy
<judofyr> …
<Defusal> it's bad enough i have to have php installed on the server at all
<Defusal> im not going to call php code from ruby to remove some slashes from a string
<judofyr> well, you don't want to figure out how stripslashes works either, so…
<Defusal> well i've got my answer
<Defusal> ruby has no way to do such a thing
<Defusal> so now i will have to waste time reimplementing phps function
<judofyr> true
<judofyr> Ruby doesn't ship with crappy PHP functions :)
<Defusal> that i do not expect
<Defusal> i do however find it strange that out of every php developer thats ever moved to ruby, not one has ever needed to do this
<apeiros_> weird prioritization… you prefer wasting time over porting/reimplementing the wrong way, rather than do it right…
dhruvasagar has joined #ruby-lang
<Defusal> apeiros_, and the right way is what?
<apeiros_> already told you
<apeiros_> if you've data to be escaped, use bind variables
<apeiros_> s/data to be escaped/variable data in queries/
<Defusal> i have sql files
<apeiros_> use load data infile for sql files
sora_h has joined #ruby-lang
<Defusal> which have template variables subbed
<apeiros_> well, that's stupid
<apeiros_> again, bind variables
<apeiros_> but I'm repeating myself
<Defusal> well, thats how the php install script does it
<apeiros_> well, that's the stupid way
<Defusal> you're missing the point
<Defusal> im not going to bother again
<apeiros_> but again, I'm repeating myself
<apeiros_> Defusal: make an example of one such file…
<Defusal> it's fine
<Defusal> i'll hack it together to make it work
<Defusal> i don't care anymore
<apeiros_> *shrug* train wreck it is, fine
<Defusal> i have far better thing to do
dous has joined #ruby-lang
<Defusal> and i have weeks of work to do before the end of the month
dous has joined #ruby-lang
<Defusal> which is in 5 days time
* apeiros_ bets it'd probably just be replacing those "template vars" with proper bind variable syntax
<apeiros_> but ignorance rules the planet, rock on
<Defusal> dude.
<Defusal> they are stupid bloody template variables
<Defusal> they are not even dynamic
<Defusal> stuff like {prefix}
<Defusal> you're making a big deal about nothing at all
<apeiros_> Defusal: how about you waste 5 more minutes on google and find out how bind vars work?
<apeiros_> and you're behaving stupid. I'm off. good luck.
<Defusal> this doesn't even have anything to do with my issue -.-
<Defusal> theres a reason the slashes are stripped
<Defusal> it has nothing to do with the templating
<Defusal> i can't perform the queries without stripping the slashes, regardless of how the templating is done
<Defusal> i don't know why that is so hard to understand.
<Defusal> ...and you tell me im ignorant, pfft
tla has joined #ruby-lang
zmack has joined #ruby-lang
olesu has joined #ruby-lang
sora_h has joined #ruby-lang
kokozedman has joined #ruby-lang
<kokozedman> hey guys... i'm trying to develop a Ruby C extension, but somehow, i can't get the error "[BUG] cfp consistency error - call0" fixed
<kokozedman> what i'm doing, is that i create a C threads (pthread), and call a Ruby function
<kokozedman> the threads call the Ruby function... and causes this "[BUG] cfp consistency error - call0"
<kokozedman> but the strange thing is: the error happens mostly when the call is completed
fayimora has joined #ruby-lang
batmanian has joined #ruby-lang
<kokozedman> anyone with some knowledge on this?
zz_wasnotrice has joined #ruby-lang
<kokozedman> this error happens only on 1.9.x
qwerxy has quit [#ruby-lang]
<rue> I haven't tried to use native threads with a Ruby extension, so I dunno
<judofyr> kokozedman: you should probably only call Ruby methods from one thread
<kokozedman> another info: i'm developing the extension using RubyInline... and the method I call is a RubyInline one
<kokozedman> so, i think, it is somehow, still something for the C context...
<rue> RubyInline ≠ extension
<kokozedman> but when i call rb_funcall(...), something about control frame is involved
<kokozedman> and when the call ends, some kind of check that should be incremented doesn't get incremented, and seems to cause the error
<kokozedman> rue: i agree... but it's somehow generating a C code that is really abiding to the way how C extensions are made
fayimora has joined #ruby-lang
lsegal has joined #ruby-lang
<rue> I'm not sure what that means, but what I mean is that if you're using Inline, don't say you're writing an extension :)
<rue> There's FFI, there's Inline, and then there're extensions
tommyvyo has joined #ruby-lang
<judofyr> there's FFI, there's extensions, and then there's madness
<kokozedman> judofyr: what's FFI?
<judofyr> kokozedman: https://github.com/ffi/ffi
<judofyr> kokozedman: if you just need to call some methods in a dylib
<Defusal> this is gonna be a very long day :/
mssola has joined #ruby-lang
<kokozedman> hmm... good to know... thanks judofyr
<judofyr> kokozedman: well supported in both MRI, JRuby and Rubinius
<kokozedman> rue: have you looked at a C code generated by RubyInline? it IS an extension... exactly like you would write if you are to create an extension...
<rue> kokozedman: Don't argue, please, these are all distinct.
<rue> Is the code generated similar? Yes, it does call into the same codebase, after all
heftig has joined #ruby-lang
ramonmaruko has joined #ruby-lang
<kokozedman> rue: alright... speaking of codebase... where can i find the API list of Ruby C functions (like rb_protect, rb_xxxx)
<rue> README.ext has some, for more you'll probably need to go into ruby.h and possibly other headers
<andrewvos> Yay! Release is live m.bbc.co.uk/news
mytrile has joined #ruby-lang
mark_locklear has joined #ruby-lang
beiter has joined #ruby-lang
rohit has joined #ruby-lang
<rue> Awesome
wyhaines has joined #ruby-lang
<judofyr> andrewvos: nice!
<judofyr> andrewvos: framework?
tbuehlmann has joined #ruby-lang
fayimora has joined #ruby-lang
<manveru> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
tekin has joined #ruby-lang
<manveru> why do people do things like that?
<shevy> sounds like an editor auto doing this
<manveru> it looks like crap on my 10" tablet
yumike has joined #ruby-lang
rdavila has joined #ruby-lang
<manveru> oh well, at least the normal bbc page is still fine
<Defusal> manveru, im gonna switch to sequel for these maintenance queries, it looks a lot nicer than rolling my own solution with the mysql driver. thanks for mentioning it
<manveru> good to hear :)
<manveru> sequel rocks
RORgasm has joined #ruby-lang
ankurgel has joined #ruby-lang
<judofyr> sequel++
<yorickpeterse> ^
<lianj> |
Guest92496 has joined #ruby-lang
Guest92496 has joined #ruby-lang
<chris2> zenspider: heh
<ankurgel> shortest way to tell if a number is a prime or not? I ended up writing http://pastebin.com/tMA8g4C5 to find first 10001 prime numbers.
<ankurgel> Also, very hoggy. Took 1 minute in execution.
<matled> ankurgel: efficient or short?
<manveru> well, for one you can use += 2 if you start with a prime
<matled> short I'd go with: (2...n-1).all? { |i| n.divmod(i).last != 0 }
<lianj> ruby -rmathn -e 'p (0...100000).select{|i| i.prime? }'
<manveru> hehe
<judofyr> ruby -rprime -e'p Prime.take(1000)'
<ankurgel> lianj: there exists .prime in mathn already?
<ankurgel> wow
reeze_xia has joined #ruby-lang
<rue> And it's actually pretty fast
<ankurgel> yes, it hardly took a second!
<judofyr> or: ruby -rprime -e'p Prime.take_while { |x| x < 100000 }'
<rue> Benchmark time!
<rue> Betting Prime is faster
<judofyr> Prime is faster here
<manveru> lianj: select(&:prime?)
<rue> Yep, by a lot
Spooner has joined #ruby-lang
<manveru> Prime uses a cache i think
Asher has joined #ruby-lang
<judofyr> mathn: 0m1.211s. Prime: 0m0.170s
* judofyr wins! :D
<lianj> ah nice :)
<ankurgel> rue: How to calculate Benchmarks in ruby, again? I run the programs by time ___ on my machine for it.
<manveru> require 'benchmark'
<manveru> Benchmark.realtime{ do_stuff }
<judofyr> I prefer benchmark-ips: https://github.com/evanphx/benchmark-ips
<judofyr> it handles warmup and iteration for you
<ankurgel> ok :)
<manveru> but it's not in stdlib :)
fayimora has joined #ruby-lang
<ankurgel> and that Prime class is being incorporated by require 'prime' ?
<judofyr> ankurgel: yes. in 1.9
seanstickle has joined #ruby-lang
<lianj> 1.8 should have a hook to uninstall itself
seanstickle has joined #ruby-lang
<judofyr> here's the benchmark with ips: http://cl.ly/2P3w351L0T262l0z1g07
<judofyr> hm
<judofyr> some encoding issue
ankurgel has joined #ruby-lang
* apeiros_ bets Marshal.load(File.open('~/projecteuler/primes.marshal')) is faster :-D
tomzx has joined #ruby-lang
<judofyr> apeiros_: well, a fast prime generator is probably faster than disk I/O
gabeanzelini has joined #ruby-lang
d3vic3 has joined #ruby-lang
<judofyr> but probably not for n=10000
<judofyr> err, n=1000000 *
codewrangler has joined #ruby-lang
<apeiros_> well, I have the 1..1e7
<apeiros_> one in C might be faster
<apeiros_> but in ruby… I doubt it
tjadc has joined #ruby-lang
<judofyr> I agree
futurechimp has joined #ruby-lang
<andrewvos> judofyr: php :(
<judofyr> apeiros_: aww :(
enebo has joined #ruby-lang
ankurgel has joined #ruby-lang
dmathieu has joined #ruby-lang
dv310p3r has joined #ruby-lang
acidChrist has joined #ruby-lang
acidChrist has quit [#ruby-lang]
tjadc has joined #ruby-lang
<Tasser> judofyr, and where does the x come from in the README?
<judofyr> Tasser: huh?
<Tasser> SYNOPSIS <- he calls x.report
justinxreese has joined #ruby-lang
<judofyr> Tasser: Benchmark.ips do |x|
<judofyr> Tasser: but yeah, it's a typo
<judofyr> Tasser: pull request sent
<judofyr> haha
<judofyr> lol, it's another one there: https://github.com/evanphx/benchmark-ips/pull/2
<Tasser> :D
<Tasser> I'd like IPS::bench {
<Tasser> something you can call from pry
ankurgel has joined #ruby-lang
Sailias has joined #ruby-lang
<andrewvos> How do I remove nil from arrays?
<andrewvos> All nils
<andrewvos> [].reject!{|d| d.nil?} <--- is that the only way?
<judofyr> andrewvos: .compact
<andrewvos> judofyr: Ahh thanks!
<judofyr> or, .compact! for the destructive one
<andrewvos> judofyr: Thanks
<apeiros_> judo fries nils
<judofyr> constantly
<judofyr> there's no funny puns on apieros :(
<andrewvos> hehehe
<judofyr> I've always thought of "andrewvos" as French. "andrew-vou"
ryez has joined #ruby-lang
<andrewvos> nope, not French
<andrewvos> Well, I'm not French. The word is.
<judofyr> oh, so the word is French?
slyphon has joined #ruby-lang
mytrile has joined #ruby-lang
morozovm_ has joined #ruby-lang
beiter has joined #ruby-lang
morozovm_ has joined #ruby-lang
<rue> Dutch?
mistym has joined #ruby-lang
<andrewvos> Think so?
outoftime has joined #ruby-lang
<rue> It would seem more likely
<rue> Maybe you're related to Marianne Vos?
deryl has joined #ruby-lang
<andrewvos> Who is that?
* andrewvos searches
<andrewvos> She apparently has a penis http://en.wikipedia.org/wiki/Marianne_Vos
carlosgaldin0 has joined #ruby-lang
<rue> Is that enough to establish relation?
ruskie has joined #ruby-lang
carlosgaldin0 has quit [#ruby-lang]
<rue> Seems a little tenuous
rdavila has joined #ruby-lang
dhruvasagar has joined #ruby-lang
f3ew has joined #ruby-lang
<f3ew> I'm trying to debug an erb problem
<f3ew> http://privatepaste.com/a8e91908f9 is the template, line 39 shows the error
<rue> How is that going for you?
<f3ew> Suggestions?
<f3ew> ruby 1.9.2, erb is being consumed via Puppet, if that matters
stiang has joined #ruby-lang
<rue> It'd probably be better to take this out of your template anyway
stiang has quit [#ruby-lang]
<rue> But your problem is that you're not seeing changes in entry?
<andrewvos> rue: Funny
<f3ew> rue: right
<f3ew> This is work in progress, so it will be cleaned up
JEG2 has joined #ruby-lang
Stalkr_ has joined #ruby-lang
stiang has joined #ruby-lang
<f3ew> Suggestions on debugging?
wmoxam has joined #ruby-lang
<Silex> use your debugger? breakpoints etc
jxie has joined #ruby-lang
fayimora has joined #ruby-lang
<rue> I'd move it out of the erb first.
<f3ew> rue: the function?
<rue> Everything but the presentation
wyhaines has joined #ruby-lang
arkonova has joined #ruby-lang
pygmael has joined #ruby-lang
RORgasm has joined #ruby-lang
dejongge has joined #ruby-lang
nofxx has joined #ruby-lang
selvakumaran has joined #ruby-lang
heftig has joined #ruby-lang
<selvakumaran> Hello there?? I wanna install QTRuby on my opensuse machine, Any help?
futurechimp has joined #ruby-lang
wallerdev has joined #ruby-lang
<andrewvos> !tumbleweed
<andrewvos> @ @ @ @
wyhaines has joined #ruby-lang
<matti> lol
pgpkeys has joined #ruby-lang
stiang has joined #ruby-lang
fayimora has joined #ruby-lang
msisk has joined #ruby-lang
sandbags has joined #ruby-lang
rolfb has joined #ruby-lang
<ankurgel> arr=[200,100,50,20,10,5,2,1]. I want to find groups such as total_sum_value=400.. these values can be grouped by [200,200] (total=400), [1.. 400 times] (total=400), [50,50,100,200] etc
PsiliPharm has joined #ruby-lang
<ankurgel> guess Arr#combination can't help me out here.
<shevy> dont even know of an algorithm to do that
<ankurgel> :D guess then will have to formalize an adequate algorithm for it.
<ankurgel> there is a related problem on ProjectEuler I read some months ago. Just remembered some part of it and modified the problem statement to practice.
<andrewvos> yeah I did that at some point
<andrewvos> ankurgel: If you can find the number, I'll give you the code ;)
<judofyr> ankurgel: good luck. if you can solve that in polynomial time, you'll be famous
<andrewvos> ankurgel: Problem number I mean
rippa has joined #ruby-lang
ankurgel has joined #ruby-lang
<erikh> judofyr: I'm going to be switching to AR I think.
<judofyr> erikh: whaat? :(
<judofyr> why?
<erikh> can't make sequel do what I want
<ankurgel> got disonnected. Anyone replied regarding that problem? Please to reply again. :)
<judofyr> 16:58 judofyr: ankurgel: good luck. if you can solve that in polynomial time, you'll be famous
<judofyr> 16:58 judofyr: ankurgel: http://en.wikipedia.org/wiki/Knapsack_problem
<judofyr> erikh: what are you trying to do?
<erikh> oh, nothing complicated, just sequel's aggressive quoting is getting in my way
<erikh> anyhow; I need to bail, work beckons
<shevy> BEND OVER!!!
selvakumaran has joined #ruby-lang
<shevy> oops, sorry. wrong channel
<andrewvos> /whois shevy
<andrewvos> You're only in ruby-lang shevy :/
<judofyr> wrong server?
slyphon has joined #ruby-lang
workmad3 has joined #ruby-lang
RORgasm has joined #ruby-lang
<erikh> andrewvos: it's called +i
<erikh> you can only see the channels you're both in
<andrewvos> erikh: +i?
<erikh> invisible mode
<erikh> try /mode andrewvos +i
Austin__ has joined #ruby-lang
<andrewvos> erikh: You lost me man
mrchrisadams has joined #ruby-lang
florentg2 has joined #ruby-lang
<rue> I can't see you
florentg2 has joined #ruby-lang
dejongge has joined #ruby-lang
<Mon_Ouie> IRC ninjas
<matled> I don't like that classes get indented more and more if they are within multiple modules. is there any typical way to solve this? module A; module B; module C; \n class Foo? or class A::B::C::Foo (the modules have to be defined already for this..)?
<judofyr> matled: that's pretty much your options
<shevy> andrewvos I am spawned on the whole of freenode man
<shevy> even on #machomebrew without having a mac
senthil has joined #ruby-lang
gsav has joined #ruby-lang
<andrewvos> hehe
<shevy> but I am learning
<shevy> they use pure ruby recipes for every program
<erikh> yeah it's kind of silly
<andrewvos> hehe
<andrewvos> Ruby *all* the things
<matti> shevy: No.
senthil has quit [#ruby-lang]
<shevy> what no
<matti> shevy: You. MUST go with Ruby shell now.
<shevy> hehe
<matti> shevy: To complete the picture.
<shevy> man I look at the todo list, it just scares me
<matti> shevy: Forget about bash.
<shevy> I think I need to put a hard cap on projects
<shevy> - Projects must not exceed one thousand lines of codes & comments
<shevy> you know like what manveru did with innate
<andrewvos> shevy++
<shevy> rush has some nice ideas
<matti> shevy: manveru is awesome ;-)
<shevy> and a cool logo
<shevy> but my approach would be different, I'd just embed pry :)
<matti> Um.
<Mon_Ouie> I'd do it the other way around, have a convenient syntax to use Ruby from a regular shell
<Mon_Ouie> (and running said code in the same VM)
<matti> I was using rush for two weeks.
<matti> Its nice.
<shevy> yeah
<shevy> why did you stop after 2 weeks?
<matti> I am more used to bash with vi mode.
<frem> bash has vi mode?
<matti> And sometimes something easy takes too long.
<matti> frem: Yes!
chimkan has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
Stalkr_ has joined #ruby-lang
<frem> matti: that is awesome, and now i need to customize my prompt to look like vim-powerline. :3
g0bl1n has joined #ruby-lang
apeiros_ has joined #ruby-lang
PsiliPharm has joined #ruby-lang
<matti> frem: Haha ;-)
ascarter has joined #ruby-lang
ilyam has joined #ruby-lang
wyhaines has joined #ruby-lang
g0bl1n has joined #ruby-lang
<rue> Isn't there a powerline for bash?
davpoind has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
<shevy> what is a powerline?
Indian has joined #ruby-lang
H2H has joined #ruby-lang
solars has joined #ruby-lang
io_syl has joined #ruby-lang
morozovm_ has joined #ruby-lang
<andrewvos> shevy: It's like a normal line, but more power.
butchanton has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
singpolyma has joined #ruby-lang
darkf has joined #ruby-lang
<shevy> lol
ddfreyne has joined #ruby-lang
burgestrand has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
ascarter has joined #ruby-lang
morozovm_ has joined #ruby-lang
achiu1 has joined #ruby-lang
ruskie has joined #ruby-lang
takaokouji has joined #ruby-lang
slyphon has joined #ruby-lang
Kero has joined #ruby-lang
brownies has joined #ruby-lang
Carnage\ has joined #ruby-lang
achiu has joined #ruby-lang
dejongge1 has joined #ruby-lang
ilyam has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
havenn has joined #ruby-lang
<kyrylo> What I'm supposed to do, if my ~/.gemrc doesn't work? I mean, I write stuff there, but nothing happens. But /etc/gemrc works flawlessly. I don't use RVM.
jmontross has joined #ruby-lang
<burgestrand> Anybody knows about the caveats when installing C extensions on Mac OS that uses frameworks instead of just regular library linking? Have a user of one of my gems where the compiled extension can’t find a symbol that *should* exist on Mac OS.
<burgestrand> O
<Mon_Ouie> That framework is bundled with Mac OS?
<burgestrand> Mon_Ouie: OpenAL, as far as I know it is
<Mon_Ouie> Yep, I didn't have any problem with that one
<kyrylo> Hum, I guess, I know the answer. Sorry for the false alarm.
<burgestrand> Mon_Ouie: you ever written an extconf.rb that links against it?
<Mon_Ouie> Maybe the user has another version that takes priority over the system one?
<burgestrand> Hm, hadn’t thought of that.
<burgestrand> I guess that’s possible, I’ll ask him. :d
<burgestrand> Mon_Ouie: awesome, thanks, this is mine: https://github.com/Burgestrand/hallon-openal/blob/master/ext/hallon/extconf.rb
<Mon_Ouie> So pretty much the same thing as far as OpenAL is concerned
<Mon_Ouie> btw I think have_library changes $LDFLAGS itself
<burgestrand> Oh, have to look out for that one
<burgestrand> Ah, yes, it might actually add -llibraryname itself
olesu has joined #ruby-lang
gabeanze1ini has joined #ruby-lang
skyjumper has quit [#ruby-lang]
fayimora has joined #ruby-lang
brianpWins has joined #ruby-lang
RORgasm has joined #ruby-lang
morozovm_ has joined #ruby-lang
jmfcool has joined #ruby-lang
qpingu has joined #ruby-lang
<burgestrand> Mon_Ouie: the user had openal installed in addition to the bundled one, thanks for the tip!
butchanton has joined #ruby-lang
crudson has joined #ruby-lang
olesu has joined #ruby-lang
segy has joined #ruby-lang
morozovm_ has joined #ruby-lang
kitallis has joined #ruby-lang
gnufied has joined #ruby-lang
gnufied has joined #ruby-lang
tbuehlmann has joined #ruby-lang
Jake232 has joined #ruby-lang
<Jake232> Randomish question, but I figure somebody here probably knows. What's the opposite of a tree transversal? eg: Putting something "flat" into a tree structure
<Asher> hierarchizing?
<Jake232> I'm not even sure if that's a word, but I'll go with it
tonesfrommars has joined #ruby-lang
<drbrain> building a tree
<outoftime> Jake232: arborization
vpamulap has joined #ruby-lang
<Asher> haha
<shevy> woodcutting
<apeiros_> transmogrification
morozovm has quit [#ruby-lang]
varreli has joined #ruby-lang
morozovm has joined #ruby-lang
scampbell has joined #ruby-lang
varreli has joined #ruby-lang
ascarter has joined #ruby-lang
olesu has joined #ruby-lang
fayimora has joined #ruby-lang
workmad3 has joined #ruby-lang
<TTilus> botanization
gregf has joined #ruby-lang
mrsolo has joined #ruby-lang
chimkan_ has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
slyphon has joined #ruby-lang
<jmontross> comiditization
fayimora has joined #ruby-lang
Okasu has joined #ruby-lang
<Okasu> hello
<Okasu> can you explain the difference btween net/http in 1.8 and 1.9?
ilyam has joined #ruby-lang
<Okasu> i can't post with 1.8 because of bot detection or something
<Okasu> but with 1.9 post work fine
olesu has joined #ruby-lang
<rue> Okasu: A more precise error and reproduction might be helpful.
<rue> Though I don't remember, maybe there was a change to cookie handling or summit.
<Okasu> with 1.8 i got "<html><title>No bot</title></html><body>No published bot with.</body>"
<Okasu> with 1.9 i got full normal body
<Okasu> http://vpaste.net/jefBj script fo reproduction
ftravers has joined #ruby-lang
justinmcp has joined #ruby-lang
havenn has joined #ruby-lang
<ftravers> can someone recommend the best way to auto t s
<ftravers> ...to auto start a sinatra/thin app on ubuntu
woollyams has joined #ruby-lang
<ftravers> i've tried daemonizing it, which works fine running from the command line as a logged in user but i want it auto started (like production) by root on system startup...
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
<Okasu> rue: do you need anything else?
<Okasu> http://vpaste.net/yQ25D fixed some puns but result is same
rom has joined #ruby-lang
dejongge has joined #ruby-lang
l0st1 has joined #ruby-lang
rom has joined #ruby-lang
<rue> I'm reading. Anyways, the interpolation of ARGV is unnecessary, though the value of it might be interesting
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
<rue> Also, make sure the URI gets parsed the same
<Okasu> yes, it's parsed the same
leafac has joined #ruby-lang
jmfcool_ has joined #ruby-lang
florentg2 has joined #ruby-lang
gregmoreno has joined #ruby-lang
imperator has joined #ruby-lang
olesu has joined #ruby-lang
<whitequark> who's rubygems admin?
<imperator> drbrain
<whitequark> after a recent Debian update the SSL certificate of rubygems is no longer considered as trused
<whitequark> it was issued by COMODO
scampbell has joined #ruby-lang
<imperator> whitequark, hop into #rubygems, maybe evan or raggi or someone knows something
<whitequark> thanks
burgestrand has joined #ruby-lang
curtism has joined #ruby-lang
curtism has joined #ruby-lang
<TTilus> ftravers: http://geeknme.wordpress.com/2009/10/15/getting-started-with-upstart-in-ubuntu/ provides an example of upstart .conf
divoxx has joined #ruby-lang
rolfb has joined #ruby-lang
scampbell has joined #ruby-lang
<ftravers> Thanks TTilus I'll have a look at that...
<Defusal> it would appear that i have ghosts in my ruby
<rue> :boo
<Defusal> :(
<Defusal> seriously, i have never been so stumped
<Defusal> i rate im going to go out and drink myself into a coma
<Okasu> ruby is totaly broken >.<
<Okasu> .rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/net/http.rb:1474:in `initialize': undefined method `empty?' for #<URI::HTTP:0xb73f4ab4> (NoMethodError)
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
workmad3 has joined #ruby-lang
<rue> Okasu: I don't think there's supposed to be a URI#empty?
<rue> So that would imply that it's expecting something that DOES
<Defusal> you know, im at the stage where i can only assume my brand new dedicated server has faulty hardware
<Defusal> how can ruby code not execute as is written in the file?
<workmad3> Defusal: what sort of errors are you getting?
<Defusal> workmad3, out of no where, EPERM errors killing a pid, but i have since figured out why
<Defusal> my Process.exists? method is no longer returning a bool
<workmad3> odd
<workmad3> what does it return?
<Defusal> workmad3, even with everything in the method commented out, and just true, it still returns a random number
<Defusal> it also doesnt print out any of the puts i added
qpingu has joined #ruby-lang
<Defusal> i can cat the file over ssh
<Defusal> so i know it is synced correctly
<Okasu> rue: and what does?
<Okasu> i neeed to read http.rb to reveal the secret?
<rue> Okasu: Strings do, but did you try the escaping?
<Defusal> the only plausable reason is that some other random gem is overriding my method
<workmad3> Defusal: that would be my guess
<Defusal> but then, how come it has worked for months
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
<workmad3> Defusal: or at least, something is shadowing your method
<Defusal> well
<Defusal> if something else is overriding it, it has a bug
<Defusal> because its been in use for about a year on multiple instances of the code
<Defusal> but only last night and tonight have i experienced this issue
<Defusal> and get this
<Defusal> well actually, that must be it
<Defusal> very strange behaviour though
<workmad3> Defusal: I'm guessing it's concurrent code?
<imperator> Defusal, do you see anything with -W ?
<Defusal> workmad3, EventMachine, so no
<workmad3> Defusal: oh, just you said you were hitting Process.exists?
<Defusal> yup
<Defusal> i use Process.getpgid(pid)
<Defusal> which performs extremely well
<Defusal> i benchmarked it not long ago
<imperator> what platform?
<Defusal> linux
<Defusal> ok, thats definitely it workmad3
<Defusal> i renamed the method to does_exist? and it behaves correctly
<imperator> got a short list of gems that could be it?
<Defusal> and the EPERM error is because the pid has since been recycled, so even though it does exist, it's not the process spawned by this application
y3llow_ has joined #ruby-lang
<Defusal> that is gonna be tricky to solve
s0ber_ has joined #ruby-lang
<Defusal> im not sure of a reliable way to check if a pid is the expected process
<Defusal> imperator, its not all that short, but i can pastebin it if you like?
<imperator> sure
<Defusal> imperator, http://pastie.org/3680227
<Defusal> i have actually been able to remove quite a few gems from the old core :)
ascarter has joined #ruby-lang
havenn_ has joined #ruby-lang
<imperator> go do your gem install dir; ack for "Process.exists"
<imperator> (ack-grep)
robbyoconnor has joined #ruby-lang
robbyoconnor has joined #ruby-lang
<imperator> s/do/to
<Defusal> imperator: /usr/local/lib/ruby/gems/1.9.1/gems$ sudo ack-grep "Process.exists?"
<Defusal> nothing :|
<imperator> hm
mfournier has joined #ruby-lang
divoxx has quit ["Linkinus - http://linkinus.com"]
<imperator> try your own code base next
<imperator> (if you didn't already)
<Defusal> i did try that
<Defusal> but heres a more important issue right now
<Defusal> Process.getpgid says this pid exists, but i can't ps ax | grep it
<Defusal> how is that possible?
<Defusal> it kills the application because of a EPERM error trying to kill the pid, because it thinks its running
<imperator> well, i thought linux showed everything, but i know some platforms only show the processes you own
<Defusal> i tried sudo
<Defusal> it does not exist to root or anything
<imperator> wait, EPERM?
<imperator> one sec, let me check something
<Defusal> EPERM killing a non-existant pid
<Defusal> well, non-existant according to px ax
<Defusal> ps ax*
<Defusal> but then Process.getpgid is faulty?
<imperator> if it didn't exist, i would expect ESRCH
<Defusal> yeah
<Defusal> well
<Defusal> thats what Process.getpgid gives when it doesn't exist
<imperator> fire up irb, and try a Process.kill(0, 99999999), what does it return?
<Defusal> but Process.getpgid thinks it does exist
rock-n-rolla has joined #ruby-lang
<Defusal> -e:1:in `kill': No such process (Errno::ESRCH)
rock-n-rolla has quit [#ruby-lang]
<Defusal> $ ruby -e 'p Process.kill(0, 4652)'
<Defusal> -e:1:in `kill': Operation not permitted (Errno::EPERM)
<imperator> got sys-proctable installed?
<Defusal> this pid gives the same EPERM error, yet it doesn't appear to exist :|
<Defusal> nope
<imperator> install it if you don't mind
<imperator> if you do mind, then look under /proc for 4652
robbyoconnor has joined #ruby-lang
<slyphon> gah fuck
<slyphon> the new bundler behavior is totally fucking me
<imperator> slyphon, hello there
<slyphon> it used to just say "Oh well, can't reach your-internal-repo" now it pukes
<slyphon> imperator: oh hai!
<imperator> Defusal, any luck?
<Defusal> imperator, finally figured it out now
heftig has joined #ruby-lang
<Defusal> its a thread, not a process
<Defusal> so then my next question is, how do i test if the Process.getpgid is for a thread or a process
<imperator> well, let's go back to what your method is trying to do
<imperator> Process.exists? i mean
<Defusal> basically: (Process.getpgid(pid) and true) rescue false
<imperator> the way i was taught was to use Process.kill(0, pid) + rescue if you want to check for its existence
<Defusal> but it rescues ESRCH
<Defusal> getpgid is supposed to be a less destructive method to do it
<imperator> what does "less destructive" mean?
<Defusal> i havnt benchmarked Process.kill(0.. but it produces the same EPERM error
<Defusal> so that doesn't help anything
<imperator> which is odd, actually
<slyphon> wow, the bundler code is...
* slyphon chokes down some vomit
<slyphon> ...pragmatic
<imperator> slyphon, something that looks like it was hacked together in a weekend, and pushed into production so that users would become beta testers?
<slyphon> yyyyyyyyeah
<imperator> just a guess
<slyphon> that
<Defusal> ok then
<slyphon> "here's some code! we'll make it work, y'know...soon"
<Defusal> i guess my only choice is to assume all EPERM errors are threads
<slyphon> like everything _why ever wrote
<Defusal> of course that means it'll assume that any process owned by someone else is a thread
<Defusal> but it doesnt look like theres any other option
<imperator> Defusal, i guess my question is, how are you getting a thread id in the first place?
alexkane has joined #ruby-lang
<Defusal> imperator, reused process id
<Defusal> stale pid in a text file
<imperator> a....text file?
<slyphon> warning! race conditions!
dcorbin has joined #ruby-lang
<Defusal> simplest way to track spawned pids and kill them on startup if there was not a clean shutdown
<slyphon> er
<Defusal> i tried a few methods with pipes back when i implemented this, but no method worked correctly
<whitequark> kill -0 is a proper way to check for existence of a process
<Defusal> so i implemented this, and it has worked fine for over a year
<whitequark> there's nothing "destructive" in it
<Defusal> whitequark, getpgid works just the same
<whitequark> and `kill' should in fact has been called "sendsignal"
<imperator> whitequark, right, but why would he get EPERM errors on a thread id?
<Defusal> i'll benchmark kill -0 sometime to compare
<Defusal> whitequark, i need to test if the pid is a pid or a thread id
<imperator> i mean, if the pid doesn't exist, it should give him ESRCH
<whitequark> do you mean thread IDs on Linux?
<Defusal> imperator, to linux threads are processes too :/
<whitequark> they're like in some other namespace or something like that
<Defusal> whitequark, pid has been reused as a thread id and now causes a EPERM when trying to kill
<Defusal> so i need to tell if its a thread id or not
<imperator> whitequark, oic
<whitequark> oic?
<imperator> Oh, I see
<whitequark> ah ok
<Defusal> any ideas?
<imperator> hm
<imperator> Defusal, so, if it *is* a thread id, you still need to kill it, or just ignore it?
<whitequark> Defusal: it kills the process for me
<Defusal> imperator, ignore it and remove from the pid list
<Defusal> whitequark, the process that the thread belongs to is owned by a different user
<Defusal> but i wouldn't want to kill it either way
<Defusal> killing random processes threads would not be good at all
<imperator> begin; Process.kill(0, pid); rescue ESRCH, EPERM; # move along; else; do_stuff; end
<Defusal> i need a way to tell if its a thread or not
<Defusal> imperator, that will work in this case, but what happens when the "pid" is a thread owned by the same user
<Defusal> i need a proper solution :(
<whitequark> you couldn't kill a thread separately from a process anyway with kill
<whitequark> you'd need to use tkill syscall for that
<Defusal> i dunno about that
<Defusal> i have done it before with htop
<Defusal> when i didnt know the "processes" were threads
<whitequark> hm interesting
<Defusal> or was it kill -9
<Defusal> one of the two
robbyoconnor has joined #ruby-lang
<Defusal> ruby should have a way to test if the pid is a thread if all its methods of checking a pid return true for a thread :/
<whitequark> it shouldn't
<Defusal> then im not sure how you can do safe process management
<rue> Processes aren't threads
<Defusal> rue, they are in this case
<whitequark> ruby is not linux-specific, and posix does not mention a way to do this
<Defusal> yeah
<Defusal> ok, next best workaround...
<Defusal> whats the best way to get the process name from a pid?
<whitequark> I'm pretty sure you are doing something else wrong
<Defusal> then i can check if it is the correct process
<rue> This doesn't make any sense
<Defusal> whitequark, i already explained the entire situation to you?
<rue> If you're in a situation where your pids and thread ids are getting mixed
<Defusal> rue, old pid has been reused by a thread and now appars to be alive
<Defusal> appears*
<slyphon> anyone know if bundler with recursively follow 'git' references?
<Defusal> rue, since threads use the same ids close to the parent pid, it can easily happen
havenn has joined #ruby-lang
<Defusal> keep in mind
<imperator> slyphon, i'm scared to find out
<Defusal> i only found out yesterday for the first time that threads even have pids
futurechimp has joined #ruby-lang
<slyphon> imperator: it would provide a way around the new behavior of breaking
<slyphon> which is kind of chafing my nether parts
<slyphon> y'know
<slyphon> "down there"
<Defusal> to htop they appear the same as processes, unless you hide userland threads, which confused the hell out of me before i spoke to some experienced linux professionals
<Defusal> and i've been using linux for a long time :/
sdeobald has joined #ruby-lang
<whitequark> Defusal: I still don't understand what's the overall task you're trying to accomplish (no, "check if pid is running" is not an overall task)
Okasu has quit [#ruby-lang]
Aaaarg has joined #ruby-lang
<rue> All threads of a given process have the same PID
<Defusal> whitequark, ignoring the fact that this applications modules do a lot of process management for installing, configuring and spawning external processes... its core spawns a process which is required before any modules can be loaded and the pid of that process is stored in a text file. the pid is killed on clean shutdown, but also on startup incase on a crash
<Defusal> rue, incorrect
<Defusal> well, not completely
PsiliPharm has joined #ruby-lang
<Defusal> you are right, but threads have their own thread id too
<Defusal> which is close to the parents pid
<rue> Yes, but that's nothing to do with process handling
robbyoconnor has joined #ruby-lang
looopy has joined #ruby-lang
<rue> If you send a signal to a pid, it's not going to go look for tids, it looks for the process
Aaaarg has joined #ruby-lang
<outoftime> anyone run into an SSL_connect ECONNRESET when trying to talk to the Facebook API?
<Defusal> rue, tell that to Process.getpgid, Process.kill and kill -0
<whitequark> rue: technically threads do have distinct pids
<whitequark> rue: and when a signal is sent to any thread of a process, it is delivered to a random (sic) thread of that process
<Defusal> rue, why don't you test yourself ;)
<whitequark> according to a manpage
<rue> whitequark: Sure, any thread might end up handling a signal
<Defusal> ok, i guess the best i can do then is read /proc/<pid>/cmdline to see if the process is the one intended to be killed
<Defusal> since there does not appear to be any way to actually tell if its a thread or a read process
<Defusal> and /proc/<thread id>/cmdline returns the command line of the parent process
<Defusal> but this will work for the most part
heftig has joined #ruby-lang
melter has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
pygmael has joined #ruby-lang
<erikh> kill(0, pid) is the way to roll
<Defusal> erikh, you kinda missed the whole discussion
<Defusal> erikh, the issue is telling whether pid is a thread or a process
<rue> erikh: Bizarro world :)
<Defusal> because to kill and getpgid, the pid is alive whether its a parent process or a thread belonging to a process
<erikh> getpgid does something totally different from kill.
<erikh> it gets the process group
<erikh> which is not necessarily the pid you're after
<erikh> rue: totally.
<Defusal> erikh, getpgid does a good job of testing if the pid exists or not, i havn't benchmarked kill -0, but getpgid performs extremely well
<Defusal> erikh, but either way, both can't tell if its really a thread id, or a process id
<erikh> dude
<erikh> they're syscalls
<erikh> you don't need to benchmark them, especially under ruby.
H2H has joined #ruby-lang
<erikh> getpgid also doesn't test the pid
<erikh> it tests the process group
<erikh> go read manpages.
robbyoconnor has joined #ruby-lang
<imperator> slyphon, there's powders and such for that
<slyphon> haha
<Defusal> erikh
<Defusal> getpgid takes a pid
<erikh> yes
<Defusal> i have been using it to test process existance for a long time
<erikh> GO READ THE FUCKING MANUAL.
<Defusal> it is recommended over kill -0 in many places
<Defusal> wtf?
<imperator> let's settle down
<Defusal> are you on crack?
<Defusal> theres nothing at all wrong with using getpgid to check a pids existance
<bougyman> is this all on linux?
<wmoxam> loldrama
<Defusal> its no better or worse than kill -0
<imperator> bougyman, yeah
<bougyman> wtf, then
<bougyman> /proc/PID
<Defusal> bougyman, theres nothing wrong with Process.getpgid(pid) or Process.kill(0, pid) for existance checking, but you still don't know if the "pid" is a process or a thread id
robbyoconnor has joined #ruby-lang
<bougyman> Defusal: you do if you check /proc
<bougyman> which is why I wtf-ed
<imperator> sys-proctable wraps it, so: require 'sys/proctable'; if Sys::ProcTable.ps(pid); do_stuff; else; do_nothing; end
<Defusal> bougyman, ok then where exactly must i check in /proc/pid/...
<imperator> there won't be an entry under /proc if it's a thread id
<bougyman> imperator just gave you a rubyish way to do so.
<imperator> afaik
<bougyman> there won't, imperator
futurechimp has joined #ruby-lang
<rue> Because it's a THREAD :D
<Defusal> i'll have to benchmark proctable, but i guess if it uses /proc it shouldn't be too bad
<Defusal> imperator, bougyman: wrong
<bougyman> benchmarking system calls?
<slyphon> wow
<bougyman> what do you mean: wrong?
<imperator> yep, on linux it's just reading /proc (and maybe getting some info from other /proc dirs)
<slyphon> ding-dong
<Defusal> ok, two answers:
<Defusal> benchmarking, because i plan on polling many pids at least twice a second forever
<Defusal> because there is no way to watch a detached pid without a netlink implementation
<Defusal> and i can cat /proc/<thread id>/cmdline and it will show me the parent processes command line
<bougyman> a detached pid is a misbehaving process.
<Defusal> so that does not test if its a real process
<Defusal> bougyman, detached intentionally, with a lot of effort, from the spawning daemon
thone_ has joined #ruby-lang
<bougyman> /proc/PID, not /proc/thread id
<bougyman> stat /proc/$$
<Defusal> cat: /proc/PID: No such file or directory
<Defusal> theres no such thing
<bougyman> i meant, replace with a PID, sir.
<bougyman> like $$ for your current one.
* drbrain palms face
<Defusal> bougyman
<Defusal> you are really not following are you?
<Defusal> i will paste you an example, so we are on the same page
<bougyman> i'm not the one who looked for /proc/PID.
<imperator> let's wait for the example
<Defusal> bougyman, because that is the only thing that made sense
<imperator> i would think these detached pids would be zombies
<Defusal> beacuse you did not listen to me
<Defusal> because*
<bougyman> you have a list of pids and want to see if they're running, right?
<bougyman> so, other than how gross that is, you just need to see if the directory exists of that PID in /proc/
<imperator> hm....if you try to kill a zombie (process), what happens? would it give you EPERM?
<Defusal> $ kill -0 4652 # 4652 is a *thread* id
<Defusal> bash: kill: (4652) - Operation not permitted
<Defusal> $ ps ax | grep 4652 => 7694 pts/8 S+ 0:00 grep --color=auto 4652
<Defusal> $ cat /proc/4652/cmdline => ./parent_process_command
<bougyman> if you awnt to find more data about it, it exists inside that /proc/1234 (for PID 1234) dir.
<Defusal> there you go, if you want more proof, do your own damn testing
<Defusal> -.-
io_syl has joined #ruby-lang
<Defusal> imperator, what kind of zombie process?
<Defusal> a defunct process just ignores even kill signals until its parent dies
<imperator> right, but i'm not sure what ruby does
<Defusal> bougyman, you should really not just assume stuff and ignore what people say :(
<Defusal> imperator, well this is really not related to this issue at least
<Defusal> i solved all my defunct process issues last week
<Defusal> truely detaching a spawned process from ruby is not very easy, the only way is to spawn a proxy ruby process which catches signals, detaches from the child, prints the real processes id to stdout and then exits
divoxx has joined #ruby-lang
<bougyman> which kernel are you running?
robbyoconnor has joined #ruby-lang
<bougyman> just checked on 3.3, there are no /proc/thread dirs.
<Defusal> anyway, i guess using the /proc/<id>/cmdline to check if the process is at least similar to what is expected is the best way to be safe
<bougyman> there is no such thing, accd to the manpage.
<bougyman> can you show me how you got a thread id in /proc/ ?
<Defusal> 2.6.32-29-server
S2kx has joined #ruby-lang
<bougyman> see man proc on that.
<Defusal> err wait
<Defusal> that is not the right version
<bougyman> eevry dir in /proc/ that's numeric is a PID.
<Defusal> i used the wrong ssh window :P
<Defusal> 3.0.0-16-server
<bougyman> yeah, even on 3.3
<Defusal> bougyman, as i said
<Defusal> i can simply cat the id
<Defusal> bougyman, you realize threads have their own "pid"
<bougyman> 03/27-16:19 < Defusal> bougyman, you should really not just assume stuff and ignore what people say :(
<Defusal> htop shows them unless you hide userland threads
<bougyman> i was trying not to assume, but I can't find anything about it in my manpages.
<rue> Threads do NOT have process IDs.
<bougyman> Defusal: inside each pid is a num_threads.
<bougyman> THOSE are the threads of the process.
<Defusal> bougyman, well, where does htop get the pids of threads from
<Defusal> and how come i can cat them from /proc?
<Defusal> :P
<bougyman> Defusal: you're mistaking something for threads that aren't threads, but this is getting silly.
<Defusal> bougyman, sigh.
<rue> If you ask a thread for its pid (i.e. getpid()), it'll give you the PID of the process to which the thread belongs
<bougyman> i'm driving home, feel free to research (with man proc)
<Defusal> no comment
<Defusal> i have given you all the evidence i have
<rue> XY
S1kx has joined #ruby-lang
<Defusal> if you still don't believe me, then good luck when you one day come across such an issue
<Defusal> but as i said, fire up htop, show and color userland threads, and copy one of their ids
<Defusal> then cat /proc/id/cmdline
<Defusal> if it doesn't work for you, something in newer kernels has changed
<Defusal> but chances are if 3.0.0 does it, other do to
<Defusal> too*
<Defusal> either way, im out for the night, cheers
<rue> Alright, well, I'm just going to invite you to reassess your situation. Threads are not processes, and they're in no way interchangeable.
<Defusal> rue: you sir, are wrong.
<rue> I don't typically use the term, but whatever.
<Defusal> i made it very clear that these ids show in htop as userland threads, give a EPERM error when you try kill -0 them from a different user, and do not show in ps ax at all, ever
<Defusal> if you are so sure they are not threads, please for the love of god tell me what they are
<Defusal> but until you can do that, you are wrong
* Defusal out.
<rue> I'd be more inclined to think that htop is busted.
<rue> Or, you know, you're interpreting it wrong.
burgestrand1 has joined #ruby-lang
dan00 has joined #ruby-lang
S2kx has joined #ruby-lang
<erikh> are you on freebsd?
pygmael has joined #ruby-lang
<erikh> oh nevermind. I don't even want to talk about this.
publicvoid__ has joined #ruby-lang
<imperator> yes, let us discuss other things
florentg2 has joined #ruby-lang
<imperator> happy things....as if bob ross were writing code....happy little ruby code....in pthalo blue
<imperator> no bugs, just happy accidents
<rue> Happy little hashes over here
<Defusal> rue, erikh and bougyman -- i apologise my edgyness today.. i am rather heavily sleep deprived at the moment
<rue> Sleep would probably help.
<Defusal> long story, but i get little sleep as is because of my hectic schedule and insane workload
<Defusal> but i ran out of my prescription med over the weekend, and underestimated the effect of the full dose after a few days break
pygmael has joined #ruby-lang
<Defusal> so on top of my sleep deprevation, i have had insomnia for a little more than 24 hours
<imperator> coding on little sleep == bad idea
<Defusal> luckily the drug negates almost all fatigue, so cognition is ok.. but edgyness remains :P
<Defusal> yeah, if it were not for the drug, i would not be productive at all imperator
<imperator> or writing code for too long; i quit at 10 hours - i'm counterproductive after that
<Defusal> i have gotten a lot done today though
<Defusal> on a normal day with my current schedule, i work from 8am till 11pm
<erikh> I take breaks throughout the day
<imperator> i can't work that long
<Defusal> with a few brief breaks for snacking and lunch
<imperator> that's not really very healthy
<erikh> ^
<Defusal> but i have virtually no fatigue
<Defusal> that will change in a few hours time though
<Defusal> indeed it is not
<Defusal> but with my current workload, i have little choice
<imperator> i'd refuse to work at that place if that was a regular occurrence
<Defusal> i have had to put all my courses on hold and will have to catch up and complete them late
<Defusal> because i have to somehow finish this platform before the end of the month
<Defusal> imperator, yeah well, in life, sh*t happens
<Defusal> sometimes stuff just has very bad timing
wallerdev has joined #ruby-lang
Karmaon has joined #ruby-lang
WillMarshall has joined #ruby-lang
wallerdev has joined #ruby-lang
wallerdev has joined #ruby-lang
brushbox has joined #ruby-lang
fayimora has joined #ruby-lang
postmodern has joined #ruby-lang
nacengineer has joined #ruby-lang
ascarter has joined #ruby-lang
singpolyma has joined #ruby-lang
havenn has joined #ruby-lang
rue has joined #ruby-lang
RickHull has joined #ruby-lang
<RickHull> ged, having a hard time finding pg docs from https://bitbucket.org/ged/ruby-pg/wiki/Home
<RickHull> also, i think my shared host has issues. require 'rubygems'; require 'pg'; PG.methods #=> uninitialized constant PG (NameError)
<ged> RickHull: Ah, yeah. http://deveiate.org/code/pg/
<ged> RickHull: But it should be linked from the project page.
<RickHull> also, i just enabled JS so maybe links were hidden
<ged> No, I mean that I haven't linked to them yet, but I should.
<ged> :P
slyphon has joined #ruby-lang
<RickHull> ah, righto. thanks. unitialized constant PG is def. an issue for me though, right?
<RickHull> i put in a support ticket
<RickHull> to my host, i mean ;)
<RickHull> i do have Object::PGError
IPGlider has joined #ruby-lang
<RickHull> maybe it's not hooked into the underlying postgres lib correctly?
<RickHull> i know this is not "your" issue, just trying to make sure i inform joyent correctly
wyhaines has joined #ruby-lang
<ged> RickHull: The older API had three toplevel constants: PGconn, PGresult, and PGError.
<ged> RickHull: I recently put everything into a PG namespace with backward-compatibility aliases.
<ged> So if you're running pg < 0.13.0, it's PGconn and PGresult.
<ged> And I've added links to the API docs and the sample/ directory to the overview page. Thanks for pointing that out.
<imperator> RickHull, dbi!
<ged> imperator: :P
<imperator> although....probably won't work with pg any more if pg changed, now that i think about it
jkyle_ has joined #ruby-lang
<ged> imperator: It should, and I'd consider it a bug if it doesn't.
<jkyle_> how do I get help for a method/class in the repl?
<imperator> ged, well, i believe in using an abstract interface when possible, which is usually
<ged> jkyle: Which repl?
<jkyle> irb or pry
<RickHull> imperator: i have used ruby dbi in the past. erikh has worked on it
<ged> imperator: Me too. I use Sequel way more than 'pg' directly.
<RickHull> and he recommended pg ;)
<imperator> oh, hah
<RickHull> ged: the gem is 0.10.0
<ged> RickHull: Yeah, so you'll need to use PGconn.
<RickHull> ok, rereading, got it
<imperator> just saw that erikh was using sequel and was getting frustrated with it; i encouraged him to revive rdbi
<RickHull> checking
<RickHull> cool, works
<ged> Method API is mostly the same minus a few newer methods, though. PG::Connection -> PGconn.
mikeric has joined #ruby-lang
deryl has joined #ruby-lang
<ged> jkyle: For method docs in 'pry', you can do: show-doc <method>
<jkyle> ah, there's not a built in method? like help(foo_obj)
<ged> jkyle: No.
<jkyle> ged: that would explain my inability to find it hehe. thanks!
rue has joined #ruby-lang
<ged> imperator: Oh, interesting. I absolutely love Sequel. It's one of my favorite Ruby libraries.
<imperator> i haven't tried it; i've either been using AR or DBI
<rue> Hrm. Flaky net
<ged> imperator: Did he post something about his frustrations?
<imperator> tweeted a brief note
<imperator> erikh, comments?
<ged> Ah, okay.
<jkyle> doesn't seme to work for classes. So is ruby-doc is where everyone goes for documentation?
ilyam_ has joined #ruby-lang
<RickHull> imperator: regarding dbi type stuff. unless you anticipate actually switching, it seems like a bad tradeoff. you are handicapped from using db-specific features
<injekt> I use ri more than online documentation
<RickHull> and if you accidentally manage to use db-specific features, switching off may not be so straightforward
<ged> I use 'gem server' for in-browser docs.
<jkyle> ri Array
<jkyle> Nothing known about Array
<injekt> so generate it
uniqanomaly_ has joined #ruby-lang
<deryl> injekt: i got verbally looked at like iw as nuts for preferring ri over gem server or the online docs.
<slyphon> i think i'm gonna get an extra cpu core put in just for jruby startups
<injekt> deryl: I'm with you, bro
<slyphon> THE FIVE CORE INTEL! <monkey-grunt>
<ged> Hahaha, "verbally looked at"?
* deryl plays slyphonfreeswitch's Screaming Monkeys
<imperator> slyphon, what are you trying to say?
<slyphon> hah
<injekt> ged: like.. when I say I'm looking at you
<injekt> .. or something
<RickHull> is there no way to treat the JVM like a normal machine? i mean, a normal machine has to boot and stuff. but once its up, any number of resident programs can use the machine "instantly"
<deryl> ged: hehe only way i could put it :)
<slyphon> imperator: oh, i'm just bellyaching
<injekt> :D
* slyphon hugs jruby
<slyphon> jruby, i wish i could quit you
<corsican> haha
* corsican pictures slyphon and jruby having gay sex in a tent
<ged> deryl: Synaesthetic! :P
<slyphon> oh ffs
<slyphon> corsican: i'd hit it
<corsican> me too
<corsican> actually I admit I don't understand jruby
<slyphon> Gemfile.lock records your *sources
<deryl> lol
<slyphon> *
<slyphon> that SUCKS
<corsican> that's basically a ruby interpreter that runs in java?
<slyphon> GAH
<slyphon> it's a ruby interpreter that runs on top of the JVM, and is AWESOME
<corsican> oh cool
<deryl> initial startup time sucks, but after that its pretty decent
<slyphon> it's the most performant ruby in some benchmarks, has grown-up GC, multiple threads for real
<slyphon> yeah
<slyphon> it's great for servers
<imperator> so, uh, spin up a jruby machine in drb/rinda and use that? is that possible?
<slyphon> nah
<injekt> it's amazing for long running processes, as is the jvm in general
<corsican> nice :)
<corsican> thanks
<slyphon> there's nailgun
<corsican> I will have to look into it
<slyphon> but i never figured out how to use it
<slyphon> i'm just horseshittin' though, the startup time only really sucks when it comes to specs
<slyphon> god *dammit*
<slyphon> why does Gemfile.lock record your sources?
<slyphon> that's so goddamn stupid
<slyphon> grrrrrrr!!!!
<ged> I think I still have some leftover distrust of 'ri' from back when it went through a period of bitrot.
<slyphon> yeah
<ged> I should get over it, though. It's pretty good nowadays.
<slyphon> i got it to work for a while, then it sucked pretty bad
<drbrain> ged: I fixed many of the things
* slyphon waves to drbrain
<ged> drbrain: Yes, I know! Many thanks!
<ged> Like I said, I should get back into the habit of using it.
<drbrain> I committed markdown support to rdoc recently
<slyphon> woah, nice
<ged> Heh, I saw.
<drbrain> … it needs battle testing still
<RickHull> i am a markdown True Believer
<RickHull> markdown all the things!
<ged> With a new parser, right?
<slyphon> programming is not religion
<drbrain> it's a port of peg-markdown
<slyphon> i'm still waiting for matz to sell out
<slyphon> AND THEN YOU'LL ALL SEE!!
<RickHull> good thing neither markdown nor markup are programming
* slyphon adusts his tinfoil hat
<drbrain> oddly, the README and ruby is not in any particular text markup format
<slyphon> RickHull: code is data! data is code! the lamb lies down with the lion!
<ged> Ah, right. I saw the .kpeg files.
<imperator> death to markdown!
<slyphon> hah!
<RickHull> the files are *IN* the computer
<slyphon> :D
<drbrain> I half expected it to be in rdtool format, but it likely predates even rd (let alone rd2)
<ged> imperator: Hehe.
<ged> Long live rd2!
<ged> Hehe.
<imperator> you know what works as a pretty good markup language?
<imperator> HTML THAT'S WHAT
<deryl> something i think *might* be nice is something like pinfo for ri. pinfo did colorized links to related info pages, made traversal to those pages easy, and was definitely a better info.
<ged> LateX?
<slyphon> imperator: eh
<drbrain> HTrollML
<RickHull> XHTML is the new hotness, i heard
<ged> Errr... LaTeX>
<mahlon> imperator: Oh, whew. I thought you were going to say 'nroff'.
<imperator> ged, yes, well, if i'm typesetting, sure
<slyphon> i find html to be pretty tiring
<deryl> doubt ri would go that direction, but for info vs. pinfo, pinfo definitely won
<drbrain> deryl: see rdoc-browser
<drbrain> (on github)
<slyphon> i had a friend-of-the-family that used to call them 'hotmail' files
<deryl> will do
<slyphon> that still makes me chuckle
<RickHull> ha
<imperator> slyphon, having to figure out how to get markdown et al to do things i can easily do in plain html is very tiring
<drbrain> … I already wrote it as a proof of concept
<slyphon> imperator: agreed
<RickHull> aitch-titty-pee
<slyphon> hahahah
<ged> There was an HTML editor for a while called "HoTmeTaL". Still makes me chuckle.
<mahlon> HoTMaiL. Not coincidence.
<slyphon> i'm such a dunce when it comes to HTML, i find if markdown can't do it, i probably didn't need it anyway
<drbrain> "huh-tup" for "HTTP" (courtesy zenspider)
<slyphon> dunce is probably the wrong word, i'm completely apathetic
postmodern has joined #ruby-lang
<RickHull> markdown nails the 80/20 pretty well for documents
<drbrain> or maybe "hut-tup"
<slyphon> yeah
<slyphon> we need an 'uh-duh' protocol
<slyphon> uddh or something
<ged> And so many markdown converters to choose from! *snerk*
<slyphon> oh gawd
<slyphon> yeah, seems like YARD is always picking a different one
<slyphon> AND NOT INSTALLING IT
* slyphon shakes his fist
<slyphon> "If you want to parse markdown..."
<slyphon> no, i'd rather just have you bitch at me
<slyphon> ok, bbl
* ged giggles.
Joeysomo has joined #ruby-lang
<musl> My new daemon 'cloudmemd' speaks TNHP (the new hottnes protocol)!
Joeysomo has joined #ruby-lang
<drbrain> I had to write a new one because there wasn't one that was BSD/MIT license, maintainable and could produce a syntax tree ☹
imperator has quit ["Leaving"]
<drbrain> well, port
<deryl> drbrain: ok, so i'll wait for 2.0 to be released :)
<injekt> lol
<drbrain> deryl: if I have enough spare time I'll finish keyboard navigation in rdoc-browser and release a curses-newpad for non-ruby-2.0 users
<drbrain> with ruby 2.0 only a year away, I don't know if I'll have that spare time, though
<deryl> doh!
postmodern has joined #ruby-lang
ilyam has joined #ruby-lang
<deryl> actually suprised that this even exists. my info/pinfo idea just came off the top of my head thinking off the cuff about what other doc viewers i liked for console users.
<deryl> nice to see something along that vein
<drbrain> I wrote it as an experiment in curses
<deryl> got ya
<drbrain> lack of complete support for modifier keys was a very annoying discovery
<drbrain> so if/when I release it I'll probably get many complaints over the "clumsy" keyboard commands
<deryl> hehe usually the way. get the blame for things not really your failing.
<Defusal> i hope ruby is optimized for ARM at some stage
<Defusal> that will be great
<drbrain> Defusal: like mruby?
<Defusal> yeah
<Defusal> i didn't even know about mruby until recently
ascarter has joined #ruby-lang
chimkan has joined #ruby-lang
<Defusal> but apparently MRIs performance on ARM is not even as good as 1.8 on x86
fayimora has joined #ruby-lang
<Defusal> with the ability to run standard linux distros on inexpensive ARM based hardware, it would be awesome to be able to use ruby
<deryl> linux ARM-based router, using nginx+unicorn+rails+ruby1.9.x for the interface? or a ruby based control infrastructure accessed via ssh? :)
<Defusal> oh there are almost unlimited use cases :P
senj has joined #ruby-lang
<deryl> Defusal: yep. friend of mine bought a usb stick looking thing thats basically a little system. miniHDMI on one end, usb on the other. slightly bigger than a U3 thumbdrive but not by much at all. probably based on something like this.
<deryl> never saw it hooked up to anything but he says its pretty much a little system. the hdmi output, usb for attaching a keyboard (he says he's using a usb hub to attach both a keyboard and mouse), has like an 8GB flash built into it. haven't seen it work, but if its tue, damn!
<Defusal> you can do a lot with ruby and a $35 micro pc that can play blueray videos and quake 3, has usb and ethernet and an array of General Perpose IO pins
<lianj> if the rpi was actually available ;)
<Defusal> it got delayed again due to an issue with the ethernet, but it'll be available eventually :P
<drbrain> I found it appalling that my old G4 PowerMac could play 720p video but not a 320x240 youtube stream
<deryl> Defusal: nice :)
<drbrain> was it really that hard for flash to use the video hardware?
<Defusal> still a lot sooner than MRI being optimized for ARM :P
<jmontross> so you can get ruby on that little raspberrypi ?
<lianj> sure
<deryl> i'd spend the 35 bucks to play with that
<Defusal> jmontross, if ubuntu, redhat and gentoo are already supported for it by the company producing it, why not
<Defusal> it may be easier to optimize rubinius for ARM though, since its core is small
wyhaines has joined #ruby-lang
<rue> drbrain: Yes, flash is just ludicrous.
Joeysomo_ has joined #ruby-lang
mdel has joined #ruby-lang
Joeysomo has joined #ruby-lang
tomzx has joined #ruby-lang