<adam_>
Has anyone got pango to work with RMagick?
adam_ is now known as adamIsAdam
<adamIsAdam>
I need to do text formatting with rmagick, and since RVG doesn't support line wrapping, that's no good.
dous has quit [Ping timeout: 246 seconds]
dc5ala has joined #ruby-lang
deryl has quit [Quit: deryl]
deryl has joined #ruby-lang
kain has joined #ruby-lang
dous has joined #ruby-lang
chimkan has quit [Quit: chimkan]
ryanf has quit [Quit: leaving]
krz has joined #ruby-lang
ryanf has joined #ruby-lang
nofxx has quit [Ping timeout: 272 seconds]
FluffyCode has quit [Remote host closed the connection]
cantonic has quit [Read error: Connection reset by peer]
rizzy has quit [Ping timeout: 255 seconds]
cantonic has joined #ruby-lang
dfr|mac has quit [Remote host closed the connection]
lcdhoffman has joined #ruby-lang
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
dc5ala has quit [Ping timeout: 246 seconds]
coryf has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
banisterfiend has quit [Remote host closed the connection]
bendrix415 has joined #ruby-lang
dc5ala has joined #ruby-lang
savage- has joined #ruby-lang
<bendrix415>
i have a simple alert, if val > crit
<bendrix415>
then alert, i would like to check val a few more times as the val may change over a minute
<bendrix415>
what is the best way to accomplish with out multiple if's
rizzy has joined #ruby-lang
dous has quit [Remote host closed the connection]
bglusma__ has quit [Remote host closed the connection]
bglusman has joined #ruby-lang
bglusman has quit [Remote host closed the connection]
brunocoelho has joined #ruby-lang
cantonic has quit [Quit: cantonic]
banisterfiend has joined #ruby-lang
w0lverine has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
ryanf has quit [Quit: leaving]
coryf has quit [Remote host closed the connection]
snorkdude has joined #ruby-lang
w0lverine has quit [Quit: w0lverine]
seanstickle has quit [Quit: seanstickle]
brunocoelho has quit [Remote host closed the connection]
rizzy has quit [Quit: Leaving]
chimkan_ has joined #ruby-lang
vertroa has quit [Ping timeout: 246 seconds]
dous has joined #ruby-lang
savage- has quit [Remote host closed the connection]
dous has quit [Ping timeout: 250 seconds]
<rking>
adamIsAdam: Worst-case is you call inkscape to render it out for you.
fgomez has quit [Ping timeout: 246 seconds]
postmodern has quit [Quit: Leaving]
<banisterfiend>
rking: oh hello, didnt see oyu there
<rking>
Yeah it's me.
snorkdude has quit [Remote host closed the connection]
fgomez has joined #ruby-lang
chimkan_ has quit [Quit: chimkan_]
savage- has joined #ruby-lang
dhruvasagar has joined #ruby-lang
arooni-mobile has joined #ruby-lang
spuk has quit [Ping timeout: 240 seconds]
rodj has joined #ruby-lang
spuk has joined #ruby-lang
mac_br has joined #ruby-lang
mac_br has quit [Client Quit]
mac_br has joined #ruby-lang
ryanf has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
mac_br has quit [Client Quit]
gregmore_ has joined #ruby-lang
gregmoreno has quit [Read error: Operation timed out]
mac_br has joined #ruby-lang
hinbody has joined #ruby-lang
snorkdude has joined #ruby-lang
banisterfiend has joined #ruby-lang
sevvie has quit [Quit: sevvie]
snorkdude has quit [Remote host closed the connection]
mark06 has joined #ruby-lang
tjadc has quit [Remote host closed the connection]
savage- has quit [Remote host closed the connection]
bryancp has joined #ruby-lang
towski has joined #ruby-lang
w0lverine has joined #ruby-lang
dous has joined #ruby-lang
dous has quit [Changing host]
dous has joined #ruby-lang
<adamIsAdam>
rking: thanks, i think i'm going to use the caption: functionality of rmagick.
<rking>
adamIsAdam: Cool.
dous has quit [Ping timeout: 246 seconds]
Asher has quit [Quit: Leaving.]
mark06 has left #ruby-lang [#ruby-lang]
rodj has quit [Quit: rodj]
ramonmaruko has quit [Quit: Leaving.]
ramonmaruko has joined #ruby-lang
dfr|mac has joined #ruby-lang
burgestrand has joined #ruby-lang
mac_br has left #ruby-lang [#ruby-lang]
postmodern has joined #ruby-lang
w0lverine has quit [Quit: w0lverine]
bytephilia has joined #ruby-lang
urbanmonk has joined #ruby-lang
dhruvasagar has quit [Quit: leaving]
dhruvasagar has joined #ruby-lang
gnufied has joined #ruby-lang
bryancp has quit [Remote host closed the connection]
deryldoucette has joined #ruby-lang
hramrach has quit [Remote host closed the connection]
w0lverine has joined #ruby-lang
r0bby has joined #ruby-lang
deryl has quit [Ping timeout: 244 seconds]
deryldoucette is now known as deryl
robbyoconnor has quit [Ping timeout: 244 seconds]
neocoin has joined #ruby-lang
Dreamer3 has quit [Quit: Leaving...]
Dreamer3 has joined #ruby-lang
burgestrand has quit [Quit: Leaving.]
wallerdev has joined #ruby-lang
savage- has joined #ruby-lang
yxhuvud has joined #ruby-lang
dous has joined #ruby-lang
dous has quit [Changing host]
dous has joined #ruby-lang
deryl has quit [Quit: deryl]
countdigi has quit [Ping timeout: 246 seconds]
fgomez has quit [Quit: leaving]
dous has quit [Ping timeout: 246 seconds]
ChadStud1uffin has quit [Ping timeout: 244 seconds]
countdigi has joined #ruby-lang
bytephilia has quit [Remote host closed the connection]
havenn has joined #ruby-lang
gokul has joined #ruby-lang
gokul has quit [Client Quit]
iMichael has joined #ruby-lang
gokul has joined #ruby-lang
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby-lang
burgestrand has joined #ruby-lang
dfr|mac has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
gnufied has quit [Quit: Leaving.]
gnufied has joined #ruby-lang
jtoy has joined #ruby-lang
sailias has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
|Vargas| has joined #ruby-lang
sailias has quit [Client Quit]
savage- has quit [Remote host closed the connection]
gnufied has joined #ruby-lang
dous has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 272 seconds]
bendrix415 has quit [Quit: ChatZilla 0.9.88.2 [Firefox 12.0/20120424093957]]
dous has quit [Ping timeout: 246 seconds]
RickHull has left #ruby-lang [#ruby-lang]
apeiros_ has quit [Remote host closed the connection]
urbanmonk has quit [Quit: Bye!]
whatasunnyday has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
postmodern has quit [Quit: Leaving]
iMichael has quit [Quit: Page closed]
havenn has quit [Remote host closed the connection]
towski has quit [Remote host closed the connection]
<certainty>
moin
andrewhl has quit [Remote host closed the connection]
andrewhl has joined #ruby-lang
andrewhl has quit [Read error: Connection reset by peer]
fgomez has joined #ruby-lang
chancancode has joined #ruby-lang
<banisterfiend>
certainty: do you think it's appropriate to greet the channel in german when english is the lingua franca and german is a dying, medieval language?
<chancancode>
Can someone explain to me why anonymous classes don't "inherit" constants from their superclass?
<drbrain>
chancancode: constant scoping doesn't work that way
cha1tanya has joined #ruby-lang
<drbrain>
chancancode: … why the class_eval?
<chancancode>
Oh it's Eric :D
<drbrain>
chancancode: … Class.new accepts a block
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
<chancancode>
drbriain: Yeah my original version is w/o the class_eval, but since that doesn't work, I tried it with class_eval
<chancancode>
This is what I wanted to do. When I'm using MiniTest::Unit, I can define a constant on MT::U::TestCase and it'd be available to all my tests w/o polluting the global namespace.
jtoy has quit [Quit: jtoy]
<chancancode>
But I couldn't figure out a way to do the same thing for the Spec syntax.
JohnBat26 has joined #ruby-lang
<drbrain>
chancancode: I'm not sure how to work around the block constant lookup issue
<certainty>
banisterfiend: i certainly will stop it if you guys find it inapropriate. It's just a habbit. I use to hang around at other english channels, where i do the same. Oh and as an aside. I don't think german is dying ;p
<banisterfiend>
certainty: im just trolling ;)
<certainty>
banisterfiend: oh, sorry. I'm not good at getting such things via irc. I'm much better at it when i actually see faces :)
<drbrain>
chancancode: banisterfiend often doesn't think before he types ☹
<drbrain>
oops, certainty ^^
<burgestrand>
chancancode: perhaps you could use const_missing to allow the lookup to go through
ttilley has quit [Ping timeout: 246 seconds]
<burgestrand>
Naw, it’s in the wrong scope. Bugger.
<chancancode>
burgestrand: How would that work? (Do I define that in Kernel or something, and check if self < MiniTest::Spec?)
<burgestrand>
Yeah, it’d be a bit hacky. :p
<burgestrand>
If it would even work at all.
<burgestrand>
Meh.
<chancancode>
Hmm. Or maybe I could just define constant_missing on MiniTest::Spec?
arooni-mobile has quit [Ping timeout: 246 seconds]
<burgestrand>
chancancode: it needs to be defined on the object you try to retrieve the constant from I’m afraid.
<chancancode>
So the conclusion is, there's pretty much no trivial way to make this work because of how blocks are scoped, correct?
dous has quit [Ping timeout: 246 seconds]
<samuelkadolph>
Make it a method
<samuelkadolph>
Who cares if it isn't an actual const?
<samuelkadolph>
And if it must be all caps, you can do SOME_CONST()
havenn has joined #ruby-lang
<chancancode>
oh :D
<chancancode>
Good enough! Thanks!
rutkla has joined #ruby-lang
ryanf has quit [Quit: leaving]
u_u has quit [Ping timeout: 240 seconds]
kain has quit [Ping timeout: 272 seconds]
solars has joined #ruby-lang
kain has joined #ruby-lang
jasiek has quit [Remote host closed the connection]
zmack has joined #ruby-lang
rue has quit [Remote host closed the connection]
kitallis has joined #ruby-lang
slaytanic has quit [Read error: Connection reset by peer]
slaytanic has joined #ruby-lang
burgestrand has quit [Quit: Leaving.]
burgestrand has joined #ruby-lang
workmad3 has quit [Ping timeout: 246 seconds]
u_u has joined #ruby-lang
guns has joined #ruby-lang
guns is now known as Guest29788
Guest29788 has quit [Client Quit]
tomb_ has quit [Quit: Computer has gone to sleep.]
tomb_ has joined #ruby-lang
WillMarshall has joined #ruby-lang
rolfb has joined #ruby-lang
Dreamer3 has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby-lang
Dreamer3 has joined #ruby-lang
Wardrop has joined #ruby-lang
Wardrop has quit [Client Quit]
Wardrop has joined #ruby-lang
Wardrop has left #ruby-lang [#ruby-lang]
shevy has joined #ruby-lang
Wardrop has joined #ruby-lang
havenn has quit [Remote host closed the connection]
<Wardrop>
I've got a bit of a problem at the moment with converting arbitrary ruby structures to json, namely, NaN float values. There doesn't seem to exist in the ruby JSON library (in stdlib), any means of converting NaN values to something such as nil or 0.
<Wardrop>
Leaving them as NaN causes the JSON library to throw an exception, as NaN literals are not valid JSON.
<Wardrop>
The JSON library does have an option to leave ignore NaN values, except then NaN literals get sent to the client where they're invalid - it just moves the problem to the client.
igotnolegs has quit [Quit: Computer has gone to sleep.]
<Wardrop>
Does anyone know how I might be able to convert these NaN values to something such as zero or nil either before the JSON library hits it, or somehow through the JSON library?
<Wardrop>
It's absolutely got me pissed this problem as it's caused me to be called into work while on holidays.
<burgestrand>
Wardrop: could you provide an example of a ruby value you cannot encode to JSON containing one of these NaN values?
<Wardrop>
[0.0/0].to_json
<burgestrand>
Ah, there we go, managed to make a NaN. Turns out the old "NaN".to_f did not work anymore.
<Wardrop>
Make sure you: require 'json'
<Wardrop>
I'd preferably like to monkey patch the JSON library
<burgestrand>
Aye, tricky problem.
<Wardrop>
Otherwise, the last resort would be to pre-process the data I plan to convert to JSON; though that'll require all kinds of recursion and will be relatively fragile if some more exotic object comes along.
<Wardrop>
The NaN's are coming as a result of the EXIFR library; a library used for extracting EXIF information from TIFF's and JPEG's, though I suppose this highlights the fragility of the JSON library in stdlib.
slaytanic has quit [Read error: Connection reset by peer]
neocoin has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 246 seconds]
publicvoid has quit [Remote host closed the connection]
<Wardrop>
ok, looks like if I monkey-patch the to_json method on Float, that may solve the problem.
dhruvasagar has joined #ruby-lang
<burgestrand>
Yeah, I tried that, it was ignored.
slaytanic has joined #ruby-lang
<burgestrand>
If it works for you by all means do.
mk03 has quit [Remote host closed the connection]
dous has joined #ruby-lang
dous has quit [Changing host]
dous has joined #ruby-lang
zmack has quit [Remote host closed the connection]
<burgestrand>
Hm.
<burgestrand>
Wardrop: I have a solution, but I don’t think you’ll be able to use to_json but that’s probably acceptable.
<Wardrop>
I did mention that earlier. You may have missed it: "The JSON library does have an option to leave ignore NaN values, except then NaN literals get sent to the client where they're invalid - it just moves the problem to the client."
dous has quit [Ping timeout: 264 seconds]
<Wardrop>
Thanks none the less though
<burgestrand>
Turns out generate even takes a hash. Heh.
Hakon has joined #ruby-lang
WillMarshall has quit [Quit: Computer has gone to sleep.]
* burgestrand
shrugs
cdt has joined #ruby-lang
tjadc has joined #ruby-lang
srbartlett has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby-lang
kitallis has quit [Ping timeout: 244 seconds]
FastJack_ has left #ruby-lang [#ruby-lang]
NeVeR_ has joined #ruby-lang
adamIsAdam has quit [Quit: adamIsAdam]
Z33K|Lux has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby-lang
whatasunnyday has quit [Quit: Leaving]
Hakon has quit [Quit: Leaving...]
dominikh has quit [Remote host closed the connection]
dominikh has joined #ruby-lang
toretore has joined #ruby-lang
judofyr has joined #ruby-lang
heftig has quit [Ping timeout: 248 seconds]
s1n4 has joined #ruby-lang
* s1n4
is confused
<s1n4>
which on is the official channel ? #ruby or #ruby-lang ?
<certainty>
there is an official channel?
zmack has joined #ruby-lang
<bnagy>
this is the official one, fwiw
r0bby is now known as robbyoconnor
<s1n4>
and #ruby ?
<s1n4>
is it official too ?
<bnagy>
no, because this is the official one :)
<certainty>
heh
<bnagy>
there is one official channel. It is this one.
<s1n4>
hmm
s1n4 has left #ruby-lang ["leaving"]
<certainty>
lol
Rizzle has quit [Read error: Connection reset by peer]
<bnagy>
not official is not the same as 'illegal' or 'filled with pederasts' or whatever
Rizzle has joined #ruby-lang
neocoin has joined #ruby-lang
Rizzle has quit [Read error: Connection reset by peer]
future_chimp has joined #ruby-lang
Hakon has joined #ruby-lang
Rizzle has joined #ruby-lang
Rizzle has quit [Read error: Connection reset by peer]
dous has joined #ruby-lang
dous has joined #ruby-lang
Rizzle has joined #ruby-lang
Rizzle has quit [Read error: Connection reset by peer]
dous has quit [Ping timeout: 244 seconds]
me has joined #ruby-lang
me is now known as Guest70188
Guest70188 has left #ruby-lang [#ruby-lang]
Rizzle has joined #ruby-lang
Guest70188 has joined #ruby-lang
Guest70188 has left #ruby-lang [#ruby-lang]
Rizzle has quit [Read error: Connection reset by peer]
Rizzle has joined #ruby-lang
fgomez has quit [Remote host closed the connection]
Rizzle has quit [Read error: Connection reset by peer]
vesan has quit [Read error: Connection reset by peer]
Rizzle has joined #ruby-lang
Rizzle has quit [Read error: Connection reset by peer]
tomb_ has left #ruby-lang [#ruby-lang]
Rizzle has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 244 seconds]
Rizzle has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby-lang
Rizzle has joined #ruby-lang
vesan has joined #ruby-lang
Rizzle has quit [Read error: Connection reset by peer]
gokul has quit [Ping timeout: 240 seconds]
Rizzle has joined #ruby-lang
mssola has joined #ruby-lang
Rizzle has quit [Read error: Connection reset by peer]
<yorickpeterse>
Thread.join will merely state that the app should wait for the thread to finish executing before terminating the script
<yorickpeterse>
If you want to ensure thread safety there's two ways of doing it: 1. don't use threads 2. use a mutex
<yorickpeterse>
Also, your indentation is horrible
* certainty
likes 1
<rue>
yorickpeterse: 2. is kind of ambiguous :P
dhruvasagar has quit [Ping timeout: 246 seconds]
<rue>
yorickpeterse: Also, #join is not before terminating the script
<rue>
It’s a blocking call
dhruvasagar has joined #ruby-lang
<rue>
The #join call you see at the end of a program is just to ensure that the threads finish. Otherwise, they are killed when the main thread exits
<yorickpeterse>
Hm, you're correct
<yorickpeterse>
Either way, I'd say it's a bad way to ensure only one thread runs
<seoaqua>
yorickpeterse, really? maybe i tested in a wrong way
dhruvasagar has quit [Ping timeout: 264 seconds]
dhruvasagar has joined #ruby-lang
<seoaqua>
rue, by my testing .join will make threads run in a line(single-threaded)
<seoaqua>
rue, i need to re-test it now :)
<rue>
It’s pointless to make threads if you don’t intend them to run in parallel
<rue>
Fibers might be more appropriate for such a use case
<seoaqua>
what if i have a huge queue of tasks and need to run 100 threads at the same time
<rue>
You can use a thread pool
<seoaqua>
now i put the threads into an Array and foreach to see if anyone is dead ,clear it and put in the new task
<rue>
Although besides that, I’m not sure what #join has to do with it?
<workmad3>
yorickpeterse: there's more than those 2 ways to ensure thread safety... you could use a semaphore instead of a mutex, you can avoid shared mutable data...
sepp2k has joined #ruby-lang
<seoaqua>
that's tow different questions:)
<seoaqua>
i dont know how to controll the ThreadPool. it's a gem ,right?
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
<seoaqua>
there is no way to know how many threads have been finished, so i dont know when to insert new ones
<bnagy>
you might want to look at Parallel (gem)
<bnagy>
or something, it does all that stuff for you
vesan has quit [Read error: Connection reset by peer]
Axsuul has quit [Ping timeout: 272 seconds]
carloslopes has joined #ruby-lang
nofxx has quit [Ping timeout: 244 seconds]
lcdhoffman has joined #ruby-lang
virunga is now known as papagno
Fullmoon has joined #ruby-lang
Fullmoon has quit [Client Quit]
papagno is now known as saette
saette is now known as saetta
vesan has joined #ruby-lang
saetta is now known as papagno
jbsan has joined #ruby-lang
papagno is now known as virunga
NeVeR_ has quit [Ping timeout: 246 seconds]
rutkla has joined #ruby-lang
s1n4 has quit [Quit: peace out]
lcdhoffman has quit [Quit: lcdhoffman]
rutkla_ has quit [Ping timeout: 240 seconds]
lcdhoffman has joined #ruby-lang
lcdhoffman has quit [Client Quit]
bytephilia has joined #ruby-lang
cha1tanya has quit [Ping timeout: 246 seconds]
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
kitallis has joined #ruby-lang
kitallis has quit [Client Quit]
sevvie has joined #ruby-lang
nofxx has quit [Ping timeout: 244 seconds]
havenn has joined #ruby-lang
tommyvyo has joined #ruby-lang
neocoin has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby-lang
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
srbartlett has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby-lang
melter has quit [Read error: Connection reset by peer]
lcdhoffman has joined #ruby-lang
gnufied has joined #ruby-lang
melter has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 264 seconds]
dhruvasagar has joined #ruby-lang
nofxx has quit [Ping timeout: 240 seconds]
jbsan has quit [Quit: jbsan]
Michagogo has joined #ruby-lang
dv310p3r has joined #ruby-lang
hynkle has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
dous has quit [Remote host closed the connection]
<Michagogo>
Why is there a #ruby and a #ruby-lang?
nofxx has joined #ruby-lang
dous has joined #ruby-lang
GeekOnCoffee has joined #ruby-lang
mwjcomputing2 has joined #ruby-lang
benwoody has joined #ruby-lang
adambeynon has joined #ruby-lang
<judofyr>
because #ruby-lang is BEST!!1!!1
rcassidy has joined #ruby-lang
<workmad3>
Michagogo: politics
Michagogo has quit [Remote host closed the connection]
bytephilia has quit [Quit: Computer has gone to sleep.]
<whitequark>
btw, parallel gem is awesome
Hanmac has joined #ruby-lang
chiel has joined #ruby-lang
Michagogo has joined #ruby-lang
<whitequark>
if you only need map/reduce, then you can have fast implementations for both mri and jruby for fre
<whitequark>
*free
<whitequark>
that's how I figured out that on my workload, mri is faster than jruby :)
<Hanmac>
whitequark "mri is faster then jruby" do you mean the default methods like map or inject/reduce or do you mean the pure ruby code?
<Muz>
Or do you mean the time taking to spawn up instances of the interpreter?
<Muz>
*taken
akamike has joined #ruby-lang
<whitequark>
neither. I have a workload which is basically very heavy on allocation, GC and CPU
<whitequark>
in fact it can be used as a RAM test
<whitequark>
basically I load a lot of data and then do the heavy processing on it
* Hanmac
likes mri more because he makes c++ gems for ruby
<whitequark>
in MRI case, I fork and then collect the results. in JRuby case, I create the equivalent number of threads and then collect the results.
jbsan has joined #ruby-lang
<whitequark>
and what I see is that basically MRI is marginally faster than any version of JRuby
<whitequark>
I have tried increasing heap size for JRuby, but that didn't change much.
outoftime has joined #ruby-lang
nofxx has quit [Ping timeout: 244 seconds]
rolfb has quit [Quit: Leaving...]
<workmad3>
whitequark: is that because your runs are short so you're seeing a high impact from jruby's startup time?
<whitequark>
workmad3: is 100s short?
<whitequark>
I've been bothering with parallel at all because it's fucking slow
<whitequark>
(without parallel, that'd be 400s on my i7 with 4 physical cores)
<workmad3>
whitequark: jruby startup time can be 3%-5% of that, in my (very limited) experience :)
<whitequark>
by the way, hyperthreading is worthless.
Michagogo has left #ruby-lang [#ruby-lang]
<whitequark>
going from 4 cores to 8 cores doesn't give any increase in performance; it indeed gives a slight decrease due to overhead.
<whitequark>
parallel gem is awesome because it includes a cross-platform method to determine amount of physical cores.
dhruvasagar has quit [Ping timeout: 246 seconds]
<Hanmac>
i cant wait for a mruby benchmark
<whitequark>
like if it's something actually interesting.
srbartlett has joined #ruby-lang
<whitequark>
I'm absolutely sure that the only way you could get Ruby to run fast enough to be actually usable in embedded is to do whole-program analysis
<whitequark>
not some funky bytecode-to-C translation, which, while allows for some optimizations by a decent compiler (i.e. not gcc), is still very naive
<whitequark>
and mruby isn't suited for whole-program analysis at all
<whitequark>
and I'm currently working full-time on implementing that.
<yorickpeterse>
whitequark: Please, get a custom theme for that blog :)
<yorickpeterse>
It's *everywherE*
<yorickpeterse>
s/E/e
havenn has quit [Remote host closed the connection]
<yorickpeterse>
Other than that I like how you're actually going into detail, it's hard to find proper technical blags these days
nofxx has quit [Ping timeout: 246 seconds]
valeri_ufo has quit [Read error: Connection reset by peer]
valeri_ufo has joined #ruby-lang
<whitequark>
yorickpeterse: it's just an overview :)
<whitequark>
and you can expect a very in-depth series of articles on writing decompilers for interpreted languages
<whitequark>
based on what I've did for furnace-avm2
<yorickpeterse>
neat
<Muz>
[6~[6~[6~[6~[6~[6~[6~aa [6~[6~
<yorickpeterse>
Is furnace more general purpose or aimed at Ruby?
<yorickpeterse>
Because if the latter it means I have competition :)
<Muz>
Whoops.
<whitequark>
yorickpeterse: Furnace is a framework which provides common stuff like AST, CFG and relevant algorithms
<whitequark>
Furnace for AVM2 is an implementation which is targeted at AVM2, but everything except AVM2-specific stages is pretty generic
<yorickpeterse>
Ah
<yorickpeterse>
Well, my stuff is Ruby specific so that's fine :)
<whitequark>
i.e. my DICM transformation, SSA optimizer and CFG reducer (basically the same stuff Emscripten uses to recreate loops) are ISA-independent
<whitequark>
[DICM stands for Dataflow Invariant Code Motion. I kind of (re)invented it. It's mostly useful for "fixing" obfuscated code.]
Hanmac has joined #ruby-lang
stephendavis89 has joined #ruby-lang
<yorickpeterse>
So how exactly would one use Furnace, I take it they have to write some sort of declaration of the syntax and what not?
<whitequark>
Furnace only works with ASTs
<whitequark>
you have to write your own parser for whatever format you have
<whitequark>
there's also Foundry, i.e my Ruby implementation I'm working on.
sailias has joined #ruby-lang
<whitequark>
I aim to write a proper and as complete as it is possible [targets can place restrictions of different severity] implementation of Ruby for usage in compile-time, and a backend infrastructure flexible enough to be able to codegen both JavaScript and LLVM
<whitequark>
JS is a significantly easier target, and it'll be a nice intermediate step
retro|cz has joined #ruby-lang
jxie has joined #ruby-lang
andrewhl has joined #ruby-lang
<judofyr>
whitequark: I have a YARV-to-JS at github.com/judofyr/rubyscript
JohnBat26 has quit [Ping timeout: 244 seconds]
gnufied has joined #ruby-lang
<rue>
Is there a best practice for setup/teardown or transacting the DB for tests for mongoid?
<whitequark>
yorickpeterse: I use Melbourne from Rubinius
<judofyr>
whitequark: lookups (methods, constants) in my version uses plain JS lookups though (with a prototype-chain), so it should be faster
<judofyr>
you've actually ported the C code
<judofyr>
woah
stephendavis89 has quit [Ping timeout: 245 seconds]
<yorickpeterse>
whitequark: I strictly decided not to use Rubinius as it makes it harder to use the tool. The beauty of YARV is that it's installed on almost, if not every, Ruby dev's machine
<yorickpeterse>
plus Ripper comes with YARV so it means no (at least for now) external deps
<whitequark>
yorickpeterse: rvm 1.9.3 do gem install melbourne
<whitequark>
judofyr: lookups through prototype chain are indeed more fast and less correct.
<yorickpeterse>
whitequark: oh? Hm, interesting
<yorickpeterse>
Hmpf, last gem release was in 2010
<judofyr>
whitequark: "less correct"? in what sense? I believe I implemented lookup correctly (although I need a loop to handle modules)
<whitequark>
judofyr: hmmm, now that's interesting
<yorickpeterse>
meh, my own parser is getting pretty complete so switching would be a waste
<whitequark>
judofyr: I'm pretty sure you don't. I was writing not a "Ruby-like" implementation but a completely compatible one to MRI
<whitequark>
there are way too many Ruby-like languages already, nobody needs another one
<whitequark>
Mirah, whatever
<whitequark>
toys
<rue>
Do too
<judofyr>
whitequark: I was aiming for full-ruby too. (although I never finished it)
Avishek12 has joined #ruby-lang
<whitequark>
*shrug* coldruby was completed in two weeks or so, intermittenly
<whitequark>
it's not that hard
<yorickpeterse>
whitequark: Ripper
<judofyr>
whitequark: I know. but it still takes time :)
<whitequark>
yorickpeterse: ahh, so you're the Ripper author
<yorickpeterse>
it basically converts Ripper's sexp output into a collection of token classes that can carry a bit more information
<yorickpeterse>
No
<yorickpeterse>
I didn't write Ripper, I'm just using it
<yorickpeterse>
If I wrote Ripper I would've at least documented it more properly :)
<yorickpeterse>
Though I intend to fix that once I have the time to send a PR
<judofyr>
whitequark: Mirah has a completely different goal though
<whitequark>
so, what do you do with its output?
<judofyr>
whitequark: it's a Java-alternative, not a Ruby-alternative
<whitequark>
judofyr: indeed
snorkdude has quit [Remote host closed the connection]
<yorickpeterse>
whitequark: was that re: me?
sailias has quit [Quit: Leaving.]
erichmenge has joined #ruby-lang
<whitequark>
yorickpeterse: yep
<seoaqua>
i was afk
<rue>
It’s numberwang!
<whitequark>
what
<seoaqua>
but the op told me matz has the administrator previledge of this channel
<yorickpeterse>
whitequark: Well, the Sexp output Ripper generates isn't very useful in its own. It's a pain to write code such as `args[0][2][0]` just to get the line number. On top of that the format can differ quite a bit depending on the context.
<yorickpeterse>
What I'm doing is converting this output to an array of custom token classes, each containing it's own data such as the line number, method name, etc
<whitequark>
yorickpeterse: the sexp format looks like that for a reason.
dfr|mac has joined #ruby-lang
<yorickpeterse>
Once the parser is solid enough (right now I'm having some trouble with *args for example) I'll be moving on to the actual analysis part
<whitequark>
it's very generic and its generic-ness is incredibly useful if you want to write transformations
<yorickpeterse>
True
<whitequark>
I have solved the exact same problem like this in Furnace:
<yorickpeterse>
I should probably push the code to Github somewhere this week, that way I can have other Rubyists yell at me :)
<whitequark>
there's an AST::Node class which has type (sexps without an explicit types, i.e. just lists, are arrays), children, and metadata.
<whitequark>
children are whatever you want them to be. there are no restrictions whatsoever
<yorickpeterse>
atm I have a bunch of special purpose token classes (e.g. ClassToken) but I feel I may have too many
<whitequark>
and data like line numbers or barriers or whatever is added to the metadata hash
<yorickpeterse>
Not a huge fan of an accessor/reader named `metadata` or `extra` though
<whitequark>
it's a tradeoff between flexibility and usability.
<whitequark>
yeah neither am I, but this is the case when it's perfectly applicable
<whitequark>
if I have a getlocal somewhere and I want to replace it, I don't care whether it was a + token or a class one
Hakon has quit [Quit: Leaving...]
<whitequark>
I just want to replace the subtree and that's it
andrewhl has quit [Remote host closed the connection]
<yorickpeterse>
Well, I don't have a separate class for *every* item
andrewhl has joined #ruby-lang
Mchl has joined #ruby-lang
<whitequark>
basically the only thing you need is a Visitor where for each node there'll be a function which will explicitly visit every subtree, as opposed to non-subtree data
<whitequark>
even it is not mandatory, but the old code I had with send magic wasn't clean at all
<whitequark>
so I decided to rewrite it in a stricter way
burgestrand has quit [Quit: Leaving.]
tonni has quit [Remote host closed the connection]
coryf has joined #ruby-lang
<whitequark>
actually I stole the visitor idea from UglifyJS, where it has landed from Common Lisp
Avishek12 has quit [Ping timeout: 260 seconds]
<judofyr>
I think I have a Ripper-to-RubyParser somewhere
snorkdude has joined #ruby-lang
<whitequark>
well, I could maybe sometimes use the Ripper parser
dfr|mac has quit [*.net *.split]
nofxx has quit [*.net *.split]
wmoxam_ has quit [*.net *.split]
gnufied has quit [*.net *.split]
jbsan has quit [*.net *.split]
x0F has quit [*.net *.split]
just4dos has quit [*.net *.split]
virunga has quit [*.net *.split]
Wardrop has quit [*.net *.split]
ramonmaruko has quit [*.net *.split]
vertroa_ has quit [*.net *.split]
naquad has quit [*.net *.split]
VGoff has quit [*.net *.split]
setmeaway has quit [*.net *.split]
kirin` has quit [*.net *.split]
t0h_ has quit [*.net *.split]
Skif has quit [*.net *.split]
ReinH has quit [*.net *.split]
thorncp has quit [*.net *.split]
mahlon has quit [*.net *.split]
ged has quit [*.net *.split]
SubSpawn has quit [*.net *.split]
anacond109 has quit [*.net *.split]
<whitequark>
but I actually may have a need to marshal the AST sometimes, and for that case, my own format is the best choice
andrewhl has quit [Ping timeout: 246 seconds]
<whitequark>
at least due to compatibility reasons
<whitequark>
yorickpeterse: may I recommend you a book?
<whitequark>
worth every cent and every minute spent
|Vargas| has quit [Quit: ...]
<yorickpeterse>
If you could take a look at my shitty code somewhere this week and yell at me that would be lovely :)
<whitequark>
sure
<whitequark>
I hang out on #r-l most of the time, and I'm in UTC+3
<whitequark>
or maybe +4, dunno
<whitequark>
something like that
<yorickpeterse>
Ah, UTC+2 here
Avishek12 is now known as 92AABBCCG
ged has joined #ruby-lang
kirin` has joined #ruby-lang
dfr|mac has joined #ruby-lang
nofxx has joined #ruby-lang
gnufied has joined #ruby-lang
jbsan has joined #ruby-lang
wmoxam_ has joined #ruby-lang
x0F has joined #ruby-lang
just4dos has joined #ruby-lang
ramonmaruko has joined #ruby-lang
virunga has joined #ruby-lang
vertroa_ has joined #ruby-lang
Wardrop has joined #ruby-lang
VGoff has joined #ruby-lang
naquad has joined #ruby-lang
setmeaway has joined #ruby-lang
t0h_ has joined #ruby-lang
Skif has joined #ruby-lang
ReinH has joined #ruby-lang
thorncp has joined #ruby-lang
mahlon has joined #ruby-lang
SubSpawn has joined #ruby-lang
anacond109 has joined #ruby-lang
rutkla has quit [Excess Flood]
kirin` has quit [Max SendQ exceeded]
ged is now known as Guest42577
judofyr has quit [Remote host closed the connection]
kirin` has joined #ruby-lang
zmack has quit [Remote host closed the connection]
wmoxam_ has quit [Read error: Connection reset by peer]
bfreeman has quit [Quit: bfreeman]
deryl has joined #ruby-lang
<solars>
hey, I've got some content that apparently is utf-8, and post it through net-http. somehow with special characters it seems to hang forever. does anyone know something about this problem with ruby 1.9?
snorkdude has quit [Remote host closed the connection]
<solars>
the xml (bottom of the gist) is sent to the server through that method
itsmeduncan has joined #ruby-lang
tonni has joined #ruby-lang
deryl has quit [Quit: deryl]
enebo has joined #ruby-lang
andrewhl has joined #ruby-lang
<yorickpeterse>
Does it work with regular ASCII text?
<rue>
s/where it fails/where I assume it fails/
<yorickpeterse>
I have a feeling it might be the SSL part instead of the encoding
KillerFox has quit [Ping timeout: 265 seconds]
<solars>
yes it works with regular ascii
<solars>
I think the problem is this 3/4 character there
<solars>
but I don't really know how to encode this for xml
nofxx has quit [Ping timeout: 240 seconds]
<solars>
such that ü is ü for example (xml entities)
deryl has joined #ruby-lang
KillerFox has joined #ruby-lang
<yorickpeterse>
Assuming the data can be converted to UTF8 you can do so using `some_string.encode('utf-8')`
<solars>
let me try that
<yorickpeterse>
Though as far as I'm aware Net::HTTP doesn't give a rat's ass about your encoding and just sends it along the wire as it's told
<solars>
yeah thats why I get the timeout I think..
shevy has quit [Ping timeout: 246 seconds]
<workmad3>
solars: net::http isn't responsible for XML encoding
<workmad3>
solars: you should use an XML library for that :P
<workmad3>
solars: XML escaping even :)
<solars>
yeah sure, I already gsub'ed the u umlaut as above - but I have no idea what kind of methods/lib do this kind of encoding as it doesn't look like html entities
slux_ has joined #ruby-lang
brunocoelho has joined #ruby-lang
<workmad3>
solars: well, what created the XML you're sending?
<solars>
I don't know, but I'd send them to mars immediately
<workmad3>
solars: because it should probably be some form of XML library, like nokogiri :)
<solars>
it comes out of a huge java buggy java app :)
<yorickpeterse>
oh boy, that sounds fun
<solars>
I've already turned into hulk today..
<workmad3>
solars: you could also try setting the content-type more appropriately
<workmad3>
solars: e.g. to 'text/xml; charset=utf-8'
<solars>
does anyone know a rest helper lib? I think there was one called rest... something, which provides a bit more abstraction on top of nethttp - maybe it does better encoding
jrbing has left #ruby-lang [#ruby-lang]
<solars>
workmad3, I will try that as well
<workmad3>
solars: rest-client maybe? or just httparty (not a rest client specifically, but a nicer layer on top of plain net/http)
<solars>
ah rest client could be, yeah
<solars>
I will try both
<solars>
maybe it works :)
apeiros_ has joined #ruby-lang
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
dfr|mac has quit [Remote host closed the connection]
shevy has joined #ruby-lang
coryf has quit [Remote host closed the connection]
carloslopes has quit [Quit: Leaving.]
jbsan has quit [Quit: jbsan]
jtoy has joined #ruby-lang
cantonic has joined #ruby-lang
jbsan has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
chimkan_ has joined #ruby-lang
<cantonic>
Hi jarib - hope you can help me. I am using watir-webdriver with headless gem. My development machine is a mac and since I upgraded to mountain lion i get "Xvfb not found on your system". Do you have a clue how to work around that? I don't want to turn headless off since the production machine is ubuntu with xvfb
savage- has joined #ruby-lang
akira989 has joined #ruby-lang
nofxx has quit [Ping timeout: 246 seconds]
chimkan___ has joined #ruby-lang
dhruvasagar has joined #ruby-lang
chimkan_ has quit [Ping timeout: 250 seconds]
chimkan___ has quit [Client Quit]
arooni-mobile has joined #ruby-lang
zmack has joined #ruby-lang
jaeckel has joined #ruby-lang
jaeckel has left #ruby-lang [#ruby-lang]
<workmad3>
cantonic: didn't they remove x11 (and probably by extension xvfb) in mountain lion?
chimkan has joined #ruby-lang
jbsan has quit [Quit: jbsan]
<cantonic>
workmad3: phew… i dunno :(
chimkan has quit [Client Quit]
<cantonic>
yeah, maybe i have to upgrade x11
<workmad3>
cantonic: probably worth investigating... I remember reading something about it, but I'm still on snow leopard :)
<cirenyc>
What is the best way to use that mapping to create a new hash from an existing hash.
<cirenyc>
Given that the keys in CC_FIELDS_STORED should be the keys of the new hash and the values are pulled from the old hash using the values in CC_FIELDS_STORED?
benanne has joined #ruby-lang
nofxx has quit [Ping timeout: 272 seconds]
publicvoid has joined #ruby-lang
coryf has joined #ruby-lang
Cidiomar has quit [Quit: Cidiomar]
dv310p3r has quit [Ping timeout: 264 seconds]
qwerxy has quit [Read error: Operation timed out]
coryf_ has joined #ruby-lang
Carnage\ has joined #ruby-lang
coryf has quit [Ping timeout: 250 seconds]
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
coryf has joined #ruby-lang
coryf has quit [Read error: Connection reset by peer]
burgestrand has joined #ruby-lang
coryf_ has quit [Read error: No route to host]
havenn has quit [Remote host closed the connection]
coryf has joined #ruby-lang
<apeiros_>
cirenyc: what approach have you tried so far?
<apeiros_>
also, I understand your source hash looks like {name: "…", :address_line1: "…", …} and your resulting hash should look like {name: "…", address_street_1: "…", …} - is that correct?
adam___ has left #ruby-lang [#ruby-lang]
<apeiros_>
cirenyc: yeah, that looks sane
burgestrand has quit [Ping timeout: 244 seconds]
<apeiros_>
is customer.active_card a plain hash?
<cirenyc>
It's an object that responds to string keys and dot notation
<apeiros_>
then your original problem description isn't quite correct :-p
<apeiros_>
no values_at I suppose?
<apeiros_>
anyway, if this code doesn't have performance issues, I'd leave it as is
akira989 has quit [Remote host closed the connection]
<apeiros_>
alternatives would be to use values_at (if available) + zip + Hash::[], or map + Hash::[]
lsegal has joined #ruby-lang
benjamin-patch has joined #ruby-lang
coryf has quit [Ping timeout: 264 seconds]
akira989 has joined #ruby-lang
<cirenyc>
apeiros_: okay, going to leave as is, but I goofed somewhere. I'm getting wrong values in the new hash with that code.
<apeiros_>
should not be due to the code you just pasted
<apeiros_>
at least I see nothing wrong with that piece
coryf has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
naz has joined #ruby-lang
slux_ has quit [Remote host closed the connection]
rutkla has joined #ruby-lang
w0lverine has quit [Quit: w0lverine]
rockpapergoat has joined #ruby-lang
havenn has joined #ruby-lang
fgomez has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
<cirenyc>
apeiros_: yeah, not sure why yet, but I'm getting back the CC_FIELD values (the symbol, not the actual value)